-
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.
fix(publish): skip private workspaces
Allow users to publish all workspaces with `npm publish --ws` while also skipping any workspace that might have been intentionally marked as private, using `"private": true` in its package.json file. Fixes: #3268 PR-URL: #3285 Credit: @ruyadorno Close: #3285 Reviewed-by: @wraithgar
- Loading branch information
Showing
3 changed files
with
200 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,40 @@ | |
* Make sure to inspect the output below. Do not ignore changes! | ||
*/ | ||
'use strict' | ||
exports[`test/lib/publish.js TAP private workspaces colorless > should output all publishes 1`] = ` | ||
Array [ | ||
"+ @npmcli/[email protected]", | ||
] | ||
` | ||
|
||
exports[`test/lib/publish.js TAP private workspaces colorless > should publish all non-private workspaces 1`] = ` | ||
Array [ | ||
Object { | ||
"_id": "@npmcli/[email protected]", | ||
"name": "@npmcli/b", | ||
"readme": "ERROR: No README data found!", | ||
"version": "1.0.0", | ||
}, | ||
] | ||
` | ||
|
||
exports[`test/lib/publish.js TAP private workspaces with color > should output all publishes 1`] = ` | ||
Array [ | ||
"+ @npmcli/[email protected]", | ||
] | ||
` | ||
|
||
exports[`test/lib/publish.js TAP private workspaces with color > should publish all non-private workspaces 1`] = ` | ||
Array [ | ||
Object { | ||
"_id": "@npmcli/[email protected]", | ||
"name": "@npmcli/b", | ||
"readme": "ERROR: No README data found!", | ||
"version": "1.0.0", | ||
}, | ||
] | ||
` | ||
|
||
exports[`test/lib/publish.js TAP shows usage with wrong set of arguments > should print usage 1`] = ` | ||
Error: | ||
Usage: npm publish | ||
|
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
I'm seeing
ENEEDAUTH
when trying the setup described in #3268 when trying to publish scoped packages to a custom registry. The workspace with"private": true
is not scoped, and the error thrown has the message "This command requires you to be logged in to https://registry.npmjs.org/." I've opened #7199 with details.