Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fs): Fixes the Zip magic fd bits #4737

Merged
merged 5 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
80 changes: 59 additions & 21 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
37 changes: 37 additions & 0 deletions .yarn/versions/70c62085.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
releases:
"@yarnpkg/builder": patch
"@yarnpkg/cli": patch
"@yarnpkg/fslib": patch
"@yarnpkg/pnp": patch

declined:
- "@yarnpkg/esbuild-plugin-pnp"
arcanis marked this conversation as resolved.
Show resolved Hide resolved
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-exec"
- "@yarnpkg/plugin-file"
- "@yarnpkg/plugin-git"
- "@yarnpkg/plugin-github"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-link"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- vscode-zipfs
- "@yarnpkg/core"
- "@yarnpkg/doctor"
- "@yarnpkg/nm"
- "@yarnpkg/pnpify"
- "@yarnpkg/sdks"
- "@yarnpkg/shell"
2 changes: 1 addition & 1 deletion packages/yarnpkg-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@yarnpkg/fslib": "workspace:^",
"chalk": "^3.0.0",
"clipanion": "^3.2.0-rc.10",
"esbuild": "npm:esbuild-wasm@^0.11.20",
"esbuild": "npm:esbuild-wasm@^0.15.1",
"semver": "^7.1.2",
"tslib": "^2.4.0"
},
Expand Down
23 changes: 13 additions & 10 deletions packages/yarnpkg-fslib/sources/ZipFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1432,19 +1432,22 @@ export class ZipFS extends BasePortableFakeFS {
return this.getFileSource(entry, opts);
}

async readdirPromise(p: PortablePath): Promise<Array<Filename>>;
async readdirPromise(p: PortablePath, opts: {withFileTypes: false} | null): Promise<Array<Filename>>;
async readdirPromise(p: PortablePath, opts: {withFileTypes: true}): Promise<Array<statUtils.DirEntry>>;
async readdirPromise(p: PortablePath, opts: {withFileTypes: boolean}): Promise<Array<Filename> | Array<statUtils.DirEntry>>;
async readdirPromise(p: PortablePath, opts?: {withFileTypes?: boolean} | null): Promise<Array<string> | Array<statUtils.DirEntry>> {
async readdirPromise(p: FSPath<PortablePath>): Promise<Array<Filename>>;
async readdirPromise(p: FSPath<PortablePath>, opts: {withFileTypes: false} | null): Promise<Array<Filename>>;
async readdirPromise(p: FSPath<PortablePath>, opts: {withFileTypes: true}): Promise<Array<statUtils.DirEntry>>;
async readdirPromise(p: FSPath<PortablePath>, opts: {withFileTypes: boolean}): Promise<Array<Filename> | Array<statUtils.DirEntry>>;
async readdirPromise(p: FSPath<PortablePath>, opts?: {withFileTypes?: boolean} | null): Promise<Array<string> | Array<statUtils.DirEntry>> {
return this.readdirSync(p, opts as any);
}

readdirSync(p: PortablePath): Array<Filename>;
readdirSync(p: PortablePath, opts: {withFileTypes: false} | null): Array<Filename>;
readdirSync(p: PortablePath, opts: {withFileTypes: true}): Array<statUtils.DirEntry>;
readdirSync(p: PortablePath, opts: {withFileTypes: boolean}): Array<Filename> | Array<statUtils.DirEntry>;
readdirSync(p: PortablePath, opts?: {withFileTypes?: boolean} | null): Array<string> | Array<statUtils.DirEntry> {
readdirSync(p: FSPath<PortablePath>): Array<Filename>;
readdirSync(p: FSPath<PortablePath>, opts: {withFileTypes: false} | null): Array<Filename>;
readdirSync(p: FSPath<PortablePath>, opts: {withFileTypes: true}): Array<statUtils.DirEntry>;
readdirSync(p: FSPath<PortablePath>, opts: {withFileTypes: boolean}): Array<Filename> | Array<statUtils.DirEntry>;
readdirSync(p: FSPath<PortablePath>, opts?: {withFileTypes?: boolean} | null): Array<string> | Array<statUtils.DirEntry> {
if (typeof p === `number`)
p = this.fdToPath(p, `read`);

const resolvedP = this.resolveFilename(`scandir '${p}'`, p);
if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP))
throw errors.ENOENT(`scandir '${p}'`);
Expand Down