From 3fd521393461639b6b768df43f0b5b71d3ee7dd2 Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 8 Jan 2024 13:56:21 -0800 Subject: [PATCH] deps: npm-packlist@8.0.2 --- node_modules/npm-packlist/lib/index.js | 42 +++++--------------------- node_modules/npm-packlist/package.json | 2 +- package-lock.json | 8 ++--- package.json | 2 +- 4 files changed, 13 insertions(+), 41 deletions(-) diff --git a/node_modules/npm-packlist/lib/index.js b/node_modules/npm-packlist/lib/index.js index 8445925ae3046..985f11ee3f738 100644 --- a/node_modules/npm-packlist/lib/index.js +++ b/node_modules/npm-packlist/lib/index.js @@ -42,20 +42,6 @@ const strictDefaults = [ '/.git', ] -const allLevels = [ - // these are included by default but can be excluded by package.json files array - '!/readme{,.*[^~$]}', - '!/copying{,.*[^~$]}', - '!/license{,.*[^~$]}', - '!/licence{,.*[^~$]}', -] - -const rootOnly = [ - /^!.*readme/i, - /^!.*copying/i, - /^!.*licen[sc]e/i, -] - const normalizePath = (path) => path.split('\\').join('/') const readOutOfTreeIgnoreFiles = (root, rel, result = []) => { @@ -141,7 +127,6 @@ class PackWalker extends IgnoreWalker { // known required files for this directory this.injectRules(strictRules, [ ...strictDefaults, - ...allLevels, ...this.requiredFiles.map((file) => `!${file}`), ]) } @@ -294,8 +279,11 @@ class PackWalker extends IgnoreWalker { const ignores = [] const strict = [ ...strictDefaults, - ...allLevels, '!/package.json', + '!/readme{,.*[^~$]}', + '!/copying{,.*[^~$]}', + '!/license{,.*[^~$]}', + '!/licence{,.*[^~$]}', '/.git', '/node_modules', '.npmrc', @@ -310,13 +298,11 @@ class PackWalker extends IgnoreWalker { // invert the rule because these are things we want to include if (file.startsWith('./')) { file = file.slice(1) - } else if (file.endsWith('/*')) { - file = file.slice(0, -1) + } + if (file.endsWith('/*')) { + file += '*' } const inverse = `!${file}` - - this.excludeNonRoot(file) - try { // if an entry in the files array is a specific file, then we need to include it as a // strict requirement for this package. if it's a directory or a pattern, it's a default @@ -365,20 +351,6 @@ class PackWalker extends IgnoreWalker { this.injectRules(strictRules, strict, callback) } - // excludes non root files by checking if elements from the files array in - // package.json contain an ! and readme/license/licence/copying, and then - // removing readme/license/licence/copying accordingly from strict defaults - excludeNonRoot (file) { - // Find the pattern - const matchingPattern = rootOnly.find(regex => regex.test(file)) - - if (matchingPattern) { - // Find which index matches the pattern and remove it from allLevels - const indexToRemove = allLevels.findIndex(element => matchingPattern.test(element)) - allLevels.splice(indexToRemove, 1) - } - } - // custom method: after we've finished gathering the files for the root package, we call this // before emitting the 'done' event in order to gather all of the files for bundled deps async gatherBundles () { diff --git a/node_modules/npm-packlist/package.json b/node_modules/npm-packlist/package.json index 5f413550e4e72..8c3a16e741ad3 100644 --- a/node_modules/npm-packlist/package.json +++ b/node_modules/npm-packlist/package.json @@ -1,6 +1,6 @@ { "name": "npm-packlist", - "version": "8.0.1", + "version": "8.0.2", "description": "Get a list of the files to add from a folder into an npm package", "directories": { "test": "test" diff --git a/package-lock.json b/package-lock.json index 7f3756b577b6d..f7fd15d2a98c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -179,7 +179,7 @@ "diff": "^5.1.0", "licensee": "^10.0.0", "nock": "^13.4.0", - "npm-packlist": "^8.0.1", + "npm-packlist": "^8.0.2", "remark": "^14.0.2", "remark-gfm": "^3.0.1", "remark-github": "^11.2.4", @@ -10158,9 +10158,9 @@ } }, "node_modules/npm-packlist": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-8.0.1.tgz", - "integrity": "sha512-MQpL27ZrsJQ2kiAuQPpZb5LtJwydNRnI15QWXsf3WHERu4rzjRj6Zju/My2fov7tLuu3Gle/uoIX/DDZ3u4O4Q==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-8.0.2.tgz", + "integrity": "sha512-shYrPFIS/JLP4oQmAwDyk5HcyysKW8/JLTEA32S0Z5TzvpaeeX2yMFfoK1fjEBnCBvVyIB/Jj/GBFdm0wsgzbA==", "inBundle": true, "dependencies": { "ignore-walk": "^6.0.4" diff --git a/package.json b/package.json index a6a9fa5920719..1c8e708c326ef 100644 --- a/package.json +++ b/package.json @@ -210,7 +210,7 @@ "diff": "^5.1.0", "licensee": "^10.0.0", "nock": "^13.4.0", - "npm-packlist": "^8.0.1", + "npm-packlist": "^8.0.2", "remark": "^14.0.2", "remark-gfm": "^3.0.1", "remark-github": "^11.2.4",