Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cli/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { posix } = require('path')
const fs = require('fs').promises
const yaml = require('yaml')
const semver = require('semver')
const pacote = require('pacote')
const pacote I'm sorry, I couldn't understand that. Can you please provide more context or clarify your request?= require('pacote')
const extractRelease = require('./extract')
const log = require('./log')

Expand Down Expand Up @@ -82,14 +82,14 @@ const main = async ({
const range = `>=${major}.0.0-a <${major + 1}.0.0` // include all prereleases
const version = semver.parse(semver.maxSatisfying(pack.versions, range))

return {
return version && {
...release,
version: version.toString(),
// the default release is always controlled by the latest dist-tag
default: semver.eq(version, pack.latest),
prerelease: version.prerelease.length > 0,
}
})
}).filter(Boolean)

const latestRelease = releaseVersions.find(r => r.default)

Expand Down
4 changes: 4 additions & 0 deletions cli/releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
},
{
"id": "v9",
"branch": "release/v9"
},
{
"id": "v10",
"branch": "latest"
}
]
2 changes: 1 addition & 1 deletion content/cli/v9/commands/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: CLI Commands
shortName: Commands
github_repo: npm/cli
github_branch: latest
github_branch: release/v9
github_path: docs/lib/content/nav.yml
redirect_from:
- /cli-commands
Expand Down
8 changes: 7 additions & 1 deletion content/cli/v9/commands/npm-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: npm-access
section: 1
description: Set access level on published packages
github_repo: npm/cli
github_branch: latest
github_branch: release/v9
github_path: docs/lib/content/commands/npm-access.md
redirect_from:
- /cli-commands/access
Expand Down Expand Up @@ -121,6 +121,8 @@ Whether or not to output JSON data, rather than the normal output.

Not supported by all npm commands.



#### `otp`

* Default: null
Expand All @@ -132,13 +134,17 @@ when publishing or changing package permissions with `npm access`.
If not set, and a registry response fails with a challenge for a one-time
password, npm will prompt on the command line for one.



#### `registry`

* Default: "https://registry.npmjs.org/"
* Type: URL

The base URL of the npm registry.



### See Also

* [`libnpmaccess`](https://npm.im/libnpmaccess)
Expand Down
7 changes: 6 additions & 1 deletion content/cli/v9/commands/npm-adduser.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: npm-adduser
section: 1
description: Add a registry user account
github_repo: npm/cli
github_branch: latest
github_branch: release/v9
github_path: docs/lib/content/commands/npm-adduser.md
redirect_from:
- /cli-commands/adduser
Expand Down Expand Up @@ -63,6 +63,8 @@ email are read in from prompts.

The base URL of the npm registry.



#### `scope`

* Default: the scope of the current project, if any, or ""
Expand Down Expand Up @@ -93,6 +95,7 @@ npm init --scope=@foo --yes
```



#### `auth-type`

* Default: "web"
Expand All @@ -101,6 +104,8 @@ npm init --scope=@foo --yes
What authentication strategy to use with `login`. Note that if an `otp`
config is given, this value will always be set to `legacy`.



### See Also

* [npm registry](/cli/v9/using-npm/registry)
Expand Down
20 changes: 19 additions & 1 deletion content/cli/v9/commands/npm-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: npm-audit
section: 1
description: Run a security audit
github_repo: npm/cli
github_branch: latest
github_branch: release/v9
github_path: docs/lib/content/commands/npm-audit.md
redirect_from:
- /cli-commands/audit
Expand Down Expand Up @@ -277,6 +277,8 @@ $ npm audit --audit-level=moderate
The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.



#### `dry-run`

* Default: false
Expand All @@ -290,6 +292,8 @@ commands that modify your local installation, eg, `install`, `update`,
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.



#### `force`

* Default: false
Expand All @@ -316,6 +320,8 @@ 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!



#### `json`

* Default: false
Expand All @@ -328,6 +334,8 @@ Whether or not to output JSON data, rather than the normal output.

Not supported by all npm commands.



#### `package-lock-only`

* Default: false
Expand All @@ -342,6 +350,8 @@ instead of checking `node_modules` and downloading dependencies.
For `list` this means the output will be based on the tree described by the
`package-lock.json`, rather than the contents of `node_modules`.



#### `omit`

* Default: 'dev' if the `NODE_ENV` environment variable is set to
Expand All @@ -360,6 +370,8 @@ it will be included.
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
variable will be set to `'production'` for all lifecycle scripts.



#### `foreground-scripts`

* Default: false
Expand All @@ -372,6 +384,8 @@ input, output, and error with the main npm process.
Note that this will generally make installs run slower, and be much noisier,
but can be useful for debugging.



#### `ignore-scripts`

* Default: false
Expand All @@ -384,6 +398,8 @@ Note that commands explicitly intended to run a particular script, such as
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.



#### `workspace`

* Default:
Expand Down Expand Up @@ -446,6 +462,8 @@ When set file: protocol dependencies will be packed and installed as regular
dependencies instead of creating a symlink. This option has no effect on
workspaces.



### See Also

* [npm install](/cli/v9/commands/npm-install)
Expand Down
6 changes: 5 additions & 1 deletion content/cli/v9/commands/npm-bugs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: npm-bugs
section: 1
description: Report bugs for a package in a web browser
github_repo: npm/cli
github_branch: latest
github_branch: release/v9
github_path: docs/lib/content/commands/npm-bugs.md
redirect_from:
- /cli-commands/bugs
Expand Down Expand Up @@ -65,13 +65,17 @@ terminal.

Set to `true` to use default system URL opener.



#### `registry`

* Default: "https://registry.npmjs.org/"
* Type: URL

The base URL of the npm registry.



#### `workspace`

* Default:
Expand Down
4 changes: 3 additions & 1 deletion content/cli/v9/commands/npm-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: npm-cache
section: 1
description: Manipulates packages cache
github_repo: npm/cli
github_branch: latest
github_branch: release/v9
github_path: docs/lib/content/commands/npm-cache.md
redirect_from:
- /cli-commands/cache
Expand Down Expand Up @@ -108,6 +108,8 @@ verify`.

The location of npm's cache directory.



### See Also

* [package spec](/cli/v9/using-npm/package-spec)
Expand Down
32 changes: 23 additions & 9 deletions content/cli/v9/commands/npm-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: npm-ci
section: 1
description: Clean install a project
github_repo: npm/cli
github_branch: latest
github_branch: release/v9
github_path: docs/lib/content/commands/npm-ci.md
redirect_from:
- /cli-commands/ci
Expand Down Expand Up @@ -115,6 +115,8 @@ place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.



#### `legacy-bundling`

* Default: false
Expand All @@ -127,6 +129,8 @@ the same manner that they are depended on. This may cause very deep
directory structures and duplicate package installs as there is no
de-duplicating. Sets `--install-strategy=nested`.



#### `global-style`

* Default: false
Expand All @@ -137,6 +141,8 @@ de-duplicating. Sets `--install-strategy=nested`.
Only install direct dependencies in the top level `node_modules`, but hoist
on deeper dependencies. Sets `--install-strategy=shallow`.



#### `omit`

* Default: 'dev' if the `NODE_ENV` environment variable is set to
Expand All @@ -155,6 +161,8 @@ it will be included.
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
variable will be set to `'production'` for all lifecycle scripts.



#### `strict-peer-deps`

* Default: false
Expand All @@ -174,15 +182,7 @@ When such an override is performed, a warning is printed, explaining the
conflict and the packages involved. If `--strict-peer-deps` is set, then
this warning is treated as a failure.

#### `package-lock`

* Default: true
* Type: Boolean

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

This configuration does not affect `npm ci`.

#### `foreground-scripts`

Expand All @@ -196,6 +196,8 @@ input, output, and error with the main npm process.
Note that this will generally make installs run slower, and be much noisier,
but can be useful for debugging.



#### `ignore-scripts`

* Default: false
Expand All @@ -208,6 +210,8 @@ Note that commands explicitly intended to run a particular script, such as
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.



#### `audit`

* Default: true
Expand All @@ -218,6 +222,8 @@ default registry and all registries configured for scopes. See the
documentation for [`npm audit`](/cli/v9/commands/npm-audit) for details on what is
submitted.



#### `bin-links`

* Default: true
Expand All @@ -230,6 +236,8 @@ Set to false to have it not do this. This can be used to work around the
fact that some file systems don't support symlinks, even on ostensibly Unix
systems.



#### `fund`

* Default: true
Expand All @@ -239,6 +247,8 @@ When "true" displays the message at the end of each `npm install`
acknowledging the number of dependencies looking for funding. See [`npm
fund`](/cli/v9/commands/npm-fund) for details.



#### `dry-run`

* Default: false
Expand All @@ -252,6 +262,8 @@ commands that modify your local installation, eg, `install`, `update`,
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.



#### `workspace`

* Default:
Expand Down Expand Up @@ -314,6 +326,8 @@ When set file: protocol dependencies will be packed and installed as regular
dependencies instead of creating a symlink. This option has no effect on
workspaces.



### See Also

* [npm install](/cli/v9/commands/npm-install)
Expand Down
2 changes: 1 addition & 1 deletion content/cli/v9/commands/npm-completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: npm-completion
section: 1
description: Tab Completion for npm
github_repo: npm/cli
github_branch: latest
github_branch: release/v9
github_path: docs/lib/content/commands/npm-completion.md
redirect_from:
- /cli-commands/completion
Expand Down
Loading