| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,38 @@ | |||
| 1 | - ## v7.5.2 (2021-02-02 | ||
| 1 | + ## v7.5.3 (2021-02-08) | ||
| 2 | + | ||
| 3 | + ### BUG FIXES | ||
| 4 | + | ||
| 5 | + * [`df596bf4c`](https://github.com/npm/cli/commit/df596bf4c10d6917672579cc38800f5e846002bc) | ||
| 6 | + fix(publish): follow all configs for registry auth check | ||
| 7 | + [#2602](https://github.com/npm/cli/issues/2602) | ||
| 8 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 9 | + * [`6d7afb03c`](https://github.com/npm/cli/commit/6d7afb03cd7602b60e709516711a2f94cd61ff25) | ||
| 10 | + [#2613](https://github.com/npm/cli/issues/2613) | ||
| 11 | + install script: pass -q to curl calls to disable user .curlrc files | ||
| 12 | + ([@nlf](https://github.com/nlf)) | ||
| 13 | + | ||
| 14 | + ### DEPENDENCIES | ||
| 15 | + | ||
| 16 | + * [`3294fed6f`](https://github.com/npm/cli/commit/3294fed6f18626516978c21fac5f28ecfdb58124) | ||
| 17 | + `pacote@11.2.5` | ||
| 18 | + * prevent infinite recursion in git dep preparation | ||
| 19 | + * [`0f7a3a87c`](https://github.com/npm/cli/commit/0f7a3a87c12e30bdd2cdab596ca6511de787c969) | ||
| 20 | + `read-package-json-fast@2.0.1` | ||
| 21 | + * avoid duplicating optionalDependencies as dependencies in package.json | ||
| 22 | + * [`6f46b0f7f`](https://github.com/npm/cli/commit/6f46b0f7fef9891e6de4af3547c70a67cb3a7a13) | ||
| 23 | + `init-package-json@2.0.2` | ||
| 24 | + * [`df4f65acc`](https://github.com/npm/cli/commit/df4f65acc4ceaf15db4c227670e80f94584c055c) | ||
| 25 | + `@npmcli/arborist@2.2.0` | ||
| 26 | + * [`7038c2ff4`](https://github.com/npm/cli/commit/7038c2ff49022f8babd495d1b831b5c82d6aed05) | ||
| 27 | + `@npmcli/run-script@1.8.2` | ||
| 28 | + * [`54cd4c87a`](https://github.com/npm/cli/commit/54cd4c87a71c9381519d8ac52e306096066dc92e) | ||
| 29 | + `libnpmversion@1.0.8` | ||
| 30 | + * [`9ab36aae4`](https://github.com/npm/cli/commit/9ab36aae429784df754211d5f086a515012b9bdd) | ||
| 31 | + `graceful-fs@4.2.5` | ||
| 32 | + * [`e1822cf27`](https://github.com/npm/cli/commit/e1822cf277336728f1d5696ffe0db3ea6e700d9e) | ||
| 33 | + `@npmcli/installed-package-contents@1.0.7` | ||
| 34 | + | ||
| 35 | + ## v7.5.2 (2021-02-02) | ||
| 2 | 36 | ||
| 3 | 37 | ### BUG FIXES | |
| 4 | 38 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ | |||
| 15 | 15 | You can download & install **`npm`** directly from [**npmjs**.com](https://npmjs.com/) using our custom `install.sh` script: | |
| 16 | 16 | ||
| 17 | 17 | ```bash | |
| 18 | - curl -L https://www.npmjs.com/install.sh | sh | ||
| 18 | + curl -qL https://www.npmjs.com/install.sh | sh | ||
| 19 | 19 | ``` | |
| 20 | 20 | ||
| 21 | 21 | #### Node Version Managers | |
@@ -50,4 +50,4 @@ npm <command> | |||
| 50 | 50 | ### Acknowledgments | |
| 51 | 51 | ||
| 52 | 52 | * `npm` is configured to use the **npm Public Registry** at [https://registry.npmjs.org](https://registry.npmjs.org) by default; Usage of this registry is subject to **Terms of Use** available at [https://npmjs.com/policies/terms](https://npmjs.com/policies/terms) | |
| 53 | - * You can configure `npm` to use any other compatible registry you prefer. You can read more about configuring third-party registries [here](https://docs.npmjs.com/cli/v7/using-npm/registry) | ||
| 53 | + * You can configure `npm` to use any other compatible registry you prefer. You can read more about configuring third-party registries [here](https://docs.npmjs.com/cli/v7/using-npm/registry) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -159,7 +159,7 @@ <h3 id="description">Description</h3> | |||
| 159 | 159 | the results to only the paths to the packages named. Note that nested | |
| 160 | 160 | packages will <em>also</em> show the paths to the specified packages. For | |
| 161 | 161 | example, running <code>npm ls promzard</code> in npm’s source tree will show:</p> | |
| 162 | - <pre lang="bash"><code>npm@7.5.2 /path/to/npm | ||
| 162 | + <pre lang="bash"><code>npm@7.5.3 /path/to/npm | ||
| 163 | 163 | └─┬ init-package-json@0.0.4 | |
| 164 | 164 | └── promzard@0.1.5 | |
| 165 | 165 | </code></pre> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2> | |||
| 148 | 148 | <pre lang="bash"><code>npm <command> [args] | |
| 149 | 149 | </code></pre> | |
| 150 | 150 | <h3 id="version">Version</h3> | |
| 151 | - <p>7.5.2</p> | ||
| 151 | + <p>7.5.3</p> | ||
| 152 | 152 | <h3 id="description">Description</h3> | |
| 153 | 153 | <p>npm is the package manager for the Node JavaScript platform. It puts | |
| 154 | 154 | modules in place so that node can find them, and manages dependency | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,22 +8,22 @@ help.completion = function (opts, cb) { | |||
| 8 | 8 | } | |
| 9 | 9 | ||
| 10 | 10 | const npmUsage = require('./utils/npm-usage.js') | |
| 11 | - var path = require('path') | ||
| 12 | - var spawn = require('./utils/spawn') | ||
| 13 | - var npm = require('./npm.js') | ||
| 14 | - var log = require('npmlog') | ||
| 15 | - var openUrl = require('./utils/open-url') | ||
| 16 | - var glob = require('glob') | ||
| 17 | - var output = require('./utils/output.js') | ||
| 11 | + const { spawn } = require('child_process') | ||
| 12 | + const path = require('path') | ||
| 13 | + const npm = require('./npm.js') | ||
| 14 | + const log = require('npmlog') | ||
| 15 | + const openUrl = require('./utils/open-url') | ||
| 16 | + const glob = require('glob') | ||
| 17 | + const output = require('./utils/output.js') | ||
| 18 | 18 | ||
| 19 | 19 | const usage = require('./utils/usage.js') | |
| 20 | 20 | ||
| 21 | 21 | help.usage = usage('help', 'npm help <term> [<terms..>]') | |
| 22 | 22 | ||
| 23 | 23 | function help (args, cb) { | |
| 24 | - var argv = npm.config.parsedArgv.cooked | ||
| 24 | + const argv = npm.config.parsedArgv.cooked | ||
| 25 | 25 | ||
| 26 | - var argnum = 0 | ||
| 26 | + let argnum = 0 | ||
| 27 | 27 | if (args.length === 2 && ~~args[0]) | |
| 28 | 28 | argnum = ~~args.shift() | |
| 29 | 29 | ||
@@ -34,7 +34,7 @@ function help (args, cb) { | |||
| 34 | 34 | const affordances = { | |
| 35 | 35 | 'find-dupes': 'dedupe', | |
| 36 | 36 | } | |
| 37 | - var section = affordances[args[0]] || npm.deref(args[0]) || args[0] | ||
| 37 | + let section = affordances[args[0]] || npm.deref(args[0]) || args[0] | ||
| 38 | 38 | ||
| 39 | 39 | // npm help <noargs>: show basic usage | |
| 40 | 40 | if (!section) { | |
@@ -52,15 +52,12 @@ function help (args, cb) { | |||
| 52 | 52 | return cb() | |
| 53 | 53 | } | |
| 54 | 54 | ||
| 55 | - var pref = [1, 5, 7] | ||
| 56 | - if (argnum) { | ||
| 57 | - pref = [argnum].concat(pref.filter(function (n) { | ||
| 58 | - return n !== argnum | ||
| 59 | - })) | ||
| 60 | - } | ||
| 55 | + let pref = [1, 5, 7] | ||
| 56 | + if (argnum) | ||
| 57 | + pref = [argnum].concat(pref.filter(n => n !== argnum)) | ||
| 61 | 58 | ||
| 62 | 59 | // npm help <section>: Try to find the path | |
| 63 | - var manroot = path.resolve(__dirname, '..', 'man') | ||
| 60 | + const manroot = path.resolve(__dirname, '..', 'man') | ||
| 64 | 61 | ||
| 65 | 62 | // legacy | |
| 66 | 63 | if (section === 'global') | |
@@ -71,18 +68,18 @@ function help (args, cb) { | |||
| 71 | 68 | // find either /section.n or /npm-section.n | |
| 72 | 69 | // The glob is used in the glob. The regexp is used much | |
| 73 | 70 | // further down. Globs and regexps are different | |
| 74 | - var compextglob = '.+(gz|bz2|lzma|[FYzZ]|xz)' | ||
| 75 | - var compextre = '\\.(gz|bz2|lzma|[FYzZ]|xz)$' | ||
| 76 | - var f = '+(npm-' + section + '|' + section + ').[0-9]?(' + compextglob + ')' | ||
| 77 | - return glob(manroot + '/*/' + f, function (er, mans) { | ||
| 71 | + const compextglob = '.+(gz|bz2|lzma|[FYzZ]|xz)' | ||
| 72 | + const compextre = '\\.(gz|bz2|lzma|[FYzZ]|xz)$' | ||
| 73 | + const f = '+(npm-' + section + '|' + section + ').[0-9]?(' + compextglob + ')' | ||
| 74 | + return glob(manroot + '/*/' + f, (er, mans) => { | ||
| 78 | 75 | if (er) | |
| 79 | 76 | return cb(er) | |
| 80 | 77 | ||
| 81 | 78 | if (!mans.length) | |
| 82 | 79 | return npm.commands['help-search'](args, cb) | |
| 83 | 80 | ||
| 84 | - mans = mans.map(function (man) { | ||
| 85 | - var ext = path.extname(man) | ||
| 81 | + mans = mans.map((man) => { | ||
| 82 | + const ext = path.extname(man) | ||
| 86 | 83 | if (man.match(new RegExp(compextre))) | |
| 87 | 84 | man = path.basename(man, ext) | |
| 88 | 85 | ||
@@ -94,14 +91,12 @@ function help (args, cb) { | |||
| 94 | 91 | } | |
| 95 | 92 | ||
| 96 | 93 | function pickMan (mans, pref_) { | |
| 97 | - var nre = /([0-9]+)$/ | ||
| 98 | - var pref = {} | ||
| 99 | - pref_.forEach(function (sect, i) { | ||
| 100 | - pref[sect] = i | ||
| 101 | - }) | ||
| 102 | - mans = mans.sort(function (a, b) { | ||
| 103 | - var an = a.match(nre)[1] | ||
| 104 | - var bn = b.match(nre)[1] | ||
| 94 | + const nre = /([0-9]+)$/ | ||
| 95 | + const pref = {} | ||
| 96 | + pref_.forEach((sect, i) => pref[sect] = i) | ||
| 97 | + mans = mans.sort((a, b) => { | ||
| 98 | + const an = a.match(nre)[1] | ||
| 99 | + const bn = b.match(nre)[1] | ||
| 105 | 100 | return an === bn ? (a > b ? -1 : 1) | |
| 106 | 101 | : pref[an] < pref[bn] ? -1 | |
| 107 | 102 | : 1 | |
@@ -110,48 +105,61 @@ function pickMan (mans, pref_) { | |||
| 110 | 105 | } | |
| 111 | 106 | ||
| 112 | 107 | function viewMan (man, cb) { | |
| 113 | - var nre = /([0-9]+)$/ | ||
| 114 | - var num = man.match(nre)[1] | ||
| 115 | - var section = path.basename(man, '.' + num) | ||
| 108 | + const nre = /([0-9]+)$/ | ||
| 109 | + const num = man.match(nre)[1] | ||
| 110 | + const section = path.basename(man, '.' + num) | ||
| 116 | 111 | ||
| 117 | 112 | // at this point, we know that the specified man page exists | |
| 118 | - var manpath = path.join(__dirname, '..', 'man') | ||
| 119 | - var env = {} | ||
| 113 | + const manpath = path.join(__dirname, '..', 'man') | ||
| 114 | + const env = {} | ||
| 120 | 115 | Object.keys(process.env).forEach(function (i) { | |
| 121 | 116 | env[i] = process.env[i] | |
| 122 | 117 | }) | |
| 123 | 118 | env.MANPATH = manpath | |
| 124 | - var viewer = npm.config.get('viewer') | ||
| 119 | + const viewer = npm.config.get('viewer') | ||
| 120 | + | ||
| 121 | + const opts = { | ||
| 122 | + env, | ||
| 123 | + stdio: 'inherit', | ||
| 124 | + } | ||
| 125 | 125 | ||
| 126 | - var conf | ||
| 126 | + let bin = 'man' | ||
| 127 | + const args = [] | ||
| 127 | 128 | switch (viewer) { | |
| 128 | 129 | case 'woman': | |
| 129 | - var a = ['-e', '(woman-find-file \'' + man + '\')'] | ||
| 130 | - conf = { env: env, stdio: 'inherit' } | ||
| 131 | - var woman = spawn('emacsclient', a, conf) | ||
| 132 | - woman.on('close', cb) | ||
| 130 | + bin = 'emacsclient' | ||
| 131 | + args.push('-e', `(woman-find-file '${man}')`) | ||
| 133 | 132 | break | |
| 134 | 133 | ||
| 135 | 134 | case 'browser': | |
| 135 | + bin = false | ||
| 136 | 136 | try { | |
| 137 | - var url = htmlMan(man) | ||
| 137 | + const url = htmlMan(man) | ||
| 138 | + openUrl(url, 'help available at the following URL', cb) | ||
| 138 | 139 | } catch (err) { | |
| 139 | 140 | return cb(err) | |
| 140 | 141 | } | |
| 141 | - openUrl(url, 'help available at the following URL', cb) | ||
| 142 | 142 | break | |
| 143 | 143 | ||
| 144 | 144 | default: | |
| 145 | - conf = { env: env, stdio: 'inherit' } | ||
| 146 | - var manProcess = spawn('man', [num, section], conf) | ||
| 147 | - manProcess.on('close', cb) | ||
| 145 | + args.push(num, section) | ||
| 148 | 146 | break | |
| 149 | 147 | } | |
| 148 | + | ||
| 149 | + if (bin) { | ||
| 150 | + const proc = spawn(bin, args, opts) | ||
| 151 | + proc.on('exit', (code) => { | ||
| 152 | + if (code) | ||
| 153 | + return cb(new Error(`help process exited with code: ${code}`)) | ||
| 154 | + | ||
| 155 | + return cb() | ||
| 156 | + }) | ||
| 157 | + } | ||
| 150 | 158 | } | |
| 151 | 159 | ||
| 152 | 160 | function htmlMan (man) { | |
| 153 | - var sect = +man.match(/([0-9]+)$/)[1] | ||
| 154 | - var f = path.basename(man).replace(/[.]([0-9]+)$/, '') | ||
| 161 | + let sect = +man.match(/([0-9]+)$/)[1] | ||
| 162 | + const f = path.basename(man).replace(/[.]([0-9]+)$/, '') | ||
| 155 | 163 | switch (sect) { | |
| 156 | 164 | case 1: | |
| 157 | 165 | sect = 'commands' | |
@@ -169,7 +177,7 @@ function htmlMan (man) { | |||
| 169 | 177 | } | |
| 170 | 178 | ||
| 171 | 179 | function getSections (cb) { | |
| 172 | - var g = path.resolve(__dirname, '../man/man[0-9]/*.[0-9]') | ||
| 180 | + const g = path.resolve(__dirname, '../man/man[0-9]/*.[0-9]') | ||
| 173 | 181 | glob(g, function (er, files) { | |
| 174 | 182 | if (er) | |
| 175 | 183 | return cb(er) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -163,7 +163,10 @@ const getJsonOutputItem = (node, { global, long }) => { | |||
| 163 | 163 | Object.assign(item, packageInfo) | |
| 164 | 164 | item.extraneous = false | |
| 165 | 165 | item.path = node.path | |
| 166 | - item._dependencies = node.package.dependencies || {} | ||
| 166 | + item._dependencies = { | ||
| 167 | + ...node.package.dependencies, | ||
| 168 | + ...node.package.optionalDependencies, | ||
| 169 | + } | ||
| 167 | 170 | item.devDependencies = node.package.devDependencies || {} | |
| 168 | 171 | item.peerDependencies = node.package.peerDependencies || {} | |
| 169 | 172 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,7 @@ const libpub = require('libnpmpublish').publish | |||
| 6 | 6 | const runScript = require('@npmcli/run-script') | |
| 7 | 7 | const pacote = require('pacote') | |
| 8 | 8 | const npa = require('npm-package-arg') | |
| 9 | + const npmFetch = require('npm-registry-fetch') | ||
| 9 | 10 | ||
| 10 | 11 | const npm = require('./npm.js') | |
| 11 | 12 | const output = require('./utils/output.js') | |
@@ -71,27 +72,12 @@ const publish_ = async (arg, opts) => { | |||
| 71 | 72 | // you can publish name@version, ./foo.tgz, etc. | |
| 72 | 73 | // even though the default is the 'file:.' cwd. | |
| 73 | 74 | const spec = npa(arg) | |
| 74 | - const manifest = await getManifest(spec, opts) | ||
| 75 | + | ||
| 76 | + let manifest = await getManifest(spec, opts) | ||
| 75 | 77 | ||
| 76 | 78 | if (manifest.publishConfig) | |
| 77 | 79 | Object.assign(opts, publishConfigToOpts(manifest.publishConfig)) | |
| 78 | 80 | ||
| 79 | - const { registry } = opts | ||
| 80 | - if (!registry) { | ||
| 81 | - throw Object.assign(new Error('No registry specified.'), { | ||
| 82 | - code: 'ENOREGISTRY', | ||
| 83 | - }) | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - if (!dryRun) { | ||
| 87 | - const creds = npm.config.getCredentialsByURI(registry) | ||
| 88 | - if (!creds.token && !creds.username) { | ||
| 89 | - throw Object.assign(new Error('This command requires you to be logged in.'), { | ||
| 90 | - code: 'ENEEDAUTH', | ||
| 91 | - }) | ||
| 92 | - } | ||
| 93 | - } | ||
| 94 | - | ||
| 95 | 81 | // only run scripts for directory type publishes | |
| 96 | 82 | if (spec.type === 'directory') { | |
| 97 | 83 | await runScript({ | |
@@ -105,18 +91,27 @@ const publish_ = async (arg, opts) => { | |||
| 105 | 91 | const tarballData = await pack(spec, opts) | |
| 106 | 92 | const pkgContents = await getContents(manifest, tarballData) | |
| 107 | 93 | ||
| 94 | + // The purpose of re-reading the manifest is in case it changed, | ||
| 95 | + // so that we send the latest and greatest thing to the registry | ||
| 96 | + // note that publishConfig might have changed as well! | ||
| 97 | + manifest = await getManifest(spec, opts) | ||
| 98 | + if (manifest.publishConfig) | ||
| 99 | + Object.assign(opts, publishConfigToOpts(manifest.publishConfig)) | ||
| 100 | + | ||
| 108 | 101 | // note that logTar calls npmlog.notice(), so if we ARE in silent mode, | |
| 109 | 102 | // this will do nothing, but we still want it in the debuglog if it fails. | |
| 110 | 103 | if (!json) | |
| 111 | 104 | logTar(pkgContents, { log, unicode }) | |
| 112 | 105 | ||
| 113 | 106 | if (!dryRun) { | |
| 114 | - // The purpose of re-reading the manifest is in case it changed, | ||
| 115 | - // so that we send the latest and greatest thing to the registry | ||
| 116 | - // note that publishConfig might have changed as well! | ||
| 117 | - const manifest = await getManifest(spec, opts) | ||
| 118 | - if (manifest.publishConfig) | ||
| 119 | - Object.assign(opts, publishConfigToOpts(manifest.publishConfig)) | ||
| 107 | + const resolved = npa.resolve(manifest.name, manifest.version) | ||
| 108 | + const registry = npmFetch.pickRegistry(resolved, opts) | ||
| 109 | + const creds = npm.config.getCredentialsByURI(registry) | ||
| 110 | + if (!creds.token && !creds.username) { | ||
| 111 | + throw Object.assign(new Error('This command requires you to be logged in.'), { | ||
| 112 | + code: 'ENEEDAUTH', | ||
| 113 | + }) | ||
| 114 | + } | ||
| 120 | 115 | await otplease(opts, opts => libpub(manifest, tarballData, opts)) | |
| 121 | 116 | } | |
| 122 | 117 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments