Repository navigation
fix(link): output symlink created by npm link - #10203
Open
ShryukGrandhi wants to merge 1 commit into
Open
ShryukGrandhi wants to merge 1 commit into
ShryukGrandhi wants to merge 1 commit into
Conversation
Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>
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
Since npm 7, running
npm linkin a package directory no longer tells you where the global symlink went. npm 6 printed a line like/path/to/global/node_modules/pkg -> /path/to/project. This adds that line back.Fixes #3177
Changes
lib/commands/link.js: after the global reify inlinkPkg, print<link path> -> <target>for each explicitly requested package (the current package, or each selected workspace). The line is skipped with--json, because the JSON summary already includes the path and the extra line would make the output invalid JSON.test/lib/commands/link.js: assert that the link line is printed fornpm linkwith no args, and that nothing extra is printed with--json.Example:
Testing
node . run test -- test/lib/commands/link.jspasses, with 100% coverage forlib/commands/link.js. The new assertion fails without the change tolink.js.npx eslint lib/commands/link.js test/lib/commands/link.jsis clean.npm_config_prefix=<tmp> node . link) on a package with abinfield. The link line was printed, and the--jsonoutput still parses as JSON.