fix(cli): filter bun's "not in project directory" watcher warning#124
Open
Mkassabov wants to merge 23 commits into
Open
fix(cli): filter bun's "not in project directory" watcher warning#124Mkassabov wants to merge 23 commits into
Mkassabov wants to merge 23 commits into
Conversation
Contributor
|
Install the packages built from this commit: alchemy bun add alchemy@https://pkg.ing/alchemy/6634b19@alchemy.run/better-auth bun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/6634b19@alchemy.run/pr-package bun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/6634b19 |
Contributor
Website Preview DeployedURL: https://alchemyeffectwebsite-worker-pr-124-c6egzmrhjl4l3rvm.testing-2b2.workers.dev Built from commit This comment updates automatically with each push. |
Bun emits a hard-coded `warn: File <path> is not in the project directory and will not be watched` line for every transpiled file outside its auto-detected project root. In this monorepo that fires hundreds of times on every `alchemy <cmd>` invocation and there is no bun flag to silence it. `foreground-child` upstream hardcodes `stdio = [0, 1, 2]`, so we vendor a minimal copy (`bin/_foreground-child.js`) that adds an optional `stderrFilter` option — pipe stderr, line-buffer, drop matches, forward the rest. Watchdog, signal proxying, IPC bridging, and exit-code forwarding are preserved verbatim from upstream (ISC, attribution at top of file). Drops the `foreground-child` dep in favor of a direct `signal-exit` dep (already a transitive). Also harden the `uncaughtException` handler for Windows: on Ctrl-C the watchdog exits with `STATUS_CONTROL_C_EXIT` (3221225786) and `signal: null` rather than `SIGINT`, so the original guard missed it.
32b5158 to
875c6e4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
warn: File <path> is not in the project directory and will not be watchedline for every transpiled file outside its auto-detected project root. In this monorepo it fires hundreds of times on everyalchemy <cmd>invocation, and there's no bun flag to silence it.foreground-child. Upstream hardcodesstdio = [0, 1, 2], which makes child-stderr filtering impossible without a fork.packages/alchemy/bin/_foreground-child.jsis a minimal vendored copy (ISC, attribution at top) with one behavioral addition: an optionalstderrFilteroption that pipes stderr, line-buffers, drops matches, and forwards the rest. Watchdog, signal proxying, IPC bridging, and exit-code forwarding are preserved verbatim. Theforeground-childdep is dropped in favor of a directsignal-exitdep (already a transitive).uncaughtExceptionhandler only matchedsignal === "SIGINT", but on Windows the watchdog exits withSTATUS_CONTROL_C_EXIT(3221225786) andsignal: null. Added that to the guard so the launcher exits cleanly instead of dumping a stack trace.