Skip to content

Commit d1dddbf

Browse files
authored
fix(ci): switch tsdown config-loader from tsx to unrun (#349)
* fix(ci): pin tsx to ~4.21.0 to avoid 4.22.0 node: builtin regression tsx 4.22.0 upgraded its bundled esbuild to 0.28, which broke node:* builtin resolution in tsx's loader hooks — specifiers like `node:child_process?tsx-namespace=...` are now read as files and fail with ENOENT. This breaks `packages/core`'s `tsdown --config-loader=tsx` build because the config's `build:before`/`build:done` hooks dynamically import `.ts` files that use Node builtins. Add tsx to overrides so transitive peer-dep resolutions don't pull 4.22.0 back in via vite/vitepress/tsdown. Drop pin when tsx#756 ships. Refs: privatenumber/tsx#750 * fix(ci): switch tsdown config-loader from tsx to unrun The previous tsx pin to ~4.21.0 was a false fix. The bug exists in tsx 4.21.x too — it surfaces on Node 24.15.0 (CI's lts/*) but not 24.12.0. tsx's loader hook appends `?tsx-namespace=<timestamp>` to specifiers and Node 24.15.0 then attempts a readFileSync on `node:child_process?...`, failing with ENOENT. Switch tsdown's --config-loader from `tsx` to `unrun` in core and the three example plugins. unrun handles the config and the build:before / build:done hooks' dynamic `.ts` imports without going through tsx's loader hook. Revert the catalog tsx pin and override added in the previous commit since they no longer carry weight. * fix(ci): revert devframe to 0.2.2 to unblock typecheck The 0.2.3 bump from `chore: update deps` (d8efd10) made the build fail first via the tsx loader bug — once that was unblocked by switching to the unrun config loader, 86 typecheck errors surfaced. Every `declare module '@vitejs/devtools-kit'` augmentation in kit/core (registering RPC server functions, client functions, and shared-state keys) stopped merging into the re-exported `DevToolsRpc*` interfaces, leaving them as the empty base from devframe/types. Pin the catalog and submodule back to 0.2.2 to restore the green state on commit 3085997. The devframe-side cause needs investigating upstream; revisit when 0.2.4+ ships.
1 parent d8efd10 commit d1dddbf

7 files changed

Lines changed: 20 additions & 19 deletions

File tree

examples/plugin-a11y-checker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dist"
1313
],
1414
"scripts": {
15-
"build:node": "tsdown --config-loader=tsx",
15+
"build:node": "tsdown --config-loader=unrun",
1616
"build": "pnpm run build:node",
1717
"play:dev": "pnpm run build && cd playground && DEBUG='vite:devtools:*' vite"
1818
},

examples/plugin-file-explorer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dist"
1313
],
1414
"scripts": {
15-
"build:node": "tsdown --config-loader=tsx",
15+
"build:node": "tsdown --config-loader=unrun",
1616
"build:ui": "cd src/ui && vite build",
1717
"build": "pnpm run build:node && pnpm run build:ui",
1818
"play:dev": "pnpm run build && cd playground && DEBUG='vite:devtools:*' vite",

examples/plugin-git-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dist"
1313
],
1414
"scripts": {
15-
"build": "tsdown --config-loader=tsx",
15+
"build": "tsdown --config-loader=unrun",
1616
"play:dev": "pnpm run build && cd playground && DEBUG='vite:devtools:*' vite",
1717
"play:build": "pnpm run build && cd playground && vite build && vite-devtools build",
1818
"play:preview": "serve ./playground/.vite-devtools"

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
],
4242
"scripts": {
4343
"build": "pnpm build:js && pnpm build:standalone",
44-
"build:js": "tsdown --config-loader=tsx",
44+
"build:js": "tsdown --config-loader=unrun",
4545
"build:standalone": "cd src/client/standalone && vite build",
46-
"watch": "tsdown --watch --config-loader=tsx",
46+
"watch": "tsdown --watch --config-loader=unrun",
4747
"dev:standalone": "cd src/client/standalone && vite dev",
4848
"prepack": "pnpm build",
4949
"play": "DEBUG='vite:devtools:*' pnpm -C playground run dev",

pnpm-lock.yaml

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ catalogs:
5757
'@rolldown/debug': ^1.0.1
5858
birpc: ^4.0.0
5959
cac: ^7.0.0
60-
devframe: ^0.2.3
60+
# 0.2.3 emits dts in a way that breaks kit/core's `declare module` augmentations.
61+
devframe: 0.2.2
6162
diff: ^9.0.0
6263
envinfo: ^7.21.0
6364
get-port-please: ^3.2.0

0 commit comments

Comments
 (0)