From ebeb2ec4a68870fb43a03438e041120db6d77b4b Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 29 Mar 2021 10:42:54 -0400 Subject: [PATCH 01/12] eslint@7.23.0 --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index fd57a39fe2e2b..8ee97d0eee756 100644 --- a/package-lock.json +++ b/package-lock.json @@ -325,7 +325,7 @@ "devDependencies": { "@mdx-js/mdx": "^1.6.22", "cmark-gfm": "^0.8.5", - "eslint": "^7.22.0", + "eslint": "^7.23.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.3.1", @@ -2615,9 +2615,9 @@ } }, "node_modules/eslint": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", - "integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.23.0.tgz", + "integrity": "sha512-kqvNVbdkjzpFy0XOszNwjkKzZ+6TcwCQ/h+ozlcIWwaimBBuhlQ4nN6kbiM2L+OjDcznkTJxzYfRFH92sx4a0Q==", "dev": true, "dependencies": { "@babel/code-frame": "7.12.11", @@ -12430,9 +12430,9 @@ } }, "eslint": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", - "integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.23.0.tgz", + "integrity": "sha512-kqvNVbdkjzpFy0XOszNwjkKzZ+6TcwCQ/h+ozlcIWwaimBBuhlQ4nN6kbiM2L+OjDcznkTJxzYfRFH92sx4a0Q==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", diff --git a/package.json b/package.json index 1e821ececafc4..8110479cf062c 100644 --- a/package.json +++ b/package.json @@ -180,7 +180,7 @@ "devDependencies": { "@mdx-js/mdx": "^1.6.22", "cmark-gfm": "^0.8.5", - "eslint": "^7.22.0", + "eslint": "^7.23.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.3.1", From a0d3d2b023d81df788462f3e51281d2db5086a76 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 29 Mar 2021 10:43:15 -0400 Subject: [PATCH 02/12] jsdom@16.5.2 --- node_modules/.gitignore | 1 - package-lock.json | 50 ++++++++++++++++------------------------- package.json | 2 +- 3 files changed, 20 insertions(+), 33 deletions(-) diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 1e763e7f89bfd..fefb3224eb1d0 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -214,7 +214,6 @@ package-lock.json /locate-path /lodash /lodash.flattendeep -/lodash.sortby /lodash.uniq /log-driver /loose-envify diff --git a/package-lock.json b/package-lock.json index 8ee97d0eee756..c77a7de98bad1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -330,7 +330,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.3.1", "eslint-plugin-standard": "^5.0.0", - "jsdom": "^16.5.1", + "jsdom": "^16.5.2", "licensee": "^8.1.0", "marked-man": "^0.7.0", "require-inject": "^1.4.4", @@ -4629,13 +4629,13 @@ "inBundle": true }, "node_modules/jsdom": { - "version": "16.5.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.1.tgz", - "integrity": "sha512-pF73EOsJgwZekbDHEY5VO/yKXUkab/DuvrQB/ANVizbr6UAHJsDdHXuotZYwkJSGQl1JM+ivXaqY+XBDDL4TiA==", + "version": "16.5.2", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.2.tgz", + "integrity": "sha512-JxNtPt9C1ut85boCbJmffaQ06NBnzkQY/MWO3YxPW8IWS38A26z+B1oBvA9LwKrytewdfymnhi4UNH3/RAgZrg==", "dev": true, "dependencies": { "abab": "^2.0.5", - "acorn": "^8.0.5", + "acorn": "^8.1.0", "acorn-globals": "^6.0.0", "cssom": "^0.4.4", "cssstyle": "^2.3.0", @@ -4657,7 +4657,7 @@ "webidl-conversions": "^6.1.0", "whatwg-encoding": "^1.0.5", "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0", + "whatwg-url": "^8.5.0", "ws": "^7.4.4", "xml-name-validator": "^3.0.0" }, @@ -5042,12 +5042,6 @@ "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, - "node_modules/lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true - }, "node_modules/lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -10262,12 +10256,12 @@ "dev": true }, "node_modules/whatwg-url": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.4.0.tgz", - "integrity": "sha512-vwTUFf6V4zhcPkWp/4CQPr1TW9Ml6SF4lVyaIMBdJw5i6qUUJ1QWM4Z6YYVkfka0OUIzVo/0aNtGVGk256IKWw==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.5.0.tgz", + "integrity": "sha512-fy+R77xWv0AiqfLl4nuGUlQ3/6b5uNfQ4WAbGQVMYshCTCCPK9psC1nWh3XHuxGVCtlcDDQPQW1csmmIQo+fwg==", "dev": true, "dependencies": { - "lodash.sortby": "^4.7.0", + "lodash": "^4.7.0", "tr46": "^2.0.2", "webidl-conversions": "^6.1.0" }, @@ -13909,13 +13903,13 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, "jsdom": { - "version": "16.5.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.1.tgz", - "integrity": "sha512-pF73EOsJgwZekbDHEY5VO/yKXUkab/DuvrQB/ANVizbr6UAHJsDdHXuotZYwkJSGQl1JM+ivXaqY+XBDDL4TiA==", + "version": "16.5.2", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.2.tgz", + "integrity": "sha512-JxNtPt9C1ut85boCbJmffaQ06NBnzkQY/MWO3YxPW8IWS38A26z+B1oBvA9LwKrytewdfymnhi4UNH3/RAgZrg==", "dev": true, "requires": { "abab": "^2.0.5", - "acorn": "^8.0.5", + "acorn": "^8.1.0", "acorn-globals": "^6.0.0", "cssom": "^0.4.4", "cssstyle": "^2.3.0", @@ -13937,7 +13931,7 @@ "webidl-conversions": "^6.1.0", "whatwg-encoding": "^1.0.5", "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0", + "whatwg-url": "^8.5.0", "ws": "^7.4.4", "xml-name-validator": "^3.0.0" }, @@ -14223,12 +14217,6 @@ "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true - }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -18042,12 +18030,12 @@ "dev": true }, "whatwg-url": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.4.0.tgz", - "integrity": "sha512-vwTUFf6V4zhcPkWp/4CQPr1TW9Ml6SF4lVyaIMBdJw5i6qUUJ1QWM4Z6YYVkfka0OUIzVo/0aNtGVGk256IKWw==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.5.0.tgz", + "integrity": "sha512-fy+R77xWv0AiqfLl4nuGUlQ3/6b5uNfQ4WAbGQVMYshCTCCPK9psC1nWh3XHuxGVCtlcDDQPQW1csmmIQo+fwg==", "dev": true, "requires": { - "lodash.sortby": "^4.7.0", + "lodash": "^4.7.0", "tr46": "^2.0.2", "webidl-conversions": "^6.1.0" } diff --git a/package.json b/package.json index 8110479cf062c..90e8c4db5ab82 100644 --- a/package.json +++ b/package.json @@ -185,7 +185,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.3.1", "eslint-plugin-standard": "^5.0.0", - "jsdom": "^16.5.1", + "jsdom": "^16.5.2", "licensee": "^8.1.0", "marked-man": "^0.7.0", "require-inject": "^1.4.4", From a28f89572a708cced69cc938f877eaa969dbad9e Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 29 Mar 2021 10:43:36 -0400 Subject: [PATCH 03/12] libnpmversion@1.1.0 --- node_modules/libnpmversion/README.md | 5 +++++ node_modules/libnpmversion/lib/index.js | 2 ++ node_modules/libnpmversion/package.json | 2 +- package-lock.json | 14 +++++++------- package.json | 2 +- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/node_modules/libnpmversion/README.md b/node_modules/libnpmversion/README.md index daa0b88157c6c..e82e7cd6f8730 100644 --- a/node_modules/libnpmversion/README.md +++ b/node_modules/libnpmversion/README.md @@ -25,6 +25,7 @@ npmVersion(arg, { signGitTag: false, // default false, gpg sign the git tag force: false, // push forward recklessly if any problems happen ignoreScripts: false, // do not run pre/post/version lifecycle scripts + scriptShell: '/bin/bash', // shell to run lifecycle scripts in message: 'v%s', // message for tag and commit, replace %s with the version }).then(newVersion => { console.error('version updated!', newVersion) @@ -149,6 +150,10 @@ Push forward recklessly if any problems happen. Default `false`. Do not run pre/post/version lifecycle scripts. Default `false`. +#### `scriptShell` String + +Path to the shell, which should execute the lifecycle scripts. Defaults to `/bin/sh` on unix, or `cmd.exe` on windows. + #### `message` String The message for the git commit and annotated git tag that are created. diff --git a/node_modules/libnpmversion/lib/index.js b/node_modules/libnpmversion/lib/index.js index c3f554834bf81..683941cdea4f3 100644 --- a/node_modules/libnpmversion/lib/index.js +++ b/node_modules/libnpmversion/lib/index.js @@ -13,6 +13,7 @@ module.exports = async (newversion, opts = {}) => { signGitTag = false, force = false, ignoreScripts = false, + scriptShell = undefined, preid = null, log = proclog, message = 'v%s', @@ -31,6 +32,7 @@ module.exports = async (newversion, opts = {}) => { signGitTag, force, ignoreScripts, + scriptShell, preid, pkg, log, diff --git a/node_modules/libnpmversion/package.json b/node_modules/libnpmversion/package.json index 0135c21e7232c..30d94c7a14699 100644 --- a/node_modules/libnpmversion/package.json +++ b/node_modules/libnpmversion/package.json @@ -1,6 +1,6 @@ { "name": "libnpmversion", - "version": "1.0.12", + "version": "1.1.0", "main": "lib/index.js", "files": [ "lib/*.js" diff --git a/package-lock.json b/package-lock.json index c77a7de98bad1..4b6a60b06b212 100644 --- a/package-lock.json +++ b/package-lock.json @@ -283,7 +283,7 @@ "libnpmpublish": "^4.0.0", "libnpmsearch": "^3.1.0", "libnpmteam": "^2.0.2", - "libnpmversion": "^1.0.12", + "libnpmversion": "^1.1.0", "make-fetch-happen": "^8.0.14", "minipass": "^3.1.3", "minipass-pipeline": "^1.2.4", @@ -4955,9 +4955,9 @@ } }, "node_modules/libnpmversion": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/libnpmversion/-/libnpmversion-1.0.12.tgz", - "integrity": "sha512-Z5L2+JXUHC4xH9VkN/3BiVflnMag2bH1Ijy8ISKFw8fBQv9IXNSQgZbzwtfo4VBg0y+ieaKYbzpfbgjfUr31mw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/libnpmversion/-/libnpmversion-1.1.0.tgz", + "integrity": "sha512-ktMHbbGpVVwmvSNQ+dG5fXgC2rB81i1hA94SaR5OCqPQ01Kuipshq6OLo8maD3xK+ulUCIfHxcAi/JYL8J9SWg==", "inBundle": true, "dependencies": { "@npmcli/git": "^2.0.6", @@ -14141,9 +14141,9 @@ } }, "libnpmversion": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/libnpmversion/-/libnpmversion-1.0.12.tgz", - "integrity": "sha512-Z5L2+JXUHC4xH9VkN/3BiVflnMag2bH1Ijy8ISKFw8fBQv9IXNSQgZbzwtfo4VBg0y+ieaKYbzpfbgjfUr31mw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/libnpmversion/-/libnpmversion-1.1.0.tgz", + "integrity": "sha512-ktMHbbGpVVwmvSNQ+dG5fXgC2rB81i1hA94SaR5OCqPQ01Kuipshq6OLo8maD3xK+ulUCIfHxcAi/JYL8J9SWg==", "requires": { "@npmcli/git": "^2.0.6", "@npmcli/run-script": "^1.8.3", diff --git a/package.json b/package.json index 90e8c4db5ab82..c270fb8872d30 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "libnpmpublish": "^4.0.0", "libnpmsearch": "^3.1.0", "libnpmteam": "^2.0.2", - "libnpmversion": "^1.0.12", + "libnpmversion": "^1.1.0", "make-fetch-happen": "^8.0.14", "minipass": "^3.1.3", "minipass-pipeline": "^1.2.4", From 9dd2ed5189b6f283094664e9e192cf1598ec3f79 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 29 Mar 2021 11:00:44 -0400 Subject: [PATCH 04/12] fix: empty newline printed to stderr Starting in v7.7.0 running `npm` (no args) is printing an empty newline to stderr. This fixes that by correctly exiting via errorHandler and avoiding hitting the cb() never called error and adds a test to make sure we avoid that regression moving forward. Fixes: https://github.com/nodejs/node/pull/37678#issuecomment-808734374 Co-authored-by: Gar --- lib/cli.js | 4 +- smoke-tests/index.js | 14 +++++++ .../smoke-tests-index.js-TAP.test.js | 37 +++++++++++++++++++ test/lib/cli.js | 29 +++++++++++++-- 4 files changed, 77 insertions(+), 7 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 46859f150e3b9..f42132f944390 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -61,9 +61,6 @@ module.exports = (process) => { impl(npm.argv, errorHandler) else { try { - // I don't know why this is needed but we get a cb() not called if we - // omit it - npm.log.level = 'silent' if (cmd) { const didYouMean = require('./utils/did-you-mean.js') const suggestions = await didYouMean(npm, npm.localPrefix, cmd) @@ -71,6 +68,7 @@ module.exports = (process) => { } else npm.output(npm.usage) process.exitCode = 1 + return errorHandler() } catch (err) { errorHandler(err) } diff --git a/smoke-tests/index.js b/smoke-tests/index.js index 38c3ed306e5f1..2c2a1b6ab9543 100644 --- a/smoke-tests/index.js +++ b/smoke-tests/index.js @@ -12,6 +12,7 @@ t.cleanSnapshot = s => s.split(cwd).join('{CWD}') .split(process.cwd()).join('{CWD}') .replace(/\\+/g, '/') .replace(/\r\n/g, '\n') + .replace(/\ \(in a browser\)/g, '') // setup server const registryServer = require('./server.js') @@ -55,6 +56,19 @@ t.test('npm init', async t => { t.equal(pkg.version, '1.0.0', 'should have expected generated version') }) +t.test('npm (no args)', async t => { + const cmd = `"${process.execPath}" "${npmLocation}" --no-audit --no-update-notifier` + const cmdRes = await execAsync(cmd, { cwd: localPrefix, env }) + .catch(err => { + t.equal(err.code, 1, 'should exit with error code') + return err + }) + + t.equal(cmdRes.stderr, '', 'should have no stderr output') + t.matchSnapshot(String(cmdRes.stdout), + 'should have expected no args output') +}) + t.test('npm install prodDep@version', async t => { const cmd = `${npmBin} install abbrev@1.0.4` const cmdRes = await exec(cmd) diff --git a/tap-snapshots/smoke-tests-index.js-TAP.test.js b/tap-snapshots/smoke-tests-index.js-TAP.test.js index aa8977316b1c8..932799bc5a47b 100644 --- a/tap-snapshots/smoke-tests-index.js-TAP.test.js +++ b/tap-snapshots/smoke-tests-index.js-TAP.test.js @@ -5,6 +5,43 @@ * Make sure to inspect the output below. Do not ignore changes! */ 'use strict' +exports[`smoke-tests/index.js TAP npm (no args) > should have expected no args output 1`] = ` +npm + +Usage: + +npm install install all the dependencies in your project +npm install add the dependency to your project +npm test run this project's tests +npm run run the script named +npm -h quick help on +npm -l display usage info for all commands +npm help search for help on +npm help npm more involved overview + +All commands: + + access, adduser, audit, bin, bugs, cache, ci, completion, + config, dedupe, deprecate, diff, dist-tag, docs, doctor, + edit, exec, explain, explore, find-dupes, fund, get, help, + hook, init, install, install-ci-test, install-test, link, + ll, login, logout, ls, org, outdated, owner, pack, ping, + prefix, profile, prune, publish, rebuild, repo, restart, + root, run-script, search, set, set-script, shrinkwrap, star, + stars, start, stop, team, test, token, uninstall, unpublish, + unstar, update, version, view, whoami + +Specify configs in the ini-formatted file: + {CWD}/smoke-tests/index/.npmrc +or on the command line via: npm --key=value + +More configuration info: npm help config +Configuration fields: npm help 7 config + +npm@7.7.5 {CWD} + +` + exports[`smoke-tests/index.js TAP npm diff > should have expected diff output 1`] = ` diff --git a/package.json b/package.json index v1.0.4..v1.1.1 100644 diff --git a/test/lib/cli.js b/test/lib/cli.js index 40da77bf44e3d..28e44394e16dc 100644 --- a/test/lib/cli.js +++ b/test/lib/cli.js @@ -172,17 +172,37 @@ t.test('gracefully handles error printing usage', t => { t.teardown(() => { npmock.output = output errorHandlerCb = null + errorHandlerCalled = null }) const proc = { - argv: ['node', 'npm', 'asdf'], + argv: ['node', 'npm'], on: () => {}, } npmock.argv = [] - npmock.output = (msg) => { - throw new Error('test exception') + errorHandlerCb = () => { + t.match(errorHandlerCalled, [], 'should call errorHandler with no args') + t.end() + } + cli(proc) +}) + +t.test('handles output error', t => { + const { output } = npmock + t.teardown(() => { + npmock.output = output + errorHandlerCb = null + errorHandlerCalled = null + }) + const proc = { + argv: ['node', 'npm'], + on: () => {}, + } + npmock.argv = [] + npmock.output = () => { + throw new Error('ERR') } errorHandlerCb = () => { - t.match(errorHandlerCalled, /test exception/) + t.match(errorHandlerCalled, /ERR/, 'should call errorHandler with error') t.end() } cli(proc) @@ -191,6 +211,7 @@ t.test('gracefully handles error printing usage', t => { t.test('load error calls error handler', t => { t.teardown(() => { errorHandlerCb = null + errorHandlerCalled = null LOAD_ERROR = null }) From 9d391462a25f637219501e2430ef1f7b89710816 Mon Sep 17 00:00:00 2001 From: Seth Thomas Date: Fri, 26 Mar 2021 14:05:05 -0500 Subject: [PATCH 05/12] docs: fix spelling in workspaces.md file PR-URL: https://github.com/npm/cli/pull/2973 Credit: @sethomas Close: #2973 Reviewed-by: @wraithgar, @nosisky --- docs/content/using-npm/workspaces.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/using-npm/workspaces.md b/docs/content/using-npm/workspaces.md index 28fccd2200c32..ab37cc16c22c6 100644 --- a/docs/content/using-npm/workspaces.md +++ b/docs/content/using-npm/workspaces.md @@ -90,7 +90,7 @@ nested workspaces to be consumed elsewhere. ### Running commands in the context of workspaces -You man use the `workspace` configuration option to run commands in the context +You can use the `workspace` configuration option to run commands in the context of a configured workspace. Following is a quick example on how to use the `npm run` command in the context From 4b100249a6cad67e002186816e64817313b636c7 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 28 Mar 2021 11:17:25 +0200 Subject: [PATCH 06/12] change 'maxsockets' default value back to 15 The default value for 'maxsockets' was changed during the refactoring in #2878 from 50 to 'Inifinity', this PR changes it to the more accurate value of 15, which was the default used in: https://github.com/npm/make-fetch-happen/blob/785af652ec0c8f108a43004903afd2183af93904/agent.js#L15 Fixes #2978 PR-URL: https://github.com/npm/cli/pull/2979 Credit: @wallrat Close: #2979 Reviewed-by: @ruyadorno Co-authored-by: Gar --- docs/content/using-npm/config.md | 2 +- lib/utils/config/definitions.js | 2 +- tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md index c701a361afbb9..cfce5396f40a7 100644 --- a/docs/content/using-npm/config.md +++ b/docs/content/using-npm/config.md @@ -795,7 +795,7 @@ Show extended information in `npm ls` and `npm search`. #### `maxsockets` -* Default: Infinity +* Default: 15 * Type: Number The maximum number of connections to use per origin (protocol/host/port diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index 512ea8af98cb4..db66aa495ba0f 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -1154,7 +1154,7 @@ define('long', { }) define('maxsockets', { - default: Infinity, + default: 15, type: Number, description: ` The maximum number of connections to use per origin (protocol/host/port diff --git a/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js b/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js index a85f90ac84181..2a3d0146b187d 100644 --- a/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js +++ b/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js @@ -674,7 +674,7 @@ Show extended information in \`npm ls\` and \`npm search\`. #### \`maxsockets\` -* Default: Infinity +* Default: 15 * Type: Number The maximum number of connections to use per origin (protocol/host/port From 4cd66972c1e1be67b2f1dd22e6d9be46e28569f3 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 29 Mar 2021 14:38:03 -0400 Subject: [PATCH 07/12] chore: fix smoke-tests snapshots --- smoke-tests/index.js | 1 + tap-snapshots/smoke-tests-index.js-TAP.test.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/smoke-tests/index.js b/smoke-tests/index.js index 2c2a1b6ab9543..1d352c62550db 100644 --- a/smoke-tests/index.js +++ b/smoke-tests/index.js @@ -13,6 +13,7 @@ t.cleanSnapshot = s => s.split(cwd).join('{CWD}') .replace(/\\+/g, '/') .replace(/\r\n/g, '\n') .replace(/\ \(in a browser\)/g, '') + .replace(/^npm@.*\ /mg, 'npm ') // setup server const registryServer = require('./server.js') diff --git a/tap-snapshots/smoke-tests-index.js-TAP.test.js b/tap-snapshots/smoke-tests-index.js-TAP.test.js index 932799bc5a47b..6fabc5cc30038 100644 --- a/tap-snapshots/smoke-tests-index.js-TAP.test.js +++ b/tap-snapshots/smoke-tests-index.js-TAP.test.js @@ -38,7 +38,7 @@ or on the command line via: npm --key=value More configuration info: npm help config Configuration fields: npm help 7 config -npm@7.7.5 {CWD} +npm {CWD} ` From 03734c29e00191d17f164d1c0e75d9f228268842 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 29 Mar 2021 14:40:33 -0400 Subject: [PATCH 08/12] npm-packlist@2.1.5 --- node_modules/npm-packlist/index.js | 9 ++++++++- node_modules/npm-packlist/package.json | 4 ++-- package-lock.json | 12 ++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/node_modules/npm-packlist/index.js b/node_modules/npm-packlist/index.js index cf87b18528b01..8f62983e6f6c0 100644 --- a/node_modules/npm-packlist/index.js +++ b/node_modules/npm-packlist/index.js @@ -182,6 +182,13 @@ const npmWalker = Class => class Walker extends Class { getPackageFiles (entries, pkg) { try { + // XXX this could be changed to use read-package-json-fast + // which handles the normalizing of bins for us, and simplifies + // the test for bundleDependencies and bundledDependencies later. + // HOWEVER if we do this, we need to be sure that we're careful + // about what we write back out since rpj-fast removes some fields + // that the user likely wants to keep. it also would add a second + // file read that we would want to optimize away. pkg = normalizePackageBin(JSON.parse(pkg.toString())) } catch (er) { // not actually a valid package.json @@ -202,7 +209,7 @@ const npmWalker = Class => class Walker extends Class { // the files list as the effective readdir result, that means it // looks like we don't have a node_modules folder at all unless we // include it here. - if (pkg.bundleDependencies && entries.includes('node_modules')) + if ((pkg.bundleDependencies || pkg.bundledDependencies) && entries.includes('node_modules')) pkg.files.push('node_modules') const patterns = Array.from(new Set(pkg.files)).reduce((set, pattern) => { diff --git a/node_modules/npm-packlist/package.json b/node_modules/npm-packlist/package.json index 6f60521059a04..1276b48413699 100644 --- a/node_modules/npm-packlist/package.json +++ b/node_modules/npm-packlist/package.json @@ -1,6 +1,6 @@ { "name": "npm-packlist", - "version": "2.1.4", + "version": "2.1.5", "description": "Get a list of the files to add from a folder into an npm package", "directories": { "test": "test" @@ -20,7 +20,7 @@ "devDependencies": { "mutate-fs": "^2.1.1", "require-inject": "^1.4.4", - "tap": "^14.10.7" + "tap": "^14.10.8" }, "scripts": { "test": "tap", diff --git a/package-lock.json b/package-lock.json index 4b6a60b06b212..23d9a48713cb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5630,9 +5630,9 @@ } }, "node_modules/npm-packlist": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.1.4.tgz", - "integrity": "sha512-Qzg2pvXC9U4I4fLnUrBmcIT4x0woLtUgxUi9eC+Zrcv1Xx5eamytGAfbDWQ67j7xOcQ2VW1I3su9smVTIdu7Hw==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.1.5.tgz", + "integrity": "sha512-KCfK3Vi2F+PH1klYauoQzg81GQ8/GGjQRKYY6tRnpQUPKTs/1gBZSRWtTEd7jGdSn1LZL7gpAmJT+BcS55k2XQ==", "inBundle": true, "dependencies": { "glob": "^7.1.6", @@ -14655,9 +14655,9 @@ } }, "npm-packlist": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.1.4.tgz", - "integrity": "sha512-Qzg2pvXC9U4I4fLnUrBmcIT4x0woLtUgxUi9eC+Zrcv1Xx5eamytGAfbDWQ67j7xOcQ2VW1I3su9smVTIdu7Hw==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.1.5.tgz", + "integrity": "sha512-KCfK3Vi2F+PH1klYauoQzg81GQ8/GGjQRKYY6tRnpQUPKTs/1gBZSRWtTEd7jGdSn1LZL7gpAmJT+BcS55k2XQ==", "requires": { "glob": "^7.1.6", "ignore-walk": "^3.0.3", From 80ce2a019526632b01b70e1c75c42608dc160332 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 29 Mar 2021 14:41:19 -0400 Subject: [PATCH 09/12] @npmcli/metavuln-calculator@1.1.1 --- .../@npmcli/metavuln-calculator/lib/get-dep-spec.js | 6 +++--- .../@npmcli/metavuln-calculator/package.json | 2 +- package-lock.json | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js b/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js index 35e83d02a1b63..8d1d72b8c46eb 100644 --- a/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js +++ b/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js @@ -8,8 +8,8 @@ module.exports = (mani, name) => { peerDependencies: peerDeps = {}, } = mani - return typeof deps[name] === 'string' ? deps[name] - : typeof optDeps[name] === 'string' ? optDeps[name] - : typeof peerDeps[name] === 'string' ? peerDeps[name] + return deps && typeof deps[name] === 'string' ? deps[name] + : optDeps && typeof optDeps[name] === 'string' ? optDeps[name] + : peerDeps && typeof peerDeps[name] === 'string' ? peerDeps[name] : null } diff --git a/node_modules/@npmcli/metavuln-calculator/package.json b/node_modules/@npmcli/metavuln-calculator/package.json index f7a4f5cc47a7e..4ad6193ae6aa8 100644 --- a/node_modules/@npmcli/metavuln-calculator/package.json +++ b/node_modules/@npmcli/metavuln-calculator/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/metavuln-calculator", - "version": "1.1.0", + "version": "1.1.1", "main": "lib/index.js", "files": [ "lib" diff --git a/package-lock.json b/package-lock.json index 23d9a48713cb0..3d8d2232000ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -903,9 +903,9 @@ } }, "node_modules/@npmcli/metavuln-calculator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-1.1.0.tgz", - "integrity": "sha512-fb51NyiWHjeqqFez9FXhvr+E2Dv4ZjPGVgnj8QC1xjHRSw4gMRIO8pNCzU11WYQ2wZxoHBhPMgovZGxP5lP74g==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-1.1.1.tgz", + "integrity": "sha512-9xe+ZZ1iGVaUovBVFI9h3qW+UuECUzhvZPxK9RaEA2mjU26o5D0JloGYWwLYvQELJNmBdQB6rrpuN8jni6LwzQ==", "inBundle": true, "dependencies": { "cacache": "^15.0.5", @@ -11142,9 +11142,9 @@ } }, "@npmcli/metavuln-calculator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-1.1.0.tgz", - "integrity": "sha512-fb51NyiWHjeqqFez9FXhvr+E2Dv4ZjPGVgnj8QC1xjHRSw4gMRIO8pNCzU11WYQ2wZxoHBhPMgovZGxP5lP74g==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-1.1.1.tgz", + "integrity": "sha512-9xe+ZZ1iGVaUovBVFI9h3qW+UuECUzhvZPxK9RaEA2mjU26o5D0JloGYWwLYvQELJNmBdQB6rrpuN8jni6LwzQ==", "requires": { "cacache": "^15.0.5", "pacote": "^11.1.11", From 5d643e469411c0b3455d827df65b18f25805bfe1 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 29 Mar 2021 14:52:57 -0400 Subject: [PATCH 10/12] docs: changelog for v7.7.6 --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74f5b5f1c58ea..b4fbc426b7811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,31 @@ +## v7.7.6 (2021-03-29) + +### BUG FIXES + +* [`9dd2ed518`](https://github.com/npm/cli/commit/9dd2ed5189b6f283094664e9e192cf1598ec3f79) + fix empty newline printed to stderr + ([@ruyadorno](https://github.com/ruyadorno)) +* [`9d391462a`](https://github.com/npm/cli/commit/9d391462a25f637219501e2430ef1f7b89710816) + [#2973](https://github.com/npm/cli/issues/2973) + fix spelling in workspaces.md file + ([@sethomas](https://github.com/sethomas)) +* [`4b100249a`](https://github.com/npm/cli/commit/4b100249a6cad67e002186816e64817313b636c7) + [#2979](https://github.com/npm/cli/issues/2979) + change 'maxsockets' default value back to 15 + ([@wallrat](https://github.com/wallrat)) + +### DEPENDENCIES + +* [`a28f89572`](https://github.com/npm/cli/commit/a28f89572a708cced69cc938f877eaa969dbad9e) + `libnpmversion@1.1.0` + * fix reading `script-shell` config on `npm version` lifecycle scripts +* [`03734c29e`](https://github.com/npm/cli/commit/03734c29e00191d17f164d1c0e75d9f228268842) + `npm-packlist@2.1.5` + * fix packaging `bundledDependencies` +* [`80ce2a019`](https://github.com/npm/cli/commit/80ce2a019526632b01b70e1c75c42608dc160332) + `@npmcli/metavuln-calculator@1.1.1` + * fix error auditing package documents with missing dependencies + ## v7.7.5 (2021-03-25) ### BUG FIXES From 02d30d6e3bac705a375e8b03525fecf6ff41b329 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 29 Mar 2021 14:53:04 -0400 Subject: [PATCH 11/12] update AUTHORS --- AUTHORS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AUTHORS b/AUTHORS index c4a8c4e45ec94..a257559bbf593 100644 --- a/AUTHORS +++ b/AUTHORS @@ -768,3 +768,5 @@ kbayrhammer James Chen-Smith Yash Singh Danielle Church +Seth Thomas +Andreas From 1267a41ac0b1c30d2cf5ac61e189eedb5136eedf Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 29 Mar 2021 14:53:05 -0400 Subject: [PATCH 12/12] 7.7.6 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3d8d2232000ca..6f81519099473 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm", - "version": "7.7.5", + "version": "7.7.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "npm", - "version": "7.7.5", + "version": "7.7.6", "bundleDependencies": [ "@npmcli/arborist", "@npmcli/ci-detect", diff --git a/package.json b/package.json index c270fb8872d30..0f078d18be573 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "7.7.5", + "version": "7.7.6", "name": "npm", "description": "a package manager for JavaScript", "keywords": [