Skip to content

fix(core): use standalone root for integration detection - #423

Merged
antfu merged 1 commit into
mainfrom
fix-standalone-integration-root
Jul 16, 2026
Merged

fix(core): use standalone root for integration detection#423
antfu merged 1 commit into
mainfrom
fix-standalone-integration-root

Conversation

@webfansplz

Copy link
Copy Markdown
Member

Context

Standalone DevTools accepts a target project directory through cwd, but optional integrations were detected relative to process.cwd().

When the CLI was launched from another directory, such as with --root, it could load integrations from the wrong project or show install launchers for integrations that were already installed. Relative --root values also need to be normalized before package resolution.

Changes

  • Allow DevTools() to use a configured directory for integration detection.
  • Normalize the directory to an absolute path before resolving packages.
  • Pass the standalone project directory to DevTools().

@pkg-pr-new

pkg-pr-new Bot commented Jul 15, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/devtools

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

@vitejs/devtools-kit

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

@vitejs/devtools-oxc

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

@vitejs/devtools-rolldown

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

@vitejs/devtools-vite

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

@vitejs/devtools-vitest

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

commit: e01e80c

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes standalone-mode optional integration detection so it respects the configured project root (instead of process.cwd()), preventing false “install launcher” states or loading integrations from the wrong project when --root/cwd is used.

Changes:

  • Pass the standalone target directory (cwd) into DevTools() when launching standalone DevTools.
  • Add DevToolsOptions.cwd and normalize it to an absolute path for package existence checks.
  • Add a unit test asserting integrations are detected relative to the configured directory.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/core/src/node/standalone.ts Passes the standalone project cwd into DevTools() so integration detection is aligned with the standalone root.
packages/core/src/node/plugins/index.ts Introduces DevToolsOptions.cwd and resolves it to an absolute path before isPackageExists checks.
packages/core/src/node/plugins/tests/index.test.ts Adds coverage to ensure optional integrations are checked from the configured project directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/node/plugins/__tests__/index.test.ts
@antfu
antfu merged commit b0f43e6 into main Jul 16, 2026
11 checks passed
@antfu
antfu deleted the fix-standalone-integration-root branch July 16, 2026 00:31
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.

3 participants