Skip to content

chore: run build scripts with oxc-node instead of tsx - #8247

Closed
Sepush wants to merge 1 commit into
tusen-ai:mainfrom
Sepush:chore-oxc-node
Closed

Sepush wants to merge 1 commit into
tusen-ai:mainfrom
Sepush:chore-oxc-node

Conversation

@Sepush

@Sepush Sepush commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Runs the repo's TypeScript scripts with oxc-node (oxnode) instead of tsx.

Changes

  • The six scripts that used tsx (gen-version, gen-volar-dts, post-build, release:changelog, transpile-docs, and pre-cjs-build inside build:package) now go through one run-ts script: cross-env OXC_TSCONFIG_PATH=src/tsconfig.esm.json oxnode.
    • Why the tsconfig: the root tsconfig has "jsx": "preserve". To run .tsx, tsx fell back to the classic h factory, while oxc-node falls back to React's automatic runtime and fails on import 'react/jsx-runtime'. src/tsconfig.esm.json ("jsx": "react", jsxFactory: h) is what the library build already compiles these files with. oxc-node has no CLI flag for this; OXC_TSCONFIG_PATH is how it selects a tsconfig.
  • scripts/post-build/index.ts: gen-web-types is imported after src is switched back from lodash to lodash-es, instead of at the top. pre-cjs-build rewrites src to the CommonJS lodash for the CJS build. Node's native ESM, which oxc-node uses, can't take named imports from it; tsx's loader allowed them.
  • scripts/post-build/gen-web-types.ts: imports kebabCase from lodash-es for the same reason.
  • tsx is replaced by @oxc-node/cli in devDependencies.

Verification

Each build ran in the same checkout path with tsx and with oxnode, and the outputs were compared file by file:

  • build:package: dist/, es/, lib/ and themes/tusimple/{es,lib} are identical.
  • build:package:vapor (the release build):
    • dist/ and every .mjs / .js file are identical.
    • 231 .d.ts files differ only in the order of union members and properties, plus one alias choice (VNodeChild vs. its expansion).
    • Two tsx runs differ the same way (229 files), and a second oxnode run flips the alias back, so this is TypeScript's declaration output varying between runs, not the runner.
  • web-types.json: same 154 components with identical contents; the order is now alphabetical, because import * as components is an ES module namespace, whose keys are sorted.
  • gen-volar-dts: volar.d.ts is unchanged. transpile-docs button: no changes. release:changelog: reaches the same confirmation prompt with the same changelog text (run with no tokens set and answered "no", so nothing was sent).
  • test:umd and test:esm pass as part of both builds.

- Run the six TypeScript scripts with oxnode (@oxc-node/cli) through one
  run-ts script. It points oxc-node at src/tsconfig.esm.json, because the
  root tsconfig has jsx: preserve, which oxc-node turns into React's
  automatic runtime while tsx used the classic h factory
- post-build: import gen-web-types only after src is back on lodash-es,
  and import kebabCase from lodash-es: native ESM can't take named
  imports from the CommonJS lodash, which tsx's loader allowed
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.56%. Comparing base (8b24921) to head (a1e1bd2).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #8247    +/-   ##
========================================
  Coverage   63.55%   63.56%            
========================================
  Files         878      878            
  Lines       27487    27487            
  Branches     8750     8524   -226     
========================================
+ Hits        17469    17471     +2     
  Misses       9803     9803            
+ Partials      215      213     -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Sepush Sepush closed this Oct 26, 2026

This branch was previously deployed

1 inactive deployment
test — a1e1bd22 Deployed Oct 25, 2026 by Sepush via test (24) #11274
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