Skip to content

Commit e1de7fd

Browse files
committed
Merge branch 'latest' into jumoel/support-web-publish
2 parents 1231bf7 + 68ade72 commit e1de7fd

File tree

29 files changed

+272
-78
lines changed

29 files changed

+272
-78
lines changed

AUTHORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,3 +837,6 @@ Yonathan Randolph <yonathan@gmail.com>
837837
Julian Møller Ellehauge <jumoel@github.com>
838838
Lucas Werkmeister <mail@lucaswerkmeister.de>
839839
Seth Westphal <westy92@users.noreply.github.com>
840+
Mihai Crisan <61682879+crisanmm@users.noreply.github.com>
841+
Kenichi Kamiya <kachick1@gmail.com>
842+
Chen XI <xichen1427@gmail.com>

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
# Changelog
22

3+
## v8.14.0 (2022-07-13)
4+
5+
### Features
6+
7+
* [`f032e1c`](https://github.com/npm/cli/commit/f032e1c0ada062e2139c8f057b24abb1ce2e4a33) [#4827](https://github.com/npm/cli/pull/4827) feat: add npm audit signatures ([@feelepxyz](https://github.com/feelepxyz))
8+
* [`e8102c1`](https://github.com/npm/cli/commit/e8102c1aae65a18e41253fbcdffe2eff0bedae53) [#5076](https://github.com/npm/cli/pull/5076) feat: Add `web` auth type ([@jumoel](https://github.com/jumoel))
9+
* [`e9b4214`](https://github.com/npm/cli/commit/e9b4214e1ddb1ad79fe6826cf2ce7ba385f0c274) [#5094](https://github.com/npm/cli/pull/5094) feat(arborist): add support for dependencies script ([@nlf](https://github.com/nlf))
10+
* [`c6c4ba3`](https://github.com/npm/cli/commit/c6c4ba3b62e2a0896a48329f4c7e13d9e44a2f80) [#5149](https://github.com/npm/cli/pull/5149) feat: notify on adduser of upcoming cmds, login and register ([@fritzy](https://github.com/fritzy))
11+
* [`e58f02f`](https://github.com/npm/cli/commit/e58f02f5e8263bf86ae1f07a863098d445e6d0cd) [#5149](https://github.com/npm/cli/pull/5149) feat: warn on config --auth-type=sso/saml/oauth, undeprecate --auth-type ([@fritzy](https://github.com/fritzy))
12+
13+
### Bug Fixes
14+
15+
* [`52ec5ec`](https://github.com/npm/cli/commit/52ec5ec61fd3b266efd7a9c5712dd6a769a2d365) [#5154](https://github.com/npm/cli/pull/5154) fix: properly open package arg repo inside workspace ([@wraithgar](https://github.com/wraithgar))
16+
17+
### Documentation
18+
19+
* [`9697f16`](https://github.com/npm/cli/commit/9697f16952b1bf02bb5455c36a1995277cbc0c97) [#5118](https://github.com/npm/cli/pull/5118) docs: typo in npm command ([@crisanmm](https://github.com/crisanmm))
20+
* [`da5a4ba`](https://github.com/npm/cli/commit/da5a4ba2c83af9a7e5e0fe38c32136adf396f557) [#5079](https://github.com/npm/cli/pull/5079) docs: update reference to deprecated spdx package ([@kachick](https://github.com/kachick))
21+
* [`25b3058`](https://github.com/npm/cli/commit/25b305830be0892bbbf0245aee2eebdb76ee2ce3) [#5043](https://github.com/npm/cli/pull/5043) docs: naming of files in example code should be consistent ([@xc1427](https://github.com/xc1427))
22+
* [`ac56fc4`](https://github.com/npm/cli/commit/ac56fc41bc2f91f51c8438f98893121e7a92ee46) [#5095](https://github.com/npm/cli/pull/5095) docs: document `dependencies` script ([@nlf](https://github.com/nlf))
23+
24+
### Dependencies
25+
26+
* [`cb0db7c`](https://github.com/npm/cli/commit/cb0db7c3fd1d0a4c30db9f44e9ea9e69ec327fe8) [#5147](https://github.com/npm/cli/pull/5147) deps: `@npmcli/arborist@5.3.0`
27+
* [`b8c0580`](https://github.com/npm/cli/commit/b8c0580e5df93aa519b3ec240bb85d59eee5ee37) [#5156](https://github.com/npm/cli/pull/5156) deps: `minipass@3.3.4`
28+
* [`ad72611`](https://github.com/npm/cli/commit/ad726118755ef577cc0755499d35a5d3c74d54a6) [#5156](https://github.com/npm/cli/pull/5156) deps: `lru-cache@7.12.0`
29+
* [`c94919d`](https://github.com/npm/cli/commit/c94919dd4874196d3a84eff4fab450a17dcd4867) [#5156](https://github.com/npm/cli/pull/5156) deps: `just-diff@5.0.3`
30+
* [`18ddc57`](https://github.com/npm/cli/commit/18ddc57c7a54165d55c81b413ef9de981c790148) [#5156](https://github.com/npm/cli/pull/5156) deps: `just-diff-apply@5.3.1`
31+
* [`a2d700b`](https://github.com/npm/cli/commit/a2d700b3cc7cebca2d1b0c16224af41da3689aaf) [#5156](https://github.com/npm/cli/pull/5156) deps: `npm-package-arg@9.1.0`
32+
* [`99dc697`](https://github.com/npm/cli/commit/99dc697409e1eb42caaf0c0e38fa41635d89a871) [#5156](https://github.com/npm/cli/pull/5156) deps: `@npmcli/run-script@4.1.7`
33+
* [`4a9f2dc`](https://github.com/npm/cli/commit/4a9f2dc9169fd330c4dcf2bad7890aaf4765bafa) [#5157](https://github.com/npm/cli/pull/5157) deps: `npm-registry-fetch@13.2.0`
34+
* [`45a9bde`](https://github.com/npm/cli/commit/45a9bdee604073a3c5b4d3c6d90e22bf6672d6bf) [#5158](https://github.com/npm/cli/pull/5158) deps: `npm-profile@6.2.0`
35+
336
## v8.13.2 (2022-06-29)
437

538
### Documentation

CONTRIBUTING.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,18 @@ $ node . run test
3535

3636
**5. Open a [Pull Request](https://github.com/npm/cli/pulls) for your work & become the newest contributor to `npm`! 🎉**
3737

38-
## Test Coverage
38+
## Pull Request Conventions
3939

40-
We use [`tap`](https://node-tap.org/) for testing & expect that every new feature or bug fix comes with corresponding tests that validate the solutions. We strive to have as close to, if not exactly, 100% code coverage.
40+
We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). When opening a pull request, please be sure that either the pull request title, or each commit in the pull request, has one of the following prefixes:
4141

42-
**You can find out what the current test coverage percentage is by running...**
42+
- `feat`: For when introducing a new feature. The result will be a new semver minor version of the package when it is next published.
43+
- `fix`: For bug fixes. The result will be a new semver patch version of the package when it is next published.
44+
- `docs`: For documentation updates. The result will be a new semver patch version of the package when it is next published.
45+
- `chore`: For changes that do not affect the published module. Often these are changes to tests. The result will be *no* change to the version of the package when it is next published (as the commit does not affect the published version).
4346

44-
```bash
45-
$ node . run check-coverage
46-
```
47+
## Test Coverage
48+
49+
We use [`tap`](https://node-tap.org/) for testing & expect that every new feature or bug fix comes with corresponding tests that validate the solutions. Tap also reports on code coverage and it will fail if that drops below 100%.
4750

4851
## Performance & Benchmarks
4952

DEPENDENCIES.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ graph LR;
131131
npm-bundled-->npm-normalize-package-bin;
132132
npm-install-checks-->semver;
133133
npm-package-arg-->hosted-git-info;
134+
npm-package-arg-->proc-log;
134135
npm-package-arg-->semver;
135136
npm-package-arg-->validate-npm-package-name;
136137
npm-packlist-->ignore-walk;
@@ -257,7 +258,7 @@ graph LR;
257258
cidr-regex-->ip-regex;
258259
cli-columns-->string-width;
259260
cli-columns-->strip-ansi;
260-
cli-table3-->colors;
261+
cli-table3-->colors-colors["@colors/colors"];
261262
cli-table3-->string-width;
262263
cmd-shim-->mkdirp-infer-owner;
263264
color-convert-->color-name;
@@ -405,6 +406,7 @@ graph LR;
405406
libnpmversion-->require-inject;
406407
libnpmversion-->semver;
407408
libnpmversion-->tap;
409+
lru-cache-->yallist;
408410
make-fetch-happen-->agentkeepalive;
409411
make-fetch-happen-->cacache;
410412
make-fetch-happen-->http-cache-semantics;
@@ -510,6 +512,7 @@ graph LR;
510512
npm-->npmcli-template-oss["@npmcli/template-oss"];
511513
npm-->npmlog;
512514
npm-->opener;
515+
npm-->p-map;
513516
npm-->pacote;
514517
npm-->parse-conflict-json;
515518
npm-->proc-log;
@@ -535,6 +538,7 @@ graph LR;
535538
npm-bundled-->npm-normalize-package-bin;
536539
npm-install-checks-->semver;
537540
npm-package-arg-->hosted-git-info;
541+
npm-package-arg-->proc-log;
538542
npm-package-arg-->semver;
539543
npm-package-arg-->validate-npm-package-name;
540544
npm-packlist-->glob;
@@ -634,6 +638,7 @@ graph LR;
634638
npmcli-run-script-->npmcli-node-gyp["@npmcli/node-gyp"];
635639
npmcli-run-script-->npmcli-promise-spawn["@npmcli/promise-spawn"];
636640
npmcli-run-script-->read-package-json-fast;
641+
npmcli-run-script-->which;
637642
npmlog-->are-we-there-yet;
638643
npmlog-->console-control-strings;
639644
npmlog-->gauge;

docs/content/commands/npm-audit.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,55 @@ output, it simply changes the command's failure threshold.
4343

4444
### Audit Signatures
4545

46-
This command can also audit the integrity values of the packages in your
47-
tree against any signatures present in the registry they were downloaded
48-
from. npm will attempt to download the keys from `/-/npm/v1/keys` on
49-
each the registry used to download any given package. It will then
50-
check the `dist.signatures` object in the package itself, and verify the
51-
`sig` present there using the `keyid` there, matching it with a key
52-
returned from the registry. The command for this is `npm audit
53-
signatures`
46+
To ensure the integrity of packages you download from the public npm registry, or any registry that supports signatures, you can verify the registry signatures of downloaded packages using the npm CLI.
47+
48+
Registry signatures can be verified using the following `audit` command:
49+
50+
```bash
51+
$ npm audit signatures
52+
```
53+
54+
The npm CLI supports registry signatures and signing keys provided by any registry if the following conventions are followed:
55+
56+
1. Signatures are provided in the package's `packument` in each published version within the `dist` object:
57+
58+
```json
59+
"dist":{
60+
"..omitted..": "..omitted..",
61+
"signatures": [{
62+
"keyid": "SHA256:{{SHA256_PUBLIC_KEY}}",
63+
"sig": "a312b9c3cb4a1b693e8ebac5ee1ca9cc01f2661c14391917dcb111517f72370809..."
64+
}]
65+
}
66+
```
67+
68+
See this [example](https://registry.npmjs.org/light-cycle/1.4.3) of a signed package from the public npm registry.
69+
70+
The `sig` is generated using the following template: `${package.name}@${package.version}:${package.dist.integrity}` and the `keyid` has to match one of the public signing keys below.
71+
72+
2. Public signing keys are provided at `registry-host.tld/-/npm/v1/keys` in the following format:
73+
74+
```
75+
{
76+
"keys": [{
77+
"expires": null,
78+
"keyid": "SHA256:{{SHA256_PUBLIC_KEY}}",
79+
"keytype": "ecdsa-sha2-nistp256",
80+
"scheme": "ecdsa-sha2-nistp256",
81+
"key": "{{B64_PUBLIC_KEY}}"
82+
}]
83+
}
84+
```
85+
86+
Keys response:
87+
88+
- `expires`: null or a simplified extended <a href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 format</a>: `YYYY-MM-DDTHH:mm:ss.sssZ`
89+
- `keydid`: sha256 fingerprint of the public key
90+
- `keytype`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI
91+
- `scheme`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI
92+
- `key`: base64 encoded public key
93+
94+
See this <a href="https://registry.npmjs.org/-/npm/v1/keys" target="_blank">example key's response from the public npm registry</a>.
5495

5596
### Audit Endpoints
5697

docs/content/configuring-npm/folders.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ For a graphical breakdown of what is installed where, use `npm ls`.
202202
#### Publishing
203203
204204
Upon publishing, npm will look in the `node_modules` folder. If any of
205-
the items there are not in the `bundledDependencies` array, then they will
205+
the items there are not in the `bundleDependencies` array, then they will
206206
not be included in the package tarball.
207207
208208
This allows a package maintainer to install all of their dependencies

docs/content/configuring-npm/package-json.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -829,14 +829,14 @@ if the `soy-milk` package is not installed on the host. This allows you to
829829
integrate and interact with a variety of host packages without requiring
830830
all of them to be installed.
831831

832-
### bundledDependencies
832+
### bundleDependencies
833833

834834
This defines an array of package names that will be bundled when publishing
835835
the package.
836836

837837
In cases where you need to preserve npm packages locally or have them
838838
available through a single file download, you can bundle the packages in a
839-
tarball file by specifying the package names in the `bundledDependencies`
839+
tarball file by specifying the package names in the `bundleDependencies`
840840
array and executing `npm pack`.
841841

842842
For example:
@@ -847,7 +847,7 @@ If we define a package.json like this:
847847
{
848848
"name": "awesome-web-framework",
849849
"version": "1.0.0",
850-
"bundledDependencies": [
850+
"bundleDependencies": [
851851
"renderized",
852852
"super-streams"
853853
]
@@ -860,9 +860,9 @@ can be installed in a new project by executing `npm install
860860
awesome-web-framework-1.0.0.tgz`. Note that the package names do not
861861
include any versions, as that information is specified in `dependencies`.
862862

863-
If this is spelled `"bundleDependencies"`, then that is also honored.
863+
If this is spelled `"bundledDependencies"`, then that is also honored.
864864

865-
Alternatively, `"bundledDependencies"` can be defined as a boolean value. A
865+
Alternatively, `"bundleDependencies"` can be defined as a boolean value. A
866866
value of `true` will bundle all dependencies, a value of `false` will bundle
867867
none.
868868

docs/content/using-npm/config.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,9 @@ newlines replaced by the string "\n". For example:
357357
cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
358358
```
359359

360-
It is _not_ the path to a certificate file (and there is no "certfile"
361-
option).
360+
It is _not_ the path to a certificate file, though you can set a
361+
registry-scoped "certfile" path like
362+
"//other-registry.tld/:certfile=/path/to/cert.pem".
362363

363364
<!-- automatically generated, do not edit manually -->
364365
<!-- see lib/utils/config/definitions.js -->
@@ -946,7 +947,8 @@ format with newlines replaced by the string "\n". For example:
946947
key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
947948
```
948949

949-
It is _not_ the path to a key file (and there is no "keyfile" option).
950+
It is _not_ the path to a key file, though you can set a registry-scoped
951+
"keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".
950952

951953
<!-- automatically generated, do not edit manually -->
952954
<!-- see lib/utils/config/definitions.js -->

lib/commands/adduser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AddUser extends BaseCommand {
3030
log.disableProgress()
3131

3232
log.warn('adduser',
33-
'`adduser` will be split into `login` and `register in a future version.'
33+
'`adduser` will be split into `login` and `register` in a future version.'
3434
+ ' `adduser` will become an alias of `register`.'
3535
+ ' `login` (currently an alias) will become its own command.')
3636
log.notice('', `Log in on ${replaceInfo(registry)}`)

lib/commands/publish.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ class Publish extends BaseCommand {
6161
throw new Error('Tag name must not be a valid SemVer range: ' + defaultTag.trim())
6262
}
6363

64-
const opts = { ...this.npm.flatOptions }
65-
log.disableProgress()
66-
64+
const opts = { ...this.npm.flatOptions, progress: false }
65+
6766
// you can publish name@version, ./foo.tgz, etc.
6867
// even though the default is the 'file:.' cwd.
6968
const spec = npa(args[0])
@@ -102,7 +101,7 @@ class Publish extends BaseCommand {
102101
const resolved = npa.resolve(manifest.name, manifest.version)
103102
const registry = npmFetch.pickRegistry(resolved, opts)
104103
const creds = this.npm.config.getCredentialsByURI(registry)
105-
const noCreds = !creds.token && !creds.username
104+
const noCreds = !(creds.token || creds.username || creds.certfile && creds.keyfile)
106105
const outputRegistry = replaceInfo(registry)
107106

108107
if (noCreds) {

0 commit comments

Comments
 (0)