Repository navigation
fix(core): run installed formatter without bun on PATH - #5859
Merged
Merged
Conversation
somanshreddy
approved these changes
Oct 18, 2026
somanshreddy
left a comment
Contributor
There was a problem hiding this comment.
Clean at 4607f4c8: no blocker.
oxfmt@0.41.0has noexportsmap and declaresbin/oxfmt(bun.lock, npm), socreateRequire(...).resolve("oxfmt/bin/oxfmt")resolves. Running that entry withprocess.execPathworks the same under tsx/node and bun.- The callers are only build scripts:
buildInjectedArtifact.tsandproducer/scripts/build-hf-early-stub.ts.build-hyperframes-runtime-artifact.tscalls onlywriteGeneratedFile, so failing closed can't affect the CLI or any runtime path. - The fail-closed change can't break the image builds.
oxfmtis a root devDependency, andDockerfile.testandgcp-cloud-run/Dockerfilerun a fullbun install --frozen-lockfilebefore any generator. - The test that throws on invalid source also checks that the existing artifact is left untouched, which is the property that matters here.
— Somu
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 176 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (3)
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 18, 2026
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.
What
Generated TypeScript now uses the checkout's installed oxfmt through the running Node/Bun executable. A formatting failure stops generation before the existing artifact is replaced.
Why
On Windows, PATH can contain bun.cmd/bun.ps1 without a directly spawnable bun executable. Spawning
bun x oxfmtfailed silently, so builds wrote unformatted tracked artifacts and left the checkout dirty.Related work
Miguel's Windows generated-artifact formatter report. No separate issue required for this correction.
How
Resolve
oxfmt/bin/oxfmtwith createRequire and run that JS entry with process.execPath. Preserve synchronous formatting, CLI configuration and stdin-filepath. Throw with the original cause instead of returning unformatted input.Test plan
What I measured
Before the fix, both new regressions fail: an empty-PATH subprocess returns raw source, and invalid source overwrites the existing artifact. After the fix, all six tests pass and repeated position-edits/SVG generator runs preserve tracked bytes.
What I did NOT exercise
Native Windows execution was unavailable on the Linux devbox. No render was produced. The subprocess test removes PATH resolution entirely, reproducing the launcher failure without relying on a platform shim.
fails without the fix: PATH-empty formatting returns raw source; malformed generated TypeScript is silently written instead of throwing before publication.