Skip to content

fix(cli): filter bun's "not in project directory" watcher warning#124

Open
Mkassabov wants to merge 23 commits into
mainfrom
fix/filter-bun-watch-warnings
Open

fix(cli): filter bun's "not in project directory" watcher warning#124
Mkassabov wants to merge 23 commits into
mainfrom
fix/filter-bun-watch-warnings

Conversation

@Mkassabov
Copy link
Copy Markdown
Contributor

@Mkassabov Mkassabov commented Apr 30, 2026

Summary

  • Filter the noise. 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 it fires hundreds of times on every alchemy <cmd> invocation, and there's no bun flag to silence it.
  • Vendor foreground-child. Upstream hardcodes stdio = [0, 1, 2], which makes child-stderr filtering impossible without a fork. packages/alchemy/bin/_foreground-child.js is a minimal vendored copy (ISC, attribution at top) with one behavioral addition: an optional stderrFilter option that pipes stderr, line-buffers, drops matches, and forwards the rest. Watchdog, signal proxying, IPC bridging, and exit-code forwarding are preserved verbatim. The foreground-child dep is dropped in favor of a direct signal-exit dep (already a transitive).
  • Harden Ctrl-C on Windows. The existing uncaughtException handler only matched signal === "SIGINT", but on Windows the watchdog exits with STATUS_CONTROL_C_EXIT (3221225786) and signal: null. Added that to the guard so the launcher exits cleanly instead of dumping a stack trace.

@alchemy-version-bot
Copy link
Copy Markdown
Contributor

alchemy-version-bot Bot commented Apr 30, 2026

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

@alchemy-version-bot
Copy link
Copy Markdown
Contributor

alchemy-version-bot Bot commented Apr 30, 2026

Website Preview Deployed

URL: https://alchemyeffectwebsite-worker-pr-124-c6egzmrhjl4l3rvm.testing-2b2.workers.dev

Built from commit 6634b19.


This comment updates automatically with each push.

@Mkassabov Mkassabov changed the base branch from main to john/vite-dev May 14, 2026 06:35
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.
@Mkassabov Mkassabov force-pushed the fix/filter-bun-watch-warnings branch from 32b5158 to 875c6e4 Compare May 14, 2026 06:38
Base automatically changed from john/vite-dev to main May 15, 2026 20:37
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