npm-packlist 5.0.0 → 5.0.3

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 +4 -3
  2. package/package.json +4 -4
package/lib/index.js CHANGED
@@ -31,6 +31,7 @@ const packageMustHavesRE = new RegExp(`^(${packageMustHaveFileNames})(\\..*[^~$]
31
31
 
32
32
  const fs = require('fs')
33
33
  const glob = require('glob')
34
+ const globify = pattern => pattern.split('\\').join('/')
34
35
 
35
36
  const pathHasPkg = (input) => {
36
37
  if (!input.startsWith('node_modules/')) {
@@ -241,8 +242,8 @@ class Walker extends IgnoreWalker {
241
242
  if (excl) {
242
243
  pattern = pattern.slice(excl[0].length)
243
244
  }
244
- // strip off any / from the start of the pattern. /foo => foo
245
- pattern = pattern.replace(/^\/+/, '')
245
+ // strip off any / or ./ from the start of the pattern. /foo => foo, ./foo => foo
246
+ pattern = pattern.replace(/^\.?\/+/, '')
246
247
  // an odd number of ! means a negated pattern. !!foo ==> foo
247
248
  const negate = excl && excl[0].length % 2 === 1
248
249
  set.push({ pattern, negate })
@@ -428,7 +429,7 @@ class Walker extends IgnoreWalker {
428
429
  }
429
430
 
430
431
  globFiles (pattern, cb) {
431
- glob(pattern, { dot: true, cwd: this.path, nocase: true }, cb)
432
+ glob(globify(pattern), { dot: true, cwd: this.path, nocase: true }, cb)
432
433
  }
433
434
 
434
435
  readPackageJson (entries) {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "npm-packlist",
3
- "version": "5.0.0",
3
+ "version": "5.0.3",
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"
7
7
  },
8
8
  "main": "lib",
9
9
  "dependencies": {
10
- "glob": "^7.2.0",
10
+ "glob": "^8.0.1",
11
11
  "ignore-walk": "^5.0.1",
12
12
  "npm-bundled": "^1.1.2",
13
13
  "npm-normalize-package-bin": "^1.0.1"
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "devDependencies": {
22
22
  "@npmcli/eslint-config": "^3.0.1",
23
- "@npmcli/template-oss": "3.2.2",
23
+ "@npmcli/template-oss": "3.4.2",
24
24
  "mutate-fs": "^2.1.1",
25
25
  "tap": "^16.0.1"
26
26
  },
@@ -56,6 +56,6 @@
56
56
  },
57
57
  "templateOSS": {
58
58
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
59
- "version": "3.2.2"
59
+ "version": "3.4.2"
60
60
  }
61
61
  }