Skip to content

Commit d8e40f3

Browse files
committed
docs(platform): clarify FileSystem.watch recursive option behavior
1 parent 16e219b commit d8e40f3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/platform-node/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@
488488

489489
Added a `recursive` option to `FileSystem.watch` that allows watching for changes in subdirectories. When set to `true`, the watcher will monitor changes in all nested directories.
490490

491-
Note: The recursive option is only supported on macOS and Windows. On other platforms, it will be ignored.
491+
Note: The `recursive` option behavior depends on the backend implementation. When using `@parcel/watcher` (default), watching is always recursive on all platforms and this option is ignored. When using the Node.js `fs.watch()` fallback, the `recursive` option is supported on all platforms (Node.js v20+).
492492

493493
Example:
494494

packages/platform/src/FileSystem.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,11 @@ export interface FileSystem {
235235
* By default, only changes to the direct children of the directory are reported.
236236
* Set the `recursive` option to `true` to watch for changes in subdirectories as well.
237237
*
238-
* Note: The `recursive` option is only supported on macOS and Windows.
239-
* On other platforms, it will be ignored.
238+
* Note: The `recursive` option behavior depends on the backend implementation:
239+
* - When using `@parcel/watcher` (default in `@effect/platform-node`):
240+
* Watching is always recursive on all platforms. This option is ignored.
241+
* - When using Node.js `fs.watch()` fallback: The `recursive` option is
242+
* supported on all platforms (Node.js v20+).
240243
*/
241244
readonly watch: (path: string, options?: WatchOptions) => Stream<WatchEvent, PlatformError>
242245
/**

0 commit comments

Comments
 (0)