npm-packlist 7.0.2 → 7.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +7 -0
  2. package/package.json +3 -3
package/lib/index.js CHANGED
@@ -300,6 +300,8 @@ class PackWalker extends IgnoreWalker {
300
300
  file = file.slice(1)
301
301
  } else if (file.startsWith('./')) {
302
302
  file = file.slice(2)
303
+ } else if (file.endsWith('/*')) {
304
+ file = file.slice(0, -2)
303
305
  }
304
306
  const inverse = `!${file}`
305
307
  try {
@@ -382,6 +384,11 @@ class PackWalker extends IgnoreWalker {
382
384
 
383
385
  // get a reference to the node we're bundling
384
386
  const node = this.tree.edgesOut.get(dep).to
387
+ // if there's no node, this is most likely an optional dependency that hasn't been
388
+ // installed. just skip it.
389
+ if (!node) {
390
+ continue
391
+ }
385
392
  // we use node.path for the path because we want the location the node was linked to,
386
393
  // not where it actually lives on disk
387
394
  const path = node.path
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-packlist",
3
- "version": "7.0.2",
3
+ "version": "7.0.4",
4
4
  "description": "Get a list of the files to add from a folder into an npm package",
5
5
  "directories": {
6
6
  "test": "test"
@@ -18,7 +18,7 @@
18
18
  "devDependencies": {
19
19
  "@npmcli/arborist": "^6.0.0 || ^6.0.0-pre.0",
20
20
  "@npmcli/eslint-config": "^4.0.0",
21
- "@npmcli/template-oss": "4.7.1",
21
+ "@npmcli/template-oss": "4.10.0",
22
22
  "mutate-fs": "^2.1.1",
23
23
  "tap": "^16.0.1"
24
24
  },
@@ -55,6 +55,6 @@
55
55
  },
56
56
  "templateOSS": {
57
57
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
58
- "version": "4.7.1"
58
+ "version": "4.10.0"
59
59
  }
60
60
  }