npm-pkgbuild 7.19.1 → 7.19.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "7.19.1",
3
+ "version": "7.19.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -28,8 +28,7 @@ export class NodeModulesContentProvider extends ContentProvider {
28
28
  this.entryProperties = entryProperties;
29
29
  }
30
30
 
31
- toString()
32
- {
31
+ toString() {
33
32
  return `${this.constructor.name}: ${this.dir}`;
34
33
  }
35
34
 
@@ -40,7 +39,11 @@ export class NodeModulesContentProvider extends ContentProvider {
40
39
  await readFile(join(this.dir, "package.json"), utf8StreamOptions)
41
40
  );
42
41
  delete json.devDependencies;
43
- await writeFile(join(tmp, "package.json"), JSON.stringify(json), utf8StreamOptions);
42
+ await writeFile(
43
+ join(tmp, "package.json"),
44
+ JSON.stringify(json),
45
+ utf8StreamOptions
46
+ );
44
47
 
45
48
  const arb = new Arborist({ path: tmp });
46
49
  await arb.buildIdealTree({ update: true, prune: true, saveType: "prod" });
@@ -50,42 +53,27 @@ export class NodeModulesContentProvider extends ContentProvider {
50
53
  for (const name of await globby("node_modules/**/*", {
51
54
  cwd: tmp
52
55
  })) {
53
- yield Object.assign(new FileSystemEntry(name, tmp), this.entryProperties);
56
+ if (
57
+ !name.match(
58
+ /(~|\.orig|\.log|\.tmp|\.bak|\.bat|yarn\.lock|\.DS_Store|\.travis\.yml|\.npm.*|\.git.*|rollup\.config\.(js|mjs|cjs)|readme.*\.md|\.c|\.cc|\.h|\.cmake|\.mk|\.\d)$/i
59
+ )
60
+ ) {
61
+ yield Object.assign(
62
+ new FileSystemEntry(name, tmp),
63
+ this.entryProperties
64
+ );
65
+ }
54
66
  }
55
67
  }
56
68
  }
57
69
 
58
70
  const toBeIgnored = [
59
- {
60
- options: { filesOnly: true },
61
- pattern: [".git*", ".npm*", "rollup.config.*", ".travis.yml"]
62
- },
63
71
  {
64
72
  options: { filesOnly: true },
65
73
  pattern: [
66
- "*~",
67
- "*.bak",
68
- "*.mk",
69
- "*.bat",
70
- "*.tmp",
71
- "*.log",
72
- "*.orig",
73
74
  "*.d.ts*",
74
- "*.1",
75
- "*.2",
76
- "*.3",
77
- "*.4",
78
- "*.5",
79
- "*.6",
80
- "*.7",
81
- "*.8",
82
- "*.9",
83
75
  "*.patch",
84
- "*.cc",
85
- "*.c",
86
- "*.h",
87
76
  "*.h.in",
88
- "*.cmake",
89
77
  "*.gyp",
90
78
  ".jshintrc*",
91
79
  ".esl*",
@@ -96,7 +84,6 @@ const toBeIgnored = [
96
84
  ".dockerignore",
97
85
  ".dir-locals.el",
98
86
  "appveyor.yml",
99
- "yarn.lock",
100
87
  "gulpfile.js",
101
88
  "jsdoc.json",
102
89
  "Gruntfile.js",
@@ -110,7 +97,6 @@ const toBeIgnored = [
110
97
  ".istanbul.yml",
111
98
  ".babelrc.*",
112
99
  ".nycrc",
113
- ".DS_Store",
114
100
  ".env",
115
101
  "x-package.json5",
116
102
  "component.json",
@@ -129,7 +115,6 @@ const toBeIgnored = [
129
115
  "Contributors*",
130
116
  "CHANGES*",
131
117
  "PATENTS*",
132
- "readme*.md",
133
118
  "AUTHORS*",
134
119
  "NOTICE*",
135
120
  "HISTORY*",
@@ -115,7 +115,9 @@ export async function extractFromPackage(pkg, dir) {
115
115
  };
116
116
 
117
117
  await packageWalker(async (pkg, base, modulePath) => {
118
- processPkg(pkg, base);
118
+ if (modulePath.length > 0) {
119
+ processPkg(pkg, base);
120
+ }
119
121
  return true;
120
122
  }, dir);
121
123