diff --git a/deps/npm/docs/content/commands/npm-cache.md b/deps/npm/docs/content/commands/npm-cache.md index 091e26e8a71828..b5eddd46c05a7d 100644 --- a/deps/npm/docs/content/commands/npm-cache.md +++ b/deps/npm/docs/content/commands/npm-cache.md @@ -11,11 +11,7 @@ description: Manipulates packages cache ```bash -npm cache add -npm cache add -npm cache add -npm cache add -npm cache add @ +npm cache add npm cache clean [] npm cache ls [@] npm cache verify @@ -101,6 +97,7 @@ cache`](/commands/npm-cache) ### See Also +* [package spec](/using-npm/package-spec) * [npm folders](/configuring-npm/folders) * [npm config](/commands/npm-config) * [npmrc](/configuring-npm/npmrc) diff --git a/deps/npm/docs/content/commands/npm-ci.md b/deps/npm/docs/content/commands/npm-ci.md index 3374bf1e25136b..9b8238d05a3b91 100644 --- a/deps/npm/docs/content/commands/npm-ci.md +++ b/deps/npm/docs/content/commands/npm-ci.md @@ -133,7 +133,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-deprecate.md b/deps/npm/docs/content/commands/npm-deprecate.md index 4345120d3744b3..20f65140fc735f 100644 --- a/deps/npm/docs/content/commands/npm-deprecate.md +++ b/deps/npm/docs/content/commands/npm-deprecate.md @@ -11,7 +11,7 @@ description: Deprecate a version of a package ```bash -npm deprecate [@] +npm deprecate ``` @@ -45,8 +45,8 @@ In this case, a version `my-thing@1.0.0-beta.0` will also be deprecated. You must be the package owner to deprecate something. See the `owner` and `adduser` help topics. -To un-deprecate a package, specify an empty string (`""`) for the `message` -argument. Note that you must use double quotes with no space between them to +To un-deprecate a package, specify an empty string (`""`) for the `message` +argument. Note that you must use double quotes with no space between them to format an empty string. ### Configuration @@ -82,6 +82,7 @@ password, npm will prompt on the command line for one. ### See Also +* [package spec](/using-npm/package-spec) * [npm publish](/commands/npm-publish) * [npm registry](/using-npm/registry) * [npm owner](/commands/npm-owner) diff --git a/deps/npm/docs/content/commands/npm-dist-tag.md b/deps/npm/docs/content/commands/npm-dist-tag.md index b9caf1fbe7fa9c..123e67dbf3b235 100644 --- a/deps/npm/docs/content/commands/npm-dist-tag.md +++ b/deps/npm/docs/content/commands/npm-dist-tag.md @@ -11,9 +11,9 @@ description: Modify package distribution tags ```bash -npm dist-tag add @ [] -npm dist-tag rm -npm dist-tag ls [] +npm dist-tag add [] +npm dist-tag rm +npm dist-tag ls [] alias: dist-tags ``` @@ -27,11 +27,11 @@ alias: dist-tags Add, remove, and enumerate distribution tags on a package: -* add: Tags the specified version of the package with the specified tag, or - the `--tag` config if not specified. If you have two-factor - authentication on auth-and-writes then you’ll need to include a one-time - password on the command line with `--otp `, or at the - OTP prompt. +* add: Tags the specified version of the package with the specified tag, + or the `--tag` config if not specified. If you have two-factor + authentication on auth-and-writes then you’ll need to include a + one-time password on the command line with + `--otp `, or at the OTP prompt. * rm: Clear a tag that is no longer in use from the package. If you have two-factor authentication on auth-and-writes then you’ll need to include @@ -168,6 +168,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm publish](/commands/npm-publish) * [npm install](/commands/npm-install) * [npm dedupe](/commands/npm-dedupe) diff --git a/deps/npm/docs/content/commands/npm-explain.md b/deps/npm/docs/content/commands/npm-explain.md index 765221056585d9..5ba2fe8206ba16 100644 --- a/deps/npm/docs/content/commands/npm-explain.md +++ b/deps/npm/docs/content/commands/npm-explain.md @@ -11,7 +11,7 @@ description: Explain installed packages ```bash -npm explain +npm explain alias: why ``` @@ -26,9 +26,10 @@ alias: why This command will print the chain of dependencies causing a given package to be installed in the current project. -Positional arguments can be either folders within `node_modules`, or -`name@version-range` specifiers, which will select the dependency -relationships to explain. +If one or more package specs are provided, then only packages matching +one of the specifiers will have their relationships explained. + +The package spec can also refer to a folder within `./node_modules` For example, running `npm explain glob` within npm's source tree will show: @@ -110,6 +111,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm config](/commands/npm-config) * [npmrc](/configuring-npm/npmrc) * [npm folders](/configuring-npm/folders) diff --git a/deps/npm/docs/content/commands/npm-fund.md b/deps/npm/docs/content/commands/npm-fund.md index 5b96e91ab8ccb9..8db0ce910de967 100644 --- a/deps/npm/docs/content/commands/npm-fund.md +++ b/deps/npm/docs/content/commands/npm-fund.md @@ -11,7 +11,7 @@ description: Retrieve funding information ```bash -npm fund [[<@scope>/]] +npm fund [] ``` @@ -23,22 +23,22 @@ npm fund [[<@scope>/]] This command retrieves information on how to fund the dependencies of a given project. If no package name is provided, it will list all -dependencies that are looking for funding in a tree structure, listing the -type of funding and the url to visit. If a package name is provided then it -tries to open its funding url using the `--browser` config param; if there -are multiple funding sources for the package, the user will be instructed -to pass the `--which` option to disambiguate. +dependencies that are looking for funding in a tree structure, listing +the type of funding and the url to visit. If a package name is provided +then it tries to open its funding url using the `--browser` config +param; if there are multiple funding sources for the package, the user +will be instructed to pass the `--which` option to disambiguate. The list will avoid duplicated entries and will stack all packages that -share the same url as a single entry. Thus, the list does not have the same -shape of the output from `npm ls`. +share the same url as a single entry. Thus, the list does not have the +same shape of the output from `npm ls`. #### Example ### Workspaces support -It's possible to filter the results to only include a single workspace and its -dependencies using the `workspace` config option. +It's possible to filter the results to only include a single workspace +and its dependencies using the `workspace` config option. #### Example: @@ -58,8 +58,8 @@ test-workspaces-fund@1.0.0 `-- bar@2.0.0 ``` -And here is an example of the expected result when filtering only by -a specific workspace `a` in the same project: +And here is an example of the expected result when filtering only by a +specific workspace `a` in the same project: ```bash $ npm fund -w a @@ -156,6 +156,7 @@ If there are multiple funding sources, which 1-indexed source URL to open. ## See Also +* [package spec](/using-npm/package-spec) * [npm install](/commands/npm-install) * [npm docs](/commands/npm-docs) * [npm ls](/commands/npm-ls) diff --git a/deps/npm/docs/content/commands/npm-init.md b/deps/npm/docs/content/commands/npm-init.md index 35343cceb4aa13..cd0be4643e0ead 100644 --- a/deps/npm/docs/content/commands/npm-init.md +++ b/deps/npm/docs/content/commands/npm-init.md @@ -11,9 +11,8 @@ description: Create a package.json file ```bash -npm init [--force|-f|--yes|-y|--scope] +npm init (same as `npx ) npm init <@scope> (same as `npx <@scope>/create`) -npm init [<@scope>/] (same as `npx [<@scope>/]create-`) aliases: create, innit ``` @@ -204,6 +203,39 @@ mistakes, unnecessary performance degradation, and malicious input. If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! + + + +#### `scope` + +* Default: the scope of the current project, if any, or "" +* Type: String + +Associate an operation with a scope for a scoped registry. + +Useful when logging in to or out of a private registry: + +``` +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +``` + +This will cause `@mycorp` to be mapped to the registry for future +installation of packages specified according to the pattern +`@mycorp/package`. + +This will also cause `npm init` to create a scoped package. + +``` +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +``` + + @@ -284,6 +316,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [init-package-json module](http://npm.im/init-package-json) * [package.json](/configuring-npm/package-json) * [npm version](/commands/npm-version) diff --git a/deps/npm/docs/content/commands/npm-install-ci-test.md b/deps/npm/docs/content/commands/npm-install-ci-test.md index 0d9470acf58b3d..74ed4667e81bfe 100644 --- a/deps/npm/docs/content/commands/npm-install-ci-test.md +++ b/deps/npm/docs/content/commands/npm-install-ci-test.md @@ -79,7 +79,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-install-test.md b/deps/npm/docs/content/commands/npm-install-test.md index 3dd860ea5c6f68..d27686e731ce16 100644 --- a/deps/npm/docs/content/commands/npm-install-test.md +++ b/deps/npm/docs/content/commands/npm-install-test.md @@ -11,16 +11,7 @@ description: Install package(s) and run tests ```bash -npm install-test [<@scope>/] -npm install-test [<@scope>/]@ -npm install-test [<@scope>/]@ -npm install-test [<@scope>/]@ -npm install-test @npm: -npm install-test -npm install-test -npm install-test -npm install-test -npm install-test / +npm install-test [ ...] alias: it ``` diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index d6668a2c2bd0fb..7e5544f85e3dda 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -11,16 +11,7 @@ description: Install a package ```bash -npm install [<@scope>/] -npm install [<@scope>/]@ -npm install [<@scope>/]@ -npm install [<@scope>/]@ -npm install @npm: -npm install -npm install -npm install -npm install -npm install / +npm install [ ...] aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall ``` diff --git a/deps/npm/docs/content/commands/npm-link.md b/deps/npm/docs/content/commands/npm-link.md index 975c807c38b348..8c1b422493bd57 100644 --- a/deps/npm/docs/content/commands/npm-link.md +++ b/deps/npm/docs/content/commands/npm-link.md @@ -11,8 +11,7 @@ description: Symlink a package folder ```bash -npm link (in package dir) -npm link [<@scope>/][@] +npm link [] alias: ln ``` @@ -29,11 +28,11 @@ test iteratively without having to continually rebuild. Package linking is a two-step process. -First, `npm link` in a package folder will create a symlink in the global -folder `{prefix}/lib/node_modules/` that links to the package -where the `npm link` command was executed. It will also link any bins in -the package to `{prefix}/bin/{name}`. Note that `npm link` uses the global -prefix (see `npm prefix -g` for its value). +First, `npm link` in a package folder with no arguments will create a +symlink in the global folder `{prefix}/lib/node_modules/` that +links to the package where the `npm link` command was executed. It will +also link any bins in the package to `{prefix}/bin/{name}`. Note that +`npm link` uses the global prefix (see `npm prefix -g` for its value). Next, in some other location, `npm link package-name` will create a symbolic link from globally-installed `package-name` to `node_modules/` of @@ -399,6 +398,7 @@ symlink. This option has no effect on workspaces. ### See Also +* [package spec](/using-npm/package-spec) * [npm developers](/using-npm/developers) * [package.json](/configuring-npm/package-json) * [npm install](/commands/npm-install) diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index ded8c0c0d26ef1..a97c5168e6e0b4 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -11,7 +11,7 @@ description: List installed packages ```bash -npm ls [[<@scope>/] ...] +npm ls alias: list ``` @@ -301,6 +301,7 @@ symlink. This option has no effect on workspaces. ### See Also +* [package spec](/using-npm/package-spec) * [npm explain](/commands/npm-explain) * [npm config](/commands/npm-config) * [npmrc](/configuring-npm/npmrc) diff --git a/deps/npm/docs/content/commands/npm-outdated.md b/deps/npm/docs/content/commands/npm-outdated.md index 6fa026550e7477..c4e07a0cd36f02 100644 --- a/deps/npm/docs/content/commands/npm-outdated.md +++ b/deps/npm/docs/content/commands/npm-outdated.md @@ -11,7 +11,7 @@ description: Check for outdated packages ```bash -npm outdated [[<@scope>/] ...] +npm outdated [ ...] ``` @@ -192,6 +192,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm update](/commands/npm-update) * [npm dist-tag](/commands/npm-dist-tag) * [npm registry](/using-npm/registry) diff --git a/deps/npm/docs/content/commands/npm-owner.md b/deps/npm/docs/content/commands/npm-owner.md index 72dfe6a22d01b0..ebc29ef6939392 100644 --- a/deps/npm/docs/content/commands/npm-owner.md +++ b/deps/npm/docs/content/commands/npm-owner.md @@ -11,9 +11,9 @@ description: Manage package owners ```bash -npm owner add [<@scope>/] -npm owner rm [<@scope>/] -npm owner ls [<@scope>/] +npm owner add +npm owner rm +npm owner ls alias: author ``` @@ -123,6 +123,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm profile](/commands/npm-profile) * [npm publish](/commands/npm-publish) * [npm registry](/using-npm/registry) diff --git a/deps/npm/docs/content/commands/npm-pack.md b/deps/npm/docs/content/commands/npm-pack.md index fa6c005e9d2287..7921042eae8fe0 100644 --- a/deps/npm/docs/content/commands/npm-pack.md +++ b/deps/npm/docs/content/commands/npm-pack.md @@ -11,7 +11,7 @@ description: Create a tarball from a package ```bash -npm pack [[<@scope>/]...] +npm pack ``` @@ -144,6 +144,7 @@ If no arguments are supplied, then npm packs the current package folder. ### See Also +* [package spec](/using-npm/package-spec) * [npm-packlist package](http://npm.im/npm-packlist) * [npm cache](/commands/npm-cache) * [npm publish](/commands/npm-publish) diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md index 2995f6bc81551e..536d04988e6849 100644 --- a/deps/npm/docs/content/commands/npm-publish.md +++ b/deps/npm/docs/content/commands/npm-publish.md @@ -11,7 +11,7 @@ description: Publish a package ```bash -npm publish [] +npm publish ``` @@ -23,42 +23,26 @@ npm publish [] Publishes a package to the registry so that it can be installed by name. -By default npm will publish to the public registry. This can be overridden -by specifying a different default registry or using a -[`scope`](/using-npm/scope) in the name (see +By default npm will publish to the public registry. This can be +overridden by specifying a different default registry or using a +[`scope`](/using-npm/scope) in the name, combined with a +scope-configured registry (see [`package.json`](/configuring-npm/package-json)). -* ``: A folder containing a package.json file -* ``: A url or file path to a gzipped tar archive containing a - single folder with a package.json file inside. +A `package` is interpreted the same way as other commands (like +`npm install` and can be: -* `[--tag ]`: Registers the published package with the given tag, such - that `npm install @` will install this version. By default, - `npm publish` updates and `npm install` installs the `latest` tag. See - [`npm-dist-tag`](npm-dist-tag) for details about tags. - -* `[--access ]`: Tells the registry whether this package - should be published as public or restricted. Only applies to scoped - packages, which default to `restricted`. If you don't have a paid - account, you must publish with `--access public` to publish scoped - packages. - -* `[--otp ]`: If you have two-factor authentication enabled in - `auth-and-writes` mode then you can provide a code from your - authenticator with this. If you don't include this and you're running - from a TTY then you'll be prompted. - -* `[--dry-run]`: As of `npm@6`, does everything publish would do except - actually publishing to the registry. Reports the details of what would - have been published. - -* `[--workspaces]`: Enables workspace context while publishing. All - workspace packages will be published. - -* `[--workspace]`: Enables workspaces context and limits results to only - those specified by this config item. Only the packages in the - workspaces given will be published. +* a) a folder containing a program described by a + [`package.json`](/configuring-npm/package-json) file +* b) a gzipped tarball containing (a) +* c) a url that resolves to (b) +* d) a `@` that is published on the registry (see + [`registry`](/using-npm/registry)) with (c) +* e) a `@` (see [`npm dist-tag`](/commands/npm-dist-tag)) that + points to (d) +* f) a `` that has a "latest" tag satisfying (e) +* g) a `` that resolves to (a) The publish will fail if the package name and version combination already exists in the specified registry. @@ -247,6 +231,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm-packlist package](http://npm.im/npm-packlist) * [npm registry](/using-npm/registry) * [npm scope](/using-npm/scope) diff --git a/deps/npm/docs/content/commands/npm-rebuild.md b/deps/npm/docs/content/commands/npm-rebuild.md index 52c368c8c513b9..6a396421213d3d 100644 --- a/deps/npm/docs/content/commands/npm-rebuild.md +++ b/deps/npm/docs/content/commands/npm-rebuild.md @@ -11,7 +11,7 @@ description: Rebuild a package ```bash -npm rebuild [[<@scope>/][@] ...] +npm rebuild [] ...] alias: rb ``` @@ -29,9 +29,8 @@ C++ addons with the new binary. It is also useful when installing with `--ignore-scripts` and `--no-bin-links`, to explicitly choose which packages to build and/or link bins. -If one or more package names (and optionally version ranges) are provided, -then only packages with a name and version matching one of the specifiers -will be rebuilt. +If one or more package specs are provided, then only packages with a +name and version matching one of the specifiers will be rebuilt. ### Configuration @@ -178,4 +177,5 @@ symlink. This option has no effect on workspaces. ### See Also +* [package spec](/using-npm/package-spec) * [npm install](/commands/npm-install) diff --git a/deps/npm/docs/content/commands/npm-restart.md b/deps/npm/docs/content/commands/npm-restart.md index f01cd014e74357..048bebb1659bd3 100644 --- a/deps/npm/docs/content/commands/npm-restart.md +++ b/deps/npm/docs/content/commands/npm-restart.md @@ -69,7 +69,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-run-script.md b/deps/npm/docs/content/commands/npm-run-script.md index 73c4b1c7a748a7..d94040f1a215d1 100644 --- a/deps/npm/docs/content/commands/npm-run-script.md +++ b/deps/npm/docs/content/commands/npm-run-script.md @@ -246,7 +246,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-star.md b/deps/npm/docs/content/commands/npm-star.md index 00ef17a816b4ae..3e81c6a55bbb05 100644 --- a/deps/npm/docs/content/commands/npm-star.md +++ b/deps/npm/docs/content/commands/npm-star.md @@ -11,7 +11,7 @@ description: Mark your favorite packages ```bash -npm star [...] +npm star [...] ``` @@ -87,6 +87,7 @@ password, npm will prompt on the command line for one. ### See Also +* [package spec](/using-npm/package-spec) * [npm unstar](/commands/npm-unstar) * [npm stars](/commands/npm-stars) * [npm view](/commands/npm-view) diff --git a/deps/npm/docs/content/commands/npm-start.md b/deps/npm/docs/content/commands/npm-start.md index 8dd874b3c7d291..148f92606d83fb 100644 --- a/deps/npm/docs/content/commands/npm-start.md +++ b/deps/npm/docs/content/commands/npm-start.md @@ -80,7 +80,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-stop.md b/deps/npm/docs/content/commands/npm-stop.md index 9a3a55cf3f20e6..a3084e8432ba77 100644 --- a/deps/npm/docs/content/commands/npm-stop.md +++ b/deps/npm/docs/content/commands/npm-stop.md @@ -73,7 +73,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-test.md b/deps/npm/docs/content/commands/npm-test.md index 8a343ab299b34c..72bb899d0b9165 100644 --- a/deps/npm/docs/content/commands/npm-test.md +++ b/deps/npm/docs/content/commands/npm-test.md @@ -70,7 +70,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-unpublish.md b/deps/npm/docs/content/commands/npm-unpublish.md index a4c481ea5af7f7..9ad99e72a5a8e0 100644 --- a/deps/npm/docs/content/commands/npm-unpublish.md +++ b/deps/npm/docs/content/commands/npm-unpublish.md @@ -11,7 +11,7 @@ description: Remove a package from the registry ```bash -npm unpublish [<@scope>/][@] +npm unpublish [] ``` @@ -146,6 +146,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm deprecate](/commands/npm-deprecate) * [npm publish](/commands/npm-publish) * [npm registry](/using-npm/registry) diff --git a/deps/npm/docs/content/commands/npm-unstar.md b/deps/npm/docs/content/commands/npm-unstar.md index 76202190da8c35..636e1b6ac0a947 100644 --- a/deps/npm/docs/content/commands/npm-unstar.md +++ b/deps/npm/docs/content/commands/npm-unstar.md @@ -11,7 +11,7 @@ description: Remove an item from your favorite packages ```bash -npm unstar [...] +npm unstar [...] ``` diff --git a/deps/npm/docs/content/commands/npm-view.md b/deps/npm/docs/content/commands/npm-view.md index 0ef17d8adfb39b..d9d1daac0cda7d 100644 --- a/deps/npm/docs/content/commands/npm-view.md +++ b/deps/npm/docs/content/commands/npm-view.md @@ -11,7 +11,7 @@ description: View registry info ```bash -npm view [<@scope>/][@] [[.subfield]...] +npm view [] [[.subfield]...] aliases: info, show, v ``` @@ -203,6 +203,7 @@ the field name. ### See Also +* [package spec](/using-npm/package-spec) * [npm search](/commands/npm-search) * [npm registry](/using-npm/registry) * [npm config](/commands/npm-config) diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md index 8b188cfb0b9380..64081350af271f 100644 --- a/deps/npm/docs/content/configuring-npm/package-json.md +++ b/deps/npm/docs/content/configuring-npm/package-json.md @@ -222,7 +222,7 @@ npm also sets a top-level "maintainers" field with your npm user info. ### funding -You can specify an object containing an URL that provides up-to-date +You can specify an object containing a URL that provides up-to-date information about ways to help fund development of your package, or a string URL, or an array of these: diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index 6ef854eb6e0ff4..3fb431402669f5 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -1518,7 +1518,7 @@ npm init --scope=@foo --yes * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/using-npm/package-spec.md b/deps/npm/docs/content/using-npm/package-spec.md new file mode 100644 index 00000000000000..0d3741018f036f --- /dev/null +++ b/deps/npm/docs/content/using-npm/package-spec.md @@ -0,0 +1,106 @@ +--- +title: package-spec +section: 7 +description: Package name specifier +--- + + +### Description + +Commands like `npm install` and the dependency sections in the +`package.json` use a package name specifier. This can be many different +things that all refer to a "package". Examples include a package name, +git url, tarball, or local directory. These will generally be referred +to as `` in the help output for the npm commands that use +this package name specifier. + +### Package name + +* `[<@scope>/]` +* `[<@scope>/]@` +* `[<@scope>/]@` +* `[<@scope>/]@` + +Refers to a package by name, with or without a scope, and optionally +tag, version, or version range. This is typically used in combination +with the [registry](/using-npm/config#registry) config to refer to a +package in a registry. + +Examples: +* `npm` +* `@npmcli/arborist` +* `@npmcli/arborist@latest` +* `npm@6.13.1` +* `npm@^4.0.0` + +### Aliases + +* `@npm:` + +Primarily used by commands like `npm install` and in the dependency +sections in the `package.json`, this refers to a package by an alias. +The `` is the name of the package as it is reified in the +`node_modules` folder, and the `` refers to a package name as +found in the configured registry. + +See `Package name` above for more info on referring to a package by +name, and [registry](/using-npm/config#registry) for configuring which +registry is used when referring to a package by name. + +Examples: +* `semver:@npm:@npmcli/semver-with-patch` +* `semver:@npm:semver@7.2.2` +* `semver:@npm:semver@legacy` + +### Folders + +* `` + +This refers to a package on the local filesystem. Specifically this is +a folder with a `package.json` file in it. This *should* always be +prefixed with a `/` or `./` (or your OS equivalent) to reduce confusion. +npm currently will parse a string with more than one `/` in it as a +folder, but this is legacy behavior that may be removed in a future +version. + +Examples: + +* `./my-package` +* `/opt/npm/my-package` + +### Tarballs + +* `` +* `` + +Examples: + +* `./my-package.tgz` +* `https://registry.npmjs.org/semver/-/semver-1.0.0.tgz` + +Refers to a package in a tarball format, either on the local filesystem +or remotely via url. This is the format that packages exist in when +uploaded to a registry. + +### git urls + +* `` +* `/` + +Refers to a package in a git repo. This can be a full git url, git +shorthand, or a username/package on GitHub. You can specify a +git tag, branch, or other git ref by appending `#ref`. + +Examples: + +* `https://github.com/npm/cli.git` +* `git@github.com:npm/cli.git` +* `git+ssh://git@github.com/npm/cli#v6.0.0` +* `github:npm/cli#HEAD` +* `npm/cli#c12ea07` + +### See also + +[npm-package-arg](https://npm.im/npm-package-arg) +[scope](/using-npm/scope) +[config](/using-npm/config) diff --git a/deps/npm/docs/output/commands/npm-cache.html b/deps/npm/docs/output/commands/npm-cache.html index c5d6869b343be2..ad29cc73819d58 100644 --- a/deps/npm/docs/output/commands/npm-cache.html +++ b/deps/npm/docs/output/commands/npm-cache.html @@ -149,11 +149,7 @@

Table of contents

-
npm cache add <tarball file>
-npm cache add <folder>
-npm cache add <tarball url>
-npm cache add <git url>
-npm cache add <name>@<version>
+
npm cache add <package-spec>
 npm cache clean [<key>]
 npm cache ls [<name>@<version>]
 npm cache verify
@@ -224,6 +220,7 @@ 

cache

See Also

    +
  • package spec
  • npm folders
  • npm config
  • npmrc
  • diff --git a/deps/npm/docs/output/commands/npm-ci.html b/deps/npm/docs/output/commands/npm-ci.html index 4f9a194ae57e54..abc8ce6deb0e31 100644 --- a/deps/npm/docs/output/commands/npm-ci.html +++ b/deps/npm/docs/output/commands/npm-ci.html @@ -245,7 +245,7 @@

    script-shell

  • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  • Type: null or String
-

The shell to use for scripts run with the npm exec, npm run and npm init <pkg> commands.

+

The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

diff --git a/deps/npm/docs/output/commands/npm-deprecate.html b/deps/npm/docs/output/commands/npm-deprecate.html index 52a9ef82c30e24..5b1d3489ca6157 100644 --- a/deps/npm/docs/output/commands/npm-deprecate.html +++ b/deps/npm/docs/output/commands/npm-deprecate.html @@ -149,7 +149,7 @@

Table of contents

-
npm deprecate <pkg>[@<version>] <message>
+
npm deprecate <package-spec> <message>
 
@@ -198,6 +198,7 @@

otp

See Also

    +
  • package spec
  • npm publish
  • npm registry
  • npm owner
  • diff --git a/deps/npm/docs/output/commands/npm-dist-tag.html b/deps/npm/docs/output/commands/npm-dist-tag.html index 8615aec686f79d..a6cdc6230b2057 100644 --- a/deps/npm/docs/output/commands/npm-dist-tag.html +++ b/deps/npm/docs/output/commands/npm-dist-tag.html @@ -149,9 +149,9 @@

    Table of contents

    -
    npm dist-tag add <pkg>@<version> [<tag>]
    -npm dist-tag rm <pkg> <tag>
    -npm dist-tag ls [<pkg>]
    +
    npm dist-tag add <package-spec (with version)> [<tag>]
    +npm dist-tag rm <package-spec> <tag>
    +npm dist-tag ls [<package-spec>]
     
     alias: dist-tags
     
    @@ -162,11 +162,11 @@

    Description

    Add, remove, and enumerate distribution tags on a package:

    • -

      add: Tags the specified version of the package with the specified tag, or -the --tag config if not specified. If you have two-factor -authentication on auth-and-writes then you’ll need to include a one-time -password on the command line with --otp <one-time password>, or at the -OTP prompt.

      +

      add: Tags the specified version of the package with the specified tag, +or the --tag config if not specified. If you have two-factor +authentication on auth-and-writes then you’ll need to include a +one-time password on the command line with +--otp <one-time password>, or at the OTP prompt.

    • rm: Clear a tag that is no longer in use from the package. If you have @@ -273,6 +273,7 @@

      include-workspace-root

      See Also

        +
      • package spec
      • npm publish
      • npm install
      • npm dedupe
      • diff --git a/deps/npm/docs/output/commands/npm-explain.html b/deps/npm/docs/output/commands/npm-explain.html index caf5ab1506fcc9..612e18676b418d 100644 --- a/deps/npm/docs/output/commands/npm-explain.html +++ b/deps/npm/docs/output/commands/npm-explain.html @@ -149,7 +149,7 @@

        Table of contents

        -
        npm explain <folder | specifier>
        +
        npm explain <package-spec>
         
         alias: why
         
        @@ -159,9 +159,9 @@

        Table of contents

        Description

        This command will print the chain of dependencies causing a given package to be installed in the current project.

        -

        Positional arguments can be either folders within node_modules, or -name@version-range specifiers, which will select the dependency -relationships to explain.

        +

        If one or more package specs are provided, then only packages matching +one of the specifiers will have their relationships explained.

        +

        The package spec can also refer to a folder within ./node_modules

        For example, running npm explain glob within npm's source tree will show:

        glob@7.1.6
         node_modules/glob
        @@ -229,6 +229,7 @@ 

        workspace

        See Also

          +
        • package spec
        • npm config
        • npmrc
        • npm folders
        • diff --git a/deps/npm/docs/output/commands/npm-fund.html b/deps/npm/docs/output/commands/npm-fund.html index ba88e461c60988..08389cb45ba6c0 100644 --- a/deps/npm/docs/output/commands/npm-fund.html +++ b/deps/npm/docs/output/commands/npm-fund.html @@ -149,7 +149,7 @@

          Table of contents

          -
          npm fund [[<@scope>/]<pkg>]
          +
          npm fund [<package-spec>]
           
          @@ -157,18 +157,18 @@

          Table of contents

          Description

          This command retrieves information on how to fund the dependencies of a given project. If no package name is provided, it will list all -dependencies that are looking for funding in a tree structure, listing the -type of funding and the url to visit. If a package name is provided then it -tries to open its funding url using the --browser config param; if there -are multiple funding sources for the package, the user will be instructed -to pass the --which option to disambiguate.

          +dependencies that are looking for funding in a tree structure, listing +the type of funding and the url to visit. If a package name is provided +then it tries to open its funding url using the --browser config +param; if there are multiple funding sources for the package, the user +will be instructed to pass the --which option to disambiguate.

          The list will avoid duplicated entries and will stack all packages that -share the same url as a single entry. Thus, the list does not have the same -shape of the output from npm ls.

          +share the same url as a single entry. Thus, the list does not have the +same shape of the output from npm ls.

          Example

          Workspaces support

          -

          It's possible to filter the results to only include a single workspace and its -dependencies using the workspace config option.

          +

          It's possible to filter the results to only include a single workspace +and its dependencies using the workspace config option.

          Example:

          Here's an example running npm fund in a project with a configured workspace a:

          @@ -183,8 +183,8 @@

          Example:

          `-- https://example.com/org `-- bar@2.0.0
          -

          And here is an example of the expected result when filtering only by -a specific workspace a in the same project:

          +

          And here is an example of the expected result when filtering only by a +specific workspace a in the same project:

          $ npm fund -w a
           test-workspaces-fund@1.0.0
           `-- https://example.com/a
          @@ -262,6 +262,7 @@ 

          which

          See Also

            +
          • package spec
          • npm install
          • npm docs
          • npm ls
          • diff --git a/deps/npm/docs/output/commands/npm-init.html b/deps/npm/docs/output/commands/npm-init.html index b25bfec2d4ffe4..c7c00b3531becf 100644 --- a/deps/npm/docs/output/commands/npm-init.html +++ b/deps/npm/docs/output/commands/npm-init.html @@ -142,16 +142,15 @@

            npm-init

            Table of contents

            - +

            Synopsis

            -
            npm init [--force|-f|--yes|-y|--scope]
            +
            npm init <package-spec> (same as `npx <package-spec>)
             npm init <@scope> (same as `npx <@scope>/create`)
            -npm init [<@scope>/]<name> (same as `npx [<@scope>/]create-<name>`)
             
             aliases: create, innit
             
            @@ -300,6 +299,29 @@

            force

            recommended that you do not use this option!

            +

            scope

            +
              +
            • Default: the scope of the current project, if any, or ""
            • +
            • Type: String
            • +
            +

            Associate an operation with a scope for a scoped registry.

            +

            Useful when logging in to or out of a private registry:

            +
            # log in, linking the scope to the custom registry
            +npm login --scope=@mycorp --registry=https://registry.mycorp.com
            +
            +# log out, removing the link and the auth token
            +npm logout --scope=@mycorp
            +
            +

            This will cause @mycorp to be mapped to the registry for future +installation of packages specified according to the pattern +@mycorp/package.

            +

            This will also cause npm init to create a scoped package.

            +
            # accept all defaults, and create a package named "@foo/whatever",
            +# instead of just named "whatever"
            +npm init --scope=@foo --yes
            +
            + +

            workspace

            • Default:
            • @@ -363,6 +385,7 @@

              include-workspace-root

              See Also

                +
              • package spec
              • init-package-json module
              • package.json
              • npm version
              • diff --git a/deps/npm/docs/output/commands/npm-install-ci-test.html b/deps/npm/docs/output/commands/npm-install-ci-test.html index b414f090278283..8d3d9541421fe0 100644 --- a/deps/npm/docs/output/commands/npm-install-ci-test.html +++ b/deps/npm/docs/output/commands/npm-install-ci-test.html @@ -202,7 +202,7 @@

                script-shell

              • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
              • Type: null or String
              -

              The shell to use for scripts run with the npm exec, npm run and npm init <pkg> commands.

              +

              The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

              diff --git a/deps/npm/docs/output/commands/npm-install-test.html b/deps/npm/docs/output/commands/npm-install-test.html index 6306ceb5938558..bf2ad29400f570 100644 --- a/deps/npm/docs/output/commands/npm-install-test.html +++ b/deps/npm/docs/output/commands/npm-install-test.html @@ -149,16 +149,7 @@

              Table of contents

              -
              npm install-test [<@scope>/]<pkg>
              -npm install-test [<@scope>/]<pkg>@<tag>
              -npm install-test [<@scope>/]<pkg>@<version>
              -npm install-test [<@scope>/]<pkg>@<version range>
              -npm install-test <alias>@npm:<name>
              -npm install-test <folder>
              -npm install-test <tarball file>
              -npm install-test <tarball url>
              -npm install-test <git:// url>
              -npm install-test <github username>/<github project>
              +
              npm install-test [<package-spec> ...]
               
               alias: it
               
              diff --git a/deps/npm/docs/output/commands/npm-install.html b/deps/npm/docs/output/commands/npm-install.html index 509702b5bd4ead..48f62f9e4822c7 100644 --- a/deps/npm/docs/output/commands/npm-install.html +++ b/deps/npm/docs/output/commands/npm-install.html @@ -149,16 +149,7 @@

              Table of contents

              -
              npm install [<@scope>/]<pkg>
              -npm install [<@scope>/]<pkg>@<tag>
              -npm install [<@scope>/]<pkg>@<version>
              -npm install [<@scope>/]<pkg>@<version range>
              -npm install <alias>@npm:<name>
              -npm install <folder>
              -npm install <tarball file>
              -npm install <tarball url>
              -npm install <git:// url>
              -npm install <github username>/<github project>
              +
              npm install [<package-spec> ...]
               
               aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall
               
              diff --git a/deps/npm/docs/output/commands/npm-link.html b/deps/npm/docs/output/commands/npm-link.html index f7d5f66a9e2bd2..cd31a3ee0dfd25 100644 --- a/deps/npm/docs/output/commands/npm-link.html +++ b/deps/npm/docs/output/commands/npm-link.html @@ -149,8 +149,7 @@

              Table of contents

              -
              npm link (in package dir)
              -npm link [<@scope>/]<pkg>[@<version>]
              +
              npm link [<package-spec>]
               
               alias: ln
               
              @@ -161,11 +160,11 @@

              Description

              This is handy for installing your own stuff, so that you can work on it and test iteratively without having to continually rebuild.

              Package linking is a two-step process.

              -

              First, npm link in a package folder will create a symlink in the global -folder {prefix}/lib/node_modules/<package> that links to the package -where the npm link command was executed. It will also link any bins in -the package to {prefix}/bin/{name}. Note that npm link uses the global -prefix (see npm prefix -g for its value).

              +

              First, npm link in a package folder with no arguments will create a +symlink in the global folder {prefix}/lib/node_modules/<package> that +links to the package where the npm link command was executed. It will +also link any bins in the package to {prefix}/bin/{name}. Note that +npm link uses the global prefix (see npm prefix -g for its value).

              Next, in some other location, npm link package-name will create a symbolic link from globally-installed package-name to node_modules/ of the current folder.

              @@ -452,6 +451,7 @@

              See Also

                +
              • package spec
              • npm developers
              • package.json
              • npm install
              • diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 7b1c29f9a80639..4363442ef3dab0 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -149,7 +149,7 @@

                Table of contents

                -
                npm ls [[<@scope>/]<pkg> ...]
                +
                npm ls <package-spec>
                 
                 alias: list
                 
                @@ -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.12.1 /path/to/npm
                +
                npm@8.13.1 /path/to/npm
                 └─┬ init-package-json@0.0.4
                   └── promzard@0.1.5
                 
                @@ -379,6 +379,7 @@

                See Also

                  +
                • package spec
                • npm explain
                • npm config
                • npmrc
                • diff --git a/deps/npm/docs/output/commands/npm-outdated.html b/deps/npm/docs/output/commands/npm-outdated.html index 0bdb9f9a66a14a..57740228c48ab6 100644 --- a/deps/npm/docs/output/commands/npm-outdated.html +++ b/deps/npm/docs/output/commands/npm-outdated.html @@ -149,7 +149,7 @@

                  Table of contents

                  -
                  npm outdated [[<@scope>/]<pkg> ...]
                  +
                  npm outdated [<package-spec> ...]
                   
                  @@ -304,6 +304,7 @@

                  workspace

                  See Also

                    +
                  • package spec
                  • npm update
                  • npm dist-tag
                  • npm registry
                  • diff --git a/deps/npm/docs/output/commands/npm-owner.html b/deps/npm/docs/output/commands/npm-owner.html index 744f7821408fd5..bf47a0ce04f93d 100644 --- a/deps/npm/docs/output/commands/npm-owner.html +++ b/deps/npm/docs/output/commands/npm-owner.html @@ -149,9 +149,9 @@

                    Table of contents

                    -
                    npm owner add <user> [<@scope>/]<pkg>
                    -npm owner rm <user> [<@scope>/]<pkg>
                    -npm owner ls [<@scope>/]<pkg>
                    +
                    npm owner add <user> <package-spec>
                    +npm owner rm <user> <package-spec>
                    +npm owner ls <package-spec>
                     
                     alias: author
                     
                    @@ -240,6 +240,7 @@

                    workspaces

                    See Also

                      +
                    • package spec
                    • npm profile
                    • npm publish
                    • npm registry
                    • diff --git a/deps/npm/docs/output/commands/npm-pack.html b/deps/npm/docs/output/commands/npm-pack.html index 86e45cb303ae36..387becd8c1f8ca 100644 --- a/deps/npm/docs/output/commands/npm-pack.html +++ b/deps/npm/docs/output/commands/npm-pack.html @@ -149,7 +149,7 @@

                      Table of contents

                      -
                      npm pack [[<@scope>/]<pkg>...]
                      +
                      npm pack <package-spec>
                       
                      @@ -255,6 +255,7 @@

                      Description

                      If no arguments are supplied, then npm packs the current package folder.

                      See Also

                        +
                      • package spec
                      • npm-packlist package
                      • npm cache
                      • npm publish
                      • diff --git a/deps/npm/docs/output/commands/npm-publish.html b/deps/npm/docs/output/commands/npm-publish.html index 23e5f11ea0e927..019295ab1f0c66 100644 --- a/deps/npm/docs/output/commands/npm-publish.html +++ b/deps/npm/docs/output/commands/npm-publish.html @@ -149,58 +149,31 @@

                        Table of contents

                        -
                        npm publish [<folder>]
                        +
                        npm publish <package-spec>
                         

                        Description

                        Publishes a package to the registry so that it can be installed by name.

                        -

                        By default npm will publish to the public registry. This can be overridden -by specifying a different default registry or using a -scope in the name (see +

                        By default npm will publish to the public registry. This can be +overridden by specifying a different default registry or using a +scope in the name, combined with a +scope-configured registry (see package.json).

                        +

                        A package is interpreted the same way as other commands (like +npm install and can be:

                          -
                        • -

                          <folder>: A folder containing a package.json file

                          -
                        • -
                        • -

                          <tarball>: A url or file path to a gzipped tar archive containing a -single folder with a package.json file inside.

                          -
                        • -
                        • -

                          [--tag <tag>]: Registers the published package with the given tag, such -that npm install <name>@<tag> will install this version. By default, -npm publish updates and npm install installs the latest tag. See -npm-dist-tag for details about tags.

                          -
                        • -
                        • -

                          [--access <public|restricted>]: Tells the registry whether this package -should be published as public or restricted. Only applies to scoped -packages, which default to restricted. If you don't have a paid -account, you must publish with --access public to publish scoped -packages.

                          -
                        • -
                        • -

                          [--otp <otpcode>]: If you have two-factor authentication enabled in -auth-and-writes mode then you can provide a code from your -authenticator with this. If you don't include this and you're running -from a TTY then you'll be prompted.

                          -
                        • -
                        • -

                          [--dry-run]: As of npm@6, does everything publish would do except -actually publishing to the registry. Reports the details of what would -have been published.

                          -
                        • -
                        • -

                          [--workspaces]: Enables workspace context while publishing. All -workspace packages will be published.

                          -
                        • -
                        • -

                          [--workspace]: Enables workspaces context and limits results to only -those specified by this config item. Only the packages in the -workspaces given will be published.

                          -
                        • +
                        • a) a folder containing a program described by a +package.json file
                        • +
                        • b) a gzipped tarball containing (a)
                        • +
                        • c) a url that resolves to (b)
                        • +
                        • d) a <name>@<version> that is published on the registry (see +registry) with (c)
                        • +
                        • e) a <name>@<tag> (see npm dist-tag) that +points to (d)
                        • +
                        • f) a <name> that has a "latest" tag satisfying (e)
                        • +
                        • g) a <git remote url> that resolves to (a)

                        The publish will fail if the package name and version combination already exists in the specified registry.

                        @@ -361,6 +334,7 @@

                        include-workspace-root

                        See Also

                          +
                        • package spec
                        • npm-packlist package
                        • npm registry
                        • npm scope
                        • diff --git a/deps/npm/docs/output/commands/npm-rebuild.html b/deps/npm/docs/output/commands/npm-rebuild.html index f4524f1a4f0baa..2fdd821d592d13 100644 --- a/deps/npm/docs/output/commands/npm-rebuild.html +++ b/deps/npm/docs/output/commands/npm-rebuild.html @@ -149,7 +149,7 @@

                          Table of contents

                          -
                          npm rebuild [[<@scope>/]<name>[@<version>] ...]
                          +
                          npm rebuild [<package-spec>] ...]
                           
                           alias: rb
                           
                          @@ -162,9 +162,8 @@

                          Description

                          C++ addons with the new binary. It is also useful when installing with --ignore-scripts and --no-bin-links, to explicitly choose which packages to build and/or link bins.

                          -

                          If one or more package names (and optionally version ranges) are provided, -then only packages with a name and version matching one of the specifiers -will be rebuilt.

                          +

                          If one or more package specs are provided, then only packages with a +name and version matching one of the specifiers will be rebuilt.

                          Configuration

                          @@ -285,6 +284,7 @@

                          See Also

            diff --git a/deps/npm/docs/output/commands/npm-restart.html b/deps/npm/docs/output/commands/npm-restart.html index f65a170d53838b..0e39072664a1d7 100644 --- a/deps/npm/docs/output/commands/npm-restart.html +++ b/deps/npm/docs/output/commands/npm-restart.html @@ -196,7 +196,7 @@

            script-shell

          • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
          • Type: null or String
          -

          The shell to use for scripts run with the npm exec, npm run and npm init <pkg> commands.

          +

          The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

          diff --git a/deps/npm/docs/output/commands/npm-run-script.html b/deps/npm/docs/output/commands/npm-run-script.html index 6211c2b55efcfc..d74acb05644c68 100644 --- a/deps/npm/docs/output/commands/npm-run-script.html +++ b/deps/npm/docs/output/commands/npm-run-script.html @@ -324,7 +324,7 @@

          script-shell

        • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
        • Type: null or String
        -

        The shell to use for scripts run with the npm exec, npm run and npm init <pkg> commands.

        +

        The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

        diff --git a/deps/npm/docs/output/commands/npm-star.html b/deps/npm/docs/output/commands/npm-star.html index bc1f7ae76992dd..d442e391108d37 100644 --- a/deps/npm/docs/output/commands/npm-star.html +++ b/deps/npm/docs/output/commands/npm-star.html @@ -149,7 +149,7 @@

        Table of contents

        -
        npm star [<pkg>...]
        +
        npm star [<package-spec>...]
         
        @@ -202,6 +202,7 @@

        otp

        See Also

          +
        • package spec
        • npm unstar
        • npm stars
        • npm view
        • diff --git a/deps/npm/docs/output/commands/npm-start.html b/deps/npm/docs/output/commands/npm-start.html index 8cedd9855d88c4..4f300f37adee2f 100644 --- a/deps/npm/docs/output/commands/npm-start.html +++ b/deps/npm/docs/output/commands/npm-start.html @@ -200,7 +200,7 @@

          script-shell

        • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
        • Type: null or String
        -

        The shell to use for scripts run with the npm exec, npm run and npm init <pkg> commands.

        +

        The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

        diff --git a/deps/npm/docs/output/commands/npm-stop.html b/deps/npm/docs/output/commands/npm-stop.html index 87b7d30fd8f3cd..8c91c7321a5ed3 100644 --- a/deps/npm/docs/output/commands/npm-stop.html +++ b/deps/npm/docs/output/commands/npm-stop.html @@ -195,7 +195,7 @@

        script-shell

      • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
      • Type: null or String
      -

      The shell to use for scripts run with the npm exec, npm run and npm init <pkg> commands.

      +

      The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

      diff --git a/deps/npm/docs/output/commands/npm-test.html b/deps/npm/docs/output/commands/npm-test.html index 5c403b94eb99a8..c4d71b30f514cd 100644 --- a/deps/npm/docs/output/commands/npm-test.html +++ b/deps/npm/docs/output/commands/npm-test.html @@ -193,7 +193,7 @@

      script-shell

    • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
    • Type: null or String
    -

    The shell to use for scripts run with the npm exec, npm run and npm init <pkg> commands.

    +

    The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

    diff --git a/deps/npm/docs/output/commands/npm-unpublish.html b/deps/npm/docs/output/commands/npm-unpublish.html index 21fafc89ebaacf..ab5858f2666fd5 100644 --- a/deps/npm/docs/output/commands/npm-unpublish.html +++ b/deps/npm/docs/output/commands/npm-unpublish.html @@ -149,7 +149,7 @@

    Table of contents

    -
    npm unpublish [<@scope>/]<pkg>[@<version>]
    +
    npm unpublish [<package-spec>]
     
    @@ -257,6 +257,7 @@

    workspaces

    See Also

      +
    • package spec
    • npm deprecate
    • npm publish
    • npm registry
    • diff --git a/deps/npm/docs/output/commands/npm-unstar.html b/deps/npm/docs/output/commands/npm-unstar.html index a332f857e6b7ea..c8b057f8e2d163 100644 --- a/deps/npm/docs/output/commands/npm-unstar.html +++ b/deps/npm/docs/output/commands/npm-unstar.html @@ -149,7 +149,7 @@

      Table of contents

      -
      npm unstar [<pkg>...]
      +
      npm unstar [<package-spec>...]
       
      diff --git a/deps/npm/docs/output/commands/npm-view.html b/deps/npm/docs/output/commands/npm-view.html index 0eb17026a77b39..2b74e28f3b9256 100644 --- a/deps/npm/docs/output/commands/npm-view.html +++ b/deps/npm/docs/output/commands/npm-view.html @@ -149,7 +149,7 @@

      Table of contents

      -
      npm view [<@scope>/]<pkg>[@<version>] [<field>[.subfield]...]
      +
      npm view [<package-spec>] [<field>[.subfield]...]
       
       aliases: info, show, v
       
      @@ -285,6 +285,7 @@

      Output

      the field name.

      See Also

        +
      • package spec
      • npm search
      • npm registry
      • npm config
      • diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 040166af65cabb..c7b7dd5dc7a046 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.12.1

        +

        8.13.1

        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/configuring-npm/package-json.html b/deps/npm/docs/output/configuring-npm/package-json.html index d5860ee6e299a1..a3bcd299c5bbe6 100644 --- a/deps/npm/docs/output/configuring-npm/package-json.html +++ b/deps/npm/docs/output/configuring-npm/package-json.html @@ -304,7 +304,7 @@

        people fields: author, contributorsBoth email and url are optional either way.

        npm also sets a top-level "maintainers" field with your npm user info.

        funding

        -

        You can specify an object containing an URL that provides up-to-date +

        You can specify an object containing a URL that provides up-to-date information about ways to help fund development of your package, or a string URL, or an array of these:

        {
        diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html
        index 4ec52124ffe563..42789d96b7922e 100644
        --- a/deps/npm/docs/output/using-npm/config.html
        +++ b/deps/npm/docs/output/using-npm/config.html
        @@ -1360,7 +1360,7 @@ 

        script-shell

      • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
      • Type: null or String
      -

      The shell to use for scripts run with the npm exec, npm run and npm init <pkg> commands.

      +

      The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

      searchexclude

      diff --git a/deps/npm/docs/output/using-npm/package-spec.html b/deps/npm/docs/output/using-npm/package-spec.html new file mode 100644 index 00000000000000..2b0855737bc269 --- /dev/null +++ b/deps/npm/docs/output/using-npm/package-spec.html @@ -0,0 +1,254 @@ + + +package-spec + + + + + +
      +
      +

      package-spec

      +Package name specifier +
      + +
      +

      Table of contents

      + +
      + +

      Description

      +

      Commands like npm install and the dependency sections in the +package.json use a package name specifier. This can be many different +things that all refer to a "package". Examples include a package name, +git url, tarball, or local directory. These will generally be referred +to as <package-spec> in the help output for the npm commands that use +this package name specifier.

      +

      Package name

      +
        +
      • [<@scope>/]<pkg>
      • +
      • [<@scope>/]<pkg>@<tag>
      • +
      • [<@scope>/]<pkg>@<version>
      • +
      • [<@scope>/]<pkg>@<version range>
      • +
      +

      Refers to a package by name, with or without a scope, and optionally +tag, version, or version range. This is typically used in combination +with the registry config to refer to a +package in a registry.

      +

      Examples:

      +
        +
      • npm
      • +
      • @npmcli/arborist
      • +
      • @npmcli/arborist@latest
      • +
      • npm@6.13.1
      • +
      • npm@^4.0.0
      • +
      +

      Aliases

      +
        +
      • <alias>@npm:<name>
      • +
      +

      Primarily used by commands like npm install and in the dependency +sections in the package.json, this refers to a package by an alias. +The <alias> is the name of the package as it is reified in the +node_modules folder, and the <name> refers to a package name as +found in the configured registry.

      +

      See Package name above for more info on referring to a package by +name, and registry for configuring which +registry is used when referring to a package by name.

      +

      Examples:

      +
        +
      • semver:@npm:@npmcli/semver-with-patch
      • +
      • semver:@npm:semver@7.2.2
      • +
      • semver:@npm:semver@legacy
      • +
      +

      Folders

      +
        +
      • <folder>
      • +
      +

      This refers to a package on the local filesystem. Specifically this is +a folder with a package.json file in it. This should always be +prefixed with a / or ./ (or your OS equivalent) to reduce confusion. +npm currently will parse a string with more than one / in it as a +folder, but this is legacy behavior that may be removed in a future +version.

      +

      Examples:

      +
        +
      • ./my-package
      • +
      • /opt/npm/my-package
      • +
      +

      Tarballs

      +
        +
      • <tarball file>
      • +
      • <tarball url>
      • +
      +

      Examples:

      +
        +
      • ./my-package.tgz
      • +
      • https://registry.npmjs.org/semver/-/semver-1.0.0.tgz
      • +
      +

      Refers to a package in a tarball format, either on the local filesystem +or remotely via url. This is the format that packages exist in when +uploaded to a registry.

      +

      git urls

      +
        +
      • <git:// url>
      • +
      • <github username>/<github project>
      • +
      +

      Refers to a package in a git repo. This can be a full git url, git +shorthand, or a username/package on GitHub. You can specify a +git tag, branch, or other git ref by appending #ref.

      +

      Examples:

      +
        +
      • https://github.com/npm/cli.git
      • +
      • git@github.com:npm/cli.git
      • +
      • git+ssh://git@github.com/npm/cli#v6.0.0
      • +
      • github:npm/cli#HEAD
      • +
      • npm/cli#c12ea07
      • +
      +

      See also

      +

      npm-package-arg +scope +config

      +
      + + +
      + + + + \ No newline at end of file diff --git a/deps/npm/lib/auth/legacy.js b/deps/npm/lib/auth/legacy.js index d1401ce14b9ef1..9aed12f3926fbe 100644 --- a/deps/npm/lib/auth/legacy.js +++ b/deps/npm/lib/auth/legacy.js @@ -1,6 +1,6 @@ const profile = require('npm-profile') const log = require('../utils/log-shim') -const openUrl = require('../utils/open-url.js') +const openUrlPrompt = require('../utils/open-url-prompt.js') const read = require('../utils/read-user-info.js') const loginPrompter = async (creds) => { @@ -47,7 +47,15 @@ const login = async (npm, opts) => { return newUser } - const openerPromise = (url) => openUrl(npm, url, 'to complete your login please visit') + const openerPromise = (url, emitter) => + openUrlPrompt( + npm, + url, + 'Authenticate your account at', + 'Press ENTER to open in the browser...', + emitter + ) + try { res = await profile.login(openerPromise, loginPrompter, opts) } catch (err) { diff --git a/deps/npm/lib/commands/cache.js b/deps/npm/lib/commands/cache.js index 862f346adb4369..bc52889c0006fb 100644 --- a/deps/npm/lib/commands/cache.js +++ b/deps/npm/lib/commands/cache.js @@ -68,11 +68,7 @@ class Cache extends BaseCommand { static name = 'cache' static params = ['cache'] static usage = [ - 'add ', - 'add ', - 'add ', - 'add ', - 'add @', + 'add ', 'clean []', 'ls [@]', 'verify', diff --git a/deps/npm/lib/commands/deprecate.js b/deps/npm/lib/commands/deprecate.js index 0ae88f1921f566..862c214dbe592f 100644 --- a/deps/npm/lib/commands/deprecate.js +++ b/deps/npm/lib/commands/deprecate.js @@ -9,7 +9,7 @@ const BaseCommand = require('../base-command.js') class Deprecate extends BaseCommand { static description = 'Deprecate a version of a package' static name = 'deprecate' - static usage = ['[@] '] + static usage = [' '] static params = [ 'registry', 'otp', diff --git a/deps/npm/lib/commands/dist-tag.js b/deps/npm/lib/commands/dist-tag.js index a207e422cb53c1..e74a3f1d435c9b 100644 --- a/deps/npm/lib/commands/dist-tag.js +++ b/deps/npm/lib/commands/dist-tag.js @@ -12,9 +12,9 @@ class DistTag extends BaseCommand { static params = ['workspace', 'workspaces', 'include-workspace-root'] static name = 'dist-tag' static usage = [ - 'add @ []', - 'rm ', - 'ls []', + 'add []', + 'rm ', + 'ls []', ] static ignoreImplicitWorkspace = false @@ -90,7 +90,7 @@ class DistTag extends BaseCommand { log.verbose('dist-tag add', defaultTag, 'to', spec.name + '@' + version) if (!spec.name || !version || !defaultTag) { - throw this.usageError() + throw this.usageError('must provide a spec with a name and version, and a tag to add') } const t = defaultTag.trim() diff --git a/deps/npm/lib/commands/explain.js b/deps/npm/lib/commands/explain.js index ca6ee7540bc916..c0ef04548a4ed3 100644 --- a/deps/npm/lib/commands/explain.js +++ b/deps/npm/lib/commands/explain.js @@ -10,7 +10,7 @@ const ArboristWorkspaceCmd = require('../arborist-cmd.js') class Explain extends ArboristWorkspaceCmd { static description = 'Explain installed packages' static name = 'explain' - static usage = [''] + static usage = [''] static params = [ 'json', 'workspace', diff --git a/deps/npm/lib/commands/fund.js b/deps/npm/lib/commands/fund.js index 09ca81653b0eb3..9690cbc32e0792 100644 --- a/deps/npm/lib/commands/fund.js +++ b/deps/npm/lib/commands/fund.js @@ -20,7 +20,7 @@ class Fund extends ArboristWorkspaceCmd { static description = 'Retrieve funding information' static name = 'fund' static params = ['json', 'browser', 'unicode', 'workspace', 'which'] - static usage = ['[[<@scope>/]]'] + static usage = ['[]'] // TODO /* istanbul ignore next */ diff --git a/deps/npm/lib/commands/init.js b/deps/npm/lib/commands/init.js index 4c299e65137bed..b8b6bd5d53e088 100644 --- a/deps/npm/lib/commands/init.js +++ b/deps/npm/lib/commands/init.js @@ -18,6 +18,7 @@ class Init extends BaseCommand { static params = [ 'yes', 'force', + 'scope', 'workspace', 'workspaces', 'workspaces-update', @@ -26,9 +27,8 @@ class Init extends BaseCommand { static name = 'init' static usage = [ - '[--force|-f|--yes|-y|--scope]', + ' (same as `npx )', '<@scope> (same as `npx <@scope>/create`)', - '[<@scope>/] (same as `npx [<@scope>/]create-`)', ] static ignoreImplicitWorkspace = false diff --git a/deps/npm/lib/commands/install.js b/deps/npm/lib/commands/install.js index 4cda36448317fe..ecc0727a2ef7c4 100644 --- a/deps/npm/lib/commands/install.js +++ b/deps/npm/lib/commands/install.js @@ -34,18 +34,7 @@ class Install extends ArboristWorkspaceCmd { ...super.params, ] - static usage = [ - '[<@scope>/]', - '[<@scope>/]@', - '[<@scope>/]@', - '[<@scope>/]@', - '@npm:', - '', - '', - '', - '', - '/', - ] + static usage = ['[ ...]'] async completion (opts) { const { partialWord } = opts diff --git a/deps/npm/lib/commands/link.js b/deps/npm/lib/commands/link.js index 80a60d36e324e9..b0b889ea787fd5 100644 --- a/deps/npm/lib/commands/link.js +++ b/deps/npm/lib/commands/link.js @@ -15,8 +15,7 @@ class Link extends ArboristWorkspaceCmd { static description = 'Symlink a package folder' static name = 'link' static usage = [ - '(in package dir)', - '[<@scope>/][@]', + '[]', ] static params = [ diff --git a/deps/npm/lib/commands/ls.js b/deps/npm/lib/commands/ls.js index cfd9cb5a5051ca..d3932072b7d348 100644 --- a/deps/npm/lib/commands/ls.js +++ b/deps/npm/lib/commands/ls.js @@ -27,7 +27,7 @@ const localeCompare = require('@isaacs/string-locale-compare')('en') class LS extends ArboristWorkspaceCmd { static description = 'List installed packages' static name = 'ls' - static usage = ['[[<@scope>/] ...]'] + static usage = [''] static params = [ 'all', 'json', diff --git a/deps/npm/lib/commands/outdated.js b/deps/npm/lib/commands/outdated.js index 081e75a2c61d36..042b776f71e0d8 100644 --- a/deps/npm/lib/commands/outdated.js +++ b/deps/npm/lib/commands/outdated.js @@ -15,7 +15,7 @@ const ArboristWorkspaceCmd = require('../arborist-cmd.js') class Outdated extends ArboristWorkspaceCmd { static description = 'Check for outdated packages' static name = 'outdated' - static usage = ['[[<@scope>/] ...]'] + static usage = ['[ ...]'] static params = [ 'all', 'json', diff --git a/deps/npm/lib/commands/owner.js b/deps/npm/lib/commands/owner.js index 4797e9c7ec84b4..732bb40a300502 100644 --- a/deps/npm/lib/commands/owner.js +++ b/deps/npm/lib/commands/owner.js @@ -27,9 +27,9 @@ class Owner extends BaseCommand { ] static usage = [ - 'add [<@scope>/]', - 'rm [<@scope>/]', - 'ls [<@scope>/]', + 'add ', + 'rm ', + 'ls ', ] static ignoreImplicitWorkspace = false diff --git a/deps/npm/lib/commands/pack.js b/deps/npm/lib/commands/pack.js index 8190ceecaf94bc..c6a74804642f66 100644 --- a/deps/npm/lib/commands/pack.js +++ b/deps/npm/lib/commands/pack.js @@ -17,7 +17,7 @@ class Pack extends BaseCommand { 'include-workspace-root', ] - static usage = ['[[<@scope>/]...]'] + static usage = [''] static ignoreImplicitWorkspace = false async exec (args) { diff --git a/deps/npm/lib/commands/publish.js b/deps/npm/lib/commands/publish.js index da6437fa9c58fc..579f5d6e74e67c 100644 --- a/deps/npm/lib/commands/publish.js +++ b/deps/npm/lib/commands/publish.js @@ -37,7 +37,7 @@ class Publish extends BaseCommand { 'include-workspace-root', ] - static usage = ['[]'] + static usage = [''] static ignoreImplicitWorkspace = false async exec (args) { diff --git a/deps/npm/lib/commands/rebuild.js b/deps/npm/lib/commands/rebuild.js index 3e6046d8df22b0..d06313ce483a95 100644 --- a/deps/npm/lib/commands/rebuild.js +++ b/deps/npm/lib/commands/rebuild.js @@ -16,7 +16,7 @@ class Rebuild extends ArboristWorkspaceCmd { ...super.params, ] - static usage = ['[[<@scope>/][@] ...]'] + static usage = ['[] ...]'] // TODO /* istanbul ignore next */ diff --git a/deps/npm/lib/commands/star.js b/deps/npm/lib/commands/star.js index 7b76be3c1632d5..20039bf8938116 100644 --- a/deps/npm/lib/commands/star.js +++ b/deps/npm/lib/commands/star.js @@ -7,7 +7,7 @@ const BaseCommand = require('../base-command.js') class Star extends BaseCommand { static description = 'Mark your favorite packages' static name = 'star' - static usage = ['[...]'] + static usage = ['[...]'] static params = [ 'registry', 'unicode', diff --git a/deps/npm/lib/commands/unpublish.js b/deps/npm/lib/commands/unpublish.js index f27be2e41c1078..ab929d98cadfa3 100644 --- a/deps/npm/lib/commands/unpublish.js +++ b/deps/npm/lib/commands/unpublish.js @@ -20,7 +20,7 @@ class Unpublish extends BaseCommand { static description = 'Remove a package from the registry' static name = 'unpublish' static params = ['dry-run', 'force', 'workspace', 'workspaces'] - static usage = ['[<@scope>/][@]'] + static usage = ['[]'] static ignoreImplicitWorkspace = false async getKeysOfVersions (name, opts) { diff --git a/deps/npm/lib/commands/view.js b/deps/npm/lib/commands/view.js index efb298a03bc359..3b8524ad3fc0d5 100644 --- a/deps/npm/lib/commands/view.js +++ b/deps/npm/lib/commands/view.js @@ -33,7 +33,7 @@ class View extends BaseCommand { static ignoreImplicitWorkspace = false - static usage = ['[<@scope>/][@] [[.subfield]...]'] + static usage = ['[] [[.subfield]...]'] async completion (opts) { if (opts.conf.argv.remain.length <= 2) { @@ -236,6 +236,15 @@ class View extends BaseCommand { } }) + // No data has been pushed because no data is matching the specified version + if (data.length === 0 && version !== 'latest') { + const er = new Error(`No match found for version ${version}`) + er.statusCode = 404 + er.code = 'E404' + er.pkgid = `${pckmnt._id}@${version}` + throw er + } + if ( !this.npm.config.get('json') && args.length === 1 && diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js index 4c77e375c5ccf3..6b35e7d4d05b4c 100644 --- a/deps/npm/lib/utils/config/definitions.js +++ b/deps/npm/lib/utils/config/definitions.js @@ -535,7 +535,7 @@ define('dev', { define('diff', { default: [], - hint: '', + hint: '', type: [String, Array], description: ` Define arguments to compare in \`npm diff\`. @@ -1458,7 +1458,7 @@ define('otp', { define('package', { default: [], - hint: '[@]', + hint: '', type: [String, Array], description: ` The package to install for [\`npm exec\`](/commands/npm-exec) @@ -1867,7 +1867,7 @@ define('script-shell', { type: [null, String], description: ` The shell to use for scripts run with the \`npm exec\`, - \`npm run\` and \`npm init \` commands. + \`npm run\` and \`npm init \` commands. `, flatten (key, obj, flatOptions) { flatOptions.scriptShell = obj[key] || undefined diff --git a/deps/npm/lib/utils/open-url-prompt.js b/deps/npm/lib/utils/open-url-prompt.js new file mode 100644 index 00000000000000..3eb3ac288c0355 --- /dev/null +++ b/deps/npm/lib/utils/open-url-prompt.js @@ -0,0 +1,69 @@ +const readline = require('readline') +const opener = require('opener') + +function print (npm, title, url) { + const json = npm.config.get('json') + + const message = json ? JSON.stringify({ title, url }) : `${title}:\n${url}` + + npm.output(message) +} + +// Prompt to open URL in browser if possible +const promptOpen = async (npm, url, title, prompt, emitter) => { + const browser = npm.config.get('browser') + const isInteractive = process.stdin.isTTY === true && process.stdout.isTTY === true + + try { + if (!/^https?:$/.test(new URL(url).protocol)) { + throw new Error() + } + } catch (_) { + throw new Error('Invalid URL: ' + url) + } + + print(npm, title, url) + + if (browser === false || !isInteractive) { + return + } + + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + }) + + const tryOpen = await new Promise(resolve => { + rl.question(prompt, () => { + resolve(true) + }) + + if (emitter && emitter.addListener) { + emitter.addListener('abort', () => { + rl.close() + + // clear the prompt line + npm.output('') + + resolve(false) + }) + } + }) + + if (!tryOpen) { + return + } + + const command = browser === true ? null : browser + await new Promise((resolve, reject) => { + opener(url, { command }, err => { + if (err) { + return reject(err) + } + + return resolve() + }) + }) +} + +module.exports = promptOpen diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index 42e1998371c0e4..30b4947bd0b24b 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -5,11 +5,7 @@ .P .RS 2 .nf -npm cache add -npm cache add -npm cache add -npm cache add -npm cache add @ +npm cache add npm cache clean [] npm cache ls [@] npm cache verify @@ -85,6 +81,8 @@ cache\fP .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help folders .IP \(bu 2 npm help config diff --git a/deps/npm/man/man1/npm-ci.1 b/deps/npm/man/man1/npm-ci.1 index 533ec91005862d..5c92d5d9ba7059 100644 --- a/deps/npm/man/man1/npm-ci.1 +++ b/deps/npm/man/man1/npm-ci.1 @@ -133,7 +133,7 @@ Type: null or String .RE .P The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm -init \fP commands\. +init \fP commands\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index e9ab9bae71a6fb..7f9fe808f5013c 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -5,7 +5,7 @@ .P .RS 2 .nf -npm deprecate [@] +npm deprecate .fi .RE .P @@ -38,8 +38,8 @@ In this case, a version \fBmy\-thing@1\.0\.0\-beta\.0\fP will also be deprecated You must be the package owner to deprecate something\. See the \fBowner\fP and \fBadduser\fP help topics\. .P -To un\-deprecate a package, specify an empty string (\fB""\fP) for the \fBmessage\fP -argument\. Note that you must use double quotes with no space between them to +To un\-deprecate a package, specify an empty string (\fB""\fP) for the \fBmessage\fP +argument\. Note that you must use double quotes with no space between them to format an empty string\. .SS Configuration .SS \fBregistry\fP @@ -69,6 +69,8 @@ password, npm will prompt on the command line for one\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help publish .IP \(bu 2 npm help registry diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index 7e1c14539540d7..7334c059d4d7f5 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -5,9 +5,9 @@ .P .RS 2 .nf -npm dist\-tag add @ [] -npm dist\-tag rm -npm dist\-tag ls [] +npm dist\-tag add [] +npm dist\-tag rm +npm dist\-tag ls [] alias: dist\-tags .fi @@ -17,11 +17,11 @@ alias: dist\-tags Add, remove, and enumerate distribution tags on a package: .RS 0 .IP \(bu 2 -add: Tags the specified version of the package with the specified tag, or -the \fB\-\-tag\fP config if not specified\. If you have two\-factor -authentication on auth\-and\-writes then you’ll need to include a one\-time -password on the command line with \fB\-\-otp \fP, or at the -OTP prompt\. +add: Tags the specified version of the package with the specified tag, +or the \fB\-\-tag\fP config if not specified\. If you have two\-factor +authentication on auth\-and\-writes then you’ll need to include a +one\-time password on the command line with +\fB\-\-otp \fP, or at the OTP prompt\. .IP \(bu 2 rm: Clear a tag that is no longer in use from the package\. If you have two\-factor authentication on auth\-and\-writes then you’ll need to include @@ -164,6 +164,8 @@ This value is not exported to the environment for child processes\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help publish .IP \(bu 2 npm help install diff --git a/deps/npm/man/man1/npm-explain.1 b/deps/npm/man/man1/npm-explain.1 index 9a3eec6756ddd8..fc7c2f2343b3d0 100644 --- a/deps/npm/man/man1/npm-explain.1 +++ b/deps/npm/man/man1/npm-explain.1 @@ -5,7 +5,7 @@ .P .RS 2 .nf -npm explain +npm explain alias: why .fi @@ -15,9 +15,10 @@ alias: why This command will print the chain of dependencies causing a given package to be installed in the current project\. .P -Positional arguments can be either folders within \fBnode_modules\fP, or -\fBname@version\-range\fP specifiers, which will select the dependency -relationships to explain\. +If one or more package specs are provided, then only packages matching +one of the specifiers will have their relationships explained\. +.P +The package spec can also refer to a folder within \fB\|\./node_modules\fP .P For example, running \fBnpm explain glob\fP within npm's source tree will show: .P @@ -106,6 +107,8 @@ This value is not exported to the environment for child processes\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help config .IP \(bu 2 npm help npmrc diff --git a/deps/npm/man/man1/npm-fund.1 b/deps/npm/man/man1/npm-fund.1 index ef77df60ce83d5..3f48fda912c551 100644 --- a/deps/npm/man/man1/npm-fund.1 +++ b/deps/npm/man/man1/npm-fund.1 @@ -5,27 +5,27 @@ .P .RS 2 .nf -npm fund [[<@scope>/]] +npm fund [] .fi .RE .SS Description .P This command retrieves information on how to fund the dependencies of a given project\. If no package name is provided, it will list all -dependencies that are looking for funding in a tree structure, listing the -type of funding and the url to visit\. If a package name is provided then it -tries to open its funding url using the \fB\-\-browser\fP config param; if there -are multiple funding sources for the package, the user will be instructed -to pass the \fB\-\-which\fP option to disambiguate\. +dependencies that are looking for funding in a tree structure, listing +the type of funding and the url to visit\. If a package name is provided +then it tries to open its funding url using the \fB\-\-browser\fP config +param; if there are multiple funding sources for the package, the user +will be instructed to pass the \fB\-\-which\fP option to disambiguate\. .P The list will avoid duplicated entries and will stack all packages that -share the same url as a single entry\. Thus, the list does not have the same -shape of the output from \fBnpm ls\fP\|\. +share the same url as a single entry\. Thus, the list does not have the +same shape of the output from \fBnpm ls\fP\|\. .SS Example .SS Workspaces support .P -It's possible to filter the results to only include a single workspace and its -dependencies using the \fBworkspace\fP config option\. +It's possible to filter the results to only include a single workspace +and its dependencies using the \fBworkspace\fP config option\. .SS Example: .P Here's an example running \fBnpm fund\fP in a project with a configured @@ -46,8 +46,8 @@ test\-workspaces\-fund@1\.0\.0 .fi .RE .P -And here is an example of the expected result when filtering only by -a specific workspace \fBa\fP in the same project: +And here is an example of the expected result when filtering only by a +specific workspace \fBa\fP in the same project: .P .RS 2 .nf @@ -148,6 +148,8 @@ If there are multiple funding sources, which 1\-indexed source URL to open\. .SH See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help install .IP \(bu 2 npm help docs diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 51e9f42f824c75..c49b0c7ac4cd47 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -5,9 +5,8 @@ .P .RS 2 .nf -npm init [\-\-force|\-f|\-\-yes|\-y|\-\-scope] +npm init (same as `npx ) npm init <@scope> (same as `npx <@scope>/create`) -npm init [<@scope>/] (same as `npx [<@scope>/]create\-`) aliases: create, innit .fi @@ -232,6 +231,42 @@ Allow unpublishing of entire packages (not just a single version)\. .P If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! +.SS \fBscope\fP +.RS 0 +.IP \(bu 2 +Default: the scope of the current project, if any, or "" +.IP \(bu 2 +Type: String + +.RE +.P +Associate an operation with a scope for a scoped registry\. +.P +Useful when logging in to or out of a private registry: +.P +.RS 2 +.nf +# log in, linking the scope to the custom registry +npm login \-\-scope=@mycorp \-\-registry=https://registry\.mycorp\.com + +# log out, removing the link and the auth token +npm logout \-\-scope=@mycorp +.fi +.RE +.P +This will cause \fB@mycorp\fP to be mapped to the registry for future +installation of packages specified according to the pattern +\fB@mycorp/package\fP\|\. +.P +This will also cause \fBnpm init\fP to create a scoped package\. +.P +.RS 2 +.nf +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init \-\-scope=@foo \-\-yes +.fi +.RE .SS \fBworkspace\fP .RS 0 .IP \(bu 2 @@ -316,6 +351,8 @@ This value is not exported to the environment for child processes\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 init\-package\-json module \fIhttp://npm\.im/init\-package\-json\fR .IP \(bu 2 npm help package\.json diff --git a/deps/npm/man/man1/npm-install-ci-test.1 b/deps/npm/man/man1/npm-install-ci-test.1 index e50f7e90aec027..8f153e1366e240 100644 --- a/deps/npm/man/man1/npm-install-ci-test.1 +++ b/deps/npm/man/man1/npm-install-ci-test.1 @@ -67,7 +67,7 @@ Type: null or String .RE .P The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm -init \fP commands\. +init \fP commands\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index 1e6ece0f47b616..02f9603e2597f8 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -5,16 +5,7 @@ .P .RS 2 .nf -npm install\-test [<@scope>/] -npm install\-test [<@scope>/]@ -npm install\-test [<@scope>/]@ -npm install\-test [<@scope>/]@ -npm install\-test @npm: -npm install\-test -npm install\-test -npm install\-test -npm install\-test -npm install\-test / +npm install\-test [ \.\.\.] alias: it .fi diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index 9d720117819769..f99ad884255373 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -5,16 +5,7 @@ .P .RS 2 .nf -npm install [<@scope>/] -npm install [<@scope>/]@ -npm install [<@scope>/]@ -npm install [<@scope>/]@ -npm install @npm: -npm install -npm install -npm install -npm install -npm install / +npm install [ \.\.\.] aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall .fi diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index d748d168451826..e138490e1b3301 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -5,8 +5,7 @@ .P .RS 2 .nf -npm link (in package dir) -npm link [<@scope>/][@] +npm link [] alias: ln .fi @@ -18,11 +17,11 @@ test iteratively without having to continually rebuild\. .P Package linking is a two\-step process\. .P -First, \fBnpm link\fP in a package folder will create a symlink in the global -folder \fB{prefix}/lib/node_modules/\fP that links to the package -where the \fBnpm link\fP command was executed\. It will also link any bins in -the package to \fB{prefix}/bin/{name}\fP\|\. Note that \fBnpm link\fP uses the global -prefix (see \fBnpm prefix \-g\fP for its value)\. +First, \fBnpm link\fP in a package folder with no arguments will create a +symlink in the global folder \fB{prefix}/lib/node_modules/\fP that +links to the package where the \fBnpm link\fP command was executed\. It will +also link any bins in the package to \fB{prefix}/bin/{name}\fP\|\. Note that +\fBnpm link\fP uses the global prefix (see \fBnpm prefix \-g\fP for its value)\. .P Next, in some other location, \fBnpm link package\-name\fP will create a symbolic link from globally\-installed \fBpackage\-name\fP to \fBnode_modules/\fP of @@ -401,6 +400,8 @@ symlink\. This option has no effect on workspaces\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help developers .IP \(bu 2 npm help package\.json diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index 2308cc16016a62..a24c524909f9ff 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -5,7 +5,7 @@ .P .RS 2 .nf -npm ls [[<@scope>/] \.\.\.] +npm ls alias: list .fi @@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@8\.12\.1 /path/to/npm +npm@8\.13\.1 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi @@ -301,6 +301,8 @@ symlink\. This option has no effect on workspaces\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help explain .IP \(bu 2 npm help config diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 3d5025e0e04335..80ec0928a2baa4 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -5,7 +5,7 @@ .P .RS 2 .nf -npm outdated [[<@scope>/] \.\.\.] +npm outdated [ \.\.\.] .fi .RE .SS Description @@ -208,6 +208,8 @@ This value is not exported to the environment for child processes\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help update .IP \(bu 2 npm help dist\-tag diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index 312bf22942d6c6..85ab4077b21bce 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -5,9 +5,9 @@ .P .RS 2 .nf -npm owner add [<@scope>/] -npm owner rm [<@scope>/] -npm owner ls [<@scope>/] +npm owner add +npm owner rm +npm owner ls alias: author .fi @@ -119,6 +119,8 @@ This value is not exported to the environment for child processes\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help profile .IP \(bu 2 npm help publish diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 028fab69b1af14..a46bf5c752648f 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -5,7 +5,7 @@ .P .RS 2 .nf -npm pack [[<@scope>/]\.\.\.] +npm pack .fi .RE .SS Configuration @@ -138,6 +138,8 @@ If no arguments are supplied, then npm packs the current package folder\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm\-packlist package \fIhttp://npm\.im/npm\-packlist\fR .IP \(bu 2 npm help cache diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index dc914cf75cc4c2..d64a144447f7b2 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -5,50 +5,39 @@ .P .RS 2 .nf -npm publish [] +npm publish .fi .RE .SS Description .P Publishes a package to the registry so that it can be installed by name\. .P -By default npm will publish to the public registry\. This can be overridden -by specifying a different default registry or using a -npm help \fBscope\fP in the name (see +By default npm will publish to the public registry\. This can be +overridden by specifying a different default registry or using a +npm help \fBscope\fP in the name, combined with a +scope\-configured registry (see npm help \fBpackage\.json\fP)\. +.P +A \fBpackage\fP is interpreted the same way as other commands (like +\fBnpm install\fP and can be: .RS 0 .IP \(bu 2 -\fB\fP: A folder containing a package\.json file -.IP \(bu 2 -\fB\fP: A url or file path to a gzipped tar archive containing a -single folder with a package\.json file inside\. +a) a folder containing a program described by a +npm help \fBpackage\.json\fP file .IP \(bu 2 -\fB[\-\-tag ]\fP: Registers the published package with the given tag, such -that \fBnpm install @\fP will install this version\. By default, -\fBnpm publish\fP updates and \fBnpm install\fP installs the \fBlatest\fP tag\. See -\fBnpm\-dist\-tag\fP \fInpm\-dist\-tag\fR for details about tags\. +b) a gzipped tarball containing (a) .IP \(bu 2 -\fB[\-\-access ]\fP: Tells the registry whether this package -should be published as public or restricted\. Only applies to scoped -packages, which default to \fBrestricted\fP\|\. If you don't have a paid -account, you must publish with \fB\-\-access public\fP to publish scoped -packages\. +c) a url that resolves to (b) .IP \(bu 2 -\fB[\-\-otp ]\fP: If you have two\-factor authentication enabled in -\fBauth\-and\-writes\fP mode then you can provide a code from your -authenticator with this\. If you don't include this and you're running -from a TTY then you'll be prompted\. +d) a \fB@\fP that is published on the registry (see +npm help \fBregistry\fP) with (c) .IP \(bu 2 -\fB[\-\-dry\-run]\fP: As of \fBnpm@6\fP, does everything publish would do except -actually publishing to the registry\. Reports the details of what would -have been published\. +e) a \fB@\fP (see npm help \fBdist\-tag\fP) that +points to (d) .IP \(bu 2 -\fB[\-\-workspaces]\fP: Enables workspace context while publishing\. All -workspace packages will be published\. +f) a \fB\fP that has a "latest" tag satisfying (e) .IP \(bu 2 -\fB[\-\-workspace]\fP: Enables workspaces context and limits results to only -those specified by this config item\. Only the packages in the -workspaces given will be published\. +g) a \fB\fP that resolves to (a) .RE .P @@ -241,6 +230,8 @@ This value is not exported to the environment for child processes\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm\-packlist package \fIhttp://npm\.im/npm\-packlist\fR .IP \(bu 2 npm help registry diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index 8d6d90b10f0871..f4e4c56118d292 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -5,7 +5,7 @@ .P .RS 2 .nf -npm rebuild [[<@scope>/][@] \.\.\.] +npm rebuild [] \.\.\.] alias: rb .fi @@ -18,9 +18,8 @@ C++ addons with the new binary\. It is also useful when installing with \fB\-\-ignore\-scripts\fP and \fB\-\-no\-bin\-links\fP, to explicitly choose which packages to build and/or link bins\. .P -If one or more package names (and optionally version ranges) are provided, -then only packages with a name and version matching one of the specifiers -will be rebuilt\. +If one or more package specs are provided, then only packages with a +name and version matching one of the specifiers will be rebuilt\. .SS Configuration .SS \fBglobal\fP .RS 0 @@ -174,6 +173,8 @@ symlink\. This option has no effect on workspaces\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help install .RE diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 2f99ee51ed4fc1..460a94350f1bd9 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -72,7 +72,7 @@ Type: null or String .RE .P The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm -init \fP commands\. +init \fP commands\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index fc26c71e0310f9..c9dc22f4eb6bd4 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -256,7 +256,7 @@ Type: null or String .RE .P The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm -init \fP commands\. +init \fP commands\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 2ccd4046e42d7e..2e91f78bdc9ca8 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -5,7 +5,7 @@ .P .RS 2 .nf -npm star [\.\.\.] +npm star [\.\.\.] .fi .RE .P @@ -67,6 +67,8 @@ password, npm will prompt on the command line for one\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help unstar .IP \(bu 2 npm help stars diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index 589ecea4a240a7..af45de89f3f5d3 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -71,7 +71,7 @@ Type: null or String .RE .P The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm -init \fP commands\. +init \fP commands\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 19695cc0e04174..f1159699a3bbca 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -64,7 +64,7 @@ Type: null or String .RE .P The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm -init \fP commands\. +init \fP commands\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index fbbe80d2638e40..8dd0f2f6828b00 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -61,7 +61,7 @@ Type: null or String .RE .P The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm -init \fP commands\. +init \fP commands\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index ff538299e7c355..57ba85fb432522 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -5,7 +5,7 @@ .P .RS 2 .nf -npm unpublish [<@scope>/][@] +npm unpublish [] .fi .RE .P @@ -149,6 +149,8 @@ This value is not exported to the environment for child processes\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help deprecate .IP \(bu 2 npm help publish diff --git a/deps/npm/man/man1/npm-unstar.1 b/deps/npm/man/man1/npm-unstar.1 index d71bfff266b312..b3ece049f9bb53 100644 --- a/deps/npm/man/man1/npm-unstar.1 +++ b/deps/npm/man/man1/npm-unstar.1 @@ -5,7 +5,7 @@ .P .RS 2 .nf -npm unstar [\.\.\.] +npm unstar [\.\.\.] .fi .RE .P diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index efba9ebd6bd696..7f83d89bf67b74 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -5,7 +5,7 @@ .P .RS 2 .nf -npm view [<@scope>/][@] [[\.subfield]\.\.\.] +npm view [] [[\.subfield]\.\.\.] aliases: info, show, v .fi @@ -216,6 +216,8 @@ the field name\. .SS See Also .RS 0 .IP \(bu 2 +npm help package spec +.IP \(bu 2 npm help search .IP \(bu 2 npm help registry diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 45db3c9e53776e..a26c713a11000f 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -4,7 +4,7 @@ .SS Synopsis .SS Version .P -8\.12\.1 +8\.13\.1 .SS Description .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man5/package-json.5 b/deps/npm/man/man5/package-json.5 index 17c4c1e322c6b1..f6477ebc015c05 100644 --- a/deps/npm/man/man5/package-json.5 +++ b/deps/npm/man/man5/package-json.5 @@ -246,7 +246,7 @@ Both email and url are optional either way\. npm also sets a top\-level "maintainers" field with your npm user info\. .SS funding .P -You can specify an object containing an URL that provides up\-to\-date +You can specify an object containing a URL that provides up\-to\-date information about ways to help fund development of your package, or a string URL, or an array of these: .P diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7 index 70f6742b10ada1..a64db0ae281ea8 100644 --- a/deps/npm/man/man7/config.7 +++ b/deps/npm/man/man7/config.7 @@ -1592,7 +1592,7 @@ Type: null or String .RE .P The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm -init \fP commands\. +init \fP commands\. .SS \fBsearchexclude\fP .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man7/package-spec.7 b/deps/npm/man/man7/package-spec.7 new file mode 100644 index 00000000000000..f86a00686b0c3f --- /dev/null +++ b/deps/npm/man/man7/package-spec.7 @@ -0,0 +1,145 @@ +.TH "PACKAGE\-SPEC" "7" "June 2022" "" "" +.SH "NAME" +\fBpackage-spec\fR \- Package name specifier +.SS Description +.P +Commands like \fBnpm install\fP and the dependency sections in the +\fBpackage\.json\fP use a package name specifier\. This can be many different +things that all refer to a "package"\. Examples include a package name, +git url, tarball, or local directory\. These will generally be referred +to as \fB\fP in the help output for the npm commands that use +this package name specifier\. +.SS Package name +.RS 0 +.IP \(bu 2 +\fB[<@scope>/]\fP +.IP \(bu 2 +\fB[<@scope>/]@\fP +.IP \(bu 2 +\fB[<@scope>/]@\fP +.IP \(bu 2 +\fB[<@scope>/]@\fP + +.RE +.P +Refers to a package by name, with or without a scope, and optionally +tag, version, or version range\. This is typically used in combination +with the npm help registry config to refer to a +package in a registry\. +.P +Examples: +.RS 0 +.IP \(bu 2 +\fBnpm\fP +.IP \(bu 2 +\fB@npmcli/arborist\fP +.IP \(bu 2 +\fB@npmcli/arborist@latest\fP +.IP \(bu 2 +\fBnpm@6\.13\.1\fP +.IP \(bu 2 +\fBnpm@^4\.0\.0\fP + +.RE +.SS Aliases +.RS 0 +.IP \(bu 2 +\fB@npm:\fP + +.RE +.P +Primarily used by commands like \fBnpm install\fP and in the dependency +sections in the \fBpackage\.json\fP, this refers to a package by an alias\. +The \fB\fP is the name of the package as it is reified in the +\fBnode_modules\fP folder, and the \fB\fP refers to a package name as +found in the configured registry\. +.P +See \fBPackage name\fP above for more info on referring to a package by +name, and npm help registry for configuring which +registry is used when referring to a package by name\. +.P +Examples: +.RS 0 +.IP \(bu 2 +\fBsemver:@npm:@npmcli/semver\-with\-patch\fP +.IP \(bu 2 +\fBsemver:@npm:semver@7\.2\.2\fP +.IP \(bu 2 +\fBsemver:@npm:semver@legacy\fP + +.RE +.SS Folders +.RS 0 +.IP \(bu 2 +\fB\fP + +.RE +.P +This refers to a package on the local filesystem\. Specifically this is +a folder with a \fBpackage\.json\fP file in it\. This \fIshould\fR always be +prefixed with a \fB/\fP or \fB\|\./\fP (or your OS equivalent) to reduce confusion\. +npm currently will parse a string with more than one \fB/\fP in it as a +folder, but this is legacy behavior that may be removed in a future +version\. +.P +Examples: +.RS 0 +.IP \(bu 2 +\fB\|\./my\-package\fP +.IP \(bu 2 +\fB/opt/npm/my\-package\fP + +.RE +.SS Tarballs +.RS 0 +.IP \(bu 2 +\fB\fP +.IP \(bu 2 +\fB\fP + +.RE +.P +Examples: +.RS 0 +.IP \(bu 2 +\fB\|\./my\-package\.tgz\fP +.IP \(bu 2 +\fBhttps://registry\.npmjs\.org/semver/\-/semver\-1\.0\.0\.tgz\fP + +.RE +.P +Refers to a package in a tarball format, either on the local filesystem +or remotely via url\. This is the format that packages exist in when +uploaded to a registry\. +.SS git urls +.RS 0 +.IP \(bu 2 +\fB\fP +.IP \(bu 2 +\fB/\fP + +.RE +.P +Refers to a package in a git repo\. This can be a full git url, git +shorthand, or a username/package on GitHub\. You can specify a +git tag, branch, or other git ref by appending \fB#ref\fP\|\. +.P +Examples: +.RS 0 +.IP \(bu 2 +\fBhttps://github\.com/npm/cli\.git\fP +.IP \(bu 2 +\fBgit@github\.com:npm/cli\.git\fP +.IP \(bu 2 +\fBgit+ssh://git@github\.com/npm/cli#v6\.0\.0\fP +.IP \(bu 2 +\fBgithub:npm/cli#HEAD\fP +.IP \(bu 2 +\fBnpm/cli#c12ea07\fP + +.RE +.SS See also +.P +npm\-package\-arg \fIhttps://npm\.im/npm\-package\-arg\fR +npm help scope +npm help config diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js index e6c9fe68fab97d..da2652c449a1cd 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js @@ -673,7 +673,7 @@ Try using the package name instead, e.g: const breakingMessage = isSemVerMajor ? 'a SemVer major change' : 'outside your stated dependency range' - log.warn('audit', `Updating ${name} to ${version},` + + log.warn('audit', `Updating ${name} to ${version}, ` + `which is ${breakingMessage}.`) await this[_add](node, { add: [`${name}@${version}`] }) diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json index baae74e25ac7b8..bfb9b4273e8834 100644 --- a/deps/npm/node_modules/@npmcli/arborist/package.json +++ b/deps/npm/node_modules/@npmcli/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "5.2.1", + "version": "5.2.3", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", @@ -11,7 +11,7 @@ "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^2.0.0", "@npmcli/package-json": "^2.0.0", - "@npmcli/run-script": "^3.0.0", + "@npmcli/run-script": "^4.1.3", "bin-links": "^3.0.0", "cacache": "^16.0.6", "common-ancestor-path": "^1.0.1", @@ -25,7 +25,7 @@ "npm-pick-manifest": "^7.0.0", "npm-registry-fetch": "^13.0.0", "npmlog": "^6.0.2", - "pacote": "^13.0.5", + "pacote": "^13.6.1", "parse-conflict-json": "^2.0.1", "proc-log": "^2.0.0", "promise-all-reject-late": "^1.0.0", diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/escape.js b/deps/npm/node_modules/@npmcli/run-script/lib/escape.js new file mode 100644 index 00000000000000..5254be24bf7ab8 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/lib/escape.js @@ -0,0 +1,71 @@ +'use strict' + +// eslint-disable-next-line max-len +// this code adapted from: https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/ +const cmd = (input, doubleEscape) => { + if (!input.length) { + return '""' + } + + let result + if (!/[ \t\n\v"]/.test(input)) { + result = input + } else { + result = '"' + for (let i = 0; i <= input.length; ++i) { + let slashCount = 0 + while (input[i] === '\\') { + ++i + ++slashCount + } + + if (i === input.length) { + result += '\\'.repeat(slashCount * 2) + break + } + + if (input[i] === '"') { + result += '\\'.repeat(slashCount * 2 + 1) + result += input[i] + } else { + result += '\\'.repeat(slashCount) + result += input[i] + } + } + result += '"' + } + + // and finally, prefix shell meta chars with a ^ + result = result.replace(/[ !^&()<>|"]/g, '^$&') + if (doubleEscape) { + result = result.replace(/[ !^&()<>|"]/g, '^$&') + } + + // except for % which is escaped with another %, and only once + result = result.replace(/%/g, '%%') + + return result +} + +const sh = (input) => { + if (!input.length) { + return `''` + } + + if (!/[\t\n\r "#$&'()*;<>?\\`|~]/.test(input)) { + return input + } + + // replace single quotes with '\'' and wrap the whole result in a fresh set of quotes + const result = `'${input.replace(/'/g, `'\\''`)}'` + // if the input string already had single quotes around it, clean those up + .replace(/^(?:'')+(?!$)/, '') + .replace(/\\'''/g, `\\'`) + + return result +} + +module.exports = { + cmd, + sh, +} diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js b/deps/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js index 9cfc84b0e0de11..660588e3ee9aa6 100644 --- a/deps/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js +++ b/deps/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js @@ -1,8 +1,12 @@ /* eslint camelcase: "off" */ const isWindows = require('./is-windows.js') const setPATH = require('./set-path.js') -const { resolve } = require('path') +const { chmodSync: chmod, unlinkSync: unlink, writeFileSync: writeFile } = require('fs') +const { tmpdir } = require('os') +const { isAbsolute, resolve } = require('path') +const which = require('which') const npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js') +const escape = require('./escape.js') const makeSpawnArgs = options => { const { @@ -12,29 +16,93 @@ const makeSpawnArgs = options => { env = {}, stdio, cmd, + args = [], stdioString = false, } = options + const spawnEnv = setPATH(path, { + // we need to at least save the PATH environment var + ...process.env, + ...env, + npm_package_json: resolve(path, 'package.json'), + npm_lifecycle_event: event, + npm_lifecycle_script: cmd, + npm_config_node_gyp, + }) + + let scriptFile + let script = '' + const isCmd = /(?:^|\\)cmd(?:\.exe)?$/i.test(scriptShell) - const args = isCmd ? ['/d', '/s', '/c', cmd] : ['-c', cmd] + if (isCmd) { + let initialCmd = '' + let insideQuotes = false + for (let i = 0; i < cmd.length; ++i) { + const char = cmd.charAt(i) + if (char === ' ' && !insideQuotes) { + break + } + + initialCmd += char + if (char === '"' || char === "'") { + insideQuotes = !insideQuotes + } + } + + let pathToInitial + try { + pathToInitial = which.sync(initialCmd, { + path: spawnEnv.path, + pathext: spawnEnv.pathext, + }).toLowerCase() + } catch (err) { + pathToInitial = initialCmd.toLowerCase() + } + + const doubleEscape = pathToInitial.endsWith('.cmd') || pathToInitial.endsWith('.bat') + + scriptFile = resolve(tmpdir(), `${event}-${Date.now()}.cmd`) + script += '@echo off\n' + script += cmd + if (args.length) { + script += ` ${args.map((arg) => escape.cmd(arg, doubleEscape)).join(' ')}` + } + } else { + const shebang = isAbsolute(scriptShell) + ? `#!${scriptShell}` + : `#!/usr/bin/env ${scriptShell}` + scriptFile = resolve(tmpdir(), `${event}-${Date.now()}.sh`) + script += `${shebang}\n` + script += cmd + if (args.length) { + script += ` ${args.map((arg) => escape.sh(arg)).join(' ')}` + } + } + + writeFile(scriptFile, script) + if (!isCmd) { + chmod(scriptFile, '0775') + } + const spawnArgs = isCmd + ? ['/d', '/s', '/c', escape.cmd(scriptFile)] + : ['-c', escape.sh(scriptFile)] const spawnOpts = { - env: setPATH(path, { - // we need to at least save the PATH environment var - ...process.env, - ...env, - npm_package_json: resolve(path, 'package.json'), - npm_lifecycle_event: event, - npm_lifecycle_script: cmd, - npm_config_node_gyp, - }), + env: spawnEnv, stdioString, stdio, cwd: path, ...(isCmd ? { windowsVerbatimArguments: true } : {}), } - return [scriptShell, args, spawnOpts] + const cleanup = () => { + // delete the script, this is just a best effort + try { + unlink(scriptFile) + } catch (err) {} + } + + return [scriptShell, spawnArgs, spawnOpts, cleanup] } module.exports = makeSpawnArgs diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js b/deps/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js index a6fa4d2b389485..84c5e2bfe0c521 100644 --- a/deps/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js +++ b/deps/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js @@ -31,7 +31,7 @@ const runScriptPkg = async options => { if (options.cmd) { cmd = options.cmd } else if (pkg.scripts && pkg.scripts[event]) { - cmd = pkg.scripts[event] + args.map(a => ` ${JSON.stringify(a)}`).join('') + cmd = pkg.scripts[event] } else if ( // If there is no preinstall or install script, default to rebuilding node-gyp packages. event === 'install' && @@ -42,7 +42,7 @@ const runScriptPkg = async options => { ) { cmd = defaultGypInstallScript } else if (event === 'start' && await isServerPackage(path)) { - cmd = 'node server.js' + args.map(a => ` ${JSON.stringify(a)}`).join('') + cmd = 'node server.js' } if (!cmd) { @@ -54,15 +54,18 @@ const runScriptPkg = async options => { console.log(bruce(pkg._id, event, cmd)) } - const p = promiseSpawn(...makeSpawnArgs({ + const [spawnShell, spawnArgs, spawnOpts, cleanup] = makeSpawnArgs({ event, path, scriptShell, env: packageEnvs(env, pkg), stdio, cmd, + args, stdioString, - }), { + }) + + const p = promiseSpawn(spawnShell, spawnArgs, spawnOpts, { event, script: cmd, pkgid: pkg._id, @@ -88,7 +91,7 @@ const runScriptPkg = async options => { } else { throw er } - }) + }).finally(cleanup) } module.exports = runScriptPkg diff --git a/deps/npm/node_modules/@npmcli/run-script/package.json b/deps/npm/node_modules/@npmcli/run-script/package.json index 733b27e44a1b8b..ef8b43f772de1b 100644 --- a/deps/npm/node_modules/@npmcli/run-script/package.json +++ b/deps/npm/node_modules/@npmcli/run-script/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/run-script", - "version": "3.0.2", + "version": "4.1.3", "description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", "author": "GitHub Inc.", "license": "ISC", @@ -23,7 +23,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.5.0", "minipass": "^3.1.6", "require-inject": "^1.4.4", "tap": "^16.0.1" @@ -48,6 +48,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.5.0" } } diff --git a/deps/npm/node_modules/cacache/lib/content/read.js b/deps/npm/node_modules/cacache/lib/content/read.js index f5128fe185d0f4..8367ccb205d0b0 100644 --- a/deps/npm/node_modules/cacache/lib/content/read.js +++ b/deps/npm/node_modules/cacache/lib/content/read.js @@ -13,7 +13,7 @@ async function read (cache, integrity, opts = {}) { const { size } = opts const { stat, cpath, sri } = await withContentSri(cache, integrity, async (cpath, sri) => { // get size - const stat = await fs.lstat(cpath) + const stat = await fs.stat(cpath) return { stat, cpath, sri } }) if (typeof size === 'number' && stat.size !== size) { @@ -73,8 +73,8 @@ function readStream (cache, integrity, opts = {}) { // Set all this up to run on the stream and then just return the stream Promise.resolve().then(async () => { const { stat, cpath, sri } = await withContentSri(cache, integrity, async (cpath, sri) => { - // just lstat to ensure it exists - const stat = await fs.lstat(cpath) + // just stat to ensure it exists + const stat = await fs.stat(cpath) return { stat, cpath, sri } }) if (typeof size === 'number' && size !== stat.size) { @@ -111,7 +111,7 @@ async function hasContent (cache, integrity) { try { return await withContentSri(cache, integrity, async (cpath, sri) => { - const stat = await fs.lstat(cpath) + const stat = await fs.stat(cpath) return { size: stat.size, sri, stat } }) } catch (err) { @@ -139,7 +139,7 @@ function hasContentSync (cache, integrity) { return withContentSriSync(cache, integrity, (cpath, sri) => { try { - const stat = fs.lstatSync(cpath) + const stat = fs.statSync(cpath) return { size: stat.size, sri, stat } } catch (err) { if (err.code === 'ENOENT') { diff --git a/deps/npm/node_modules/cacache/package.json b/deps/npm/node_modules/cacache/package.json index 8e54901b4562a0..bb5674dafca81b 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.1.0", + "version": "16.1.1", "cache-version": { "content": "2", "index": "5" @@ -69,7 +69,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.4.3", + "@npmcli/template-oss": "3.5.0", "tap": "^16.0.0" }, "engines": { @@ -78,7 +78,7 @@ "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "3.4.3" + "version": "3.5.0" }, "author": "GitHub Inc." } diff --git a/deps/npm/node_modules/libnpmdiff/package.json b/deps/npm/node_modules/libnpmdiff/package.json index 3630980ccb30b2..814629dd2e2957 100644 --- a/deps/npm/node_modules/libnpmdiff/package.json +++ b/deps/npm/node_modules/libnpmdiff/package.json @@ -1,6 +1,6 @@ { "name": "libnpmdiff", - "version": "4.0.3", + "version": "4.0.4", "description": "The registry diff", "repository": { "type": "git", @@ -56,7 +56,7 @@ "diff": "^5.0.0", "minimatch": "^5.0.1", "npm-package-arg": "^9.0.1", - "pacote": "^13.0.5", + "pacote": "^13.6.1", "tar": "^6.1.0" }, "templateOSS": { diff --git a/deps/npm/node_modules/libnpmexec/package.json b/deps/npm/node_modules/libnpmexec/package.json index dfe40b0d9f7ad0..d163103ea2b0bf 100644 --- a/deps/npm/node_modules/libnpmexec/package.json +++ b/deps/npm/node_modules/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "4.0.6", + "version": "4.0.8", "files": [ "bin/", "lib/" @@ -57,12 +57,12 @@ "dependencies": { "@npmcli/arborist": "^5.0.0", "@npmcli/ci-detect": "^2.0.0", - "@npmcli/run-script": "^3.0.0", + "@npmcli/run-script": "^4.1.3", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0", "npm-package-arg": "^9.0.1", "npmlog": "^6.0.2", - "pacote": "^13.0.5", + "pacote": "^13.6.1", "proc-log": "^2.0.0", "read": "^1.0.7", "read-package-json-fast": "^2.0.2", diff --git a/deps/npm/node_modules/libnpmpack/package.json b/deps/npm/node_modules/libnpmpack/package.json index 02f06a8bbfa3c1..86bec9ff1d618d 100644 --- a/deps/npm/node_modules/libnpmpack/package.json +++ b/deps/npm/node_modules/libnpmpack/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpack", - "version": "4.1.0", + "version": "4.1.2", "description": "Programmatic API for the bits behind npm pack", "author": "GitHub Inc.", "main": "lib/index.js", @@ -38,9 +38,9 @@ "bugs": "https://github.com/npm/libnpmpack/issues", "homepage": "https://npmjs.com/package/libnpmpack", "dependencies": { - "@npmcli/run-script": "^3.0.0", + "@npmcli/run-script": "^4.1.3", "npm-package-arg": "^9.0.1", - "pacote": "^13.5.0" + "pacote": "^13.6.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" diff --git a/deps/npm/node_modules/libnpmversion/package.json b/deps/npm/node_modules/libnpmversion/package.json index 86f97378128375..c5c1a0398bb169 100644 --- a/deps/npm/node_modules/libnpmversion/package.json +++ b/deps/npm/node_modules/libnpmversion/package.json @@ -1,6 +1,6 @@ { "name": "libnpmversion", - "version": "3.0.4", + "version": "3.0.6", "main": "lib/index.js", "files": [ "bin/", @@ -37,7 +37,7 @@ }, "dependencies": { "@npmcli/git": "^3.0.0", - "@npmcli/run-script": "^3.0.0", + "@npmcli/run-script": "^4.1.3", "json-parse-even-better-errors": "^2.3.1", "proc-log": "^2.0.0", "semver": "^7.3.7" diff --git a/deps/npm/node_modules/make-fetch-happen/lib/agent.js b/deps/npm/node_modules/make-fetch-happen/lib/agent.js index f64644ff611a57..dd68492ed7ea7b 100644 --- a/deps/npm/node_modules/make-fetch-happen/lib/agent.js +++ b/deps/npm/node_modules/make-fetch-happen/lib/agent.js @@ -171,7 +171,7 @@ const getPath = u => u.pathname + u.search + u.hash const HttpProxyAgent = require('http-proxy-agent') const HttpsProxyAgent = require('https-proxy-agent') -const SocksProxyAgent = require('socks-proxy-agent') +const { SocksProxyAgent } = require('socks-proxy-agent') module.exports.getProxy = getProxy function getProxy (proxyUrl, opts, isHttps) { // our current proxy agents do not support an overridden dns lookup method, so will not @@ -198,6 +198,9 @@ function getProxy (proxyUrl, opts, isHttps) { return new HttpsProxyAgent(popts) } } else if (proxyUrl.protocol.startsWith('socks')) { + // socks-proxy-agent uses hostname not host + popts.hostname = popts.host + delete popts.host return new SocksProxyAgent(popts) } else { throw Object.assign( diff --git a/deps/npm/node_modules/make-fetch-happen/package.json b/deps/npm/node_modules/make-fetch-happen/package.json index e3d42bb2110d1f..e04c7645c4f2a1 100644 --- a/deps/npm/node_modules/make-fetch-happen/package.json +++ b/deps/npm/node_modules/make-fetch-happen/package.json @@ -1,6 +1,6 @@ { "name": "make-fetch-happen", - "version": "10.1.6", + "version": "10.1.8", "description": "Opinionated, caching, retrying fetch client", "main": "lib/index.js", "files": [ @@ -50,7 +50,7 @@ "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.1.1", + "socks-proxy-agent": "^7.0.0", "ssri": "^9.0.0" }, "devDependencies": { diff --git a/deps/npm/node_modules/npm-profile/lib/index.js b/deps/npm/node_modules/npm-profile/lib/index.js index 74a8084292a6c5..eb97c621dd18dc 100644 --- a/deps/npm/node_modules/npm-profile/lib/index.js +++ b/deps/npm/node_modules/npm-profile/lib/index.js @@ -2,6 +2,7 @@ const fetch = require('npm-registry-fetch') const { HttpErrorBase } = require('npm-registry-fetch/lib/errors') +const EventEmitter = require('events') const os = require('os') const { URL } = require('url') const log = require('proc-log') @@ -59,6 +60,9 @@ const webAuth = (opener, opts, body) => { ...opts, method: 'POST', body, + headers: { + 'npm-use-webauthn': opts.authType === 'webauthn', + }, }).then(res => { return Promise.all([res, res.json()]) }).then(([res, content]) => { @@ -70,8 +74,23 @@ const webAuth = (opener, opts, body) => { return content }).then(({ doneUrl, loginUrl }) => { log.verbose('web auth', 'opening url pair') - return opener(loginUrl).then( - () => webAuthCheckLogin(doneUrl, { ...opts, cache: false }) + + const doneEmitter = new EventEmitter() + + const openPromise = opener(loginUrl, doneEmitter) + const webAuthCheckPromise = webAuthCheckLogin(doneUrl, { ...opts, cache: false }) + .then(authResult => { + log.verbose('web auth', 'done-check finished') + + // cancel open prompt if it's present + doneEmitter.emit('abort') + + return authResult + }) + + return Promise.all([openPromise, webAuthCheckPromise]).then( + // pick the auth result and pass it along + ([, authResult]) => authResult ) }).catch(er => { if ((er.statusCode >= 400 && er.statusCode <= 499) || er.statusCode === 500) { diff --git a/deps/npm/node_modules/npm-profile/package.json b/deps/npm/node_modules/npm-profile/package.json index 5e8f2d2391abd6..4f9da95d73fe81 100644 --- a/deps/npm/node_modules/npm-profile/package.json +++ b/deps/npm/node_modules/npm-profile/package.json @@ -1,6 +1,6 @@ { "name": "npm-profile", - "version": "6.0.3", + "version": "6.1.0", "description": "Library for updating an npmjs.com profile", "keywords": [], "author": "GitHub Inc.", @@ -20,7 +20,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.4.1", + "@npmcli/template-oss": "3.4.2", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -44,6 +44,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.4.1" + "version": "3.4.2" } } diff --git a/deps/npm/node_modules/pacote/package.json b/deps/npm/node_modules/pacote/package.json index af100fa8d6bfa2..696c925d353208 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.6.0", + "version": "13.6.1", "description": "JavaScript package downloader", "author": "GitHub Inc.", "bin": { @@ -45,7 +45,7 @@ "@npmcli/git": "^3.0.0", "@npmcli/installed-package-contents": "^1.0.7", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/run-script": "^3.0.1", + "@npmcli/run-script": "^4.1.0", "cacache": "^16.0.0", "chownr": "^2.0.0", "fs-minipass": "^2.1.0", diff --git a/deps/npm/node_modules/socks-proxy-agent/package.json b/deps/npm/node_modules/socks-proxy-agent/package.json index 268b8a5b187441..aa2999969c1743 100644 --- a/deps/npm/node_modules/socks-proxy-agent/package.json +++ b/deps/npm/node_modules/socks-proxy-agent/package.json @@ -2,7 +2,7 @@ "name": "socks-proxy-agent", "description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS", "homepage": "https://github.com/TooTallNate/node-socks-proxy-agent#readme", - "version": "6.2.0", + "version": "7.0.0", "main": "dist/index.js", "author": { "email": "nathan@tootallnate.net", @@ -38,6 +38,10 @@ "name": "Matheus Fernandes", "email": "matheus.frndes@gmail.com" }, + { + "name": "Ricky Miller", + "email": "richardkazuomiller@gmail.com" + }, { "name": "Shantanu Sharma", "email": "shantanu34@outlook.com" @@ -111,12 +115,12 @@ "@commitlint/config-conventional": "latest", "@types/debug": "latest", "@types/node": "latest", - "cacheable-lookup": "^6.0.4", + "cacheable-lookup": "latest", "conventional-github-releaser": "latest", - "dns2": "^2.0.1", + "dns2": "latest", "finepack": "latest", "git-authors-cli": "latest", - "mocha": "latest", + "mocha": "9", "nano-staged": "latest", "npm-check-updates": "latest", "prettier-standard": "latest", @@ -136,6 +140,22 @@ "files": [ "dist" ], + "scripts": { + "build": "tsc", + "clean": "rimraf node_modules", + "contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true", + "lint": "ts-standard", + "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)", + "prebuild": "rimraf dist", + "prepublishOnly": "npm run build", + "prerelease": "npm run update:check && npm run contributors", + "release": "standard-version -a", + "release:github": "conventional-github-releaser -p angular", + "release:tags": "git push --follow-tags origin HEAD:master", + "test": "mocha --reporter spec", + "update": "ncu -u", + "update:check": "ncu -- --error-level 2" + }, "license": "MIT", "commitlint": { "extends": [ @@ -157,21 +177,5 @@ "commit-msg": "npx commitlint --edit", "pre-commit": "npx nano-staged" }, - "typings": "dist/index.d.ts", - "scripts": { - "build": "tsc", - "clean": "rimraf node_modules", - "contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true", - "lint": "ts-standard", - "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)", - "prebuild": "rimraf dist", - "prerelease": "npm run update:check && npm run contributors", - "release": "standard-version -a", - "release:github": "conventional-github-releaser -p angular", - "release:tags": "git push --follow-tags origin HEAD:master", - "test": "mocha --reporter spec", - "update": "ncu -u", - "update:check": "ncu -- --error-level 2" - }, - "readme": "socks-proxy-agent\n================\n### A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS\n[![Build Status](https://github.com/TooTallNate/node-socks-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-socks-proxy-agent/actions?workflow=Node+CI)\n\nThis module provides an `http.Agent` implementation that connects to a\nspecified SOCKS proxy server, and can be used with the built-in `http`\nand `https` modules.\n\nIt can also be used in conjunction with the `ws` module to establish a WebSocket\nconnection over a SOCKS proxy. See the \"Examples\" section below.\n\nInstallation\n------------\n\nInstall with `npm`:\n\n``` bash\nnpm install socks-proxy-agent\n```\n\n\nExamples\n--------\n\n#### TypeScript example\n\n```ts\nimport https from 'https';\nimport { SocksProxyAgent } from 'socks-proxy-agent';\n\nconst info = {\n\thostname: 'br41.nordvpn.com',\n\tuserId: 'your-name@gmail.com',\n\tpassword: 'abcdef12345124'\n};\nconst agent = new SocksProxyAgent(info);\n\nhttps.get('https://ipinfo.io', { agent }, (res) => {\n\tconsole.log(res.headers);\n\tres.pipe(process.stdout);\n});\n```\n\n#### `http` module example\n\n```js\nvar url = require('url');\nvar http = require('http');\nvar { SocksProxyAgent } = require('socks-proxy-agent');\n\n// SOCKS proxy to connect to\nvar proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080';\nconsole.log('using proxy server %j', proxy);\n\n// HTTP endpoint for the proxy to connect to\nvar endpoint = process.argv[2] || 'http://nodejs.org/api/';\nconsole.log('attempting to GET %j', endpoint);\nvar opts = url.parse(endpoint);\n\n// create an instance of the `SocksProxyAgent` class with the proxy server information\nvar agent = new SocksProxyAgent(proxy);\nopts.agent = agent;\n\nhttp.get(opts, function (res) {\n\tconsole.log('\"response\" event!', res.headers);\n\tres.pipe(process.stdout);\n});\n```\n\n#### `https` module example\n\n```js\nvar url = require('url');\nvar https = require('https');\nvar { SocksProxyAgent } = require('socks-proxy-agent');\n\n// SOCKS proxy to connect to\nvar proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080';\nconsole.log('using proxy server %j', proxy);\n\n// HTTP endpoint for the proxy to connect to\nvar endpoint = process.argv[2] || 'https://encrypted.google.com/';\nconsole.log('attempting to GET %j', endpoint);\nvar opts = url.parse(endpoint);\n\n// create an instance of the `SocksProxyAgent` class with the proxy server information\nvar agent = new SocksProxyAgent(proxy);\nopts.agent = agent;\n\nhttps.get(opts, function (res) {\n\tconsole.log('\"response\" event!', res.headers);\n\tres.pipe(process.stdout);\n});\n```\n\n#### `ws` WebSocket connection example\n\n``` js\nvar WebSocket = require('ws');\nvar { SocksProxyAgent } = require('socks-proxy-agent');\n\n// SOCKS proxy to connect to\nvar proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080';\nconsole.log('using proxy server %j', proxy);\n\n// WebSocket endpoint for the proxy to connect to\nvar endpoint = process.argv[2] || 'ws://echo.websocket.org';\nconsole.log('attempting to connect to WebSocket %j', endpoint);\n\n// create an instance of the `SocksProxyAgent` class with the proxy server information\nvar agent = new SocksProxyAgent(proxy);\n\n// initiate the WebSocket connection\nvar socket = new WebSocket(endpoint, { agent: agent });\n\nsocket.on('open', function () {\n\tconsole.log('\"open\" event!');\n\tsocket.send('hello world');\n});\n\nsocket.on('message', function (data, flags) {\n\tconsole.log('\"message\" event! %j %j', data, flags);\n\tsocket.close();\n});\n```\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n" -} \ No newline at end of file + "typings": "dist/index.d.ts" +} diff --git a/deps/npm/package.json b/deps/npm/package.json index fbfabe9365cd03..a9d84ab62ce15a 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "8.12.1", + "version": "8.13.1", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ @@ -62,10 +62,10 @@ "@npmcli/fs": "^2.1.0", "@npmcli/map-workspaces": "^2.0.3", "@npmcli/package-json": "^2.0.0", - "@npmcli/run-script": "^3.0.1", + "@npmcli/run-script": "^4.1.3", "abbrev": "~1.1.1", "archy": "~1.0.0", - "cacache": "^16.1.0", + "cacache": "^16.1.1", "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^4.0.0", @@ -90,7 +90,7 @@ "libnpmsearch": "^5.0.2", "libnpmteam": "^4.0.2", "libnpmversion": "^3.0.1", - "make-fetch-happen": "^10.1.6", + "make-fetch-happen": "^10.1.8", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -102,12 +102,12 @@ "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.0.2", "npm-pick-manifest": "^7.0.1", - "npm-profile": "^6.0.3", + "npm-profile": "^6.1.0", "npm-registry-fetch": "^13.1.1", "npm-user-validate": "^1.0.1", "npmlog": "^6.0.2", "opener": "^1.5.2", - "pacote": "^13.6.0", + "pacote": "^13.6.1", "parse-conflict-json": "^2.0.2", "proc-log": "^2.0.1", "qrcode-terminal": "^0.12.0", 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 802fa8de935166..13a3b06fe33d65 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 @@ -98,11 +98,7 @@ exports[`test/lib/load-all-commands.js TAP load each command cache > must match Manipulates packages cache Usage: -npm cache add -npm cache add -npm cache add -npm cache add -npm cache add @ +npm cache add npm cache clean [] npm cache ls [@] npm cache verify @@ -178,7 +174,7 @@ exports[`test/lib/load-all-commands.js TAP load each command deprecate > must ma Deprecate a version of a package Usage: -npm deprecate [@] +npm deprecate Options: [--registry ] [--otp ] @@ -193,10 +189,10 @@ Usage: npm diff [...] Options: -[--diff [--diff ...]] -[--diff-name-only] [--diff-unified ] [--diff-ignore-all-space] -[--diff-no-prefix] [--diff-src-prefix ] [--diff-dst-prefix ] -[--diff-text] [-g|--global] [--tag ] +[--diff [--diff ...]] [--diff-name-only] +[--diff-unified ] [--diff-ignore-all-space] [--diff-no-prefix] +[--diff-src-prefix ] [--diff-dst-prefix ] [--diff-text] [-g|--global] +[--tag ] [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] [--include-workspace-root] @@ -207,9 +203,9 @@ exports[`test/lib/load-all-commands.js TAP load each command dist-tag > must mat Modify package distribution tags Usage: -npm dist-tag add @ [] -npm dist-tag rm -npm dist-tag ls [] +npm dist-tag add [] +npm dist-tag rm +npm dist-tag ls [] Options: [-w|--workspace [-w|--workspace ...]] @@ -270,8 +266,7 @@ npm exec -c ' [args...]' npm exec --package=foo -c ' [args...]' Options: -[--package [@] [--package [@] ...]] -[-c|--call ] +[--package [--package ...]] [-c|--call ] [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] [--include-workspace-root] @@ -284,7 +279,7 @@ exports[`test/lib/load-all-commands.js TAP load each command explain > must matc Explain installed packages Usage: -npm explain +npm explain Options: [--json] [-w|--workspace [-w|--workspace ...]] @@ -326,7 +321,7 @@ exports[`test/lib/load-all-commands.js TAP load each command fund > must match s Retrieve funding information Usage: -npm fund [[<@scope>/]] +npm fund [] Options: [--json] [--no-browser|--browser ] [--unicode] @@ -390,12 +385,11 @@ exports[`test/lib/load-all-commands.js TAP load each command init > must match s Create a package.json file Usage: -npm init [--force|-f|--yes|-y|--scope] +npm init (same as \`npx ) npm init <@scope> (same as \`npx <@scope>/create\`) -npm init [<@scope>/] (same as \`npx [<@scope>/]create-\`) Options: -[-y|--yes] [-f|--force] +[-y|--yes] [-f|--force] [--scope <@scope>] [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] [--no-workspaces-update] [--include-workspace-root] @@ -408,16 +402,7 @@ exports[`test/lib/load-all-commands.js TAP load each command install > must matc Install a package Usage: -npm install [<@scope>/] -npm install [<@scope>/]@ -npm install [<@scope>/]@ -npm install [<@scope>/]@ -npm install @npm: -npm install -npm install -npm install -npm install -npm install / +npm install [ ...] Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] @@ -452,16 +437,7 @@ exports[`test/lib/load-all-commands.js TAP load each command install-test > must Install package(s) and run tests Usage: -npm install-test [<@scope>/] -npm install-test [<@scope>/]@ -npm install-test [<@scope>/]@ -npm install-test [<@scope>/]@ -npm install-test @npm: -npm install-test -npm install-test -npm install-test -npm install-test -npm install-test / +npm install-test [ ...] Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] @@ -481,8 +457,7 @@ exports[`test/lib/load-all-commands.js TAP load each command link > must match s Symlink a package folder Usage: -npm link (in package dir) -npm link [<@scope>/][@] +npm link [] Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] @@ -547,7 +522,7 @@ exports[`test/lib/load-all-commands.js TAP load each command ls > must match sna List installed packages Usage: -npm ls [[<@scope>/] ...] +npm ls Options: [-a|--all] [--json] [-l|--long] [-p|--parseable] [-g|--global] [--depth ] @@ -581,7 +556,7 @@ exports[`test/lib/load-all-commands.js TAP load each command outdated > must mat Check for outdated packages Usage: -npm outdated [[<@scope>/] ...] +npm outdated [ ...] Options: [-a|--all] [--json] [-l|--long] [-p|--parseable] [-g|--global] @@ -594,9 +569,9 @@ exports[`test/lib/load-all-commands.js TAP load each command owner > must match Manage package owners Usage: -npm owner add [<@scope>/] -npm owner rm [<@scope>/] -npm owner ls [<@scope>/] +npm owner add +npm owner rm +npm owner ls Options: [--registry ] [--otp ] @@ -612,7 +587,7 @@ exports[`test/lib/load-all-commands.js TAP load each command pack > must match s Create a tarball from a package Usage: -npm pack [[<@scope>/]...] +npm pack Options: [--dry-run] [--json] [--pack-destination ] @@ -698,7 +673,7 @@ exports[`test/lib/load-all-commands.js TAP load each command publish > must matc Publish a package Usage: -npm publish [] +npm publish Options: [--tag ] [--access ] [--dry-run] [--otp ] @@ -712,7 +687,7 @@ exports[`test/lib/load-all-commands.js TAP load each command rebuild > must matc Rebuild a package Usage: -npm rebuild [[<@scope>/][@] ...] +npm rebuild [] ...] Options: [-g|--global] [--no-bin-links] [--foreground-scripts] [--ignore-scripts] @@ -829,7 +804,7 @@ exports[`test/lib/load-all-commands.js TAP load each command star > must match s Mark your favorite packages Usage: -npm star [...] +npm star [...] Options: [--registry ] [--unicode] [--otp ] @@ -938,7 +913,7 @@ exports[`test/lib/load-all-commands.js TAP load each command unpublish > must ma Remove a package from the registry Usage: -npm unpublish [<@scope>/][@] +npm unpublish [] Options: [--dry-run] [-f|--force] @@ -952,7 +927,7 @@ exports[`test/lib/load-all-commands.js TAP load each command unstar > must match Remove an item from your favorite packages Usage: -npm unstar [...] +npm unstar [...] Options: [--registry ] [--unicode] [--otp ] @@ -1001,7 +976,7 @@ exports[`test/lib/load-all-commands.js TAP load each command view > must match s View registry info Usage: -npm view [<@scope>/][@] [[.subfield]...] +npm view [] [[.subfield]...] Options: [--json] [-w|--workspace [-w|--workspace ...]] diff --git a/deps/npm/tap-snapshots/test/lib/npm.js.test.cjs b/deps/npm/tap-snapshots/test/lib/npm.js.test.cjs index d08935a14d1772..c59252f9e81a9e 100644 --- a/deps/npm/tap-snapshots/test/lib/npm.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/npm.js.test.cjs @@ -238,11 +238,7 @@ All commands: cache Manipulates packages cache Usage: - npm cache add - npm cache add - npm cache add - npm cache add - npm cache add @ + npm cache add npm cache clean [] npm cache ls [@] npm cache verify @@ -308,7 +304,7 @@ All commands: deprecate Deprecate a version of a package Usage: - npm deprecate [@] + npm deprecate Options: [--registry ] [--otp ] @@ -321,10 +317,10 @@ All commands: npm diff [...] Options: - [--diff [--diff ...]] - [--diff-name-only] [--diff-unified ] [--diff-ignore-all-space] - [--diff-no-prefix] [--diff-src-prefix ] [--diff-dst-prefix ] - [--diff-text] [-g|--global] [--tag ] + [--diff [--diff ...]] [--diff-name-only] + [--diff-unified ] [--diff-ignore-all-space] [--diff-no-prefix] + [--diff-src-prefix ] [--diff-dst-prefix ] [--diff-text] [-g|--global] + [--tag ] [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] [--include-workspace-root] @@ -333,9 +329,9 @@ All commands: dist-tag Modify package distribution tags Usage: - npm dist-tag add @ [] - npm dist-tag rm - npm dist-tag ls [] + npm dist-tag add [] + npm dist-tag rm + npm dist-tag ls [] Options: [-w|--workspace [-w|--workspace ...]] @@ -388,8 +384,7 @@ All commands: npm exec --package=foo -c ' [args...]' Options: - [--package [@] [--package [@] ...]] - [-c|--call ] + [--package [--package ...]] [-c|--call ] [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] [--include-workspace-root] @@ -400,7 +395,7 @@ All commands: explain Explain installed packages Usage: - npm explain + npm explain Options: [--json] [-w|--workspace [-w|--workspace ...]] @@ -436,7 +431,7 @@ All commands: fund Retrieve funding information Usage: - npm fund [[<@scope>/]] + npm fund [] Options: [--json] [--no-browser|--browser ] [--unicode] @@ -480,12 +475,11 @@ All commands: init Create a package.json file Usage: - npm init [--force|-f|--yes|-y|--scope] + npm init (same as \`npx ) npm init <@scope> (same as \`npx <@scope>/create\`) - npm init [<@scope>/] (same as \`npx [<@scope>/]create-\`) Options: - [-y|--yes] [-f|--force] + [-y|--yes] [-f|--force] [--scope <@scope>] [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] [--no-workspaces-update] [--include-workspace-root] @@ -496,16 +490,7 @@ All commands: install Install a package Usage: - npm install [<@scope>/] - npm install [<@scope>/]@ - npm install [<@scope>/]@ - npm install [<@scope>/]@ - npm install @npm: - npm install - npm install - npm install - npm install - npm install / + npm install [ ...] Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] @@ -536,16 +521,7 @@ All commands: install-test Install package(s) and run tests Usage: - npm install-test [<@scope>/] - npm install-test [<@scope>/]@ - npm install-test [<@scope>/]@ - npm install-test [<@scope>/]@ - npm install-test @npm: - npm install-test - npm install-test - npm install-test - npm install-test - npm install-test / + npm install-test [ ...] Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] @@ -563,8 +539,7 @@ All commands: link Symlink a package folder Usage: - npm link (in package dir) - npm link [<@scope>/][@] + npm link [] Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] @@ -621,7 +596,7 @@ All commands: ls List installed packages Usage: - npm ls [[<@scope>/] ...] + npm ls Options: [-a|--all] [--json] [-l|--long] [-p|--parseable] [-g|--global] [--depth ] @@ -651,7 +626,7 @@ All commands: outdated Check for outdated packages Usage: - npm outdated [[<@scope>/] ...] + npm outdated [ ...] Options: [-a|--all] [--json] [-l|--long] [-p|--parseable] [-g|--global] @@ -662,9 +637,9 @@ All commands: owner Manage package owners Usage: - npm owner add [<@scope>/] - npm owner rm [<@scope>/] - npm owner ls [<@scope>/] + npm owner add + npm owner rm + npm owner ls Options: [--registry ] [--otp ] @@ -678,7 +653,7 @@ All commands: pack Create a tarball from a package Usage: - npm pack [[<@scope>/]...] + npm pack Options: [--dry-run] [--json] [--pack-destination ] @@ -752,7 +727,7 @@ All commands: publish Publish a package Usage: - npm publish [] + npm publish Options: [--tag ] [--access ] [--dry-run] [--otp ] @@ -764,7 +739,7 @@ All commands: rebuild Rebuild a package Usage: - npm rebuild [[<@scope>/][@] ...] + npm rebuild [] ...] Options: [-g|--global] [--no-bin-links] [--foreground-scripts] [--ignore-scripts] @@ -863,7 +838,7 @@ All commands: star Mark your favorite packages Usage: - npm star [...] + npm star [...] Options: [--registry ] [--unicode] [--otp ] @@ -956,7 +931,7 @@ All commands: unpublish Remove a package from the registry Usage: - npm unpublish [<@scope>/][@] + npm unpublish [] Options: [--dry-run] [-f|--force] @@ -968,7 +943,7 @@ All commands: unstar Remove an item from your favorite packages Usage: - npm unstar [...] + npm unstar [...] Options: [--registry ] [--unicode] [--otp ] @@ -1011,7 +986,7 @@ All commands: view View registry info Usage: - npm view [<@scope>/][@] [[.subfield]...] + npm view [] [[.subfield]...] Options: [--json] [-w|--workspace [-w|--workspace ...]] 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 33d6e4fb7a00f7..19909d8c5b35d6 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 @@ -1591,7 +1591,7 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for scrip * Type: null or String The shell to use for scripts run with the \`npm exec\`, \`npm run\` and \`npm -init \` commands. +init \` commands. ` exports[`test/lib/utils/config/definitions.js TAP > config description for searchexclude 1`] = ` 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 77f2c876841ede..9d95aa9528bd89 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 @@ -1391,7 +1391,7 @@ npm init --scope=@foo --yes * Type: null or String The shell to use for scripts run with the \`npm exec\`, \`npm run\` and \`npm -init \` commands. +init \` commands. diff --git a/deps/npm/tap-snapshots/test/lib/utils/open-url-prompt.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/open-url-prompt.js.test.cjs new file mode 100644 index 00000000000000..8af3c475c7720c --- /dev/null +++ b/deps/npm/tap-snapshots/test/lib/utils/open-url-prompt.js.test.cjs @@ -0,0 +1,25 @@ +/* IMPORTANT + * This snapshot file is auto-generated, but designed for humans. + * It should be checked into source control and tracked carefully. + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. + * Make sure to inspect the output below. Do not ignore changes! + */ +'use strict' +exports[`test/lib/utils/open-url-prompt.js TAP opens a url > must match snapshot 1`] = ` +Array [ + Array [ + String( + npm home: + https://www.npmjs.com + ), + ], +] +` + +exports[`test/lib/utils/open-url-prompt.js TAP prints json output > must match snapshot 1`] = ` +Array [ + Array [ + "{\\"title\\":\\"npm home\\",\\"url\\":\\"https://www.npmjs.com\\"}", + ], +] +` diff --git a/deps/npm/test/lib/auth/legacy.js b/deps/npm/test/lib/auth/legacy.js index 0c23f8ba6b3356..39d977d436b5e2 100644 --- a/deps/npm/test/lib/auth/legacy.js +++ b/deps/npm/test/lib/auth/legacy.js @@ -12,7 +12,7 @@ const legacy = t.mock('../../../lib/auth/legacy.js', { }, }, 'npm-profile': profile, - '../../../lib/utils/open-url.js': (npm, url, msg) => { + '../../../lib/utils/open-url-prompt.js': (_npm, url) => { if (!url) { throw Object.assign(new Error('failed open url'), { code: 'ERROR' }) } diff --git a/deps/npm/test/lib/commands/edit.js b/deps/npm/test/lib/commands/edit.js index 1943e8c5fb4ae1..b2a10be135ad90 100644 --- a/deps/npm/test/lib/commands/edit.js +++ b/deps/npm/test/lib/commands/edit.js @@ -1,4 +1,5 @@ const t = require('tap') +const fs = require('fs') const path = require('path') const tspawk = require('../../fixtures/tspawk') const { load: loadMockNpm } = require('../../fixtures/mock-npm') @@ -41,11 +42,19 @@ t.test('npm edit', async t => { const [scriptShell] = makeSpawnArgs({ event: 'install', path: npm.prefix, + cmd: 'testinstall', }) spawk.spawn('testeditor', [semverPath]) spawk.spawn( scriptShell, - args => args.includes('testinstall'), + args => { + const lastArg = args[args.length - 1] + const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') + const rightFilename = path.basename(lastArg).startsWith('install') + const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) + .trim().endsWith('testinstall') + return rightExtension && rightFilename && rightContents + }, { cwd: semverPath } ) await npm.exec('edit', ['semver']) @@ -58,11 +67,19 @@ t.test('rebuild failure', async t => { const [scriptShell] = makeSpawnArgs({ event: 'install', path: npm.prefix, + cmd: 'testinstall', }) spawk.spawn('testeditor', [semverPath]) spawk.spawn( scriptShell, - args => args.includes('testinstall'), + args => { + const lastArg = args[args.length - 1] + const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') + const rightFilename = path.basename(lastArg).startsWith('install') + const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) + .trim().endsWith('testinstall') + return rightExtension && rightFilename && rightContents + }, { cwd: semverPath } ).exit(1).stdout('test error') await t.rejects( @@ -94,11 +111,19 @@ t.test('npm edit editor has flags', async t => { const [scriptShell] = makeSpawnArgs({ event: 'install', path: npm.prefix, + cmd: 'testinstall', }) spawk.spawn('testeditor', ['--flag', semverPath]) spawk.spawn( scriptShell, - args => args.includes('testinstall'), + args => { + const lastArg = args[args.length - 1] + const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') + const rightFilename = path.basename(lastArg).startsWith('install') + const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) + .trim().endsWith('testinstall') + return rightExtension && rightFilename && rightContents + }, { cwd: semverPath } ) await npm.exec('edit', ['semver']) diff --git a/deps/npm/test/lib/commands/restart.js b/deps/npm/test/lib/commands/restart.js index 84bd93d8c99ca9..bfbe715e8c688d 100644 --- a/deps/npm/test/lib/commands/restart.js +++ b/deps/npm/test/lib/commands/restart.js @@ -1,3 +1,5 @@ +const fs = require('fs') +const path = require('path') const t = require('tap') const tspawk = require('../../fixtures/tspawk') const { load: loadMockNpm } = require('../../fixtures/mock-npm') @@ -24,10 +26,14 @@ t.test('should run restart script from package.json', async t => { loglevel: 'silent', }, }) - const [scriptShell] = makeSpawnArgs({ path: npm.prefix }) + const [scriptShell] = makeSpawnArgs({ path: npm.prefix, cmd: 'node ./test-restart.js' }) const script = spawk.spawn(scriptShell, (args) => { - t.ok(args.includes('node ./test-restart.js "foo"'), 'ran restart script with extra args') - return true + const lastArg = args[args.length - 1] + const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') + const rightFilename = path.basename(lastArg).startsWith('restart') + const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) + .trim().endsWith('foo') + return rightExtension && rightFilename && rightContents }) await npm.exec('restart', ['foo']) t.ok(script.called, 'script ran') diff --git a/deps/npm/test/lib/commands/start.js b/deps/npm/test/lib/commands/start.js index 8fc73493d20a9a..79c2133bc69fc4 100644 --- a/deps/npm/test/lib/commands/start.js +++ b/deps/npm/test/lib/commands/start.js @@ -1,3 +1,5 @@ +const fs = require('fs') +const path = require('path') const t = require('tap') const tspawk = require('../../fixtures/tspawk') const { load: loadMockNpm } = require('../../fixtures/mock-npm') @@ -10,7 +12,6 @@ const spawk = tspawk(t) const makeSpawnArgs = require('@npmcli/run-script/lib/make-spawn-args.js') t.test('should run start script from package.json', async t => { - t.plan(2) const { npm } = await loadMockNpm(t, { prefixDir: { 'package.json': JSON.stringify({ @@ -25,10 +26,14 @@ t.test('should run start script from package.json', async t => { loglevel: 'silent', }, }) - const [scriptShell] = makeSpawnArgs({ path: npm.prefix }) + const [scriptShell] = makeSpawnArgs({ path: npm.prefix, cmd: 'node ./test-start.js' }) const script = spawk.spawn(scriptShell, (args) => { - t.ok(args.includes('node ./test-start.js "foo"'), 'ran start script with extra args') - return true + const lastArg = args[args.length - 1] + const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') + const rightFilename = path.basename(lastArg).startsWith('start') + const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) + .trim().endsWith('foo') + return rightExtension && rightFilename && rightContents }) await npm.exec('start', ['foo']) t.ok(script.called, 'script ran') diff --git a/deps/npm/test/lib/commands/stop.js b/deps/npm/test/lib/commands/stop.js index f2aef21899f6ce..1a4abd0b3abda7 100644 --- a/deps/npm/test/lib/commands/stop.js +++ b/deps/npm/test/lib/commands/stop.js @@ -1,3 +1,5 @@ +const fs = require('fs') +const path = require('path') const t = require('tap') const tspawk = require('../../fixtures/tspawk') const { load: loadMockNpm } = require('../../fixtures/mock-npm') @@ -24,10 +26,14 @@ t.test('should run stop script from package.json', async t => { loglevel: 'silent', }, }) - const [scriptShell] = makeSpawnArgs({ path: npm.prefix }) + const [scriptShell] = makeSpawnArgs({ path: npm.prefix, cmd: 'node ./test-stop.js' }) const script = spawk.spawn(scriptShell, (args) => { - t.ok(args.includes('node ./test-stop.js "foo"'), 'ran stop script with extra args') - return true + const lastArg = args[args.length - 1] + const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') + const rightFilename = path.basename(lastArg).startsWith('stop') + const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) + .trim().endsWith('foo') + return rightExtension && rightFilename && rightContents }) await npm.exec('stop', ['foo']) t.ok(script.called, 'script ran') diff --git a/deps/npm/test/lib/commands/test.js b/deps/npm/test/lib/commands/test.js index e9ea0a3c834aa1..c6d3f530bb69e3 100644 --- a/deps/npm/test/lib/commands/test.js +++ b/deps/npm/test/lib/commands/test.js @@ -1,3 +1,5 @@ +const fs = require('fs') +const path = require('path') const t = require('tap') const tspawk = require('../../fixtures/tspawk') const { load: loadMockNpm } = require('../../fixtures/mock-npm') @@ -24,10 +26,14 @@ t.test('should run test script from package.json', async t => { loglevel: 'silent', }, }) - const [scriptShell] = makeSpawnArgs({ path: npm.prefix }) + const [scriptShell] = makeSpawnArgs({ path: npm.prefix, cmd: 'node ./test-test.js' }) const script = spawk.spawn(scriptShell, (args) => { - t.ok(args.includes('node ./test-test.js "foo"'), 'ran test script with extra args') - return true + const lastArg = args[args.length - 1] + const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') + const rightFilename = path.basename(lastArg).startsWith('test') + const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) + .trim().endsWith('foo') + return rightExtension && rightFilename && rightContents }) await npm.exec('test', ['foo']) t.ok(script.called, 'script ran') diff --git a/deps/npm/test/lib/commands/view.js b/deps/npm/test/lib/commands/view.js index da823db5d75072..d347bc9230ec8a 100644 --- a/deps/npm/test/lib/commands/view.js +++ b/deps/npm/test/lib/commands/view.js @@ -33,6 +33,7 @@ const packument = (nv, opts) => { }, }, blue: { + _id: 'blue', name: 'blue', 'dist-tags': { latest: '1.0.0', @@ -464,6 +465,14 @@ t.test('throws when unpublished', async t => { ) }) +t.test('throws when version not matched', async t => { + const { npm } = await loadMockNpm(t) + await t.rejects( + npm.exec('view', ['blue@2.0.0']), + { code: 'E404', pkgid: 'blue@2.0.0', message: 'No match found for version 2.0.0' } + ) +}) + t.test('workspaces', async t => { const prefixDir = { 'package.json': JSON.stringify({ diff --git a/deps/npm/test/lib/utils/open-url-prompt.js b/deps/npm/test/lib/utils/open-url-prompt.js new file mode 100644 index 00000000000000..6908e36b7c81e3 --- /dev/null +++ b/deps/npm/test/lib/utils/open-url-prompt.js @@ -0,0 +1,150 @@ +const t = require('tap') +const mockGlobals = require('../../fixtures/mock-globals.js') +const EventEmitter = require('events') + +const OUTPUT = [] +const output = (...args) => OUTPUT.push(args) +const npm = { + _config: { + json: false, + browser: true, + }, + config: { + get: k => npm._config[k], + set: (k, v) => { + npm._config[k] = v + }, + }, + output, +} + +let openerUrl = null +let openerOpts = null +let openerResult = null +const opener = (url, opts, cb) => { + openerUrl = url + openerOpts = opts + return cb(openerResult) +} + +let questionShouldResolve = true +const readline = { + createInterface: () => ({ + question: (_q, cb) => { + if (questionShouldResolve === true) { + cb() + } + }, + close: () => {}, + }), +} + +const openUrlPrompt = t.mock('../../../lib/utils/open-url-prompt.js', { + opener, + readline, +}) + +mockGlobals(t, { + 'process.stdin.isTTY': true, + 'process.stdout.isTTY': true, +}) + +t.test('does not open a url in non-interactive environments', async t => { + t.teardown(() => { + openerUrl = null + openerOpts = null + OUTPUT.length = 0 + }) + + mockGlobals(t, { + 'process.stdin.isTTY': false, + 'process.stdout.isTTY': false, + }) + + await openUrlPrompt(npm, 'https://www.npmjs.com', 'npm home', 'prompt') + t.equal(openerUrl, null, 'did not open') + t.same(openerOpts, null, 'did not open') +}) + +t.test('opens a url', async t => { + t.teardown(() => { + openerUrl = null + openerOpts = null + OUTPUT.length = 0 + npm._config.browser = true + }) + + npm._config.browser = 'browser' + await openUrlPrompt(npm, 'https://www.npmjs.com', 'npm home', 'prompt') + t.equal(openerUrl, 'https://www.npmjs.com', 'opened the given url') + t.same(openerOpts, { command: 'browser' }, 'passed command as null (the default)') + t.matchSnapshot(OUTPUT) +}) + +t.test('prints json output', async t => { + t.teardown(() => { + openerUrl = null + openerOpts = null + OUTPUT.length = 0 + npm._config.json = false + }) + + npm._config.json = true + await openUrlPrompt(npm, 'https://www.npmjs.com', 'npm home', 'prompt') + t.matchSnapshot(OUTPUT) +}) + +t.test('returns error for non-https url', async t => { + t.teardown(() => { + openerUrl = null + openerOpts = null + OUTPUT.length = 0 + }) + await t.rejects( + openUrlPrompt(npm, 'ftp://www.npmjs.com', 'npm home', 'prompt'), + /Invalid URL/, + 'got the correct error' + ) + t.equal(openerUrl, null, 'did not open') + t.same(openerOpts, null, 'did not open') + t.same(OUTPUT, [], 'printed no output') +}) + +t.test('does not open url if canceled', async t => { + t.teardown(() => { + openerUrl = null + openerOpts = null + OUTPUT.length = 0 + questionShouldResolve = true + }) + + questionShouldResolve = false + const emitter = new EventEmitter() + + const open = openUrlPrompt(npm, 'https://www.npmjs.com', 'npm home', 'prompt', emitter) + + emitter.emit('abort') + + await open + + t.equal(openerUrl, null, 'did not open') + t.same(openerOpts, null, 'did not open') +}) + +t.test('returns error when opener errors', async t => { + t.teardown(() => { + openerUrl = null + openerOpts = null + openerResult = null + OUTPUT.length = 0 + }) + + openerResult = new Error('Opener failed') + + await t.rejects( + openUrlPrompt(npm, 'https://www.npmjs.com', 'npm home', 'prompt'), + /Opener failed/, + 'got the correct error' + ) + t.equal(openerUrl, 'https://www.npmjs.com', 'did not open') +})