| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cde5960 commit eaeb870
11 files changed
| 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 | - npm@9.3.0 /path/to/npm | ||
| 30 | + npm@9.3.1 /path/to/npm | ||
| 31 | 31 | └─┬ init-package-json@0.0.4 | |
| 32 | 32 | └── promzard@0.1.5 | |
| 33 | 33 | ``` | |
| 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 | - 9.3.0 | ||
| 17 | + 9.3.1 | ||
| 18 | 18 | ||
| 19 | 19 | ### Description | |
| 20 | 20 | ||
| 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 | - <pre><code class="language-bash">npm@9.3.0 /path/to/npm | ||
| 163 | + <pre><code class="language-bash">npm@9.3.1 /path/to/npm | ||
| 164 | 164 | └─┬ init-package-json@0.0.4 | |
| 165 | 165 | └── promzard@0.1.5 | |
| 166 | 166 | </code></pre> | |
| 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>9.3.0</p> | ||
| 153 | + <p>9.3.1</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 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,7 +67,7 @@ class CI extends ArboristWorkspaceCmd { | |||
| 67 | 67 | const path = `${where}/node_modules` | |
| 68 | 68 | // get the list of entries so we can skip the glob for performance | |
| 69 | 69 | const entries = await fs.readdir(path, null).catch(er => []) | |
| 70 | - return Promise.all(entries.map(f => fs.rm(`${path}/${f}`, { force: true }))) | ||
| 70 | + return Promise.all(entries.map(f => fs.rm(`${path}/${f}`, { force: true, recursive: true }))) | ||
| 71 | 71 | }) | |
| 72 | 72 | ||
| 73 | 73 | await arb.reify(opts) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,19 +52,21 @@ class Deprecate extends BaseCommand { | |||
| 52 | 52 | query: { write: true }, | |
| 53 | 53 | }) | |
| 54 | 54 | ||
| 55 | - Object.keys(packument.versions) | ||
| 55 | + const versions = Object.keys(packument.versions) | ||
| 56 | 56 | .filter(v => semver.satisfies(v, spec, { includePrerelease: true })) | |
| 57 | - .forEach(v => { | ||
| 58 | - packument.versions[v].deprecated = msg | ||
| 59 | - }) | ||
| 60 | 57 | ||
| 61 | - return otplease(this.npm, this.npm.flatOptions, opts => fetch(uri, { | ||
| 62 | - ...opts, | ||
| 63 | - spec: p, | ||
| 64 | - method: 'PUT', | ||
| 65 | - body: packument, | ||
| 66 | - ignoreBody: true, | ||
| 67 | - })) | ||
| 58 | + if (versions.length) { | ||
| 59 | + for (const v of versions) { | ||
| 60 | + packument.versions[v].deprecated = msg | ||
| 61 | + } | ||
| 62 | + return otplease(this.npm, this.npm.flatOptions, opts => fetch(uri, { | ||
| 63 | + ...opts, | ||
| 64 | + spec: p, | ||
| 65 | + method: 'PUT', | ||
| 66 | + body: packument, | ||
| 67 | + ignoreBody: true, | ||
| 68 | + })) | ||
| 69 | + } | ||
| 68 | 70 | } | |
| 69 | 71 | } | |
| 70 | 72 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ Positional arguments are \fBname@version-range\fR identifiers, which will limit | |||
| 20 | 20 | .P | |
| 21 | 21 | .RS 2 | |
| 22 | 22 | .nf | |
| 23 | - npm@9.3.0 /path/to/npm | ||
| 23 | + npm@9.3.1 /path/to/npm | ||
| 24 | 24 | └─┬ init-package-json@0.0.4 | |
| 25 | 25 | └── promzard@0.1.5 | |
| 26 | 26 | .fi | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ npm | |||
| 12 | 12 | Note: This command is unaware of workspaces. | |
| 13 | 13 | .SS "Version" | |
| 14 | 14 | .P | |
| 15 | - 9.3.0 | ||
| 15 | + 9.3.1 | ||
| 16 | 16 | .SS "Description" | |
| 17 | 17 | .P | |
| 18 | 18 | npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | { | |
| 2 | - "version": "9.3.0", | ||
| 2 | + "version": "9.3.1", | ||
| 3 | 3 | "name": "npm", | |
| 4 | 4 | "description": "a package manager for JavaScript", | |
| 5 | 5 | "workspaces": [ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,6 +79,30 @@ t.test('reifies, audits, removes node_modules', async t => { | |||
| 79 | 79 | t.equal(fs.existsSync(nmAbbrev), true, 'installs abbrev') | |
| 80 | 80 | }) | |
| 81 | 81 | ||
| 82 | + t.test('reifies, audits, removes node_modules on repeat run', async t => { | ||
| 83 | + const { npm, joinedOutput, registry } = await loadMockNpm(t, { | ||
| 84 | + prefixDir: { | ||
| 85 | + abbrev: abbrev, | ||
| 86 | + 'package.json': JSON.stringify(packageJson), | ||
| 87 | + 'package-lock.json': JSON.stringify(packageLock), | ||
| 88 | + node_modules: { test: 'test file that will be removed' }, | ||
| 89 | + }, | ||
| 90 | + }) | ||
| 91 | + const manifest = registry.manifest({ name: 'abbrev' }) | ||
| 92 | + await registry.tarball({ | ||
| 93 | + manifest: manifest.versions['1.0.0'], | ||
| 94 | + tarball: path.join(npm.prefix, 'abbrev'), | ||
| 95 | + }) | ||
| 96 | + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) | ||
| 97 | + await npm.exec('ci', []) | ||
| 98 | + await npm.exec('ci', []) | ||
| 99 | + t.match(joinedOutput(), 'added 1 package, and audited 2 packages in') | ||
| 100 | + const nmTest = path.join(npm.prefix, 'node_modules', 'test') | ||
| 101 | + t.equal(fs.existsSync(nmTest), false, 'existing node_modules is removed') | ||
| 102 | + const nmAbbrev = path.join(npm.prefix, 'node_modules', 'abbrev') | ||
| 103 | + t.equal(fs.existsSync(nmAbbrev), true, 'installs abbrev') | ||
| 104 | + }) | ||
| 105 | + | ||
| 82 | 106 | t.test('--no-audit and --ignore-scripts', async t => { | |
| 83 | 107 | const { npm, joinedOutput, registry } = await loadMockNpm(t, { | |
| 84 | 108 | config: { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments