Skip to content

fix(core): restore integration cwd detection and harden build exit - #427

Merged
antfu merged 1 commit into
mainfrom
tame-bees-divide
Jul 16, 2026
Merged

fix(core): restore integration cwd detection and harden build exit#427
antfu merged 1 commit into
mainfrom
tame-bees-divide

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Description

CI is red on main. Root causes:

  • test job (fails on ubuntu/windows/macos): the "unify builtin devtools plugin" refactor moved BUILTIN_LAUNCHER_INTEGRATIONS/detection into DevToolsBuiltin() but dropped the cwd forward from DevTools({ cwd }), so optional-integration detection (isPackageExists) silently fell back to process.cwd() again — regressing fix(core): use standalone root for integration detection #423 and failing the existing resolves optional integrations from the configured project directory unit test. Fixed by forwarding cwd through.
  • e2e job (times out after 120s on the CLI-build test): while chasing this down, found two real hang risks with no bearing on this specific flake but worth closing: vite-devtools build relies on the event loop draining naturally to exit, so any stray open handle from a devtools.setup() hook (ours or third-party) would hang the process forever with no diagnostic; and the client's Iconify SVG fetch has no timeout, so a stalled connection hangs indefinitely instead of degrading to a blank icon like the code already intends for network failures. Added an explicit process.exit(0) after a successful build, and an AbortSignal.timeout() on the Iconify fetch. Also gave the e2e harness's CLI-build spawn its own bounded timeout so a future hang fails fast with a clear message instead of silently burning the whole test timeout.

Verified locally: full unit suite (256 passed), lint, typecheck, and the e2e static-build test all green.

Linked Issues

Additional context

Regresses #423 via the refactor in 3fbc896 (no PR, direct push to main).


Created with the help of an agent.

The "unify builtin devtools plugin" refactor dropped `cwd` when calling
`DevToolsBuiltin()` from `DevTools()`, so optional-integration detection
silently fell back to `process.cwd()` again — regressing #423 and
breaking the `resolves optional integrations from the configured
project directory` unit test on every OS in CI.

Also hardens two unrelated hang risks found while chasing the failing
e2e job: the CLI's `build` command now exits explicitly once the
static build finishes instead of relying on the event loop draining
naturally, and the Iconify SVG fetch now times out instead of hanging
forever on a stalled connection. The e2e harness's CLI-build spawn gets
an explicit timeout too, so a future hang fails fast with a clear
message instead of silently burning the whole test timeout.

Fixed with the help of an agent.
@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools@427

@vitejs/devtools-kit

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-kit@427

@vitejs/devtools-oxc

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-oxc@427

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-rolldown@427

@vitejs/devtools-vite

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-vite@427

@vitejs/devtools-vitest

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-vitest@427

commit: 1032d49

@antfu
antfu merged commit ba8a960 into main Jul 16, 2026
9 of 10 checks passed
@antfu
antfu deleted the tame-bees-divide branch July 16, 2026 01:40
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