diff --git a/node_modules/npm-bundled/index.js b/node_modules/npm-bundled/index.js index bde0acd164b7d..197a1bcb99a15 100644 --- a/node_modules/npm-bundled/index.js +++ b/node_modules/npm-bundled/index.js @@ -10,6 +10,9 @@ const fs = require('fs') const path = require('path') const EE = require('events').EventEmitter +// we don't care about the package bins, but we share a pj cache +// with other modules that DO care about it, so keep it nice. +const normalizePackageBin = require('npm-normalize-package-bin') class BundleWalker extends EE { constructor (opt) { @@ -84,7 +87,7 @@ class BundleWalker extends EE { onPackageJson (pj, data) { try { - this.package = JSON.parse(data + '') + this.package = normalizePackageBin(JSON.parse(data + '')) } catch (er) { return this.done() } @@ -92,17 +95,22 @@ class BundleWalker extends EE { this.onPackage(this.package) } + allDepsBundled (pkg) { + return Object.keys(pkg.dependencies || {}).concat( + Object.keys(pkg.optionalDependencies || {})) + } + onPackage (pkg) { // all deps are bundled if we got here as a child. // otherwise, only bundle bundledDeps // Get a unique-ified array with a short-lived Set - const bdRaw = this.parent - ? Object.keys(pkg.dependencies || {}).concat( - Object.keys(pkg.optionalDependencies || {})) + const bdRaw = this.parent ? this.allDepsBundled(pkg) : pkg.bundleDependencies || pkg.bundledDependencies || [] const bd = Array.from(new Set( - Array.isArray(bdRaw) ? bdRaw : Object.keys(bdRaw))) + Array.isArray(bdRaw) ? bdRaw + : bdRaw === true ? this.allDepsBundled(pkg) + : Object.keys(bdRaw))) if (!bd.length) return this.done() diff --git a/node_modules/npm-bundled/package.json b/node_modules/npm-bundled/package.json index 4829737400453..18c578a5cb72d 100644 --- a/node_modules/npm-bundled/package.json +++ b/node_modules/npm-bundled/package.json @@ -1,8 +1,8 @@ { "_from": "npm-bundled@^1.0.1", - "_id": "npm-bundled@1.0.6", + "_id": "npm-bundled@1.1.1", "_inBundle": false, - "_integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", + "_integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", "_location": "/npm-bundled", "_phantomChildren": {}, "_requested": { @@ -18,10 +18,10 @@ "_requiredBy": [ "/npm-packlist" ], - "_resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", - "_shasum": "e7ba9aadcef962bb61248f91721cd932b3fe6bdd", + "_resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", + "_shasum": "1edd570865a94cdb1bc8220775e29466c9fb234b", "_spec": "npm-bundled@^1.0.1", - "_where": "/Users/aeschright/code/npm-release/node_modules/npm-packlist", + "_where": "/Users/isaacs/dev/npm/cli/node_modules/npm-packlist", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -31,6 +31,9 @@ "url": "https://github.com/npm/npm-bundled/issues" }, "bundleDependencies": false, + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + }, "deprecated": false, "description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof", "devDependencies": { @@ -56,5 +59,5 @@ "preversion": "npm test", "test": "tap test/*.js -J --100" }, - "version": "1.0.6" + "version": "1.1.1" } diff --git a/node_modules/npm-packlist/index.js b/node_modules/npm-packlist/index.js index dd7706a4aee2a..eaf14b8661751 100644 --- a/node_modules/npm-packlist/index.js +++ b/node_modules/npm-packlist/index.js @@ -17,6 +17,8 @@ const rootBuiltinRules = Symbol('root-builtin-rules') const packageNecessaryRules = Symbol('package-necessary-rules') const path = require('path') +const normalizePackageBin = require('npm-normalize-package-bin') + const defaultRules = [ '.npmignore', '.gitignore', @@ -176,12 +178,11 @@ const npmWalker = Class => class Walker extends Class { '!npm-shrinkwrap.json', '!@(readme|copying|license|licence|notice|changes|changelog|history){,.*[^~$]}' ] - if (pkg.bin) - if (typeof pkg.bin === "object") - for (const key in pkg.bin) - rules.push('!' + pkg.bin[key]) - else - rules.push('!' + pkg.bin) + if (pkg.bin) { + // always an object, because normalized already + for (const key in pkg.bin) + rules.push('!' + pkg.bin[key]) + } const data = rules.filter(f => f).join('\n') + '\n' super.onReadIgnoreFile(packageNecessaryRules, data, _=>_) @@ -216,7 +217,7 @@ const npmWalker = Class => class Walker extends Class { if (file === 'package.json') try { const ig = path.resolve(this.path, file) - this.onPackageJson(ig, JSON.parse(data), then) + this.onPackageJson(ig, normalizePackageBin(JSON.parse(data)), then) } catch (er) { // ignore package.json files that are not json then() diff --git a/node_modules/npm-packlist/package.json b/node_modules/npm-packlist/package.json index a8fabfa7f1240..c022dcef65b51 100644 --- a/node_modules/npm-packlist/package.json +++ b/node_modules/npm-packlist/package.json @@ -1,29 +1,29 @@ { - "_from": "npm-packlist@1.4.6", - "_id": "npm-packlist@1.4.6", + "_from": "npm-packlist@1.4.7", + "_id": "npm-packlist@1.4.7", "_inBundle": false, - "_integrity": "sha512-u65uQdb+qwtGvEJh/DgQgW1Xg7sqeNbmxYyrvlNznaVTjV3E5P6F/EFjM+BVHXl7JJlsdG8A64M0XI8FI/IOlg==", + "_integrity": "sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ==", "_location": "/npm-packlist", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "npm-packlist@1.4.6", + "raw": "npm-packlist@1.4.7", "name": "npm-packlist", "escapedName": "npm-packlist", - "rawSpec": "1.4.6", + "rawSpec": "1.4.7", "saveSpec": null, - "fetchSpec": "1.4.6" + "fetchSpec": "1.4.7" }, "_requiredBy": [ "#USER", "/", "/pacote" ], - "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.6.tgz", - "_shasum": "53ba3ed11f8523079f1457376dd379ee4ea42ff4", - "_spec": "npm-packlist@1.4.6", - "_where": "/Users/mperrotte/npminc/cli", + "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.7.tgz", + "_shasum": "9e954365a06b80b18111ea900945af4f88ed4848", + "_spec": "npm-packlist@1.4.7", + "_where": "/Users/isaacs/dev/npm/cli", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -54,6 +54,9 @@ "license": "ISC", "main": "index.js", "name": "npm-packlist", + "publishConfig": { + "tag": "legacy-v1" + }, "repository": { "type": "git", "url": "git+https://github.com/npm/npm-packlist.git" @@ -68,5 +71,5 @@ "tap": { "jobs": 1 }, - "version": "1.4.6" + "version": "1.4.7" } diff --git a/package-lock.json b/package-lock.json index cb36983218900..f0a76b9e0056c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3778,9 +3778,12 @@ } }, "npm-bundled": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", - "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", + "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } }, "npm-cache-filename": { "version": "1.0.2", @@ -3838,9 +3841,9 @@ } }, "npm-packlist": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.6.tgz", - "integrity": "sha512-u65uQdb+qwtGvEJh/DgQgW1Xg7sqeNbmxYyrvlNznaVTjV3E5P6F/EFjM+BVHXl7JJlsdG8A64M0XI8FI/IOlg==", + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.7.tgz", + "integrity": "sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ==", "requires": { "ignore-walk": "^3.0.1", "npm-bundled": "^1.0.1" diff --git a/package.json b/package.json index 846a68fe35fe6..7638d0e741d4e 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "npm-install-checks": "^3.0.2", "npm-lifecycle": "^3.1.4", "npm-package-arg": "^6.1.1", - "npm-packlist": "^1.4.6", + "npm-packlist": "^1.4.7", "npm-pick-manifest": "^3.0.2", "npm-profile": "^4.0.2", "npm-registry-fetch": "^4.0.2",