From 32d34c0da4f393a74697297667eb9226155ecc6b Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Wed, 6 Feb 2019 13:14:23 -0800 Subject: [PATCH] npm-packlist@1.3.0 --- node_modules/npm-bundled/index.js | 14 ++++++++++++- node_modules/npm-bundled/package.json | 12 +++++------ node_modules/npm-packlist/index.js | 28 ++++++++++++++++++++------ node_modules/npm-packlist/package.json | 22 ++++++++++---------- package-lock.json | 12 +++++------ package.json | 2 +- 6 files changed, 59 insertions(+), 31 deletions(-) diff --git a/node_modules/npm-bundled/index.js b/node_modules/npm-bundled/index.js index c0c5f60cc0edf..bde0acd164b7d 100644 --- a/node_modules/npm-bundled/index.js +++ b/node_modules/npm-bundled/index.js @@ -43,6 +43,18 @@ class BundleWalker extends EE { this.bundle = null } + addListener (ev, fn) { + return this.on(ev, fn) + } + + on (ev, fn) { + const ret = super.on(ev, fn) + if (ev === 'done' && this.didDone) { + this.emit('done', this.result) + } + return ret + } + done () { if (!this.didDone) { this.didDone = true @@ -57,7 +69,7 @@ class BundleWalker extends EE { } start () { - const pj = this.path + '/package.json' + const pj = path.resolve(this.path, 'package.json') if (this.packageJsonCache.has(pj)) this.onPackage(this.packageJsonCache.get(pj)) else diff --git a/node_modules/npm-bundled/package.json b/node_modules/npm-bundled/package.json index 4c46838ce476a..4829737400453 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.5", + "_id": "npm-bundled@1.0.6", "_inBundle": false, - "_integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==", + "_integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "_location": "/npm-bundled", "_phantomChildren": {}, "_requested": { @@ -18,10 +18,10 @@ "_requiredBy": [ "/npm-packlist" ], - "_resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", - "_shasum": "3c1732b7ba936b3a10325aef616467c0ccbcc979", + "_resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "_shasum": "e7ba9aadcef962bb61248f91721cd932b3fe6bdd", "_spec": "npm-bundled@^1.0.1", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/npm-packlist", + "_where": "/Users/aeschright/code/npm-release/node_modules/npm-packlist", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -56,5 +56,5 @@ "preversion": "npm test", "test": "tap test/*.js -J --100" }, - "version": "1.0.5" + "version": "1.0.6" } diff --git a/node_modules/npm-packlist/index.js b/node_modules/npm-packlist/index.js index 110a344cb04d9..5cbe011fb66e8 100644 --- a/node_modules/npm-packlist/index.js +++ b/node_modules/npm-packlist/index.js @@ -38,7 +38,13 @@ const defaultRules = [ '._*', '*.orig', 'package-lock.json', + 'yarn.lock', 'archived-packages/**', + 'core', + '*.core', + '*.vgcore', + 'vgcore.*', + 'core.+([0-9])', ] // a decorator that applies our custom rules to an ignore walker @@ -136,13 +142,21 @@ const npmWalker = Class => class Walker extends Class { onPackageJson (ig, pkg, then) { this.packageJsonCache.set(ig, pkg) - // if there's a browser or main, make sure we don't ignore it + // if there's a bin, browser or main, make sure we don't ignore it const rules = [ pkg.browser ? '!' + pkg.browser : '', pkg.main ? '!' + pkg.main : '', - '!@(readme|copying|license|licence|notice|changes|changelog|history){,.*}' - ].filter(f => f).join('\n') + '\n' - super.onReadIgnoreFile(packageNecessaryRules, rules, _=>_) + '!@(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) + + const data = rules.filter(f => f).join('\n') + '\n' + super.onReadIgnoreFile(packageNecessaryRules, data, _=>_) if (Array.isArray(pkg.files)) super.onReadIgnoreFile('package.json', '*\n' + pkg.files.map( @@ -163,7 +177,8 @@ const npmWalker = Class => class Walker extends Class { onReadIgnoreFile (file, data, then) { if (file === 'package.json') try { - this.onPackageJson(file, JSON.parse(data), then) + const ig = path.resolve(this.path, file) + this.onPackageJson(ig, JSON.parse(data), then) } catch (er) { // ignore package.json files that are not json then() @@ -193,12 +208,13 @@ class WalkerSync extends npmWalker(IgnoreWalkerSync) { const walk = (options, callback) => { options = options || {} const p = new Promise((resolve, reject) => { - const bw = new BundleWalker(options).start() + const bw = new BundleWalker(options) bw.on('done', bundled => { options.bundled = bundled options.packageJsonCache = bw.packageJsonCache new Walker(options).on('done', resolve).on('error', reject).start() }) + bw.start() }) return callback ? p.then(res => callback(null, res), callback) : p } diff --git a/node_modules/npm-packlist/package.json b/node_modules/npm-packlist/package.json index d37a7bd1bb4f6..20b37c55b5e8c 100644 --- a/node_modules/npm-packlist/package.json +++ b/node_modules/npm-packlist/package.json @@ -1,29 +1,29 @@ { - "_from": "npm-packlist@1.2.0", - "_id": "npm-packlist@1.2.0", + "_from": "npm-packlist@1.3.0", + "_id": "npm-packlist@1.3.0", "_inBundle": false, - "_integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", + "_integrity": "sha512-qPBc6CnxEzpOcc4bjoIBJbYdy0D/LFFPUdxvfwor4/w3vxeE0h6TiOVurCEPpQ6trjN77u/ShyfeJGsbAfB3dA==", "_location": "/npm-packlist", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "npm-packlist@1.2.0", + "raw": "npm-packlist@1.3.0", "name": "npm-packlist", "escapedName": "npm-packlist", - "rawSpec": "1.2.0", + "rawSpec": "1.3.0", "saveSpec": null, - "fetchSpec": "1.2.0" + "fetchSpec": "1.3.0" }, "_requiredBy": [ "#USER", "/", "/pacote" ], - "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.2.0.tgz", - "_shasum": "55a60e793e272f00862c7089274439a4cc31fc7f", - "_spec": "npm-packlist@1.2.0", - "_where": "/Users/aeschright/code/cli", + "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.3.0.tgz", + "_shasum": "7f01e8e44408341379ca98cfd756e7b29bd2626c", + "_spec": "npm-packlist@1.3.0", + "_where": "/Users/aeschright/code/npm-release", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -64,5 +64,5 @@ "preversion": "npm test", "test": "tap test/*.js --100 -J" }, - "version": "1.2.0" + "version": "1.3.0" } diff --git a/package-lock.json b/package-lock.json index 86d41472273be..ad6af6d07e53b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3202,9 +3202,9 @@ } }, "npm-bundled": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", - "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==" + "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==" }, "npm-cache-filename": { "version": "1.0.2", @@ -3251,9 +3251,9 @@ } }, "npm-packlist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.2.0.tgz", - "integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.3.0.tgz", + "integrity": "sha512-qPBc6CnxEzpOcc4bjoIBJbYdy0D/LFFPUdxvfwor4/w3vxeE0h6TiOVurCEPpQ6trjN77u/ShyfeJGsbAfB3dA==", "requires": { "ignore-walk": "^3.0.1", "npm-bundled": "^1.0.1" diff --git a/package.json b/package.json index ea4c35001665f..ff329704debf2 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "npm-install-checks": "~3.0.0", "npm-lifecycle": "^2.1.0", "npm-package-arg": "^6.1.0", - "npm-packlist": "^1.2.0", + "npm-packlist": "^1.3.0", "npm-pick-manifest": "^2.2.3", "npm-registry-fetch": "^3.9.0", "npm-user-validate": "~1.0.0",