@dpuse/dpuse-development 1.0.144 → 1.0.147
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/README.md +14 -14
- package/dist/dpuse-development.es.js +332 -315
- package/dist/dpuse-development.es.js.map +1 -1
- package/dist/utilities-D98znirs.js.map +1 -1
- package/package.json +5 -5
|
@@ -237,11 +237,15 @@ async function Le() {
|
|
|
237
237
|
"--no-fund"
|
|
238
238
|
], !0), await be("4️⃣ Name the advisories above that the CI audit ignores");
|
|
239
239
|
let t = await Re();
|
|
240
|
-
t.length > 0 ? await r("5️⃣ Move install-script pins to installed versions", "npm", [
|
|
240
|
+
if (t.length > 0 ? await r("5️⃣ Move install-script pins to installed versions", "npm", [
|
|
241
241
|
"install-scripts",
|
|
242
242
|
"approve",
|
|
243
243
|
...t
|
|
244
|
-
]) : w("5️⃣ No pinned install-script approvals to move"), process.platform === "darwin"
|
|
244
|
+
]) : w("5️⃣ No pinned install-script approvals to move"), process.platform === "darwin") {
|
|
245
|
+
let e = await ze();
|
|
246
|
+
await r("6️⃣ Remove unused install-script entries", "npm", ["install-scripts", "prune"]), await Be(e);
|
|
247
|
+
} else w("6️⃣ Skipped removing unused install-script entries (macOS only)");
|
|
248
|
+
t.length > 0 && await r("7️⃣ Run install scripts skipped in steps 3 and 4", "npm", [
|
|
245
249
|
"rebuild",
|
|
246
250
|
...t,
|
|
247
251
|
"--no-strict-allow-scripts"
|
|
@@ -256,55 +260,68 @@ async function Le() {
|
|
|
256
260
|
}
|
|
257
261
|
}
|
|
258
262
|
async function Re() {
|
|
259
|
-
let
|
|
263
|
+
let e = await ze(), t = Object.entries(e).filter(([e, t]) => t && e.lastIndexOf("@") > 0).map(([e]) => e.slice(0, e.lastIndexOf("@")));
|
|
260
264
|
return [...new Set(t)];
|
|
261
265
|
}
|
|
266
|
+
async function ze() {
|
|
267
|
+
let { allowScripts: e = {} } = await C(E.resolve(process.cwd(), "package.json"));
|
|
268
|
+
return e;
|
|
269
|
+
}
|
|
270
|
+
async function Be(e) {
|
|
271
|
+
let t = E.resolve(process.cwd(), "package.json"), n = await C(t), r = n.allowScripts ?? {}, i = Object.keys(e).filter((e) => !Object.hasOwn(r, e));
|
|
272
|
+
if (i.length === 0) return;
|
|
273
|
+
let { packages: a = {} } = await C(E.resolve(process.cwd(), "package-lock.json")), o = Object.entries(a), s = i.filter((e) => {
|
|
274
|
+
let t = e.lastIndexOf("@"), n = t > 0 ? e.slice(0, t) : e, r = t > 0 ? e.slice(t + 1) : void 0;
|
|
275
|
+
return o.some(([e, t]) => e.endsWith(`node_modules/${n}`) && t.hasInstallScript === !0 && (r === void 0 || t.version === r));
|
|
276
|
+
});
|
|
277
|
+
s.length !== 0 && (n.allowScripts = Object.fromEntries(Object.entries(e).filter(([e]) => Object.hasOwn(r, e) || s.includes(e))), await v(t, n), w(`6️⃣ Restored install-script entries the lockfile still needs: ${s.join(", ")}`));
|
|
278
|
+
}
|
|
262
279
|
//#endregion
|
|
263
280
|
//#region src/actions/checkProject.ts
|
|
264
|
-
async function
|
|
281
|
+
async function Ve() {
|
|
265
282
|
await Oe(), await Le();
|
|
266
283
|
}
|
|
267
284
|
//#endregion
|
|
268
285
|
//#region src/actions/documentActions.ts
|
|
269
|
-
var
|
|
286
|
+
var He = "<!-- SUPPORTED_ACTIONS_START -->", Ue = "<!-- SUPPORTED_ACTIONS_END -->", We = "Connectors conform to a unified interface contract by implementing a specific subset of standard actions. These standardised actions allow the DPUse application to interact with any underlying data source in the same way, enabling Connectors to be built independently and loaded dynamically at runtime.", Ge = {
|
|
270
287
|
source: "This connector is a Source connector that supports only read actions. Connectors can also function as a Destination (write-only) or Bidirectional (read/write), depending on the actions they support.",
|
|
271
288
|
destination: "This connector is a Destination connector that supports only write actions. Connectors can also function as a Source (read-only) or Bidirectional (read/write), depending on the actions they support.",
|
|
272
289
|
bidirectional: "This connector is a Bidirectional connector that supports both read and write actions. Connectors can also function as a Source (read-only) or Destination (write-only), depending on the actions they support.",
|
|
273
290
|
unknown: "This connector does not yet implement any read or write actions, so its type cannot be determined. Connectors function as a Source (read-only), a Destination (write-only), or Bidirectional (read/write), depending on the actions they support."
|
|
274
|
-
},
|
|
275
|
-
async function
|
|
291
|
+
}, Ke = "The table below lists all connector actions and highlights those supported by this connector.";
|
|
292
|
+
async function qe() {
|
|
276
293
|
try {
|
|
277
294
|
l("Document Actions"), w("1️⃣ Insert actions description and table into 'README.md'");
|
|
278
|
-
let t = (await C("config.json")).actionNames ?? [], n = i(t), r = a(t), o = `## Supported Actions\n\n${
|
|
279
|
-
await e(o,
|
|
295
|
+
let t = (await C("config.json")).actionNames ?? [], n = i(t), r = a(t), o = `## Supported Actions\n\n${We}\n\n${Ge[n]} ${Ke}\n\n${r}`;
|
|
296
|
+
await e(o, He, Ue), x("Actions documented");
|
|
280
297
|
} catch (e) {
|
|
281
298
|
console.error("❌ Error documenting actions", e), process.exit(1);
|
|
282
299
|
}
|
|
283
300
|
}
|
|
284
301
|
//#endregion
|
|
285
302
|
//#region src/actions/documentContributingLicense.ts
|
|
286
|
-
async function
|
|
303
|
+
async function Je() {
|
|
287
304
|
try {
|
|
288
305
|
l("Document Contributing & License");
|
|
289
|
-
let [t, n] = await Promise.all([C("package.json"), C("config.json")]), { owner: r, repository: i } = S(t, "document contributing and license"), a =
|
|
290
|
-
w("1️⃣ Insert contributing and license content into 'README.md'"), await d(), await e(
|
|
306
|
+
let [t, n] = await Promise.all([C("package.json"), C("config.json")]), { owner: r, repository: i } = S(t, "document contributing and license"), a = Ye(t), o = Xe(n.firstCreatedAt);
|
|
307
|
+
w("1️⃣ Insert contributing and license content into 'README.md'"), await d(), await e(Ze(r, i, a, o), te, ae), x("Contributing & license documented");
|
|
291
308
|
} catch (e) {
|
|
292
309
|
console.error("❌ Error documenting contributing and license", e), process.exit(1);
|
|
293
310
|
}
|
|
294
311
|
}
|
|
295
|
-
function
|
|
312
|
+
function Ye(e) {
|
|
296
313
|
let t = e.author, n = typeof t == "string" ? t : t?.name;
|
|
297
314
|
if (n == null || n === "") throw Error("package.json 'author' field is required to document contributing and license.");
|
|
298
315
|
let r = n.indexOf("<"), i = r === -1 ? -1 : n.indexOf(">", r);
|
|
299
316
|
return i === -1 ? n.trim() : [n.slice(0, r).trim(), n.slice(i + 1).trim()].filter((e) => e !== "").join(" ");
|
|
300
317
|
}
|
|
301
|
-
function
|
|
318
|
+
function Xe(e) {
|
|
302
319
|
let t = (/* @__PURE__ */ new Date()).getFullYear();
|
|
303
320
|
if (e == null) return String(t);
|
|
304
321
|
let n = new Date(e).getFullYear();
|
|
305
322
|
return n === t ? String(t) : `${String(n)}-present`;
|
|
306
323
|
}
|
|
307
|
-
function
|
|
324
|
+
function Ze(e, t, n, r) {
|
|
308
325
|
return `## Contributing
|
|
309
326
|
|
|
310
327
|
This repository is maintained solely by its owner and does not, at present, accept external contributions into the canonical repo. Its source is published openly under the MIT License — every DPUse project is fully open source except DPUse Engine, which remains closed and proprietary.
|
|
@@ -319,8 +336,8 @@ This project is licensed under the MIT License, permitting free use, modificatio
|
|
|
319
336
|
}
|
|
320
337
|
//#endregion
|
|
321
338
|
//#region src/utilities/rustCrates.ts
|
|
322
|
-
var k = "licenses/cargoMetadata.json",
|
|
323
|
-
async function
|
|
339
|
+
var k = "licenses/cargoMetadata.json", A = "licenses/cargoTree.txt", Qe = 1e3, $e = 1e4, et = "dpuse-development (https://github.com/dpuse/dpuse-development)", tt = /^(?:copying|licen[cs]e|unlicense)/i, nt = "wasm32-unknown-unknown";
|
|
340
|
+
async function rt(e, n) {
|
|
324
341
|
if (await t("rust/Cargo.toml") === null) return null;
|
|
325
342
|
let r = [
|
|
326
343
|
"--manifest-path",
|
|
@@ -333,22 +350,22 @@ async function nt(e, n) {
|
|
|
333
350
|
"--edges",
|
|
334
351
|
"normal,no-proc-macro",
|
|
335
352
|
"--target",
|
|
336
|
-
|
|
353
|
+
nt,
|
|
337
354
|
"--prefix",
|
|
338
355
|
"depth",
|
|
339
356
|
"--format",
|
|
340
357
|
"{p}|{l}|{r}"
|
|
341
358
|
];
|
|
342
|
-
await o(e, "cargo", i,
|
|
359
|
+
await o(e, "cargo", i, A), await o(e, "cargo", [
|
|
343
360
|
"metadata",
|
|
344
361
|
...r,
|
|
345
362
|
"--format-version",
|
|
346
363
|
"1",
|
|
347
364
|
"--filter-platform",
|
|
348
|
-
|
|
365
|
+
nt
|
|
349
366
|
], k);
|
|
350
|
-
let a =
|
|
351
|
-
await T.rm(
|
|
367
|
+
let a = it(await s(A)), c = await C(k);
|
|
368
|
+
await T.rm(A, { force: !0 }), await T.rm(k, { force: !0 });
|
|
352
369
|
let l = /* @__PURE__ */ new Map();
|
|
353
370
|
for (let e of a) e.isOwn || l.has(`${e.name}@${e.version}`) || l.set(`${e.name}@${e.version}`, {
|
|
354
371
|
name: e.name,
|
|
@@ -361,9 +378,9 @@ async function nt(e, n) {
|
|
|
361
378
|
latestPublishedDate: ""
|
|
362
379
|
});
|
|
363
380
|
let u = l.values().toArray();
|
|
364
|
-
|
|
365
|
-
for (let e of u) e.licenseFiles = await
|
|
366
|
-
return await
|
|
381
|
+
at(u, n);
|
|
382
|
+
for (let e of u) e.licenseFiles = await ct(e, c);
|
|
383
|
+
return await lt(e, u), {
|
|
367
384
|
crates: u,
|
|
368
385
|
treeItems: a.map(({ name: e, version: t, depth: n, isOwn: r }) => ({
|
|
369
386
|
name: e,
|
|
@@ -373,7 +390,7 @@ async function nt(e, n) {
|
|
|
373
390
|
}))
|
|
374
391
|
};
|
|
375
392
|
}
|
|
376
|
-
function
|
|
393
|
+
function it(e) {
|
|
377
394
|
let t = [];
|
|
378
395
|
for (let n of e.split("\n")) {
|
|
379
396
|
let [e = "", r = "", i = ""] = n.trim().split("|", 3), a = /^\d+/.exec(e)?.[0];
|
|
@@ -390,30 +407,30 @@ function rt(e) {
|
|
|
390
407
|
}
|
|
391
408
|
return t;
|
|
392
409
|
}
|
|
393
|
-
function
|
|
394
|
-
let n = t.split(";").filter((e) =>
|
|
410
|
+
function at(e, t) {
|
|
411
|
+
let n = t.split(";").filter((e) => ot(e)), r = e.filter((e) => !st(e.licenseExpression, n));
|
|
395
412
|
if (r.length === 0) return;
|
|
396
413
|
let i = r.map((e) => `${e.name}@${e.version} (${e.licenseExpression === "" ? "no licence" : e.licenseExpression})`).join(", ");
|
|
397
414
|
throw Error(`Rust crates with licences not allowed: ${i}.`);
|
|
398
415
|
}
|
|
399
|
-
function
|
|
416
|
+
function ot(e) {
|
|
400
417
|
try {
|
|
401
418
|
return he(e, [e]);
|
|
402
419
|
} catch {
|
|
403
420
|
return !1;
|
|
404
421
|
}
|
|
405
422
|
}
|
|
406
|
-
function
|
|
423
|
+
function st(e, t) {
|
|
407
424
|
try {
|
|
408
425
|
return he(e.replaceAll("/", " OR "), t);
|
|
409
426
|
} catch {
|
|
410
427
|
return !1;
|
|
411
428
|
}
|
|
412
429
|
}
|
|
413
|
-
async function
|
|
430
|
+
async function ct(e, t) {
|
|
414
431
|
let n = t.packages.find((t) => t.name === e.name && t.version === e.version);
|
|
415
432
|
if (n == null) return [];
|
|
416
|
-
let r = E.dirname(n.manifest_path), i = (await T.readdir(r)).filter((e) =>
|
|
433
|
+
let r = E.dirname(n.manifest_path), i = (await T.readdir(r)).filter((e) => tt.test(e)).toSorted((e, t) => e.localeCompare(t, "en"));
|
|
417
434
|
await T.mkdir("licenses/downloads", { recursive: !0 });
|
|
418
435
|
let a = [];
|
|
419
436
|
for (let t of i) {
|
|
@@ -425,14 +442,14 @@ async function st(e, t) {
|
|
|
425
442
|
}
|
|
426
443
|
return a;
|
|
427
444
|
}
|
|
428
|
-
async function
|
|
445
|
+
async function lt(e, t) {
|
|
429
446
|
w(`${e} - fetch release dates from crates.io`);
|
|
430
447
|
for (let [e, n] of t.entries()) {
|
|
431
|
-
e > 0 && await me(
|
|
448
|
+
e > 0 && await me(Qe), console.info(`⚙️ Fetching '${n.name}' (${String(e + 1)} of ${String(t.length)})...`);
|
|
432
449
|
try {
|
|
433
450
|
let e = await fetch(`https://crates.io/api/v1/crates/${encodeURIComponent(n.name)}`, {
|
|
434
|
-
headers: { "User-Agent":
|
|
435
|
-
signal: AbortSignal.timeout(
|
|
451
|
+
headers: { "User-Agent": et },
|
|
452
|
+
signal: AbortSignal.timeout($e)
|
|
436
453
|
});
|
|
437
454
|
if (!e.ok) continue;
|
|
438
455
|
let t = await e.json(), r = new Map((t.versions ?? []).map((e) => [e.num, e.created_at]));
|
|
@@ -442,77 +459,77 @@ async function ct(e, t) {
|
|
|
442
459
|
}
|
|
443
460
|
//#endregion
|
|
444
461
|
//#region src/actions/documentDependencies.ts
|
|
445
|
-
var
|
|
446
|
-
async function
|
|
462
|
+
var j = "<!-- DEPENDENCY_LICENSES_START -->", M = "<!-- DEPENDENCY_LICENSES_END -->", N = "## Dependency Licenses", ut = `bundle-analysis-reports/${se}`, P = "licenses/licenseTree.json", dt = "Packages flagged ❗ have a newer version available; ⚠️ indicates a package that hasn't been updated in the last 6 months or longer. Neither flag necessarily indicates a problem: we let new releases stabilise before upgrading, and some packages are mature and stable (have limited or no dependencies), so they require no active development.", ft = `The dependency tree below lists every package in this project — direct and transitive — along with its installed version, release date, and update status. ${dt}`, pt = `The dependency tree below shows how each package in the table above is reached — direct and transitive — along with its installed version, release date, and update status. A package that does not ship itself, such as one whose parts are bundled separately, is left out and what ships beneath it is shown in its place. ${dt}`;
|
|
463
|
+
async function mt(e = "MIT") {
|
|
447
464
|
try {
|
|
448
465
|
l("Document Dependencies");
|
|
449
466
|
let t = await C("package.json"), n = t.name ?? "";
|
|
450
467
|
if (re.has(n)) {
|
|
451
|
-
await
|
|
468
|
+
await ht(n), x("Dependencies documented");
|
|
452
469
|
return;
|
|
453
470
|
}
|
|
454
471
|
await m("1️⃣ Clear downloaded licenses", "licenses/downloads");
|
|
455
|
-
let r = await
|
|
472
|
+
let r = await wt(), i = await Tt();
|
|
456
473
|
if (i === null) {
|
|
457
|
-
let n =
|
|
458
|
-
await
|
|
474
|
+
let n = kt(r);
|
|
475
|
+
await Ct("2️⃣ Identify production licenses", e, [t.name ?? "", ...n], !0), await o("3️⃣ Identify transitive dependencies", "npm", [
|
|
459
476
|
"ls",
|
|
460
477
|
"--all",
|
|
461
478
|
"--json",
|
|
462
479
|
"--omit=dev"
|
|
463
|
-
],
|
|
480
|
+
], P), await gt("4️⃣ ", e, new Set(n));
|
|
464
481
|
} else {
|
|
465
|
-
let n =
|
|
466
|
-
await
|
|
482
|
+
let n = Et(i, r), a = Dt(r), s = a.filter((e) => !n.has(e));
|
|
483
|
+
await Ct("2️⃣ Identify shipped licenses", e, [t.name ?? "", ...s], !1), Ot(n, new Set(a)), await o("3️⃣ Identify transitive dependencies", "npm", [
|
|
467
484
|
"ls",
|
|
468
485
|
"--all",
|
|
469
486
|
"--json"
|
|
470
|
-
],
|
|
471
|
-
let c = await
|
|
487
|
+
], P, !0);
|
|
488
|
+
let c = await rt("4️⃣ Identify Rust crates compiled into the WebAssembly", e), l = {
|
|
472
489
|
allowedLicenses: e,
|
|
473
|
-
productionNames:
|
|
490
|
+
productionNames: xt(t),
|
|
474
491
|
rustCrates: c,
|
|
475
492
|
shippedKeys: n
|
|
476
493
|
};
|
|
477
|
-
await
|
|
494
|
+
await _t(c === null ? "4️⃣ " : "5️⃣ ", l);
|
|
478
495
|
}
|
|
479
496
|
x("Dependencies documented");
|
|
480
497
|
} catch (e) {
|
|
481
498
|
console.error("❌ Error documenting dependencies", e), process.exit(1);
|
|
482
499
|
}
|
|
483
500
|
}
|
|
484
|
-
async function
|
|
501
|
+
async function ht(t) {
|
|
485
502
|
w(`1️⃣ Skip: ${t} is a development-only tool and is never part of a production release.`);
|
|
486
503
|
let n = `> [!WARNING]\n> Dependency licenses are not documented here: ${t} is a development-only tool and is never part of a production release.`;
|
|
487
|
-
await e(`${
|
|
504
|
+
await e(`${N}\n\n${n}`, j, M);
|
|
488
505
|
}
|
|
489
|
-
async function
|
|
506
|
+
async function gt(t, n, r) {
|
|
490
507
|
w(`${t} Insert licenses into 'README.md'`);
|
|
491
|
-
let i = await C(
|
|
492
|
-
for (let e of a.values()) o +=
|
|
508
|
+
let i = await C(P), a = await St(), o = `${Nt(n, !1)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
|
|
509
|
+
for (let e of a.values()) o += I(e);
|
|
493
510
|
let s = [];
|
|
494
|
-
i.dependencies != null &&
|
|
495
|
-
let c = `${
|
|
496
|
-
await e(`${
|
|
511
|
+
i.dependencies != null && Lt(i.dependencies, a, r, s, 0);
|
|
512
|
+
let c = `${ft}\n\n${s.join("\n")}`;
|
|
513
|
+
await e(`${N}\n\n${o.trimEnd()}\n\n### Dependency Tree\n\n${c}`, j, M);
|
|
497
514
|
}
|
|
498
|
-
async function
|
|
515
|
+
async function _t(t, n) {
|
|
499
516
|
w(`${t} Insert licenses into 'README.md'`);
|
|
500
|
-
let { allowedLicenses: r, productionNames: i, rustCrates: a, shippedKeys: o } = n, s = await
|
|
501
|
-
for (let e of s.values().toArray().toSorted(
|
|
502
|
-
for (let e of c.values().toArray().toSorted(
|
|
503
|
-
let f = await C(
|
|
504
|
-
|
|
517
|
+
let { allowedLicenses: r, productionNames: i, rustCrates: a, shippedKeys: o } = n, s = await St(), c = new Map((a?.crates ?? []).map((e) => [`${e.name}@${e.version}`, yt(e)])), l = a !== null, u = l ? "|Type|Dependency|Version|License(s)|Document|\n|:-|:-|:-:|:-|:-|" : "|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|", d = `${Nt(r, !0, l)}\n\n${u}\n`;
|
|
518
|
+
for (let e of s.values().toArray().toSorted(vt)) d += I(e, l ? "JavaScript" : void 0);
|
|
519
|
+
for (let e of c.values().toArray().toSorted(vt)) d += I(e, "Rust");
|
|
520
|
+
let f = await C(P), p = Object.entries(f.dependencies ?? {}).toSorted(([e], [t]) => Number(!i.has(e)) - Number(!i.has(t))), m = [];
|
|
521
|
+
L(p, {
|
|
505
522
|
licensesByKey: s,
|
|
506
523
|
shippedKeys: o,
|
|
507
524
|
shownKeys: /* @__PURE__ */ new Set()
|
|
508
525
|
}, m, 0, !1);
|
|
509
|
-
let h = m.length === 0 ? "None." : m.join("\n"), g = (a?.treeItems ?? []).map((e) =>
|
|
510
|
-
await e(`${
|
|
526
|
+
let h = m.length === 0 ? "None." : m.join("\n"), g = (a?.treeItems ?? []).map((e) => bt(e, c)).join("\n"), _ = l ? `${pt}\n\n#### JavaScript\n\n${h}\n\n#### Rust\n\n${g}` : `${pt}\n\n${h}`;
|
|
527
|
+
await e(`${N}\n\n${d.trimEnd()}\n\n### Dependency Tree\n\n${_}`, j, M);
|
|
511
528
|
}
|
|
512
|
-
function
|
|
529
|
+
function vt(e, t) {
|
|
513
530
|
return e.name.localeCompare(t.name, "en") || e.installedVersion.localeCompare(t.installedVersion, "en");
|
|
514
531
|
}
|
|
515
|
-
function
|
|
532
|
+
function yt(e) {
|
|
516
533
|
return {
|
|
517
534
|
name: e.name,
|
|
518
535
|
repository: e.repository,
|
|
@@ -525,26 +542,26 @@ function vt(e) {
|
|
|
525
542
|
licenseFiles: e.licenseFiles
|
|
526
543
|
};
|
|
527
544
|
}
|
|
528
|
-
function
|
|
545
|
+
function bt(e, t) {
|
|
529
546
|
let n = " ".repeat(e.depth);
|
|
530
|
-
return e.isOwn ? `${n}- **${e.name}** ${e.version} — this project's Rust code, compiled into its WebAssembly` :
|
|
547
|
+
return e.isOwn ? `${n}- **${e.name}** ${e.version} — this project's Rust code, compiled into its WebAssembly` : R(e.name, e.version, t.get(`${e.name}@${e.version}`), n);
|
|
531
548
|
}
|
|
532
|
-
function
|
|
549
|
+
function xt(e) {
|
|
533
550
|
return /* @__PURE__ */ new Set([
|
|
534
551
|
...Object.keys(e.dependencies ?? {}),
|
|
535
552
|
...Object.keys(e.optionalDependencies ?? {}),
|
|
536
553
|
...Object.keys(e.peerDependencies ?? {})
|
|
537
554
|
]);
|
|
538
555
|
}
|
|
539
|
-
async function
|
|
556
|
+
async function St() {
|
|
540
557
|
let e = await C("licenses/licenses.json"), t = /* @__PURE__ */ new Map();
|
|
541
|
-
for (let [n, r] of Object.entries(e)) t.set(n,
|
|
558
|
+
for (let [n, r] of Object.entries(e)) t.set(n, Ft(n, r));
|
|
542
559
|
return await Promise.all(t.values().map(async (e) => {
|
|
543
|
-
let t = await
|
|
560
|
+
let t = await It(e.name, e.installedVersion);
|
|
544
561
|
e.latestVersion = t.latestVersion, e.latestPublishedDate = t.latestPublishedDate, e.publishedDate = t.publishedDate;
|
|
545
562
|
})), t;
|
|
546
563
|
}
|
|
547
|
-
async function
|
|
564
|
+
async function Ct(e, t, n, r) {
|
|
548
565
|
w(e), await new Promise((e, i) => {
|
|
549
566
|
let a = {
|
|
550
567
|
start: process.cwd(),
|
|
@@ -562,58 +579,58 @@ async function St(e, t, n, r) {
|
|
|
562
579
|
});
|
|
563
580
|
});
|
|
564
581
|
}
|
|
565
|
-
async function
|
|
582
|
+
async function wt() {
|
|
566
583
|
let e = await t("package-lock.json");
|
|
567
584
|
return e === null ? {} : JSON.parse(e).packages ?? {};
|
|
568
585
|
}
|
|
569
|
-
async function
|
|
570
|
-
let e = await t(
|
|
586
|
+
async function Tt() {
|
|
587
|
+
let e = await t(ut);
|
|
571
588
|
return e === null ? null : JSON.parse(e);
|
|
572
589
|
}
|
|
573
|
-
function
|
|
590
|
+
function Et(e, t) {
|
|
574
591
|
let n = new Set(e.packages);
|
|
575
592
|
for (let r of e.external) {
|
|
576
|
-
let e =
|
|
577
|
-
if (e !== void 0) for (let r of [e, ...
|
|
593
|
+
let e = Mt(t, "", r);
|
|
594
|
+
if (e !== void 0) for (let r of [e, ...At(t, e)]) {
|
|
578
595
|
let e = t[r];
|
|
579
|
-
e?.version !== void 0 && n.add(
|
|
596
|
+
e?.version !== void 0 && n.add(F(r, e));
|
|
580
597
|
}
|
|
581
598
|
}
|
|
582
599
|
return n;
|
|
583
600
|
}
|
|
584
|
-
function
|
|
601
|
+
function Dt(e) {
|
|
585
602
|
let t = /* @__PURE__ */ new Set();
|
|
586
|
-
for (let [n, r] of Object.entries(e)) n !== "" && r.version !== void 0 && t.add(
|
|
603
|
+
for (let [n, r] of Object.entries(e)) n !== "" && r.version !== void 0 && t.add(F(n, r));
|
|
587
604
|
return [...t];
|
|
588
605
|
}
|
|
589
|
-
function
|
|
606
|
+
function Ot(e, t) {
|
|
590
607
|
let n = [...e.difference(t)];
|
|
591
608
|
n.length > 0 && console.warn(`⚠️ Not installed, so not checked; rebuild to refresh the record: ${n.join(", ")}`);
|
|
592
609
|
}
|
|
593
|
-
function
|
|
610
|
+
function F(e, t) {
|
|
594
611
|
return `${t.name ?? e.slice(e.lastIndexOf("node_modules/") + 13)}@${String(t.version)}`;
|
|
595
612
|
}
|
|
596
|
-
function
|
|
597
|
-
let t =
|
|
613
|
+
function kt(e) {
|
|
614
|
+
let t = At(e, ""), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
598
615
|
for (let [i, a] of Object.entries(e)) {
|
|
599
616
|
if (i === "" || a.version === void 0) continue;
|
|
600
|
-
let e =
|
|
617
|
+
let e = F(i, a);
|
|
601
618
|
t.has(i) ? n.add(e) : r.add(e);
|
|
602
619
|
}
|
|
603
620
|
return r.values().filter((e) => !n.has(e)).toArray();
|
|
604
621
|
}
|
|
605
|
-
function
|
|
622
|
+
function At(e, t) {
|
|
606
623
|
let n = /* @__PURE__ */ new Set(), r = [t];
|
|
607
624
|
for (; r.length > 0;) {
|
|
608
625
|
let t = r.pop() ?? "", i = e[t];
|
|
609
|
-
if (i !== void 0) for (let a of
|
|
610
|
-
let i =
|
|
626
|
+
if (i !== void 0) for (let a of jt(i)) {
|
|
627
|
+
let i = Mt(e, t, a);
|
|
611
628
|
i === void 0 || n.has(i) || (n.add(i), r.push(i));
|
|
612
629
|
}
|
|
613
630
|
}
|
|
614
631
|
return n;
|
|
615
632
|
}
|
|
616
|
-
function
|
|
633
|
+
function jt(e) {
|
|
617
634
|
let t = Object.keys(e.peerDependencies ?? {}).filter((t) => e.peerDependenciesMeta?.[t]?.optional !== !0);
|
|
618
635
|
return [
|
|
619
636
|
...Object.keys(e.dependencies ?? {}),
|
|
@@ -621,7 +638,7 @@ function At(e) {
|
|
|
621
638
|
...t
|
|
622
639
|
];
|
|
623
640
|
}
|
|
624
|
-
function
|
|
641
|
+
function Mt(e, t, n) {
|
|
625
642
|
let r = t;
|
|
626
643
|
for (;;) {
|
|
627
644
|
let t = r === "" ? `node_modules/${n}` : `${r}/node_modules/${n}`, i = e[t];
|
|
@@ -631,14 +648,14 @@ function jt(e, t, n) {
|
|
|
631
648
|
r = a === -1 ? "" : r.slice(0, a);
|
|
632
649
|
}
|
|
633
650
|
}
|
|
634
|
-
function
|
|
635
|
-
let r =
|
|
651
|
+
function Nt(e, t, n = !1) {
|
|
652
|
+
let r = Pt(e.split(";")), i = n ? "[license-checker](https://github.com/RSeidelsohn/license-checker-rseidelsohn) and [cargo tree](https://doc.rust-lang.org/cargo/commands/cargo-tree.html)" : "[license-checker](https://github.com/RSeidelsohn/license-checker-rseidelsohn)", a = "The following table lists every package whose code, styles or assets are included in this project's build, as recorded by the build itself. Modules loaded at run time are not included; each documents its own.";
|
|
636
653
|
return `License data is updated each time \`npm run document\` is run, using ${i}. ${t ? n ? `${a} It also lists every Rust crate compiled into its WebAssembly, as resolved by Cargo; macros and other crates used only while compiling put none of their code in it, so are left out.` : a : "The following table lists all production dependencies. This project has no build record, so the list is taken from its declared dependencies."} These dependencies have been checked and confirmed to use ${r}, all of which allow commercial use. All are used unmodified, so any licence conditions that apply only to modified versions are not triggered. Developers cloning this repository should independently verify development dependencies.`;
|
|
637
654
|
}
|
|
638
|
-
function
|
|
655
|
+
function Pt(e) {
|
|
639
656
|
return e.length === 1 ? e[0] ?? "" : e.length === 2 ? `${String(e[0])} or ${String(e[1])}` : `${e.slice(0, -1).join(", ")}, or ${String(e.at(-1))}`;
|
|
640
657
|
}
|
|
641
|
-
function
|
|
658
|
+
function Ft(e, t) {
|
|
642
659
|
let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
|
|
643
660
|
return {
|
|
644
661
|
name: r,
|
|
@@ -655,7 +672,7 @@ function Pt(e, t) {
|
|
|
655
672
|
}]
|
|
656
673
|
};
|
|
657
674
|
}
|
|
658
|
-
async function
|
|
675
|
+
async function It(e, t) {
|
|
659
676
|
try {
|
|
660
677
|
let n = await fetch(`https://registry.npmjs.org/${encodeURIComponent(e)}`);
|
|
661
678
|
if (n.ok) {
|
|
@@ -673,36 +690,36 @@ async function Ft(e, t) {
|
|
|
673
690
|
publishedDate: ""
|
|
674
691
|
};
|
|
675
692
|
}
|
|
676
|
-
function
|
|
693
|
+
function I(e, t) {
|
|
677
694
|
let n = e.licenseFiles.length === 0 ? "⚠️ No license file" : e.licenseFiles.map((e) => `[${e.label}](licenses/${e.path})`).join(" ");
|
|
678
695
|
return `${t === void 0 ? "" : `|${t}`}|[${e.name}](${e.repository})|${e.installedVersion}|${e.licenseTypes}|${n}|\n`;
|
|
679
696
|
}
|
|
680
|
-
function
|
|
697
|
+
function Lt(e, t, n, r, i) {
|
|
681
698
|
let a = " ".repeat(i);
|
|
682
699
|
for (let [o, s] of Object.entries(e)) {
|
|
683
700
|
if (s.version === void 0) continue;
|
|
684
701
|
let e = s.version;
|
|
685
|
-
n.has(`${o}@${e}`) || (r.push(
|
|
702
|
+
n.has(`${o}@${e}`) || (r.push(R(o, e, t.get(`${o}@${e}`), a)), s.dependencies != null && Lt(s.dependencies, t, n, r, i + 1));
|
|
686
703
|
}
|
|
687
704
|
}
|
|
688
|
-
function
|
|
705
|
+
function L(e, t, n, r, i) {
|
|
689
706
|
for (let [a, o] of e) {
|
|
690
707
|
if (o.version === void 0) continue;
|
|
691
708
|
let e = `${a}@${o.version}`, s = Object.entries(o.dependencies ?? {});
|
|
692
|
-
t.shippedKeys.has(e) ? i && t.shownKeys.has(e) || (t.shownKeys.add(e), n.push(
|
|
709
|
+
t.shippedKeys.has(e) ? i && t.shownKeys.has(e) || (t.shownKeys.add(e), n.push(R(a, o.version, t.licensesByKey.get(e), " ".repeat(r))), L(s, t, n, r + 1, !1)) : L(s, t, n, r, !0);
|
|
693
710
|
}
|
|
694
711
|
}
|
|
695
|
-
function
|
|
696
|
-
return `${r}- **${n == null ? e : `[${e}](${n.repository})`}** ${t}${
|
|
712
|
+
function R(e, t, n, r) {
|
|
713
|
+
return `${r}- **${n == null ? e : `[${e}](${n.repository})`}** ${t}${Rt(n)}`;
|
|
697
714
|
}
|
|
698
|
-
function
|
|
715
|
+
function Rt(e) {
|
|
699
716
|
if (e == null) return "";
|
|
700
|
-
let t = e.publishedDate ?
|
|
717
|
+
let t = e.publishedDate ? zt(e.publishedDate.split("T", 1)[0]) : "";
|
|
701
718
|
if (e.latestVersion === "" || e.latestVersion === e.installedVersion) return t === "" ? "" : ` — ${t}`;
|
|
702
|
-
let n = e.latestPublishedDate ?
|
|
719
|
+
let n = e.latestPublishedDate ? zt(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `latest: ${e.latestVersion} ❗` : `latest: ${e.latestVersion} — ${n} ❗`;
|
|
703
720
|
return t === "" ? ` — → ${r}` : ` — ${t} → ${r}`;
|
|
704
721
|
}
|
|
705
|
-
function
|
|
722
|
+
function zt(e) {
|
|
706
723
|
if (e == null || e === "") return "n/a";
|
|
707
724
|
let t = e.split("T", 1)[0];
|
|
708
725
|
if (t == null || t === "") return "n/a";
|
|
@@ -711,42 +728,42 @@ function Rt(e) {
|
|
|
711
728
|
}
|
|
712
729
|
//#endregion
|
|
713
730
|
//#region src/actions/documentOpening.ts
|
|
714
|
-
var
|
|
715
|
-
async function
|
|
731
|
+
var Bt = "<!-- OPENING_START -->", Vt = "<!-- OPENING_END -->";
|
|
732
|
+
async function Ht() {
|
|
716
733
|
try {
|
|
717
734
|
l("Document Opening"), w("1️⃣ Insert opening content into 'README.md'");
|
|
718
|
-
let t = await C("package.json"), n = await C("config.json"), { owner: r, repository: i } = S(t, "document opening"), a =
|
|
735
|
+
let t = await C("package.json"), n = await C("config.json"), { owner: r, repository: i } = S(t, "document opening"), a = Wt(t), o = Kt(n), s = g(n.id), c = s.uploadGroupName === void 0 ? void 0 : n.id, u = s.publishedTo === "npm" ? Gt(t) : void 0, d = qt(r, i, a, {
|
|
719
736
|
description: t.description,
|
|
720
737
|
dpuseModuleId: c,
|
|
721
738
|
introduction: o,
|
|
722
739
|
npmPackageName: u,
|
|
723
740
|
version: t.version
|
|
724
741
|
});
|
|
725
|
-
await e(d,
|
|
742
|
+
await e(d, Bt, Vt), x("Opening documented");
|
|
726
743
|
} catch (e) {
|
|
727
744
|
console.error("❌ Error documenting opening", e), process.exit(1);
|
|
728
745
|
}
|
|
729
746
|
}
|
|
730
|
-
function
|
|
747
|
+
function Ut(e) {
|
|
731
748
|
return e === void 0 ? "blue" : /^v?0/.test(e) || /alpha|beta|snapshot|dev|pre|rc/i.test(e) ? "orange" : "blue";
|
|
732
749
|
}
|
|
733
|
-
function
|
|
750
|
+
function Wt(e) {
|
|
734
751
|
let t = e.license;
|
|
735
752
|
if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
|
|
736
753
|
return t;
|
|
737
754
|
}
|
|
738
|
-
function
|
|
755
|
+
function Gt(e) {
|
|
739
756
|
let t = e.name;
|
|
740
757
|
if (t == null || t === "") throw Error("package.json 'name' field is required to document opening.");
|
|
741
758
|
return t;
|
|
742
759
|
}
|
|
743
|
-
function
|
|
760
|
+
function Kt(e) {
|
|
744
761
|
let t = e.description.en?.trim();
|
|
745
762
|
return t === void 0 || t === "" ? void 0 : t;
|
|
746
763
|
}
|
|
747
|
-
function
|
|
764
|
+
function qt(e, t, n, r) {
|
|
748
765
|
let { description: i, dpuseModuleId: a, introduction: o, npmPackageName: s, version: c } = r, l = `https://github.com/${e}/${t}`, u = n.replaceAll("-", "--"), d = encodeURIComponent(`https://api.dpuse.app/configs/${a ?? ""}`);
|
|
749
|
-
return `[](./LICENSE)${a === void 0 ? "" : `\n[](./LICENSE)${a === void 0 ? "" : `\n[})](${l}/releases/latest)`}${s === void 0 ? "" : `\n[](https://www.npmjs.com/package/${s})`}
|
|
750
767
|
[](${l}/actions/workflows/ci.yml)${i == null || i === "" ? "" : `\n\n${i}`}
|
|
751
768
|
|
|
752
769
|
[Report a Vulnerability](${l}/security/advisories/new) · [Open an Issue](${l}/issues)
|
|
@@ -765,31 +782,31 @@ In addition, DPUse provides [Tools](https://www.dpuse.app) used by the applicati
|
|
|
765
782
|
}
|
|
766
783
|
//#endregion
|
|
767
784
|
//#region src/actions/documentQualitySecurity.ts
|
|
768
|
-
var
|
|
785
|
+
var Jt = {
|
|
769
786
|
"Branch-Protection": 3,
|
|
770
787
|
"Code-Review": 0,
|
|
771
788
|
Contributors: 0
|
|
772
|
-
},
|
|
789
|
+
}, Yt = /* @__PURE__ */ new Set(["CII-Best-Practices"]), Xt = "coverage/coverage-final.json", Zt = "coverage/coverage-summary.json", Qt = 80, $t = 60, en = "code-health-reports/vitest/badge.json", tn = {
|
|
773
790
|
actions: "GitHub Actions",
|
|
774
791
|
"javascript-typescript": "JavaScript/TypeScript",
|
|
775
792
|
rust: "Rust"
|
|
776
|
-
},
|
|
793
|
+
}, nn = {
|
|
777
794
|
A: "brightgreen",
|
|
778
795
|
B: "green",
|
|
779
796
|
C: "yellow",
|
|
780
797
|
D: "orange",
|
|
781
798
|
F: "red"
|
|
782
|
-
},
|
|
783
|
-
async function
|
|
799
|
+
}, rn = `${u}/health.json`, an = le(ue);
|
|
800
|
+
async function on() {
|
|
784
801
|
try {
|
|
785
802
|
l("Document Quality & Security");
|
|
786
|
-
let t = await C("package.json"), n = await
|
|
803
|
+
let t = await C("package.json"), n = await sn(t), r = await ln(t, n === void 0 ? [] : ["--coverage", Xt]), { owner: i, repository: a } = S(t, "document quality and security");
|
|
787
804
|
w("4️⃣ Read security checks and settings");
|
|
788
|
-
let o = await
|
|
805
|
+
let o = await dn(i, a, t);
|
|
789
806
|
w("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
|
|
790
|
-
let [s, c] = await Promise.all([
|
|
807
|
+
let [s, c] = await Promise.all([fn(`https://github.com/${i}/${a}`), pn(`github.com/${i}/${a}`)]);
|
|
791
808
|
w("6️⃣ Insert quality and security content into 'README.md'");
|
|
792
|
-
let u =
|
|
809
|
+
let u = vn(i, a, {
|
|
793
810
|
coveragePercent: n,
|
|
794
811
|
fallowHealth: r,
|
|
795
812
|
securitySettings: o
|
|
@@ -799,7 +816,7 @@ async function an() {
|
|
|
799
816
|
console.error("❌ Error documenting quality and security", e), process.exit(1);
|
|
800
817
|
}
|
|
801
818
|
}
|
|
802
|
-
async function
|
|
819
|
+
async function sn(e) {
|
|
803
820
|
if (e.devDependencies?.["@vitest/coverage-v8"] == null) {
|
|
804
821
|
w("1️⃣ Test coverage NOT measured, as '@vitest/coverage-v8' is not installed");
|
|
805
822
|
return;
|
|
@@ -809,25 +826,25 @@ async function on(e) {
|
|
|
809
826
|
"--passWithNoTests",
|
|
810
827
|
"--coverage"
|
|
811
828
|
]);
|
|
812
|
-
let n = await t(
|
|
829
|
+
let n = await t(Zt);
|
|
813
830
|
if (n === null) return;
|
|
814
831
|
let i = JSON.parse(n).total.lines.pct;
|
|
815
|
-
if (i !== "Unknown") return await
|
|
832
|
+
if (i !== "Unknown") return await cn(i), i;
|
|
816
833
|
}
|
|
817
|
-
async function
|
|
834
|
+
async function cn(e) {
|
|
818
835
|
let t = [
|
|
819
836
|
"red",
|
|
820
837
|
"yellow",
|
|
821
838
|
"brightgreen"
|
|
822
|
-
], n = Number(e >=
|
|
823
|
-
await v(
|
|
839
|
+
], n = Number(e >= $t) + Number(e >= Qt);
|
|
840
|
+
await v(en, {
|
|
824
841
|
schemaVersion: 1,
|
|
825
842
|
label: "coverage",
|
|
826
843
|
message: `${e.toFixed(1)}%`,
|
|
827
844
|
color: t[n]
|
|
828
845
|
});
|
|
829
846
|
}
|
|
830
|
-
async function
|
|
847
|
+
async function ln(e, t) {
|
|
831
848
|
if (e.devDependencies?.fallow == null) {
|
|
832
849
|
w("2️⃣ Code health NOT measured, as Fallow is not installed"), w("3️⃣ Code health report NOT required");
|
|
833
850
|
return;
|
|
@@ -838,32 +855,32 @@ async function cn(e, t) {
|
|
|
838
855
|
"--format",
|
|
839
856
|
"json",
|
|
840
857
|
...t
|
|
841
|
-
],
|
|
842
|
-
let n = await C(
|
|
843
|
-
return await
|
|
858
|
+
], rn), await o("3️⃣ Write code health report", "fallow", ["--format", "markdown"], ne, !0);
|
|
859
|
+
let n = await C(rn);
|
|
860
|
+
return await un(n), n;
|
|
844
861
|
}
|
|
845
|
-
async function
|
|
862
|
+
async function un(e) {
|
|
846
863
|
let { score: t, grade: n } = e.health_score;
|
|
847
864
|
await v(_, {
|
|
848
865
|
schemaVersion: 1,
|
|
849
866
|
label: "fallow",
|
|
850
867
|
message: `${n} (${String(Math.round(t))})`,
|
|
851
|
-
color:
|
|
868
|
+
color: nn[n] ?? "lightgrey"
|
|
852
869
|
});
|
|
853
870
|
}
|
|
854
|
-
async function
|
|
871
|
+
async function dn(e, n, r) {
|
|
855
872
|
let [i, a, o] = await Promise.all([
|
|
856
873
|
t(".github/workflows/ci.yml"),
|
|
857
874
|
t(".github/dependabot.yml"),
|
|
858
875
|
t(y)
|
|
859
876
|
]), s = await t(".github/workflows/codeql.yml") ?? "", [c, l, u, d] = await Promise.all([
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
877
|
+
z(`repos/${e}/${n}`),
|
|
878
|
+
z(`repos/${e}/${n}/private-vulnerability-reporting`),
|
|
879
|
+
z(`repos/${e}/${n}/vulnerability-alerts`),
|
|
880
|
+
z(`repos/${e}/${n}/commits/main/check-runs?per_page=100`)
|
|
864
881
|
]), f = c === void 0 ? void 0 : JSON.parse(c).security_and_analysis, p = (e) => f?.[e] === void 0 ? void 0 : f[e].status === "enabled", m = new Set((d === void 0 ? [] : JSON.parse(d).check_runs).map((e) => e.app?.slug)), h = a?.match(/package-ecosystem:/g)?.length ?? 0, g = a?.match(/open-pull-requests-limit: 0\b/g)?.length ?? 0;
|
|
865
882
|
return {
|
|
866
|
-
codeQLLanguages: s.matchAll(/- language: ([\w-]+)/g).filter(([, e]) => e !== "rust" || o !== null).map(([, e = ""]) =>
|
|
883
|
+
codeQLLanguages: s.matchAll(/- language: ([\w-]+)/g).filter(([, e]) => e !== "rust" || o !== null).map(([, e = ""]) => tn[e] ?? e).toArray(),
|
|
867
884
|
codeQLQueries: /queries: ([\w-]+)/.exec(s)?.[1],
|
|
868
885
|
dependabotAlerts: u !== void 0,
|
|
869
886
|
dependabotSecurityUpdates: p("dependabot_security_updates"),
|
|
@@ -880,37 +897,37 @@ async function un(e, n, r) {
|
|
|
880
897
|
testsInCI: i?.includes("npm test") ?? !1
|
|
881
898
|
};
|
|
882
899
|
}
|
|
883
|
-
async function
|
|
900
|
+
async function z(e) {
|
|
884
901
|
try {
|
|
885
|
-
let { stdout: t } = await
|
|
902
|
+
let { stdout: t } = await an("gh", ["api", e]);
|
|
886
903
|
return t;
|
|
887
904
|
} catch (e) {
|
|
888
905
|
if (String(e.stderr).includes("HTTP 404")) return;
|
|
889
906
|
throw e;
|
|
890
907
|
}
|
|
891
908
|
}
|
|
892
|
-
async function
|
|
909
|
+
async function fn(e) {
|
|
893
910
|
let t = await fetch(`https://www.bestpractices.dev/projects.json?url=${encodeURIComponent(e)}`);
|
|
894
911
|
if (!t.ok) throw Error(`OpenSSF Best Practices lookup failed with status ${String(t.status)}.`);
|
|
895
912
|
return (await t.json()).find((t) => t.repo_url === e)?.id;
|
|
896
913
|
}
|
|
897
|
-
async function
|
|
914
|
+
async function pn(e) {
|
|
898
915
|
let t = await fetch(`https://api.scorecard.dev/projects/${e}`);
|
|
899
916
|
if (t.status !== 404) {
|
|
900
917
|
if (!t.ok) throw Error(`OpenSSF Scorecard lookup failed with status ${String(t.status)}.`);
|
|
901
918
|
return await t.json();
|
|
902
919
|
}
|
|
903
920
|
}
|
|
904
|
-
function pn(e) {
|
|
905
|
-
return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Jt.has(e) || qt[e] !== void 0 && t >= qt[e]);
|
|
906
|
-
}
|
|
907
921
|
function mn(e) {
|
|
922
|
+
return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Yt.has(e) || Jt[e] !== void 0 && t >= Jt[e]);
|
|
923
|
+
}
|
|
924
|
+
function hn(e) {
|
|
908
925
|
return e === !1 ? " These are handled manually." : "";
|
|
909
926
|
}
|
|
910
|
-
function
|
|
927
|
+
function B(e) {
|
|
911
928
|
return e === void 0 ? "❔ Unknown" : e ? "✅ On" : "❌ Off";
|
|
912
929
|
}
|
|
913
|
-
function
|
|
930
|
+
function V(e, t) {
|
|
914
931
|
return t.length === 0 ? "" : `### ${e}
|
|
915
932
|
|
|
916
933
|
|Check|Status|What it does|
|
|
@@ -919,90 +936,90 @@ ${t.map((e) => `|${e.join("|")}|`).join("\n")}
|
|
|
919
936
|
|
|
920
937
|
`;
|
|
921
938
|
}
|
|
922
|
-
function
|
|
939
|
+
function gn(e, t, n, r) {
|
|
923
940
|
return `})`;
|
|
924
941
|
}
|
|
925
|
-
function
|
|
942
|
+
function _n(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
|
|
926
943
|
let a = `https://github.com/${e}/${t}`, o = (e) => e ? ` Part of the [CI workflow](${a}/actions/workflows/ci.yml) on every push and pull request to \`main\`.` : "", s = [[
|
|
927
944
|
"Unit tests",
|
|
928
|
-
|
|
945
|
+
B(i.testsInCI),
|
|
929
946
|
`[Vitest](https://vitest.dev) runs the unit tests.${o(i.testsInCI)}`
|
|
930
947
|
], [
|
|
931
948
|
"Property-based tests",
|
|
932
|
-
|
|
949
|
+
B(i.propertyTests),
|
|
933
950
|
`[fast-check](https://fast-check.dev) runs many random inputs per test to find edge cases, alongside the unit tests.${o(i.propertyTests && i.testsInCI)}`
|
|
934
951
|
]];
|
|
935
952
|
n !== void 0 && s.push([
|
|
936
953
|
"Test coverage",
|
|
937
|
-
|
|
938
|
-
`${
|
|
954
|
+
B(!0),
|
|
955
|
+
`${gn(e, t, "Coverage", en)} [Vitest's V8 coverage](https://vitest.dev/guide/coverage) measures the share of source lines the unit tests run. The target is ${String(Qt)}%.`
|
|
939
956
|
]);
|
|
940
957
|
let c = `[](https://sonarcloud.io/summary/new_code?id=${e}_${t}) `, l = [[
|
|
941
958
|
"Code analysis",
|
|
942
|
-
|
|
959
|
+
B(i.sonarCloud),
|
|
943
960
|
`${i.sonarCloud ? c : ""}[SonarCloud](https://sonarcloud.io) checks every push for bugs, code smells and vulnerabilities.`
|
|
944
961
|
], [
|
|
945
962
|
"Linting",
|
|
946
|
-
|
|
963
|
+
B(i.lintInCI),
|
|
947
964
|
`[ESLint](https://eslint.org) checks the code for errors and style problems.${o(i.lintInCI)}`
|
|
948
965
|
]];
|
|
949
966
|
r !== void 0 && l.unshift([
|
|
950
967
|
"Code health",
|
|
951
|
-
|
|
952
|
-
`[${
|
|
968
|
+
B(!0),
|
|
969
|
+
`[${gn(e, t, "Fallow code health", _)}](./${ne}) [Fallow](https://github.com/fallow-rs/fallow) finds unused code, duplication, complexity and dependency problems.`
|
|
953
970
|
]);
|
|
954
971
|
let u = i.codeQLLanguages.length > 0, d = `[](${a}/security/code-scanning) `, f = i.codeQLQueries === "security-extended" ? "using the extended security queries" : "using the default queries", p = u ? ` ${i.codeQLLanguages.join(" and ")}` : "", m = [
|
|
955
972
|
[
|
|
956
973
|
"Push protection",
|
|
957
|
-
|
|
974
|
+
B(i.pushProtection),
|
|
958
975
|
"[GitHub push protection](https://docs.github.com/en/code-security/secret-scanning/push-protection-for-repositories-and-organizations) blocks pushes that contain credentials."
|
|
959
976
|
],
|
|
960
977
|
[
|
|
961
978
|
"Static analysis",
|
|
962
|
-
|
|
979
|
+
B(u),
|
|
963
980
|
`${u ? d : ""}[CodeQL](https://codeql.github.com) scans${p} for security vulnerabilities, ${f}, on every push and pull request to \`main\` and weekly.`
|
|
964
981
|
],
|
|
965
982
|
[
|
|
966
983
|
"Secret scanning",
|
|
967
|
-
|
|
984
|
+
B(i.secretScanning),
|
|
968
985
|
"[GitHub secret scanning](https://docs.github.com/en/code-security/secret-scanning) detects credentials, such as API keys and tokens, committed to the repository."
|
|
969
986
|
]
|
|
970
987
|
], h = "[Dependabot](https://docs.github.com/en/code-security/dependabot)", g = [
|
|
971
988
|
[
|
|
972
989
|
"Vulnerability audit",
|
|
973
|
-
|
|
990
|
+
B(i.npmAuditInCI),
|
|
974
991
|
i.npmAuditLevel === void 0 ? `[npm audit](https://docs.npmjs.com/cli/commands/npm-audit) fails when a shipped dependency has any known vulnerability, or a development dependency has a high or critical one.${o(i.npmAuditInCI)}` : `[npm audit](https://docs.npmjs.com/cli/commands/npm-audit) fails when a dependency has a known vulnerability of ${i.npmAuditLevel} severity or above.${o(i.npmAuditInCI)}`
|
|
975
992
|
],
|
|
976
993
|
[
|
|
977
994
|
"Supply chain risk",
|
|
978
|
-
|
|
995
|
+
B(i.socket),
|
|
979
996
|
"[Socket](https://socket.dev) flags malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE."
|
|
980
997
|
],
|
|
981
998
|
[
|
|
982
999
|
"Security alerts",
|
|
983
|
-
|
|
1000
|
+
B(i.dependabotAlerts),
|
|
984
1001
|
`${h} alerts when a dependency has a known vulnerability, using the GitHub Advisory Database.`
|
|
985
1002
|
],
|
|
986
1003
|
[
|
|
987
1004
|
"Security updates",
|
|
988
|
-
|
|
989
|
-
`${h} opens pull requests that update vulnerable dependencies.${
|
|
1005
|
+
B(i.dependabotSecurityUpdates),
|
|
1006
|
+
`${h} opens pull requests that update vulnerable dependencies.${hn(i.dependabotSecurityUpdates)}`
|
|
990
1007
|
],
|
|
991
1008
|
[
|
|
992
1009
|
"Version updates",
|
|
993
|
-
|
|
994
|
-
`${h} opens pull requests for new dependency versions.${
|
|
1010
|
+
B(i.dependabotVersionUpdates),
|
|
1011
|
+
`${h} opens pull requests for new dependency versions.${hn(i.dependabotVersionUpdates)}`
|
|
995
1012
|
]
|
|
996
1013
|
];
|
|
997
1014
|
return `This section is updated each time \`npm run document\` is run. Settings come from the repository's workflow files and GitHub. Test coverage and the Fallow score are measured at the same time.
|
|
998
1015
|
|
|
999
|
-
${
|
|
1016
|
+
${V("Testing", s)}${V("Code Quality", l)}${V("Security Analysis", m)}${V("Dependencies", g)}`;
|
|
1000
1017
|
}
|
|
1001
|
-
function
|
|
1002
|
-
let a = `https://github.com/${e}/${t}`, o = `github.com/${e}/${t}`, s = `https://www.bestpractices.dev/projects/${String(r)}`, c = i !== void 0 &&
|
|
1018
|
+
function vn(e, t, n, r, i) {
|
|
1019
|
+
let a = `https://github.com/${e}/${t}`, o = `github.com/${e}/${t}`, s = `https://www.bestpractices.dev/projects/${String(r)}`, c = i !== void 0 && mn(i) ? "\n\n> [!NOTE]\n> Apart from the Best Practices badge above, the remaining Scorecard gaps need multi-person review or a pull-request workflow, which this solo-maintained project doesn't use." : "", l = r === void 0 ? "" : `[](${s})\n`, u = n.securitySettings.privateVulnerabilityReporting === !0 ? `Use [GitHub private vulnerability reporting](${a}/security/advisories/new) instead. See [SECURITY.md](./SECURITY.md) for the full disclosure policy, contact details, and expected response times.` : "See [SECURITY.md](./SECURITY.md) for how to report one privately, the full disclosure policy, and expected response times.";
|
|
1003
1020
|
return `## Quality & Security
|
|
1004
1021
|
|
|
1005
|
-
${
|
|
1022
|
+
${_n(e, t, n)}### OpenSSF 🚧
|
|
1006
1023
|
|
|
1007
1024
|
${l}[](https://scorecard.dev/viewer/?uri=${o})
|
|
1008
1025
|
|
|
@@ -1014,37 +1031,37 @@ Please do not open public GitHub issues for security vulnerabilities. ${u}`;
|
|
|
1014
1031
|
}
|
|
1015
1032
|
//#endregion
|
|
1016
1033
|
//#region src/actions/documentUsage.ts
|
|
1017
|
-
var
|
|
1034
|
+
var yn = "<!-- USAGE_START -->", bn = "<!-- USAGE_END -->", xn = /* @__PURE__ */ new Set([
|
|
1018
1035
|
"connector",
|
|
1019
1036
|
"cookbook",
|
|
1020
1037
|
"presenter"
|
|
1021
|
-
]),
|
|
1022
|
-
async function
|
|
1038
|
+
]), Sn = /* @__PURE__ */ new Set(["development", "eslint"]), Cn = "> [!WARNING]\n> This project is not designed for general use. It is custom built for the DPUse CI/CD process. You are welcome to clone and customise it for your own purposes, but you will need to adapt it to your own project structure and tooling.", wn = "This repository manages itself using the actions it implements.", Tn = "This repository is managed using the common set of actions provided by [@dpuse/dpuse-development](https://github.com/dpuse/dpuse-development).";
|
|
1039
|
+
async function En() {
|
|
1023
1040
|
try {
|
|
1024
1041
|
l("Document Usage"), w("1️⃣ Insert usage content into 'README.md'");
|
|
1025
|
-
let [t, n] = await Promise.all([C("package.json"), C("config.json")]), r =
|
|
1026
|
-
await e(d,
|
|
1042
|
+
let [t, n] = await Promise.all([C("package.json"), C("config.json")]), r = Dn(t), i = On(r), a = H(t.engines?.node), o = H(t.engines?.npm), s = H(t.devDependencies?.typescript), c = kn(g(n.id), t.name), u = `${r.replace(/\.git$/, "")}/blob/main/package.json`, d = An(c, r, i, a, o, s, `${t.name === "@dpuse/dpuse-development" ? wn : Tn} See the \`scripts\` block in [package.json](${u}) for details.`);
|
|
1043
|
+
await e(d, yn, bn), x("Usage documented");
|
|
1027
1044
|
} catch (e) {
|
|
1028
1045
|
console.error("❌ Error documenting usage", e), process.exit(1);
|
|
1029
1046
|
}
|
|
1030
1047
|
}
|
|
1031
|
-
function
|
|
1048
|
+
function Dn(e) {
|
|
1032
1049
|
let t = e.repository, n = typeof t == "string" ? t : t?.url;
|
|
1033
1050
|
if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
|
|
1034
1051
|
return n.replace(/^git\+/, "");
|
|
1035
1052
|
}
|
|
1036
|
-
function
|
|
1053
|
+
function On(e) {
|
|
1037
1054
|
return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
|
|
1038
1055
|
}
|
|
1039
|
-
function
|
|
1056
|
+
function H(e) {
|
|
1040
1057
|
if (e == null) throw Error("package.json version range is required to document usage.");
|
|
1041
1058
|
let t = /\d+(?:\.\d+)*/.exec(e);
|
|
1042
1059
|
if (t == null) throw Error(`Unable to parse version from '${e}'.`);
|
|
1043
1060
|
return t[0];
|
|
1044
1061
|
}
|
|
1045
|
-
function
|
|
1062
|
+
function kn(e, t) {
|
|
1046
1063
|
let { typeId: n } = e;
|
|
1047
|
-
if (
|
|
1064
|
+
if (xn.has(n)) return `This ${n} is automatically uploaded to the DPUse Engine cloud once released and becomes instantly available to all new browser app instances, with existing instances notified of the update.
|
|
1048
1065
|
|
|
1049
1066
|
You may view or clone this repository for your own purposes, such as building a new, similar ${n}, though there is currently no process to accept third-party ${n}s into DPUse at this stage.`;
|
|
1050
1067
|
if (e.publishedTo === "npm") {
|
|
@@ -1055,11 +1072,11 @@ You may view or clone this repository for your own purposes, such as building a
|
|
|
1055
1072
|
npm install ${t}
|
|
1056
1073
|
\`\`\`
|
|
1057
1074
|
|
|
1058
|
-
${
|
|
1075
|
+
${Sn.has(n) ? `${Cn}\n\n` : ""}To work on the source instead, clone this repository.`;
|
|
1059
1076
|
}
|
|
1060
1077
|
return "You may view or clone this repository for your own purposes.";
|
|
1061
1078
|
}
|
|
1062
|
-
function
|
|
1079
|
+
function An(e, t, n, r, i, a, o) {
|
|
1063
1080
|
return `## Usage
|
|
1064
1081
|
|
|
1065
1082
|
${e}
|
|
@@ -1076,62 +1093,62 @@ ${o}`;
|
|
|
1076
1093
|
}
|
|
1077
1094
|
//#endregion
|
|
1078
1095
|
//#region src/actions/documentApiReference.ts
|
|
1079
|
-
var
|
|
1080
|
-
async function
|
|
1096
|
+
var U = "API_REFERENCE.md";
|
|
1097
|
+
async function jn() {
|
|
1081
1098
|
try {
|
|
1082
1099
|
l("Document API Reference");
|
|
1083
1100
|
let { writeAPIReference: e } = await import("./apiReference-CdMhhAl1.js");
|
|
1084
|
-
await e("1️⃣ ",
|
|
1101
|
+
await e("1️⃣ ", U), x("API reference documented");
|
|
1085
1102
|
} catch (e) {
|
|
1086
1103
|
console.error("❌ Error documenting API reference", e), process.exit(1);
|
|
1087
1104
|
}
|
|
1088
1105
|
}
|
|
1089
1106
|
//#endregion
|
|
1090
1107
|
//#region src/actions/documentBundleSizes.ts
|
|
1091
|
-
var
|
|
1092
|
-
async function
|
|
1108
|
+
var Mn = "bundle-analysis-reports/sonda/index.json", Nn = "bundle-analysis-reports/sonda/worker.json", Pn = "<!-- BUNDLE_START -->", Fn = "<!-- BUNDLE_END -->", W = " ", G = 20, In = "█", Ln = "▒", Rn = 100 / G / 2, zn = 100 / G, Bn = 48, Vn = "This report is updated with each release, from the bundle the release builds, using [Sonda](https://sonda.dev/), which analyses final source maps to reveal the actual effects of tree-shaking and minification rather than relying on pre-build estimates.\n\n_Note: Sonda's Vite reports currently exclude CSS files, since Vite does not generate source maps for CSS._", Hn = "Bars show each row's share of its output file.", Un = "↳ rows are part of the row above.", Wn = "+ n more = the row also holds n more files from the same package or folder, each no larger than the one named. A package can appear under several output files, each holding different files, never the same file twice.", K = "(bundler output, whitespace & JSON)", q = "(inlined worker)", Gn = `${q} = a Web Worker built separately and embedded in its output file as text. Where the build records what it contains, its rows list that; any few bytes over are the escaping needed to embed it.`, J = "(Rust WebAssembly as base64", Kn = `${J}…) = the compiled Rust code, embedded as base64 text, about a third larger than the binary it decodes to, which is the size given.`, qn = `${K} = bytes Sonda can't trace to a source file: whitespace (indentation and line breaks), code the bundler generates (region comments, the combined import/export lines, its small runtime helper and wrappers), and imported JSON such as \`config.json\`, which the bundler doesn't map. The JSON and the generated code are real bytes that ship; the whitespace mostly disappears once compressed.`;
|
|
1109
|
+
async function Jn(n) {
|
|
1093
1110
|
try {
|
|
1094
1111
|
l("Document Bundle Sizes"), w("1️⃣ Read bundle analysis report");
|
|
1095
|
-
let r = await C(
|
|
1112
|
+
let r = await C(Mn), i = await t(Nn), a = i === null ? void 0 : JSON.parse(i), o = /* @__PURE__ */ new Map();
|
|
1096
1113
|
for (let e of r.resources) e.kind === "asset" && o.set(e.name, await t(e.name));
|
|
1097
1114
|
w("2️⃣ Insert table into 'README.md'");
|
|
1098
|
-
let s =
|
|
1115
|
+
let s = Yn(r, {
|
|
1099
1116
|
assetContents: o,
|
|
1100
1117
|
isModuleLevel: n?.moduleLevel ?? !1,
|
|
1101
1118
|
workerJson: a
|
|
1102
1119
|
}), c = [
|
|
1103
|
-
s.includes("↳") ? `${
|
|
1104
|
-
/ \+ \d+ more \|/.test(s) ?
|
|
1105
|
-
s.includes(K) ? Wn : "",
|
|
1120
|
+
s.includes("↳") ? `${Hn} ${Un}` : Hn,
|
|
1121
|
+
/ \+ \d+ more \|/.test(s) ? Wn : "",
|
|
1106
1122
|
s.includes(q) ? Gn : "",
|
|
1107
|
-
Kn
|
|
1123
|
+
s.includes(J) ? Kn : "",
|
|
1124
|
+
qn
|
|
1108
1125
|
].filter((e) => e !== "");
|
|
1109
|
-
await e(`## Bundle Analysis\n\n${
|
|
1126
|
+
await e(`## Bundle Analysis\n\n${Vn}\n\n${s}\n\n${c.join("\n\n")}`, Pn, Fn), x("Bundle sizes documented");
|
|
1110
1127
|
} catch (e) {
|
|
1111
1128
|
console.error("❌ Error documenting bundle sizes", e), process.exit(1);
|
|
1112
1129
|
}
|
|
1113
1130
|
}
|
|
1114
|
-
function
|
|
1115
|
-
let { assetContents: n, isModuleLevel: r, workerJson: i } = t, a =
|
|
1131
|
+
function Yn(e, t) {
|
|
1132
|
+
let { assetContents: n, isModuleLevel: r, workerJson: i } = t, a = ur(e), o = i === void 0 ? void 0 : ur(i).values().next().value;
|
|
1116
1133
|
for (let [e, t] of a) {
|
|
1117
1134
|
let r = n.get(e);
|
|
1118
|
-
r != null &&
|
|
1135
|
+
r != null && Xn(t, r, o);
|
|
1119
1136
|
}
|
|
1120
|
-
let s = a.values().flatMap((e) => e.values().toArray()).reduce((e, t) => e + t.sizes.uncompressed, 0), c = e.resources.filter((e) => e.kind === "asset").map((e) => [e.name,
|
|
1137
|
+
let s = a.values().flatMap((e) => e.values().toArray()).reduce((e, t) => e + t.sizes.uncompressed, 0), c = e.resources.filter((e) => e.kind === "asset").map((e) => [e.name, hr(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), l = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
|
|
1121
1138
|
for (let [e, t] of c) {
|
|
1122
|
-
let n = [...a.get(e) ?? /* @__PURE__ */ new Map()].toSorted(
|
|
1123
|
-
l.push(
|
|
1139
|
+
let n = [...a.get(e) ?? /* @__PURE__ */ new Map()].toSorted(ir), i = n.reduce((e, [, t]) => e + t.sizes.uncompressed, 0), o = i > 0 && s > 0 ? ` · ${br(i, s)} of the build` : "";
|
|
1140
|
+
l.push(Q(`**${Z(e)}**`, `${gr(t)}${o}`), ...ar(n, i, r));
|
|
1124
1141
|
}
|
|
1125
1142
|
return l.join("\n");
|
|
1126
1143
|
}
|
|
1127
|
-
function
|
|
1128
|
-
let r =
|
|
1129
|
-
|
|
1144
|
+
function Xn(e, t, n) {
|
|
1145
|
+
let r = Zn(t), i = Qn(r ?? ""), a = Qn(t);
|
|
1146
|
+
er(e, {
|
|
1130
1147
|
bytes: a.bytes - i.bytes,
|
|
1131
1148
|
binaryBytes: a.binaryBytes - i.binaryBytes
|
|
1132
|
-
}), r !== void 0 &&
|
|
1149
|
+
}), r !== void 0 && tr(e, Buffer.byteLength(r), i, n);
|
|
1133
1150
|
}
|
|
1134
|
-
function
|
|
1151
|
+
function Zn(e) {
|
|
1135
1152
|
if (!e.includes("new Worker(")) return;
|
|
1136
1153
|
let t = /encodeURIComponent\((\w+)\)/.exec(e)?.[1];
|
|
1137
1154
|
if (t === void 0) return;
|
|
@@ -1141,30 +1158,30 @@ function Xn(e) {
|
|
|
1141
1158
|
for (; a < e.length && e[a] !== r;) a += e[a] === "\\" ? 2 : 1;
|
|
1142
1159
|
return e.slice(i, a);
|
|
1143
1160
|
}
|
|
1144
|
-
function
|
|
1161
|
+
function Qn(e) {
|
|
1145
1162
|
let t = {
|
|
1146
1163
|
bytes: 0,
|
|
1147
1164
|
binaryBytes: 0
|
|
1148
1165
|
};
|
|
1149
1166
|
for (let n of e.matchAll(/data:application\/wasm;base64,([A-Za-z\d+/]*={0,2})/g)) {
|
|
1150
1167
|
let e = n[1] ?? "";
|
|
1151
|
-
t.bytes += n[0].length, t.binaryBytes += Math.floor(e.length * 3 / 4) -
|
|
1168
|
+
t.bytes += n[0].length, t.binaryBytes += Math.floor(e.length * 3 / 4) - $n(e);
|
|
1152
1169
|
}
|
|
1153
1170
|
return t;
|
|
1154
1171
|
}
|
|
1155
|
-
function
|
|
1172
|
+
function $n(e) {
|
|
1156
1173
|
return e.endsWith("==") ? 2 : +!!e.endsWith("=");
|
|
1157
1174
|
}
|
|
1158
|
-
function
|
|
1175
|
+
function er(e, t) {
|
|
1159
1176
|
if (t.bytes <= 0) return;
|
|
1160
|
-
let n = [e.get("wasm"), e.get(
|
|
1177
|
+
let n = [e.get("wasm"), e.get(K)].flatMap((e) => e === void 0 ? [] : e.files.entries().map(([t, n]) => ({
|
|
1161
1178
|
group: e,
|
|
1162
1179
|
fileName: t,
|
|
1163
1180
|
sizes: n
|
|
1164
1181
|
})).toArray()).find(({ sizes: e }) => e.uncompressed >= t.bytes);
|
|
1165
1182
|
if (n === void 0) return;
|
|
1166
|
-
|
|
1167
|
-
let r = `${
|
|
1183
|
+
rr(e, n.group, n.fileName, n.sizes, t.bytes);
|
|
1184
|
+
let r = `${J}, ${$(t.binaryBytes)} binary)`;
|
|
1168
1185
|
e.set(r, {
|
|
1169
1186
|
sizes: {
|
|
1170
1187
|
uncompressed: t.bytes,
|
|
@@ -1176,15 +1193,15 @@ function $n(e, t) {
|
|
|
1176
1193
|
}]])
|
|
1177
1194
|
});
|
|
1178
1195
|
}
|
|
1179
|
-
function
|
|
1180
|
-
let i = e.get(
|
|
1196
|
+
function tr(e, t, n, r) {
|
|
1197
|
+
let i = e.get(K), a = i?.files.get("");
|
|
1181
1198
|
if (i === void 0 || a === void 0 || a.uncompressed < t) return;
|
|
1182
|
-
|
|
1199
|
+
rr(e, i, "", a, t);
|
|
1183
1200
|
let o = r === void 0 ? /* @__PURE__ */ new Map([["", {
|
|
1184
1201
|
uncompressed: t,
|
|
1185
1202
|
gzip: 0
|
|
1186
|
-
}]]) :
|
|
1187
|
-
e.set(
|
|
1203
|
+
}]]) : nr(r, t, n);
|
|
1204
|
+
e.set(q, {
|
|
1188
1205
|
sizes: {
|
|
1189
1206
|
uncompressed: t,
|
|
1190
1207
|
gzip: 0
|
|
@@ -1192,92 +1209,92 @@ function er(e, t, n, r) {
|
|
|
1192
1209
|
files: o
|
|
1193
1210
|
});
|
|
1194
1211
|
}
|
|
1195
|
-
function
|
|
1196
|
-
|
|
1212
|
+
function nr(e, t, n) {
|
|
1213
|
+
er(e, n);
|
|
1197
1214
|
let r = /* @__PURE__ */ new Map();
|
|
1198
1215
|
for (let [t, n] of e) if (t === "src") for (let [e, t] of n.files) r.set(e, { ...t });
|
|
1199
1216
|
else {
|
|
1200
|
-
let e = n.files.size === 1 ?
|
|
1217
|
+
let e = n.files.size === 1 ? X(t, lr(n.files)) : t;
|
|
1201
1218
|
r.set(e, { ...n.sizes });
|
|
1202
1219
|
}
|
|
1203
|
-
let i = r.values().reduce((e, t) => e + t.uncompressed, 0), a = r.get(
|
|
1204
|
-
return a.uncompressed += Math.max(0, t - i), a.uncompressed > 0 && r.set(
|
|
1220
|
+
let i = r.values().reduce((e, t) => e + t.uncompressed, 0), a = r.get(K) ?? vr();
|
|
1221
|
+
return a.uncompressed += Math.max(0, t - i), a.uncompressed > 0 && r.set(K, a), r;
|
|
1205
1222
|
}
|
|
1206
|
-
function
|
|
1223
|
+
function rr(e, t, n, r, i) {
|
|
1207
1224
|
if (r.uncompressed -= i, t.sizes.uncompressed -= i, r.uncompressed <= 0 && t.files.delete(n), !(t.sizes.uncompressed > 0)) for (let [n, r] of e) r === t && e.delete(n);
|
|
1208
1225
|
}
|
|
1209
|
-
function
|
|
1210
|
-
return e[0] ===
|
|
1226
|
+
function ir(e, t) {
|
|
1227
|
+
return e[0] === K == (t[0] === K) ? t[1].sizes.uncompressed - e[1].sizes.uncompressed : e[0] === K ? 1 : -1;
|
|
1211
1228
|
}
|
|
1212
|
-
function
|
|
1229
|
+
function ar(e, t, n) {
|
|
1213
1230
|
let r = [];
|
|
1214
1231
|
for (let [i, { sizes: a, files: o }] of e) if (o.size === 1) {
|
|
1215
|
-
let e =
|
|
1216
|
-
r.push(
|
|
1217
|
-
} else r.push(
|
|
1232
|
+
let e = lr(o);
|
|
1233
|
+
r.push(Q(`${W}${Z(X(i, e))}`, Y(a.uncompressed, t)));
|
|
1234
|
+
} else r.push(Q(`${W}${cr(i, o)}`, Y(a.uncompressed, t))), n || r.push(...or(o, t));
|
|
1218
1235
|
return r;
|
|
1219
1236
|
}
|
|
1220
|
-
function
|
|
1221
|
-
let n = [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), r =
|
|
1237
|
+
function or(e, t) {
|
|
1238
|
+
let n = [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), r = sr(n, t), i = (r > 0 ? n.slice(0, -r) : n).map(([e, n]) => Q(`${W}${W}↳ ${Z(e)}`, Y(n.uncompressed, t, Ln)));
|
|
1222
1239
|
if (r > 0) {
|
|
1223
1240
|
let e = n.slice(-r).reduce((e, [, t]) => e + t.uncompressed, 0);
|
|
1224
|
-
i.push(
|
|
1241
|
+
i.push(Q(`${W}${W}↳ ${String(r)} smaller files`, Y(e, t, Ln)));
|
|
1225
1242
|
}
|
|
1226
1243
|
return i;
|
|
1227
1244
|
}
|
|
1228
|
-
function
|
|
1245
|
+
function sr(e, t) {
|
|
1229
1246
|
if (t <= 0) return 0;
|
|
1230
1247
|
let n = 0, r = 0;
|
|
1231
1248
|
for (let [, i] of e.toReversed()) {
|
|
1232
|
-
let e = i.uncompressed / t * 100 <
|
|
1249
|
+
let e = i.uncompressed / t * 100 < Rn, a = (r + i.uncompressed) / t * 100 <= zn;
|
|
1233
1250
|
if (!e || !a) break;
|
|
1234
1251
|
n++, r += i.uncompressed;
|
|
1235
1252
|
}
|
|
1236
1253
|
return n >= 2 ? n : 0;
|
|
1237
1254
|
}
|
|
1238
|
-
function
|
|
1239
|
-
return `${
|
|
1255
|
+
function Y(e, t, n = In) {
|
|
1256
|
+
return `${_r(t > 0 ? e / t * 100 : 0, n)} · ${$(e)}`;
|
|
1240
1257
|
}
|
|
1241
|
-
function
|
|
1258
|
+
function X(e, t) {
|
|
1242
1259
|
return t === "" ? e : `${e} → ${t}`;
|
|
1243
1260
|
}
|
|
1244
|
-
function
|
|
1245
|
-
if (e ===
|
|
1261
|
+
function cr(e, t) {
|
|
1262
|
+
if (e === q) return e;
|
|
1246
1263
|
let [n] = [...t].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed)[0] ?? [""];
|
|
1247
|
-
return `${X(
|
|
1264
|
+
return `${Z(X(e, n))} + ${String(t.size - 1)} more`;
|
|
1248
1265
|
}
|
|
1249
|
-
function
|
|
1250
|
-
let t = e.indexOf(" → "), n = t === -1 ? "" : e.slice(0, t + 3), r = e.slice(n.length), i = Math.max(
|
|
1266
|
+
function Z(e) {
|
|
1267
|
+
let t = e.indexOf(" → "), n = t === -1 ? "" : e.slice(0, t + 3), r = e.slice(n.length), i = Math.max(Bn - n.length, 2);
|
|
1251
1268
|
return r.length > i ? `${n}<abbr title="${r.replaceAll("&", "&").replaceAll("\"", """)}">…${r.slice(r.length - (i - 1))}</abbr>` : e;
|
|
1252
1269
|
}
|
|
1253
|
-
function
|
|
1270
|
+
function Q(e, t) {
|
|
1254
1271
|
return `| ${e} | ${t.replaceAll(" ", " ")} |`;
|
|
1255
1272
|
}
|
|
1256
|
-
function
|
|
1273
|
+
function lr(e) {
|
|
1257
1274
|
let [t] = e.keys();
|
|
1258
1275
|
if (t === void 0) throw Error("Expected exactly one file");
|
|
1259
1276
|
return t;
|
|
1260
1277
|
}
|
|
1261
|
-
function
|
|
1262
|
-
let t =
|
|
1278
|
+
function ur(e) {
|
|
1279
|
+
let t = dr(e.dependencies), n = /* @__PURE__ */ new Map();
|
|
1263
1280
|
for (let r of e.resources) {
|
|
1264
1281
|
if (r.kind !== "chunk" || !r.parent) continue;
|
|
1265
|
-
let { group: e, file: i } =
|
|
1282
|
+
let { group: e, file: i } = fr(r.name, t), a = hr(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
|
|
1266
1283
|
n.set(r.parent, o);
|
|
1267
1284
|
let s = o.get(e) ?? {
|
|
1268
|
-
sizes:
|
|
1285
|
+
sizes: vr(),
|
|
1269
1286
|
files: /* @__PURE__ */ new Map()
|
|
1270
1287
|
};
|
|
1271
|
-
o.set(e, s),
|
|
1272
|
-
let c = s.files.get(i) ??
|
|
1273
|
-
s.files.set(i, c),
|
|
1288
|
+
o.set(e, s), yr(s.sizes, a);
|
|
1289
|
+
let c = s.files.get(i) ?? vr();
|
|
1290
|
+
s.files.set(i, c), yr(c, a);
|
|
1274
1291
|
}
|
|
1275
1292
|
return n;
|
|
1276
1293
|
}
|
|
1277
|
-
function
|
|
1294
|
+
function dr(e) {
|
|
1278
1295
|
return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
|
|
1279
1296
|
}
|
|
1280
|
-
function
|
|
1297
|
+
function fr(e, t) {
|
|
1281
1298
|
let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
|
|
1282
1299
|
if (n) {
|
|
1283
1300
|
let [t, r] = n;
|
|
@@ -1287,49 +1304,49 @@ function dr(e, t) {
|
|
|
1287
1304
|
};
|
|
1288
1305
|
}
|
|
1289
1306
|
return e === "[unassigned]" ? {
|
|
1290
|
-
group:
|
|
1307
|
+
group: K,
|
|
1291
1308
|
file: ""
|
|
1292
1309
|
} : e.startsWith("\0") ? {
|
|
1293
1310
|
group: "(runtime)",
|
|
1294
1311
|
file: e.slice(1)
|
|
1295
1312
|
} : e.startsWith("rust/") ? {
|
|
1296
1313
|
group: "wasm",
|
|
1297
|
-
file:
|
|
1314
|
+
file: pr(e)
|
|
1298
1315
|
} : {
|
|
1299
1316
|
group: "src",
|
|
1300
|
-
file:
|
|
1317
|
+
file: mr(e)
|
|
1301
1318
|
};
|
|
1302
1319
|
}
|
|
1303
|
-
function
|
|
1304
|
-
let t = e.split("/", 2)[1] ?? "", n =
|
|
1320
|
+
function pr(e) {
|
|
1321
|
+
let t = e.split("/", 2)[1] ?? "", n = mr(e);
|
|
1305
1322
|
return t !== "" && n.startsWith(t) ? `…${n.slice(t.length)}` : n;
|
|
1306
1323
|
}
|
|
1307
|
-
function
|
|
1324
|
+
function mr(e) {
|
|
1308
1325
|
return e.split("/").at(-1) ?? e;
|
|
1309
1326
|
}
|
|
1310
|
-
function
|
|
1327
|
+
function hr(e) {
|
|
1311
1328
|
return {
|
|
1312
1329
|
uncompressed: e.uncompressed,
|
|
1313
1330
|
gzip: e.gzip ?? 0
|
|
1314
1331
|
};
|
|
1315
1332
|
}
|
|
1316
|
-
function
|
|
1333
|
+
function gr(e) {
|
|
1317
1334
|
return `${$(e.uncompressed)} · gzip ${$(e.gzip)}`;
|
|
1318
1335
|
}
|
|
1319
|
-
function
|
|
1320
|
-
let n = Math.round(e / 100 *
|
|
1321
|
-
return `\`${t.repeat(n)}${"░".repeat(
|
|
1336
|
+
function _r(e, t = In) {
|
|
1337
|
+
let n = Math.round(e / 100 * G);
|
|
1338
|
+
return `\`${t.repeat(n)}${"░".repeat(G - n)}\` ${e.toFixed(1)}%`;
|
|
1322
1339
|
}
|
|
1323
|
-
function
|
|
1340
|
+
function vr() {
|
|
1324
1341
|
return {
|
|
1325
1342
|
uncompressed: 0,
|
|
1326
1343
|
gzip: 0
|
|
1327
1344
|
};
|
|
1328
1345
|
}
|
|
1329
|
-
function
|
|
1346
|
+
function yr(e, t) {
|
|
1330
1347
|
e.uncompressed += t.uncompressed, e.gzip += t.gzip;
|
|
1331
1348
|
}
|
|
1332
|
-
function
|
|
1349
|
+
function br(e, t) {
|
|
1333
1350
|
return `${(e / t * 100).toFixed(1)}%`;
|
|
1334
1351
|
}
|
|
1335
1352
|
function $(e) {
|
|
@@ -1337,15 +1354,15 @@ function $(e) {
|
|
|
1337
1354
|
}
|
|
1338
1355
|
//#endregion
|
|
1339
1356
|
//#region src/actions/documentProject.ts
|
|
1340
|
-
async function
|
|
1357
|
+
async function xr(e = "MIT", n = !1) {
|
|
1341
1358
|
try {
|
|
1342
1359
|
let i = await C("config.json"), a = g(i.id).typeId === "connector";
|
|
1343
|
-
await
|
|
1344
|
-
let o = await t(
|
|
1345
|
-
o ? await
|
|
1360
|
+
await Ht(), a && await qe(), await En(), await mt(e), await t("bundle-analysis-reports/sonda/index.json") === null ? w(`ℹ️ Bundle sizes NOT documented, as there is no '${Mn}' yet. Build the project first.`) : await Jn({ moduleLevel: n }), await on(), await Je();
|
|
1361
|
+
let o = await t(U) !== null;
|
|
1362
|
+
o ? await jn() : w(`ℹ️ '${U}' NOT required by this project`), await r("ℹ️ Format generated files", "prettier", [
|
|
1346
1363
|
"--write",
|
|
1347
1364
|
"README.md",
|
|
1348
|
-
...o ? [
|
|
1365
|
+
...o ? [U] : []
|
|
1349
1366
|
]);
|
|
1350
1367
|
} catch (e) {
|
|
1351
1368
|
console.error("❌ Error documenting project", e), process.exit(1);
|
|
@@ -1353,7 +1370,7 @@ async function yr(e = "MIT", n = !1) {
|
|
|
1353
1370
|
}
|
|
1354
1371
|
//#endregion
|
|
1355
1372
|
//#region src/actions/formatCode.ts
|
|
1356
|
-
async function
|
|
1373
|
+
async function Sr() {
|
|
1357
1374
|
try {
|
|
1358
1375
|
l("Format Code");
|
|
1359
1376
|
let e = [
|
|
@@ -1374,7 +1391,7 @@ async function br() {
|
|
|
1374
1391
|
}
|
|
1375
1392
|
//#endregion
|
|
1376
1393
|
//#region src/actions/lintCode.ts
|
|
1377
|
-
async function
|
|
1394
|
+
async function Cr() {
|
|
1378
1395
|
try {
|
|
1379
1396
|
l("Lint Code"), await r("1️⃣ Lint", "eslint", ["."]), x("Code linted");
|
|
1380
1397
|
} catch (e) {
|
|
@@ -1383,12 +1400,12 @@ async function xr() {
|
|
|
1383
1400
|
}
|
|
1384
1401
|
//#endregion
|
|
1385
1402
|
//#region src/utilities/cloudflare.ts
|
|
1386
|
-
var
|
|
1403
|
+
var wr = {
|
|
1387
1404
|
".css": "text/css",
|
|
1388
1405
|
".js": "application/javascript",
|
|
1389
1406
|
".wasm": "application/wasm"
|
|
1390
|
-
},
|
|
1391
|
-
async function
|
|
1407
|
+
}, Tr = "dpuse-sample-data-eu";
|
|
1408
|
+
async function Er() {
|
|
1392
1409
|
let e = await C("config.json"), t = {
|
|
1393
1410
|
body: JSON.stringify(e),
|
|
1394
1411
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1396,12 +1413,12 @@ async function wr() {
|
|
|
1396
1413
|
}, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
|
|
1397
1414
|
if (!n.ok) throw Error(await n.text());
|
|
1398
1415
|
}
|
|
1399
|
-
async function
|
|
1400
|
-
let n = await
|
|
1401
|
-
for (let [e, t] of r) await
|
|
1416
|
+
async function Dr(e, t) {
|
|
1417
|
+
let n = await Mr(`${e}/${t}`, t), r = Map.groupBy(n, ({ key: e }) => c(e));
|
|
1418
|
+
for (let [e, t] of r) await jr(t, ["--content-type", e]);
|
|
1402
1419
|
}
|
|
1403
|
-
async function
|
|
1404
|
-
await
|
|
1420
|
+
async function Or(e) {
|
|
1421
|
+
await Dr(e, "application"), await Dr(e, "fileStore"), await jr(["applicationIndex.json", "fileStoreIndex.json"].map((t) => ({
|
|
1405
1422
|
file: `${e}/${t}`,
|
|
1406
1423
|
key: t
|
|
1407
1424
|
})), [
|
|
@@ -1411,7 +1428,7 @@ async function Er(e) {
|
|
|
1411
1428
|
"no-cache"
|
|
1412
1429
|
]);
|
|
1413
1430
|
}
|
|
1414
|
-
async function
|
|
1431
|
+
async function kr(e) {
|
|
1415
1432
|
let t = e.id, n = {
|
|
1416
1433
|
body: JSON.stringify(e),
|
|
1417
1434
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1419,13 +1436,13 @@ async function Dr(e) {
|
|
|
1419
1436
|
}, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
|
|
1420
1437
|
if (!r.ok) throw Error(await r.text());
|
|
1421
1438
|
}
|
|
1422
|
-
async function
|
|
1439
|
+
async function Ar(e, t) {
|
|
1423
1440
|
let n = `v${e.version ?? "unknown"}`;
|
|
1424
1441
|
async function r(e, r = "") {
|
|
1425
1442
|
let i = await ee(e, { withFileTypes: !0 });
|
|
1426
1443
|
for (let a of i) {
|
|
1427
1444
|
if (a.isDirectory() || a.name.endsWith(".map")) continue;
|
|
1428
|
-
let i = `${e}/${a.name}`, o = r ? `${r}/${a.name}` : a.name, s = `${t}_${n}/${o}`.replaceAll("\\", "/"), c =
|
|
1445
|
+
let i = `${e}/${a.name}`, o = r ? `${r}/${a.name}` : a.name, s = `${t}_${n}/${o}`.replaceAll("\\", "/"), c = wr[E.extname(a.name)] ?? "application/octet-stream";
|
|
1429
1446
|
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await b(void 0, "wrangler", [
|
|
1430
1447
|
"r2",
|
|
1431
1448
|
"object",
|
|
@@ -1441,7 +1458,7 @@ async function Or(e, t) {
|
|
|
1441
1458
|
}
|
|
1442
1459
|
await r("dist");
|
|
1443
1460
|
}
|
|
1444
|
-
async function
|
|
1461
|
+
async function jr(e, t) {
|
|
1445
1462
|
if (e.length === 0) return;
|
|
1446
1463
|
let n = await T.mkdtemp(E.join(ge.tmpdir(), "dpuse-r2-bulk-")), r = E.join(n, "files.json");
|
|
1447
1464
|
try {
|
|
@@ -1449,7 +1466,7 @@ async function kr(e, t) {
|
|
|
1449
1466
|
"r2",
|
|
1450
1467
|
"bulk",
|
|
1451
1468
|
"put",
|
|
1452
|
-
|
|
1469
|
+
Tr,
|
|
1453
1470
|
"--filename",
|
|
1454
1471
|
r,
|
|
1455
1472
|
...t,
|
|
@@ -1463,12 +1480,12 @@ async function kr(e, t) {
|
|
|
1463
1480
|
});
|
|
1464
1481
|
}
|
|
1465
1482
|
}
|
|
1466
|
-
async function
|
|
1483
|
+
async function Mr(e, t) {
|
|
1467
1484
|
let n = await ee(e), r = [];
|
|
1468
1485
|
for (let i of n) {
|
|
1469
1486
|
if (i.startsWith(".")) continue;
|
|
1470
1487
|
let n = `${e}/${i}`, a = `${t}/${i}`;
|
|
1471
|
-
(await h(n)).isDirectory() ? r.push(...await
|
|
1488
|
+
(await h(n)).isDirectory() ? r.push(...await Mr(n, a)) : r.push({
|
|
1472
1489
|
file: n,
|
|
1473
1490
|
key: a
|
|
1474
1491
|
});
|
|
@@ -1477,7 +1494,7 @@ async function Ar(e, t) {
|
|
|
1477
1494
|
}
|
|
1478
1495
|
//#endregion
|
|
1479
1496
|
//#region src/actions/publishProject.ts
|
|
1480
|
-
async function
|
|
1497
|
+
async function Nr() {
|
|
1481
1498
|
try {
|
|
1482
1499
|
l("Publish Project");
|
|
1483
1500
|
let e = await C("package.json"), t = await C("config.json"), n = g(t.id);
|
|
@@ -1487,30 +1504,30 @@ async function jr() {
|
|
|
1487
1504
|
"app",
|
|
1488
1505
|
"kb"
|
|
1489
1506
|
].includes(n.publishedTo);
|
|
1490
|
-
i && await r("2️⃣ Deploy", "npm", ["run", "deploy"]), await
|
|
1507
|
+
i && await r("2️⃣ Deploy", "npm", ["run", "deploy"]), await Pr(i ? "3️⃣ " : "2️⃣ ", e, t, n), n.publishedTo === "sampleData" && (w("3️⃣ Upload sample data"), await Or("public")), x(`Project version '${e.version ?? "unknown"}' published.`);
|
|
1491
1508
|
} catch (e) {
|
|
1492
1509
|
console.error("❌ Error publishing project", e), process.exit(1);
|
|
1493
1510
|
}
|
|
1494
1511
|
}
|
|
1495
|
-
async function
|
|
1496
|
-
if (r.typeId === "app") w(`${e} Register module`), await
|
|
1497
|
-
else if (r.typeId === "engine") w(`${e} Register module`), await
|
|
1512
|
+
async function Pr(e, t, n, r) {
|
|
1513
|
+
if (r.typeId === "app") w(`${e} Register module`), await Er();
|
|
1514
|
+
else if (r.typeId === "engine") w(`${e} Register module`), await Ar(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await kr(n);
|
|
1498
1515
|
else if (r.uploadGroupName === void 0) w(`${e} Registration NOT required`);
|
|
1499
1516
|
else {
|
|
1500
1517
|
w(`${e} Register module`);
|
|
1501
1518
|
let i = n.id.split("-").slice(2).join("-");
|
|
1502
|
-
await
|
|
1519
|
+
await Ar(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await kr(n);
|
|
1503
1520
|
}
|
|
1504
1521
|
}
|
|
1505
1522
|
//#endregion
|
|
1506
1523
|
//#region src/actions/releaseProject.ts
|
|
1507
|
-
async function
|
|
1524
|
+
async function Fr(e = "MIT", t = !1) {
|
|
1508
1525
|
try {
|
|
1509
1526
|
l("Release Project");
|
|
1510
1527
|
let n = await C("package.json"), i = await C("config.json"), a = g(i.id);
|
|
1511
1528
|
await p("1️⃣ ", n);
|
|
1512
1529
|
let o = await oe("2️⃣ ", n, a);
|
|
1513
|
-
if (await Ee("3️⃣ ", n), w("4️⃣ Regenerate README"), await
|
|
1530
|
+
if (await Ee("3️⃣ ", n), w("4️⃣ Regenerate README"), await xr(e, t), await b("5️⃣ Stage changes", "git", ["add", "."]), await b("6️⃣ Commit changes", "git", [
|
|
1514
1531
|
"commit",
|
|
1515
1532
|
"-m",
|
|
1516
1533
|
`v${n.version ?? "unknown"}`
|
|
@@ -1518,7 +1535,7 @@ async function Nr(e = "MIT", t = !1) {
|
|
|
1518
1535
|
"push",
|
|
1519
1536
|
"origin",
|
|
1520
1537
|
"main:main"
|
|
1521
|
-
]), await
|
|
1538
|
+
]), await Pr("8️⃣ ", n, o, a), a.publishedTo === "npm") {
|
|
1522
1539
|
let e = `v${n.version ?? "unknown"}`;
|
|
1523
1540
|
await r("9️⃣ Trigger GitHub release", "gh", [
|
|
1524
1541
|
"release",
|
|
@@ -1537,7 +1554,7 @@ async function Nr(e = "MIT", t = !1) {
|
|
|
1537
1554
|
}
|
|
1538
1555
|
//#endregion
|
|
1539
1556
|
//#region src/actions/syncProjectWithGitHub.ts
|
|
1540
|
-
async function
|
|
1557
|
+
async function Ir() {
|
|
1541
1558
|
try {
|
|
1542
1559
|
l("Synchronise Project with GitHub");
|
|
1543
1560
|
let e = await C("package.json"), t = await C("config.json"), n = g(t.id);
|
|
@@ -1556,12 +1573,12 @@ async function Pr() {
|
|
|
1556
1573
|
}
|
|
1557
1574
|
//#endregion
|
|
1558
1575
|
//#region src/actions/testProject.ts
|
|
1559
|
-
var
|
|
1576
|
+
var Lr = [
|
|
1560
1577
|
"1️⃣ ",
|
|
1561
1578
|
"2️⃣ ",
|
|
1562
1579
|
"3️⃣ ",
|
|
1563
1580
|
"4️⃣ "
|
|
1564
|
-
],
|
|
1581
|
+
], Rr = [{
|
|
1565
1582
|
id: "unit",
|
|
1566
1583
|
label: "Run unit tests",
|
|
1567
1584
|
command: "vitest",
|
|
@@ -1574,13 +1591,13 @@ var Fr = [
|
|
|
1574
1591
|
arguments: ["test", "--pass-with-no-tests"],
|
|
1575
1592
|
configFileName: "playwright.config.ts"
|
|
1576
1593
|
}];
|
|
1577
|
-
async function
|
|
1594
|
+
async function zr(e = ["unit"]) {
|
|
1578
1595
|
try {
|
|
1579
1596
|
l("Test Project");
|
|
1580
1597
|
let n = 0;
|
|
1581
|
-
for (let i of
|
|
1598
|
+
for (let i of Rr) {
|
|
1582
1599
|
if (!e.includes(i.id) || await t(i.configFileName) === null) continue;
|
|
1583
|
-
let a = `${
|
|
1600
|
+
let a = `${Lr[n] ?? ""} ${i.label}`;
|
|
1584
1601
|
await r(a, i.command, i.arguments), n += 1;
|
|
1585
1602
|
}
|
|
1586
1603
|
if (n === 0) {
|
|
@@ -1594,7 +1611,7 @@ async function Lr(e = ["unit"]) {
|
|
|
1594
1611
|
}
|
|
1595
1612
|
//#endregion
|
|
1596
1613
|
//#region src/actions/triggerGitHubRelease.ts
|
|
1597
|
-
async function
|
|
1614
|
+
async function Br() {
|
|
1598
1615
|
try {
|
|
1599
1616
|
l("Trigger GitHub Release");
|
|
1600
1617
|
let e = `v${(await C("package.json")).version ?? "unknown"}`;
|
|
@@ -1612,4 +1629,4 @@ async function Rr() {
|
|
|
1612
1629
|
}
|
|
1613
1630
|
}
|
|
1614
1631
|
//#endregion
|
|
1615
|
-
export { ye as auditDependencies, Te as buildProject,
|
|
1632
|
+
export { ye as auditDependencies, Te as buildProject, Ve as checkProject, xr as documentProject, Sr as formatCode, Cr as lintCode, Nr as publishProject, Fr as releaseProject, c as resolveSampleDataContentType, Ir as syncProjectWithGitHub, zr as testProject, Br as triggerGitHubRelease, Dr as uploadDirectoryToR2 };
|