npm-packlist 1.1.9 → 1.1.10
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.
- package/index.js +10 -3
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -76,7 +76,11 @@ const npmWalker = Class => class Walker extends Class {
|
|
|
76
76
|
// get the partial path from the root of the walk
|
|
77
77
|
const p = this.path.substr(this.root.length + 1)
|
|
78
78
|
const pkgre = /^node_modules\/(@[^\/]+\/?[^\/]+|[^\/]+)(\/.*)?$/
|
|
79
|
-
const
|
|
79
|
+
const isRoot = !this.parent
|
|
80
|
+
const pkg = isRoot && pkgre.test(entry) ?
|
|
81
|
+
entry.replace(pkgre, '$1') : null
|
|
82
|
+
const rootNM = isRoot && entry === 'node_modules'
|
|
83
|
+
const rootPJ = isRoot && entry === 'package.json'
|
|
80
84
|
|
|
81
85
|
return (
|
|
82
86
|
// if we're in a bundled package, check with the parent.
|
|
@@ -86,14 +90,17 @@ const npmWalker = Class => class Walker extends Class {
|
|
|
86
90
|
// if package is bundled, all files included
|
|
87
91
|
// also include @scope dirs for bundled scoped deps
|
|
88
92
|
// they'll be ignored if no files end up in them.
|
|
93
|
+
// However, this only matters if we're in the root.
|
|
94
|
+
// node_modules folders elsewhere, like lib/node_modules,
|
|
95
|
+
// should be included normally unless ignored.
|
|
89
96
|
: pkg ? -1 !== this.bundled.indexOf(pkg) ||
|
|
90
97
|
-1 !== this.bundledScopes.indexOf(pkg)
|
|
91
98
|
|
|
92
99
|
// only walk top node_modules if we want to bundle something
|
|
93
|
-
:
|
|
100
|
+
: rootNM ? !!this.bundled.length
|
|
94
101
|
|
|
95
102
|
// always include package.json at the root.
|
|
96
|
-
:
|
|
103
|
+
: rootPJ ? true
|
|
97
104
|
|
|
98
105
|
// otherwise, follow ignore-walk's logic
|
|
99
106
|
: super.filterEntry(entry, partial)
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-packlist",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
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": "index.js",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"ignore-walk": "^3.0.
|
|
10
|
+
"ignore-walk": "^3.0.1",
|
|
11
11
|
"npm-bundled": "^1.0.1"
|
|
12
12
|
},
|
|
13
13
|
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"mkdirp": "^0.5.1",
|
|
20
20
|
"rimraf": "^2.6.1",
|
|
21
|
-
"tap": "^10.
|
|
21
|
+
"tap": "^10.7.2"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"test": "tap test/*.js --100 -J",
|