Closed
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
2 changes: 2 additions & 0 deletions deps/npm/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -765,3 +765,5 @@ Jan Sepke <625043+jansepke@users.noreply.github.com>
Augusto Moura <augusto.borgesm@gmail.com>
Eric Chow <eric.zjp.chow@gmail.com>
kbayrhammer <klaus.bayrhammer@redbull.com>
James Chen-Smith <jameschensmith@gmail.com>
Yash Singh <saiansh2525@gmail.com>
77 changes: 77 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
## v7.7.4 (2021-03-24)

### BUG FIXES

* [`200bee74b`](https://github.com/npm/cli/commit/200bee74b31a738687446b7b535cac67b1c582fd)
[#2951](https://github.com/npm/cli/issues/2951)
fix(config): accept explicit `production=false`
([@wraithgar](https://github.com/wraithgar))
* [`7b45e9df6`](https://github.com/npm/cli/commit/7b45e9df6102c7bd6e403d1fdc9939581c38f546)
[#2950](https://github.com/npm/cli/issues/2950)
warn if using workspaces config options in `npm config`
([@ruyadorno](https://github.com/ruyadorno))

## v7.7.3 (2021-03-24)

### BUG FIXES

* [`c76f04ac2`](https://github.com/npm/cli/commit/c76f04ac28ddf2ae4df4b3ce0aec684a118de1b5)
[#2925](https://github.com/npm/cli/issues/2925)
fix(set-script): add completion
([@Yash-Singh1](https://github.com/Yash-Singh1))
* [`0379eab69`](https://github.com/npm/cli/commit/0379eab698b78ae4aa89bbe2043607f420e52f11)
[#2929](https://github.com/npm/cli/issues/2929)
fix(install): ignore auditLevel
`npm install` should not be affected by the `auditLevel` config, as the
results of audit do not change its exit status.
([@wraithgar](https://github.com/wraithgar))
* [`98efadeb4`](https://github.com/npm/cli/commit/98efadeb4b2ae9289f14ed6f42a169230faf7239)
[#2923](https://github.com/npm/cli/issues/2923)
fix(audit-level): add `info` audit level
This is a valid level but wasn't configured to be allowed.
Also added this param to the usage output for `npm audit`
([@wraithgar](https://github.com/wraithgar))
* [`e8d2adcf4`](https://github.com/npm/cli/commit/e8d2adcf40ad63030f844c9aa44c6d16e2146797)
[#2945](https://github.com/npm/cli/issues/2945)
config should not error when workspaces are configured
([@nlf](https://github.com/nlf))
* [`aba2bc623`](https://github.com/npm/cli/commit/aba2bc623ea99e563b1b15b81dbb4ba94f86fe4c)
[#2944](https://github.com/npm/cli/issues/2944)
fix(progress): re-add progress bar to reify
The logger was no longer in flatOptions, we pass it in explicitly now
([@wraithgar](https://github.com/wraithgar))
* [`877b4ed29`](https://github.com/npm/cli/commit/877b4ed2925c97b5249a4d33575420dda64f7339)
[#2946](https://github.com/npm/cli/issues/2946)
fix(flatOptions): re-add `_auth`
This was not being added to flatOptions, and things like
`npm-registry-fetch` are looking for it.
([@wraithgar](https://github.com/wraithgar))

## v7.7.2 (2021-03-24)

### BUG FIXES
* [`a4df2b98d`](https://github.com/npm/cli/commit/a4df2b98d89429b19cd29b5fc895cdbfc0a6bd78)
[#2942](https://github.com/npm/cli/issues/2942)
Restore --dev flag, unify --omit flatteners
([@isaacs](https://github.com/isaacs))

### DEPENDENCIES
* [`2cbfaac0e`](https://github.com/npm/cli/commit/2cbfaac0ecd5810316f6d76168ed9618bd11bf3a)
`hosted-git-info@4.0.2`
* [#83](https://github.com/npm/hosted-git-info/pull/83) Do not parse
urls for gitlab
([@nlf](https://github.com/nlf))

## v7.7.1 (2021-03-24)

### BUG FIXES

* [`543b0e39b`](https://github.com/npm/cli/commit/543b0e39bcb94fc408804b01ca9c0d7b960b2681)
[#2930](https://github.com/npm/cli/issues/2930)
fix(uninstall): use correct local prefix
([@jameschensmith](https://github.com/jameschensmith))
* [`dce4960ef`](https://github.com/npm/cli/commit/dce4960ef6d52af128affe7755b2ca72de913b6c)
[#2932](https://github.com/npm/cli/issues/2932)
fix(config): flatten savePrefix properly
([@wraithgar](https://github.com/wraithgar))

## v7.7.0 (2021-03-23)

### FEATURES
Expand Down
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npm-find-dupes.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,3 +21,4 @@ duplications, without actually changing the package tree.
* [npm ls](/cli-commands/ls)
* [npm update](/cli-commands/update)
* [npm install](/cli-commands/install)

14 changes: 11 additions & 3 deletions deps/npm/docs/content/using-npm/config.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`

* Default: null
* Type: "low", "moderate", "high", "critical", "none", or null
* Type: "info", "low", "moderate", "high", "critical", "none", or null

The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
Expand DownExpand Up@@ -1382,6 +1382,14 @@ What authentication strategy to use with `adduser`/`login`.

`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.

#### `dev`

* Default: false
* Type: Boolean
* DEPRECATED: Please use --include=dev instead.

Alias for `--include=dev`.

#### `init.author.email`

* Default: ""
Expand DownExpand Up@@ -1451,8 +1459,8 @@ Alias for --include=optional or --omit=optional

#### `production`

* Default: false
* Type: Boolean
* Default: null
* Type: null or Boolean
* DEPRECATED: Use `--omit=dev` instead.

Alias for `--omit=dev`
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff 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.7.0 /path/to/npm
<pre lang="bash"><code>npm@7.7.4 /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 numberDiff line numberDiff 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.7.0</p>
<p>7.7.4</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
15 changes: 11 additions & 4 deletions deps/npm/docs/output/using-npm/config.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deps/npm/lib/audit.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,7 @@ class Audit extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
staticgetparams(){
return[
'audit-level',
'dry-run',
'force',
'json',
Expand Down
11 changes: 8 additions & 3 deletions deps/npm/lib/ci.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,8 +42,14 @@ class CI extends BaseCommand {
}

const where = this.npm.prefix
const arb = new Arborist({ ...this.npm.flatOptions, path: where })
const opts = {
...this.npm.flatOptions,
path: where,
log: this.npm.log,
save: false, // npm ci should never modify the lockfile or package.json
}

const arb = new Arborist(opts)
await Promise.all([
arb.loadVirtual().catch(er => {
log.verbose('loadVirtual', er.stack)
Expand All@@ -55,8 +61,7 @@ class CI extends BaseCommand {
}),
removeNodeModules(where),
])
// npm ci should never modify the lockfile or package.json
await arb.reify({ ...this.npm.flatOptions, save: false })
await arb.reify(opts)

const ignoreScripts = this.npm.config.get('ignore-scripts')
// run the same set of scripts that `npm install` runs.
Expand Down
5 changes: 5 additions & 0 deletions deps/npm/lib/config.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,11 @@ class Config extends BaseCommand {
this.config(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.npm.log.warn('config', 'This command does not support workspaces.')
this.exec(args, cb)
}

async config ([action, ...args]) {
this.npm.log.disableProgress()
try {
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/dedupe.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,6 +30,7 @@ class Dedupe extends BaseCommand {
const where = this.npm.prefix
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
path: where,
dryRun,
}
Expand Down
12 changes: 10 additions & 2 deletions deps/npm/lib/exec.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -175,7 +175,11 @@ class Exec extends BaseCommand {
if (needInstall) {
const installDir = this.cacheInstallDir(packages)
await mkdirp(installDir)
const arb = new Arborist({ ...this.npm.flatOptions, path: installDir })
const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: installDir,
})
const tree = await arb.loadActual()

// at this point, we have to ensure that we get the exact same
Expand DownExpand Up@@ -212,7 +216,11 @@ class Exec extends BaseCommand {
throw new Error('canceled')
}
}
await arb.reify({ ...this.npm.flatOptions, add })
await arb.reify({
...this.npm.flatOptions,
log: this.npm.log,
add,
})
}
pathArr.unshift(resolve(installDir, 'node_modules/.bin'))
}
Expand Down
13 changes: 7 additions & 6 deletions deps/npm/lib/install.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -126,15 +126,16 @@ class Install extends BaseCommand {
if (this.npm.config.get('dev'))
log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.')

const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
auditLevel: null,
path: where,
})

await arb.reify({
...this.npm.flatOptions,
add: args,
})
}
const arb = new Arborist(opts)
await arb.reify(opts)

if (!args.length && !isGlobalInstall && !ignoreScripts) {
const scriptShell = this.npm.config.get('script-shell') || undefined
const scripts = [
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/lib/link.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,6 +66,7 @@ class Link extends BaseCommand {
const globalOpts = {
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
prune: false,
}
Expand DownExpand Up@@ -113,12 +114,14 @@ class Link extends BaseCommand {
// reify all the pending names as symlinks there
const localArb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: this.npm.prefix,
save,
})
await localArb.reify({
...this.npm.flatOptions,
path: this.npm.prefix,
log: this.npm.log,
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
save,
})
Expand All@@ -131,9 +134,13 @@ class Link extends BaseCommand {
const arb = new Arborist({
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
})
await arb.reify({ add: [`file:${this.npm.prefix}`] })
await arb.reify({
add: [`file:${this.npm.prefix}`],
log: this.npm.log,
})
await reifyFinish(this.npm, arb)
}

Expand Down
8 changes: 5 additions & 3 deletions deps/npm/lib/prune.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,11 +30,13 @@ class Prune extends BaseCommand {

async prune () {
const where = this.npm.prefix
const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
path: where,
})
await arb.prune(this.npm.flatOptions)
log: this.npm.log,
}
const arb = new Arborist(opts)
await arb.prune(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
11 changes: 11 additions & 0 deletions deps/npm/lib/set-script.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ const log = require('npmlog')
const fs = require('fs')
const parseJSON = require('json-parse-even-better-errors')
const rpj = require('read-package-json-fast')
const { resolve } = require('path')

const BaseCommand = require('./base-command.js')
class SetScript extends BaseCommand {
Expand All@@ -20,6 +21,16 @@ class SetScript extends BaseCommand {
return ['[<script>] [<command>]']
}

async completion (opts) {
const argv = opts.conf.argv.remain
if (argv.length === 2) {
// find the script name
const json = resolve(this.npm.localPrefix, 'package.json')
const { scripts = {} } = await rpj(json).catch(er => ({}))
return Object.keys(scripts)
}
}

exec (args, cb) {
this.set(args).then(() => cb()).catch(cb)
}
Expand Down
16 changes: 10 additions & 6 deletions deps/npm/lib/uninstall.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,8 +38,9 @@ class Uninstall extends BaseCommand {
async uninstall (args) {
// the /path/to/node_modules/..
const global = this.npm.config.get('global')
const prefix = this.npm.config.get('prefix')
const path = global ? resolve(this.npm.globalDir, '..') : prefix
const path = global
? resolve(this.npm.globalDir, '..')
: this.npm.localPrefix

if (!args.length) {
if (!global)
Expand All@@ -60,12 +61,15 @@ class Uninstall extends BaseCommand {
}
}

const arb = new Arborist({ ...this.npm.flatOptions, path })

await arb.reify({
const opts = {
...this.npm.flatOptions,
path,
log: this.npm.log,
rm: args,
})

}
const arb = new Arborist(opts)
await arb.reify(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/update.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,7 @@ class Update extends BaseCommand {

const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: where,
})

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Closed
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
2 changes: 2 additions & 0 deletions deps/npm/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -765,3 +765,5 @@ Jan Sepke <625043+jansepke@users.noreply.github.com>
Augusto Moura <augusto.borgesm@gmail.com>
Eric Chow <eric.zjp.chow@gmail.com>
kbayrhammer <klaus.bayrhammer@redbull.com>
James Chen-Smith <jameschensmith@gmail.com>
Yash Singh <saiansh2525@gmail.com>
77 changes: 77 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
## v7.7.4 (2021-03-24)

### BUG FIXES

* [`200bee74b`](https://github.com/npm/cli/commit/200bee74b31a738687446b7b535cac67b1c582fd)
[#2951](https://github.com/npm/cli/issues/2951)
fix(config): accept explicit `production=false`
([@wraithgar](https://github.com/wraithgar))
* [`7b45e9df6`](https://github.com/npm/cli/commit/7b45e9df6102c7bd6e403d1fdc9939581c38f546)
[#2950](https://github.com/npm/cli/issues/2950)
warn if using workspaces config options in `npm config`
([@ruyadorno](https://github.com/ruyadorno))

## v7.7.3 (2021-03-24)

### BUG FIXES

* [`c76f04ac2`](https://github.com/npm/cli/commit/c76f04ac28ddf2ae4df4b3ce0aec684a118de1b5)
[#2925](https://github.com/npm/cli/issues/2925)
fix(set-script): add completion
([@Yash-Singh1](https://github.com/Yash-Singh1))
* [`0379eab69`](https://github.com/npm/cli/commit/0379eab698b78ae4aa89bbe2043607f420e52f11)
[#2929](https://github.com/npm/cli/issues/2929)
fix(install): ignore auditLevel
`npm install` should not be affected by the `auditLevel` config, as the
results of audit do not change its exit status.
([@wraithgar](https://github.com/wraithgar))
* [`98efadeb4`](https://github.com/npm/cli/commit/98efadeb4b2ae9289f14ed6f42a169230faf7239)
[#2923](https://github.com/npm/cli/issues/2923)
fix(audit-level): add `info` audit level
This is a valid level but wasn't configured to be allowed.
Also added this param to the usage output for `npm audit`
([@wraithgar](https://github.com/wraithgar))
* [`e8d2adcf4`](https://github.com/npm/cli/commit/e8d2adcf40ad63030f844c9aa44c6d16e2146797)
[#2945](https://github.com/npm/cli/issues/2945)
config should not error when workspaces are configured
([@nlf](https://github.com/nlf))
* [`aba2bc623`](https://github.com/npm/cli/commit/aba2bc623ea99e563b1b15b81dbb4ba94f86fe4c)
[#2944](https://github.com/npm/cli/issues/2944)
fix(progress): re-add progress bar to reify
The logger was no longer in flatOptions, we pass it in explicitly now
([@wraithgar](https://github.com/wraithgar))
* [`877b4ed29`](https://github.com/npm/cli/commit/877b4ed2925c97b5249a4d33575420dda64f7339)
[#2946](https://github.com/npm/cli/issues/2946)
fix(flatOptions): re-add `_auth`
This was not being added to flatOptions, and things like
`npm-registry-fetch` are looking for it.
([@wraithgar](https://github.com/wraithgar))

## v7.7.2 (2021-03-24)

### BUG FIXES
* [`a4df2b98d`](https://github.com/npm/cli/commit/a4df2b98d89429b19cd29b5fc895cdbfc0a6bd78)
[#2942](https://github.com/npm/cli/issues/2942)
Restore --dev flag, unify --omit flatteners
([@isaacs](https://github.com/isaacs))

### DEPENDENCIES
* [`2cbfaac0e`](https://github.com/npm/cli/commit/2cbfaac0ecd5810316f6d76168ed9618bd11bf3a)
`hosted-git-info@4.0.2`
* [#83](https://github.com/npm/hosted-git-info/pull/83) Do not parse
urls for gitlab
([@nlf](https://github.com/nlf))

## v7.7.1 (2021-03-24)

### BUG FIXES

* [`543b0e39b`](https://github.com/npm/cli/commit/543b0e39bcb94fc408804b01ca9c0d7b960b2681)
[#2930](https://github.com/npm/cli/issues/2930)
fix(uninstall): use correct local prefix
([@jameschensmith](https://github.com/jameschensmith))
* [`dce4960ef`](https://github.com/npm/cli/commit/dce4960ef6d52af128affe7755b2ca72de913b6c)
[#2932](https://github.com/npm/cli/issues/2932)
fix(config): flatten savePrefix properly
([@wraithgar](https://github.com/wraithgar))

## v7.7.0 (2021-03-23)

### FEATURES
Expand Down
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npm-find-dupes.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,3 +21,4 @@ duplications, without actually changing the package tree.
* [npm ls](/cli-commands/ls)
* [npm update](/cli-commands/update)
* [npm install](/cli-commands/install)

14 changes: 11 additions & 3 deletions deps/npm/docs/content/using-npm/config.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`

* Default: null
* Type: "low", "moderate", "high", "critical", "none", or null
* Type: "info", "low", "moderate", "high", "critical", "none", or null

The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
Expand DownExpand Up@@ -1382,6 +1382,14 @@ What authentication strategy to use with `adduser`/`login`.

`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.

#### `dev`

* Default: false
* Type: Boolean
* DEPRECATED: Please use --include=dev instead.

Alias for `--include=dev`.

#### `init.author.email`

* Default: ""
Expand DownExpand Up@@ -1451,8 +1459,8 @@ Alias for --include=optional or --omit=optional

#### `production`

* Default: false
* Type: Boolean
* Default: null
* Type: null or Boolean
* DEPRECATED: Use `--omit=dev` instead.

Alias for `--omit=dev`
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff 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.7.0 /path/to/npm
<pre lang="bash"><code>npm@7.7.4 /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 numberDiff line numberDiff 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.7.0</p>
<p>7.7.4</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
15 changes: 11 additions & 4 deletions deps/npm/docs/output/using-npm/config.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deps/npm/lib/audit.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,7 @@ class Audit extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
staticgetparams(){
return[
'audit-level',
'dry-run',
'force',
'json',
Expand Down
11 changes: 8 additions & 3 deletions deps/npm/lib/ci.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,8 +42,14 @@ class CI extends BaseCommand {
}

const where = this.npm.prefix
const arb = new Arborist({ ...this.npm.flatOptions, path: where })
const opts = {
...this.npm.flatOptions,
path: where,
log: this.npm.log,
save: false, // npm ci should never modify the lockfile or package.json
}

const arb = new Arborist(opts)
await Promise.all([
arb.loadVirtual().catch(er => {
log.verbose('loadVirtual', er.stack)
Expand All@@ -55,8 +61,7 @@ class CI extends BaseCommand {
}),
removeNodeModules(where),
])
// npm ci should never modify the lockfile or package.json
await arb.reify({ ...this.npm.flatOptions, save: false })
await arb.reify(opts)

const ignoreScripts = this.npm.config.get('ignore-scripts')
// run the same set of scripts that `npm install` runs.
Expand Down
5 changes: 5 additions & 0 deletions deps/npm/lib/config.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,11 @@ class Config extends BaseCommand {
this.config(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.npm.log.warn('config', 'This command does not support workspaces.')
this.exec(args, cb)
}

async config ([action, ...args]) {
this.npm.log.disableProgress()
try {
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/dedupe.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,6 +30,7 @@ class Dedupe extends BaseCommand {
const where = this.npm.prefix
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
path: where,
dryRun,
}
Expand Down
12 changes: 10 additions & 2 deletions deps/npm/lib/exec.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -175,7 +175,11 @@ class Exec extends BaseCommand {
if (needInstall) {
const installDir = this.cacheInstallDir(packages)
await mkdirp(installDir)
const arb = new Arborist({ ...this.npm.flatOptions, path: installDir })
const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: installDir,
})
const tree = await arb.loadActual()

// at this point, we have to ensure that we get the exact same
Expand DownExpand Up@@ -212,7 +216,11 @@ class Exec extends BaseCommand {
throw new Error('canceled')
}
}
await arb.reify({ ...this.npm.flatOptions, add })
await arb.reify({
...this.npm.flatOptions,
log: this.npm.log,
add,
})
}
pathArr.unshift(resolve(installDir, 'node_modules/.bin'))
}
Expand Down
13 changes: 7 additions & 6 deletions deps/npm/lib/install.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -126,15 +126,16 @@ class Install extends BaseCommand {
if (this.npm.config.get('dev'))
log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.')

const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
auditLevel: null,
path: where,
})

await arb.reify({
...this.npm.flatOptions,
add: args,
})
}
const arb = new Arborist(opts)
await arb.reify(opts)

if (!args.length && !isGlobalInstall && !ignoreScripts) {
const scriptShell = this.npm.config.get('script-shell') || undefined
const scripts = [
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/lib/link.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,6 +66,7 @@ class Link extends BaseCommand {
const globalOpts = {
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
prune: false,
}
Expand DownExpand Up@@ -113,12 +114,14 @@ class Link extends BaseCommand {
// reify all the pending names as symlinks there
const localArb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: this.npm.prefix,
save,
})
await localArb.reify({
...this.npm.flatOptions,
path: this.npm.prefix,
log: this.npm.log,
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
save,
})
Expand All@@ -131,9 +134,13 @@ class Link extends BaseCommand {
const arb = new Arborist({
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
})
await arb.reify({ add: [`file:${this.npm.prefix}`] })
await arb.reify({
add: [`file:${this.npm.prefix}`],
log: this.npm.log,
})
await reifyFinish(this.npm, arb)
}

Expand Down
8 changes: 5 additions & 3 deletions deps/npm/lib/prune.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,11 +30,13 @@ class Prune extends BaseCommand {

async prune () {
const where = this.npm.prefix
const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
path: where,
})
await arb.prune(this.npm.flatOptions)
log: this.npm.log,
}
const arb = new Arborist(opts)
await arb.prune(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
11 changes: 11 additions & 0 deletions deps/npm/lib/set-script.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ const log = require('npmlog')
const fs = require('fs')
const parseJSON = require('json-parse-even-better-errors')
const rpj = require('read-package-json-fast')
const { resolve } = require('path')

const BaseCommand = require('./base-command.js')
class SetScript extends BaseCommand {
Expand All@@ -20,6 +21,16 @@ class SetScript extends BaseCommand {
return ['[<script>] [<command>]']
}

async completion (opts) {
const argv = opts.conf.argv.remain
if (argv.length === 2) {
// find the script name
const json = resolve(this.npm.localPrefix, 'package.json')
const { scripts = {} } = await rpj(json).catch(er => ({}))
return Object.keys(scripts)
}
}

exec (args, cb) {
this.set(args).then(() => cb()).catch(cb)
}
Expand Down
16 changes: 10 additions & 6 deletions deps/npm/lib/uninstall.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,8 +38,9 @@ class Uninstall extends BaseCommand {
async uninstall (args) {
// the /path/to/node_modules/..
const global = this.npm.config.get('global')
const prefix = this.npm.config.get('prefix')
const path = global ? resolve(this.npm.globalDir, '..') : prefix
const path = global
? resolve(this.npm.globalDir, '..')
: this.npm.localPrefix

if (!args.length) {
if (!global)
Expand All@@ -60,12 +61,15 @@ class Uninstall extends BaseCommand {
}
}

const arb = new Arborist({ ...this.npm.flatOptions, path })

await arb.reify({
const opts = {
...this.npm.flatOptions,
path,
log: this.npm.log,
rm: args,
})

}
const arb = new Arborist(opts)
await arb.reify(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/update.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,7 @@ class Update extends BaseCommand {

const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: where,
})

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Closed
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
2 changes: 2 additions & 0 deletions deps/npm/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -765,3 +765,5 @@ Jan Sepke <625043+jansepke@users.noreply.github.com>
Augusto Moura <augusto.borgesm@gmail.com>
Eric Chow <eric.zjp.chow@gmail.com>
kbayrhammer <klaus.bayrhammer@redbull.com>
James Chen-Smith <jameschensmith@gmail.com>
Yash Singh <saiansh2525@gmail.com>
77 changes: 77 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
## v7.7.4 (2021-03-24)

### BUG FIXES

* [`200bee74b`](https://github.com/npm/cli/commit/200bee74b31a738687446b7b535cac67b1c582fd)
[#2951](https://github.com/npm/cli/issues/2951)
fix(config): accept explicit `production=false`
([@wraithgar](https://github.com/wraithgar))
* [`7b45e9df6`](https://github.com/npm/cli/commit/7b45e9df6102c7bd6e403d1fdc9939581c38f546)
[#2950](https://github.com/npm/cli/issues/2950)
warn if using workspaces config options in `npm config`
([@ruyadorno](https://github.com/ruyadorno))

## v7.7.3 (2021-03-24)

### BUG FIXES

* [`c76f04ac2`](https://github.com/npm/cli/commit/c76f04ac28ddf2ae4df4b3ce0aec684a118de1b5)
[#2925](https://github.com/npm/cli/issues/2925)
fix(set-script): add completion
([@Yash-Singh1](https://github.com/Yash-Singh1))
* [`0379eab69`](https://github.com/npm/cli/commit/0379eab698b78ae4aa89bbe2043607f420e52f11)
[#2929](https://github.com/npm/cli/issues/2929)
fix(install): ignore auditLevel
`npm install` should not be affected by the `auditLevel` config, as the
results of audit do not change its exit status.
([@wraithgar](https://github.com/wraithgar))
* [`98efadeb4`](https://github.com/npm/cli/commit/98efadeb4b2ae9289f14ed6f42a169230faf7239)
[#2923](https://github.com/npm/cli/issues/2923)
fix(audit-level): add `info` audit level
This is a valid level but wasn't configured to be allowed.
Also added this param to the usage output for `npm audit`
([@wraithgar](https://github.com/wraithgar))
* [`e8d2adcf4`](https://github.com/npm/cli/commit/e8d2adcf40ad63030f844c9aa44c6d16e2146797)
[#2945](https://github.com/npm/cli/issues/2945)
config should not error when workspaces are configured
([@nlf](https://github.com/nlf))
* [`aba2bc623`](https://github.com/npm/cli/commit/aba2bc623ea99e563b1b15b81dbb4ba94f86fe4c)
[#2944](https://github.com/npm/cli/issues/2944)
fix(progress): re-add progress bar to reify
The logger was no longer in flatOptions, we pass it in explicitly now
([@wraithgar](https://github.com/wraithgar))
* [`877b4ed29`](https://github.com/npm/cli/commit/877b4ed2925c97b5249a4d33575420dda64f7339)
[#2946](https://github.com/npm/cli/issues/2946)
fix(flatOptions): re-add `_auth`
This was not being added to flatOptions, and things like
`npm-registry-fetch` are looking for it.
([@wraithgar](https://github.com/wraithgar))

## v7.7.2 (2021-03-24)

### BUG FIXES
* [`a4df2b98d`](https://github.com/npm/cli/commit/a4df2b98d89429b19cd29b5fc895cdbfc0a6bd78)
[#2942](https://github.com/npm/cli/issues/2942)
Restore --dev flag, unify --omit flatteners
([@isaacs](https://github.com/isaacs))

### DEPENDENCIES
* [`2cbfaac0e`](https://github.com/npm/cli/commit/2cbfaac0ecd5810316f6d76168ed9618bd11bf3a)
`hosted-git-info@4.0.2`
* [#83](https://github.com/npm/hosted-git-info/pull/83) Do not parse
urls for gitlab
([@nlf](https://github.com/nlf))

## v7.7.1 (2021-03-24)

### BUG FIXES

* [`543b0e39b`](https://github.com/npm/cli/commit/543b0e39bcb94fc408804b01ca9c0d7b960b2681)
[#2930](https://github.com/npm/cli/issues/2930)
fix(uninstall): use correct local prefix
([@jameschensmith](https://github.com/jameschensmith))
* [`dce4960ef`](https://github.com/npm/cli/commit/dce4960ef6d52af128affe7755b2ca72de913b6c)
[#2932](https://github.com/npm/cli/issues/2932)
fix(config): flatten savePrefix properly
([@wraithgar](https://github.com/wraithgar))

## v7.7.0 (2021-03-23)

### FEATURES
Expand Down
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npm-find-dupes.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,3 +21,4 @@ duplications, without actually changing the package tree.
* [npm ls](/cli-commands/ls)
* [npm update](/cli-commands/update)
* [npm install](/cli-commands/install)

14 changes: 11 additions & 3 deletions deps/npm/docs/content/using-npm/config.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`

* Default: null
* Type: "low", "moderate", "high", "critical", "none", or null
* Type: "info", "low", "moderate", "high", "critical", "none", or null

The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
Expand DownExpand Up@@ -1382,6 +1382,14 @@ What authentication strategy to use with `adduser`/`login`.

`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.

#### `dev`

* Default: false
* Type: Boolean
* DEPRECATED: Please use --include=dev instead.

Alias for `--include=dev`.

#### `init.author.email`

* Default: ""
Expand DownExpand Up@@ -1451,8 +1459,8 @@ Alias for --include=optional or --omit=optional

#### `production`

* Default: false
* Type: Boolean
* Default: null
* Type: null or Boolean
* DEPRECATED: Use `--omit=dev` instead.

Alias for `--omit=dev`
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff 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.7.0 /path/to/npm
<pre lang="bash"><code>npm@7.7.4 /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 numberDiff line numberDiff 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.7.0</p>
<p>7.7.4</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
15 changes: 11 additions & 4 deletions deps/npm/docs/output/using-npm/config.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deps/npm/lib/audit.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,7 @@ class Audit extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
staticgetparams(){
return[
'audit-level',
'dry-run',
'force',
'json',
Expand Down
11 changes: 8 additions & 3 deletions deps/npm/lib/ci.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,8 +42,14 @@ class CI extends BaseCommand {
}

const where = this.npm.prefix
const arb = new Arborist({ ...this.npm.flatOptions, path: where })
const opts = {
...this.npm.flatOptions,
path: where,
log: this.npm.log,
save: false, // npm ci should never modify the lockfile or package.json
}

const arb = new Arborist(opts)
await Promise.all([
arb.loadVirtual().catch(er => {
log.verbose('loadVirtual', er.stack)
Expand All@@ -55,8 +61,7 @@ class CI extends BaseCommand {
}),
removeNodeModules(where),
])
// npm ci should never modify the lockfile or package.json
await arb.reify({ ...this.npm.flatOptions, save: false })
await arb.reify(opts)

const ignoreScripts = this.npm.config.get('ignore-scripts')
// run the same set of scripts that `npm install` runs.
Expand Down
5 changes: 5 additions & 0 deletions deps/npm/lib/config.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,11 @@ class Config extends BaseCommand {
this.config(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.npm.log.warn('config', 'This command does not support workspaces.')
this.exec(args, cb)
}

async config ([action, ...args]) {
this.npm.log.disableProgress()
try {
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/dedupe.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,6 +30,7 @@ class Dedupe extends BaseCommand {
const where = this.npm.prefix
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
path: where,
dryRun,
}
Expand Down
12 changes: 10 additions & 2 deletions deps/npm/lib/exec.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -175,7 +175,11 @@ class Exec extends BaseCommand {
if (needInstall) {
const installDir = this.cacheInstallDir(packages)
await mkdirp(installDir)
const arb = new Arborist({ ...this.npm.flatOptions, path: installDir })
const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: installDir,
})
const tree = await arb.loadActual()

// at this point, we have to ensure that we get the exact same
Expand DownExpand Up@@ -212,7 +216,11 @@ class Exec extends BaseCommand {
throw new Error('canceled')
}
}
await arb.reify({ ...this.npm.flatOptions, add })
await arb.reify({
...this.npm.flatOptions,
log: this.npm.log,
add,
})
}
pathArr.unshift(resolve(installDir, 'node_modules/.bin'))
}
Expand Down
13 changes: 7 additions & 6 deletions deps/npm/lib/install.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -126,15 +126,16 @@ class Install extends BaseCommand {
if (this.npm.config.get('dev'))
log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.')

const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
auditLevel: null,
path: where,
})

await arb.reify({
...this.npm.flatOptions,
add: args,
})
}
const arb = new Arborist(opts)
await arb.reify(opts)

if (!args.length && !isGlobalInstall && !ignoreScripts) {
const scriptShell = this.npm.config.get('script-shell') || undefined
const scripts = [
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/lib/link.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,6 +66,7 @@ class Link extends BaseCommand {
const globalOpts = {
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
prune: false,
}
Expand DownExpand Up@@ -113,12 +114,14 @@ class Link extends BaseCommand {
// reify all the pending names as symlinks there
const localArb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: this.npm.prefix,
save,
})
await localArb.reify({
...this.npm.flatOptions,
path: this.npm.prefix,
log: this.npm.log,
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
save,
})
Expand All@@ -131,9 +134,13 @@ class Link extends BaseCommand {
const arb = new Arborist({
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
})
await arb.reify({ add: [`file:${this.npm.prefix}`] })
await arb.reify({
add: [`file:${this.npm.prefix}`],
log: this.npm.log,
})
await reifyFinish(this.npm, arb)
}

Expand Down
8 changes: 5 additions & 3 deletions deps/npm/lib/prune.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,11 +30,13 @@ class Prune extends BaseCommand {

async prune () {
const where = this.npm.prefix
const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
path: where,
})
await arb.prune(this.npm.flatOptions)
log: this.npm.log,
}
const arb = new Arborist(opts)
await arb.prune(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
11 changes: 11 additions & 0 deletions deps/npm/lib/set-script.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ const log = require('npmlog')
const fs = require('fs')
const parseJSON = require('json-parse-even-better-errors')
const rpj = require('read-package-json-fast')
const { resolve } = require('path')

const BaseCommand = require('./base-command.js')
class SetScript extends BaseCommand {
Expand All@@ -20,6 +21,16 @@ class SetScript extends BaseCommand {
return ['[<script>] [<command>]']
}

async completion (opts) {
const argv = opts.conf.argv.remain
if (argv.length === 2) {
// find the script name
const json = resolve(this.npm.localPrefix, 'package.json')
const { scripts = {} } = await rpj(json).catch(er => ({}))
return Object.keys(scripts)
}
}

exec (args, cb) {
this.set(args).then(() => cb()).catch(cb)
}
Expand Down
16 changes: 10 additions & 6 deletions deps/npm/lib/uninstall.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,8 +38,9 @@ class Uninstall extends BaseCommand {
async uninstall (args) {
// the /path/to/node_modules/..
const global = this.npm.config.get('global')
const prefix = this.npm.config.get('prefix')
const path = global ? resolve(this.npm.globalDir, '..') : prefix
const path = global
? resolve(this.npm.globalDir, '..')
: this.npm.localPrefix

if (!args.length) {
if (!global)
Expand All@@ -60,12 +61,15 @@ class Uninstall extends BaseCommand {
}
}

const arb = new Arborist({ ...this.npm.flatOptions, path })

await arb.reify({
const opts = {
...this.npm.flatOptions,
path,
log: this.npm.log,
rm: args,
})

}
const arb = new Arborist(opts)
await arb.reify(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/update.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,7 @@ class Update extends BaseCommand {

const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: where,
})

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Closed
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
2 changes: 2 additions & 0 deletions deps/npm/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -765,3 +765,5 @@ Jan Sepke <625043+jansepke@users.noreply.github.com>
Augusto Moura <augusto.borgesm@gmail.com>
Eric Chow <eric.zjp.chow@gmail.com>
kbayrhammer <klaus.bayrhammer@redbull.com>
James Chen-Smith <jameschensmith@gmail.com>
Yash Singh <saiansh2525@gmail.com>
77 changes: 77 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
## v7.7.4 (2021-03-24)

### BUG FIXES

* [`200bee74b`](https://github.com/npm/cli/commit/200bee74b31a738687446b7b535cac67b1c582fd)
[#2951](https://github.com/npm/cli/issues/2951)
fix(config): accept explicit `production=false`
([@wraithgar](https://github.com/wraithgar))
* [`7b45e9df6`](https://github.com/npm/cli/commit/7b45e9df6102c7bd6e403d1fdc9939581c38f546)
[#2950](https://github.com/npm/cli/issues/2950)
warn if using workspaces config options in `npm config`
([@ruyadorno](https://github.com/ruyadorno))

## v7.7.3 (2021-03-24)

### BUG FIXES

* [`c76f04ac2`](https://github.com/npm/cli/commit/c76f04ac28ddf2ae4df4b3ce0aec684a118de1b5)
[#2925](https://github.com/npm/cli/issues/2925)
fix(set-script): add completion
([@Yash-Singh1](https://github.com/Yash-Singh1))
* [`0379eab69`](https://github.com/npm/cli/commit/0379eab698b78ae4aa89bbe2043607f420e52f11)
[#2929](https://github.com/npm/cli/issues/2929)
fix(install): ignore auditLevel
`npm install` should not be affected by the `auditLevel` config, as the
results of audit do not change its exit status.
([@wraithgar](https://github.com/wraithgar))
* [`98efadeb4`](https://github.com/npm/cli/commit/98efadeb4b2ae9289f14ed6f42a169230faf7239)
[#2923](https://github.com/npm/cli/issues/2923)
fix(audit-level): add `info` audit level
This is a valid level but wasn't configured to be allowed.
Also added this param to the usage output for `npm audit`
([@wraithgar](https://github.com/wraithgar))
* [`e8d2adcf4`](https://github.com/npm/cli/commit/e8d2adcf40ad63030f844c9aa44c6d16e2146797)
[#2945](https://github.com/npm/cli/issues/2945)
config should not error when workspaces are configured
([@nlf](https://github.com/nlf))
* [`aba2bc623`](https://github.com/npm/cli/commit/aba2bc623ea99e563b1b15b81dbb4ba94f86fe4c)
[#2944](https://github.com/npm/cli/issues/2944)
fix(progress): re-add progress bar to reify
The logger was no longer in flatOptions, we pass it in explicitly now
([@wraithgar](https://github.com/wraithgar))
* [`877b4ed29`](https://github.com/npm/cli/commit/877b4ed2925c97b5249a4d33575420dda64f7339)
[#2946](https://github.com/npm/cli/issues/2946)
fix(flatOptions): re-add `_auth`
This was not being added to flatOptions, and things like
`npm-registry-fetch` are looking for it.
([@wraithgar](https://github.com/wraithgar))

## v7.7.2 (2021-03-24)

### BUG FIXES
* [`a4df2b98d`](https://github.com/npm/cli/commit/a4df2b98d89429b19cd29b5fc895cdbfc0a6bd78)
[#2942](https://github.com/npm/cli/issues/2942)
Restore --dev flag, unify --omit flatteners
([@isaacs](https://github.com/isaacs))

### DEPENDENCIES
* [`2cbfaac0e`](https://github.com/npm/cli/commit/2cbfaac0ecd5810316f6d76168ed9618bd11bf3a)
`hosted-git-info@4.0.2`
* [#83](https://github.com/npm/hosted-git-info/pull/83) Do not parse
urls for gitlab
([@nlf](https://github.com/nlf))

## v7.7.1 (2021-03-24)

### BUG FIXES

* [`543b0e39b`](https://github.com/npm/cli/commit/543b0e39bcb94fc408804b01ca9c0d7b960b2681)
[#2930](https://github.com/npm/cli/issues/2930)
fix(uninstall): use correct local prefix
([@jameschensmith](https://github.com/jameschensmith))
* [`dce4960ef`](https://github.com/npm/cli/commit/dce4960ef6d52af128affe7755b2ca72de913b6c)
[#2932](https://github.com/npm/cli/issues/2932)
fix(config): flatten savePrefix properly
([@wraithgar](https://github.com/wraithgar))

## v7.7.0 (2021-03-23)

### FEATURES
Expand Down
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npm-find-dupes.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,3 +21,4 @@ duplications, without actually changing the package tree.
* [npm ls](/cli-commands/ls)
* [npm update](/cli-commands/update)
* [npm install](/cli-commands/install)

14 changes: 11 additions & 3 deletions deps/npm/docs/content/using-npm/config.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`

* Default: null
* Type: "low", "moderate", "high", "critical", "none", or null
* Type: "info", "low", "moderate", "high", "critical", "none", or null

The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
Expand DownExpand Up@@ -1382,6 +1382,14 @@ What authentication strategy to use with `adduser`/`login`.

`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.

#### `dev`

* Default: false
* Type: Boolean
* DEPRECATED: Please use --include=dev instead.

Alias for `--include=dev`.

#### `init.author.email`

* Default: ""
Expand DownExpand Up@@ -1451,8 +1459,8 @@ Alias for --include=optional or --omit=optional

#### `production`

* Default: false
* Type: Boolean
* Default: null
* Type: null or Boolean
* DEPRECATED: Use `--omit=dev` instead.

Alias for `--omit=dev`
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff 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.7.0 /path/to/npm
<pre lang="bash"><code>npm@7.7.4 /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 numberDiff line numberDiff 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.7.0</p>
<p>7.7.4</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
15 changes: 11 additions & 4 deletions deps/npm/docs/output/using-npm/config.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deps/npm/lib/audit.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,7 @@ class Audit extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
staticgetparams(){
return[
'audit-level',
'dry-run',
'force',
'json',
Expand Down
11 changes: 8 additions & 3 deletions deps/npm/lib/ci.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,8 +42,14 @@ class CI extends BaseCommand {
}

const where = this.npm.prefix
const arb = new Arborist({ ...this.npm.flatOptions, path: where })
const opts = {
...this.npm.flatOptions,
path: where,
log: this.npm.log,
save: false, // npm ci should never modify the lockfile or package.json
}

const arb = new Arborist(opts)
await Promise.all([
arb.loadVirtual().catch(er => {
log.verbose('loadVirtual', er.stack)
Expand All@@ -55,8 +61,7 @@ class CI extends BaseCommand {
}),
removeNodeModules(where),
])
// npm ci should never modify the lockfile or package.json
await arb.reify({ ...this.npm.flatOptions, save: false })
await arb.reify(opts)

const ignoreScripts = this.npm.config.get('ignore-scripts')
// run the same set of scripts that `npm install` runs.
Expand Down
5 changes: 5 additions & 0 deletions deps/npm/lib/config.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,11 @@ class Config extends BaseCommand {
this.config(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.npm.log.warn('config', 'This command does not support workspaces.')
this.exec(args, cb)
}

async config ([action, ...args]) {
this.npm.log.disableProgress()
try {
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/dedupe.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,6 +30,7 @@ class Dedupe extends BaseCommand {
const where = this.npm.prefix
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
path: where,
dryRun,
}
Expand Down
12 changes: 10 additions & 2 deletions deps/npm/lib/exec.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -175,7 +175,11 @@ class Exec extends BaseCommand {
if (needInstall) {
const installDir = this.cacheInstallDir(packages)
await mkdirp(installDir)
const arb = new Arborist({ ...this.npm.flatOptions, path: installDir })
const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: installDir,
})
const tree = await arb.loadActual()

// at this point, we have to ensure that we get the exact same
Expand DownExpand Up@@ -212,7 +216,11 @@ class Exec extends BaseCommand {
throw new Error('canceled')
}
}
await arb.reify({ ...this.npm.flatOptions, add })
await arb.reify({
...this.npm.flatOptions,
log: this.npm.log,
add,
})
}
pathArr.unshift(resolve(installDir, 'node_modules/.bin'))
}
Expand Down
13 changes: 7 additions & 6 deletions deps/npm/lib/install.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -126,15 +126,16 @@ class Install extends BaseCommand {
if (this.npm.config.get('dev'))
log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.')

const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
auditLevel: null,
path: where,
})

await arb.reify({
...this.npm.flatOptions,
add: args,
})
}
const arb = new Arborist(opts)
await arb.reify(opts)

if (!args.length && !isGlobalInstall && !ignoreScripts) {
const scriptShell = this.npm.config.get('script-shell') || undefined
const scripts = [
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/lib/link.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,6 +66,7 @@ class Link extends BaseCommand {
const globalOpts = {
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
prune: false,
}
Expand DownExpand Up@@ -113,12 +114,14 @@ class Link extends BaseCommand {
// reify all the pending names as symlinks there
const localArb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: this.npm.prefix,
save,
})
await localArb.reify({
...this.npm.flatOptions,
path: this.npm.prefix,
log: this.npm.log,
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
save,
})
Expand All@@ -131,9 +134,13 @@ class Link extends BaseCommand {
const arb = new Arborist({
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
})
await arb.reify({ add: [`file:${this.npm.prefix}`] })
await arb.reify({
add: [`file:${this.npm.prefix}`],
log: this.npm.log,
})
await reifyFinish(this.npm, arb)
}

Expand Down
8 changes: 5 additions & 3 deletions deps/npm/lib/prune.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,11 +30,13 @@ class Prune extends BaseCommand {

async prune () {
const where = this.npm.prefix
const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
path: where,
})
await arb.prune(this.npm.flatOptions)
log: this.npm.log,
}
const arb = new Arborist(opts)
await arb.prune(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
11 changes: 11 additions & 0 deletions deps/npm/lib/set-script.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ const log = require('npmlog')
const fs = require('fs')
const parseJSON = require('json-parse-even-better-errors')
const rpj = require('read-package-json-fast')
const { resolve } = require('path')

const BaseCommand = require('./base-command.js')
class SetScript extends BaseCommand {
Expand All@@ -20,6 +21,16 @@ class SetScript extends BaseCommand {
return ['[<script>] [<command>]']
}

async completion (opts) {
const argv = opts.conf.argv.remain
if (argv.length === 2) {
// find the script name
const json = resolve(this.npm.localPrefix, 'package.json')
const { scripts = {} } = await rpj(json).catch(er => ({}))
return Object.keys(scripts)
}
}

exec (args, cb) {
this.set(args).then(() => cb()).catch(cb)
}
Expand Down
16 changes: 10 additions & 6 deletions deps/npm/lib/uninstall.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,8 +38,9 @@ class Uninstall extends BaseCommand {
async uninstall (args) {
// the /path/to/node_modules/..
const global = this.npm.config.get('global')
const prefix = this.npm.config.get('prefix')
const path = global ? resolve(this.npm.globalDir, '..') : prefix
const path = global
? resolve(this.npm.globalDir, '..')
: this.npm.localPrefix

if (!args.length) {
if (!global)
Expand All@@ -60,12 +61,15 @@ class Uninstall extends BaseCommand {
}
}

const arb = new Arborist({ ...this.npm.flatOptions, path })

await arb.reify({
const opts = {
...this.npm.flatOptions,
path,
log: this.npm.log,
rm: args,
})

}
const arb = new Arborist(opts)
await arb.reify(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/update.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,7 @@ class Update extends BaseCommand {

const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: where,
})

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Closed
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
2 changes: 2 additions & 0 deletions deps/npm/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -765,3 +765,5 @@ Jan Sepke <625043+jansepke@users.noreply.github.com>
Augusto Moura <augusto.borgesm@gmail.com>
Eric Chow <eric.zjp.chow@gmail.com>
kbayrhammer <klaus.bayrhammer@redbull.com>
James Chen-Smith <jameschensmith@gmail.com>
Yash Singh <saiansh2525@gmail.com>
77 changes: 77 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
## v7.7.4 (2021-03-24)

### BUG FIXES

* [`200bee74b`](https://github.com/npm/cli/commit/200bee74b31a738687446b7b535cac67b1c582fd)
[#2951](https://github.com/npm/cli/issues/2951)
fix(config): accept explicit `production=false`
([@wraithgar](https://github.com/wraithgar))
* [`7b45e9df6`](https://github.com/npm/cli/commit/7b45e9df6102c7bd6e403d1fdc9939581c38f546)
[#2950](https://github.com/npm/cli/issues/2950)
warn if using workspaces config options in `npm config`
([@ruyadorno](https://github.com/ruyadorno))

## v7.7.3 (2021-03-24)

### BUG FIXES

* [`c76f04ac2`](https://github.com/npm/cli/commit/c76f04ac28ddf2ae4df4b3ce0aec684a118de1b5)
[#2925](https://github.com/npm/cli/issues/2925)
fix(set-script): add completion
([@Yash-Singh1](https://github.com/Yash-Singh1))
* [`0379eab69`](https://github.com/npm/cli/commit/0379eab698b78ae4aa89bbe2043607f420e52f11)
[#2929](https://github.com/npm/cli/issues/2929)
fix(install): ignore auditLevel
`npm install` should not be affected by the `auditLevel` config, as the
results of audit do not change its exit status.
([@wraithgar](https://github.com/wraithgar))
* [`98efadeb4`](https://github.com/npm/cli/commit/98efadeb4b2ae9289f14ed6f42a169230faf7239)
[#2923](https://github.com/npm/cli/issues/2923)
fix(audit-level): add `info` audit level
This is a valid level but wasn't configured to be allowed.
Also added this param to the usage output for `npm audit`
([@wraithgar](https://github.com/wraithgar))
* [`e8d2adcf4`](https://github.com/npm/cli/commit/e8d2adcf40ad63030f844c9aa44c6d16e2146797)
[#2945](https://github.com/npm/cli/issues/2945)
config should not error when workspaces are configured
([@nlf](https://github.com/nlf))
* [`aba2bc623`](https://github.com/npm/cli/commit/aba2bc623ea99e563b1b15b81dbb4ba94f86fe4c)
[#2944](https://github.com/npm/cli/issues/2944)
fix(progress): re-add progress bar to reify
The logger was no longer in flatOptions, we pass it in explicitly now
([@wraithgar](https://github.com/wraithgar))
* [`877b4ed29`](https://github.com/npm/cli/commit/877b4ed2925c97b5249a4d33575420dda64f7339)
[#2946](https://github.com/npm/cli/issues/2946)
fix(flatOptions): re-add `_auth`
This was not being added to flatOptions, and things like
`npm-registry-fetch` are looking for it.
([@wraithgar](https://github.com/wraithgar))

## v7.7.2 (2021-03-24)

### BUG FIXES
* [`a4df2b98d`](https://github.com/npm/cli/commit/a4df2b98d89429b19cd29b5fc895cdbfc0a6bd78)
[#2942](https://github.com/npm/cli/issues/2942)
Restore --dev flag, unify --omit flatteners
([@isaacs](https://github.com/isaacs))

### DEPENDENCIES
* [`2cbfaac0e`](https://github.com/npm/cli/commit/2cbfaac0ecd5810316f6d76168ed9618bd11bf3a)
`hosted-git-info@4.0.2`
* [#83](https://github.com/npm/hosted-git-info/pull/83) Do not parse
urls for gitlab
([@nlf](https://github.com/nlf))

## v7.7.1 (2021-03-24)

### BUG FIXES

* [`543b0e39b`](https://github.com/npm/cli/commit/543b0e39bcb94fc408804b01ca9c0d7b960b2681)
[#2930](https://github.com/npm/cli/issues/2930)
fix(uninstall): use correct local prefix
([@jameschensmith](https://github.com/jameschensmith))
* [`dce4960ef`](https://github.com/npm/cli/commit/dce4960ef6d52af128affe7755b2ca72de913b6c)
[#2932](https://github.com/npm/cli/issues/2932)
fix(config): flatten savePrefix properly
([@wraithgar](https://github.com/wraithgar))

## v7.7.0 (2021-03-23)

### FEATURES
Expand Down
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npm-find-dupes.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,3 +21,4 @@ duplications, without actually changing the package tree.
* [npm ls](/cli-commands/ls)
* [npm update](/cli-commands/update)
* [npm install](/cli-commands/install)

14 changes: 11 additions & 3 deletions deps/npm/docs/content/using-npm/config.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`

* Default: null
* Type: "low", "moderate", "high", "critical", "none", or null
* Type: "info", "low", "moderate", "high", "critical", "none", or null

The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
Expand DownExpand Up@@ -1382,6 +1382,14 @@ What authentication strategy to use with `adduser`/`login`.

`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.

#### `dev`

* Default: false
* Type: Boolean
* DEPRECATED: Please use --include=dev instead.

Alias for `--include=dev`.

#### `init.author.email`

* Default: ""
Expand DownExpand Up@@ -1451,8 +1459,8 @@ Alias for --include=optional or --omit=optional

#### `production`

* Default: false
* Type: Boolean
* Default: null
* Type: null or Boolean
* DEPRECATED: Use `--omit=dev` instead.

Alias for `--omit=dev`
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff 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.7.0 /path/to/npm
<pre lang="bash"><code>npm@7.7.4 /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 numberDiff line numberDiff 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.7.0</p>
<p>7.7.4</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
15 changes: 11 additions & 4 deletions deps/npm/docs/output/using-npm/config.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deps/npm/lib/audit.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,7 @@ class Audit extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
staticgetparams(){
return[
'audit-level',
'dry-run',
'force',
'json',
Expand Down
11 changes: 8 additions & 3 deletions deps/npm/lib/ci.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,8 +42,14 @@ class CI extends BaseCommand {
}

const where = this.npm.prefix
const arb = new Arborist({ ...this.npm.flatOptions, path: where })
const opts = {
...this.npm.flatOptions,
path: where,
log: this.npm.log,
save: false, // npm ci should never modify the lockfile or package.json
}

const arb = new Arborist(opts)
await Promise.all([
arb.loadVirtual().catch(er => {
log.verbose('loadVirtual', er.stack)
Expand All@@ -55,8 +61,7 @@ class CI extends BaseCommand {
}),
removeNodeModules(where),
])
// npm ci should never modify the lockfile or package.json
await arb.reify({ ...this.npm.flatOptions, save: false })
await arb.reify(opts)

const ignoreScripts = this.npm.config.get('ignore-scripts')
// run the same set of scripts that `npm install` runs.
Expand Down
5 changes: 5 additions & 0 deletions deps/npm/lib/config.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,11 @@ class Config extends BaseCommand {
this.config(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.npm.log.warn('config', 'This command does not support workspaces.')
this.exec(args, cb)
}

async config ([action, ...args]) {
this.npm.log.disableProgress()
try {
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/dedupe.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,6 +30,7 @@ class Dedupe extends BaseCommand {
const where = this.npm.prefix
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
path: where,
dryRun,
}
Expand Down
12 changes: 10 additions & 2 deletions deps/npm/lib/exec.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -175,7 +175,11 @@ class Exec extends BaseCommand {
if (needInstall) {
const installDir = this.cacheInstallDir(packages)
await mkdirp(installDir)
const arb = new Arborist({ ...this.npm.flatOptions, path: installDir })
const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: installDir,
})
const tree = await arb.loadActual()

// at this point, we have to ensure that we get the exact same
Expand DownExpand Up@@ -212,7 +216,11 @@ class Exec extends BaseCommand {
throw new Error('canceled')
}
}
await arb.reify({ ...this.npm.flatOptions, add })
await arb.reify({
...this.npm.flatOptions,
log: this.npm.log,
add,
})
}
pathArr.unshift(resolve(installDir, 'node_modules/.bin'))
}
Expand Down
13 changes: 7 additions & 6 deletions deps/npm/lib/install.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -126,15 +126,16 @@ class Install extends BaseCommand {
if (this.npm.config.get('dev'))
log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.')

const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
auditLevel: null,
path: where,
})

await arb.reify({
...this.npm.flatOptions,
add: args,
})
}
const arb = new Arborist(opts)
await arb.reify(opts)

if (!args.length && !isGlobalInstall && !ignoreScripts) {
const scriptShell = this.npm.config.get('script-shell') || undefined
const scripts = [
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/lib/link.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,6 +66,7 @@ class Link extends BaseCommand {
const globalOpts = {
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
prune: false,
}
Expand DownExpand Up@@ -113,12 +114,14 @@ class Link extends BaseCommand {
// reify all the pending names as symlinks there
const localArb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: this.npm.prefix,
save,
})
await localArb.reify({
...this.npm.flatOptions,
path: this.npm.prefix,
log: this.npm.log,
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
save,
})
Expand All@@ -131,9 +134,13 @@ class Link extends BaseCommand {
const arb = new Arborist({
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
})
await arb.reify({ add: [`file:${this.npm.prefix}`] })
await arb.reify({
add: [`file:${this.npm.prefix}`],
log: this.npm.log,
})
await reifyFinish(this.npm, arb)
}

Expand Down
8 changes: 5 additions & 3 deletions deps/npm/lib/prune.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,11 +30,13 @@ class Prune extends BaseCommand {

async prune () {
const where = this.npm.prefix
const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
path: where,
})
await arb.prune(this.npm.flatOptions)
log: this.npm.log,
}
const arb = new Arborist(opts)
await arb.prune(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
11 changes: 11 additions & 0 deletions deps/npm/lib/set-script.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ const log = require('npmlog')
const fs = require('fs')
const parseJSON = require('json-parse-even-better-errors')
const rpj = require('read-package-json-fast')
const { resolve } = require('path')

const BaseCommand = require('./base-command.js')
class SetScript extends BaseCommand {
Expand All@@ -20,6 +21,16 @@ class SetScript extends BaseCommand {
return ['[<script>] [<command>]']
}

async completion (opts) {
const argv = opts.conf.argv.remain
if (argv.length === 2) {
// find the script name
const json = resolve(this.npm.localPrefix, 'package.json')
const { scripts = {} } = await rpj(json).catch(er => ({}))
return Object.keys(scripts)
}
}

exec (args, cb) {
this.set(args).then(() => cb()).catch(cb)
}
Expand Down
16 changes: 10 additions & 6 deletions deps/npm/lib/uninstall.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,8 +38,9 @@ class Uninstall extends BaseCommand {
async uninstall (args) {
// the /path/to/node_modules/..
const global = this.npm.config.get('global')
const prefix = this.npm.config.get('prefix')
const path = global ? resolve(this.npm.globalDir, '..') : prefix
const path = global
? resolve(this.npm.globalDir, '..')
: this.npm.localPrefix

if (!args.length) {
if (!global)
Expand All@@ -60,12 +61,15 @@ class Uninstall extends BaseCommand {
}
}

const arb = new Arborist({ ...this.npm.flatOptions, path })

await arb.reify({
const opts = {
...this.npm.flatOptions,
path,
log: this.npm.log,
rm: args,
})

}
const arb = new Arborist(opts)
await arb.reify(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/update.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,7 @@ class Update extends BaseCommand {

const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: where,
})

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Closed
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
2 changes: 2 additions & 0 deletions deps/npm/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -765,3 +765,5 @@ Jan Sepke <625043+jansepke@users.noreply.github.com>
Augusto Moura <augusto.borgesm@gmail.com>
Eric Chow <eric.zjp.chow@gmail.com>
kbayrhammer <klaus.bayrhammer@redbull.com>
James Chen-Smith <jameschensmith@gmail.com>
Yash Singh <saiansh2525@gmail.com>
77 changes: 77 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
## v7.7.4 (2021-03-24)

### BUG FIXES

* [`200bee74b`](https://github.com/npm/cli/commit/200bee74b31a738687446b7b535cac67b1c582fd)
[#2951](https://github.com/npm/cli/issues/2951)
fix(config): accept explicit `production=false`
([@wraithgar](https://github.com/wraithgar))
* [`7b45e9df6`](https://github.com/npm/cli/commit/7b45e9df6102c7bd6e403d1fdc9939581c38f546)
[#2950](https://github.com/npm/cli/issues/2950)
warn if using workspaces config options in `npm config`
([@ruyadorno](https://github.com/ruyadorno))

## v7.7.3 (2021-03-24)

### BUG FIXES

* [`c76f04ac2`](https://github.com/npm/cli/commit/c76f04ac28ddf2ae4df4b3ce0aec684a118de1b5)
[#2925](https://github.com/npm/cli/issues/2925)
fix(set-script): add completion
([@Yash-Singh1](https://github.com/Yash-Singh1))
* [`0379eab69`](https://github.com/npm/cli/commit/0379eab698b78ae4aa89bbe2043607f420e52f11)
[#2929](https://github.com/npm/cli/issues/2929)
fix(install): ignore auditLevel
`npm install` should not be affected by the `auditLevel` config, as the
results of audit do not change its exit status.
([@wraithgar](https://github.com/wraithgar))
* [`98efadeb4`](https://github.com/npm/cli/commit/98efadeb4b2ae9289f14ed6f42a169230faf7239)
[#2923](https://github.com/npm/cli/issues/2923)
fix(audit-level): add `info` audit level
This is a valid level but wasn't configured to be allowed.
Also added this param to the usage output for `npm audit`
([@wraithgar](https://github.com/wraithgar))
* [`e8d2adcf4`](https://github.com/npm/cli/commit/e8d2adcf40ad63030f844c9aa44c6d16e2146797)
[#2945](https://github.com/npm/cli/issues/2945)
config should not error when workspaces are configured
([@nlf](https://github.com/nlf))
* [`aba2bc623`](https://github.com/npm/cli/commit/aba2bc623ea99e563b1b15b81dbb4ba94f86fe4c)
[#2944](https://github.com/npm/cli/issues/2944)
fix(progress): re-add progress bar to reify
The logger was no longer in flatOptions, we pass it in explicitly now
([@wraithgar](https://github.com/wraithgar))
* [`877b4ed29`](https://github.com/npm/cli/commit/877b4ed2925c97b5249a4d33575420dda64f7339)
[#2946](https://github.com/npm/cli/issues/2946)
fix(flatOptions): re-add `_auth`
This was not being added to flatOptions, and things like
`npm-registry-fetch` are looking for it.
([@wraithgar](https://github.com/wraithgar))

## v7.7.2 (2021-03-24)

### BUG FIXES
* [`a4df2b98d`](https://github.com/npm/cli/commit/a4df2b98d89429b19cd29b5fc895cdbfc0a6bd78)
[#2942](https://github.com/npm/cli/issues/2942)
Restore --dev flag, unify --omit flatteners
([@isaacs](https://github.com/isaacs))

### DEPENDENCIES
* [`2cbfaac0e`](https://github.com/npm/cli/commit/2cbfaac0ecd5810316f6d76168ed9618bd11bf3a)
`hosted-git-info@4.0.2`
* [#83](https://github.com/npm/hosted-git-info/pull/83) Do not parse
urls for gitlab
([@nlf](https://github.com/nlf))

## v7.7.1 (2021-03-24)

### BUG FIXES

* [`543b0e39b`](https://github.com/npm/cli/commit/543b0e39bcb94fc408804b01ca9c0d7b960b2681)
[#2930](https://github.com/npm/cli/issues/2930)
fix(uninstall): use correct local prefix
([@jameschensmith](https://github.com/jameschensmith))
* [`dce4960ef`](https://github.com/npm/cli/commit/dce4960ef6d52af128affe7755b2ca72de913b6c)
[#2932](https://github.com/npm/cli/issues/2932)
fix(config): flatten savePrefix properly
([@wraithgar](https://github.com/wraithgar))

## v7.7.0 (2021-03-23)

### FEATURES
Expand Down
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npm-find-dupes.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,3 +21,4 @@ duplications, without actually changing the package tree.
* [npm ls](/cli-commands/ls)
* [npm update](/cli-commands/update)
* [npm install](/cli-commands/install)

14 changes: 11 additions & 3 deletions deps/npm/docs/content/using-npm/config.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`

* Default: null
* Type: "low", "moderate", "high", "critical", "none", or null
* Type: "info", "low", "moderate", "high", "critical", "none", or null

The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
Expand DownExpand Up@@ -1382,6 +1382,14 @@ What authentication strategy to use with `adduser`/`login`.

`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.

#### `dev`

* Default: false
* Type: Boolean
* DEPRECATED: Please use --include=dev instead.

Alias for `--include=dev`.

#### `init.author.email`

* Default: ""
Expand DownExpand Up@@ -1451,8 +1459,8 @@ Alias for --include=optional or --omit=optional

#### `production`

* Default: false
* Type: Boolean
* Default: null
* Type: null or Boolean
* DEPRECATED: Use `--omit=dev` instead.

Alias for `--omit=dev`
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff 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.7.0 /path/to/npm
<pre lang="bash"><code>npm@7.7.4 /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 numberDiff line numberDiff 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.7.0</p>
<p>7.7.4</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
15 changes: 11 additions & 4 deletions deps/npm/docs/output/using-npm/config.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deps/npm/lib/audit.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,7 @@ class Audit extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
staticgetparams(){
return[
'audit-level',
'dry-run',
'force',
'json',
Expand Down
11 changes: 8 additions & 3 deletions deps/npm/lib/ci.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,8 +42,14 @@ class CI extends BaseCommand {
}

const where = this.npm.prefix
const arb = new Arborist({ ...this.npm.flatOptions, path: where })
const opts = {
...this.npm.flatOptions,
path: where,
log: this.npm.log,
save: false, // npm ci should never modify the lockfile or package.json
}

const arb = new Arborist(opts)
await Promise.all([
arb.loadVirtual().catch(er => {
log.verbose('loadVirtual', er.stack)
Expand All@@ -55,8 +61,7 @@ class CI extends BaseCommand {
}),
removeNodeModules(where),
])
// npm ci should never modify the lockfile or package.json
await arb.reify({ ...this.npm.flatOptions, save: false })
await arb.reify(opts)

const ignoreScripts = this.npm.config.get('ignore-scripts')
// run the same set of scripts that `npm install` runs.
Expand Down
5 changes: 5 additions & 0 deletions deps/npm/lib/config.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,11 @@ class Config extends BaseCommand {
this.config(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.npm.log.warn('config', 'This command does not support workspaces.')
this.exec(args, cb)
}

async config ([action, ...args]) {
this.npm.log.disableProgress()
try {
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/dedupe.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,6 +30,7 @@ class Dedupe extends BaseCommand {
const where = this.npm.prefix
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
path: where,
dryRun,
}
Expand Down
12 changes: 10 additions & 2 deletions deps/npm/lib/exec.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -175,7 +175,11 @@ class Exec extends BaseCommand {
if (needInstall) {
const installDir = this.cacheInstallDir(packages)
await mkdirp(installDir)
const arb = new Arborist({ ...this.npm.flatOptions, path: installDir })
const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: installDir,
})
const tree = await arb.loadActual()

// at this point, we have to ensure that we get the exact same
Expand DownExpand Up@@ -212,7 +216,11 @@ class Exec extends BaseCommand {
throw new Error('canceled')
}
}
await arb.reify({ ...this.npm.flatOptions, add })
await arb.reify({
...this.npm.flatOptions,
log: this.npm.log,
add,
})
}
pathArr.unshift(resolve(installDir, 'node_modules/.bin'))
}
Expand Down
13 changes: 7 additions & 6 deletions deps/npm/lib/install.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -126,15 +126,16 @@ class Install extends BaseCommand {
if (this.npm.config.get('dev'))
log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.')

const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
auditLevel: null,
path: where,
})

await arb.reify({
...this.npm.flatOptions,
add: args,
})
}
const arb = new Arborist(opts)
await arb.reify(opts)

if (!args.length && !isGlobalInstall && !ignoreScripts) {
const scriptShell = this.npm.config.get('script-shell') || undefined
const scripts = [
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/lib/link.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,6 +66,7 @@ class Link extends BaseCommand {
const globalOpts = {
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
prune: false,
}
Expand DownExpand Up@@ -113,12 +114,14 @@ class Link extends BaseCommand {
// reify all the pending names as symlinks there
const localArb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: this.npm.prefix,
save,
})
await localArb.reify({
...this.npm.flatOptions,
path: this.npm.prefix,
log: this.npm.log,
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
save,
})
Expand All@@ -131,9 +134,13 @@ class Link extends BaseCommand {
const arb = new Arborist({
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
})
await arb.reify({ add: [`file:${this.npm.prefix}`] })
await arb.reify({
add: [`file:${this.npm.prefix}`],
log: this.npm.log,
})
await reifyFinish(this.npm, arb)
}

Expand Down
8 changes: 5 additions & 3 deletions deps/npm/lib/prune.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,11 +30,13 @@ class Prune extends BaseCommand {

async prune () {
const where = this.npm.prefix
const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
path: where,
})
await arb.prune(this.npm.flatOptions)
log: this.npm.log,
}
const arb = new Arborist(opts)
await arb.prune(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
11 changes: 11 additions & 0 deletions deps/npm/lib/set-script.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ const log = require('npmlog')
const fs = require('fs')
const parseJSON = require('json-parse-even-better-errors')
const rpj = require('read-package-json-fast')
const { resolve } = require('path')

const BaseCommand = require('./base-command.js')
class SetScript extends BaseCommand {
Expand All@@ -20,6 +21,16 @@ class SetScript extends BaseCommand {
return ['[<script>] [<command>]']
}

async completion (opts) {
const argv = opts.conf.argv.remain
if (argv.length === 2) {
// find the script name
const json = resolve(this.npm.localPrefix, 'package.json')
const { scripts = {} } = await rpj(json).catch(er => ({}))
return Object.keys(scripts)
}
}

exec (args, cb) {
this.set(args).then(() => cb()).catch(cb)
}
Expand Down
16 changes: 10 additions & 6 deletions deps/npm/lib/uninstall.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,8 +38,9 @@ class Uninstall extends BaseCommand {
async uninstall (args) {
// the /path/to/node_modules/..
const global = this.npm.config.get('global')
const prefix = this.npm.config.get('prefix')
const path = global ? resolve(this.npm.globalDir, '..') : prefix
const path = global
? resolve(this.npm.globalDir, '..')
: this.npm.localPrefix

if (!args.length) {
if (!global)
Expand All@@ -60,12 +61,15 @@ class Uninstall extends BaseCommand {
}
}

const arb = new Arborist({ ...this.npm.flatOptions, path })

await arb.reify({
const opts = {
...this.npm.flatOptions,
path,
log: this.npm.log,
rm: args,
})

}
const arb = new Arborist(opts)
await arb.reify(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/update.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,7 @@ class Update extends BaseCommand {

const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: where,
})

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Closed
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
2 changes: 2 additions & 0 deletions deps/npm/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -765,3 +765,5 @@ Jan Sepke <625043+jansepke@users.noreply.github.com>
Augusto Moura <augusto.borgesm@gmail.com>
Eric Chow <eric.zjp.chow@gmail.com>
kbayrhammer <klaus.bayrhammer@redbull.com>
James Chen-Smith <jameschensmith@gmail.com>
Yash Singh <saiansh2525@gmail.com>
77 changes: 77 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
## v7.7.4 (2021-03-24)

### BUG FIXES

* [`200bee74b`](https://github.com/npm/cli/commit/200bee74b31a738687446b7b535cac67b1c582fd)
[#2951](https://github.com/npm/cli/issues/2951)
fix(config): accept explicit `production=false`
([@wraithgar](https://github.com/wraithgar))
* [`7b45e9df6`](https://github.com/npm/cli/commit/7b45e9df6102c7bd6e403d1fdc9939581c38f546)
[#2950](https://github.com/npm/cli/issues/2950)
warn if using workspaces config options in `npm config`
([@ruyadorno](https://github.com/ruyadorno))

## v7.7.3 (2021-03-24)

### BUG FIXES

* [`c76f04ac2`](https://github.com/npm/cli/commit/c76f04ac28ddf2ae4df4b3ce0aec684a118de1b5)
[#2925](https://github.com/npm/cli/issues/2925)
fix(set-script): add completion
([@Yash-Singh1](https://github.com/Yash-Singh1))
* [`0379eab69`](https://github.com/npm/cli/commit/0379eab698b78ae4aa89bbe2043607f420e52f11)
[#2929](https://github.com/npm/cli/issues/2929)
fix(install): ignore auditLevel
`npm install` should not be affected by the `auditLevel` config, as the
results of audit do not change its exit status.
([@wraithgar](https://github.com/wraithgar))
* [`98efadeb4`](https://github.com/npm/cli/commit/98efadeb4b2ae9289f14ed6f42a169230faf7239)
[#2923](https://github.com/npm/cli/issues/2923)
fix(audit-level): add `info` audit level
This is a valid level but wasn't configured to be allowed.
Also added this param to the usage output for `npm audit`
([@wraithgar](https://github.com/wraithgar))
* [`e8d2adcf4`](https://github.com/npm/cli/commit/e8d2adcf40ad63030f844c9aa44c6d16e2146797)
[#2945](https://github.com/npm/cli/issues/2945)
config should not error when workspaces are configured
([@nlf](https://github.com/nlf))
* [`aba2bc623`](https://github.com/npm/cli/commit/aba2bc623ea99e563b1b15b81dbb4ba94f86fe4c)
[#2944](https://github.com/npm/cli/issues/2944)
fix(progress): re-add progress bar to reify
The logger was no longer in flatOptions, we pass it in explicitly now
([@wraithgar](https://github.com/wraithgar))
* [`877b4ed29`](https://github.com/npm/cli/commit/877b4ed2925c97b5249a4d33575420dda64f7339)
[#2946](https://github.com/npm/cli/issues/2946)
fix(flatOptions): re-add `_auth`
This was not being added to flatOptions, and things like
`npm-registry-fetch` are looking for it.
([@wraithgar](https://github.com/wraithgar))

## v7.7.2 (2021-03-24)

### BUG FIXES
* [`a4df2b98d`](https://github.com/npm/cli/commit/a4df2b98d89429b19cd29b5fc895cdbfc0a6bd78)
[#2942](https://github.com/npm/cli/issues/2942)
Restore --dev flag, unify --omit flatteners
([@isaacs](https://github.com/isaacs))

### DEPENDENCIES
* [`2cbfaac0e`](https://github.com/npm/cli/commit/2cbfaac0ecd5810316f6d76168ed9618bd11bf3a)
`hosted-git-info@4.0.2`
* [#83](https://github.com/npm/hosted-git-info/pull/83) Do not parse
urls for gitlab
([@nlf](https://github.com/nlf))

## v7.7.1 (2021-03-24)

### BUG FIXES

* [`543b0e39b`](https://github.com/npm/cli/commit/543b0e39bcb94fc408804b01ca9c0d7b960b2681)
[#2930](https://github.com/npm/cli/issues/2930)
fix(uninstall): use correct local prefix
([@jameschensmith](https://github.com/jameschensmith))
* [`dce4960ef`](https://github.com/npm/cli/commit/dce4960ef6d52af128affe7755b2ca72de913b6c)
[#2932](https://github.com/npm/cli/issues/2932)
fix(config): flatten savePrefix properly
([@wraithgar](https://github.com/wraithgar))

## v7.7.0 (2021-03-23)

### FEATURES
Expand Down
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npm-find-dupes.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,3 +21,4 @@ duplications, without actually changing the package tree.
* [npm ls](/cli-commands/ls)
* [npm update](/cli-commands/update)
* [npm install](/cli-commands/install)

14 changes: 11 additions & 3 deletions deps/npm/docs/content/using-npm/config.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`

* Default: null
* Type: "low", "moderate", "high", "critical", "none", or null
* Type: "info", "low", "moderate", "high", "critical", "none", or null

The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
Expand DownExpand Up@@ -1382,6 +1382,14 @@ What authentication strategy to use with `adduser`/`login`.

`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.

#### `dev`

* Default: false
* Type: Boolean
* DEPRECATED: Please use --include=dev instead.

Alias for `--include=dev`.

#### `init.author.email`

* Default: ""
Expand DownExpand Up@@ -1451,8 +1459,8 @@ Alias for --include=optional or --omit=optional

#### `production`

* Default: false
* Type: Boolean
* Default: null
* Type: null or Boolean
* DEPRECATED: Use `--omit=dev` instead.

Alias for `--omit=dev`
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff 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.7.0 /path/to/npm
<pre lang="bash"><code>npm@7.7.4 /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 numberDiff line numberDiff 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.7.0</p>
<p>7.7.4</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
15 changes: 11 additions & 4 deletions deps/npm/docs/output/using-npm/config.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deps/npm/lib/audit.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,7 @@ class Audit extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
staticgetparams(){
return[
'audit-level',
'dry-run',
'force',
'json',
Expand Down
11 changes: 8 additions & 3 deletions deps/npm/lib/ci.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,8 +42,14 @@ class CI extends BaseCommand {
}

const where = this.npm.prefix
const arb = new Arborist({ ...this.npm.flatOptions, path: where })
const opts = {
...this.npm.flatOptions,
path: where,
log: this.npm.log,
save: false, // npm ci should never modify the lockfile or package.json
}

const arb = new Arborist(opts)
await Promise.all([
arb.loadVirtual().catch(er => {
log.verbose('loadVirtual', er.stack)
Expand All@@ -55,8 +61,7 @@ class CI extends BaseCommand {
}),
removeNodeModules(where),
])
// npm ci should never modify the lockfile or package.json
await arb.reify({ ...this.npm.flatOptions, save: false })
await arb.reify(opts)

const ignoreScripts = this.npm.config.get('ignore-scripts')
// run the same set of scripts that `npm install` runs.
Expand Down
5 changes: 5 additions & 0 deletions deps/npm/lib/config.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,11 @@ class Config extends BaseCommand {
this.config(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.npm.log.warn('config', 'This command does not support workspaces.')
this.exec(args, cb)
}

async config ([action, ...args]) {
this.npm.log.disableProgress()
try {
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/dedupe.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,6 +30,7 @@ class Dedupe extends BaseCommand {
const where = this.npm.prefix
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
path: where,
dryRun,
}
Expand Down
12 changes: 10 additions & 2 deletions deps/npm/lib/exec.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -175,7 +175,11 @@ class Exec extends BaseCommand {
if (needInstall) {
const installDir = this.cacheInstallDir(packages)
await mkdirp(installDir)
const arb = new Arborist({ ...this.npm.flatOptions, path: installDir })
const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: installDir,
})
const tree = await arb.loadActual()

// at this point, we have to ensure that we get the exact same
Expand DownExpand Up@@ -212,7 +216,11 @@ class Exec extends BaseCommand {
throw new Error('canceled')
}
}
await arb.reify({ ...this.npm.flatOptions, add })
await arb.reify({
...this.npm.flatOptions,
log: this.npm.log,
add,
})
}
pathArr.unshift(resolve(installDir, 'node_modules/.bin'))
}
Expand Down
13 changes: 7 additions & 6 deletions deps/npm/lib/install.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -126,15 +126,16 @@ class Install extends BaseCommand {
if (this.npm.config.get('dev'))
log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.')

const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
auditLevel: null,
path: where,
})

await arb.reify({
...this.npm.flatOptions,
add: args,
})
}
const arb = new Arborist(opts)
await arb.reify(opts)

if (!args.length && !isGlobalInstall && !ignoreScripts) {
const scriptShell = this.npm.config.get('script-shell') || undefined
const scripts = [
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/lib/link.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,6 +66,7 @@ class Link extends BaseCommand {
const globalOpts = {
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
prune: false,
}
Expand DownExpand Up@@ -113,12 +114,14 @@ class Link extends BaseCommand {
// reify all the pending names as symlinks there
const localArb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: this.npm.prefix,
save,
})
await localArb.reify({
...this.npm.flatOptions,
path: this.npm.prefix,
log: this.npm.log,
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
save,
})
Expand All@@ -131,9 +134,13 @@ class Link extends BaseCommand {
const arb = new Arborist({
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
})
await arb.reify({ add: [`file:${this.npm.prefix}`] })
await arb.reify({
add: [`file:${this.npm.prefix}`],
log: this.npm.log,
})
await reifyFinish(this.npm, arb)
}

Expand Down
8 changes: 5 additions & 3 deletions deps/npm/lib/prune.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,11 +30,13 @@ class Prune extends BaseCommand {

async prune () {
const where = this.npm.prefix
const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
path: where,
})
await arb.prune(this.npm.flatOptions)
log: this.npm.log,
}
const arb = new Arborist(opts)
await arb.prune(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
11 changes: 11 additions & 0 deletions deps/npm/lib/set-script.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ const log = require('npmlog')
const fs = require('fs')
const parseJSON = require('json-parse-even-better-errors')
const rpj = require('read-package-json-fast')
const { resolve } = require('path')

const BaseCommand = require('./base-command.js')
class SetScript extends BaseCommand {
Expand All@@ -20,6 +21,16 @@ class SetScript extends BaseCommand {
return ['[<script>] [<command>]']
}

async completion (opts) {
const argv = opts.conf.argv.remain
if (argv.length === 2) {
// find the script name
const json = resolve(this.npm.localPrefix, 'package.json')
const { scripts = {} } = await rpj(json).catch(er => ({}))
return Object.keys(scripts)
}
}

exec (args, cb) {
this.set(args).then(() => cb()).catch(cb)
}
Expand Down
16 changes: 10 additions & 6 deletions deps/npm/lib/uninstall.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,8 +38,9 @@ class Uninstall extends BaseCommand {
async uninstall (args) {
// the /path/to/node_modules/..
const global = this.npm.config.get('global')
const prefix = this.npm.config.get('prefix')
const path = global ? resolve(this.npm.globalDir, '..') : prefix
const path = global
? resolve(this.npm.globalDir, '..')
: this.npm.localPrefix

if (!args.length) {
if (!global)
Expand All@@ -60,12 +61,15 @@ class Uninstall extends BaseCommand {
}
}

const arb = new Arborist({ ...this.npm.flatOptions, path })

await arb.reify({
const opts = {
...this.npm.flatOptions,
path,
log: this.npm.log,
rm: args,
})

}
const arb = new Arborist(opts)
await arb.reify(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/update.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,7 @@ class Update extends BaseCommand {

const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: where,
})

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Closed
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
2 changes: 2 additions & 0 deletions deps/npm/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -765,3 +765,5 @@ Jan Sepke <625043+jansepke@users.noreply.github.com>
Augusto Moura <augusto.borgesm@gmail.com>
Eric Chow <eric.zjp.chow@gmail.com>
kbayrhammer <klaus.bayrhammer@redbull.com>
James Chen-Smith <jameschensmith@gmail.com>
Yash Singh <saiansh2525@gmail.com>
77 changes: 77 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
## v7.7.4 (2021-03-24)

### BUG FIXES

* [`200bee74b`](https://github.com/npm/cli/commit/200bee74b31a738687446b7b535cac67b1c582fd)
[#2951](https://github.com/npm/cli/issues/2951)
fix(config): accept explicit `production=false`
([@wraithgar](https://github.com/wraithgar))
* [`7b45e9df6`](https://github.com/npm/cli/commit/7b45e9df6102c7bd6e403d1fdc9939581c38f546)
[#2950](https://github.com/npm/cli/issues/2950)
warn if using workspaces config options in `npm config`
([@ruyadorno](https://github.com/ruyadorno))

## v7.7.3 (2021-03-24)

### BUG FIXES

* [`c76f04ac2`](https://github.com/npm/cli/commit/c76f04ac28ddf2ae4df4b3ce0aec684a118de1b5)
[#2925](https://github.com/npm/cli/issues/2925)
fix(set-script): add completion
([@Yash-Singh1](https://github.com/Yash-Singh1))
* [`0379eab69`](https://github.com/npm/cli/commit/0379eab698b78ae4aa89bbe2043607f420e52f11)
[#2929](https://github.com/npm/cli/issues/2929)
fix(install): ignore auditLevel
`npm install` should not be affected by the `auditLevel` config, as the
results of audit do not change its exit status.
([@wraithgar](https://github.com/wraithgar))
* [`98efadeb4`](https://github.com/npm/cli/commit/98efadeb4b2ae9289f14ed6f42a169230faf7239)
[#2923](https://github.com/npm/cli/issues/2923)
fix(audit-level): add `info` audit level
This is a valid level but wasn't configured to be allowed.
Also added this param to the usage output for `npm audit`
([@wraithgar](https://github.com/wraithgar))
* [`e8d2adcf4`](https://github.com/npm/cli/commit/e8d2adcf40ad63030f844c9aa44c6d16e2146797)
[#2945](https://github.com/npm/cli/issues/2945)
config should not error when workspaces are configured
([@nlf](https://github.com/nlf))
* [`aba2bc623`](https://github.com/npm/cli/commit/aba2bc623ea99e563b1b15b81dbb4ba94f86fe4c)
[#2944](https://github.com/npm/cli/issues/2944)
fix(progress): re-add progress bar to reify
The logger was no longer in flatOptions, we pass it in explicitly now
([@wraithgar](https://github.com/wraithgar))
* [`877b4ed29`](https://github.com/npm/cli/commit/877b4ed2925c97b5249a4d33575420dda64f7339)
[#2946](https://github.com/npm/cli/issues/2946)
fix(flatOptions): re-add `_auth`
This was not being added to flatOptions, and things like
`npm-registry-fetch` are looking for it.
([@wraithgar](https://github.com/wraithgar))

## v7.7.2 (2021-03-24)

### BUG FIXES
* [`a4df2b98d`](https://github.com/npm/cli/commit/a4df2b98d89429b19cd29b5fc895cdbfc0a6bd78)
[#2942](https://github.com/npm/cli/issues/2942)
Restore --dev flag, unify --omit flatteners
([@isaacs](https://github.com/isaacs))

### DEPENDENCIES
* [`2cbfaac0e`](https://github.com/npm/cli/commit/2cbfaac0ecd5810316f6d76168ed9618bd11bf3a)
`hosted-git-info@4.0.2`
* [#83](https://github.com/npm/hosted-git-info/pull/83) Do not parse
urls for gitlab
([@nlf](https://github.com/nlf))

## v7.7.1 (2021-03-24)

### BUG FIXES

* [`543b0e39b`](https://github.com/npm/cli/commit/543b0e39bcb94fc408804b01ca9c0d7b960b2681)
[#2930](https://github.com/npm/cli/issues/2930)
fix(uninstall): use correct local prefix
([@jameschensmith](https://github.com/jameschensmith))
* [`dce4960ef`](https://github.com/npm/cli/commit/dce4960ef6d52af128affe7755b2ca72de913b6c)
[#2932](https://github.com/npm/cli/issues/2932)
fix(config): flatten savePrefix properly
([@wraithgar](https://github.com/wraithgar))

## v7.7.0 (2021-03-23)

### FEATURES
Expand Down
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npm-find-dupes.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,3 +21,4 @@ duplications, without actually changing the package tree.
* [npm ls](/cli-commands/ls)
* [npm update](/cli-commands/update)
* [npm install](/cli-commands/install)

14 changes: 11 additions & 3 deletions deps/npm/docs/content/using-npm/config.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`

* Default: null
* Type: "low", "moderate", "high", "critical", "none", or null
* Type: "info", "low", "moderate", "high", "critical", "none", or null

The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
Expand DownExpand Up@@ -1382,6 +1382,14 @@ What authentication strategy to use with `adduser`/`login`.

`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.

#### `dev`

* Default: false
* Type: Boolean
* DEPRECATED: Please use --include=dev instead.

Alias for `--include=dev`.

#### `init.author.email`

* Default: ""
Expand DownExpand Up@@ -1451,8 +1459,8 @@ Alias for --include=optional or --omit=optional

#### `production`

* Default: false
* Type: Boolean
* Default: null
* Type: null or Boolean
* DEPRECATED: Use `--omit=dev` instead.

Alias for `--omit=dev`
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff 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.7.0 /path/to/npm
<pre lang="bash"><code>npm@7.7.4 /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 numberDiff line numberDiff 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.7.0</p>
<p>7.7.4</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
15 changes: 11 additions & 4 deletions deps/npm/docs/output/using-npm/config.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deps/npm/lib/audit.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,7 @@ class Audit extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
staticgetparams(){
return[
'audit-level',
'dry-run',
'force',
'json',
Expand Down
11 changes: 8 additions & 3 deletions deps/npm/lib/ci.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,8 +42,14 @@ class CI extends BaseCommand {
}

const where = this.npm.prefix
const arb = new Arborist({ ...this.npm.flatOptions, path: where })
const opts = {
...this.npm.flatOptions,
path: where,
log: this.npm.log,
save: false, // npm ci should never modify the lockfile or package.json
}

const arb = new Arborist(opts)
await Promise.all([
arb.loadVirtual().catch(er => {
log.verbose('loadVirtual', er.stack)
Expand All@@ -55,8 +61,7 @@ class CI extends BaseCommand {
}),
removeNodeModules(where),
])
// npm ci should never modify the lockfile or package.json
await arb.reify({ ...this.npm.flatOptions, save: false })
await arb.reify(opts)

const ignoreScripts = this.npm.config.get('ignore-scripts')
// run the same set of scripts that `npm install` runs.
Expand Down
5 changes: 5 additions & 0 deletions deps/npm/lib/config.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,11 @@ class Config extends BaseCommand {
this.config(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.npm.log.warn('config', 'This command does not support workspaces.')
this.exec(args, cb)
}

async config ([action, ...args]) {
this.npm.log.disableProgress()
try {
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/dedupe.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,6 +30,7 @@ class Dedupe extends BaseCommand {
const where = this.npm.prefix
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
path: where,
dryRun,
}
Expand Down
12 changes: 10 additions & 2 deletions deps/npm/lib/exec.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -175,7 +175,11 @@ class Exec extends BaseCommand {
if (needInstall) {
const installDir = this.cacheInstallDir(packages)
await mkdirp(installDir)
const arb = new Arborist({ ...this.npm.flatOptions, path: installDir })
const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: installDir,
})
const tree = await arb.loadActual()

// at this point, we have to ensure that we get the exact same
Expand DownExpand Up@@ -212,7 +216,11 @@ class Exec extends BaseCommand {
throw new Error('canceled')
}
}
await arb.reify({ ...this.npm.flatOptions, add })
await arb.reify({
...this.npm.flatOptions,
log: this.npm.log,
add,
})
}
pathArr.unshift(resolve(installDir, 'node_modules/.bin'))
}
Expand Down
13 changes: 7 additions & 6 deletions deps/npm/lib/install.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -126,15 +126,16 @@ class Install extends BaseCommand {
if (this.npm.config.get('dev'))
log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.')

const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
auditLevel: null,
path: where,
})

await arb.reify({
...this.npm.flatOptions,
add: args,
})
}
const arb = new Arborist(opts)
await arb.reify(opts)

if (!args.length && !isGlobalInstall && !ignoreScripts) {
const scriptShell = this.npm.config.get('script-shell') || undefined
const scripts = [
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/lib/link.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,6 +66,7 @@ class Link extends BaseCommand {
const globalOpts = {
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
prune: false,
}
Expand DownExpand Up@@ -113,12 +114,14 @@ class Link extends BaseCommand {
// reify all the pending names as symlinks there
const localArb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: this.npm.prefix,
save,
})
await localArb.reify({
...this.npm.flatOptions,
path: this.npm.prefix,
log: this.npm.log,
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
save,
})
Expand All@@ -131,9 +134,13 @@ class Link extends BaseCommand {
const arb = new Arborist({
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
})
await arb.reify({ add: [`file:${this.npm.prefix}`] })
await arb.reify({
add: [`file:${this.npm.prefix}`],
log: this.npm.log,
})
await reifyFinish(this.npm, arb)
}

Expand Down
8 changes: 5 additions & 3 deletions deps/npm/lib/prune.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,11 +30,13 @@ class Prune extends BaseCommand {

async prune () {
const where = this.npm.prefix
const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
path: where,
})
await arb.prune(this.npm.flatOptions)
log: this.npm.log,
}
const arb = new Arborist(opts)
await arb.prune(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
11 changes: 11 additions & 0 deletions deps/npm/lib/set-script.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ const log = require('npmlog')
const fs = require('fs')
const parseJSON = require('json-parse-even-better-errors')
const rpj = require('read-package-json-fast')
const { resolve } = require('path')

const BaseCommand = require('./base-command.js')
class SetScript extends BaseCommand {
Expand All@@ -20,6 +21,16 @@ class SetScript extends BaseCommand {
return ['[<script>] [<command>]']
}

async completion (opts) {
const argv = opts.conf.argv.remain
if (argv.length === 2) {
// find the script name
const json = resolve(this.npm.localPrefix, 'package.json')
const { scripts = {} } = await rpj(json).catch(er => ({}))
return Object.keys(scripts)
}
}

exec (args, cb) {
this.set(args).then(() => cb()).catch(cb)
}
Expand Down
16 changes: 10 additions & 6 deletions deps/npm/lib/uninstall.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,8 +38,9 @@ class Uninstall extends BaseCommand {
async uninstall (args) {
// the /path/to/node_modules/..
const global = this.npm.config.get('global')
const prefix = this.npm.config.get('prefix')
const path = global ? resolve(this.npm.globalDir, '..') : prefix
const path = global
? resolve(this.npm.globalDir, '..')
: this.npm.localPrefix

if (!args.length) {
if (!global)
Expand All@@ -60,12 +61,15 @@ class Uninstall extends BaseCommand {
}
}

const arb = new Arborist({ ...this.npm.flatOptions, path })

await arb.reify({
const opts = {
...this.npm.flatOptions,
path,
log: this.npm.log,
rm: args,
})

}
const arb = new Arborist(opts)
await arb.reify(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/update.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,7 @@ class Update extends BaseCommand {

const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: where,
})

Expand Down
Loading