Skip to content

Comments

feat(tools-filesystem): Add a richer set of filesystem helpers to tools-filesystem#3977

Merged
JasonVMo merged 13 commits intomainfrom
user/jasonvmo/fs-enhancements
Feb 23, 2026
Merged

feat(tools-filesystem): Add a richer set of filesystem helpers to tools-filesystem#3977
JasonVMo merged 13 commits intomainfrom
user/jasonvmo/fs-enhancements

Conversation

@JasonVMo
Copy link
Collaborator

Description

This enhances the set of filesystem helpers in tools-filesystem.

Changes to existing functions

  • renamed ensureDir and ensureDirForFile to follow standard sync naming conventions.
  • restructured the files to create an index file and dedicated files for types of functionality.
  • enhanced the reworked the mockFS to provide much more functionality including promise based mocks.

New functionality

  • asynchronous versions of the helper functions. Pairings follow fs naming (e.g. ensureDirSync + ensureDir)
  • helpers for reading files with UTF encoding
  • helpers for parsing JSON with BOM stripping, and serializing with trailing "\n" addition which is always omitted by JSON.serialize.
  • helpers for reading/writing JSON files which use these helpers.
  • optimized file compares which do cheap compares (size, ino/dev) then content comparisons. Sync and async versions provided.
  • FSEntry class which provides a wrapper around a path, progressively caching information and coalescing promise based filesystem calls. This is useful to either implement a caching layer, or to be handed out by a caching layer.
  • ability to use the mockFS to test the new functionality.
  • tests for all the new functionality.

Test plan

Automated tests.

@github-actions github-actions bot added the feature: cli This is related to CLI label Feb 18, 2026
@JasonVMo JasonVMo enabled auto-merge (squash) February 19, 2026 21:48
@JasonVMo JasonVMo merged commit 5149e36 into main Feb 23, 2026
15 checks passed
@JasonVMo JasonVMo deleted the user/jasonvmo/fs-enhancements branch February 23, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: cli This is related to CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants