Skip to content

Fsa watch bridge improvements#1268

Merged
streamich merged 14 commits into
masterfrom
fsa-watch-bridge-improvements
Jul 8, 2026
Merged

Fsa watch bridge improvements#1268
streamich merged 14 commits into
masterfrom
fsa-watch-bridge-improvements

Conversation

@streamich

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 8, 2026 10:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the fs.watch bridging behavior across the in-memory Volume implementation and the FSA-to-Node adapter, adding better option parity (ignore patterns, abort signals, and missing-path behavior) and extending CI coverage.

Changes:

  • Centralizes watch() ignore-pattern handling into @jsonjoy.com/fs-node-utils and uses it from both fs-node and fs-fsa-to-node.
  • Enhances watch cancellation semantics via AbortSignal (including improved fs.promises.watch() AbortError behavior) and adds throwIfNoEntry support for the FSA adapter.
  • Extends GitHub Actions checks to include Node.js 26.x.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
yarn.lock Records the added glob-to-regex.js dependency.
packages/fs-node/src/volume.ts Updates watch() overloads/options handling and reuses shared ignore matcher.
packages/fs-node/src/FsPromises.ts Adjusts promises.watch() abort semantics and tests expectations.
packages/fs-node/src/tests/volume.test.ts Removes as any casts now that watch() is properly overloaded.
packages/fs-node/src/tests/promises.test.ts Adds stronger coverage for abort behavior and queued-event discard semantics.
packages/fs-node-utils/src/watchIgnore.ts Introduces shared ignore-pattern-to-matcher utilities.
packages/fs-node-utils/src/types/FsCallbackApi.ts Updates watch typing to proper overload signatures.
packages/fs-node-utils/src/index.ts Exports the new watchIgnore utilities.
packages/fs-node-utils/package.json Adds glob-to-regex.js dependency to support ignore patterns.
packages/fs-fsa-to-node/src/FsaNodeFsWatcher.ts Adds ignore filtering and throwIfNoEntry behavior in watcher startup.
packages/fs-fsa-to-node/src/FsaNodeFs.ts Wires signal, ignore, and throwIfNoEntry options through to the watcher.
packages/fs-fsa-to-node/src/tests/watch.test.ts Adds coverage for signal, throwIfNoEntry, and ignore behaviors.
packages/fs-core/src/Node.ts Marks Node.changes as deprecated in favor of volume-level mechanisms.
packages/fs-core/src/Link.ts Marks Link.changes as deprecated in favor of volume-level mechanisms.
.github/workflows/checks.yml Adds Node.js 26.x to the CI matrix.

Comment thread packages/fs-node/src/FsPromises.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.

Comment thread README.md Outdated
Comment thread packages/fs-fsa-to-node/src/FsaNodeFsWatcher.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

packages/fs-fsa-to-node/src/FsaNodeFs.ts:893

  • This watch implementation and its option/listener function types declare filename: string, but the watcher can emit a Buffer when encoding: 'buffer' is selected. Align the callback types with misc.TDataOut to match runtime behavior and the updated FsCallbackApi overloads.
  public readonly watch: FsCallbackApi['watch'] = (
    path: misc.PathLike,
    options?: opts.IWatchOptions | string | ((eventType: string, filename: string) => void),
    listener?: (eventType: string, filename: string) => void,
  ): misc.IFSWatcher => {

Comment thread packages/fs-node/src/volume.ts
Comment thread packages/fs-node-utils/src/types/FsCallbackApi.ts
Comment thread packages/fs-node/src/volume.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.

Comment thread packages/fs-node/src/volume.ts
Comment thread packages/fs-fsa-to-node/src/FsaNodeFs.ts
Comment thread packages/fs-fsa-to-node/src/FsaNodeFs.ts
@streamich streamich merged commit cbf22ca into master Jul 8, 2026
13 checks passed
@streamich streamich deleted the fsa-watch-bridge-improvements branch July 8, 2026 12:31
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