diff --git a/node_modules/npm-packlist/lib/index.js b/node_modules/npm-packlist/lib/index.js index 853a99c4fe2cd..91606e4faa5e6 100644 --- a/node_modules/npm-packlist/lib/index.js +++ b/node_modules/npm-packlist/lib/index.js @@ -294,8 +294,13 @@ class PackWalker extends IgnoreWalker { // if we have a files array in our package, we need to pull rules from it if (files) { - for (const file of files) { + for (let file of files) { // invert the rule because these are things we want to include + if (file.startsWith('/')) { + file = file.slice(1) + } else if (file.startsWith('./')) { + file = file.slice(2) + } const inverse = `!${file}` try { // if an entry in the files array is a specific file, then we need to include it as a @@ -305,7 +310,7 @@ class PackWalker extends IgnoreWalker { // if we have a file and we know that, it's strictly required if (stat.isFile()) { strict.unshift(inverse) - this.requiredFiles.push(file.startsWith('/') ? file.slice(1) : file) + this.requiredFiles.push(file) } else if (stat.isDirectory()) { // otherwise, it's a default ignore, and since we got here we know it's not a pattern // so we include the directory contents diff --git a/node_modules/npm-packlist/package.json b/node_modules/npm-packlist/package.json index c0fdd1b002ec1..ffbd9dda852c0 100644 --- a/node_modules/npm-packlist/package.json +++ b/node_modules/npm-packlist/package.json @@ -1,6 +1,6 @@ { "name": "npm-packlist", - "version": "7.0.1", + "version": "7.0.2", "description": "Get a list of the files to add from a folder into an npm package", "directories": { "test": "test" @@ -18,7 +18,7 @@ "devDependencies": { "@npmcli/arborist": "^6.0.0 || ^6.0.0-pre.0", "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.5.1", + "@npmcli/template-oss": "4.7.1", "mutate-fs": "^2.1.1", "tap": "^16.0.1" }, @@ -55,6 +55,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.5.1" + "version": "4.7.1" } } diff --git a/package-lock.json b/package-lock.json index 20e8b82045273..72797972f92bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8334,9 +8334,9 @@ } }, "node_modules/npm-packlist": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.1.tgz", - "integrity": "sha512-XddbYutimy7hdmP7S1tHMjFwghn64lvgdnhYG0KLGFBWjEvMt1/jg95OR3vPNNCjkakHS+k4a//3XOO8JOGI2A==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.2.tgz", + "integrity": "sha512-d2+7RMySjVXssww23rV5NuIq1NzGvM04OlI5kwnvtYKfFTAPVs6Zxmxns2HRtJEA1oNj7D/BbFXeVAOLmW3N3Q==", "inBundle": true, "dependencies": { "ignore-walk": "^6.0.0"