-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
renames read-local-package to read-package-name The global check needed to be moved outside this function, because it was handled differently (and will be even moreso when we implement diff workspaces) in each function. This allowed us to now pass in the prefix itself instead of the npm object, so we can reuse this function to look up package names when we refactor npm diff for workspaces. PR-URL: #3331 Credit: @wraithgar Close: #3331 Reviewed-by: @ruyadorno
- Loading branch information
Showing
9 changed files
with
203 additions
and
103 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
7 changes: 2 additions & 5 deletions
7
lib/utils/read-local-package.js → lib/utils/read-package-name.js
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,8 @@ | |
*/ | ||
'use strict' | ||
exports[`test/lib/dist-tag.js TAP add missing args > should exit usage error message 1`] = ` | ||
npm dist-tag | ||
Error: | ||
Usage: npm dist-tag | ||
Modify package distribution tags | ||
|
@@ -21,11 +22,14 @@ Options: | |
alias: dist-tags | ||
Run "npm help dist-tag" for more info | ||
Run "npm help dist-tag" for more info { | ||
"code": "EUSAGE", | ||
} | ||
` | ||
|
||
exports[`test/lib/dist-tag.js TAP add missing pkg name > should exit usage error message 1`] = ` | ||
npm dist-tag | ||
Error: | ||
Usage: npm dist-tag | ||
Modify package distribution tags | ||
|
@@ -40,7 +44,9 @@ Options: | |
alias: dist-tags | ||
Run "npm help dist-tag" for more info | ||
Run "npm help dist-tag" for more info { | ||
"code": "EUSAGE", | ||
} | ||
` | ||
|
||
exports[`test/lib/dist-tag.js TAP add new tag > should return success msg 1`] = ` | ||
|
@@ -53,7 +59,8 @@ dist-tag add 1.0.0 to @scoped/[email protected] | |
` | ||
|
||
exports[`test/lib/dist-tag.js TAP borked cmd usage > should show usage error 1`] = ` | ||
npm dist-tag | ||
Error: | ||
Usage: npm dist-tag | ||
Modify package distribution tags | ||
|
@@ -68,7 +75,31 @@ Options: | |
alias: dist-tags | ||
Run "npm help dist-tag" for more info | ||
Run "npm help dist-tag" for more info { | ||
"code": "EUSAGE", | ||
} | ||
` | ||
|
||
exports[`test/lib/dist-tag.js TAP ls global > should throw basic usage 1`] = ` | ||
Error: | ||
Usage: npm dist-tag | ||
Modify package distribution tags | ||
Usage: | ||
npm dist-tag add <pkg>@<version> [<tag>] | ||
npm dist-tag rm <pkg> <tag> | ||
npm dist-tag ls [<pkg>] | ||
Options: | ||
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] | ||
[-ws|--workspaces] | ||
alias: dist-tags | ||
Run "npm help dist-tag" for more info { | ||
"code": "EUSAGE", | ||
} | ||
` | ||
|
||
exports[`test/lib/dist-tag.js TAP ls in current package > should list available tags for current package 1`] = ` | ||
|
@@ -78,7 +109,8 @@ latest: 1.0.0 | |
` | ||
|
||
exports[`test/lib/dist-tag.js TAP ls on missing name in current package > should throw usage error message 1`] = ` | ||
npm dist-tag | ||
Error: | ||
Usage: npm dist-tag | ||
Modify package distribution tags | ||
|
@@ -93,7 +125,9 @@ Options: | |
alias: dist-tags | ||
Run "npm help dist-tag" for more info | ||
Run "npm help dist-tag" for more info { | ||
"code": "EUSAGE", | ||
} | ||
` | ||
|
||
exports[`test/lib/dist-tag.js TAP ls on missing package > should log no dist-tag found msg 1`] = ` | ||
|
@@ -133,7 +167,8 @@ exports[`test/lib/dist-tag.js TAP remove existing tag > should return success ms | |
` | ||
|
||
exports[`test/lib/dist-tag.js TAP remove missing pkg name > should exit usage error message 1`] = ` | ||
npm dist-tag | ||
Error: | ||
Usage: npm dist-tag | ||
Modify package distribution tags | ||
|
@@ -148,7 +183,9 @@ Options: | |
alias: dist-tags | ||
Run "npm help dist-tag" for more info | ||
Run "npm help dist-tag" for more info { | ||
"code": "EUSAGE", | ||
} | ||
` | ||
|
||
exports[`test/lib/dist-tag.js TAP remove non-existing tag > should log error msg 1`] = ` | ||
|
Oops, something went wrong.