fix(dev): spawn pinned local tailwind bin directly, not bunx @latest#493
Merged
Conversation
Two defects from the same bunx wrapper, both observed live while verifying #459: - Leak: nodeSpawn('bunx', ['@tailwindcss/cli', ...]) produced a volta-shim -> bunx -> node chain; kill('SIGTERM') hit only the wrapper and the node --watch grandchild reparented to launchd, watching files forever. - Drift: bunx downloaded floating @tailwindcss/cli@latest, ignoring the pinned ^4.2.4 devDependency. dev.ts now spawns node_modules/.bin/tailwindcss directly under bun — the child pid IS the tailwind process, and the version comes from the lockfile. build:css drops bunx for the same pinning (node_modules/.bin is on PATH in package scripts). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The bunx-wrapper grandchild leak is fixed by the direct local-bin spawn; rewrite the known-gap note to record what changed and why, and note the comment-only-edit gotcha for verifying the watch pipeline. Update the architecture diagram line. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Fixes the dev-loop tailwind leak surfaced during #459 verification (documented as a known gap in
dev-loop.mdby #491) — straight to PR, no issue, per kickoff decision.Two defects, one root cause:
nodeSpawn('bunx', ['@tailwindcss/cli', …, '--watch=always'])produced a volta-shim → bunx → node grandchild chain.tailwindChild.kill('SIGTERM')hit only the wrapper; the node--watchprocess reparented to launchd and watched files forever (observed twice, pids 91436/91590).@tailwindcss/cli@latestat every dev boot, ignoring the pinned^4.2.4devDependency.Changes
scripts/dev.ts: spawn the lockfile-pinnednode_modules/.bin/tailwindcssdirectly underbun— the child pid IS the tailwind process, so SIGTERM reaches it. No wrapper resolution at boot.package.jsonbuild:css:bunx @tailwindcss/cli→ baretailwindcss(node_modules/.bin is on package-script PATH). CI workflows runbun install --frozen-lockfilefirst, so both pipelines resolve the pinned version.dev-loop.mddiagram + leak note updated; spec/plan under.claude/specs/.No new unit tests — spawn configuration with no logic surface (spec rules out brittle package.json-grep tests).
Verification
bun run dev→ exactly one tailwind process, direct child of the dev pid (no node grandchild, no bunx/volta wrapper)css updateddev event fired (edit + revert); note: comment-only edits produce identical output and skip the rewrite (documented gotcha)kill -TERM→ graceful chain ran, zero tailwind/bunx survivors, port freedbun run build:css→ v4.2.4 (pinned), exits 0@latest)Follow-up candidates (out of scope): prune now-dead bunx download-chatter patterns from
dev-log-classifier.ts; optionalexistsSync(TAILWIND_BIN)guard with a "run bun install" hint.🤖 Generated with Claude Code