npm-pkgbuild 15.4.1 → 15.5.0
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,4 +1,4 @@
|
|
|
1
|
-
import { dirname } from "node:path";
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
2
|
import { globby } from "globby";
|
|
3
3
|
import { FileSystemEntry } from "content-entry-filesystem";
|
|
4
4
|
import { asArray } from "../util.mjs";
|
|
@@ -46,6 +46,10 @@ export class FileContentProvider extends ContentProvider {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
get isPatternMatch() {
|
|
50
|
+
return this.definitions.pattern.find(p => p.match(/[\*\?]/));
|
|
51
|
+
}
|
|
52
|
+
|
|
49
53
|
toString() {
|
|
50
54
|
return `${this.constructor.name}: ${this.definitions.base}, ${this.definitions.pattern} -> ${this.entryProperties.destination}`;
|
|
51
55
|
}
|
|
@@ -54,6 +58,7 @@ export class FileContentProvider extends ContentProvider {
|
|
|
54
58
|
const definitions = this.definitions;
|
|
55
59
|
const base = definitions.base;
|
|
56
60
|
|
|
61
|
+
let count = 0;
|
|
57
62
|
for (const name of await globby(definitions.pattern, {
|
|
58
63
|
cwd: base
|
|
59
64
|
})) {
|
|
@@ -65,6 +70,15 @@ export class FileContentProvider extends ContentProvider {
|
|
|
65
70
|
yield this.baseProperties
|
|
66
71
|
? Object.create(entry, this.baseProperties)
|
|
67
72
|
: entry;
|
|
73
|
+
|
|
74
|
+
count++;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (!this.isPatternMatch && count < 1) {
|
|
78
|
+
const file = join(base, this.definitions.pattern[0]);
|
|
79
|
+
const error = new Error(`File not found ${file}`);
|
|
80
|
+
error.file = file;
|
|
81
|
+
throw error;
|
|
68
82
|
}
|
|
69
83
|
}
|
|
70
84
|
}
|
|
@@ -255,7 +255,8 @@ const toBeSkipped = new RegExp(
|
|
|
255
255
|
"__tests__",
|
|
256
256
|
"Porting-Buffer\\.md",
|
|
257
257
|
"chains and topics\\.md",
|
|
258
|
-
"build_detect_platform"
|
|
258
|
+
"build_detect_platform",
|
|
259
|
+
"install_daemon_node.node"
|
|
259
260
|
].join("|") +
|
|
260
261
|
")$|(node_modules/(npm-pkgbuild|@types|node-addon-api|mf-hosting|node-gyp$)|(win32|android|darwin)-(ia32|x64|arm|arm64))",
|
|
261
262
|
"i"
|
|
@@ -334,7 +334,7 @@ export async function* extractFromPackage(options = {}, env = {}) {
|
|
|
334
334
|
dependencies = mergeDependencies(dependencies, fragment.dependencies);
|
|
335
335
|
Object.assign(output, fragment.output);
|
|
336
336
|
for (const def of Object.values(output)) {
|
|
337
|
-
if (def.content) {
|
|
337
|
+
if (def.content && !def.dir) {
|
|
338
338
|
def.dir = fragment.dir;
|
|
339
339
|
}
|
|
340
340
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
export class FileContentProvider extends ContentProvider {
|
|
8
8
|
static get description(): string;
|
|
9
9
|
definitions: any;
|
|
10
|
+
get isPatternMatch(): any;
|
|
10
11
|
[Symbol.asyncIterator](): AsyncGenerator<any, void, unknown>;
|
|
11
12
|
}
|
|
12
13
|
import { ContentProvider } from "./content-provider.mjs";
|