Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
309c4f0
deps: update V8 to 9.4.146.19
targos Oct 2, 2021
4da73d0
build: reset embedder string to "-node.0"
targos Oct 2, 2021
b8aabd5
deps: V8: un-cherry-pick bd019bd
refack Mar 27, 2019
e810f07
deps: V8: patch register-arm64.h
refack May 22, 2019
88ae710
deps: V8: forward declaration of `Rtl*FunctionTable`
refack May 22, 2019
e981215
deps: make v8.h compatible with VS2015
joaocgreis Nov 1, 2019
1aea6a7
deps: fix V8 build issue with inline methods
gengjiawen Oct 14, 2020
22dcd3e
deps: silence irrelevant V8 warnings
targos Jan 30, 2021
be01694
deps: silence irrelevant V8 warning
targos May 1, 2021
807b68b
deps: V8: cherry-pick 00bb1a77c03e
RaisinTen Aug 21, 2021
150d816
deps: V8: cherry-pick bdcda72cd1d8
targos Aug 31, 2021
8de5eb8
deps: V8: cherry-pick 5681a6565828
targos Sep 6, 2021
5cc24e6
deps: V8: cherry-pick 9a607043cb31
gengjiawen Sep 9, 2021
a3db203
deps: make V8 9.4 abi-compatible with 9.0
targos Oct 2, 2021
e7046e0
deps: restore minimum ICU version to 68
targos Jul 20, 2021
f7c8274
tools: update V8 gypfiles for 9.4
targos Jul 28, 2021
02a87b0
doc: update markdown formatting for *.md files
Trott Sep 18, 2021
ebf1710
tools: extend default yamllint config
targos Sep 19, 2021
7e58cda
doc: update tools .md files for upcoming lint/formatting
Trott Sep 19, 2021
c231745
doc: prepare markdown file for upcoming formatting/linting
Trott Sep 19, 2021
cea7395
doc: update benchmarks README.md for upcoming linting/formatting
Trott Sep 19, 2021
847b451
doc: update markdown files in src for upcoming linting/formatting
Trott Sep 19, 2021
94b415b
doc: add blank line between comments
Trott Sep 20, 2021
7968c79
crypto: don't call callback twice in case crypto.randomBytes fails
lbguilherme Sep 19, 2021
7bd62f4
doc: fix typos in http.md
lpinca Sep 20, 2021
80fdedd
tools: fix find-inactive-collaborators for recent README change
Trott Sep 20, 2021
779dfd1
doc: make version picker usable on mobile
evanlucas Aug 31, 2021
0232f94
tools: update remark-preset-lint-node to 3.1.0
Trott Sep 20, 2021
e22ca06
build: fix "test-internet.yml" workflows
suryapratapsinghsuryavanshi Sep 22, 2021
eaf9d08
build: add --no-user for pip commands in Makefile
Trott Sep 21, 2021
b856886
meta: update mailmap for LakshmiSwethaG
Trott Sep 21, 2021
4d46bde
meta: add mailmap entry for ralphtheninja
Trott Sep 19, 2021
59db829
doc: fix typo in `async_hooks.md`
xuchaobei Sep 23, 2021
6489423
console: avoid unnecessary variables
Cinnamonsroll Sep 23, 2021
67812e8
tools: re-implement lint-md without unified-args
Trott Sep 20, 2021
73a127b
doc: fix buffer api example code's token error
gitwillsky Sep 15, 2021
4b117fb
console: use validators for consistency
VoltrexKeyva Aug 19, 2021
6bf6790
doc: fix typo in 'maxHeaderSize'
rebhialfa Sep 20, 2021
bddf8c2
src,crypto: eliminate code duplication between StatelessDiffieHellman*
RaisinTen Sep 11, 2021
2fa5e50
crypto: handle initEDRaw pkey failure
codebytere Sep 23, 2021
a68f91c
doc: add version when diagnostics_channel APIs were added
Flarna Sep 24, 2021
26db6db
tools: implement markdown formatting
Trott Sep 22, 2021
9c4e7a5
tools: fix lint-md autolinking
Trott Sep 24, 2021
a660017
meta: add .mailmap entry for kunalspathak
Trott Sep 24, 2021
9a2b94a
doc: update fs.watchFile doc
clement-nardi Sep 17, 2021
ced8467
typings: define types for worker and messaging bindings
targos Sep 18, 2021
dd39422
typings: define types for symbols binding
targos Sep 18, 2021
d36127d
src: move `ToUSVString()` to node_util.cc
XadillaX Sep 24, 2021
a1bee94
build: pass a tuple of alternatives to str.endswith()
cclauss Sep 6, 2021
547fc86
lib: use `validateArray`
VoltrexKeyva Aug 15, 2021
528f922
src: remove usage of AllocatedBuffer from udp_wrap.cc
RaisinTen Sep 19, 2021
88e7bd0
events: allow dispatch many times without listener
mrbbot Aug 15, 2021
7fbfb66
build: limit update authors CI scope
gengjiawen Sep 26, 2021
685c7d4
deps: update `nghttp2` to v1.45.1
thunder-coding Sep 24, 2021
34f3021
benchmark: add `util.toUSVString()`'s benchmark
XadillaX Sep 24, 2021
22725f5
http: use 0 as default for requests limit
fatal10110 Sep 23, 2021
9fa6dfb
doc: fix example of crypto.generateKeySync
GreenSleepes Sep 27, 2021
344c03b
repl: skip EmptyStatements and return result with TLA
Mesteery Sep 23, 2021
da6c82b
meta: update gdams contact information
Trott Sep 27, 2021
614a7c2
doc: fix typo in packages.md
warlock1996 Sep 27, 2021
bbf1ed7
src: remove AllocatedBuffer from crypto_common.cc
RaisinTen Sep 25, 2021
972d921
module: fix ERR_REQUIRE_ESM for parentPath null
guybedford Sep 18, 2021
66edb7b
doc: fix typo in fs.md
warlock1996 Sep 29, 2021
48c162d
build: set DESTCPU correctly for 'make binary' on Apple Silicon
cheister Sep 18, 2021
1d0a3e1
doc: fix typo in fs
mscdex Sep 29, 2021
9ee9e41
meta: move one or more collaborators to emeritus
nodejs-github-bot Sep 15, 2021
d64740f
meta: update AUTHORS
nodejs-github-bot Sep 26, 2021
e040f2c
meta: add .mailmap entry for daguej
Trott Sep 26, 2021
a6112dd
src: fix time-of-use vs time-of-check "bugs"
kokke Sep 14, 2021
383dbe9
src: implement changes suggested by @addaleax
kokke Sep 27, 2021
555af5b
http: remove 'data' and 'end' listener if client parser error
mcollina Sep 28, 2021
d2e54e5
doc: reorder stream 'readable' paragraphs
vweevers Sep 25, 2021
dc0c274
test: suppress compiler warning in test_bigint
danbev Sep 29, 2021
f4164fa
util: expose stripVTControlCharacters()
cjihrig Sep 19, 2021
66d3101
util: improve ansi escape code regex
cjihrig Sep 25, 2021
f31b0c9
tools: update remark-preset-lint-node to 3.2.0
Trott Oct 1, 2021
66ab278
meta: add .mailmap entry for Jimbly
Trott Sep 30, 2021
a75a8f2
meta: update AUTHORS
nodejs-github-bot Oct 3, 2021
3d5eba8
lib: refactor to avoid unsafe array iteration
aduh95 Sep 30, 2021
a5218b5
doc: update Forrest Norvell's pronouns
othiym23 Oct 3, 2021
6a8689f
test: fix typo in test/common/index.js
tniessen Oct 3, 2021
f71ac57
doc: add triagers to the table of contents
iam-frankqiu Sep 1, 2021
3148f9b
build: check for duplicates in new AUTHORS entries
Trott Sep 30, 2021
7bb4dc2
tools: update certdata.txt
richardlau Oct 1, 2021
9af2592
crypto: update root certificates
richardlau Oct 1, 2021
88bdbf1
doc: format markdown files in test directory
Trott Oct 3, 2021
e2cd2f4
doc: fix CVE-2021-22940 references
targos Oct 4, 2021
abfcbcd
doc: update fast-track approval comment request
VoltrexKeyva Oct 4, 2021
b694b0c
src: use `As()` instead of `Cast()` for conversions
RaisinTen Oct 2, 2021
8d7710e
tools: update rollup entry in lint-md package.json
iam-frankqiu Oct 4, 2021
a37527c
meta: add mailmap entry for ratracegrad
Trott Oct 3, 2021
c7f3294
fs: add stream utilities to `FileHandle`
aduh95 Sep 5, 2021
1db2ffd
doc: fix typo in stream docs
juanarbol Oct 5, 2021
8d0546d
doc: correct the codeblock for `hmacImportParams.hash`
J-Human Oct 6, 2021
dc9c319
doc: fix the inline code-block at the NodeDhKeyGenParams class
J-Human Oct 6, 2021
947f3dc
deps: V8: patch jinja2 for Python 3.10 compat
targos Oct 5, 2021
18820bf
tools: patch jinja2 for Python 3.10 compat
targos Oct 5, 2021
f83b9bc
build: support Python 3.10.0
iam-frankqiu Oct 4, 2021
9b0e61a
doc,src: update crypto/README.md
tniessen Oct 5, 2021
69eaaf6
doc: format general markdown files
Trott Oct 5, 2021
cff0c12
doc: note readStream.path if fd is specified
ylemkimon Sep 29, 2021
d112c9a
meta: update mailmap entry for othiym23
Trott Oct 5, 2021
7652129
meta: consolidate AUTHORS entries for jemjam
Trott Oct 5, 2021
316b385
doc: security release announcement safety check
mcollina Oct 5, 2021
8d1c471
doc: clarify that priorities applies to values
mhdawson Oct 4, 2021
b89c7ae
deps: upgrade npm to 8.0.0
npm-robot Oct 7, 2021
f1ae6fb
2021-10-08, Version 16.11.0 (Current)
danielleadams Oct 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
deps: upgrade npm to 8.0.0
PR-URL: #40369
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
npm-robot authored and danielleadams committed Oct 8, 2021
commit b89c7ae29732161305d2307fd72baaf3db5cbffa
6 changes: 4 additions & 2 deletions deps/npm/docs/content/configuring-npm/package-lock-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ Package descriptors have the following fields:
the case of packages fetched from the registry, this will be a url to a
tarball. In the case of git dependencies, this will be the full git url
with commit sha. In the case of link dependencies, this will be the
location of the link target.
location of the link target. `registry.npmjs.org` is a magic value meaning
"the currently configured registry".

* integrity: A `sha512` or `sha1` [Standard Subresource
Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/)
Expand Down Expand Up @@ -201,7 +202,8 @@ Dependency objects have the following fields:

* resolved: For registry sources this is path of the tarball relative to
the registry URL. If the tarball URL isn't on the same server as the
registry URL then this is a complete URL.
registry URL then this is a complete URL. `registry.npmjs.org` is a magic
value meaning "the currently configured registry".

* bundled: If true, this is the bundled dependency and will be installed
by the parent module. When installing, this module will be extracted
Expand Down
7 changes: 7 additions & 0 deletions deps/npm/docs/content/using-npm/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ The registry URL used is determined by the scope of the package (see
supplied by the `registry` config parameter. See [`npm config`](/commands/npm-config),
[`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on managing npm's configuration.

When the default registry is used in a package-lock or shrinkwrap is has the
special meaning of "the currently configured registry". If you create a lock
file while using the default registry you can switch to another registry and
npm will install packages from the new registry, but if you create a lock
file while using a custom registry packages will be installed from that
registry even after you change to another registry.

### Does npm send any information about me back to the registry?

Yes.
Expand Down
3 changes: 2 additions & 1 deletion deps/npm/docs/content/using-npm/scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ desired, with `npm access` or on the npmjs.com website.

Scopes can be associated with a separate registry. This allows you to
seamlessly use a mix of packages from the primary npm registry and one or more
private registries, such as npm Enterprise.
private registries, such as [GitHub Packages](https://github.com/features/packages) or the open source [Verdaccio](https://verdaccio.org)
project.

You can associate a scope with a registry at login, e.g.

Expand Down
16 changes: 16 additions & 0 deletions deps/npm/docs/content/using-npm/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,22 @@ npm run test --workspaces

Will run the `test` script in both `./packages/a` and `./packages/b`.

Commands will be run in each workspace in the order they appear in your `package.json`

```
{
"workspaces": [ "packages/a", "packages/b" ]
}
```

Order of run is different with:

```
{
"workspaces": [ "packages/b", "packages/a" ]
}
```

### Ignoring missing scripts

It is not required for all of the workspaces to implement scripts run with the `npm run` command.
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code>npm@7.24.0 /path/to/npm
<pre lang="bash"><code>npm@8.0.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.24.0</p>
<p>8.0.0</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
6 changes: 4 additions & 2 deletions deps/npm/docs/output/configuring-npm/package-lock-json.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ <h4 id="packages"><code>packages</code></h4>
the case of packages fetched from the registry, this will be a url to a
tarball. In the case of git dependencies, this will be the full git url
with commit sha. In the case of link dependencies, this will be the
location of the link target.</p>
location of the link target. <code>registry.npmjs.org</code> is a magic value meaning
“the currently configured registry”.</p>
</li>
<li>
<p>integrity: A <code>sha512</code> or <code>sha1</code> <a href="https://w3c.github.io/webappsec/specs/subresourceintegrity/">Standard Subresource
Expand Down Expand Up @@ -334,7 +335,8 @@ <h4 id="dependencies">dependencies</h4>
<li>
<p>resolved: For registry sources this is path of the tarball relative to
the registry URL. If the tarball URL isn’t on the same server as the
registry URL then this is a complete URL.</p>
registry URL then this is a complete URL. <code>registry.npmjs.org</code> is a magic
value meaning “the currently configured registry”.</p>
</li>
<li>
<p>bundled: If true, this is the bundled dependency and will be installed
Expand Down
6 changes: 6 additions & 0 deletions deps/npm/docs/output/using-npm/registry.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ <h2 id="table-of-contents">Table of contents</h2>
<a href="../using-npm/scope.html"><code>scope</code></a>. If no scope is specified, the default registry is used, which is
supplied by the <code>registry</code> config parameter. See <a href="../commands/npm-config.html"><code>npm config</code></a>,
<a href="../configuring-npm/npmrc.html"><code>npmrc</code></a>, and <a href="../using-npm/config.html"><code>config</code></a> for more on managing npm’s configuration.</p>
<p>When the default registry is used in a package-lock or shrinkwrap is has the
special meaning of “the currently configured registry”. If you create a lock
file while using the default registry you can switch to another registry and
npm will install packages from the new registry, but if you create a lock
file while using a custom registry packages will be installed from that
registry even after you change to another registry.</p>
<h3 id="does-npm-send-any-information-about-me-back-to-the-registry">Does npm send any information about me back to the registry?</h3>
<p>Yes.</p>
<p>When making requests of the registry npm adds two headers with information
Expand Down
3 changes: 2 additions & 1 deletion deps/npm/docs/output/using-npm/scope.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ <h4 id="publishing-private-scoped-packages-to-the-npm-registry">Publishing priva
<h3 id="associating-a-scope-with-a-registry">Associating a scope with a registry</h3>
<p>Scopes can be associated with a separate registry. This allows you to
seamlessly use a mix of packages from the primary npm registry and one or more
private registries, such as npm Enterprise.</p>
private registries, such as <a href="https://github.com/features/packages">GitHub Packages</a> or the open source <a href="https://verdaccio.org">Verdaccio</a>
project.</p>
<p>You can associate a scope with a registry at login, e.g.</p>
<pre lang="bash"><code>npm login --registry=http://reg.example.com --scope=@myco
</code></pre>
Expand Down
10 changes: 10 additions & 0 deletions deps/npm/docs/output/using-npm/workspaces.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,16 @@ <h3 id="running-commands-in-the-context-of-workspaces">Running commands in the c
<pre><code>npm run test --workspaces
</code></pre>
<p>Will run the <code>test</code> script in both <code>./packages/a</code> and <code>./packages/b</code>.</p>
<p>Commands will be run in each workspace in the order they appear in your <code>package.json</code></p>
<pre><code>{
"workspaces": [ "packages/a", "packages/b" ]
}
</code></pre>
<p>Order of run is different with:</p>
<pre><code>{
"workspaces": [ "packages/b", "packages/a" ]
}
</code></pre>
<h3 id="ignoring-missing-scripts">Ignoring missing scripts</h3>
<p>It is not required for all of the workspaces to implement scripts run with the <code>npm run</code> command.</p>
<p>By running the command with the <code>--if-present</code> flag, npm will ignore workspaces missing target script.</p>
Expand Down
5 changes: 3 additions & 2 deletions deps/npm/lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const semver = require('semver')
const BaseCommand = require('./base-command.js')
const npa = require('npm-package-arg')
const jsonParse = require('json-parse-even-better-errors')
const localeCompare = require('@isaacs/string-locale-compare')('en')

const searchCachePackage = async (path, spec, cacheKeys) => {
const parsed = npa(spec)
Expand Down Expand Up @@ -212,10 +213,10 @@ class Cache extends BaseCommand {
for (const key of keySet)
results.add(key)
}
[...results].sort((a, b) => a.localeCompare(b, 'en')).forEach(key => this.npm.output(key))
[...results].sort(localeCompare).forEach(key => this.npm.output(key))
return
}
cacheKeys.sort((a, b) => a.localeCompare(b, 'en')).forEach(key => this.npm.output(key))
cacheKeys.sort(localeCompare).forEach(key => this.npm.output(key))
}
}

Expand Down
5 changes: 3 additions & 2 deletions deps/npm/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const writeFile = promisify(fs.writeFile)
const { spawn } = require('child_process')
const { EOL } = require('os')
const ini = require('ini')
const localeCompare = require('@isaacs/string-locale-compare')('en')

// take an array of `[key, value, k2=v2, k3, v3, ...]` and turn into
// { key: value, k2: v2, k3: v3 }
Expand Down Expand Up @@ -209,7 +210,7 @@ class Config extends BaseCommand {
; Configs like \`//<hostname>/:_authToken\` are auth that is restricted
; to the registry host specified.

${data.split('\n').sort((a, b) => a.localeCompare(b, 'en')).join('\n').trim()}
${data.split('\n').sort(localeCompare).join('\n').trim()}

;;;;
; all available options shown below with default values
Expand Down Expand Up @@ -238,7 +239,7 @@ ${defData}
if (where === 'default' && !long)
continue

const keys = Object.keys(data).sort((a, b) => a.localeCompare(b, 'en'))
const keys = Object.keys(data).sort(localeCompare)
if (!keys.length)
continue

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/lib/deprecate.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Deprecate extends BaseCommand {
}

async deprecate ([pkg, msg]) {
// msg == null becase '' is a valid value, it indicates undeprecate
// msg == null because '' is a valid value, it indicates undeprecate
if (!pkg || msg == null)
throw this.usageError()

Expand Down
3 changes: 2 additions & 1 deletion deps/npm/lib/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('path')
const openUrl = require('./utils/open-url.js')
const { promisify } = require('util')
const glob = promisify(require('glob'))
const localeCompare = require('@isaacs/string-locale-compare')('en')

const BaseCommand = require('./base-command.js')

Expand Down Expand Up @@ -82,7 +83,7 @@ class Help extends BaseCommand {
if (aManNumber !== bManNumber)
return aManNumber - bManNumber

return a.localeCompare(b, 'en')
return localeCompare(a, b)
})
const man = mans[0]

Expand Down
4 changes: 2 additions & 2 deletions deps/npm/lib/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const _problems = Symbol('problems')
const _required = Symbol('required')
const _type = Symbol('type')
const ArboristWorkspaceCmd = require('./workspaces/arborist-cmd.js')
const localeCompare = require('@isaacs/string-locale-compare')('en')

class LS extends ArboristWorkspaceCmd {
/* istanbul ignore next - see test/lib/load-all-commands.js */
Expand Down Expand Up @@ -503,8 +504,7 @@ const augmentNodesWithMetadata = ({
return node
}

const sortAlphabetically = (a, b) =>
a.pkgid.localeCompare(b.pkgid, 'en')
const sortAlphabetically = ({ pkgid: a }, { pkgid: b }) => localeCompare(a, b)

const humanOutput = ({ color, result, seenItems, unicode }) => {
// we need to traverse the entire tree in order to determine which items
Expand Down
3 changes: 0 additions & 3 deletions deps/npm/lib/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,3 @@ const npm = module.exports = new class extends EventEmitter {
this.log.showProgress()
}
}()

if (require.main === module)
require('./cli.js')(process)
6 changes: 5 additions & 1 deletion deps/npm/lib/outdated.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const color = require('chalk')
const styles = require('ansistyles')
const npa = require('npm-package-arg')
const pickManifest = require('npm-pick-manifest')
const localeCompare = require('@isaacs/string-locale-compare')('en')

const Arborist = require('@npmcli/arborist')

Expand Down Expand Up @@ -85,7 +86,10 @@ class Outdated extends ArboristWorkspaceCmd {
}))

// sorts list alphabetically
const outdated = this.list.sort((a, b) => a.name.localeCompare(b.name, 'en'))
const outdated = this.list.sort((a, b) => localeCompare(a.name, b.name))

if (outdated.length > 0)
process.exitCode = 1

// return if no outdated packages
if (outdated.length === 0 && !this.npm.config.get('json'))
Expand Down
4 changes: 2 additions & 2 deletions deps/npm/lib/utils/completion/installed-deep.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { resolve } = require('path')
const Arborist = require('@npmcli/arborist')
const localeCompare = require('@isaacs/string-locale-compare')('en')

const installedDeep = async (npm) => {
const {
Expand All @@ -15,8 +16,7 @@ const installedDeep = async (npm) => {
return i
})
.filter(i => (i.depth - 1) <= depth)
.sort((a, b) => a.depth - b.depth)
.sort((a, b) => a.depth === b.depth ? a.name.localeCompare(b.name, 'en') : 0)
.sort((a, b) => (a.depth - b.depth) || localeCompare(a.name, b.name))

const res = new Set()
const gArb = new Arborist({ global: true, path: resolve(npm.globalDir, '..') })
Expand Down
3 changes: 2 additions & 1 deletion deps/npm/lib/utils/config/describe-all.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const definitions = require('./definitions.js')
const localeCompare = require('@isaacs/string-locale-compare')('en')
const describeAll = () => {
// sort not-deprecated ones to the top
/* istanbul ignore next - typically already sorted in the definitions file,
Expand All @@ -7,7 +8,7 @@ const describeAll = () => {
const sort = ([keya, {deprecated: depa}], [keyb, {deprecated: depb}]) => {
return depa && !depb ? 1
: !depa && depb ? -1
: keya.localeCompare(keyb, 'en')
: localeCompare(keya, keyb)
}
return Object.entries(definitions).sort(sort)
.map(([key, def]) => def.describe())
Expand Down
3 changes: 2 additions & 1 deletion deps/npm/lib/utils/npm-usage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { dirname } = require('path')
const { cmdList } = require('./cmd-list')
const localeCompare = require('@isaacs/string-locale-compare')('en')

module.exports = (npm) => {
const usesBrowser = npm.config.get('viewer') === 'browser'
Expand Down Expand Up @@ -62,7 +63,7 @@ const usages = (npm) => {
maxLen = Math.max(maxLen, c.length)
return set
}, [])
.sort((a, b) => a[0].localeCompare(b[0], 'en'))
.sort(([a], [b]) => localeCompare(a, b))
.map(([c, usage]) => `\n ${c}${' '.repeat(maxLen - c.length + 1)}${
(usage.split('\n').join('\n' + ' '.repeat(maxLen + 5)))}`)
.join('\n')
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/utils/open-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { URL } = require('url')

// attempt to open URL in web-browser, print address otherwise:
const open = async (npm, url, errMsg) => {
url = encodeURI(url)
const browser = npm.config.get('browser')

function printAlternateMsg () {
Expand Down
11 changes: 5 additions & 6 deletions deps/npm/lib/utils/tar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ const ssri = require('ssri')
const npmlog = require('npmlog')
const formatBytes = require('./format-bytes.js')
const columnify = require('columnify')
const localeCompare = require('@isaacs/string-locale-compare')('en', {
sensitivity: 'case',
numeric: true,
})

const logTar = (tarball, opts = {}) => {
const { unicode = false, log = npmlog } = opts
Expand Down Expand Up @@ -75,12 +79,7 @@ const getContents = async (manifest, tarball) => {
algorithms: ['sha1', 'sha512'],
})

const comparator = (a, b) => {
return a.path.localeCompare(b.path, 'en', {
sensitivity: 'case',
numeric: true,
})
}
const comparator = ({ path: a }, { path: b }) => localeCompare(a, b)

const isUpper = (str) => {
const ch = str.charAt(0)
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-access.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-ACCESS" "1" "September 2021" "" ""
.TH "NPM\-ACCESS" "1" "October 2021" "" ""
.SH "NAME"
\fBnpm-access\fR \- Set access level on published packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-adduser.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-ADDUSER" "1" "September 2021" "" ""
.TH "NPM\-ADDUSER" "1" "October 2021" "" ""
.SH "NAME"
\fBnpm-adduser\fR \- Add a registry user account
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-audit.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-AUDIT" "1" "September 2021" "" ""
.TH "NPM\-AUDIT" "1" "October 2021" "" ""
.SH "NAME"
\fBnpm-audit\fR \- Run a security audit
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-bin.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-BIN" "1" "September 2021" "" ""
.TH "NPM\-BIN" "1" "October 2021" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-bugs.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-BUGS" "1" "September 2021" "" ""
.TH "NPM\-BUGS" "1" "October 2021" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Report bugs for a package in a web browser
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-cache.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-CACHE" "1" "September 2021" "" ""
.TH "NPM\-CACHE" "1" "October 2021" "" ""
.SH "NAME"
\fBnpm-cache\fR \- Manipulates packages cache
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ci.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-CI" "1" "September 2021" "" ""
.TH "NPM\-CI" "1" "October 2021" "" ""
.SH "NAME"
\fBnpm-ci\fR \- Install a project with a clean slate
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-completion.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-COMPLETION" "1" "September 2021" "" ""
.TH "NPM\-COMPLETION" "1" "October 2021" "" ""
.SH "NAME"
\fBnpm-completion\fR \- Tab Completion for npm
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-config.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-CONFIG" "1" "September 2021" "" ""
.TH "NPM\-CONFIG" "1" "October 2021" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SS Synopsis
Expand Down
Loading