| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| 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.8.0 /path/to/npm | ||
| 30 | + npm@9.8.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.8.0 | ||
| 17 | + 9.8.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.8.0 /path/to/npm | ||
| 163 | + <pre><code class="language-bash">npm@9.8.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.8.0</p> | ||
| 153 | + <p>9.8.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 | |
|---|---|---|---|
@@ -89,7 +89,7 @@ class Publish extends BaseCommand { | |||
| 89 | 89 | // The purpose of re-reading the manifest is in case it changed, | |
| 90 | 90 | // so that we send the latest and greatest thing to the registry | |
| 91 | 91 | // note that publishConfig might have changed as well! | |
| 92 | - manifest = await this.getManifest(spec, opts) | ||
| 92 | + manifest = await this.getManifest(spec, opts, true) | ||
| 93 | 93 | ||
| 94 | 94 | // JSON already has the package contents | |
| 95 | 95 | if (!json) { | |
@@ -196,11 +196,18 @@ class Publish extends BaseCommand { | |||
| 196 | 196 | // if it's a directory, read it from the file system | |
| 197 | 197 | // otherwise, get the full metadata from whatever it is | |
| 198 | 198 | // XXX can't pacote read the manifest from a directory? | |
| 199 | - async getManifest (spec, opts) { | ||
| 199 | + async getManifest (spec, opts, logWarnings = false) { | ||
| 200 | 200 | let manifest | |
| 201 | 201 | if (spec.type === 'directory') { | |
| 202 | + const changes = [] | ||
| 203 | + const pkg = await pkgJson.fix(spec.fetchSpec, { changes }) | ||
| 204 | + if (changes.length && logWarnings) { | ||
| 205 | + /* eslint-disable-next-line max-len */ | ||
| 206 | + log.warn('publish', 'npm auto-corrected some errors in your package.json when publishing. Please run "npm pkg fix" to address these errors.') | ||
| 207 | + log.warn('publish', `errors corrected:\n${changes.join('\n')}`) | ||
| 208 | + } | ||
| 202 | 209 | // Prepare is the special function for publishing, different than normalize | |
| 203 | - const { content } = await pkgJson.prepare(spec.fetchSpec) | ||
| 210 | + const { content } = await pkg.prepare() | ||
| 204 | 211 | manifest = content | |
| 205 | 212 | } else { | |
| 206 | 213 | manifest = await pacote.manifest(spec, { | |
| 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.8.0 /path/to/npm | ||
| 23 | + npm@9.8.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.8.0 | ||
| 15 | + 9.8.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. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments