diff --git a/AUTHORS b/AUTHORS index 1230739b5c723..6d503651970ae 100644 --- a/AUTHORS +++ b/AUTHORS @@ -821,3 +821,7 @@ linkgoron Quentin Barbe dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Delapouite +F. Hinkelmann +Tierney Cyren +Mohamed Akram +Wassim Chegham <1699357+manekinekko@users.noreply.github.com> diff --git a/CHANGELOG.md b/CHANGELOG.md index bc2e2e1d0e1eb..88cf576872c30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +## v8.5.1 (2022-02-17) + +### Dependencies + +* [`54cda9697`](https://github.com/npm/cli/commit/54cda9697b776fae807966097315c7b836623743) + [#4410](https://github.com/npm/cli/pull/4410) + fix(arborist): do not audit in offline mode + ([@mohd-akram](https://github.com/mohd-akram)) +* [`fb13bdaf1`](https://github.com/npm/cli/commit/fb13bdaf12dde3ef5685a77354e51a9cfa579879) + [#4403](https://github.com/npm/cli/pull/4403) + deps: `@npmcli/ci-detect@2.0.0` +* [`702801002`](https://github.com/npm/cli/commit/702801002e99bf02dd4d6d1e447a5ab332d56c79) + [#4415](https://github.com/npm/cli/pull/4415) + deps: `make-fetch-happen@10.0.3` +* [`88bab3540`](https://github.com/npm/cli/commit/88bab354097023c96c49e78d7ee54159f495bf73) + [#4416](https://github.com/npm/cli/pull/4416) + deps: `gauge@4.0.1` + +### Documentation + +* [`20378c67c`](https://github.com/npm/cli/commit/20378c67cd533db514dd2aec7828c6d119e9d6c7) + [#4423](https://github.com/npm/cli/pull/4423) + docs: update documentation for ping + ([@fhinkel](https://github.com/fhinkel)) +* [`408d2fc15`](https://github.com/npm/cli/commit/408d2fc150185ef66125f7d6bdb1c25edb71bba3) + [#4426](https://github.com/npm/cli/pull/4426) + docs: update workspaces guide for consistency + ([@bnb](https://github.com/bnb)) +* [`9275856eb`](https://github.com/npm/cli/commit/9275856eb75e7c394a3c7617c2b495aba35ee2de) + [#4424](https://github.com/npm/cli/pull/4424) + docs: update usage example for npm pkg + ([@manekinekko](https://github.com/manekinekko)) +* [`20c83fae7`](https://github.com/npm/cli/commit/20c83fae76ff4a051e4f6542a328f1c00cf071bb) + [#4428](https://github.com/npm/cli/pull/4428) + docs: update docs for npm install + ([@manekinekko](https://github.com/manekinekko)) + ## v8.5.0 (2022-02-10) ### Features diff --git a/docs/content/commands/npm-ping.md b/docs/content/commands/npm-ping.md index 6f1c4582f058f..c59a56e611e54 100644 --- a/docs/content/commands/npm-ping.md +++ b/docs/content/commands/npm-ping.md @@ -18,11 +18,14 @@ Ping the configured or given npm registry and verify authentication. If it works it will output something like: ```bash -Ping success: {*Details about registry*} +npm notice PING https://registry.npmjs.org/ +npm notice PONG 255ms ``` -otherwise you will get: +otherwise you will get an error: ```bash -Ping error: {*Detail about error} +npm notice PING http://foo.com/ +npm ERR! code E404 +npm ERR! 404 Not Found - GET http://www.foo.com/-/ping?write=true ``` ### Configuration diff --git a/docs/content/using-npm/workspaces.md b/docs/content/using-npm/workspaces.md index c2ecce5ef471c..26d6a5d7551dc 100644 --- a/docs/content/using-npm/workspaces.md +++ b/docs/content/using-npm/workspaces.md @@ -30,24 +30,25 @@ Workspaces are usually defined via the `workspaces` property of the { "name": "my-workspaces-powered-project", "workspaces": [ - "workspace-a" + "packages/a" ] } ``` Given the above `package.json` example living at a current working -directory `.` that contains a folder named `workspace-a` that itself contains +directory `.` that contains a folder named `packages/a` that itself contains a `package.json` inside it, defining a Node.js package, e.g: ``` . +-- package.json -`-- workspace-a - `-- package.json +`-- packages + +-- a + | `-- package.json ``` The expected result once running `npm install` in this current working -directory `.` is that the folder `workspace-a` will get symlinked to the +directory `.` is that the folder `packages/a` will get symlinked to the `node_modules` folder of the current working dir. Below is a post `npm install` example, given that same previous example @@ -56,11 +57,12 @@ structure of files and folders: ``` . +-- node_modules -| `-- workspace-a -> ../workspace-a +| `-- packages/a -> ../packages/a +-- package-lock.json +-- package.json -`-- workspace-a - `-- package.json +`-- packages + +-- a + | `-- package.json ``` ### Getting started with workspaces diff --git a/lib/commands/pkg.js b/lib/commands/pkg.js index 007932429d661..6ca892293cebe 100644 --- a/lib/commands/pkg.js +++ b/lib/commands/pkg.js @@ -9,6 +9,8 @@ class Pkg extends BaseCommand { 'set = [= ...]', 'get [ [ ...]]', 'delete [ ...]', + 'set [[].= ...]', + 'set [[].= ...]', ] static params = [ diff --git a/node_modules/@npmcli/ci-detect/index.js b/node_modules/@npmcli/ci-detect/lib/index.js similarity index 98% rename from node_modules/@npmcli/ci-detect/index.js rename to node_modules/@npmcli/ci-detect/lib/index.js index df9318d658a49..8be8fe2e6d03b 100644 --- a/node_modules/@npmcli/ci-detect/index.js +++ b/node_modules/@npmcli/ci-detect/lib/index.js @@ -13,6 +13,7 @@ module.exports = () => : process.env.DSARI ? 'dsari' : process.env.GITHUB_ACTION ? 'github-actions' : process.env.TDDIUM ? 'tddium' + : process.env.SCREWDRIVER ? 'screwdriver' : process.env.STRIDER ? 'strider' : process.env.TASKCLUSTER_ROOT_URL ? 'taskcluster' : process.env.JENKINS_URL ? 'jenkins' diff --git a/node_modules/@npmcli/ci-detect/package.json b/node_modules/@npmcli/ci-detect/package.json index 1c01f7a9f62be..c1cf9dc889371 100644 --- a/node_modules/@npmcli/ci-detect/package.json +++ b/node_modules/@npmcli/ci-detect/package.json @@ -1,26 +1,41 @@ { "name": "@npmcli/ci-detect", - "version": "1.4.0", + "version": "2.0.0", "description": "Detect what kind of CI environment the program is in", - "author": "Isaac Z. Schlueter (https://izs.me)", + "author": "GitHub Inc.", "license": "ISC", + "main": "./lib", "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" + "prepublishOnly": "git push origin --follow-tags", + "lint": "eslint '**/*.js'", + "postlint": "npm-template-check", + "template-copy": "npm-template-copy --force", + "lintfix": "npm run lint -- --fix", + "snap": "tap", + "posttest": "npm run lint" }, "tap": { "check-coverage": true }, "devDependencies": { - "tap": "^14.10.2" + "@npmcli/template-oss": "^2.7.1", + "tap": "^15.1.6" }, "files": [ - "index.js" + "bin", + "lib" ], "repository": { "type": "git", "url": "git+https://github.com/npm/ci-detect.git" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" + }, + "templateOSS": { + "version": "2.7.1" } } diff --git a/node_modules/gauge/lib/themes.js b/node_modules/gauge/lib/themes.js index 1098ca0e48c5a..d2e62bbccb3d8 100644 --- a/node_modules/gauge/lib/themes.js +++ b/node_modules/gauge/lib/themes.js @@ -27,8 +27,8 @@ themes.addTheme('colorASCII', themes.getTheme('ASCII'), { }) themes.addTheme('brailleSpinner', { - preProgressbar: '⸨', - postProgressbar: '⸩', + preProgressbar: '(', + postProgressbar: ')', progressbarTheme: { complete: '#', remaining: '⠂', diff --git a/node_modules/gauge/package.json b/node_modules/gauge/package.json index 433958760e245..c51c2b13fb2b3 100644 --- a/node_modules/gauge/package.json +++ b/node_modules/gauge/package.json @@ -1,6 +1,6 @@ { "name": "gauge", - "version": "4.0.0", + "version": "4.0.1", "description": "A terminal based horizontal gauge", "main": "lib", "scripts": { @@ -12,7 +12,8 @@ "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "snap": "tap", - "posttest": "npm run lint" + "posttest": "npm run lint", + "template-copy": "npm-template-copy --force" }, "repository": { "type": "git", @@ -41,7 +42,7 @@ "wide-align": "^1.1.2" }, "devDependencies": { - "@npmcli/template-oss": "^2.3.0", + "@npmcli/template-oss": "^2.7.1", "readable-stream": "^3.6.0", "tap": "^15.0.10" }, @@ -58,5 +59,7 @@ "functions": 92, "lines": 90 }, - "templateVersion": "2.3.0" + "templateOSS": { + "version": "2.7.1" + } } diff --git a/node_modules/make-fetch-happen/lib/agent.js b/node_modules/make-fetch-happen/lib/agent.js index b87427755efed..cc1d388691961 100644 --- a/node_modules/make-fetch-happen/lib/agent.js +++ b/node_modules/make-fetch-happen/lib/agent.js @@ -76,10 +76,12 @@ function getAgent (uri, opts) { localAddress: opts.localAddress, rejectUnauthorized: opts.rejectUnauthorized, timeout: agentTimeout, + freeSocketTimeout: 15000, }) : new HttpAgent({ maxSockets: agentMaxSockets, localAddress: opts.localAddress, timeout: agentTimeout, + freeSocketTimeout: 15000, }) AGENT_CACHE.set(key, agent) return agent diff --git a/node_modules/make-fetch-happen/package.json b/node_modules/make-fetch-happen/package.json index bd11b7cddbf5e..c01a09ac5d7aa 100644 --- a/node_modules/make-fetch-happen/package.json +++ b/node_modules/make-fetch-happen/package.json @@ -1,6 +1,6 @@ { "name": "make-fetch-happen", - "version": "10.0.2", + "version": "10.0.3", "description": "Opinionated, caching, retrying fetch client", "main": "lib/index.js", "files": [ @@ -52,10 +52,9 @@ }, "devDependencies": { "@npmcli/template-oss": "^2.7.1", - "eslint": "^8.8.0", + "eslint": "^8.9.0", "mkdirp": "^1.0.4", "nock": "^13.2.4", - "npmlog": "^6.0.1", "rimraf": "^3.0.2", "safe-buffer": "^5.2.1", "standard-version": "^9.3.2", diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js deleted file mode 100644 index 0930cf8890b9a..0000000000000 --- a/node_modules/object-assign/index.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license deleted file mode 100644 index 654d0bfe94343..0000000000000 --- a/node_modules/object-assign/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json deleted file mode 100644 index 503eb1e6d0f5a..0000000000000 --- a/node_modules/object-assign/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "object-assign", - "version": "4.1.1", - "description": "ES2015 `Object.assign()` ponyfill", - "license": "MIT", - "repository": "sindresorhus/object-assign", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && ava", - "bench": "matcha bench.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "object", - "assign", - "extend", - "properties", - "es2015", - "ecmascript", - "harmony", - "ponyfill", - "prollyfill", - "polyfill", - "shim", - "browser" - ], - "devDependencies": { - "ava": "^0.16.0", - "lodash": "^4.16.4", - "matcha": "^0.7.0", - "xo": "^0.16.0" - } -} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md deleted file mode 100644 index 1be09d35c776c..0000000000000 --- a/node_modules/object-assign/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) - -> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) - - -## Use the built-in - -Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), -support `Object.assign()` :tada:. If you target only those environments, then by all -means, use `Object.assign()` instead of this package. - - -## Install - -``` -$ npm install --save object-assign -``` - - -## Usage - -```js -const objectAssign = require('object-assign'); - -objectAssign({foo: 0}, {bar: 1}); -//=> {foo: 0, bar: 1} - -// multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 2}); -//=> {foo: 0, bar: 1, baz: 2} - -// overwrites equal keys -objectAssign({foo: 0}, {foo: 1}, {foo: 2}); -//=> {foo: 2} - -// ignores null and undefined sources -objectAssign({foo: 0}, null, {bar: 1}, undefined); -//=> {foo: 0, bar: 1} -``` - - -## API - -### objectAssign(target, [source, ...]) - -Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. - - -## Resources - -- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) - - -## Related - -- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/package-lock.json b/package-lock.json index e1cffb032dd26..0e6871d7773bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm", - "version": "8.5.0", + "version": "8.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "npm", - "version": "8.5.0", + "version": "8.5.1", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -88,7 +88,7 @@ "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/arborist": "^4.3.1", - "@npmcli/ci-detect": "^1.4.0", + "@npmcli/ci-detect": "^2.0.0", "@npmcli/config": "^3.0.0", "@npmcli/map-workspaces": "^2.0.0", "@npmcli/package-json": "^1.0.1", @@ -122,7 +122,7 @@ "libnpmsearch": "^4.0.1", "libnpmteam": "^3.0.1", "libnpmversion": "^2.0.2", - "make-fetch-happen": "^10.0.2", + "make-fetch-happen": "^10.0.3", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -806,10 +806,13 @@ "link": true }, "node_modules/@npmcli/ci-detect": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-1.4.0.tgz", - "integrity": "sha512-3BGrt6FLjqM6br5AhWRKTr3u5GIVkjRYeAFrMp3HjnfICrg4xOrVRwFavKT6tsp++bq5dluL5t8ME/Nha/6c1Q==", - "inBundle": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-2.0.0.tgz", + "integrity": "sha512-8yQtQ9ArHh/TzdUDKQwEvwCgpDuhSWTDAbiKMl3854PcT+Dk4UmWaiawuFTLy9n5twzXOBXVflWe+90/ffXQrA==", + "inBundle": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" + } }, "node_modules/@npmcli/config": { "version": "3.0.0", @@ -3420,9 +3423,9 @@ "dev": true }, "node_modules/gauge": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.0.tgz", - "integrity": "sha512-F8sU45yQpjQjxKkm1UOAhf0U/O0aFt//Fl7hsrNVto+patMHjs7dPI9mFOGUKbhrgKm0S3EjW3scMFuQmWSROw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.1.tgz", + "integrity": "sha512-zJ4jePUHR8cceduZ53b6temRalyGpkC2Kc2r3ecNphmL+uWNoJ3YcOcUjpbG6WwoE/Ef6/+aEZz63neI2WIa1Q==", "inBundle": true, "dependencies": { "ansi-regex": "^5.0.1", @@ -5020,9 +5023,9 @@ "peer": true }, "node_modules/make-fetch-happen": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.2.tgz", - "integrity": "sha512-JSFLK53NJP22FL/eAGOyKsWbc2G3v+toPMD7Dq9PJKQCvK0i3t8hGkKxe+3YZzwYa+c0kxRHu7uxH3fvO+rsaA==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.3.tgz", + "integrity": "sha512-CzarPHynPpHjhF5in/YapnO44rSZeYX5VCMfdXa99+gLwpbfFLh20CWa6dP/taV9Net9PWJwXNKtp/4ZTCQnag==", "inBundle": true, "dependencies": { "agentkeepalive": "^4.2.0", @@ -10634,7 +10637,7 @@ "license": "ISC", "dependencies": { "@npmcli/arborist": "^4.0.0", - "@npmcli/ci-detect": "^1.3.0", + "@npmcli/ci-detect": "^2.0.0", "@npmcli/run-script": "^2.0.0", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0", @@ -11492,9 +11495,9 @@ } }, "@npmcli/ci-detect": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-1.4.0.tgz", - "integrity": "sha512-3BGrt6FLjqM6br5AhWRKTr3u5GIVkjRYeAFrMp3HjnfICrg4xOrVRwFavKT6tsp++bq5dluL5t8ME/Nha/6c1Q==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-2.0.0.tgz", + "integrity": "sha512-8yQtQ9ArHh/TzdUDKQwEvwCgpDuhSWTDAbiKMl3854PcT+Dk4UmWaiawuFTLy9n5twzXOBXVflWe+90/ffXQrA==" }, "@npmcli/config": { "version": "3.0.0", @@ -13450,9 +13453,9 @@ "dev": true }, "gauge": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.0.tgz", - "integrity": "sha512-F8sU45yQpjQjxKkm1UOAhf0U/O0aFt//Fl7hsrNVto+patMHjs7dPI9mFOGUKbhrgKm0S3EjW3scMFuQmWSROw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.1.tgz", + "integrity": "sha512-zJ4jePUHR8cceduZ53b6temRalyGpkC2Kc2r3ecNphmL+uWNoJ3YcOcUjpbG6WwoE/Ef6/+aEZz63neI2WIa1Q==", "requires": { "ansi-regex": "^5.0.1", "aproba": "^1.0.3 || ^2.0.0", @@ -14463,7 +14466,7 @@ "version": "file:workspaces/libnpmexec", "requires": { "@npmcli/arborist": "^4.0.0", - "@npmcli/ci-detect": "^1.3.0", + "@npmcli/ci-detect": "^2.0.0", "@npmcli/run-script": "^2.0.0", "@npmcli/template-oss": "^2.4.2", "bin-links": "^3.0.0", @@ -14814,9 +14817,9 @@ "peer": true }, "make-fetch-happen": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.2.tgz", - "integrity": "sha512-JSFLK53NJP22FL/eAGOyKsWbc2G3v+toPMD7Dq9PJKQCvK0i3t8hGkKxe+3YZzwYa+c0kxRHu7uxH3fvO+rsaA==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.3.tgz", + "integrity": "sha512-CzarPHynPpHjhF5in/YapnO44rSZeYX5VCMfdXa99+gLwpbfFLh20CWa6dP/taV9Net9PWJwXNKtp/4ZTCQnag==", "requires": { "agentkeepalive": "^4.2.0", "cacache": "^15.3.0", diff --git a/package.json b/package.json index ef564abd0aca0..c407a66ae12d1 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "8.5.0", + "version": "8.5.1", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ @@ -56,7 +56,7 @@ "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/arborist": "^4.3.1", - "@npmcli/ci-detect": "^1.4.0", + "@npmcli/ci-detect": "^2.0.0", "@npmcli/config": "^3.0.0", "@npmcli/map-workspaces": "^2.0.0", "@npmcli/package-json": "^1.0.1", @@ -90,7 +90,7 @@ "libnpmsearch": "^4.0.1", "libnpmteam": "^3.0.1", "libnpmversion": "^2.0.2", - "make-fetch-happen": "^10.0.2", + "make-fetch-happen": "^10.0.3", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs index c9da1e23671ea..d84cdfb305e90 100644 --- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs +++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -690,6 +690,8 @@ Usage: npm pkg set = [= ...] npm pkg get [ [ ...]] npm pkg delete [ ...] +npm pkg set [[].= ...] +npm pkg set [[].= ...] Options: [-f|--force] [--json] diff --git a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs index f91f2b11d3533..42c24fabdfd61 100644 --- a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs +++ b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs @@ -773,6 +773,8 @@ All commands: npm pkg set = [= ...] npm pkg get [ [ ...]] npm pkg delete [ ...] + npm pkg set [[].= ...] + npm pkg set [[].= ...] Options: [-f|--force] [--json] diff --git a/workspaces/arborist/lib/audit-report.js b/workspaces/arborist/lib/audit-report.js index 53fc5b17ade58..b7d8249b12ddc 100644 --- a/workspaces/arborist/lib/audit-report.js +++ b/workspaces/arborist/lib/audit-report.js @@ -304,7 +304,7 @@ class AuditReport extends Map { async [_getReport] () { // if we're not auditing, just return false - if (this.options.audit === false || this.tree.inventory.size === 1) { + if (this.options.audit === false || this.options.offline === true || this.tree.inventory.size === 1) { return null } diff --git a/workspaces/arborist/test/audit-report.js b/workspaces/arborist/test/audit-report.js index 062300b026148..16ea7e13b7386 100644 --- a/workspaces/arborist/test/audit-report.js +++ b/workspaces/arborist/test/audit-report.js @@ -260,6 +260,24 @@ t.test('audit disabled by config', async t => { t.equal(report.error, null, 'no error encountered') }) +t.test('audit disabled by offline mode', async t => { + const path = resolve(fixtures, 'audit-nyc-mkdirp') + + const logs = [] + const onlog = (...msg) => logs.push(msg) + process.on('log', onlog) + t.teardown(() => process.removeListener('log', onlog)) + + const arb = newArb(path, { offline: true }) + + const tree = await arb.loadVirtual() + const report = await AuditReport.load(tree, arb.options) + t.equal(report.report, null, 'did not get audit response') + t.equal(report.size, 0, 'did not find any vulnerabilities') + t.match(logs, [], 'no logs of error') + t.equal(report.error, null, 'no error encountered') +}) + t.test('one vulnerability', async t => { const path = resolve(fixtures, 'audit-one-vuln') const auditFile = resolve(path, 'audit.json') diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 1de0cdfe26a95..4410f187ec66a 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -51,7 +51,7 @@ }, "dependencies": { "@npmcli/arborist": "^4.0.0", - "@npmcli/ci-detect": "^1.3.0", + "@npmcli/ci-detect": "^2.0.0", "@npmcli/run-script": "^2.0.0", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0",