Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuy Adorno <ruyadorno@hotmail.com>2021-04-07 18:03:41 +0300
committerRuy Adorno <ruyadorno@hotmail.com>2021-04-22 22:06:29 +0300
commit4c1f16d2c29a7a56c19b97f2820e6305a6075083 (patch)
tree460fd0dfa65b168d3f35bac5e0ad363b14684a1d /tap-snapshots
parent2aecec591df6866e27d0b17dc49cef8f7d738d77 (diff)
feat: add init workspaces
Add workspaces support to `npm init` - Fixes `npm exec` respecting `script-shell` option value - Refactored `lib/exec.js` into `libnpmexec` - Updates init-package-json@2.0.3 - Added ability to create a new workspace using the -w config PR-URL: https://github.com/npm/cli/pull/3095 Credit: @ruyadorno Close: #3095 Reviewed-by: @wraithgar
Diffstat (limited to 'tap-snapshots')
-rw-r--r--tap-snapshots/test/lib/init.js.test.cjs15
-rw-r--r--tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs3
-rw-r--r--tap-snapshots/test/lib/utils/npm-usage.js.test.cjs4
3 files changed, 13 insertions, 9 deletions
diff --git a/tap-snapshots/test/lib/init.js.test.cjs b/tap-snapshots/test/lib/init.js.test.cjs
index 25015aab6..043d8b641 100644
--- a/tap-snapshots/test/lib/init.js.test.cjs
+++ b/tap-snapshots/test/lib/init.js.test.cjs
@@ -5,15 +5,14 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
-exports[`test/lib/init.js TAP classic npm init no args > should print helper info 1`] = `
-This utility will walk you through creating a package.json file.
-It only covers the most common items, and tries to guess sensible defaults.
+exports[`test/lib/init.js TAP workspaces no args > should print helper info 1`] = `
-See \`npm help init\` for definitive documentation on these fields
-and exactly what they do.
+`
+
+exports[`test/lib/init.js TAP workspaces no args, existing folder > should print helper info 1`] = `
+
+`
-Use \`npm install <pkg>\` afterwards to install a package and
-save it as a dependency in the package.json file.
+exports[`test/lib/init.js TAP workspaces with arg but missing workspace folder > should print helper info 1`] = `
-Press ^C at any time to quit.
`
diff --git a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs
index 6c2659062..ce520e748 100644
--- a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs
+++ b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs
@@ -966,7 +966,8 @@ installation of packages specified according to the pattern
* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
* Type: null or String
-The shell to use for scripts run with the \`npm run\` command.
+The shell to use for scripts run with the \`npm exec\`, \`npm run\` and \`npm
+init <pkg>\` commands.
#### \`searchexclude\`
diff --git a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs
index e32d5e9f4..946cfba90 100644
--- a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs
+++ b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs
@@ -467,6 +467,10 @@ All commands:
npm init <@scope> (same as \`npx <@scope>/create\`)
npm init [<@scope>/]<name> (same as \`npx [<@scope>/]create-<name>\`)
+ Options:
+ [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
+ [-ws|--workspaces]
+
aliases: create, innit
Run "npm help init" for more info