Add ZenFsAdapter for just-bash to operate on zen-fs filesystem #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR creates a
ZenFsAdapterclass that implements just-bash'sIFileSysteminterface, enabling just-bash to operate directly on a zen-fs filesystem. This allows writes made via just-bash commands to be visible from the zen-fs perspective (and vice versa), rather than requiring manual file copying between separate filesystems.The tests have been refactored to remove redundant tests that only exercised one library in isolation, focusing instead on demonstrating the integration between just-bash and zen-fs.
Key changes:
ZenFsAdapterclass (186 lines) wrapping zen-fs sync APIs as async methodsensureParentDirs)Review & Testing Checklist for Human
ZenFsAdapterinterface compatibility: The adapter implements methods based on just-bash'sIFileSysteminterface, but there's no explicit type import/check. Confirm the method signatures match what just-bash expects.ensureParentDirsbehavior: The adapter auto-creates parent directories on write/append/symlink/link operations. This differs from standard fs behavior - verify this is acceptable.symlink,link,chmod,readlink,lstatare implemented but not covered by tests. Consider if these need test coverage.Test plan:
All 9 tests should pass, demonstrating:
Notes
The adapter wraps zen-fs sync methods in async functions since just-bash's
IFileSysteminterface is async. ThegetAllPaths()method implements a recursive directory walk for glob support.Link to Devin run: https://app.devin.ai/sessions/e5a59ab234c5481e817dad43a74cfc6e
Requested by: Dan Lynch (@pyramation)