@dpuse/dpuse-development 0.3.791 → 0.3.793

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.
@@ -1,4 +1,4 @@
1
- import { C as e, E as t, O as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, k as m, l as h, m as g, n as _, o as ee, p as v, r as y, s as te, t as ne, u as re, v as b, w as x, x as S, y as C } from "./utilities-CPg6O2rR.js";
1
+ import { C as e, E as t, O as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, k as m, l as h, m as g, n as _, o as ee, p as v, r as y, s as te, t as ne, u as re, v as b, w as x, x as S, y as C } from "./utilities-DxgaXApN.js";
2
2
  import { existsSync as ie } from "node:fs";
3
3
  import w from "node:path";
4
4
  import { promisify as ae } from "node:util";
@@ -9,7 +9,7 @@ import { init as le } from "license-checker-rseidelsohn";
9
9
  //#region src/actions/auditDependencies.ts
10
10
  async function ue() {
11
11
  try {
12
- f("Audit Dependencies"), await e("1️⃣ Check using 'npm audit'", "npm", ["audit"]), d("Dependencies audited");
12
+ f("Audit Dependencies"), await e("1️⃣ Check shipped dependencies for any vulnerability", "npm", ["audit", "--omit=dev"]), await e("2️⃣ Check all dependencies for high or critical vulnerabilities", "npm", ["audit", "--audit-level=high"]), d("Dependencies audited");
13
13
  } catch (e) {
14
14
  console.error("❌ Error auditing dependencies", e), process.exit(1);
15
15
  }
@@ -138,7 +138,12 @@ async function xe() {
138
138
  "rebuild",
139
139
  ...n,
140
140
  "--no-strict-allow-scripts"
141
- ]), await e("7️⃣ Confirm every install script is reviewed", "npm", ["install", "--strict-allow-scripts"]), d("Dependencies checked");
141
+ ]), await e("7️⃣ Confirm every install script is reviewed", "npm", [
142
+ "install",
143
+ "--strict-allow-scripts",
144
+ "--no-audit",
145
+ "--no-fund"
146
+ ]), d("Dependencies checked");
142
147
  } catch (e) {
143
148
  console.error("❌ Error checking dependencies", e), process.exit(1);
144
149
  }
@@ -343,7 +348,7 @@ var Ge = "<!-- OPENING_START -->", Ke = "<!-- OPENING_END -->";
343
348
  async function qe() {
344
349
  try {
345
350
  f("Document Opening"), a("1️⃣ Insert opening content into 'README.md'");
346
- let e = await C("package.json"), n = await C("config.json"), { owner: i, repo: o } = r(e, "document opening"), s = Je(e), c = Ye(n), l = Xe(i, o, s, e.description, c);
351
+ let e = await C("package.json"), n = await C("config.json"), { owner: i, repo: o } = r(e, "document opening"), s = Je(e), c = Xe(n), l = Ze(i, o, s, v(n.id).publishedTo === "npm" ? Ye(e) : void 0, e.description, c);
347
352
  await t(l, Ge, Ke), d("Opening documented");
348
353
  } catch (e) {
349
354
  console.error("❌ Error documenting opening", e), process.exit(1);
@@ -355,16 +360,21 @@ function Je(e) {
355
360
  return t;
356
361
  }
357
362
  function Ye(e) {
363
+ let t = e.name;
364
+ if (t == null || t === "") throw Error("package.json 'name' field is required to document opening.");
365
+ return t;
366
+ }
367
+ function Xe(e) {
358
368
  let t = e.description.en, n = (Array.isArray(t) ? t : [t]).filter((e) => typeof e == "string" && e !== "");
359
369
  return n.length === 0 ? void 0 : n.join("\n\n");
360
370
  }
361
- function Xe(e, t, n, r, i) {
362
- let a = `https://github.com/${e}/${t}`;
371
+ function Ze(e, t, n, r, i, a) {
372
+ let o = `https://github.com/${e}/${t}`;
363
373
  return `[![License: ${n}](https://img.shields.io/badge/License-${n.replaceAll("-", "--")}-blue.svg)](./LICENSE)
364
- [![DPUse version](https://img.shields.io/github/v/release/${e}/${t}?color=f6821f&label=DPUse)](${a}/releases/latest)
365
- [![CI](${a}/actions/workflows/ci.yml/badge.svg)](${a}/actions/workflows/ci.yml)
374
+ [![DPUse version](https://img.shields.io/github/v/release/${e}/${t}?color=f6821f&label=DPUse)](${o}/releases/latest)${r === void 0 ? "" : `\n[![npm version](https://img.shields.io/npm/v/${r}?color=cb3837&label=npm)](https://www.npmjs.com/package/${r})`}
375
+ [![CI](${o}/actions/workflows/ci.yml/badge.svg)](${o}/actions/workflows/ci.yml)
366
376
 
367
- [DPUse](https://www.dpuse.app) · [Report a Vulnerability](${a}/security/advisories/new) · [Open an Issue](${a}/issues)${r == null || r === "" ? "" : `\n\n${r}`}
377
+ [DPUse](https://www.dpuse.app) · [Report a Vulnerability](${o}/security/advisories/new) · [Open an Issue](${o}/issues)${i == null || i === "" ? "" : `\n\n${i}`}
368
378
 
369
379
  ## About DPUse
370
380
 
@@ -376,7 +386,7 @@ DPUse (Data Positioning & Use) is an in-browser application that positions your
376
386
 
377
387
  **Publishing** uses a library of [Presenters](https://www.dpuse.app) to render standard [Presentations](https://www.dpuse.app) immediately using the contextualised data; additionally, [Cookbooks](https://www.dpuse.app) of [Recipes](https://www.dpuse.app) let you build Data Apps using your preferred tools.
378
388
 
379
- In addition, DPUse provides [Tools](https://www.dpuse.app) used by the application, and you can use them to construct connectors and presenters.${i === void 0 ? "" : `\n\n## Introduction\n\n${i}`}`;
389
+ In addition, DPUse provides [Tools](https://www.dpuse.app) used by the application, and you can use them to construct connectors and presenters.${a === void 0 ? "" : `\n\n## Introduction\n\n${a}`}`;
380
390
  }
381
391
  //#endregion
382
392
  //#region src/actions/documentQualitySecurity.ts
@@ -384,27 +394,27 @@ var M = {
384
394
  "Branch-Protection": 3,
385
395
  "Code-Review": 0,
386
396
  Contributors: 0
387
- }, Ze = /* @__PURE__ */ new Set(["CII-Best-Practices"]), Qe = "coverage/coverage-final.json", $e = "coverage/coverage-summary.json", N = 80, et = 60, P = "code-health-reports/vitest/badge.json", tt = {
397
+ }, Qe = /* @__PURE__ */ new Set(["CII-Best-Practices"]), $e = "coverage/coverage-final.json", et = "coverage/coverage-summary.json", tt = 80, nt = 60, N = "code-health-reports/vitest/badge.json", rt = {
388
398
  actions: "GitHub Actions",
389
399
  "javascript-typescript": "JavaScript/TypeScript",
390
400
  rust: "Rust"
391
- }, nt = {
401
+ }, it = {
392
402
  A: "brightgreen",
393
403
  B: "green",
394
404
  C: "yellow",
395
405
  D: "orange",
396
406
  F: "red"
397
- }, F = `${p}/health.json`, rt = ae(oe);
398
- async function it() {
407
+ }, P = `${p}/health.json`, at = ae(oe);
408
+ async function ot() {
399
409
  try {
400
410
  f("Document Quality & Security");
401
- let e = await C("package.json"), n = await at(e), i = await st(e, n === void 0 ? [] : ["--coverage", Qe]), { owner: o, repo: s } = r(e, "document quality and security");
411
+ let e = await C("package.json"), n = await st(e), i = await lt(e, n === void 0 ? [] : ["--coverage", $e]), { owner: o, repo: s } = r(e, "document quality and security");
402
412
  a("4️⃣ Read security checks and settings");
403
- let c = await lt(o, s, e);
413
+ let c = await dt(o, s, e);
404
414
  a("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
405
- let [l, u] = await Promise.all([ut(`https://github.com/${o}/${s}`), dt(`github.com/${o}/${s}`)]);
415
+ let [l, u] = await Promise.all([ft(`https://github.com/${o}/${s}`), pt(`github.com/${o}/${s}`)]);
406
416
  a("6️⃣ Insert quality and security content into 'README.md'");
407
- let p = mt(o, s, {
417
+ let p = gt(o, s, {
408
418
  coveragePercent: n,
409
419
  fallowHealth: i,
410
420
  securitySettings: c
@@ -414,7 +424,7 @@ async function it() {
414
424
  console.error("❌ Error documenting quality and security", e), process.exit(1);
415
425
  }
416
426
  }
417
- async function at(t) {
427
+ async function st(t) {
418
428
  if (t.devDependencies?.["@vitest/coverage-v8"] == null) {
419
429
  a("1️⃣ Test coverage NOT measured, as '@vitest/coverage-v8' is not installed");
420
430
  return;
@@ -424,25 +434,25 @@ async function at(t) {
424
434
  "--passWithNoTests",
425
435
  "--coverage"
426
436
  ]);
427
- let n = await S($e);
437
+ let n = await S(et);
428
438
  if (n === null) return;
429
439
  let r = JSON.parse(n).total.lines.pct;
430
- return await ot(r), r;
440
+ return await ct(r), r;
431
441
  }
432
- async function ot(e) {
442
+ async function ct(e) {
433
443
  let t = [
434
444
  "red",
435
445
  "yellow",
436
446
  "brightgreen"
437
- ], n = Number(e >= et) + Number(e >= N);
438
- await i(P, {
447
+ ], n = Number(e >= nt) + Number(e >= tt);
448
+ await i(N, {
439
449
  schemaVersion: 1,
440
450
  label: "coverage",
441
451
  message: `${e.toFixed(1)}%`,
442
452
  color: t[n]
443
453
  });
444
454
  }
445
- async function st(e, t) {
455
+ async function lt(e, t) {
446
456
  if (e.devDependencies?.fallow == null) {
447
457
  a("2️⃣ Code health NOT measured, as Fallow is not installed"), a("3️⃣ Code health report NOT required");
448
458
  return;
@@ -453,32 +463,32 @@ async function st(e, t) {
453
463
  "--format",
454
464
  "json",
455
465
  ...t
456
- ], F), await x("3️⃣ Write code health report", "fallow", ["--format", "markdown"], o, !0);
457
- let n = await C(F);
458
- return await ct(n), n;
466
+ ], P), await x("3️⃣ Write code health report", "fallow", ["--format", "markdown"], o, !0);
467
+ let n = await C(P);
468
+ return await ut(n), n;
459
469
  }
460
- async function ct(e) {
470
+ async function ut(e) {
461
471
  let { score: t, grade: n } = e.health_score;
462
472
  await i(y, {
463
473
  schemaVersion: 1,
464
474
  label: "fallow",
465
475
  message: `${n} (${String(Math.round(t))})`,
466
- color: nt[n] ?? "lightgrey"
476
+ color: it[n] ?? "lightgrey"
467
477
  });
468
478
  }
469
- async function lt(e, t, n) {
479
+ async function dt(e, t, n) {
470
480
  let [r, i, a] = await Promise.all([
471
481
  S(".github/workflows/ci.yml"),
472
482
  S(".github/workflows/codeql.yml"),
473
483
  S(".github/dependabot.yml")
474
484
  ]), [o, s, c, l] = await Promise.all([
475
- I(`repos/${e}/${t}`),
476
- I(`repos/${e}/${t}/private-vulnerability-reporting`),
477
- I(`repos/${e}/${t}/vulnerability-alerts`),
478
- I(`repos/${e}/${t}/commits/main/check-runs?per_page=100`)
485
+ F(`repos/${e}/${t}`),
486
+ F(`repos/${e}/${t}/private-vulnerability-reporting`),
487
+ F(`repos/${e}/${t}/vulnerability-alerts`),
488
+ F(`repos/${e}/${t}/commits/main/check-runs?per_page=100`)
479
489
  ]), u = o === void 0 ? void 0 : JSON.parse(o).security_and_analysis, d = (e) => u?.[e] === void 0 ? void 0 : u[e].status === "enabled", f = new Set((l === void 0 ? [] : JSON.parse(l).check_runs).map((e) => e.app?.slug)), p = a?.match(/package-ecosystem:/g)?.length ?? 0, m = a?.match(/open-pull-requests-limit: 0\b/g)?.length ?? 0;
480
490
  return {
481
- codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) => tt[e] ?? e).toArray(),
491
+ codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) => rt[e] ?? e).toArray(),
482
492
  codeQLQueries: /queries: ([\w-]+)/.exec(i ?? "")?.[1],
483
493
  dependabotAlerts: c !== void 0,
484
494
  dependabotSecurityUpdates: d("dependabot_security_updates"),
@@ -495,37 +505,37 @@ async function lt(e, t, n) {
495
505
  testsInCI: r?.includes("npm test") ?? !1
496
506
  };
497
507
  }
498
- async function I(e) {
508
+ async function F(e) {
499
509
  try {
500
- let { stdout: t } = await rt("gh", ["api", e]);
510
+ let { stdout: t } = await at("gh", ["api", e]);
501
511
  return t;
502
512
  } catch (e) {
503
513
  if (String(e.stderr).includes("HTTP 404")) return;
504
514
  throw e;
505
515
  }
506
516
  }
507
- async function ut(e) {
517
+ async function ft(e) {
508
518
  let t = await fetch(`https://www.bestpractices.dev/projects.json?url=${encodeURIComponent(e)}`);
509
519
  if (!t.ok) throw Error(`OpenSSF Best Practices lookup failed with status ${String(t.status)}.`);
510
520
  return (await t.json()).find((t) => t.repo_url === e)?.id;
511
521
  }
512
- async function dt(e) {
522
+ async function pt(e) {
513
523
  let t = await fetch(`https://api.scorecard.dev/projects/${e}`);
514
524
  if (t.status !== 404) {
515
525
  if (!t.ok) throw Error(`OpenSSF Scorecard lookup failed with status ${String(t.status)}.`);
516
526
  return await t.json();
517
527
  }
518
528
  }
519
- function ft(e) {
520
- return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Ze.has(e) || M[e] !== void 0 && t >= M[e]);
529
+ function mt(e) {
530
+ return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Qe.has(e) || M[e] !== void 0 && t >= M[e]);
521
531
  }
522
- function L(e) {
532
+ function I(e) {
523
533
  return e === !1 ? " These are handled manually." : "";
524
534
  }
525
- function R(e) {
535
+ function L(e) {
526
536
  return e === void 0 ? "❔ Unknown" : e ? "✅ On" : "❌ Off";
527
537
  }
528
- function z(e, t) {
538
+ function R(e, t) {
529
539
  return t.length === 0 ? "" : `### ${e}
530
540
 
531
541
  |Check|Status|What it does|
@@ -534,90 +544,90 @@ ${t.map((e) => `|${e.join("|")}|`).join("\n")}
534
544
 
535
545
  `;
536
546
  }
537
- function B(e, t, n, r) {
547
+ function z(e, t, n, r) {
538
548
  return `![${n}](https://img.shields.io/endpoint?url=${encodeURIComponent(`https://raw.githubusercontent.com/${e}/${t}/main/${r}`)})`;
539
549
  }
540
- function pt(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
541
- let a = `https://github.com/${e}/${t}`, s = (e) => e ? ` Part of the [CI workflow](${a}/actions/workflows/ci.yml) on every push to \`main\`.` : "", c = [[
550
+ function ht(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
551
+ let a = `https://github.com/${e}/${t}`, s = (e) => e ? ` Part of the [CI workflow](${a}/actions/workflows/ci.yml) on every push and pull request to \`main\`.` : "", c = [[
542
552
  "Unit tests",
543
- R(i.testsInCI),
553
+ L(i.testsInCI),
544
554
  `[Vitest](https://vitest.dev) runs the unit tests.${s(i.testsInCI)}`
545
555
  ], [
546
556
  "Property-based tests",
547
- R(i.propertyTests),
557
+ L(i.propertyTests),
548
558
  `[fast-check](https://fast-check.dev) runs many random inputs per test to find edge cases, alongside the unit tests.${s(i.propertyTests && i.testsInCI)}`
549
559
  ]];
550
560
  n !== void 0 && c.push([
551
561
  "Test coverage",
552
- R(!0),
553
- `${B(e, t, "Coverage", P)} [Vitest's V8 coverage](https://vitest.dev/guide/coverage) measures the share of source lines the unit tests run. The target is ${String(N)}%.`
562
+ L(!0),
563
+ `${z(e, t, "Coverage", N)} [Vitest's V8 coverage](https://vitest.dev/guide/coverage) measures the share of source lines the unit tests run. The target is ${String(tt)}%.`
554
564
  ]);
555
565
  let l = `[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=${e}_${t}&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=${e}_${t}) `, u = [[
556
566
  "Code analysis",
557
- R(i.sonarCloud),
567
+ L(i.sonarCloud),
558
568
  `${i.sonarCloud ? l : ""}[SonarCloud](https://sonarcloud.io) checks every push for bugs, code smells and vulnerabilities.`
559
569
  ], [
560
570
  "Linting",
561
- R(i.lintInCI),
571
+ L(i.lintInCI),
562
572
  `[ESLint](https://eslint.org) checks the code for errors and style problems.${s(i.lintInCI)}`
563
573
  ]];
564
574
  r !== void 0 && u.unshift([
565
575
  "Code health",
566
- R(!0),
567
- `[${B(e, t, "Fallow code health", y)}](./${o}) [Fallow](https://github.com/fallow-rs/fallow) finds unused code, duplication, complexity and dependency problems.`
576
+ L(!0),
577
+ `[${z(e, t, "Fallow code health", y)}](./${o}) [Fallow](https://github.com/fallow-rs/fallow) finds unused code, duplication, complexity and dependency problems.`
568
578
  ]);
569
579
  let d = i.codeQLLanguages.length > 0, f = `[![CodeQL](${a}/actions/workflows/codeql.yml/badge.svg)](${a}/security/code-scanning) `, p = i.codeQLQueries === "security-extended" ? "using the extended security queries" : "using the default queries", m = d ? ` ${i.codeQLLanguages.join(" and ")}` : "", h = [
570
580
  [
571
581
  "Push protection",
572
- R(i.pushProtection),
582
+ L(i.pushProtection),
573
583
  "[GitHub push protection](https://docs.github.com/en/code-security/secret-scanning/push-protection-for-repositories-and-organizations) blocks pushes that contain credentials."
574
584
  ],
575
585
  [
576
586
  "Static analysis",
577
- R(d),
587
+ L(d),
578
588
  `${d ? f : ""}[CodeQL](https://codeql.github.com) scans${m} for security vulnerabilities, ${p}, on every push and pull request to \`main\` and weekly.`
579
589
  ],
580
590
  [
581
591
  "Secret scanning",
582
- R(i.secretScanning),
592
+ L(i.secretScanning),
583
593
  "[GitHub secret scanning](https://docs.github.com/en/code-security/secret-scanning) detects credentials, such as API keys and tokens, committed to the repository."
584
594
  ]
585
595
  ], g = "[Dependabot](https://docs.github.com/en/code-security/dependabot)", _ = [
586
596
  [
587
597
  "Vulnerability audit",
588
- R(i.npmAuditInCI),
589
- i.npmAuditLevel === void 0 ? `[npm audit](https://docs.npmjs.com/cli/commands/npm-audit) fails when any dependency has a known vulnerability.${s(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.${s(i.npmAuditInCI)}`
598
+ L(i.npmAuditInCI),
599
+ 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.${s(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.${s(i.npmAuditInCI)}`
590
600
  ],
591
601
  [
592
602
  "Supply chain risk",
593
- R(i.socket),
603
+ L(i.socket),
594
604
  "[Socket](https://socket.dev) flags malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE."
595
605
  ],
596
606
  [
597
607
  "Security alerts",
598
- R(i.dependabotAlerts),
608
+ L(i.dependabotAlerts),
599
609
  `${g} alerts when a dependency has a known vulnerability, using the GitHub Advisory Database.`
600
610
  ],
601
611
  [
602
612
  "Security updates",
603
- R(i.dependabotSecurityUpdates),
604
- `${g} opens pull requests that update vulnerable dependencies.${L(i.dependabotSecurityUpdates)}`
613
+ L(i.dependabotSecurityUpdates),
614
+ `${g} opens pull requests that update vulnerable dependencies.${I(i.dependabotSecurityUpdates)}`
605
615
  ],
606
616
  [
607
617
  "Version updates",
608
- R(i.dependabotVersionUpdates),
609
- `${g} opens pull requests for new dependency versions.${L(i.dependabotVersionUpdates)}`
618
+ L(i.dependabotVersionUpdates),
619
+ `${g} opens pull requests for new dependency versions.${I(i.dependabotVersionUpdates)}`
610
620
  ]
611
621
  ];
612
622
  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.
613
623
 
614
- ${z("Testing", c)}${z("Code Quality", u)}${z("Security Analysis", h)}${z("Dependencies", _)}`;
624
+ ${R("Testing", c)}${R("Code Quality", u)}${R("Security Analysis", h)}${R("Dependencies", _)}`;
615
625
  }
616
- function mt(e, t, n, r, i) {
617
- let a = `https://github.com/${e}/${t}`, o = `github.com/${e}/${t}`, s = `https://www.bestpractices.dev/projects/${String(r)}`, c = i !== void 0 && ft(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 ? "" : `[![OpenSSF Best Practices](${s}/badge)](${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.";
626
+ function gt(e, t, n, r, i) {
627
+ let a = `https://github.com/${e}/${t}`, o = `github.com/${e}/${t}`, s = `https://www.bestpractices.dev/projects/${String(r)}`, c = i !== void 0 && mt(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 ? "" : `[![OpenSSF Best Practices](${s}/badge)](${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.";
618
628
  return `## Quality & Security
619
629
 
620
- ${pt(e, t, n)}### OpenSSF 🚧
630
+ ${ht(e, t, n)}### OpenSSF 🚧
621
631
 
622
632
  ${l}[![OpenSSF Scorecard](https://api.scorecard.dev/projects/${o}/badge)](https://scorecard.dev/viewer/?uri=${o})
623
633
 
@@ -629,37 +639,37 @@ Please do not open public GitHub issues for security vulnerabilities. ${u}`;
629
639
  }
630
640
  //#endregion
631
641
  //#region src/actions/documentUsage.ts
632
- var ht = "<!-- USAGE_START -->", gt = "<!-- USAGE_END -->", _t = /* @__PURE__ */ new Set([
642
+ var _t = "<!-- USAGE_START -->", vt = "<!-- USAGE_END -->", yt = /* @__PURE__ */ new Set([
633
643
  "connector",
634
644
  "cookbook",
635
645
  "presenter"
636
- ]), vt = /* @__PURE__ */ new Set(["development", "eslint"]), yt = "> [!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.", bt = "This repository manages itself using the actions it implements.", xt = "This repository is managed using the common set of actions provided by [@dpuse/dpuse-development](https://github.com/dpuse/dpuse-development).";
637
- async function St() {
646
+ ]), bt = /* @__PURE__ */ new Set(["development", "eslint"]), xt = "> [!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.", St = "This repository manages itself using the actions it implements.", Ct = "This repository is managed using the common set of actions provided by [@dpuse/dpuse-development](https://github.com/dpuse/dpuse-development).";
647
+ async function wt() {
638
648
  try {
639
649
  f("Document Usage"), a("1️⃣ Insert usage content into 'README.md'");
640
- let [e, n] = await Promise.all([C("package.json"), C("config.json")]), r = Ct(e), i = wt(r), o = V(e.engines?.node), s = V(e.engines?.npm), c = V(e.devDependencies?.typescript), l = Tt(v(n.id), e.name), u = `${r.replace(/\.git$/, "")}/blob/main/package.json`, p = Et(l, r, i, o, s, c, `${e.name === "@dpuse/dpuse-development" ? bt : xt} See the \`scripts\` block in [package.json](${u}) for details.`);
641
- await t(p, ht, gt), d("Usage documented");
650
+ let [e, n] = await Promise.all([C("package.json"), C("config.json")]), r = Tt(e), i = Et(r), o = B(e.engines?.node), s = B(e.engines?.npm), c = B(e.devDependencies?.typescript), l = Dt(v(n.id), e.name), u = `${r.replace(/\.git$/, "")}/blob/main/package.json`, p = Ot(l, r, i, o, s, c, `${e.name === "@dpuse/dpuse-development" ? St : Ct} See the \`scripts\` block in [package.json](${u}) for details.`);
651
+ await t(p, _t, vt), d("Usage documented");
642
652
  } catch (e) {
643
653
  console.error("❌ Error documenting usage", e), process.exit(1);
644
654
  }
645
655
  }
646
- function Ct(e) {
656
+ function Tt(e) {
647
657
  let t = e.repository, n = typeof t == "string" ? t : t?.url;
648
658
  if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
649
659
  return n.replace(/^git\+/, "");
650
660
  }
651
- function wt(e) {
661
+ function Et(e) {
652
662
  return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
653
663
  }
654
- function V(e) {
664
+ function B(e) {
655
665
  if (e == null) throw Error("package.json version range is required to document usage.");
656
666
  let t = /\d+(?:\.\d+)*/.exec(e);
657
667
  if (t == null) throw Error(`Unable to parse version from '${e}'.`);
658
668
  return t[0];
659
669
  }
660
- function Tt(e, t) {
670
+ function Dt(e, t) {
661
671
  let { typeId: n } = e;
662
- if (_t.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.
672
+ if (yt.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.
663
673
 
664
674
  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.`;
665
675
  if (e.publishedTo === "npm") {
@@ -670,11 +680,11 @@ You may view or clone this repository for your own purposes, such as building a
670
680
  npm install ${t}
671
681
  \`\`\`
672
682
 
673
- ${vt.has(n) ? `${yt}\n\n` : ""}To work on the source instead, clone this repository.`;
683
+ ${bt.has(n) ? `${xt}\n\n` : ""}To work on the source instead, clone this repository.`;
674
684
  }
675
685
  return "You may view or clone this repository for your own purposes.";
676
686
  }
677
- function Et(e, t, n, r, i, a, o) {
687
+ function Ot(e, t, n, r, i, a, o) {
678
688
  return `## Usage
679
689
 
680
690
  ${e}
@@ -691,93 +701,93 @@ ${o}`;
691
701
  }
692
702
  //#endregion
693
703
  //#region src/actions/documentApiReference.ts
694
- var H = "API_REFERENCE.md";
695
- async function Dt() {
704
+ var V = "API_REFERENCE.md";
705
+ async function kt() {
696
706
  try {
697
707
  f("Document API Reference");
698
- let { writeAPIReference: e } = await import("./apiReference-CnXXTvff.js");
699
- await e("1️⃣ ", H), d("API reference documented");
708
+ let { writeAPIReference: e } = await import("./apiReference-DCzx5xFp.js");
709
+ await e("1️⃣ ", V), d("API reference documented");
700
710
  } catch (e) {
701
711
  console.error("❌ Error documenting API reference", e), process.exit(1);
702
712
  }
703
713
  }
704
714
  //#endregion
705
715
  //#region src/actions/documentBundleSizes.ts
706
- var U = "bundle-analysis-reports/sonda/index.json", Ot = "<!-- BUNDLE_START -->", kt = "<!-- BUNDLE_END -->", W = "&nbsp;&nbsp;&nbsp;&nbsp;", G = 20, At = "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._", K = "(bundler output, whitespace & JSON)", jt = `${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.`;
707
- async function Mt(e) {
716
+ var H = "bundle-analysis-reports/sonda/index.json", At = "<!-- BUNDLE_START -->", jt = "<!-- BUNDLE_END -->", U = "&nbsp;&nbsp;&nbsp;&nbsp;", W = 20, Mt = "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._", G = "(bundler output, whitespace & JSON)", Nt = `${G} = 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.`;
717
+ async function Pt(e) {
708
718
  try {
709
719
  f("Document Bundle Sizes"), a("1️⃣ Read bundle analysis report");
710
- let n = await C(U);
720
+ let n = await C(H);
711
721
  a("2️⃣ Insert table into 'README.md'");
712
- let r = Nt(n, e?.moduleLevel ?? !1);
713
- await t(`## Bundle Analysis\n\n${At}\n\n${r}\n\n${jt}`, Ot, kt), d("Bundle sizes documented");
722
+ let r = Ft(n, e?.moduleLevel ?? !1);
723
+ await t(`## Bundle Analysis\n\n${Mt}\n\n${r}\n\n${Nt}`, At, jt), d("Bundle sizes documented");
714
724
  } catch (e) {
715
725
  console.error("❌ Error documenting bundle sizes", e), process.exit(1);
716
726
  }
717
727
  }
718
- function Nt(e, t) {
719
- let n = Lt(e), r = n.values().flatMap((e) => e.values().toArray()).reduce((e, t) => e + t.sizes.uncompressed, 0), i = e.resources.filter((e) => e.kind === "asset").map((e) => [e.name, X(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), a = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
728
+ function Ft(e, t) {
729
+ let n = zt(e), r = n.values().flatMap((e) => e.values().toArray()).reduce((e, t) => e + t.sizes.uncompressed, 0), i = e.resources.filter((e) => e.kind === "asset").map((e) => [e.name, Y(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), a = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
720
730
  for (let [e, o] of i) {
721
- let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted((e, t) => t[1].sizes.uncompressed - e[1].sizes.uncompressed), s = i.length === 1 ? Pt(e, o, It(i), r, t) : Ft(e, o, i, r, t);
731
+ let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted((e, t) => t[1].sizes.uncompressed - e[1].sizes.uncompressed), s = i.length === 1 ? It(e, o, Rt(i), r, t) : Lt(e, o, i, r, t);
722
732
  a.push(...s);
723
733
  }
724
734
  return a.join("\n");
725
735
  }
726
- function Pt(e, t, n, r, i) {
736
+ function It(e, t, n, r, i) {
727
737
  let [a, { sizes: o, files: s }] = n, c = r > 0 ? o.uncompressed / r * 100 : 0;
728
- if (s.size === 1) return [`| ${e} → ${J(a, Y(s))} | ${Z(t)} · ${Q(c)} |`];
729
- let l = [`| ${e} → ${a} | ${Z(t)} · ${Q(c)} |`];
730
- return i || l.push(...q(s, W, r)), l;
738
+ if (s.size === 1) return [`| ${e} → ${q(a, J(s))} | ${X(t)} · ${Z(c)} |`];
739
+ let l = [`| ${e} → ${a} | ${X(t)} · ${Z(c)} |`];
740
+ return i || l.push(...K(s, U, r)), l;
731
741
  }
732
- function Ft(e, t, n, r, i) {
733
- let a = [`| ${e} | ${Z(t)} |`];
742
+ function Lt(e, t, n, r, i) {
743
+ let a = [`| ${e} | ${X(t)} |`];
734
744
  for (let [e, { sizes: t, files: o }] of n) {
735
745
  let n = r > 0 ? t.uncompressed / r * 100 : 0;
736
746
  if (o.size === 1) {
737
- let t = Y(o);
738
- a.push(`| ${W}${J(e, t)} | ${Q(n)} |`);
747
+ let t = J(o);
748
+ a.push(`| ${U}${q(e, t)} | ${Z(n)} |`);
739
749
  continue;
740
750
  }
741
- a.push(`| ${W}${e} | ${Q(n)} |`), i || a.push(...q(o, `${W}${W}`, r));
751
+ a.push(`| ${U}${e} | ${Z(n)} |`), i || a.push(...K(o, `${U}${U}`, r));
742
752
  }
743
753
  return a;
744
754
  }
745
- function q(e, t, n) {
746
- return [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed).map(([e, r]) => `| ${t}${e} | ${Q(n > 0 ? r.uncompressed / n * 100 : 0)} |`);
755
+ function K(e, t, n) {
756
+ return [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed).map(([e, r]) => `| ${t}${e} | ${Z(n > 0 ? r.uncompressed / n * 100 : 0)} |`);
747
757
  }
748
- function J(e, t) {
758
+ function q(e, t) {
749
759
  return t === "" ? e : `${e} → ${t}`;
750
760
  }
751
- function It(e) {
761
+ function Rt(e) {
752
762
  let [t] = e;
753
763
  if (t === void 0) throw Error("Expected exactly one entry");
754
764
  return t;
755
765
  }
756
- function Y(e) {
766
+ function J(e) {
757
767
  let [t] = e.keys();
758
768
  if (t === void 0) throw Error("Expected exactly one file");
759
769
  return t;
760
770
  }
761
- function Lt(e) {
762
- let t = Rt(e.dependencies), n = /* @__PURE__ */ new Map();
771
+ function zt(e) {
772
+ let t = Bt(e.dependencies), n = /* @__PURE__ */ new Map();
763
773
  for (let r of e.resources) {
764
774
  if (r.kind !== "chunk" || !r.parent) continue;
765
- let { group: e, file: i } = zt(r.name, t), a = X(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
775
+ let { group: e, file: i } = Vt(r.name, t), a = Y(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
766
776
  n.set(r.parent, o);
767
777
  let s = o.get(e) ?? {
768
- sizes: Vt(),
778
+ sizes: Q(),
769
779
  files: /* @__PURE__ */ new Map()
770
780
  };
771
- o.set(e, s), Ht(s.sizes, a);
772
- let c = s.files.get(i) ?? Vt();
773
- s.files.set(i, c), Ht(c, a);
781
+ o.set(e, s), $(s.sizes, a);
782
+ let c = s.files.get(i) ?? Q();
783
+ s.files.set(i, c), $(c, a);
774
784
  }
775
785
  return n;
776
786
  }
777
- function Rt(e) {
787
+ function Bt(e) {
778
788
  return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
779
789
  }
780
- function zt(e, t) {
790
+ function Vt(e, t) {
781
791
  let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
782
792
  if (n) {
783
793
  let [t, r] = n;
@@ -787,39 +797,39 @@ function zt(e, t) {
787
797
  };
788
798
  }
789
799
  return e === "[unassigned]" ? {
790
- group: K,
800
+ group: G,
791
801
  file: ""
792
802
  } : e.startsWith("\0") ? {
793
803
  group: "(runtime)",
794
804
  file: e.slice(1)
795
805
  } : {
796
806
  group: e.startsWith("rust/") || e.includes("vite-plugin-wasm") ? "wasm" : "src",
797
- file: Bt(e)
807
+ file: Ht(e)
798
808
  };
799
809
  }
800
- function Bt(e) {
810
+ function Ht(e) {
801
811
  return e.split("/").at(-1) ?? e;
802
812
  }
803
- function X(e) {
813
+ function Y(e) {
804
814
  return {
805
815
  uncompressed: e.uncompressed,
806
816
  gzip: e.gzip ?? 0
807
817
  };
808
818
  }
809
- function Z(e) {
819
+ function X(e) {
810
820
  return `${Ut(e.uncompressed)} · gzip ${Ut(e.gzip)}`;
811
821
  }
812
- function Q(e) {
813
- let t = Math.round(e / 100 * G);
814
- return `\`${"█".repeat(t)}${"░".repeat(G - t)}\` ${e.toFixed(1)}%`;
822
+ function Z(e) {
823
+ let t = Math.round(e / 100 * W);
824
+ return `\`${"█".repeat(t)}${"░".repeat(W - t)}\` ${e.toFixed(1)}%`;
815
825
  }
816
- function Vt() {
826
+ function Q() {
817
827
  return {
818
828
  uncompressed: 0,
819
829
  gzip: 0
820
830
  };
821
831
  }
822
- function Ht(e, t) {
832
+ function $(e, t) {
823
833
  e.uncompressed += t.uncompressed, e.gzip += t.gzip;
824
834
  }
825
835
  function Ut(e) {
@@ -830,12 +840,12 @@ function Ut(e) {
830
840
  async function Wt(t = "MIT", n = !1) {
831
841
  try {
832
842
  let r = await C("config.json"), i = v(r.id).typeId === "connector";
833
- await qe(), i && await ke(), await St(), await Fe(t), await S("bundle-analysis-reports/sonda/index.json") === null ? a(`ℹ️ Bundle sizes NOT documented, as there is no '${U}' yet. Build the project first.`) : await Mt({ moduleLevel: n }), await it(), await Ae();
834
- let o = await S(H) !== null;
835
- o ? await Dt() : a(`ℹ️ '${H}' NOT required by this project`), await e("ℹ️ Format generated files", "prettier", [
843
+ await qe(), i && await ke(), await wt(), await Fe(t), await S("bundle-analysis-reports/sonda/index.json") === null ? a(`ℹ️ Bundle sizes NOT documented, as there is no '${H}' yet. Build the project first.`) : await Pt({ moduleLevel: n }), await ot(), await Ae();
844
+ let o = await S(V) !== null;
845
+ o ? await kt() : a(`ℹ️ '${V}' NOT required by this project`), await e("ℹ️ Format generated files", "prettier", [
836
846
  "--write",
837
847
  "README.md",
838
- ...o ? [H] : []
848
+ ...o ? [V] : []
839
849
  ]);
840
850
  } catch (e) {
841
851
  console.error("❌ Error documenting project", e), process.exit(1);
@@ -935,12 +945,12 @@ async function Zt() {
935
945
  try {
936
946
  f("Publish Project");
937
947
  let e = await C("package.json"), t = await C("config.json");
938
- await $("1️⃣ ", e, t, v(t.id)), d(`Project version '${e.version ?? "unknown"}' published.`);
948
+ await Qt("1️⃣ ", e, t, v(t.id)), d(`Project version '${e.version ?? "unknown"}' published.`);
939
949
  } catch (e) {
940
950
  console.error("❌ Error publishing project", e), process.exit(1);
941
951
  }
942
952
  }
943
- async function $(e, t, n, r) {
953
+ async function Qt(e, t, n, r) {
944
954
  if (r.typeId === "app") a(`${e} Register module`), await qt();
945
955
  else if (r.typeId === "engine") a(`${e} Register module`), await Xt(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await Yt(n);
946
956
  else if (r.uploadGroupName === void 0) a(`${e} Registration NOT required`);
@@ -952,7 +962,7 @@ async function $(e, t, n, r) {
952
962
  }
953
963
  //#endregion
954
964
  //#region src/actions/releaseProject.ts
955
- async function Qt(t = "MIT", n = !1) {
965
+ async function $t(t = "MIT", n = !1) {
956
966
  try {
957
967
  f("Release Project");
958
968
  let r = await C("package.json"), i = await C("config.json"), o = v(i.id);
@@ -966,7 +976,7 @@ async function Qt(t = "MIT", n = !1) {
966
976
  "push",
967
977
  "origin",
968
978
  "main:main"
969
- ]), await $("8️⃣ ", r, s, o), o.publishedTo === "npm") {
979
+ ]), await Qt("8️⃣ ", r, s, o), o.publishedTo === "npm") {
970
980
  let t = `v${r.version ?? "unknown"}`;
971
981
  await e("9️⃣ Create GitHub release", "gh", [
972
982
  "release",
@@ -985,7 +995,7 @@ async function Qt(t = "MIT", n = !1) {
985
995
  }
986
996
  //#endregion
987
997
  //#region src/actions/syncProjectWithGitHub.ts
988
- async function $t() {
998
+ async function en() {
989
999
  try {
990
1000
  f("Synchronise Project with GitHub");
991
1001
  let e = await C("package.json"), t = await C("config.json"), n = v(t.id);
@@ -1004,12 +1014,12 @@ async function $t() {
1004
1014
  }
1005
1015
  //#endregion
1006
1016
  //#region src/actions/testProject.ts
1007
- var en = [
1017
+ var tn = [
1008
1018
  "1️⃣ ",
1009
1019
  "2️⃣ ",
1010
1020
  "3️⃣ ",
1011
1021
  "4️⃣ "
1012
- ], tn = [{
1022
+ ], nn = [{
1013
1023
  id: "unit",
1014
1024
  label: "Run unit tests",
1015
1025
  command: "vitest",
@@ -1022,13 +1032,13 @@ var en = [
1022
1032
  arguments: ["test", "--pass-with-no-tests"],
1023
1033
  configFileName: "playwright.config.ts"
1024
1034
  }];
1025
- async function nn(t = ["unit"]) {
1035
+ async function rn(t = ["unit"]) {
1026
1036
  try {
1027
1037
  f("Test Project");
1028
1038
  let n = 0;
1029
- for (let r of tn) {
1039
+ for (let r of nn) {
1030
1040
  if (!t.includes(r.id) || await S(r.configFileName) === null) continue;
1031
- let i = `${en[n] ?? ""} ${r.label}`;
1041
+ let i = `${tn[n] ?? ""} ${r.label}`;
1032
1042
  await e(i, r.command, r.arguments), n += 1;
1033
1043
  }
1034
1044
  if (n === 0) {
@@ -1041,4 +1051,4 @@ async function nn(t = ["unit"]) {
1041
1051
  }
1042
1052
  }
1043
1053
  //#endregion
1044
- export { ue as auditDependencies, de as buildProject, Ce as checkProject, Wt as documentProject, Gt as formatCode, Kt as lintCode, Zt as publishProject, Qt as releaseProject, $t as syncProjectWithGitHub, nn as testProject, Jt as uploadDirectoryToR2 };
1054
+ export { ue as auditDependencies, de as buildProject, Ce as checkProject, Wt as documentProject, Gt as formatCode, Kt as lintCode, Zt as publishProject, $t as releaseProject, en as syncProjectWithGitHub, rn as testProject, Jt as uploadDirectoryToR2 };