build: drop Node from Docker, patch @volar/typescript for Bun#199
Merged
Conversation
vue-tsc was the only thing keeping Node in the runtime image. With the upstream Bun-compat patch on @volar/typescript applied via `bun patch`, the build now runs entirely on Bun. Patch reference: https://github.com/kernoeb/volar.js/tree/fix-bun-vue-tsc Upstream issue: oven-sh/bun#4754
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
Dockerfile(was only there forvue-tsc)bun patchon@volar/typescript@2.4.28to fix the long-standing incompat where Bun's module loader does not honorfs.readFileSyncmonkey-patching — the trick Volar uses to inject.vueextension support into TypeScript (Bun issue 4754, opened 2023).Module#_compilecall, honored by both Node and Bun. Same fix lives on a fork at kernoeb/volar.js@fix-bun-vue-tsc.What the patch does
fs.readFileSyncto intercept Node's CJS loader read oftsc.jstsc.jsdirectly, transforms it, thenModule#_compiles the resulttransformTscContentfailure as the "this is the v5.7+ shim" signalModule._extensions['.js']wrapper)enableCompileCache(), our patch bypassed it)Module.enableCompileCache()to mirror the shimTest plan
docker build --target buildpasses end-to-end in ~44s (was building successfully with Node previously)bun installre-applies the patch automatically (verified on cleanrm -rf node_modules && bun install)bun run typecheck(=vue-tsc -b --force) exits 0bun run test:unit— 136 tests, 5704 expect() calls, all green/api/pingas before (smoke-test on test server)Notes
@volar/typescript2.4.28 is the version currently pinned viabun.lock. If volar bumps minor we'll need to regenerate the patch —bun patchwill fail-loud on hash mismatch.