diff options
author | Audrey Eschright <audrey@npmjs.com> | 2019-02-07 00:14:23 +0300 |
---|---|---|
committer | Audrey Eschright <audrey@lifeofaudrey.com> | 2019-02-14 22:19:49 +0300 |
commit | f492bb3e41517925ff82bb5e058dd539d5a7353c (patch) | |
tree | 9937183f2d2db616cf05610a7ac9f85c6c8e171d /node_modules | |
parent | 580e97e95e5cef365522021ef9675aa46689953e (diff) |
npm-packlist@1.3.0
Diffstat (limited to 'node_modules')
-rw-r--r-- | node_modules/npm-bundled/index.js | 14 | ||||
-rw-r--r-- | node_modules/npm-bundled/package.json | 12 | ||||
-rw-r--r-- | node_modules/npm-packlist/index.js | 28 | ||||
-rw-r--r-- | node_modules/npm-packlist/package.json | 22 |
4 files changed, 52 insertions, 24 deletions
diff --git a/node_modules/npm-bundled/index.js b/node_modules/npm-bundled/index.js index c0c5f60cc..bde0acd16 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 4c46838ce..482973740 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 110a344cb..5cbe011fb 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 d37a7bd1b..20b37c55b 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" } |