GeezerVison is showing github.com — deps: upgrade npm to 10.2.4 · nodejs/node@68e7d49
File treeExpand file treeCollapse file tree Open diff view settings @isaacs/cliui/node_modules disparity-colors/node_modules/ansi-styles
string-width-cjs/node_modules string-width/node_modules strip-ansi-cjs/node_modules/ansi-regex wrap-ansi-cjs/node_modules
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/content/commands/npm-ls.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For | 27 | 27 | example, running `npm ls promzard` in npm's source tree will show: | 28 | 28 |
| 29 | 29 | ```bash | 30 | | - | | 30 | + | 31 | 31 | | 32 | 32 | | 33 | 33 | ``` | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/content/commands/npm-prune.md +2-3Lines changed: 2 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -18,10 +18,9 @@ then only packages matching one of the supplied names are removed. | 18 | 18 | Extraneous packages are those present in the `node_modules` folder that are | 19 | 19 | not listed as any package's dependency list. | 20 | 20 |
| 21 | | -If the `--production` flag is specified or the `NODE_ENV` environment | | 21 | +If the `--omit=dev` flag is specified or the `NODE_ENV` environment | 22 | 22 | variable is set to `production`, this command will remove the packages | 23 | | -specified in your `devDependencies`. Setting `--no-production` will negate | 24 | | -`NODE_ENV` being set to `production`. | | 23 | +specified in your `devDependencies`. | 25 | 24 |
| 26 | 25 | If the `--dry-run` flag is used then no changes will actually be made. | 27 | 26 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/content/commands/npm-view.md +7Lines changed: 7 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -32,6 +32,13 @@ For example, to show the dependencies of the `ronn` package at version | 32 | 32 | | 33 | 33 | ``` | 34 | 34 |
| | 35 | +By default, `npm view` shows data about the current project context (by looking for a `package.json`). | | 36 | +To show field data for the current project use a file path (i.e. `.`): | | 37 | + | | 38 | +```bash | | 39 | +npm view . dependencies | | 40 | +``` | | 41 | + | 35 | 42 | You can view child fields by separating them with a period. | 36 | 43 | To view the git repository URL for the latest version of `npm`, you would run the following command: | 37 | 44 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/content/commands/npm.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ Note: This command is unaware of workspaces. | 14 | 14 |
| 15 | 15 | ### Version | 16 | 16 |
| 17 | | -10.2.3 | | 17 | +10.2.4 | 18 | 18 |
| 19 | 19 | ### Description | 20 | 20 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm-ls.html +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -160,7 +160,7 @@ <h3 id="description">Description</h3> | 160 | 160 | the results to only the paths to the packages named. Note that nested | 161 | 161 | packages will <em>also</em> show the paths to the specified packages. For | 162 | 162 | example, running <code>npm ls promzard</code> in npm's source tree will show:</p> | 163 | | - | | 163 | + | 164 | 164 | | 165 | 165 | | 166 | 166 | </code></pre> | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm-prune.html +2-3Lines changed: 2 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -153,10 +153,9 @@ <h3 id="description">Description</h3> | 153 | 153 | then only packages matching one of the supplied names are removed.</p> | 154 | 154 | <p>Extraneous packages are those present in the <code>node_modules</code> folder that are | 155 | 155 | not listed as any package's dependency list.</p> | 156 | | -<p>If the <code>--production</code> flag is specified or the <code>NODE_ENV</code> environment | | 156 | +<p>If the <code>--omit=dev</code> flag is specified or the <code>NODE_ENV</code> environment | 157 | 157 | variable is set to <code>production</code>, this command will remove the packages | 158 | | -specified in your <code>devDependencies</code>. Setting <code>--no-production</code> will negate | 159 | | -<code>NODE_ENV</code> being set to <code>production</code>.</p> | | 158 | +specified in your <code>devDependencies</code>.</p> | 160 | 159 | <p>If the <code>--dry-run</code> flag is used then no changes will actually be made.</p> | 161 | 160 | <p>If the <code>--json</code> flag is used, then the changes <code>npm prune</code> made (or would | 162 | 161 | have made with <code>--dry-run</code>) are printed as a JSON object.</p> | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm-view.html +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -161,6 +161,10 @@ <h3 id="description">Description</h3> | 161 | 161 | <code>0.3.5</code>, you could do the following:</p> | 162 | 162 | | 163 | 163 | </code></pre> | | 164 | +<p>By default, <code>npm view</code> shows data about the current project context (by looking for a <code>package.json</code>). | | 165 | +To show field data for the current project use a file path (i.e. <code>.</code>):</p> | | 166 | +<pre><code class="language-bash">npm view . dependencies | | 167 | +</code></pre> | 164 | 168 | <p>You can view child fields by separating them with a period. | 165 | 169 | To view the git repository URL for the latest version of <code>npm</code>, you would run the following command:</p> | 166 | 170 | <pre><code class="language-bash">npm view npm repository.url | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm.html +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -150,7 +150,7 @@ <h2 id="table-of-contents">Table of contents</h2> | 150 | 150 | </code></pre> | 151 | 151 | <p>Note: This command is unaware of workspaces.</p> | 152 | 152 | <h3 id="version">Version</h3> | 153 | | -<p>10.2.3</p> | | 153 | +<p>10.2.4</p> | 154 | 154 | <h3 id="description">Description</h3> | 155 | 155 | <p>npm is the package manager for the Node JavaScript platform. It puts | 156 | 156 | modules in place so that node can find them, and manages dependency | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/lib/commands/exec.js +17-8Lines changed: 17 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,24 +34,33 @@ class Exec extends BaseCommand { | 34 | 34 | for (const [name, path] of this.workspaces) { | 35 | 35 | const locationMsg = | 36 | 36 | `in workspace ${this.npm.chalk.green(name)} at location:\n${this.npm.chalk.dim(path)}` | 37 | | - await this.callExec(args, { locationMsg, runPath: path }) | | 37 | + await this.callExec(args, { name, locationMsg, runPath: path }) | 38 | 38 | } | 39 | 39 | } | 40 | 40 |
| 41 | | - async callExec (args, { locationMsg, runPath } = {}) { | 42 | | - // This is where libnpmexec will look for locally installed packages | | 41 | + async callExec (args, { name, locationMsg, runPath } = {}) { | | 42 | + // This is where libnpmexec will look for locally installed packages at the project level | 43 | 43 | const localPrefix = this.npm.localPrefix | | 44 | + // This is where libnpmexec will look for locally installed packages at the workspace level | | 45 | + let localBin = this.npm.localBin | | 46 | + let path = localPrefix | 44 | 47 |
| 45 | 48 | // This is where libnpmexec will actually run the scripts from | 46 | 49 | if (!runPath) { | 47 | 50 | runPath = process.cwd() | | 51 | + } else { | | 52 | + // We have to consider if the workspace has its own separate versions | | 53 | + // libnpmexec will walk up to localDir after looking here | | 54 | + localBin = resolve(this.npm.localDir, name, 'node_modules', '.bin') | | 55 | + // We also need to look for `bin` entries in the workspace package.json | | 56 | + // libnpmexec will NOT look in the project root for the bin entry | | 57 | + path = runPath | 48 | 58 | } | 49 | 59 |
| 50 | 60 | const call = this.npm.config.get('call') | 51 | 61 | let globalPath | 52 | 62 | const { | 53 | 63 | flatOptions, | 54 | | - localBin, | 55 | 64 | globalBin, | 56 | 65 | globalDir, | 57 | 66 | chalk, | @@ -79,14 +88,14 @@ class Exec extends BaseCommand { | 79 | 88 | // copy args so they dont get mutated | 80 | 89 | args: [...args], | 81 | 90 | call, | 82 | | - localBin, | 83 | | - locationMsg, | | 91 | + chalk, | 84 | 92 | globalBin, | 85 | 93 | globalPath, | | 94 | + localBin, | | 95 | + locationMsg, | 86 | 96 | output, | 87 | | - chalk, | 88 | 97 | packages, | 89 | | - path: localPrefix, | | 98 | + path, | 90 | 99 | runPath, | 91 | 100 | scriptShell, | 92 | 101 | yes, | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/lib/commands/outdated.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,6 @@ const npa = require('npm-package-arg') | 6 | 6 | const pickManifest = require('npm-pick-manifest') | 7 | 7 | const localeCompare = require('@isaacs/string-locale-compare')('en') | 8 | 8 |
| 9 | | -const ansiTrim = require('strip-ansi') | 10 | 9 | const ArboristWorkspaceCmd = require('../arborist-cmd.js') | 11 | 10 |
| 12 | 11 | class Outdated extends ArboristWorkspaceCmd { | @@ -23,6 +22,7 @@ class Outdated extends ArboristWorkspaceCmd { | 23 | 22 | ] | 24 | 23 |
| 25 | 24 | async exec (args) { | | 25 | + const { default: stripAnsi } = await import('strip-ansi') | 26 | 26 | const global = resolve(this.npm.globalDir, '..') | 27 | 27 | const where = this.npm.global | 28 | 28 | ? global | @@ -106,7 +106,7 @@ class Outdated extends ArboristWorkspaceCmd { | 106 | 106 |
| 107 | 107 | const tableOpts = { | 108 | 108 | align: ['l', 'r', 'r', 'r', 'l'], | 109 | | - stringLength: s => ansiTrim(s).length, | | 109 | + stringLength: s => stripAnsi(s).length, | 110 | 110 | } | 111 | 111 | this.npm.output(table(outTable, tableOpts)) | 112 | 112 | } | |
|