Repository navigation
Conversation
A workspace member can become an implicit target of npm install and uninstall. Resolve the owning project before a root-only dependency edit, while keeping relative package arguments in the calling directory. Use npm to verify membership on early npm 8 and preserve explicit workspace selections. Cover member dependency and lockfile retention, including nested workspaces with the same package name.
PowerShell splits attached path options at the drive colon when it runs the npm shim with -File. Pass generated prefix, global config and caller-relative workspace paths as separate arguments so npm edits the intended project. Extend the nested npm 8 fixture to remove a dependency from the outer docs workspace using a caller-relative selector.
Select the project through the active npm configuration while keeping the launcher and caller directory. This preserves lifecycle paths, global configuration, and workspace links during dependency edits. Reject combined local adds before npm can save a path that fails from a member. Cover the old npm tarball boundary and run a lifecycle script in a fresh workspace.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Summary
From
packages/app,vp remove -w testnpm2can remove the dependency from both the root and app. The command succeeds even if app still imports the package. A root-only add can also write an extra declaration to app.vp remove -w testnpm2vp add -w --filter docs testnpm2For npm dependency edits, select the owning project when npm loads its configuration. Keep the original launcher and working directory so relative paths, configuration files and install scripts retain their meaning. Package-bearing
vp installand the removal aliases use the same path.If npm would save a local dependency path that does not resolve from a member, stop before writing. For a combined root and member add, pass a bare tarball path with npm 8.19.0 or later. Add an external directory to each target separately.
Evidence
--prefix. An install script then saw the project as its global npm prefix. The new offline fixture checks the script’sINIT_CWD, runsnpm prefix -g, and resolves a workspace dependency from a fresh install.just check,just testandjust lintpassed. The adapter and add guide also passedvp check.crypto-bigint 0.5.5. The base and head have the same Cargo lockfile. CI logMerge Danger
Door · Two-way. Blast radius · npm workspace dependency edits.
Risk is medium. The adapter depends on npm’s internal configuration loader. A future npm change can select the wrong manifest or lockfile. The workspace and lifecycle fixtures exercise that boundary.