diff --git a/deps/npm/docs/content/commands/npm-dedupe.md b/deps/npm/docs/content/commands/npm-dedupe.md index f816b99433581f..570e018342f276 100644 --- a/deps/npm/docs/content/commands/npm-dedupe.md +++ b/deps/npm/docs/content/commands/npm-dedupe.md @@ -147,10 +147,6 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use `npm prune`. - This configuration does not affect `npm ci`. diff --git a/deps/npm/docs/content/commands/npm-find-dupes.md b/deps/npm/docs/content/commands/npm-find-dupes.md index a92c57bd7e183b..4da6c296c6bf6d 100644 --- a/deps/npm/docs/content/commands/npm-find-dupes.md +++ b/deps/npm/docs/content/commands/npm-find-dupes.md @@ -87,10 +87,6 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use `npm prune`. - This configuration does not affect `npm ci`. diff --git a/deps/npm/docs/content/commands/npm-install-test.md b/deps/npm/docs/content/commands/npm-install-test.md index 931ff050718e10..3dd860ea5c6f68 100644 --- a/deps/npm/docs/content/commands/npm-install-test.md +++ b/deps/npm/docs/content/commands/npm-install-test.md @@ -162,10 +162,6 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use `npm prune`. - This configuration does not affect `npm ci`. diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index c0a1272c5503d1..d6668a2c2bd0fb 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -552,10 +552,6 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use `npm prune`. - This configuration does not affect `npm ci`. diff --git a/deps/npm/docs/content/commands/npm-link.md b/deps/npm/docs/content/commands/npm-link.md index fb2b23921b0445..975c807c38b348 100644 --- a/deps/npm/docs/content/commands/npm-link.md +++ b/deps/npm/docs/content/commands/npm-link.md @@ -224,10 +224,6 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use `npm prune`. - This configuration does not affect `npm ci`. diff --git a/deps/npm/docs/content/commands/npm-owner.md b/deps/npm/docs/content/commands/npm-owner.md index 0779984e19a9db..72dfe6a22d01b0 100644 --- a/deps/npm/docs/content/commands/npm-owner.md +++ b/deps/npm/docs/content/commands/npm-owner.md @@ -73,6 +73,52 @@ password, npm will prompt on the command line for one. +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + + + + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + + + + ### See Also diff --git a/deps/npm/docs/content/commands/npm-pkg.md b/deps/npm/docs/content/commands/npm-pkg.md index 576e1335efbba9..deff7e82c694dd 100644 --- a/deps/npm/docs/content/commands/npm-pkg.md +++ b/deps/npm/docs/content/commands/npm-pkg.md @@ -76,6 +76,14 @@ Returned values are always in **json** format. npm pkg get contributors[0].email ``` + For complex fields you can also name a property in square brackets + to specifically select a child field. This is especially helpful + with the exports object: + + ```bash + npm pkg get "exports[.].require" + ``` + * `npm pkg set =` Sets a `value` in your `package.json` based on the `field` value. When diff --git a/deps/npm/docs/content/commands/npm-update.md b/deps/npm/docs/content/commands/npm-update.md index 394773214995cd..421d04ca3dc583 100644 --- a/deps/npm/docs/content/commands/npm-update.md +++ b/deps/npm/docs/content/commands/npm-update.md @@ -280,10 +280,6 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use `npm prune`. - This configuration does not affect `npm ci`. diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index ba79dd505a88ed..4dc2829825d60d 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -1219,10 +1219,6 @@ The package to install for [`npm exec`](/commands/npm-exec) If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use `npm prune`. - This configuration does not affect `npm ci`. diff --git a/deps/npm/docs/output/commands/npm-dedupe.html b/deps/npm/docs/output/commands/npm-dedupe.html index 5bc84af0a26ac7..89d62caf702327 100644 --- a/deps/npm/docs/output/commands/npm-dedupe.html +++ b/deps/npm/docs/output/commands/npm-dedupe.html @@ -253,9 +253,6 @@

package-lock

If set to false, then ignore package-lock.json files when installing. This will also prevent writing package-lock.json if save is true.

-

When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use npm prune.

This configuration does not affect npm ci.

diff --git a/deps/npm/docs/output/commands/npm-find-dupes.html b/deps/npm/docs/output/commands/npm-find-dupes.html index 9e57bd78dffb5d..0e3ee0856096ab 100644 --- a/deps/npm/docs/output/commands/npm-find-dupes.html +++ b/deps/npm/docs/output/commands/npm-find-dupes.html @@ -210,9 +210,6 @@

package-lock

If set to false, then ignore package-lock.json files when installing. This will also prevent writing package-lock.json if save is true.

-

When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use npm prune.

This configuration does not affect npm ci.

diff --git a/deps/npm/docs/output/commands/npm-install-test.html b/deps/npm/docs/output/commands/npm-install-test.html index 9e3655c49f7c5f..6306ceb5938558 100644 --- a/deps/npm/docs/output/commands/npm-install-test.html +++ b/deps/npm/docs/output/commands/npm-install-test.html @@ -273,9 +273,6 @@

package-lock

If set to false, then ignore package-lock.json files when installing. This will also prevent writing package-lock.json if save is true.

-

When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use npm prune.

This configuration does not affect npm ci.

diff --git a/deps/npm/docs/output/commands/npm-install.html b/deps/npm/docs/output/commands/npm-install.html index de949e9493afdb..509702b5bd4ead 100644 --- a/deps/npm/docs/output/commands/npm-install.html +++ b/deps/npm/docs/output/commands/npm-install.html @@ -599,9 +599,6 @@

package-lock

If set to false, then ignore package-lock.json files when installing. This will also prevent writing package-lock.json if save is true.

-

When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use npm prune.

This configuration does not affect npm ci.

diff --git a/deps/npm/docs/output/commands/npm-link.html b/deps/npm/docs/output/commands/npm-link.html index 33a2f33b69c8c5..f7d5f66a9e2bd2 100644 --- a/deps/npm/docs/output/commands/npm-link.html +++ b/deps/npm/docs/output/commands/npm-link.html @@ -312,9 +312,6 @@

package-lock

If set to false, then ignore package-lock.json files when installing. This will also prevent writing package-lock.json if save is true.

-

When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use npm prune.

This configuration does not affect npm ci.

diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 707324960a84bc..4b44cbfbc3d570 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -166,7 +166,7 @@

Description

the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm's source tree will show:

-
npm@8.8.0 /path/to/npm
+
npm@8.9.0 /path/to/npm
 └─┬ init-package-json@0.0.4
   └── promzard@0.1.5
 
diff --git a/deps/npm/docs/output/commands/npm-owner.html b/deps/npm/docs/output/commands/npm-owner.html index b76967a18dad18..744f7821408fd5 100644 --- a/deps/npm/docs/output/commands/npm-owner.html +++ b/deps/npm/docs/output/commands/npm-owner.html @@ -142,7 +142,7 @@

npm-owner

Table of contents

- +

Synopsis

@@ -198,6 +198,45 @@

otp

password, npm will prompt on the command line for one.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+ + +

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+ +

See Also

    diff --git a/deps/npm/docs/output/commands/npm-pkg.html b/deps/npm/docs/output/commands/npm-pkg.html index 221afc4e594b2b..95635ee6028383 100644 --- a/deps/npm/docs/output/commands/npm-pkg.html +++ b/deps/npm/docs/output/commands/npm-pkg.html @@ -192,6 +192,11 @@

    Description

    contributor in the list, you can run:

    npm pkg get contributors[0].email
     
    +

    For complex fields you can also name a property in square brackets +to specifically select a child field. This is especially helpful +with the exports object:

    +
    npm pkg get "exports[.].require"
    +
  • npm pkg set <field>=<value>

    diff --git a/deps/npm/docs/output/commands/npm-update.html b/deps/npm/docs/output/commands/npm-update.html index 2ada2dcb7cc9ca..d88ea8578bacef 100644 --- a/deps/npm/docs/output/commands/npm-update.html +++ b/deps/npm/docs/output/commands/npm-update.html @@ -352,9 +352,6 @@

    package-lock

If set to false, then ignore package-lock.json files when installing. This will also prevent writing package-lock.json if save is true.

-

When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use npm prune.

This configuration does not affect npm ci.

diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index a48efdbe4f62e7..947e5a7ee179ad 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -149,7 +149,7 @@

Table of contents

Version

-

8.8.0

+

8.9.0

Description

npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html index 57e6e21073ddfe..e1edc365007055 100644 --- a/deps/npm/docs/output/using-npm/config.html +++ b/deps/npm/docs/output/using-npm/config.html @@ -1123,9 +1123,6 @@

package-lock

If set to false, then ignore package-lock.json files when installing. This will also prevent writing package-lock.json if save is true.

-

When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use npm prune.

This configuration does not affect npm ci.

diff --git a/deps/npm/lib/commands/doctor.js b/deps/npm/lib/commands/doctor.js index ca0438f1a24815..f5bee1eb83f6cb 100644 --- a/deps/npm/lib/commands/doctor.js +++ b/deps/npm/lib/commands/doctor.js @@ -1,5 +1,4 @@ const cacache = require('cacache') -const chalk = require('chalk') const fs = require('fs') const fetch = require('make-fetch-happen') const table = require('text-table') @@ -102,28 +101,19 @@ class Doctor extends BaseCommand { messages.push(line) } - const outHead = ['Check', 'Value', 'Recommendation/Notes'].map( - !this.npm.color ? h => h : h => chalk.underline(h) - ) + const outHead = ['Check', 'Value', 'Recommendation/Notes'].map(h => this.npm.chalk.underline(h)) let allOk = true - const outBody = messages.map( - !this.npm.color - ? item => { - allOk = allOk && item[1] - item[1] = item[1] ? 'ok' : 'not ok' - item[2] = String(item[2]) - return item - } - : item => { - allOk = allOk && item[1] - if (!item[1]) { - item[0] = chalk.red(item[0]) - item[2] = chalk.magenta(String(item[2])) - } - item[1] = item[1] ? chalk.green('ok') : chalk.red('not ok') - return item - } - ) + const outBody = messages.map(item => { + if (!item[1]) { + allOk = false + item[0] = this.npm.chalk.red(item[0]) + item[1] = this.npm.chalk.red('not ok') + item[2] = this.npm.chalk.magenta(String(item[2])) + } else { + item[1] = this.npm.chalk.green('ok') + } + return item + }) const outTable = [outHead, ...outBody] const tableOpts = { stringLength: s => ansiTrim(s).length, diff --git a/deps/npm/lib/commands/exec.js b/deps/npm/lib/commands/exec.js index f764cea528adba..d9a686cc9a3be7 100644 --- a/deps/npm/lib/commands/exec.js +++ b/deps/npm/lib/commands/exec.js @@ -73,6 +73,9 @@ class Exec extends BaseCommand { return libexec({ ...flatOptions, + // we explicitly set packageLockOnly to false because if it's true + // when we try to install a missing package, we won't actually install it + packageLockOnly: false, args, call, localBin, diff --git a/deps/npm/lib/commands/owner.js b/deps/npm/lib/commands/owner.js index 285b06be8e5fe1..9338b22a5e8574 100644 --- a/deps/npm/lib/commands/owner.js +++ b/deps/npm/lib/commands/owner.js @@ -22,6 +22,8 @@ class Owner extends BaseCommand { static params = [ 'registry', 'otp', + 'workspace', + 'workspaces', ] static usage = [ @@ -69,22 +71,43 @@ class Owner extends BaseCommand { } async exec ([action, ...args]) { - switch (action) { - case 'ls': - case 'list': - return this.ls(args[0]) - case 'add': - return this.changeOwners(args[0], args[1], 'add') - case 'rm': - case 'remove': - return this.changeOwners(args[0], args[1], 'rm') - default: + if (action === 'ls' || action === 'list') { + await this.ls(args[0]) + } else if (action === 'add') { + await this.changeOwners(args[0], args[1], 'add') + } else if (action === 'rm' || action === 'remove') { + await this.changeOwners(args[0], args[1], 'rm') + } else { + throw this.usageError() + } + } + + async execWorkspaces ([action, ...args], filters) { + await this.setWorkspaces(filters) + // ls pkg or owner add/rm package + if ((action === 'ls' && args.length > 0) || args.length > 1) { + const implicitWorkspaces = this.npm.config.get('workspace', 'default') + if (implicitWorkspaces.length === 0) { + log.warn(`Ignoring specified workspace(s)`) + } + return this.exec([action, ...args]) + } + + for (const [name] of this.workspaces) { + if (action === 'ls' || action === 'list') { + await this.ls(name) + } else if (action === 'add') { + await this.changeOwners(args[0], name, 'add') + } else if (action === 'rm' || action === 'remove') { + await this.changeOwners(args[0], name, 'rm') + } else { throw this.usageError() + } } } async ls (pkg) { - pkg = await this.getPkg(pkg) + pkg = await this.getPkg(this.npm.prefix, pkg) const spec = npa(pkg) try { @@ -101,12 +124,12 @@ class Owner extends BaseCommand { } } - async getPkg (pkg) { + async getPkg (prefix, pkg) { if (!pkg) { if (this.npm.config.get('global')) { throw this.usageError() } - const { name } = await readJson(resolve(this.npm.prefix, 'package.json')) + const { name } = await readJson(resolve(prefix, 'package.json')) if (!name) { throw this.usageError() } @@ -121,7 +144,7 @@ class Owner extends BaseCommand { throw this.usageError() } - pkg = await this.getPkg(pkg) + pkg = await this.getPkg(this.npm.prefix, pkg) log.verbose(`owner ${addOrRm}`, '%s to %s', user, pkg) const spec = npa(pkg) diff --git a/deps/npm/lib/commands/publish.js b/deps/npm/lib/commands/publish.js index ff303669387868..cbf0ccf4d65810 100644 --- a/deps/npm/lib/commands/publish.js +++ b/deps/npm/lib/commands/publish.js @@ -7,7 +7,6 @@ const runScript = require('@npmcli/run-script') const pacote = require('pacote') const npa = require('npm-package-arg') const npmFetch = require('npm-registry-fetch') -const chalk = require('chalk') const replaceInfo = require('../utils/replace-info.js') const otplease = require('../utils/otplease.js') @@ -151,8 +150,6 @@ class Publish extends BaseCommand { const results = {} const json = this.npm.config.get('json') const { silent } = this.npm - const noop = a => a - const color = this.npm.color ? chalk : { green: noop, bold: noop } await this.setWorkspaces(filters) for (const [name, workspace] of this.workspaces.entries()) { @@ -164,9 +161,9 @@ class Publish extends BaseCommand { log.warn( 'publish', `Skipping workspace ${ - color.green(name) + this.npm.chalk.green(name) }, marked as ${ - color.bold('private') + this.npm.chalk.bold('private') }` ) continue diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index c819a0807b507d..732362565e2903 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -1,16 +1,15 @@ const EventEmitter = require('events') const { resolve, dirname, join } = require('path') const Config = require('@npmcli/config') +const chalk = require('chalk') +const which = require('which') +const fs = require('@npmcli/fs') // Patch the global fs module here at the app level require('graceful-fs').gracefulify(require('fs')) const { definitions, flatten, shorthands } = require('./utils/config/index.js') const usage = require('./utils/npm-usage.js') - -const which = require('which') -const fs = require('@npmcli/fs') - const LogFile = require('./utils/log-file.js') const Timers = require('./utils/timers.js') const Display = require('./utils/display.js') @@ -37,6 +36,7 @@ class Npm extends EventEmitter { #tmpFolder = null #title = 'npm' #argvClean = [] + #chalk = null #logFile = new LogFile() #display = new Display() @@ -322,6 +322,17 @@ class Npm extends EventEmitter { return this.flatOptions.color } + get chalk () { + if (!this.#chalk) { + let level = chalk.level + if (!this.color) { + level = 0 + } + this.#chalk = new chalk.Instance({ level }) + } + return this.#chalk + } + get logColor () { return this.flatOptions.logColor } diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js index 4a1f971d85436c..6f1b1a7244a504 100644 --- a/deps/npm/lib/utils/config/definitions.js +++ b/deps/npm/lib/utils/config/definitions.js @@ -1448,10 +1448,6 @@ define('package-lock', { This will also prevent _writing_ \`package-lock.json\` if \`save\` is true. - When package package-locks are disabled, automatic pruning of extraneous - modules will also be disabled. To remove extraneous modules with - package-locks disabled use \`npm prune\`. - This configuration does not affect \`npm ci\`. `, flatten: (key, obj, flatOptions) => { diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 79ca419e53b813..66e859f6a2a6d8 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ACCESS" "1" "April 2022" "" "" +.TH "NPM\-ACCESS" "1" "May 2022" "" "" .SH "NAME" \fBnpm-access\fR \- Set access level on published packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index 6e755bf90e968e..08a78c48e85522 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ADDUSER" "1" "April 2022" "" "" +.TH "NPM\-ADDUSER" "1" "May 2022" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SS Synopsis diff --git a/deps/npm/man/man1/npm-audit.1 b/deps/npm/man/man1/npm-audit.1 index 5954f069d9a9f9..d84fdd59e583c3 100644 --- a/deps/npm/man/man1/npm-audit.1 +++ b/deps/npm/man/man1/npm-audit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-AUDIT" "1" "April 2022" "" "" +.TH "NPM\-AUDIT" "1" "May 2022" "" "" .SH "NAME" \fBnpm-audit\fR \- Run a security audit .SS Synopsis diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index b6229ecc46433f..efe38ee8d91181 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "1" "April 2022" "" "" +.TH "NPM\-BIN" "1" "May 2022" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SS Synopsis diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index d211456d50e94f..f56c459c6d73e1 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUGS" "1" "April 2022" "" "" +.TH "NPM\-BUGS" "1" "May 2022" "" "" .SH "NAME" \fBnpm-bugs\fR \- Report bugs for a package in a web browser .SS Synopsis diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index a57d0343e0de72..1b5e5a843725b3 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "1" "April 2022" "" "" +.TH "NPM\-CACHE" "1" "May 2022" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SS Synopsis diff --git a/deps/npm/man/man1/npm-ci.1 b/deps/npm/man/man1/npm-ci.1 index 0cfdc6cf07452d..3aefdfc80b84e3 100644 --- a/deps/npm/man/man1/npm-ci.1 +++ b/deps/npm/man/man1/npm-ci.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CI" "1" "April 2022" "" "" +.TH "NPM\-CI" "1" "May 2022" "" "" .SH "NAME" \fBnpm-ci\fR \- Install a project with a clean slate .SS Synopsis diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index 6b829353d44896..87eb098ce92098 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM\-COMPLETION" "1" "April 2022" "" "" +.TH "NPM\-COMPLETION" "1" "May 2022" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SS Synopsis diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 4517877124b65c..19f9ab6a06deb7 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "1" "April 2022" "" "" +.TH "NPM\-CONFIG" "1" "May 2022" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SS Synopsis diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 71c319f04a27d0..c337c715017a57 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEDUPE" "1" "April 2022" "" "" +.TH "NPM\-DEDUPE" "1" "May 2022" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication in the package tree .SS Synopsis @@ -141,10 +141,6 @@ Type: Boolean If set to false, then ignore \fBpackage\-lock\.json\fP files when installing\. This will also prevent \fIwriting\fR \fBpackage\-lock\.json\fP if \fBsave\fP is true\. .P -When package package\-locks are disabled, automatic pruning of extraneous -modules will also be disabled\. To remove extraneous modules with -package\-locks disabled use \fBnpm prune\fP\|\. -.P This configuration does not affect \fBnpm ci\fP\|\. .SS \fBomit\fP .RS 0 diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index bf7fcfe728cd0b..594b1689b73f62 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "1" "April 2022" "" "" +.TH "NPM\-DEPRECATE" "1" "May 2022" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-diff.1 b/deps/npm/man/man1/npm-diff.1 index 6da0dd52e189e5..90bdfa94760483 100644 --- a/deps/npm/man/man1/npm-diff.1 +++ b/deps/npm/man/man1/npm-diff.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DIFF" "1" "April 2022" "" "" +.TH "NPM\-DIFF" "1" "May 2022" "" "" .SH "NAME" \fBnpm-diff\fR \- The registry diff command .SS Synopsis diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index 7130524d2642df..33166e1c45a244 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DIST\-TAG" "1" "April 2022" "" "" +.TH "NPM\-DIST\-TAG" "1" "May 2022" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags .SS Synopsis diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index 62a633dff1c397..e7dc87e834e440 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "1" "April 2022" "" "" +.TH "NPM\-DOCS" "1" "May 2022" "" "" .SH "NAME" \fBnpm-docs\fR \- Open documentation for a package in a web browser .SS Synopsis diff --git a/deps/npm/man/man1/npm-doctor.1 b/deps/npm/man/man1/npm-doctor.1 index 6a3b9b20fb3bda..4c7dd20a9df826 100644 --- a/deps/npm/man/man1/npm-doctor.1 +++ b/deps/npm/man/man1/npm-doctor.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCTOR" "1" "April 2022" "" "" +.TH "NPM\-DOCTOR" "1" "May 2022" "" "" .SH "NAME" \fBnpm-doctor\fR \- Check your npm environment .SS Synopsis diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index 433e8f7b4ae5c9..d5e4fd9398fa6d 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "1" "April 2022" "" "" +.TH "NPM\-EDIT" "1" "May 2022" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SS Synopsis diff --git a/deps/npm/man/man1/npm-exec.1 b/deps/npm/man/man1/npm-exec.1 index 01db093870fb9d..1203e1427e0b90 100644 --- a/deps/npm/man/man1/npm-exec.1 +++ b/deps/npm/man/man1/npm-exec.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXEC" "1" "April 2022" "" "" +.TH "NPM\-EXEC" "1" "May 2022" "" "" .SH "NAME" \fBnpm-exec\fR \- Run a command from a local or remote npm package .SS Synopsis diff --git a/deps/npm/man/man1/npm-explain.1 b/deps/npm/man/man1/npm-explain.1 index a8d343c1d19f5a..29866d5c36b214 100644 --- a/deps/npm/man/man1/npm-explain.1 +++ b/deps/npm/man/man1/npm-explain.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLAIN" "1" "April 2022" "" "" +.TH "NPM\-EXPLAIN" "1" "May 2022" "" "" .SH "NAME" \fBnpm-explain\fR \- Explain installed packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index cdb01df980fedb..266248676dfacb 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLORE" "1" "April 2022" "" "" +.TH "NPM\-EXPLORE" "1" "May 2022" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SS Synopsis diff --git a/deps/npm/man/man1/npm-find-dupes.1 b/deps/npm/man/man1/npm-find-dupes.1 index d89bd9f390829e..4f1652d54bb5bc 100644 --- a/deps/npm/man/man1/npm-find-dupes.1 +++ b/deps/npm/man/man1/npm-find-dupes.1 @@ -1,4 +1,4 @@ -.TH "NPM\-FIND\-DUPES" "1" "April 2022" "" "" +.TH "NPM\-FIND\-DUPES" "1" "May 2022" "" "" .SH "NAME" \fBnpm-find-dupes\fR \- Find duplication in the package tree .SS Synopsis @@ -75,10 +75,6 @@ Type: Boolean If set to false, then ignore \fBpackage\-lock\.json\fP files when installing\. This will also prevent \fIwriting\fR \fBpackage\-lock\.json\fP if \fBsave\fP is true\. .P -When package package\-locks are disabled, automatic pruning of extraneous -modules will also be disabled\. To remove extraneous modules with -package\-locks disabled use \fBnpm prune\fP\|\. -.P This configuration does not affect \fBnpm ci\fP\|\. .SS \fBomit\fP .RS 0 diff --git a/deps/npm/man/man1/npm-fund.1 b/deps/npm/man/man1/npm-fund.1 index d501652230fa85..44d848357d5281 100644 --- a/deps/npm/man/man1/npm-fund.1 +++ b/deps/npm/man/man1/npm-fund.1 @@ -1,4 +1,4 @@ -.TH "NPM\-FUND" "1" "April 2022" "" "" +.TH "NPM\-FUND" "1" "May 2022" "" "" .SH "NAME" \fBnpm-fund\fR \- Retrieve funding information .SS Synopsis diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index 73ac93576c840d..f4e9ec4c91e4d5 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "1" "April 2022" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "May 2022" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SS Synopsis diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 8af1b37e83c135..83cb8f92d04db8 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP" "1" "April 2022" "" "" +.TH "NPM\-HELP" "1" "May 2022" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SS Synopsis diff --git a/deps/npm/man/man1/npm-hook.1 b/deps/npm/man/man1/npm-hook.1 index 32d92b03bc0fb4..27b8888c8cda20 100644 --- a/deps/npm/man/man1/npm-hook.1 +++ b/deps/npm/man/man1/npm-hook.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HOOK" "1" "April 2022" "" "" +.TH "NPM\-HOOK" "1" "May 2022" "" "" .SH "NAME" \fBnpm-hook\fR \- Manage registry hooks .SS Synopsis diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 30d3890d21f12d..829b1b4752bdb5 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INIT" "1" "April 2022" "" "" +.TH "NPM\-INIT" "1" "May 2022" "" "" .SH "NAME" \fBnpm-init\fR \- Create a package\.json file .SS Synopsis diff --git a/deps/npm/man/man1/npm-install-ci-test.1 b/deps/npm/man/man1/npm-install-ci-test.1 index 3c253a0364c1c2..aeddd06d146dda 100644 --- a/deps/npm/man/man1/npm-install-ci-test.1 +++ b/deps/npm/man/man1/npm-install-ci-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL\-CI\-TEST" "1" "April 2022" "" "" +.TH "NPM\-INSTALL\-CI\-TEST" "1" "May 2022" "" "" .SH "NAME" \fBnpm-install-ci-test\fR \- Install a project with a clean slate and run tests .SS Synopsis diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index b28c8300e19674..17aadace62fc2a 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL\-TEST" "1" "April 2022" "" "" +.TH "NPM\-INSTALL\-TEST" "1" "May 2022" "" "" .SH "NAME" \fBnpm-install-test\fR \- Install package(s) and run tests .SS Synopsis @@ -155,10 +155,6 @@ Type: Boolean If set to false, then ignore \fBpackage\-lock\.json\fP files when installing\. This will also prevent \fIwriting\fR \fBpackage\-lock\.json\fP if \fBsave\fP is true\. .P -When package package\-locks are disabled, automatic pruning of extraneous -modules will also be disabled\. To remove extraneous modules with -package\-locks disabled use \fBnpm prune\fP\|\. -.P This configuration does not affect \fBnpm ci\fP\|\. .SS \fBforeground\-scripts\fP .RS 0 diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index 1f3bf51ada1feb..7630adb0e28045 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "1" "April 2022" "" "" +.TH "NPM\-INSTALL" "1" "May 2022" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SS Synopsis @@ -566,10 +566,6 @@ Type: Boolean If set to false, then ignore \fBpackage\-lock\.json\fP files when installing\. This will also prevent \fIwriting\fR \fBpackage\-lock\.json\fP if \fBsave\fP is true\. .P -When package package\-locks are disabled, automatic pruning of extraneous -modules will also be disabled\. To remove extraneous modules with -package\-locks disabled use \fBnpm prune\fP\|\. -.P This configuration does not affect \fBnpm ci\fP\|\. .SS \fBforeground\-scripts\fP .RS 0 diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index d726e669dd2411..f59c74651940c5 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "1" "April 2022" "" "" +.TH "NPM\-LINK" "1" "May 2022" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SS Synopsis @@ -223,10 +223,6 @@ Type: Boolean If set to false, then ignore \fBpackage\-lock\.json\fP files when installing\. This will also prevent \fIwriting\fR \fBpackage\-lock\.json\fP if \fBsave\fP is true\. .P -When package package\-locks are disabled, automatic pruning of extraneous -modules will also be disabled\. To remove extraneous modules with -package\-locks disabled use \fBnpm prune\fP\|\. -.P This configuration does not affect \fBnpm ci\fP\|\. .SS \fBomit\fP .RS 0 diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index 01dd67cdc1b481..8307918100789e 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LOGOUT" "1" "April 2022" "" "" +.TH "NPM\-LOGOUT" "1" "May 2022" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index 6485cb3650decf..df207311c04553 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "1" "April 2022" "" "" +.TH "NPM\-LS" "1" "May 2022" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SS Synopsis @@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@8\.8\.0 /path/to/npm +npm@8\.9\.0 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm-org.1 b/deps/npm/man/man1/npm-org.1 index 841a3b5d7a4251..28d623b204b760 100644 --- a/deps/npm/man/man1/npm-org.1 +++ b/deps/npm/man/man1/npm-org.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ORG" "1" "April 2022" "" "" +.TH "NPM\-ORG" "1" "May 2022" "" "" .SH "NAME" \fBnpm-org\fR \- Manage orgs .SS Synopsis diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 46921b5a8ef0df..9fe1ddf692e56e 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "1" "April 2022" "" "" +.TH "NPM\-OUTDATED" "1" "May 2022" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index d67b4cf339fd6e..09f488ed8ea57f 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "1" "April 2022" "" "" +.TH "NPM\-OWNER" "1" "May 2022" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SS Synopsis @@ -62,6 +62,60 @@ when publishing or changing package permissions with \fBnpm access\fP\|\. .P If not set, and a registry response fails with a challenge for a one\-time password, npm will prompt on the command line for one\. +.SS \fBworkspace\fP +.RS 0 +.IP \(bu 2 +Default: +.IP \(bu 2 +Type: String (can be set multiple times) + +.RE +.P +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option\. +.P +Valid values for the \fBworkspace\fP config are either: +.RS 0 +.IP \(bu 2 +Workspace names +.IP \(bu 2 +Path to a workspace directory +.IP \(bu 2 +Path to a parent workspace directory (will result in selecting all +workspaces within that folder) + +.RE +.P +When set for the \fBnpm init\fP command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project\. +.P +This value is not exported to the environment for child processes\. +.SS \fBworkspaces\fP +.RS 0 +.IP \(bu 2 +Default: null +.IP \(bu 2 +Type: null or Boolean + +.RE +.P +Set to true to run the command in the context of \fBall\fR configured +workspaces\. +.P +Explicitly setting this to false will cause commands like \fBinstall\fP to +ignore workspaces altogether\. When not set explicitly: +.RS 0 +.IP \(bu 2 +Commands that operate on the \fBnode_modules\fP tree (install, update, etc\.) +will link workspaces into the \fBnode_modules\fP folder\. \- Commands that do +other things (test, exec, publish, etc\.) will operate on the root project, +\fIunless\fR one or more workspaces are specified in the \fBworkspace\fP config\. + +.RE +.P +This value is not exported to the environment for child processes\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 3eabcc79878c30..94a0df9efc3bb5 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "1" "April 2022" "" "" +.TH "NPM\-PACK" "1" "May 2022" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index c564f5fdeacd20..bf065b16f1573d 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PING" "1" "April 2022" "" "" +.TH "NPM\-PING" "1" "May 2022" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-pkg.1 b/deps/npm/man/man1/npm-pkg.1 index 577e030d42c4b1..1307a6664b1e64 100644 --- a/deps/npm/man/man1/npm-pkg.1 +++ b/deps/npm/man/man1/npm-pkg.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PKG" "1" "April 2022" "" "" +.TH "NPM\-PKG" "1" "May 2022" "" "" .SH "NAME" \fBnpm-pkg\fR \- Manages your package\.json .SS Synopsis @@ -68,6 +68,15 @@ Returned values are always in \fBjson\fR format\. .nf npm pkg get contributors[0]\.email .fi +.RE + For complex fields you can also name a property in square brackets + to specifically select a child field\. This is especially helpful + with the exports object: +.P +.RS 2 +.nf + npm pkg get "exports[\.]\.require" +.fi .RE .IP \(bu 2 \fBnpm pkg set =\fP diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index 356ad4e8636b93..2434c34678e71f 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "1" "April 2022" "" "" +.TH "NPM\-PREFIX" "1" "May 2022" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SS Synopsis diff --git a/deps/npm/man/man1/npm-profile.1 b/deps/npm/man/man1/npm-profile.1 index d546955b8b6afd..a7a1733b63d179 100644 --- a/deps/npm/man/man1/npm-profile.1 +++ b/deps/npm/man/man1/npm-profile.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PROFILE" "1" "April 2022" "" "" +.TH "NPM\-PROFILE" "1" "May 2022" "" "" .SH "NAME" \fBnpm-profile\fR \- Change settings on your registry profile .SS Synopsis diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index a3d43f6455fc5c..a0d23793206b3b 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "1" "April 2022" "" "" +.TH "NPM\-PRUNE" "1" "May 2022" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index 4fabf6e3687545..241f7cffd2045f 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "1" "April 2022" "" "" +.TH "NPM\-PUBLISH" "1" "May 2022" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index bd5a47263f0e2a..dab000878d1c63 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "1" "April 2022" "" "" +.TH "NPM\-REBUILD" "1" "May 2022" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 0b298e82969ef5..7fd6c738c9f7a0 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "1" "April 2022" "" "" +.TH "NPM\-REPO" "1" "May 2022" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SS Synopsis diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 5ce2cc44c48ad3..9866fa5792cd6d 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RESTART" "1" "April 2022" "" "" +.TH "NPM\-RESTART" "1" "May 2022" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index dcc8c34de675bb..4e1a94be7b4b65 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "1" "April 2022" "" "" +.TH "NPM\-ROOT" "1" "May 2022" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SS Synopsis diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index edf0561cec05b3..b9e2afb2696852 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "April 2022" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "May 2022" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SS Synopsis diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index ae56a5687ea8c2..51fa43b80e73c8 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "1" "April 2022" "" "" +.TH "NPM\-SEARCH" "1" "May 2022" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-set-script.1 b/deps/npm/man/man1/npm-set-script.1 index e82c766a83fb46..96ee6e3e346617 100644 --- a/deps/npm/man/man1/npm-set-script.1 +++ b/deps/npm/man/man1/npm-set-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SET\-SCRIPT" "1" "April 2022" "" "" +.TH "NPM\-SET\-SCRIPT" "1" "May 2022" "" "" .SH "NAME" \fBnpm-set-script\fR \- Set tasks in the scripts section of package\.json .SS Synopsis diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index bd17cbf0090b62..fa87fb7e72b2d4 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "1" "April 2022" "" "" +.TH "NPM\-SHRINKWRAP" "1" "May 2022" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions for publication .SS Synopsis diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 0bae2d1c1ce292..6075139da7cbb2 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STAR" "1" "April 2022" "" "" +.TH "NPM\-STAR" "1" "May 2022" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 65ed2aff68186c..aa290760aad377 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STARS" "1" "April 2022" "" "" +.TH "NPM\-STARS" "1" "May 2022" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SS Synopsis diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index 4f2044a5435780..f45e4a2a24c3e7 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "1" "April 2022" "" "" +.TH "NPM\-START" "1" "May 2022" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 487837323a6f8a..a7bb25b3a44dd1 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "1" "April 2022" "" "" +.TH "NPM\-STOP" "1" "May 2022" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index 31a27eaaf7b211..05f508427a4a08 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEAM" "1" "April 2022" "" "" +.TH "NPM\-TEAM" "1" "May 2022" "" "" .SH "NAME" \fBnpm-team\fR \- Manage organization teams and team memberships .SS Synopsis diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index b2e4dd13f0996a..590d9519df51f6 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "1" "April 2022" "" "" +.TH "NPM\-TEST" "1" "May 2022" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-token.1 b/deps/npm/man/man1/npm-token.1 index b95b41974f5512..f2e32ea27fdbec 100644 --- a/deps/npm/man/man1/npm-token.1 +++ b/deps/npm/man/man1/npm-token.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TOKEN" "1" "April 2022" "" "" +.TH "NPM\-TOKEN" "1" "May 2022" "" "" .SH "NAME" \fBnpm-token\fR \- Manage your authentication tokens .SS Synopsis diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 387a037ca43183..d918034ba19490 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNINSTALL" "1" "April 2022" "" "" +.TH "NPM\-UNINSTALL" "1" "May 2022" "" "" .SH "NAME" \fBnpm-uninstall\fR \- Remove a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index 7303db9137420b..20198422799984 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "1" "April 2022" "" "" +.TH "NPM\-UNPUBLISH" "1" "May 2022" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-unstar.1 b/deps/npm/man/man1/npm-unstar.1 index ed84041591e119..1fa7b88c64a5d4 100644 --- a/deps/npm/man/man1/npm-unstar.1 +++ b/deps/npm/man/man1/npm-unstar.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNSTAR" "1" "April 2022" "" "" +.TH "NPM\-UNSTAR" "1" "May 2022" "" "" .SH "NAME" \fBnpm-unstar\fR \- Remove an item from your favorite packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index e681d6a5543169..fa2903a18c26b5 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "April 2022" "" "" +.TH "NPM\-UPDATE" "1" "May 2022" "" "" .SH "NAME" \fBnpm-update\fR \- Update packages .SS Synopsis @@ -279,10 +279,6 @@ Type: Boolean If set to false, then ignore \fBpackage\-lock\.json\fP files when installing\. This will also prevent \fIwriting\fR \fBpackage\-lock\.json\fP if \fBsave\fP is true\. .P -When package package\-locks are disabled, automatic pruning of extraneous -modules will also be disabled\. To remove extraneous modules with -package\-locks disabled use \fBnpm prune\fP\|\. -.P This configuration does not affect \fBnpm ci\fP\|\. .SS \fBforeground\-scripts\fP .RS 0 diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 8d24aed5274dea..444c0709759de0 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "1" "April 2022" "" "" +.TH "NPM\-VERSION" "1" "May 2022" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SS Synopsis diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index 877d8a8aa3d870..b77c7705667115 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "1" "April 2022" "" "" +.TH "NPM\-VIEW" "1" "May 2022" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SS Synopsis diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index 607d1a55c5e1e5..d79c448a7a1141 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "1" "April 2022" "" "" +.TH "NPM\-WHOAMI" "1" "May 2022" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SS Synopsis diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 3147db3ad76ee1..cbfc8e8ec6a572 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,10 +1,10 @@ -.TH "NPM" "1" "April 2022" "" "" +.TH "NPM" "1" "May 2022" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SS Synopsis .SS Version .P -8\.8\.0 +8\.9\.0 .SS Description .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man1/npx.1 b/deps/npm/man/man1/npx.1 index c1230a949228e3..51634bc8e8f9f3 100644 --- a/deps/npm/man/man1/npx.1 +++ b/deps/npm/man/man1/npx.1 @@ -1,4 +1,4 @@ -.TH "NPX" "1" "April 2022" "" "" +.TH "NPX" "1" "May 2022" "" "" .SH "NAME" \fBnpx\fR \- Run a command from a local or remote npm package .SS Synopsis diff --git a/deps/npm/man/man5/folders.5 b/deps/npm/man/man5/folders.5 index 10e161c6796751..74403f97bfccae 100644 --- a/deps/npm/man/man5/folders.5 +++ b/deps/npm/man/man5/folders.5 @@ -1,4 +1,4 @@ -.TH "FOLDERS" "5" "April 2022" "" "" +.TH "FOLDERS" "5" "May 2022" "" "" .SH "NAME" \fBfolders\fR \- Folder Structures Used by npm .SS Description diff --git a/deps/npm/man/man5/install.5 b/deps/npm/man/man5/install.5 index ccccf3a696fdad..40d8a825c9ef54 100644 --- a/deps/npm/man/man5/install.5 +++ b/deps/npm/man/man5/install.5 @@ -1,4 +1,4 @@ -.TH "INSTALL" "5" "April 2022" "" "" +.TH "INSTALL" "5" "May 2022" "" "" .SH "NAME" \fBinstall\fR \- Download and install node and npm .SS Description diff --git a/deps/npm/man/man5/npm-shrinkwrap-json.5 b/deps/npm/man/man5/npm-shrinkwrap-json.5 index dcc5cca516ae0b..2928a9bae6cfdb 100644 --- a/deps/npm/man/man5/npm-shrinkwrap-json.5 +++ b/deps/npm/man/man5/npm-shrinkwrap-json.5 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP\.JSON" "5" "April 2022" "" "" +.TH "NPM\-SHRINKWRAP\.JSON" "5" "May 2022" "" "" .SH "NAME" \fBnpm-shrinkwrap.json\fR \- A publishable lockfile .SS Description diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index 0e3e8edefa21a3..429bcc3875dd50 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "April 2022" "" "" +.TH "NPMRC" "5" "May 2022" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SS Description diff --git a/deps/npm/man/man5/package-json.5 b/deps/npm/man/man5/package-json.5 index b799144aaa36c0..47156509747685 100644 --- a/deps/npm/man/man5/package-json.5 +++ b/deps/npm/man/man5/package-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "April 2022" "" "" +.TH "PACKAGE\.JSON" "5" "May 2022" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SS Description diff --git a/deps/npm/man/man5/package-lock-json.5 b/deps/npm/man/man5/package-lock-json.5 index dd0d17b88cb4a2..569d9c5ae679d9 100644 --- a/deps/npm/man/man5/package-lock-json.5 +++ b/deps/npm/man/man5/package-lock-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\-LOCK\.JSON" "5" "April 2022" "" "" +.TH "PACKAGE\-LOCK\.JSON" "5" "May 2022" "" "" .SH "NAME" \fBpackage-lock.json\fR \- A manifestation of the manifest .SS Description diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7 index 3bb501bcdae6f4..eee1ac6c5f2fe1 100644 --- a/deps/npm/man/man7/config.7 +++ b/deps/npm/man/man7/config.7 @@ -1,4 +1,4 @@ -.TH "CONFIG" "7" "April 2022" "" "" +.TH "CONFIG" "7" "May 2022" "" "" .SH "NAME" \fBconfig\fR \- More than you probably want to know about npm configuration .SS Description @@ -1284,10 +1284,6 @@ Type: Boolean If set to false, then ignore \fBpackage\-lock\.json\fP files when installing\. This will also prevent \fIwriting\fR \fBpackage\-lock\.json\fP if \fBsave\fP is true\. .P -When package package\-locks are disabled, automatic pruning of extraneous -modules will also be disabled\. To remove extraneous modules with -package\-locks disabled use \fBnpm prune\fP\|\. -.P This configuration does not affect \fBnpm ci\fP\|\. .SS \fBpackage\-lock\-only\fP .RS 0 diff --git a/deps/npm/man/man7/developers.7 b/deps/npm/man/man7/developers.7 index 7b50a0dc6c5acf..12e9b535fce56a 100644 --- a/deps/npm/man/man7/developers.7 +++ b/deps/npm/man/man7/developers.7 @@ -1,4 +1,4 @@ -.TH "DEVELOPERS" "7" "April 2022" "" "" +.TH "DEVELOPERS" "7" "May 2022" "" "" .SH "NAME" \fBdevelopers\fR \- Developer Guide .SS Description diff --git a/deps/npm/man/man7/logging.7 b/deps/npm/man/man7/logging.7 index 41634c61a61bb9..ea0a7a8f1873b0 100644 --- a/deps/npm/man/man7/logging.7 +++ b/deps/npm/man/man7/logging.7 @@ -1,4 +1,4 @@ -.TH "LOGGING" "7" "April 2022" "" "" +.TH "LOGGING" "7" "May 2022" "" "" .SH "NAME" \fBLogging\fR \- Why, What & How We Log .SS Description diff --git a/deps/npm/man/man7/orgs.7 b/deps/npm/man/man7/orgs.7 index 0df926774952c2..84c949949dc60c 100644 --- a/deps/npm/man/man7/orgs.7 +++ b/deps/npm/man/man7/orgs.7 @@ -1,4 +1,4 @@ -.TH "ORGS" "7" "April 2022" "" "" +.TH "ORGS" "7" "May 2022" "" "" .SH "NAME" \fBorgs\fR \- Working with Teams & Orgs .SS Description diff --git a/deps/npm/man/man7/registry.7 b/deps/npm/man/man7/registry.7 index dcdb33934bea20..eff3f31ab64127 100644 --- a/deps/npm/man/man7/registry.7 +++ b/deps/npm/man/man7/registry.7 @@ -1,4 +1,4 @@ -.TH "REGISTRY" "7" "April 2022" "" "" +.TH "REGISTRY" "7" "May 2022" "" "" .SH "NAME" \fBregistry\fR \- The JavaScript Package Registry .SS Description diff --git a/deps/npm/man/man7/removal.7 b/deps/npm/man/man7/removal.7 index 5743d339ecd144..27bb1de4c99af1 100644 --- a/deps/npm/man/man7/removal.7 +++ b/deps/npm/man/man7/removal.7 @@ -1,4 +1,4 @@ -.TH "REMOVAL" "7" "April 2022" "" "" +.TH "REMOVAL" "7" "May 2022" "" "" .SH "NAME" \fBremoval\fR \- Cleaning the Slate .SS Synopsis diff --git a/deps/npm/man/man7/scope.7 b/deps/npm/man/man7/scope.7 index 0fd24d0fcb6ac1..5d4f0e7270a02b 100644 --- a/deps/npm/man/man7/scope.7 +++ b/deps/npm/man/man7/scope.7 @@ -1,4 +1,4 @@ -.TH "SCOPE" "7" "April 2022" "" "" +.TH "SCOPE" "7" "May 2022" "" "" .SH "NAME" \fBscope\fR \- Scoped packages .SS Description diff --git a/deps/npm/man/man7/scripts.7 b/deps/npm/man/man7/scripts.7 index 9cedf62bc8cbf1..2ced12c63d9006 100644 --- a/deps/npm/man/man7/scripts.7 +++ b/deps/npm/man/man7/scripts.7 @@ -1,4 +1,4 @@ -.TH "SCRIPTS" "7" "April 2022" "" "" +.TH "SCRIPTS" "7" "May 2022" "" "" .SH "NAME" \fBscripts\fR \- How npm handles the "scripts" field .SS Description diff --git a/deps/npm/man/man7/workspaces.7 b/deps/npm/man/man7/workspaces.7 index b5d6b3bde3ddb6..494b4068621421 100644 --- a/deps/npm/man/man7/workspaces.7 +++ b/deps/npm/man/man7/workspaces.7 @@ -1,4 +1,4 @@ -.TH "WORKSPACES" "7" "April 2022" "" "" +.TH "WORKSPACES" "7" "May 2022" "" "" .SH "NAME" \fBworkspaces\fR \- Working with workspaces .SS Description diff --git a/deps/npm/node_modules/cacache/lib/content/read.js b/deps/npm/node_modules/cacache/lib/content/read.js index 8bffb2af83caba..0aeb454725bd00 100644 --- a/deps/npm/node_modules/cacache/lib/content/read.js +++ b/deps/npm/node_modules/cacache/lib/content/read.js @@ -10,6 +10,7 @@ const Pipeline = require('minipass-pipeline') const lstat = util.promisify(fs.lstat) const readFile = util.promisify(fs.readFile) +const copyFile = util.promisify(fs.copyFile) module.exports = read @@ -90,12 +91,8 @@ function readStream (cache, integrity, opts = {}) { return stream } -let copyFile -if (fs.copyFile) { - module.exports.copy = copy - module.exports.copy.sync = copySync - copyFile = util.promisify(fs.copyFile) -} +module.exports.copy = copy +module.exports.copy.sync = copySync function copy (cache, integrity, dest) { return withContentSri(cache, integrity, (cpath, sri) => { diff --git a/deps/npm/node_modules/cacache/lib/content/write.js b/deps/npm/node_modules/cacache/lib/content/write.js index a71e81ad5e150c..b0aa18c12ba78b 100644 --- a/deps/npm/node_modules/cacache/lib/content/write.js +++ b/deps/npm/node_modules/cacache/lib/content/write.js @@ -13,34 +13,37 @@ const path = require('path') const rimraf = util.promisify(require('rimraf')) const ssri = require('ssri') const uniqueFilename = require('unique-filename') -const { disposer } = require('./../util/disposer') const fsm = require('fs-minipass') const writeFile = util.promisify(fs.writeFile) module.exports = write -function write (cache, data, opts = {}) { +async function write (cache, data, opts = {}) { const { algorithms, size, integrity } = opts if (algorithms && algorithms.length > 1) { throw new Error('opts.algorithms only supports a single algorithm for now') } if (typeof size === 'number' && data.length !== size) { - return Promise.reject(sizeError(size, data.length)) + throw sizeError(size, data.length) } const sri = ssri.fromData(data, algorithms ? { algorithms } : {}) if (integrity && !ssri.checkData(data, integrity, opts)) { - return Promise.reject(checksumError(integrity, sri)) + throw checksumError(integrity, sri) } - return disposer(makeTmp(cache, opts), makeTmpDisposer, - (tmp) => { - return writeFile(tmp.target, data, { flag: 'wx' }) - .then(() => moveToDestination(tmp, cache, sri, opts)) - }) - .then(() => ({ integrity: sri, size: data.length })) + const tmp = await makeTmp(cache, opts) + try { + await writeFile(tmp.target, data, { flag: 'wx' }) + await moveToDestination(tmp, cache, sri, opts) + return { integrity: sri, size: data.length } + } finally { + if (!tmp.moved) { + await rimraf(tmp.target) + } + } } module.exports.stream = writeStream @@ -94,18 +97,22 @@ function writeStream (cache, opts = {}) { return new CacacheWriteStream(cache, opts) } -function handleContent (inputStream, cache, opts) { - return disposer(makeTmp(cache, opts), makeTmpDisposer, (tmp) => { - return pipeToTmp(inputStream, cache, tmp.target, opts) - .then((res) => { - return moveToDestination( - tmp, - cache, - res.integrity, - opts - ).then(() => res) - }) - }) +async function handleContent (inputStream, cache, opts) { + const tmp = await makeTmp(cache, opts) + try { + const res = await pipeToTmp(inputStream, cache, tmp.target, opts) + await moveToDestination( + tmp, + cache, + res.integrity, + opts + ) + return res + } finally { + if (!tmp.moved) { + await rimraf(tmp.target) + } + } } function pipeToTmp (inputStream, cache, tmpTarget, opts) { @@ -136,11 +143,7 @@ function pipeToTmp (inputStream, cache, tmpTarget, opts) { outStream ) - return pipeline.promise() - .then(() => ({ integrity, size })) - .catch(er => rimraf(tmpTarget).then(() => { - throw er - })) + return pipeline.promise().then(() => ({ integrity, size })) } function makeTmp (cache, opts) { @@ -151,14 +154,6 @@ function makeTmp (cache, opts) { })) } -function makeTmpDisposer (tmp) { - if (tmp.moved) { - return Promise.resolve() - } - - return rimraf(tmp.target) -} - function moveToDestination (tmp, cache, sri, opts) { const destination = contentPath(cache, sri) const destDir = path.dirname(destination) diff --git a/deps/npm/node_modules/cacache/lib/entry-index.js b/deps/npm/node_modules/cacache/lib/entry-index.js index 426778b8509634..9d4485624acbca 100644 --- a/deps/npm/node_modules/cacache/lib/entry-index.js +++ b/deps/npm/node_modules/cacache/lib/entry-index.js @@ -8,7 +8,6 @@ const path = require('path') const ssri = require('ssri') const uniqueFilename = require('unique-filename') -const { disposer } = require('./util/disposer') const contentPath = require('./content/path') const fixOwner = require('./util/fix-owner') const hashToSegments = require('./util/hash-to-segments') @@ -102,7 +101,12 @@ async function compact (cache, key, matchFn, opts = {}) { } // write the file atomically - await disposer(setup(), teardown, write) + const tmp = await setup() + try { + await write(tmp) + } finally { + await teardown(tmp) + } // we reverse the list we generated such that the newest // entries come first in order to make looping through them easier diff --git a/deps/npm/node_modules/cacache/lib/get.js b/deps/npm/node_modules/cacache/lib/get.js index d9d4bf4c6416fb..58f357b1da3d19 100644 --- a/deps/npm/node_modules/cacache/lib/get.js +++ b/deps/npm/node_modules/cacache/lib/get.js @@ -3,15 +3,11 @@ const Collect = require('minipass-collect') const Minipass = require('minipass') const Pipeline = require('minipass-pipeline') -const fs = require('fs') -const util = require('util') const index = require('./entry-index') const memo = require('./memoization') const read = require('./content/read') -const writeFile = util.promisify(fs.writeFile) - function getData (cache, key, opts = {}) { const { integrity, memoize, size } = opts const memoized = memo.get(cache, key, opts) @@ -209,42 +205,25 @@ function info (cache, key, opts = {}) { module.exports.info = info function copy (cache, key, dest, opts = {}) { - if (read.copy) { - return index.find(cache, key, opts).then((entry) => { - if (!entry) { - throw new index.NotFoundError(cache, key) - } - return read.copy(cache, entry.integrity, dest, opts) - .then(() => { - return { - metadata: entry.metadata, - size: entry.size, - integrity: entry.integrity, - } - }) - }) - } - - return getData(cache, key, opts).then((res) => { - return writeFile(dest, res.data).then(() => { - return { - metadata: res.metadata, - size: res.size, - integrity: res.integrity, - } - }) + return index.find(cache, key, opts).then((entry) => { + if (!entry) { + throw new index.NotFoundError(cache, key) + } + return read.copy(cache, entry.integrity, dest, opts) + .then(() => { + return { + metadata: entry.metadata, + size: entry.size, + integrity: entry.integrity, + } + }) }) } + module.exports.copy = copy function copyByDigest (cache, key, dest, opts = {}) { - if (read.copy) { - return read.copy(cache, key, dest, opts).then(() => key) - } - - return getDataByDigest(cache, key, opts).then((res) => { - return writeFile(dest, res).then(() => key) - }) + return read.copy(cache, key, dest, opts).then(() => key) } module.exports.copy.byDigest = copyByDigest diff --git a/deps/npm/node_modules/cacache/lib/put.js b/deps/npm/node_modules/cacache/lib/put.js index d6904fa3012726..eed51874f9f64c 100644 --- a/deps/npm/node_modules/cacache/lib/put.js +++ b/deps/npm/node_modules/cacache/lib/put.js @@ -37,6 +37,7 @@ function putStream (cache, key, opts = {}) { opts = putOpts(opts) let integrity let size + let error let memoData const pipeline = new Pipeline() @@ -58,6 +59,9 @@ function putStream (cache, key, opts = {}) { .on('size', (s) => { size = s }) + .on('error', (err) => { + error = err + }) pipeline.push(contentStream) @@ -65,21 +69,17 @@ function putStream (cache, key, opts = {}) { // and memoize if we're doing that pipeline.push(new Flush({ flush () { - return index - .insert(cache, key, integrity, { ...opts, size }) - .then((entry) => { - if (memoize && memoData) { - memo.put(cache, entry, memoData, opts) - } - - if (integrity) { + if (!error) { + return index + .insert(cache, key, integrity, { ...opts, size }) + .then((entry) => { + if (memoize && memoData) { + memo.put(cache, entry, memoData, opts) + } pipeline.emit('integrity', integrity) - } - - if (size) { pipeline.emit('size', size) - } - }) + }) + } }, })) diff --git a/deps/npm/node_modules/cacache/lib/util/disposer.js b/deps/npm/node_modules/cacache/lib/util/disposer.js deleted file mode 100644 index 52d7d3edda7d52..00000000000000 --- a/deps/npm/node_modules/cacache/lib/util/disposer.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict' - -module.exports.disposer = disposer - -function disposer (creatorFn, disposerFn, fn) { - const runDisposer = (resource, result, shouldThrow = false) => { - return disposerFn(resource) - .then( - // disposer resolved, do something with original fn's promise - () => { - if (shouldThrow) { - throw result - } - - return result - }, - // Disposer fn failed, crash process - (err) => { - throw err - // Or process.exit? - }) - } - - return creatorFn - .then((resource) => { - // fn(resource) can throw, so wrap in a promise here - return Promise.resolve().then(() => fn(resource)) - .then((result) => runDisposer(resource, result)) - .catch((err) => runDisposer(resource, err, true)) - }) -} diff --git a/deps/npm/node_modules/cacache/package.json b/deps/npm/node_modules/cacache/package.json index 9eb646df76b40a..cd7e4de5e0cba3 100644 --- a/deps/npm/node_modules/cacache/package.json +++ b/deps/npm/node_modules/cacache/package.json @@ -1,6 +1,6 @@ { "name": "cacache", - "version": "16.0.6", + "version": "16.0.7", "cache-version": { "content": "2", "index": "5" @@ -12,7 +12,6 @@ "lib/" ], "scripts": { - "benchmarks": "node test/benchmarks", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", @@ -71,10 +70,6 @@ "devDependencies": { "@npmcli/eslint-config": "^3.0.1", "@npmcli/template-oss": "3.4.1", - "benchmark": "^2.1.4", - "chalk": "^4.1.2", - "require-inject": "^1.4.4", - "tacks": "^1.3.0", "tap": "^16.0.0" }, "tap": { diff --git a/deps/npm/node_modules/pacote/lib/fetcher.js b/deps/npm/node_modules/pacote/lib/fetcher.js index 65e97e205204e4..d88724c5d19731 100644 --- a/deps/npm/node_modules/pacote/lib/fetcher.js +++ b/deps/npm/node_modules/pacote/lib/fetcher.js @@ -105,8 +105,15 @@ class FetcherBase { this[_readPackageJson] = readPackageJsonFast } - // config values: npmjs (default), never - this.replaceRegistryHost = opts.replaceRegistryHost === 'never' ? 'never' : 'npmjs' + // config values: npmjs (default), never, always + // we don't want to mutate the original value + if (opts.replaceRegistryHost !== 'never' + && opts.replaceRegistryHost !== 'always' + ) { + this.replaceRegistryHost = 'npmjs' + } else { + this.replaceRegistryHost = opts.replaceRegistryHost + } this.defaultTag = opts.defaultTag || 'latest' this.registry = removeTrailingSlashes(opts.registry || 'https://registry.npmjs.org') diff --git a/deps/npm/node_modules/pacote/lib/registry.js b/deps/npm/node_modules/pacote/lib/registry.js index b4f890d310dfae..e8ca16f596d6f6 100644 --- a/deps/npm/node_modules/pacote/lib/registry.js +++ b/deps/npm/node_modules/pacote/lib/registry.js @@ -165,6 +165,9 @@ class RegistryFetcher extends Fetcher { } if (this.integrity) { mani._integrity = String(this.integrity) + if (dist.signatures) { + mani._signatures = dist.signatures + } } this.package = rpj.normalize(mani) return this.package diff --git a/deps/npm/node_modules/pacote/lib/remote.js b/deps/npm/node_modules/pacote/lib/remote.js index 3404ea9474944a..14e687805d47a8 100644 --- a/deps/npm/node_modules/pacote/lib/remote.js +++ b/deps/npm/node_modules/pacote/lib/remote.js @@ -5,7 +5,7 @@ const pacoteVersion = require('../package.json').version const fetch = require('npm-registry-fetch') const Minipass = require('minipass') // The default registry URL is a string of great magic. -const magic = /^https?:\/\/registry\.npmjs\.org\// +const magicHost = 'https://registry.npmjs.org' const _cacheFetches = Symbol.for('pacote.Fetcher._cacheFetches') const _headers = Symbol('_headers') @@ -13,10 +13,13 @@ class RemoteFetcher extends Fetcher { constructor (spec, opts) { super(spec, opts) this.resolved = this.spec.fetchSpec - if (this.replaceRegistryHost === 'npmjs' - && magic.test(this.resolved) - && !magic.test(this.registry + '/')) { - this.resolved = this.resolved.replace(magic, this.registry + '/') + const resolvedURL = new URL(this.resolved) + if ( + (this.replaceRegistryHost === 'npmjs' + && resolvedURL.origin === magicHost) + || this.replaceRegistryHost === 'always' + ) { + this.resolved = new URL(resolvedURL.pathname, this.registry).href } // nam is a fermented pork sausage that is good to eat diff --git a/deps/npm/node_modules/pacote/package.json b/deps/npm/node_modules/pacote/package.json index af8166d4ea19e8..2f4323c4414edc 100644 --- a/deps/npm/node_modules/pacote/package.json +++ b/deps/npm/node_modules/pacote/package.json @@ -1,6 +1,6 @@ { "name": "pacote", - "version": "13.1.1", + "version": "13.3.0", "description": "JavaScript package downloader", "author": "GitHub Inc.", "bin": { @@ -26,11 +26,11 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.4.3", "hosted-git-info": "^5.0.0", "mutate-fs": "^2.1.1", "nock": "^13.2.4", - "npm-registry-mock": "^1.3.1", + "npm-registry-mock": "^1.3.2", "tap": "^16.0.1" }, "files": [ @@ -74,7 +74,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2", + "version": "3.4.3", "windowsCI": false } } diff --git a/deps/npm/package.json b/deps/npm/package.json index e1f683219311aa..d3e55ad623a432 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "8.8.0", + "version": "8.9.0", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ @@ -65,7 +65,7 @@ "@npmcli/run-script": "^3.0.1", "abbrev": "~1.1.1", "archy": "~1.0.0", - "cacache": "^16.0.6", + "cacache": "^16.0.7", "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^4.0.0", @@ -107,7 +107,7 @@ "npm-user-validate": "^1.0.1", "npmlog": "^6.0.2", "opener": "^1.5.2", - "pacote": "^13.1.1", + "pacote": "^13.3.0", "parse-conflict-json": "^2.0.2", "proc-log": "^2.0.1", "qrcode-terminal": "^0.12.0", @@ -213,7 +213,7 @@ "test": "tap", "test-all": "npm run test --if-present --workspaces --include-workspace-root", "snap": "tap", - "postsnap": "make -s mandocs", + "postsnap": "make -s docs", "test:nocleanup": "NO_TEST_CLEANUP=1 npm run test --", "sudotest": "sudo npm run test --", "sudotest:nocleanup": "sudo NO_TEST_CLEANUP=1 npm run test --", diff --git a/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs index 37349cbe01e7d2..eccb06580d9f9e 100644 --- a/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -596,6 +596,8 @@ npm owner ls [<@scope>/] Options: [--registry ] [--otp ] +[-w|--workspace [-w|--workspace ...]] +[-ws|--workspaces] alias: author diff --git a/deps/npm/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs index ff00f9a0f9b3dd..42db6ce030b537 100644 --- a/deps/npm/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs @@ -1302,10 +1302,6 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for packa If set to false, then ignore \`package-lock.json\` files when installing. This will also prevent _writing_ \`package-lock.json\` if \`save\` is true. -When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use \`npm prune\`. - This configuration does not affect \`npm ci\`. ` diff --git a/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index 6740b94c772c8a..d0ce3a26f764ff 100644 --- a/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -1093,10 +1093,6 @@ The package to install for [\`npm exec\`](/commands/npm-exec) If set to false, then ignore \`package-lock.json\` files when installing. This will also prevent _writing_ \`package-lock.json\` if \`save\` is true. -When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with -package-locks disabled use \`npm prune\`. - This configuration does not affect \`npm ci\`. diff --git a/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs index 941def42ee1833..bbb3563405da19 100644 --- a/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs @@ -664,6 +664,8 @@ All commands: Options: [--registry ] [--otp ] + [-w|--workspace [-w|--workspace ...]] + [-ws|--workspaces] alias: author diff --git a/deps/npm/test/coverage-map.js b/deps/npm/test/coverage-map.js index 0ea90981860218..9a289b6489e3e4 100644 --- a/deps/npm/test/coverage-map.js +++ b/deps/npm/test/coverage-map.js @@ -12,6 +12,7 @@ const coverageMap = (filename) => { if (/^test\/lib\/commands/.test(filename) || filename === 'test/lib/npm.js') { return [ filename.replace(/^test\//, ''), + 'lib/npm.js', 'lib/base-command.js', 'lib/exec/get-workspace-location-msg.js', ] diff --git a/deps/npm/test/fixtures/mock-npm.js b/deps/npm/test/fixtures/mock-npm.js index 4263dc8fbedc3f..c9701ebc237948 100644 --- a/deps/npm/test/fixtures/mock-npm.js +++ b/deps/npm/test/fixtures/mock-npm.js @@ -132,7 +132,9 @@ const LoadMockNpm = async (t, { }) const npm = init ? new Npm() : null - t.teardown(() => npm && npm.unload()) + t.teardown(() => { + npm && npm.unload() + }) if (load) { await npm.load() diff --git a/deps/npm/test/lib/commands/exec.js b/deps/npm/test/lib/commands/exec.js index d6e598d568d5b3..1117885b917315 100644 --- a/deps/npm/test/lib/commands/exec.js +++ b/deps/npm/test/lib/commands/exec.js @@ -385,6 +385,64 @@ t.test('npm exec foo, not present locally or in central loc', async t => { ]) }) +t.test('npm exec foo, packageLockOnly set to true', async t => { + const path = t.testdir() + const installDir = resolve('npx-cache-dir/f7fbba6e0636f890') + npm.localPrefix = path + npm.config.set('package-lock-only', true) + t.teardown(() => { + npm.config.set('package-lock-only', false) + }) + + ARB_ACTUAL_TREE[path] = { + inventory: { + query () { + return new Set() + }, + }, + } + ARB_ACTUAL_TREE[installDir] = { + inventory: { + query () { + return new Set() + }, + }, + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + foo: 'foo', + }, + _from: 'foo@', + } + await exec.exec(['foo', 'one arg', 'two arg']) + t.strictSame(MKDIRPS, [installDir], 'need to make install dir') + t.match(ARB_CTOR, [{ + path, + packageLockOnly: false, + }]) + t.match(ARB_REIFY, [{ + add: ['foo@'], + legacyPeerDeps: false, + packageLockOnly: false, + }], 'need to install foo@') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` + t.match(RUN_SCRIPTS, [ + { + pkg: { scripts: { npx: 'foo' } }, + args: ['one arg', 'two arg'], + banner: false, + path: process.cwd(), + stdioString: true, + event: 'npx', + env: { PATH }, + stdio: 'inherit', + }, + ]) +}) + t.test('npm exec foo, not present locally but in central loc', async t => { const path = t.testdir() const installDir = resolve('npx-cache-dir/f7fbba6e0636f890') diff --git a/deps/npm/test/lib/commands/owner.js b/deps/npm/test/lib/commands/owner.js index d80ce36fece983..800d5b96a58763 100644 --- a/deps/npm/test/lib/commands/owner.js +++ b/deps/npm/test/lib/commands/owner.js @@ -2,6 +2,7 @@ const t = require('tap') const { load: loadMockNpm } = require('../../fixtures/mock-npm.js') const MockRegistry = require('../../fixtures/mock-registry.js') +const path = require('path') const npa = require('npm-package-arg') const packageName = '@npmcli/test-package' const spec = npa(packageName) @@ -12,6 +13,42 @@ const maintainers = [ { email: 'test-user-b@npmjs.org', name: 'test-user-b' }, ] +const workspaceFixture = { + 'package.json': JSON.stringify({ + name: packageName, + version: '1.2.3-test', + workspaces: ['workspace-a', 'workspace-b', 'workspace-c'], + }), + 'workspace-a': { + 'package.json': JSON.stringify({ + name: 'workspace-a', + version: '1.2.3-a', + }), + }, + 'workspace-b': { + 'package.json': JSON.stringify({ + name: 'workspace-b', + version: '1.2.3-n', + }), + }, + 'workspace-c': JSON.stringify({ + 'package.json': { + name: 'workspace-n', + version: '1.2.3-n', + }, + }), +} + +function registryPackage (t, registry, name) { + const mockRegistry = new MockRegistry({ tap: t, registry }) + + const manifest = mockRegistry.manifest({ + name, + packuments: [{ maintainers, version: '1.0.0' }], + }) + mockRegistry.package({ manifest }) +} + t.test('owner no args', async t => { const { npm } = await loadMockNpm(t) await t.rejects( @@ -429,6 +466,158 @@ t.test('owner rm no cwd package', async t => { ) }) +t.test('workspaces', async t => { + t.test('owner no args --workspace', async t => { + const { npm } = await loadMockNpm(t, { + prefixDir: workspaceFixture, + }) + npm.config.set('workspace', ['workspace-a']) + await t.rejects( + npm.exec('owner', []), + { code: 'EUSAGE' }, + 'rejects with usage' + ) + }) + + t.test('owner ls implicit workspace', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: workspaceFixture, + globals: ({ prefix }) => ({ + 'process.cwd': () => path.join(prefix, 'workspace-a'), + }), + }) + registryPackage(t, npm.config.get('registry'), 'workspace-a') + await npm.exec('owner', ['ls']) + t.match(joinedOutput(), maintainers.map(m => `${m.name} <${m.email}>`).join('\n')) + }) + + t.test('owner ls explicit workspace', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: workspaceFixture, + globals: ({ prefix }) => ({ + 'process.cwd': () => prefix, + }), + }) + npm.config.set('workspace', ['workspace-a']) + registryPackage(t, npm.config.get('registry'), 'workspace-a') + await npm.exec('owner', ['ls']) + t.match(joinedOutput(), maintainers.map(m => `${m.name} <${m.email}>`).join('\n')) + }) + + t.test('owner ls implicit workspace', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: workspaceFixture, + globals: ({ prefix }) => ({ + 'process.cwd': () => path.join(prefix, 'workspace-a'), + }), + }) + registryPackage(t, npm.config.get('registry'), packageName) + await npm.exec('owner', ['ls', packageName]) + t.match(joinedOutput(), maintainers.map(m => `${m.name} <${m.email}>`).join('\n')) + }) + + t.test('owner ls explicit workspace', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: workspaceFixture, + globals: ({ prefix }) => ({ + 'process.cwd': () => prefix, + }), + }) + npm.config.set('workspace', ['workspace-a']) + registryPackage(t, npm.config.get('registry'), packageName) + await npm.exec('owner', ['ls', packageName]) + t.match(joinedOutput(), maintainers.map(m => `${m.name} <${m.email}>`).join('\n')) + }) + + t.test('owner add implicit workspace', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: workspaceFixture, + globals: ({ prefix }) => ({ + 'process.cwd': () => path.join(prefix, 'workspace-a'), + }), + }) + const username = 'foo' + const registry = new MockRegistry({ tap: t, registry: npm.config.get('registry') }) + + const manifest = registry.manifest({ + name: 'workspace-a', + packuments: [{ maintainers, version: '1.0.0' }], + }) + registry.package({ manifest }) + registry.couchuser({ username }) + registry.nock.put(`/workspace-a/-rev/${manifest._rev}`, body => { + t.match(body, { + _id: manifest._id, + _rev: manifest._rev, + maintainers: [ + ...manifest.maintainers, + { name: username, email: '' }, + ], + }) + return true + }).reply(200, {}) + await npm.exec('owner', ['add', username]) + t.equal(joinedOutput(), `+ ${username} (workspace-a)`) + }) + + t.test('owner add --workspace', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: workspaceFixture, + }) + npm.config.set('workspace', ['workspace-a']) + const username = 'foo' + const registry = new MockRegistry({ tap: t, registry: npm.config.get('registry') }) + + const manifest = registry.manifest({ + name: 'workspace-a', + packuments: [{ maintainers, version: '1.0.0' }], + }) + registry.package({ manifest }) + registry.couchuser({ username }) + registry.nock.put(`/workspace-a/-rev/${manifest._rev}`, body => { + t.match(body, { + _id: manifest._id, + _rev: manifest._rev, + maintainers: [ + ...manifest.maintainers, + { name: username, email: '' }, + ], + }) + return true + }).reply(200, {}) + await npm.exec('owner', ['add', username]) + t.equal(joinedOutput(), `+ ${username} (workspace-a)`) + }) + + t.test('owner rm --workspace', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: workspaceFixture, + globals: ({ prefix }) => ({ + 'process.cwd': () => path.join(prefix, 'workspace-a'), + }), + }) + const registry = new MockRegistry({ tap: t, registry: npm.config.get('registry') }) + + const username = maintainers[0].name + const manifest = registry.manifest({ + name: 'workspace-a', + packuments: [{ maintainers, version: '1.0.0' }], + }) + registry.package({ manifest }) + registry.couchuser({ username }) + registry.nock.put(`/workspace-a/-rev/${manifest._rev}`, body => { + t.match(body, { + _id: manifest._id, + _rev: manifest._rev, + maintainers: maintainers.slice(1), + }) + return true + }).reply(200, {}) + await npm.exec('owner', ['rm', username]) + t.equal(joinedOutput(), `- ${username} (workspace-a)`) + }) +}) + t.test('completion', async t => { t.test('basic commands', async t => { const { npm } = await loadMockNpm(t) diff --git a/deps/npm/test/lib/npm.js b/deps/npm/test/lib/npm.js index 1966ca96000886..566cbca20f6bf3 100644 --- a/deps/npm/test/lib/npm.js +++ b/deps/npm/test/lib/npm.js @@ -620,7 +620,7 @@ t.test('implicit workspace rejection', async t => { }), }) await t.rejects( - mock.npm.exec('owner', []), + mock.npm.exec('team', []), /This command does not support workspaces/ ) })