fix(core): use standalone root for integration detection - #423
Merged
Conversation
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
Contributor
There was a problem hiding this comment.
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) intoDevTools()when launching standalone DevTools. - Add
DevToolsOptions.cwdand 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.
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.
Context
Standalone DevTools accepts a target project directory through
cwd, but optional integrations were detected relative toprocess.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--rootvalues also need to be normalized before package resolution.Changes
DevTools()to use a configured directory for integration detection.DevTools().