npm-pkgbuild 10.19.2 → 10.19.4
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 +4 -5
- package/src/extract-from-package.mjs +25 -8
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "10.19.
|
|
3
|
+
"version": "10.19.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"sideEffects": false,
|
|
8
7
|
"exports": {
|
|
9
8
|
".": "./src/module.mjs"
|
|
10
9
|
},
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
"@npmcli/arborist": "^6.1.6",
|
|
44
43
|
"@vercel/nft": "^0.22.5",
|
|
45
44
|
"aggregate-async-iterator": "^1.1.15",
|
|
46
|
-
"commander": "^
|
|
45
|
+
"commander": "^10.0.0",
|
|
47
46
|
"content-entry": "^5.2.16",
|
|
48
47
|
"content-entry-filesystem": "^5.2.13",
|
|
49
48
|
"content-entry-transform": "^1.4.27",
|
|
@@ -61,14 +60,14 @@
|
|
|
61
60
|
"tar-stream": "^3.0.0"
|
|
62
61
|
},
|
|
63
62
|
"devDependencies": {
|
|
64
|
-
"ava": "^5.1.
|
|
63
|
+
"ava": "^5.1.1",
|
|
65
64
|
"c8": "^7.12.0",
|
|
66
65
|
"documentation": "^14.0.1",
|
|
67
66
|
"semantic-release": "^20.0.2",
|
|
68
67
|
"stream-buffers": "^3.0.2"
|
|
69
68
|
},
|
|
70
69
|
"engines": {
|
|
71
|
-
"node": ">=16.
|
|
70
|
+
"node": ">=16.19.0"
|
|
72
71
|
},
|
|
73
72
|
"repository": {
|
|
74
73
|
"type": "git",
|
|
@@ -2,7 +2,7 @@ import { join, resolve } from "node:path";
|
|
|
2
2
|
import { packageDirectory } from "pkg-dir";
|
|
3
3
|
import { packageWalker } from "npm-package-walker";
|
|
4
4
|
import { createContext } from "expression-expander";
|
|
5
|
-
import { asArray
|
|
5
|
+
import { asArray } from "./util.mjs";
|
|
6
6
|
import { NPMPackContentProvider } from "./content/npm-pack-content-provider.mjs";
|
|
7
7
|
import { NodeModulesContentProvider } from "./content/node-modules-content-provider.mjs";
|
|
8
8
|
import { FileContentProvider } from "./content/file-content-provider.mjs";
|
|
@@ -191,6 +191,12 @@ export async function* extractFromPackage(options = {}, env = {}) {
|
|
|
191
191
|
if (modulePath.length >= 1) {
|
|
192
192
|
fragment.parent =
|
|
193
193
|
modulePath.length === 1 ? parent : modulePath[modulePath.length - 2];
|
|
194
|
+
/*console.log(
|
|
195
|
+
"FRAGMENT",
|
|
196
|
+
fragment.name,
|
|
197
|
+
fragment.parent,
|
|
198
|
+
fragments[fragment.parent] ? "exists" : "missing"
|
|
199
|
+
);*/
|
|
194
200
|
} else {
|
|
195
201
|
if (properties.name) {
|
|
196
202
|
properties.name = properties.name.replace(/^\@[^\/]+\//, "");
|
|
@@ -218,7 +224,7 @@ export async function* extractFromPackage(options = {}, env = {}) {
|
|
|
218
224
|
fragment.properties = properties;
|
|
219
225
|
fragment.dir = join(base, ...modulePath.map(p => `node_modules/${p}`));
|
|
220
226
|
|
|
221
|
-
fragments[
|
|
227
|
+
fragments[fragment.name] = fragment;
|
|
222
228
|
|
|
223
229
|
if (pkgbuild.variant) {
|
|
224
230
|
fragment.priority = 1;
|
|
@@ -228,8 +234,8 @@ export async function* extractFromPackage(options = {}, env = {}) {
|
|
|
228
234
|
if (modulePath.length === 0) {
|
|
229
235
|
root = fragment;
|
|
230
236
|
}
|
|
237
|
+
parent = fragment.name;
|
|
231
238
|
}
|
|
232
|
-
parent = packageContent.name;
|
|
233
239
|
|
|
234
240
|
return true;
|
|
235
241
|
}, await packageDirectory({ cwd: options.dir }));
|
|
@@ -237,9 +243,13 @@ export async function* extractFromPackage(options = {}, env = {}) {
|
|
|
237
243
|
if (root && Object.keys(variants).length === 0) {
|
|
238
244
|
variants.default = root;
|
|
239
245
|
}
|
|
246
|
+
/*
|
|
247
|
+
console.log("FRAGMENTS", Object.keys(fragments));
|
|
248
|
+
console.log("VARIANTS", variants);
|
|
249
|
+
*/
|
|
240
250
|
|
|
241
251
|
for (const [name, variant] of Object.entries(variants)) {
|
|
242
|
-
let arch =
|
|
252
|
+
let arch = variant.arch;
|
|
243
253
|
const properties = {};
|
|
244
254
|
const depends = {};
|
|
245
255
|
const output = {};
|
|
@@ -262,8 +272,6 @@ export async function* extractFromPackage(options = {}, env = {}) {
|
|
|
262
272
|
);
|
|
263
273
|
}
|
|
264
274
|
|
|
265
|
-
arch = [...arch].sort();
|
|
266
|
-
|
|
267
275
|
properties.variant = name;
|
|
268
276
|
|
|
269
277
|
const context = createContext({ properties });
|
|
@@ -277,10 +285,19 @@ export async function* extractFromPackage(options = {}, env = {}) {
|
|
|
277
285
|
properties: context.expand(properties)
|
|
278
286
|
};
|
|
279
287
|
|
|
280
|
-
|
|
288
|
+
console.log(
|
|
289
|
+
"RESULT",
|
|
290
|
+
result.variant,
|
|
291
|
+
result.properties,
|
|
292
|
+
sources,
|
|
293
|
+
output,
|
|
294
|
+
arch
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
if (arch.size === 0) {
|
|
281
298
|
yield result;
|
|
282
299
|
} else {
|
|
283
|
-
for (const a of arch) {
|
|
300
|
+
for (const a of [...arch].sort()) {
|
|
284
301
|
if (variant.restrictArch.size && !variant.restrictArch.has(a)) {
|
|
285
302
|
console.log("RESTRICT", a);
|
|
286
303
|
} else {
|