Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
Diffstat (limited to 'deps')
-rw-r--r--deps/npm/docs/content/using-npm/config.md2
-rw-r--r--deps/npm/docs/output/commands/npm-ls.html2
-rw-r--r--deps/npm/docs/output/commands/npm.html2
-rw-r--r--deps/npm/docs/output/using-npm/config.html2
-rw-r--r--deps/npm/lib/publish.js3
-rw-r--r--deps/npm/lib/utils/config/definitions.js6
-rw-r--r--deps/npm/man/man1/npm-ls.12
-rw-r--r--deps/npm/man/man1/npm.12
-rw-r--r--deps/npm/man/man7/config.72
-rw-r--r--deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js35
-rw-r--r--deps/npm/node_modules/@npmcli/arborist/package.json11
-rw-r--r--deps/npm/package.json4
-rw-r--r--deps/npm/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs2
-rw-r--r--deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs2
-rw-r--r--deps/npm/test/lib/utils/config/definitions.js9
15 files changed, 54 insertions, 32 deletions
diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md
index ddabe01d7d8..a5017e61db9 100644
--- a/deps/npm/docs/content/using-npm/config.md
+++ b/deps/npm/docs/content/using-npm/config.md
@@ -987,7 +987,7 @@ When passed to `npm config` this refers to which config file to use.
* Default: Version 2 if no lockfile or current lockfile version less than or
equal to 2, otherwise maintain current lockfile version
-* Type: null, 1, 2, or 3
+* Type: null, 1, 2, 3, "1", "2", or "3"
Set the lockfile format version to be used in package-lock.json and
npm-shrinkwrap-json files. Possible options are:
diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html
index d13c14c6e2f..398d46b6ac5 100644
--- a/deps/npm/docs/output/commands/npm-ls.html
+++ b/deps/npm/docs/output/commands/npm-ls.html
@@ -159,7 +159,7 @@ tree at all, use <a href="../commands/npm-explain.html"><code>npm explain</code>
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@8.1.1 /path/to/npm
+<pre lang="bash"><code>npm@8.1.2 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html
index 63f5416e597..3e42f7dfb73 100644
--- a/deps/npm/docs/output/commands/npm.html
+++ b/deps/npm/docs/output/commands/npm.html
@@ -148,7 +148,7 @@ npm command-line interface
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
-<p>8.1.1</p>
+<p>8.1.2</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
diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html
index 1f67ec7939b..dbdb6fcbc11 100644
--- a/deps/npm/docs/output/using-npm/config.html
+++ b/deps/npm/docs/output/using-npm/config.html
@@ -939,7 +939,7 @@ to “global”</li>
<ul>
<li>Default: Version 2 if no lockfile or current lockfile version less than or
equal to 2, otherwise maintain current lockfile version</li>
-<li>Type: null, 1, 2, or 3</li>
+<li>Type: null, 1, 2, 3, “1”, “2”, or “3”</li>
</ul>
<p>Set the lockfile format version to be used in package-lock.json and
npm-shrinkwrap-json files. Possible options are:</p>
diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js
index 32e70129f2c..5e064a34bc0 100644
--- a/deps/npm/lib/publish.js
+++ b/deps/npm/lib/publish.js
@@ -8,6 +8,7 @@ const pacote = require('pacote')
const npa = require('npm-package-arg')
const npmFetch = require('npm-registry-fetch')
const chalk = require('chalk')
+const replaceInfo = require('./utils/replace-info.js')
const otplease = require('./utils/otplease.js')
const { getContents, logTar } = require('./utils/tar.js')
@@ -68,7 +69,7 @@ class Publish extends BaseCommand {
if (args.length !== 1)
throw this.usageError()
- log.verbose('publish', args)
+ log.verbose('publish', replaceInfo(args))
const unicode = this.npm.config.get('unicode')
const dryRun = this.npm.config.get('dry-run')
diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js
index c9806b3c289..a725ee0fa1d 100644
--- a/deps/npm/lib/utils/config/definitions.js
+++ b/deps/npm/lib/utils/config/definitions.js
@@ -1157,7 +1157,7 @@ define('location', {
define('lockfile-version', {
default: null,
- type: [null, 1, 2, 3],
+ type: [null, 1, 2, 3, '1', '2', '3'],
defaultDescription: `
Version 2 if no lockfile or current lockfile version less than or equal to
2, otherwise maintain current lockfile version
@@ -1179,7 +1179,9 @@ define('lockfile-version', {
on disk than lockfile version 2, but not interoperable with older npm
versions. Ideal if all users are on npm version 7 and higher.
`,
- flatten,
+ flatten: (key, obj, flatOptions) => {
+ flatOptions.lockfileVersion = obj[key] && parseInt(obj[key], 10)
+ },
})
define('loglevel', {
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index 6e6a5482fdb..99609df8d79 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
-npm@8\.1\.1 /path/to/npm
+npm@8\.1\.2 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index 108b97fd78b..eb30baef3eb 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
-8\.1\.1
+8\.1\.2
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7
index 1cd82ea02b5..98fbf2060ec 100644
--- a/deps/npm/man/man7/config.7
+++ b/deps/npm/man/man7/config.7
@@ -1254,7 +1254,7 @@ When passed to \fBnpm config\fP this refers to which config file to use\.
Default: Version 2 if no lockfile or current lockfile version less than or
equal to 2, otherwise maintain current lockfile version
.IP \(bu 2
-Type: null, 1, 2, or 3
+Type: null, 1, 2, 3, "1", "2", or "3"
.RE
.P
diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
index 93e1cb1a45c..e7dd435ca34 100644
--- a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
+++ b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
@@ -238,21 +238,31 @@ class Shrinkwrap {
return swKeyOrder
}
- static reset (options) {
+ static async reset (options) {
// still need to know if it was loaded from the disk, but don't
// bother reading it if we're gonna just throw it away.
const s = new Shrinkwrap(options)
s.reset()
- return s[_maybeStat]().then(([sw, lock]) => {
- s.filename = resolve(s.path,
- (s.hiddenLockfile ? 'node_modules/.package-lock'
- : s.shrinkwrapOnly || sw ? 'npm-shrinkwrap'
- : 'package-lock') + '.json')
- s.loadedFromDisk = !!(sw || lock)
- s.type = basename(s.filename)
- return s
- })
+ const [sw, lock] = await s[_maybeStat]()
+
+ s.filename = resolve(s.path,
+ (s.hiddenLockfile ? 'node_modules/.package-lock'
+ : s.shrinkwrapOnly || sw ? 'npm-shrinkwrap'
+ : 'package-lock') + '.json')
+ s.loadedFromDisk = !!(sw || lock)
+ s.type = basename(s.filename)
+
+ try {
+ if (s.loadedFromDisk && !s.lockfileVersion) {
+ const json = parseJSON(await maybeReadFile(s.filename))
+ if (json.lockfileVersion > defaultLockfileVersion) {
+ s.lockfileVersion = json.lockfileVersion
+ }
+ }
+ } catch (e) {}
+
+ return s
}
static metaFromNode (node, path) {
@@ -380,9 +390,10 @@ class Shrinkwrap {
reset () {
this.tree = null
this[_awaitingUpdate] = new Map()
- this.originalLockfileVersion = this.lockfileVersion
+ const lockfileVersion = this.lockfileVersion || defaultLockfileVersion
+ this.originalLockfileVersion = lockfileVersion
this.data = {
- lockfileVersion: this.lockfileVersion || defaultLockfileVersion,
+ lockfileVersion,
requires: true,
packages: {},
dependencies: {},
diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json
index 1954be5b3d7..cfa74a805b1 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": "4.0.2",
+ "version": "4.0.3",
"description": "Manage node_modules trees",
"dependencies": {
"@isaacs/string-locale-compare": "^1.0.1",
@@ -45,11 +45,10 @@
"tcompare": "^5.0.6"
},
"scripts": {
- "test": "npm run test-only --",
- "test-only": "tap",
- "posttest": "npm run lint --",
+ "test": "tap",
+ "posttest": "npm run lint",
"snap": "tap",
- "postsnap": "npm run lintfix --",
+ "postsnap": "npm run lintfix",
"test-proxy": "ARBORIST_TEST_PROXY=1 tap --snapshot",
"preversion": "npm test",
"postversion": "npm publish",
@@ -88,7 +87,7 @@
"--no-warnings",
"--no-deprecation"
],
- "timeout": "240"
+ "timeout": "360"
},
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16"
diff --git a/deps/npm/package.json b/deps/npm/package.json
index b92ca93f613..cb8b46e8a48 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -1,5 +1,5 @@
{
- "version": "8.1.1",
+ "version": "8.1.2",
"name": "npm",
"description": "a package manager for JavaScript",
"workspaces": [
@@ -55,7 +55,7 @@
},
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
- "@npmcli/arborist": "^4.0.2",
+ "@npmcli/arborist": "^4.0.3",
"@npmcli/ci-detect": "^1.4.0",
"@npmcli/config": "^2.3.0",
"@npmcli/map-workspaces": "^2.0.0",
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 aaf59e6a2be..8c85225f2f9 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
@@ -1061,7 +1061,7 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for lockf
* Default: Version 2 if no lockfile or current lockfile version less than or
equal to 2, otherwise maintain current lockfile version
-* Type: null, 1, 2, or 3
+* Type: null, 1, 2, 3, "1", "2", or "3"
Set the lockfile format version to be used in package-lock.json and
npm-shrinkwrap-json files. Possible options are:
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 dc55893d00b..1ebb336092e 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
@@ -861,7 +861,7 @@ When passed to \`npm config\` this refers to which config file to use.
* Default: Version 2 if no lockfile or current lockfile version less than or
equal to 2, otherwise maintain current lockfile version
-* Type: null, 1, 2, or 3
+* Type: null, 1, 2, 3, "1", "2", or "3"
Set the lockfile format version to be used in package-lock.json and
npm-shrinkwrap-json files. Possible options are:
diff --git a/deps/npm/test/lib/utils/config/definitions.js b/deps/npm/test/lib/utils/config/definitions.js
index 622e603bc75..15b43715f45 100644
--- a/deps/npm/test/lib/utils/config/definitions.js
+++ b/deps/npm/test/lib/utils/config/definitions.js
@@ -892,3 +892,12 @@ t.test('workspaces derived', t => {
t.equal(flat.workspacesEnabled, false)
t.end()
})
+
+t.test('lockfile version', t => {
+ const flat = {}
+ definitions['lockfile-version'].flatten('lockfile-version', {
+ 'lockfile-version': '3',
+ }, flat)
+ t.match(flat.lockfileVersion, 3, 'flattens to a number')
+ t.end()
+})