Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: upgrade npm to 8.5.0 #41925

Merged
merged 1 commit into from
Feb 11, 2022
Merged
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
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npm-exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,4 @@ project.
* [npm stop](/commands/npm-stop)
* [npm config](/commands/npm-config)
* [npm workspaces](/using-npm/workspaces)
* [npx](/commands/npx)
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npx.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,4 @@ This resulted in some shifts in its functionality:
* [npm restart](/commands/npm-restart)
* [npm stop](/commands/npm-stop)
* [npm config](/commands/npm-config)
* [npm exec](/commands/npm-exec)
2 changes: 1 addition & 1 deletion deps/npm/docs/content/using-npm/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ If a package would be saved at install time by the use of `--save`,
`--save-dev`, or `--save-optional`, then also put it in the
`bundleDependencies` list.

Ignore if `--save-peer` is set, since peerDependencies cannot be bundled.
Ignored if `--save-peer` is set, since peerDependencies cannot be bundled.

<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
Expand Down
1 change: 1 addition & 0 deletions deps/npm/docs/output/commands/npm-exec.html
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ <h3 id="see-also">See Also</h3>
<li><a href="../commands/npm-stop.html">npm stop</a></li>
<li><a href="../commands/npm-config.html">npm config</a></li>
<li><a href="../using-npm/workspaces.html">npm workspaces</a></li>
<li><a href="../commands/npx.html">npx</a></li>
</ul>
</div>

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 @@ -160,7 +160,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@8.4.1 /path/to/npm
<pre lang="bash"><code>npm@8.5.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 @@ -149,7 +149,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>8.4.1</p>
<p>8.5.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
1 change: 1 addition & 0 deletions deps/npm/docs/output/commands/npx.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ <h3 id="see-also">See Also</h3>
<li><a href="../commands/npm-restart.html">npm restart</a></li>
<li><a href="../commands/npm-stop.html">npm stop</a></li>
<li><a href="../commands/npm-config.html">npm config</a></li>
<li><a href="../commands/npm-exec.html">npm exec</a></li>
</ul>
</div>

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/using-npm/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ <h4 id="save-bundle"><code>save-bundle</code></h4>
<p>If a package would be saved at install time by the use of <code>--save</code>,
<code>--save-dev</code>, or <code>--save-optional</code>, then also put it in the
<code>bundleDependencies</code> list.</p>
<p>Ignore if <code>--save-peer</code> is set, since peerDependencies cannot be bundled.</p>
<p>Ignored if <code>--save-peer</code> is set, since peerDependencies cannot be bundled.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="save-dev"><code>save-dev</code></h4>
Expand Down
6 changes: 5 additions & 1 deletion deps/npm/lib/commands/org.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const liborg = require('libnpmorg')
const otplease = require('../utils/otplease.js')
const Table = require('cli-table3')
const BaseCommand = require('../base-command.js')
const log = require('../utils/log-shim.js')

class Org extends BaseCommand {
static description = 'Manage orgs'
Expand Down Expand Up @@ -32,7 +33,10 @@ class Org extends BaseCommand {
}

async exec ([cmd, orgname, username, role], cb) {
return otplease(this.npm.flatOptions, opts => {
return otplease({
...this.npm.flatOptions,
log,
}, opts => {
switch (cmd) {
case 'add':
case 'set':
Expand Down
17 changes: 2 additions & 15 deletions deps/npm/lib/commands/pack.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
const util = require('util')
const pacote = require('pacote')
const libpack = require('libnpmpack')
const npa = require('npm-package-arg')
const path = require('path')
const log = require('../utils/log-shim')
const { getContents, logTar } = require('../utils/tar.js')
const writeFile = util.promisify(require('fs').writeFile)
const BaseCommand = require('../base-command.js')

class Pack extends BaseCommand {
Expand All @@ -28,7 +25,6 @@ class Pack extends BaseCommand {
}

const unicode = this.npm.config.get('unicode')
const dryRun = this.npm.config.get('dry-run')
const json = this.npm.config.get('json')

// Get the manifests and filenames first so we can bail early on manifest
Expand All @@ -40,24 +36,15 @@ class Pack extends BaseCommand {
if (!manifest._id) {
throw new Error('Invalid package, must have name and version')
}

const filename = `${manifest.name}-${manifest.version}.tgz`
.replace(/^@/, '').replace(/\//, '-')
manifests.push({ arg, filename, manifest })
manifests.push({ arg, manifest })
}

// Load tarball names up for printing afterward to isolate from the
// noise generated during packing
const tarballs = []
for (const { arg, filename, manifest } of manifests) {
for (const { arg, manifest } of manifests) {
const tarballData = await libpack(arg, this.npm.flatOptions)
const pkgContents = await getContents(manifest, tarballData)
const tarballFilename = path.resolve(this.npm.config.get('pack-destination'), filename)

if (!dryRun) {
await writeFile(tarballFilename, tarballData)
}

tarballs.push(pkgContents)
}

Expand Down
3 changes: 2 additions & 1 deletion deps/npm/lib/commands/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ class Publish extends BaseCommand {
})
}

const tarballData = await pack(spec, opts)
// we pass dryRun: true to libnpmpack so it doesn't write the file to disk
const tarballData = await pack(spec, { ...opts, dryRun: true })
const pkgContents = await getContents(manifest, tarballData)

// The purpose of re-reading the manifest is in case it changed,
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/lib/commands/unpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Unpublish extends BaseCommand {
)
}

const opts = this.npm.flatOptions
const opts = { ...this.npm.flatOptions, log }
if (!spec || path.resolve(spec.name) === this.npm.localPrefix) {
// if there's a package.json in the current folder, then
// read the package name and version out of that.
Expand Down
5 changes: 3 additions & 2 deletions deps/npm/lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,7 @@ define('pack-destination', {
description: `
Directory in which \`npm pack\` will save tarballs.
`,
flatten,
})

define('parseable', {
Expand Down Expand Up @@ -1587,7 +1588,7 @@ define('save', {
default: true,
defaultDescription: `\`true\` unless when using \`npm update\` or
\`npm dedupe\` where it defaults to \`false\``,
usage: '-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer',
usage: '-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle',
type: Boolean,
short: 'S',
description: `
Expand All @@ -1610,7 +1611,7 @@ define('save-bundle', {
\`--save-dev\`, or \`--save-optional\`, then also put it in the
\`bundleDependencies\` list.

Ignore if \`--save-peer\` is set, since peerDependencies cannot be bundled.
Ignored if \`--save-peer\` is set, since peerDependencies cannot be bundled.
`,
flatten (key, obj, flatOptions) {
// XXX update arborist to just ignore it if resulting saveType is peer
Expand Down
2 changes: 2 additions & 0 deletions deps/npm/man/man1/npm-exec.1
Original file line number Diff line number Diff line change
Expand Up @@ -462,5 +462,7 @@ npm help stop
npm help config
.IP \(bu 2
npm help workspaces
.IP \(bu 2
npm help npx

.RE
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@8\.4\.1 /path/to/npm
npm@8\.5\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm.1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
8\.4\.1
8\.5\.0
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
Expand Down
2 changes: 2 additions & 0 deletions deps/npm/man/man1/npx.1
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,7 @@ npm help restart
npm help stop
.IP \(bu 2
npm help config
.IP \(bu 2
npm help exec

.RE
2 changes: 1 addition & 1 deletion deps/npm/man/man7/config.7
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ If a package would be saved at install time by the use of \fB\-\-save\fP,
\fB\-\-save\-dev\fP, or \fB\-\-save\-optional\fP, then also put it in the
\fBbundleDependencies\fP list\.
.P
Ignore if \fB\-\-save\-peer\fP is set, since peerDependencies cannot be bundled\.
Ignored if \fB\-\-save\-peer\fP is set, since peerDependencies cannot be bundled\.
<!\-\- automatically generated, do not edit manually \-\->
<!\-\- see lib/utils/config/definitions\.js \-\->

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deps/npm/node_modules/@npmcli/arborist/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions deps/npm/node_modules/@npmcli/config/lib/env-replace.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading