Skip to content

Commit e5de604

Browse files
authored
fix(fslib): correct the FileHandle implementation (#3889)
* fix(fslib): map `FileHandle` functions to their fd counterpart * fix: `FileHandle.write` * refactor: avoid needing tslib update * test: `FileHandle.read` * test: `FileHandle.readFile` * test: `FileHandle.appendFile` * fix: `FileHandle.writeFile` * refactor: use symbols for internals * fix: ref counter * fix: throw when when using a closed FileHandle * fix: handle passing `FileHandle` to `fs.promises` functions * fix: `FileHandle.writev` * fix: `FileHandle.truncate` * fix: `FileHandle.chmod` * chore: versions * chore: changelog * chore: install
1 parent 548f953 commit e5de604

File tree

9 files changed

+990
-145
lines changed

9 files changed

+990
-145
lines changed

.pnp.cjs

Lines changed: 339 additions & 106 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarn/versions/7f506ae4.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
releases:
2+
"@yarnpkg/cli": patch
3+
"@yarnpkg/fslib": patch
4+
"@yarnpkg/plugin-pnp": patch
5+
"@yarnpkg/pnp": patch
6+
7+
declined:
8+
- "@yarnpkg/esbuild-plugin-pnp"
9+
- "@yarnpkg/plugin-compat"
10+
- "@yarnpkg/plugin-constraints"
11+
- "@yarnpkg/plugin-dlx"
12+
- "@yarnpkg/plugin-essentials"
13+
- "@yarnpkg/plugin-exec"
14+
- "@yarnpkg/plugin-file"
15+
- "@yarnpkg/plugin-git"
16+
- "@yarnpkg/plugin-github"
17+
- "@yarnpkg/plugin-init"
18+
- "@yarnpkg/plugin-interactive-tools"
19+
- "@yarnpkg/plugin-link"
20+
- "@yarnpkg/plugin-nm"
21+
- "@yarnpkg/plugin-npm"
22+
- "@yarnpkg/plugin-npm-cli"
23+
- "@yarnpkg/plugin-pack"
24+
- "@yarnpkg/plugin-patch"
25+
- "@yarnpkg/plugin-pnpm"
26+
- "@yarnpkg/plugin-stage"
27+
- "@yarnpkg/plugin-typescript"
28+
- "@yarnpkg/plugin-version"
29+
- "@yarnpkg/plugin-workspace-tools"
30+
- vscode-zipfs
31+
- "@yarnpkg/builder"
32+
- "@yarnpkg/core"
33+
- "@yarnpkg/doctor"
34+
- "@yarnpkg/json-proxy"
35+
- "@yarnpkg/nm"
36+
- "@yarnpkg/pnpify"
37+
- "@yarnpkg/sdks"
38+
- "@yarnpkg/shell"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ The following changes only affect people writing Yarn plugins:
5959
- The patched filesystem now supports `ftruncate`.
6060
- The patched filesystem now supports `fchmod`.
6161
- The patched filesystem now supports `throwIfNoEntry`.
62+
- The PnP filesystem now handles most of the FileHandle methods
6263
- Updates the PnP compatibility layer for TypeScript 4.8 Beta
6364
- The `npm_package_json` environment variable is now set by Yarn.
6465

packages/yarnpkg-core/sources/worker-zip/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/yarnpkg-fslib/sources/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export {VirtualFS} from './VirtualFS';
4747
export {ZipFS} from './ZipFS';
4848
export {ZipOpenFS} from './ZipOpenFS';
4949

50-
export {patchFs, extendFs} from './patchFs';
50+
export {patchFs, extendFs} from './patchFs/patchFs';
5151

5252
export {xfs} from './xfs';
5353
export type {XFS} from './xfs';

0 commit comments

Comments
 (0)