From 59c836aae8d0104a767e80c540b963c91774012a Mon Sep 17 00:00:00 2001 From: isaacs Date: Mon, 9 Dec 2019 16:04:01 -0800 Subject: npm-packlist@1.4.7 --- node_modules/npm-bundled/index.js | 18 +++++++++++++----- node_modules/npm-bundled/package.json | 15 +++++++++------ 2 files changed, 22 insertions(+), 11 deletions(-) (limited to 'node_modules/npm-bundled') diff --git a/node_modules/npm-bundled/index.js b/node_modules/npm-bundled/index.js index bde0acd16..197a1bcb9 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 482973740..18c578a5c 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" } -- cgit v1.2.3