Repository navigation
fix(workspace): only use a workspace root that includes the current package - #859
Open
liangmiQwQ wants to merge 4 commits into
Open
liangmiQwQ wants to merge 4 commits into
liangmiQwQ wants to merge 4 commits into
Conversation
…ackage Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
liangmiQwQ
marked this pull request as ready for review
October 17, 2026 11:13
Contributor
Author
Member
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
fengmk2
approved these changes
Oct 18, 2026
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
fengmk2
pushed a commit
to voidzero-dev/vite-plus
that referenced
this pull request
Oct 18, 2026
Inspired by voidzero-dev/vite-task#859 The JS `findWorkspaceRoot` in `resolve-vite-config.ts` was a second copy of `vt_workspace::find_workspace_root`, the lookup that `vp run` and `vp install` use. The two copies had drifted apart: - The JS copy treated `lerna.json` as a monorepo root. The rest of `vp` does not. - The JS copy could not parse a `package.json` saved with a UTF-8 BOM, so it skipped that root and kept walking up. - The JS copy skipped any malformed `package.json` and kept walking up, so it could return an unrelated workspace above the real one. This PR adds a `findMonorepoRoot` binding. It wraps `find_workspace_root` and returns the root only for pnpm and `package.json` workspaces. `vp pack` (`resolveViteConfig` with `traverseUp`) and `vp create` (`getConfiguredCreate`) now use it, and the JS copy is removed. A malformed `package.json` now throws the same error both commands already hit in their earlier Rust lookup. This PR also fixes `findViteConfigUp`. It checked its start directory before checking that the directory was inside the stop directory. Running `vp pack` at a monorepo root with no `vite.config` could pick up a config from the directory above the root. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wan9chi
requested changes
Oct 19, 2026
Co-authored-by: GPT-6 <noreply@openai.com>
Signed-off-by: Liang <github@liangmi.dev>
This branch has not been deployed
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.
Close voidzero-dev/vite-plus#3013
Motivation
find_workspace_rootwalks up from the cwd and stops at the firstpnpm-workspace.yaml, orpackage.jsonwithworkspaces. It doesn't check whether the package at the cwd is a member of that workspace. So runningvp run buildinexamples/demo, whenpnpm-workspace.yamlonly listspackages/*, picks the outer folder as the workspace root and runs the root package'sbuildinstead of the demo's.This PR follows npm's behavior: a workspace is only used as the root if its member globs include the package nearest to the cwd, or if the cwd belongs to the root package itself. Otherwise the search keeps going up, and if no workspace includes the package, it is treated as a standalone package.
The member glob parsing and pattern normalization in
vt_workspaceare shared between root detection and package graph loading, so both agree on what counts as a member, including skippingnode_modules.🤖 Generated with Claude Code