npm-packlist 2.1.4 → 2.1.5

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/index.js +8 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -182,6 +182,13 @@ const npmWalker = Class => class Walker extends Class {
182
182
 
183
183
  getPackageFiles (entries, pkg) {
184
184
  try {
185
+ // XXX this could be changed to use read-package-json-fast
186
+ // which handles the normalizing of bins for us, and simplifies
187
+ // the test for bundleDependencies and bundledDependencies later.
188
+ // HOWEVER if we do this, we need to be sure that we're careful
189
+ // about what we write back out since rpj-fast removes some fields
190
+ // that the user likely wants to keep. it also would add a second
191
+ // file read that we would want to optimize away.
185
192
  pkg = normalizePackageBin(JSON.parse(pkg.toString()))
186
193
  } catch (er) {
187
194
  // not actually a valid package.json
@@ -202,7 +209,7 @@ const npmWalker = Class => class Walker extends Class {
202
209
  // the files list as the effective readdir result, that means it
203
210
  // looks like we don't have a node_modules folder at all unless we
204
211
  // include it here.
205
- if (pkg.bundleDependencies && entries.includes('node_modules'))
212
+ if ((pkg.bundleDependencies || pkg.bundledDependencies) && entries.includes('node_modules'))
206
213
  pkg.files.push('node_modules')
207
214
 
208
215
  const patterns = Array.from(new Set(pkg.files)).reduce((set, pattern) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-packlist",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
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"
@@ -20,7 +20,7 @@
20
20
  "devDependencies": {
21
21
  "mutate-fs": "^2.1.1",
22
22
  "require-inject": "^1.4.4",
23
- "tap": "^14.10.7"
23
+ "tap": "^14.10.8"
24
24
  },
25
25
  "scripts": {
26
26
  "test": "tap",