Skip to content

feat: derive in-memory layer from another FileSystem - #5

Merged
Lucas-Bur merged 4 commits into
mainfrom
feat/derive-memfs-from-filesystem
Jul 15, 2026
Merged

Lucas-Bur merged 4 commits into
mainfrom
feat/derive-memfs-from-filesystem

Conversation

@Lucas-Bur

Copy link
Copy Markdown
Owner

Summary

  • add layerFromPath to snapshot a real FileSystem tree into memfs
  • preserve files, directories, symlinks, modes, ownership, and timestamps
  • support remapping through mountAt and extend cross-validation coverage

Verification

  • pnpm test:run (207 tests passed)

Lucas-Bur added 4 commits July 4, 2026 00:40
Adds \layerFromPath\ and \makeVolFromFileSystem\ which walk a source
directory through any caller-provided Effect-TS FileSystem (Node, Bun,
custom) and replicate the tree into a fresh memfs Volume. Files, empty
directories, symlinks, mode bits, owner, and access/modification times
are all preserved. Source can be remapped via \mountAt\.

\
eadDirectory\ is reshaped to mirror \
ode:fs/promises.readdir\
semantics exactly: relative paths with forward-slash separators, with
intermediate directories included under recursive mode.

Also adds a \playground/\ workspace, renames the cross-validation
suite to the \.test.ts\ convention, and wires it up to vitest.

TODO(1:1-parity): every operation in this module must remain
behaviorally identical to NodeFileSystem. Enforced by the cross-
validation suite in test/file-system-suite.test.ts. Documented in
README under Roadmap and pinned via a marker comment in src/index.ts.
@Lucas-Bur
Lucas-Bur merged commit f5acef5 into main Jul 15, 2026
1 check passed
@Lucas-Bur
Lucas-Bur deleted the feat/derive-memfs-from-filesystem branch July 15, 2026 01:31
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.52941% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/helpers/volume.ts 97.84% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

2 participants