diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2021-05-21 20:22:51 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-05-27 17:24:12 +0300 |
commit | 4a4fbe33c51413adcd558b4af6f1e204b1b87e41 (patch) | |
tree | af8624d65414bfcf89c68e5ebfcc2aa5b8170201 /tap-snapshots | |
parent | 64b13dd1082b6ca7eac4e8e329bfdd8cd8daf157 (diff) |
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: https://github.com/npm/cli/issues/3268
PR-URL: https://github.com/npm/cli/pull/3285
Credit: @ruyadorno
Close: #3285
Reviewed-by: @wraithgar
Diffstat (limited to 'tap-snapshots')
-rw-r--r-- | tap-snapshots/test/lib/publish.js.test.cjs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tap-snapshots/test/lib/publish.js.test.cjs b/tap-snapshots/test/lib/publish.js.test.cjs index 05f0e6580..7a7502e02 100644 --- a/tap-snapshots/test/lib/publish.js.test.cjs +++ b/tap-snapshots/test/lib/publish.js.test.cjs @@ -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/b@1.0.0", +] +` + +exports[`test/lib/publish.js TAP private workspaces colorless > should publish all non-private workspaces 1`] = ` +Array [ + Object { + "_id": "@npmcli/b@1.0.0", + "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/b@1.0.0", +] +` + +exports[`test/lib/publish.js TAP private workspaces with color > should publish all non-private workspaces 1`] = ` +Array [ + Object { + "_id": "@npmcli/b@1.0.0", + "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 |