Skip to content

fix(memfs): resolve relative streams from virtual cwd#1271

Open
xianjianlf2 wants to merge 1 commit into
streamich:masterfrom
xianjianlf2:fix/create-write-stream-relative-900
Open

fix(memfs): resolve relative streams from virtual cwd#1271
xianjianlf2 wants to merge 1 commit into
streamich:masterfrom
xianjianlf2:fix/create-write-stream-relative-900

Conversation

@xianjianlf2

Copy link
Copy Markdown

Summary

  • resolve Superblock relative paths against the volume's process-like cwd instead of the host process cwd
  • give the default memfs export and memfs() helper a virtual-root cwd by default
  • add regression coverage for relative createWriteStream paths on memfs() and the default fs export

Fixes #900.

Tests

  • yarn build
  • yarn jest packages/memfs/src/tests/memfs.process.test.ts --runInBand
  • yarn jest packages/fs-node/src/tests/volume.process.test.ts --runInBand
  • yarn prettier --check packages/fs-core/src/Superblock.ts packages/fs-node/src/tests/volume.process.test.ts packages/memfs/src/tests/memfs.process.test.ts packages/memfs/src/index.ts
  • node runtime check for default fs.createWriteStream('relative') and memfs().fs.createWriteStream('relative')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using createWriteStream does not work as intended

1 participant