diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 499ad3842d31f..acffa4fbbd53b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: Node CI -on: [push] +on: [push, pull_request] jobs: build: @@ -8,7 +8,7 @@ jobs: fail-fast: false matrix: node-version: [6.x, 8.x, 10.x, 12.x] - os: [ubuntu-latest] + os: [ubuntu-latest, windows-latest, macOS-latest] runs-on: ${{ matrix.os }} diff --git a/.npmignore b/.npmignore index c42aaf956257d..f45f47b93829b 100644 --- a/.npmignore +++ b/.npmignore @@ -24,5 +24,5 @@ html/*.png *.pyc - +Session.vim .nyc_output diff --git a/.travis.yml b/.travis.yml index cec3aac226b1c..9fb0d51133692 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,6 @@ node_js: env: "DEPLOY_VERSION=testing" -notifications: - slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 - install: - "node . install" diff --git a/AUTHORS b/AUTHORS index c2a38c02d53f9..08cade33b6ff1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -691,3 +691,7 @@ Vitaliy Markitanov <9357021+vit100@users.noreply.github.com> simon_s John Kennedy Bernard Kitchens +Jarda Snajdr +Naix Geng <1308363651@qq.com> +Dylan Treisman +mum-never-proud diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cd9c8d8f8861..bae7de7060560 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## 6.14.5 (2020-05-01) + +### BUG FIXES + +* [`33ec41f18`](https://github.com/npm/cli/commit/33ec41f18f557146607cb14a7a38c707fce6d42c) [#758](https://github.com/npm/cli/pull/758) fix: relativize file links when inflating shrinkwrap ([@jsnajdr](https://github.com/jsnajdr)) +* [`94ed456df`](https://github.com/npm/cli/commit/94ed456dfb0b122fd4192429024f034d06c3c454) [#1162](https://github.com/npm/cli/pull/1162) fix: npm init help output ([@mum-never-proud](https://github.com/mum-never-proud)) + +### DEPENDENCIES + +* [`5587ac01f`](https://github.com/npm/cli/commit/5587ac01ffd0d2ea830a6bbb67bb34a611ffc409) `npm-registry-fetch@4.0.4` + * [`fc5d94c39`](https://github.com/npm/npm-registry-fetch/commit/fc5d94c39ca218d78df77249ab3a6bf1d9ed9db1) fix: removed default timeout +* [`07a4d8884`](https://github.com/npm/cli/commit/07a4d8884448359bac485a49c05fd2d23d06834b) `graceful-fs@4.2.4` +* [`8228d1f2e`](https://github.com/npm/cli/commit/8228d1f2e427ad9adee617266108acd1ee39b4a5) `mkdirp@0.5.5` +* [`e6d208317`](https://github.com/npm/cli/commit/e6d20831740a84aea766da2a2913cf82a4d56ada) `nopt@4.0.3` + ## 6.14.4 (2020-03-24) ### DEPENDENCIES diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 981f0457d5c6b..c08bd090cb64b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,7 +73,7 @@ All interactions in the npm repository are covered by the [npm Code of Conduct]( # Make sure you install the dependencies first before running tests. $ npm install -# Run tests for the CLI (it could take awhile). +# Run tests for the CLI (it could take a while). $ npm run test ``` @@ -97,7 +97,7 @@ $ make link ################# # ALTERNATIVELY ################# -# If ou're working on a feature or bug, you can run the same command on your +# If you're working on a feature or bug, you can run the same command on your # working branch and link that code. # Create new branch to work from (there are many ways) @@ -130,7 +130,7 @@ let you know that it's sent the request to start the benchmark suite. ![image](https://user-images.githubusercontent.com/2818462/72312698-e2e57f80-3656-11ea-9fcf-4a8f6b97b0d1.png) -If you've updated your pull-reuqest and you'd like to run the the benchmark suite again, simple update your original comment, by adding `test this please ✅` again, or simply just adding another emoji to the **end**. _(The trigger is the phrase "test this please ✅" at the beginning of a comment. Updates will trigger as well, so long as the phrase stays at the beginning.)_. +If you've updated your pull-request and you'd like to run the the benchmark suite again, simple update your original comment, by adding `test this please ✅` again, or simply just adding another emoji to the **end**. _(The trigger is the phrase "test this please ✅" at the beginning of a comment. Updates will trigger as well, so long as the phrase stays at the beginning.)_. ![image](https://user-images.githubusercontent.com/2818462/72313006-ec231c00-3657-11ea-9bd9-227634d67362.png) diff --git a/docs/content/cli-commands/npm.md b/docs/content/cli-commands/npm.md index 01a9308204d19..2d9789dd77c1c 100644 --- a/docs/content/cli-commands/npm.md +++ b/docs/content/cli-commands/npm.md @@ -57,14 +57,14 @@ on a preinstalled git. If one of the packages npm tries to install is a native node module and requires compiling of C++ Code, npm will use -[node-gyp](https://github.com/TooTallNate/node-gyp) for that task. -For a Unix system, [node-gyp](https://github.com/TooTallNate/node-gyp) +[node-gyp](https://github.com/nodejs/node-gyp) for that task. +For a Unix system, [node-gyp](https://github.com/nodejs/node-gyp) needs Python, make and a buildchain like GCC. On Windows, Python and Microsoft Visual Studio C++ are needed. Python 3 is -not supported by [node-gyp](https://github.com/TooTallNate/node-gyp). +not supported by [node-gyp](https://github.com/nodejs/node-gyp). For more information visit -[the node-gyp repository](https://github.com/TooTallNate/node-gyp) and -the [node-gyp Wiki](https://github.com/TooTallNate/node-gyp/wiki). +[the node-gyp repository](https://github.com/nodejs/node-gyp) and +the [node-gyp Wiki](https://github.com/nodejs/node-gyp/wiki). ### Directories diff --git a/docs/content/using-npm/scripts.md b/docs/content/using-npm/scripts.md index a9ca433fdea08..369d8f0c9ab12 100644 --- a/docs/content/using-npm/scripts.md +++ b/docs/content/using-npm/scripts.md @@ -145,9 +145,15 @@ suites, then those executables will be added to the `PATH` for executing the scripts. So, if your package.json has this: ```json -{ "name" : "foo" -, "dependencies" : { "bar" : "0.1.x" } -, "scripts": { "start" : "bar ./test" } } +{ + "name" : "foo", + "dependencies" : { + "bar" : "0.1.x" + }, + "scripts": { + "start" : "bar ./test" + } +} ``` then you could run `npm start` to execute the `bar` script, which is @@ -176,9 +182,15 @@ there is a config param of `[@]:`. For example, if the package.json has this: ```json -{ "name" : "foo" -, "config" : { "port" : "8080" } -, "scripts" : { "start" : "node server.js" } } +{ + "name" : "foo", + "config" : { + "port" : "8080" + }, + "scripts" : { + "start" : "node server.js" + } +} ``` and the server.js is this: @@ -213,10 +225,11 @@ process.env.npm_package_scripts_install === "foo.js" For example, if your package.json contains this: ```json -{ "scripts" : - { "install" : "scripts/install.js" - , "postinstall" : "scripts/postinstall.js" - , "uninstall" : "scripts/uninstall.js" +{ + "scripts" : { + "install" : "scripts/install.js", + "postinstall" : "scripts/install.js", + "uninstall" : "scripts/uninstall.js" } } ``` @@ -232,10 +245,11 @@ If you want to run a make command, you can do so. This works just fine: ```json -{ "scripts" : - { "preinstall" : "./configure" - , "install" : "make && make install" - , "test" : "make test" +{ + "scripts" : { + "preinstall" : "./configure", + "install" : "make && make install", + "test" : "make test" } } ``` diff --git a/lib/init.js b/lib/init.js index 9d873689f6b7e..41995abe22bbf 100644 --- a/lib/init.js +++ b/lib/init.js @@ -63,7 +63,7 @@ function init (args, cb) { 'This utility will walk you through creating a package.json file.', 'It only covers the most common items, and tries to guess sensible defaults.', '', - 'See `npm help json` for definitive documentation on these fields', + 'See `npm help init` for definitive documentation on these fields', 'and exactly what they do.', '', 'Use `npm install ` afterwards to install a package and', diff --git a/lib/install/deps.js b/lib/install/deps.js index 3d8b333c64441..72c7192963000 100644 --- a/lib/install/deps.js +++ b/lib/install/deps.js @@ -74,7 +74,10 @@ function doesChildVersionMatch (child, requested, requestor) { var childReq = child.package._requested if (childReq) { if (childReq.rawSpec === requested.rawSpec) return true - if (childReq.type === requested.type && childReq.saveSpec === requested.saveSpec) return true + if (childReq.type === requested.type) { + if (childReq.saveSpec === requested.saveSpec) return true + if (childReq.fetchSpec === requested.fetchSpec) return true + } } // If _requested didn't exist OR if it didn't match then we'll try using // _from. We pass it through npa to normalize the specifier. @@ -200,6 +203,7 @@ function removeObsoleteDep (child, log) { }) } +exports.packageRelativePath = packageRelativePath function packageRelativePath (tree) { if (!tree) return '' var requested = tree.package._requested || {} @@ -570,7 +574,7 @@ function addDependency (name, versionSpec, tree, log, done) { try { var req = childDependencySpecifier(tree, name, versionSpec) if (tree.swRequires && tree.swRequires[name]) { - var swReq = childDependencySpecifier(tree, name, tree.swRequires[name], tree.package._where) + var swReq = childDependencySpecifier(tree, name, tree.swRequires[name]) } } catch (err) { return done(err) diff --git a/lib/install/get-requested.js b/lib/install/get-requested.js index ab410ffc9b6e3..df0eec6f6a631 100644 --- a/lib/install/get-requested.js +++ b/lib/install/get-requested.js @@ -1,12 +1,15 @@ 'use strict' const npa = require('npm-package-arg') const moduleName = require('../utils/module-name.js') - +const packageRelativePath = require('./deps').packageRelativePath module.exports = function (child, reqBy) { if (!child.requiredBy.length) return if (!reqBy) reqBy = child.requiredBy[0] const deps = reqBy.package.dependencies || {} const devDeps = reqBy.package.devDependencies || {} + const optDeps = reqBy.package.optionalDependencies || {} const name = moduleName(child) - return npa.resolve(name, deps[name] || devDeps[name], reqBy.realpath) + const spec = deps[name] || devDeps[name] || optDeps[name] + const where = packageRelativePath(reqBy) + return npa.resolve(name, spec, where) } diff --git a/lib/install/inflate-shrinkwrap.js b/lib/install/inflate-shrinkwrap.js index 1ec4f9ba6dcfd..122068c201287 100644 --- a/lib/install/inflate-shrinkwrap.js +++ b/lib/install/inflate-shrinkwrap.js @@ -89,6 +89,20 @@ function tarballToVersion (name, tb) { return match[2] || match[1] } +function relativizeLink (name, spec, topPath, requested) { + if (!spec.startsWith('file:')) { + return + } + + let requestedPath = requested.fetchSpec + if (requested.type === 'file') { + requestedPath = path.dirname(requestedPath) + } + + const relativized = path.relative(requestedPath, path.resolve(topPath, spec.slice(5))) + return 'file:' + relativized +} + function inflatableChild (onDiskChild, name, topPath, tree, sw, requested, opts) { validate('OSSOOOO|ZSSOOOO', arguments) const usesIntegrity = ( @@ -101,7 +115,14 @@ function inflatableChild (onDiskChild, name, topPath, tree, sw, requested, opts) sw.resolved = sw.version sw.version = regTarball } - if (sw.requires) Object.keys(sw.requires).map(_ => { sw.requires[_] = tarballToVersion(_, sw.requires[_]) || sw.requires[_] }) + if (sw.requires) { + Object.keys(sw.requires).forEach(name => { + const spec = sw.requires[name] + sw.requires[name] = tarballToVersion(name, spec) || + relativizeLink(name, spec, topPath, requested) || + spec + }) + } const modernLink = requested.type === 'directory' && !sw.from if (hasModernMeta(onDiskChild) && childIsEquivalent(sw, requested, onDiskChild)) { // The version on disk matches the shrinkwrap entry. diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js index 8c75ee259e091..de3df47fd5552 100644 --- a/node_modules/graceful-fs/graceful-fs.js +++ b/node_modules/graceful-fs/graceful-fs.js @@ -21,6 +21,14 @@ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { function noop () {} +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + var debug = noop if (util.debuglog) debug = util.debuglog('gfs4') @@ -32,14 +40,10 @@ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) } // Once time initialization -if (!global[gracefulQueue]) { +if (!fs[gracefulQueue]) { // This queue can be shared by multiple loaded instances - var queue = [] - Object.defineProperty(global, gracefulQueue, { - get: function() { - return queue - } - }) + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) // Patch fs.close/closeSync to shared queue version, because we need // to retry() whenever a close happens *anywhere* in the program. @@ -79,12 +83,16 @@ if (!global[gracefulQueue]) { if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { - debug(global[gracefulQueue]) - require('assert').equal(global[gracefulQueue].length, 0) + debug(fs[gracefulQueue]) + require('assert').equal(fs[gracefulQueue].length, 0) }) } } +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + module.exports = patch(clone(fs)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { module.exports = patch(fs) @@ -334,11 +342,11 @@ function patch (fs) { function enqueue (elem) { debug('ENQUEUE', elem[0].name, elem[1]) - global[gracefulQueue].push(elem) + fs[gracefulQueue].push(elem) } function retry () { - var elem = global[gracefulQueue].shift() + var elem = fs[gracefulQueue].shift() if (elem) { debug('RETRY', elem[0].name, elem[1]) elem[0].apply(null, elem[1]) diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json index 788876e322073..32518904d9741 100644 --- a/node_modules/graceful-fs/package.json +++ b/node_modules/graceful-fs/package.json @@ -1,19 +1,19 @@ { - "_from": "graceful-fs@4.2.3", - "_id": "graceful-fs@4.2.3", + "_from": "graceful-fs@4.2.4", + "_id": "graceful-fs@4.2.4", "_inBundle": false, - "_integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "_integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "_location": "/graceful-fs", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "graceful-fs@4.2.3", + "raw": "graceful-fs@4.2.4", "name": "graceful-fs", "escapedName": "graceful-fs", - "rawSpec": "4.2.3", + "rawSpec": "4.2.4", "saveSpec": null, - "fetchSpec": "4.2.3" + "fetchSpec": "4.2.4" }, "_requiredBy": [ "#USER", @@ -41,10 +41,10 @@ "/test-exclude/load-json-file", "/write-file-atomic" ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "_shasum": "4a12ff1b60376ef09862c2093edd908328be8423", - "_spec": "graceful-fs@4.2.3", - "_where": "/Users/mperrotte/npminc/cli", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "_shasum": "2256bde14d3632958c465ebc96dc467ca07a29fb", + "_spec": "graceful-fs@4.2.4", + "_where": "/Users/ruyadorno/Documents/workspace/cli", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, @@ -98,5 +98,5 @@ "preversion": "npm test", "test": "node test.js | tap -" }, - "version": "4.2.3" + "version": "4.2.4" } diff --git a/node_modules/mkdirp/README.markdown b/node_modules/mkdirp/README.markdown index 3cc1315385116..fc314bfbd662c 100644 --- a/node_modules/mkdirp/README.markdown +++ b/node_modules/mkdirp/README.markdown @@ -37,7 +37,7 @@ Create a new directory and any necessary subdirectories at `dir` with octal permission string `opts.mode`. If `opts` is a non-object, it will be treated as the `opts.mode`. -If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. +If `opts.mode` isn't specified, it defaults to `0777`. `cb(err, made)` fires with the error or the first directory `made` that had to be created, if any. @@ -52,7 +52,7 @@ Synchronously create a new directory and any necessary subdirectories at `dir` with octal permission string `opts.mode`. If `opts` is a non-object, it will be treated as the `opts.mode`. -If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. +If `opts.mode` isn't specified, it defaults to `0777`. Returns the first directory that had to be created, if any. diff --git a/node_modules/mkdirp/index.js b/node_modules/mkdirp/index.js index 2f1287071fc0d..468d7cd8df53b 100644 --- a/node_modules/mkdirp/index.js +++ b/node_modules/mkdirp/index.js @@ -17,7 +17,7 @@ function mkdirP (p, opts, f, made) { var xfs = opts.fs || fs; if (mode === undefined) { - mode = _0777 & (~process.umask()); + mode = _0777 } if (!made) made = null; @@ -62,7 +62,7 @@ mkdirP.sync = function sync (p, opts, made) { var xfs = opts.fs || fs; if (mode === undefined) { - mode = _0777 & (~process.umask()); + mode = _0777 } if (!made) made = null; diff --git a/node_modules/mkdirp/package.json b/node_modules/mkdirp/package.json index 5ff5891b2c06d..af775065f04fa 100644 --- a/node_modules/mkdirp/package.json +++ b/node_modules/mkdirp/package.json @@ -1,19 +1,19 @@ { - "_from": "mkdirp@0.5.4", - "_id": "mkdirp@0.5.4", + "_from": "mkdirp@0.5.5", + "_id": "mkdirp@0.5.5", "_inBundle": false, - "_integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", + "_integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "_location": "/mkdirp", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "mkdirp@0.5.4", + "raw": "mkdirp@0.5.5", "name": "mkdirp", "escapedName": "mkdirp", - "rawSpec": "0.5.4", + "rawSpec": "0.5.5", "saveSpec": null, - "fetchSpec": "0.5.4" + "fetchSpec": "0.5.5" }, "_requiredBy": [ "#USER", @@ -32,9 +32,9 @@ "/tar", "/write" ], - "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", - "_shasum": "fd01504a6797ec5c9be81ff43d204961ed64a512", - "_spec": "mkdirp@0.5.4", + "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "_shasum": "d91cefd62d1436ca0f41620e251288d420099def", + "_spec": "mkdirp@0.5.5", "_where": "/Users/ruyadorno/Documents/workspace/cli", "author": { "name": "James Halliday", @@ -51,7 +51,7 @@ "dependencies": { "minimist": "^1.2.5" }, - "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", + "deprecated": false, "description": "Recursively mkdir, like `mkdir -p`", "devDependencies": { "mock-fs": "^3.7.0", @@ -79,5 +79,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "0.5.4" + "version": "0.5.5" } diff --git a/node_modules/nopt/.npmignore b/node_modules/nopt/.npmignore deleted file mode 100644 index 3c3629e647f5d..0000000000000 --- a/node_modules/nopt/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/nopt/.travis.yml b/node_modules/nopt/.travis.yml deleted file mode 100644 index a1cef591c3cfd..0000000000000 --- a/node_modules/nopt/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - '0.12' - - '4' - - '6' - - '7' -before_install: - - npm install -g npm@latest diff --git a/node_modules/nopt/examples/my-program.js b/node_modules/nopt/examples/my-program.js deleted file mode 100755 index 142447e18e756..0000000000000 --- a/node_modules/nopt/examples/my-program.js +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env node - -//process.env.DEBUG_NOPT = 1 - -// my-program.js -var nopt = require("../lib/nopt") - , Stream = require("stream").Stream - , path = require("path") - , knownOpts = { "foo" : [String, null] - , "bar" : [Stream, Number] - , "baz" : path - , "bloo" : [ "big", "medium", "small" ] - , "flag" : Boolean - , "pick" : Boolean - } - , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] - , "b7" : ["--bar", "7"] - , "m" : ["--bloo", "medium"] - , "p" : ["--pick"] - , "f" : ["--flag", "true"] - , "g" : ["--flag"] - , "s" : "--flag" - } - // everything is optional. - // knownOpts and shorthands default to {} - // arg list defaults to process.argv - // slice defaults to 2 - , parsed = nopt(knownOpts, shortHands, process.argv, 2) - -console.log("parsed =\n"+ require("util").inspect(parsed)) diff --git a/node_modules/nopt/lib/nopt.js b/node_modules/nopt/lib/nopt.js index 1fb113514f334..0ec5753d0cb89 100644 --- a/node_modules/nopt/lib/nopt.js +++ b/node_modules/nopt/lib/nopt.js @@ -113,7 +113,12 @@ function clean (data, types, typeDefs) { return d[k] }).filter(function (val) { return val !== remove }) - if (!val.length) delete data[k] + // if we allow Array specifically, then an empty array is how we + // express 'no value here', not null. Allow it. + if (!val.length && type.indexOf(Array) === -1) { + debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array)) + delete data[k] + } else if (isArray) { debug(isArray, data[k], val) data[k] = val diff --git a/node_modules/nopt/package.json b/node_modules/nopt/package.json index cea3624f4d14e..1490f6d25d75c 100644 --- a/node_modules/nopt/package.json +++ b/node_modules/nopt/package.json @@ -1,51 +1,54 @@ { - "_args": [ - [ - "nopt@4.0.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "nopt@4.0.1", - "_id": "nopt@4.0.1", + "_from": "nopt@4.0.3", + "_id": "nopt@4.0.3", "_inBundle": false, - "_integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "_integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", "_location": "/nopt", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "nopt@4.0.1", + "raw": "nopt@4.0.3", "name": "nopt", "escapedName": "nopt", - "rawSpec": "4.0.1", + "rawSpec": "4.0.3", "saveSpec": null, - "fetchSpec": "4.0.1" + "fetchSpec": "4.0.3" }, "_requiredBy": [ - "/" + "#USER", + "/", + "/node-gyp" ], - "_resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "_spec": "4.0.1", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "_shasum": "a375cad9d02fd921278d954c2254d5aa57e15e48", + "_spec": "nopt@4.0.3", + "_where": "/Users/ruyadorno/Documents/workspace/cli", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bin": { - "nopt": "./bin/nopt.js" + "nopt": "bin/nopt.js" }, "bugs": { "url": "https://github.com/npm/nopt/issues" }, + "bundleDependencies": false, "dependencies": { "abbrev": "1", "osenv": "^0.1.4" }, + "deprecated": false, "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", "devDependencies": { - "tap": "^8.0.1" + "tap": "^14.10.6" }, + "files": [ + "bin", + "lib" + ], "homepage": "https://github.com/npm/nopt#readme", "license": "ISC", "main": "lib/nopt.js", @@ -55,7 +58,10 @@ "url": "git+https://github.com/npm/nopt.git" }, "scripts": { + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preversion": "npm test", "test": "tap test/*.js" }, - "version": "4.0.1" + "version": "4.0.3" } diff --git a/node_modules/nopt/test/basic.js b/node_modules/nopt/test/basic.js deleted file mode 100644 index 5c18ac0fc6a31..0000000000000 --- a/node_modules/nopt/test/basic.js +++ /dev/null @@ -1,303 +0,0 @@ -var nopt = require("../") - , test = require('tap').test - , isWin = process.platform === 'win32' - -test("passing a string results in a string", function (t) { - var parsed = nopt({ key: String }, {}, ["--key", "myvalue"], 0) - t.same(parsed.key, "myvalue") - t.end() -}) - -// https://github.com/npm/nopt/issues/31 -test("Empty String results in empty string, not true", function (t) { - var parsed = nopt({ empty: String }, {}, ["--empty"], 0) - t.same(parsed.empty, "") - t.end() -}) - -// https://github.com/npm/nopt/issues/65 -test("Empty String should not swallow next flag", function (t) { - var parsed = nopt({ empty: String, foo: String }, {}, ["--empty", "--foo"], 0) - t.same(parsed.empty, "") - t.same(parsed.foo, "") - t.end() -}) - -// https://github.com/npm/nopt/issues/66 -test("Empty String should not be true when type is single item Array", function (t) { - var parsed = nopt({ 'foo': [String] }, {}, ["--foo"], 0) - t.same(parsed.foo, "") - t.end() -}) - -test("~ path is resolved to " + (isWin ? '%USERPROFILE%' : '$HOME'), function (t) { - var path = require("path") - , the - - if (isWin) { - the = { - key: 'USERPROFILE', - dir: 'C:\\temp', - val: '~\\val' - } - } else { - the = { - key: 'HOME', - dir: '/tmp', - val: '~/val' - } - } - if (!process.env[the.key]) process.env[the.key] = v.dir - var parsed = nopt({key: path}, {}, ["--key=" + the.val], 0) - t.same(parsed.key, path.resolve(process.env[the.key], "val")) - t.end() -}) - -// https://github.com/npm/nopt/issues/24 -test("Unknown options are not parsed as numbers", function (t) { - var parsed = nopt({"parse-me": Number}, null, ['--leave-as-is=1.20', '--parse-me=1.20'], 0) - t.equal(parsed['leave-as-is'], '1.20') - t.equal(parsed['parse-me'], 1.2) - t.end() -}); - -// https://github.com/npm/nopt/issues/48 -test("Check types based on name of type", function (t) { - var parsed = nopt({"parse-me": {name: "Number"}}, null, ['--parse-me=1.20'], 0) - t.equal(parsed['parse-me'], 1.2) - t.end() -}) - - -test("Missing types are not parsed", function (t) { - var parsed = nopt({"parse-me": {}}, null, ['--parse-me=1.20'], 0) - //should only contain argv - t.equal(Object.keys(parsed).length, 1) - t.end() -}) - -test("Types passed without a name are not parsed", function (t) { - var parsed = nopt({"parse-me": {}}, {}, ['--parse-me=1.20'], 0) - //should only contain argv - t.equal(Object.keys(parsed).length, 1) - t.end() -}) - -test("other tests", function (t) { - - var util = require("util") - , Stream = require("stream") - , path = require("path") - , url = require("url") - - , shorthands = - { s : ["--loglevel", "silent"] - , d : ["--loglevel", "info"] - , dd : ["--loglevel", "verbose"] - , ddd : ["--loglevel", "silly"] - , noreg : ["--no-registry"] - , reg : ["--registry"] - , "no-reg" : ["--no-registry"] - , silent : ["--loglevel", "silent"] - , verbose : ["--loglevel", "verbose"] - , h : ["--usage"] - , H : ["--usage"] - , "?" : ["--usage"] - , help : ["--usage"] - , v : ["--version"] - , f : ["--force"] - , desc : ["--description"] - , "no-desc" : ["--no-description"] - , "local" : ["--no-global"] - , l : ["--long"] - , p : ["--parseable"] - , porcelain : ["--parseable"] - , g : ["--global"] - } - - , types = - { aoa: Array - , nullstream: [null, Stream] - , date: Date - , str: String - , browser : String - , cache : path - , color : ["always", Boolean] - , depth : Number - , description : Boolean - , dev : Boolean - , editor : path - , force : Boolean - , global : Boolean - , globalconfig : path - , group : [String, Number] - , gzipbin : String - , logfd : [Number, Stream] - , loglevel : ["silent","win","error","warn","info","verbose","silly"] - , long : Boolean - , "node-version" : [false, String] - , npaturl : url - , npat : Boolean - , "onload-script" : [false, String] - , outfd : [Number, Stream] - , parseable : Boolean - , pre: Boolean - , prefix: path - , proxy : url - , "rebuild-bundle" : Boolean - , registry : url - , searchopts : String - , searchexclude: [null, String] - , shell : path - , t: [Array, String] - , tag : String - , tar : String - , tmp : path - , "unsafe-perm" : Boolean - , usage : Boolean - , user : String - , username : String - , userconfig : path - , version : Boolean - , viewer: path - , _exit : Boolean - , path: path - } - - ; [["-v", {version:true}, []] - ,["---v", {version:true}, []] - ,["ls -s --no-reg connect -d", - {loglevel:"info",registry:null},["ls","connect"]] - ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]] - ,["ls --registry blargle", {}, ["ls"]] - ,["--no-registry", {registry:null}, []] - ,["--no-color true", {color:false}, []] - ,["--no-color false", {color:true}, []] - ,["--no-color", {color:false}, []] - ,["--color false", {color:false}, []] - ,["--color --logfd 7", {logfd:7,color:true}, []] - ,["--color=true", {color:true}, []] - ,["--logfd=10", {logfd:10}, []] - ,["--tmp=/tmp -tar=gtar", {tmp: isWin ? "C:\\tmp" : "/tmp",tar:"gtar"},[]] - ,["--tmp=tmp -tar=gtar", - {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]] - ,["--logfd x", {}, []] - ,["a -true -- -no-false", {true:true},["a","-no-false"]] - ,["a -no-false", {false:false},["a"]] - ,["a -no-no-true", {true:true}, ["a"]] - ,["a -no-no-no-false", {false:false}, ["a"]] - ,["---NO-no-No-no-no-no-nO-no-no"+ - "-No-no-no-no-no-no-no-no-no"+ - "-no-no-no-no-NO-NO-no-no-no-no-no-no"+ - "-no-body-can-do-the-boogaloo-like-I-do" - ,{"body-can-do-the-boogaloo-like-I-do":false}, []] - ,["we are -no-strangers-to-love "+ - "--you-know=the-rules --and=so-do-i "+ - "---im-thinking-of=a-full-commitment "+ - "--no-you-would-get-this-from-any-other-guy "+ - "--no-gonna-give-you-up "+ - "-no-gonna-let-you-down=true "+ - "--no-no-gonna-run-around false "+ - "--desert-you=false "+ - "--make-you-cry false "+ - "--no-tell-a-lie "+ - "--no-no-and-hurt-you false" - ,{"strangers-to-love":false - ,"you-know":"the-rules" - ,"and":"so-do-i" - ,"you-would-get-this-from-any-other-guy":false - ,"gonna-give-you-up":false - ,"gonna-let-you-down":false - ,"gonna-run-around":false - ,"desert-you":false - ,"make-you-cry":false - ,"tell-a-lie":false - ,"and-hurt-you":false - },["we", "are"]] - ,["-t one -t two -t three" - ,{t: ["one", "two", "three"]} - ,[]] - ,["-t one -t null -t three four five null" - ,{t: ["one", "null", "three"]} - ,["four", "five", "null"]] - ,["-t foo" - ,{t:["foo"]} - ,[]] - ,["--no-t" - ,{t:["false"]} - ,[]] - ,["-no-no-t" - ,{t:["true"]} - ,[]] - ,["-aoa one -aoa null -aoa 100" - ,{aoa:["one", null, '100']} - ,[]] - ,["-str 100" - ,{str:"100"} - ,[]] - ,["--color always" - ,{color:"always"} - ,[]] - ,["--no-nullstream" - ,{nullstream:null} - ,[]] - ,["--nullstream false" - ,{nullstream:null} - ,[]] - ,["--notadate=2011-01-25" - ,{notadate: "2011-01-25"} - ,[]] - ,["--date 2011-01-25" - ,{date: new Date("2011-01-25")} - ,[]] - ,["-cl 1" - ,{config: true, length: 1} - ,[] - ,{config: Boolean, length: Number, clear: Boolean} - ,{c: "--config", l: "--length"}] - ,["--acount bla" - ,{"acount":true} - ,["bla"] - ,{account: Boolean, credentials: Boolean, options: String} - ,{a:"--account", c:"--credentials",o:"--options"}] - ,["--clear" - ,{clear:true} - ,[] - ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean} - ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}] - ,["--file -" - ,{"file":"-"} - ,[] - ,{file:String} - ,{}] - ,["--file -" - ,{"file":true} - ,["-"] - ,{file:Boolean} - ,{}] - ,["--path" - ,{"path":null} - ,[]] - ,["--path ." - ,{"path":process.cwd()} - ,[]] - ].forEach(function (test) { - var argv = test[0].split(/\s+/) - , opts = test[1] - , rem = test[2] - , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0) - , parsed = actual.argv - delete actual.argv - for (var i in opts) { - var e = JSON.stringify(opts[i]) - , a = JSON.stringify(actual[i] === undefined ? null : actual[i]) - if (e && typeof e === "object") { - t.deepEqual(e, a) - } else { - t.equal(e, a) - } - } - t.deepEqual(rem, parsed.remain) - }) - t.end() -}) diff --git a/node_modules/npm-registry-fetch/CHANGELOG.md b/node_modules/npm-registry-fetch/CHANGELOG.md index 3599c6b2fcac1..75b74eec60144 100644 --- a/node_modules/npm-registry-fetch/CHANGELOG.md +++ b/node_modules/npm-registry-fetch/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [4.0.4](https://github.com/npm/registry-fetch/compare/v4.0.3...v4.0.4) (2020-04-28) + + + ## [4.0.3](https://github.com/npm/registry-fetch/compare/v4.0.2...v4.0.3) (2020-02-13) diff --git a/node_modules/npm-registry-fetch/README.md b/node_modules/npm-registry-fetch/README.md index 80ce64cda78ef..9f9c6d0e808fd 100644 --- a/node_modules/npm-registry-fetch/README.md +++ b/node_modules/npm-registry-fetch/README.md @@ -581,7 +581,7 @@ See also [`opts.ca`](#opts-ca). ##### `opts.timeout` * Type: Milliseconds -* Default: 30000 (30 seconds) +* Default: 0 (no timeout) Time before a hanging request times out. diff --git a/node_modules/npm-registry-fetch/config.js b/node_modules/npm-registry-fetch/config.js index d7be3f9b38a16..c4e8b687412a5 100644 --- a/node_modules/npm-registry-fetch/config.js +++ b/node_modules/npm-registry-fetch/config.js @@ -76,7 +76,7 @@ module.exports = figgyPudding({ 'spec': {}, 'strict-ssl': {}, 'timeout': { - default: 30 * 1000 + default: 0 }, 'user-agent': { default: `${ diff --git a/node_modules/npm-registry-fetch/package.json b/node_modules/npm-registry-fetch/package.json index ca6c5f90c6352..c1582514e36e1 100644 --- a/node_modules/npm-registry-fetch/package.json +++ b/node_modules/npm-registry-fetch/package.json @@ -1,19 +1,19 @@ { - "_from": "npm-registry-fetch@4.0.3", - "_id": "npm-registry-fetch@4.0.3", + "_from": "npm-registry-fetch@4.0.4", + "_id": "npm-registry-fetch@4.0.4", "_inBundle": false, - "_integrity": "sha512-WGvUx0lkKFhu9MbiGFuT9nG2NpfQ+4dCJwRwwtK2HK5izJEvwDxMeUyqbuMS7N/OkpVCqDorV6rO5E4V9F8lJw==", + "_integrity": "sha512-6jb34hX/iYNQebqWUHtU8YF6Cjb1H6ouTFPClYsyiW6lpFkljTpdeftm53rRojtja1rKAvKNIIiTS5Sjpw4wsA==", "_location": "/npm-registry-fetch", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "npm-registry-fetch@4.0.3", + "raw": "npm-registry-fetch@4.0.4", "name": "npm-registry-fetch", "escapedName": "npm-registry-fetch", - "rawSpec": "4.0.3", + "rawSpec": "4.0.4", "saveSpec": null, - "fetchSpec": "4.0.3" + "fetchSpec": "4.0.4" }, "_requiredBy": [ "#USER", @@ -28,10 +28,10 @@ "/npm-profile", "/pacote" ], - "_resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.3.tgz", - "_shasum": "3c2179e39e04f9348b1c2979545951d36bee8766", - "_spec": "npm-registry-fetch@4.0.3", - "_where": "/Users/darcyclarke/Documents/Repos/npm/cli", + "_resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.4.tgz", + "_shasum": "2da1ecf3f43d419d96abf313664291a4623d3ea5", + "_spec": "npm-registry-fetch@4.0.4", + "_where": "/Users/ruyadorno/Documents/workspace/cli", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -102,5 +102,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "4.0.3" + "version": "4.0.4" } diff --git a/package-lock.json b/package-lock.json index 4a27a40d3325c..7261d0b2f13a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "npm", - "version": "6.14.4", + "version": "6.14.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1770,7 +1770,7 @@ "dependencies": { "get-stream": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" } } @@ -2365,15 +2365,15 @@ "dependencies": { "get-stream": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" } } }, "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" }, "growl": { "version": "1.10.5", @@ -3632,9 +3632,9 @@ } }, "mkdirp": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", - "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "requires": { "minimist": "^1.2.5" }, @@ -3752,9 +3752,9 @@ } }, "nopt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", "requires": { "abbrev": "1", "osenv": "^0.1.4" @@ -3903,9 +3903,9 @@ } }, "npm-registry-fetch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.3.tgz", - "integrity": "sha512-WGvUx0lkKFhu9MbiGFuT9nG2NpfQ+4dCJwRwwtK2HK5izJEvwDxMeUyqbuMS7N/OkpVCqDorV6rO5E4V9F8lJw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.4.tgz", + "integrity": "sha512-6jb34hX/iYNQebqWUHtU8YF6Cjb1H6ouTFPClYsyiW6lpFkljTpdeftm53rRojtja1rKAvKNIIiTS5Sjpw4wsA==", "requires": { "JSONStream": "^1.3.4", "bluebird": "^3.5.1", diff --git a/package.json b/package.json index d367dc98b5982..bfbed9ea0bab4 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "6.14.4", + "version": "6.14.5", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -61,7 +61,7 @@ "fs-write-stream-atomic": "~1.0.10", "gentle-fs": "^2.3.0", "glob": "^7.1.6", - "graceful-fs": "^4.2.3", + "graceful-fs": "^4.2.4", "has-unicode": "~2.0.1", "hosted-git-info": "^2.8.8", "iferr": "^1.0.2", @@ -91,10 +91,10 @@ "lru-cache": "^5.1.1", "meant": "~1.0.1", "mississippi": "^3.0.0", - "mkdirp": "^0.5.4", + "mkdirp": "^0.5.5", "move-concurrently": "^1.0.1", "node-gyp": "^5.1.0", - "nopt": "~4.0.1", + "nopt": "^4.0.3", "normalize-package-data": "^2.5.0", "npm-audit-report": "^1.3.2", "npm-cache-filename": "~1.0.2", @@ -104,7 +104,7 @@ "npm-packlist": "^1.4.8", "npm-pick-manifest": "^3.0.2", "npm-profile": "^4.0.4", - "npm-registry-fetch": "^4.0.3", + "npm-registry-fetch": "^4.0.4", "npm-user-validate": "~1.0.0", "npmlog": "~4.1.2", "once": "~1.4.0", diff --git a/scripts/release.sh b/scripts/release.sh index 31fb6fa194141..75d2115aadf83 100644 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -7,6 +7,8 @@ unset CDPATH set -e rm -rf release *.tgz || true +rm node_modules/node-gyp/gyp/pylib/gyp/*.pyc || true +rm node_modules/node-gyp/gyp/pylib/gyp/generator/*.pyc || true mkdir release node ./bin/npm-cli.js pack --loglevel error >/dev/null mv *.tgz release diff --git a/test/tap/install-dep-classification.js b/test/tap/install-dep-classification.js index 257fc99fc123f..1c9995cedc8a0 100644 --- a/test/tap/install-dep-classification.js +++ b/test/tap/install-dep-classification.js @@ -126,7 +126,7 @@ test('optional dependency identification', function (t) { optional: true }, example: { - version: '1.0.0', + version: 'file:../example-1.0.0.tgz', optional: true } } @@ -150,7 +150,7 @@ test('development dependency identification', function (t) { dev: true }, example: { - version: '1.0.0', + version: 'file:../example-1.0.0.tgz', dev: true } } @@ -173,7 +173,7 @@ test('default dependency identification', function (t) { optional: true }, example: { - version: '1.0.0', + version: 'file:../example-1.0.0.tgz', optional: true } }