Skip to content

Commit 3fd5213

Browse files
committed
deps: npm-packlist@8.0.2
1 parent 2fd8292 commit 3fd5213

File tree

4 files changed

+13
-41
lines changed

4 files changed

+13
-41
lines changed

node_modules/npm-packlist/lib/index.js

+7-35
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,6 @@ const strictDefaults = [
4242
'/.git',
4343
]
4444

45-
const allLevels = [
46-
// these are included by default but can be excluded by package.json files array
47-
'!/readme{,.*[^~$]}',
48-
'!/copying{,.*[^~$]}',
49-
'!/license{,.*[^~$]}',
50-
'!/licence{,.*[^~$]}',
51-
]
52-
53-
const rootOnly = [
54-
/^!.*readme/i,
55-
/^!.*copying/i,
56-
/^!.*licen[sc]e/i,
57-
]
58-
5945
const normalizePath = (path) => path.split('\\').join('/')
6046

6147
const readOutOfTreeIgnoreFiles = (root, rel, result = []) => {
@@ -141,7 +127,6 @@ class PackWalker extends IgnoreWalker {
141127
// known required files for this directory
142128
this.injectRules(strictRules, [
143129
...strictDefaults,
144-
...allLevels,
145130
...this.requiredFiles.map((file) => `!${file}`),
146131
])
147132
}
@@ -294,8 +279,11 @@ class PackWalker extends IgnoreWalker {
294279
const ignores = []
295280
const strict = [
296281
...strictDefaults,
297-
...allLevels,
298282
'!/package.json',
283+
'!/readme{,.*[^~$]}',
284+
'!/copying{,.*[^~$]}',
285+
'!/license{,.*[^~$]}',
286+
'!/licence{,.*[^~$]}',
299287
'/.git',
300288
'/node_modules',
301289
'.npmrc',
@@ -310,13 +298,11 @@ class PackWalker extends IgnoreWalker {
310298
// invert the rule because these are things we want to include
311299
if (file.startsWith('./')) {
312300
file = file.slice(1)
313-
} else if (file.endsWith('/*')) {
314-
file = file.slice(0, -1)
301+
}
302+
if (file.endsWith('/*')) {
303+
file += '*'
315304
}
316305
const inverse = `!${file}`
317-
318-
this.excludeNonRoot(file)
319-
320306
try {
321307
// if an entry in the files array is a specific file, then we need to include it as a
322308
// 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 {
365351
this.injectRules(strictRules, strict, callback)
366352
}
367353

368-
// excludes non root files by checking if elements from the files array in
369-
// package.json contain an ! and readme/license/licence/copying, and then
370-
// removing readme/license/licence/copying accordingly from strict defaults
371-
excludeNonRoot (file) {
372-
// Find the pattern
373-
const matchingPattern = rootOnly.find(regex => regex.test(file))
374-
375-
if (matchingPattern) {
376-
// Find which index matches the pattern and remove it from allLevels
377-
const indexToRemove = allLevels.findIndex(element => matchingPattern.test(element))
378-
allLevels.splice(indexToRemove, 1)
379-
}
380-
}
381-
382354
// custom method: after we've finished gathering the files for the root package, we call this
383355
// before emitting the 'done' event in order to gather all of the files for bundled deps
384356
async gatherBundles () {

node_modules/npm-packlist/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "npm-packlist",
3-
"version": "8.0.1",
3+
"version": "8.0.2",
44
"description": "Get a list of the files to add from a folder into an npm package",
55
"directories": {
66
"test": "test"

package-lock.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
"diff": "^5.1.0",
180180
"licensee": "^10.0.0",
181181
"nock": "^13.4.0",
182-
"npm-packlist": "^8.0.1",
182+
"npm-packlist": "^8.0.2",
183183
"remark": "^14.0.2",
184184
"remark-gfm": "^3.0.1",
185185
"remark-github": "^11.2.4",
@@ -10158,9 +10158,9 @@
1015810158
}
1015910159
},
1016010160
"node_modules/npm-packlist": {
10161-
"version": "8.0.1",
10162-
"resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-8.0.1.tgz",
10163-
"integrity": "sha512-MQpL27ZrsJQ2kiAuQPpZb5LtJwydNRnI15QWXsf3WHERu4rzjRj6Zju/My2fov7tLuu3Gle/uoIX/DDZ3u4O4Q==",
10161+
"version": "8.0.2",
10162+
"resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-8.0.2.tgz",
10163+
"integrity": "sha512-shYrPFIS/JLP4oQmAwDyk5HcyysKW8/JLTEA32S0Z5TzvpaeeX2yMFfoK1fjEBnCBvVyIB/Jj/GBFdm0wsgzbA==",
1016410164
"inBundle": true,
1016510165
"dependencies": {
1016610166
"ignore-walk": "^6.0.4"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
"diff": "^5.1.0",
211211
"licensee": "^10.0.0",
212212
"nock": "^13.4.0",
213-
"npm-packlist": "^8.0.1",
213+
"npm-packlist": "^8.0.2",
214214
"remark": "^14.0.2",
215215
"remark-gfm": "^3.0.1",
216216
"remark-github": "^11.2.4",

0 commit comments

Comments
 (0)