@dpuse/dpuse-development 1.0.108 → 1.0.109

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,16 +1,16 @@
1
- import { C as e, D as t, E as n, M as r, O as i, S as a, T as o, _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, j as g, k as _, l as v, m as y, n as ee, o as te, p as b, r as ne, s as re, t as ie, u as x, v as S, w as C, x as w, y as T } from "./utilities-BLjGg0iM.js";
2
- import { SHIPPED_PACKAGES_FILE_NAME as ae } from "./vite.es.js";
3
- import { existsSync as oe, promises as E } from "node:fs";
4
- import D from "node:path";
5
- import { promisify as se } from "node:util";
6
- import { execFile as ce } from "node:child_process";
7
- import { fileURLToPath as le } from "node:url";
8
- import { run as ue } from "npm-check-updates";
9
- import { init as de } from "license-checker-rseidelsohn";
10
- import { setTimeout as fe } from "node:timers/promises";
11
- import pe from "spdx-satisfies";
1
+ import { C as e, D as t, E as n, M as r, O as i, S as a, T as o, _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, j as g, k as _, l as v, m as y, n as ee, o as te, p as b, r as ne, s as re, t as ie, u as ae, v as x, w as S, x as C, y as w } from "./utilities-BLjGg0iM.js";
2
+ import { SHIPPED_PACKAGES_FILE_NAME as oe } from "./vite.es.js";
3
+ import { existsSync as se, promises as T } from "node:fs";
4
+ import E from "node:path";
5
+ import { promisify as ce } from "node:util";
6
+ import { execFile as le } from "node:child_process";
7
+ import { fileURLToPath as ue } from "node:url";
8
+ import { run as de } from "npm-check-updates";
9
+ import { init as fe } from "license-checker-rseidelsohn";
10
+ import { setTimeout as pe } from "node:timers/promises";
11
+ import me from "spdx-satisfies";
12
12
  //#region src/actions/auditDependencies_.json
13
- var me = [
13
+ var he = [
14
14
  {
15
15
  id: "GHSA-ch52-4w7c-c8xp",
16
16
  reason: "'http-cache-semantics', used by the licence checker, which only reads the npm registry locally, with no shared cache to leak from",
@@ -26,75 +26,75 @@ var me = [
26
26
  reason: "'braces', used by ESLint's file matching in dpuse-app, which only reads glob patterns from the project's own config",
27
27
  reviewBy: "2026-12-31"
28
28
  }
29
- ], he = /* @__PURE__ */ new Set(["critical", "high"]);
30
- async function ge() {
29
+ ], ge = /* @__PURE__ */ new Set(["critical", "high"]);
30
+ async function _e() {
31
31
  try {
32
32
  s("Audit Dependencies");
33
- let e = await w("package.json");
34
- ne.has(e.name ?? "") ? T(`1️⃣ Shipped dependencies NOT checked: ${e.name ?? ""} is a development-only tool`) : await o("1️⃣ Check shipped dependencies for any vulnerability", "npm", ["audit", "--omit=dev"]);
33
+ let e = await C("package.json");
34
+ ne.has(e.name ?? "") ? w(`1️⃣ Shipped dependencies NOT checked: ${e.name ?? ""} is a development-only tool`) : await o("1️⃣ Check shipped dependencies for any vulnerability", "npm", ["audit", "--omit=dev"]);
35
35
  let t = await n("2️⃣ Check all dependencies for high or critical vulnerabilities", "npm", ["audit", "--json"]), r = JSON.parse(t);
36
36
  if (r.error !== void 0) throw Error(r.error.summary);
37
- let i = _e(ve(r));
37
+ let i = ve(ye(r));
38
38
  if (i.length > 0) throw Error(`${String(i.length)} high or critical vulnerabilities found`);
39
- S("Dependencies audited");
39
+ x("Dependencies audited");
40
40
  } catch (e) {
41
41
  console.error("❌ Error auditing dependencies", e), process.exit(1);
42
42
  }
43
43
  }
44
- function _e(e) {
44
+ function ve(e) {
45
45
  let t = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), n = [];
46
46
  for (let r of e) {
47
- if (!he.has(r.severity)) continue;
48
- let e = r.url.slice(r.url.lastIndexOf("/") + 1), i = me.find((t) => t.id === e);
47
+ if (!ge.has(r.severity)) continue;
48
+ let e = r.url.slice(r.url.lastIndexOf("/") + 1), i = he.find((t) => t.id === e);
49
49
  i === void 0 ? (console.error(`❌ ${r.severity} '${r.name}': ${r.title} (${r.url})`), n.push(r)) : i.reviewBy < t ? console.warn(`⚠️ Ignored ${e}, but its review date ${i.reviewBy} has passed: ${i.reason}`) : console.info(`ℹ️ Ignored ${e}: ${i.reason}`);
50
50
  }
51
51
  return n;
52
52
  }
53
- function ve(e) {
53
+ function ye(e) {
54
54
  let t = /* @__PURE__ */ new Map(), n = Object.values(e.vulnerabilities ?? {});
55
55
  for (let e of n) for (let n of e.via) typeof n != "string" && t.set(n.url, n);
56
56
  return t.values().toArray();
57
57
  }
58
58
  //#endregion
59
59
  //#region src/actions/buildProject.ts
60
- var ye = "build:wasm";
61
- async function be() {
60
+ var be = "build:wasm";
61
+ async function xe() {
62
62
  try {
63
- s("Build Project"), await xe("1️⃣ ", await w("package.json")), S("Project built");
63
+ s("Build Project"), await Se("1️⃣ ", await C("package.json")), x("Project built");
64
64
  } catch (e) {
65
65
  console.error("❌ Error building project", e), process.exit(1);
66
66
  }
67
67
  }
68
- async function xe(e, t) {
69
- t.scripts?.[ye] != null && await o(`${e} Build WebAssembly`, "npm", ["run", ye]), await o(`${e} Bundle project`, "vite", ["build"]);
68
+ async function Se(e, t) {
69
+ t.scripts?.[be] != null && await o(`${e} Build WebAssembly`, "npm", ["run", be]), await o(`${e} Bundle project`, "vite", ["build"]);
70
70
  }
71
71
  //#endregion
72
72
  //#region src/actions/checkConfigFiles.ts
73
- var O = "@dpuse/dpuse-development/prettierrc", Se = "dpuse-development";
74
- async function Ce() {
73
+ var D = "@dpuse/dpuse-development/prettierrc", Ce = "dpuse-development";
74
+ async function we() {
75
75
  try {
76
- s("Check configuration files"), T("1️⃣ Check individual files");
77
- let t = await w("config.json"), n = await w("package.json"), r = n.private === !0, i = m(t.id), a = D.dirname(le(import.meta.url));
78
- await k(a, ".editorconfig"), await k(a, ".gitattributes"), await k(a, ".gitignore", [".gitignore_default"]), await k(a, ".markdownlint.json"), await k(a, ".ncurc.json"), await we(i, a), await k(a, "LICENSE"), await Ee(i, a), await De(i, a), await Oe(i, a), await je(i, a), Te(i, n);
76
+ s("Check configuration files"), w("1️⃣ Check individual files");
77
+ let t = await C("config.json"), n = await C("package.json"), r = n.private === !0, i = m(t.id), a = E.dirname(ue(import.meta.url));
78
+ await O(a, ".editorconfig"), await O(a, ".gitattributes"), await O(a, ".gitignore", [".gitignore_default"]), await O(a, ".markdownlint.json"), await O(a, ".ncurc.json"), await Te(i, a), await O(a, "LICENSE"), await De(i, a), await Oe(i, a), await ke(i, a), await Me(i, a), Ee(i, n);
79
79
  let o = await e(v) !== null;
80
- o && await k(a, "rust-toolchain.toml"), await k(a, ".github/dependabot.yml", [`.github/dependabot${r ? ".private" : ""}${o ? ".rust" : ""}.yml`]), r ? await ke(a) : (await Ae(a), await k(a, "SECURITY.md", [], (e) => e.replaceAll(Se, () => t.id))), S("Configuration files checked");
80
+ o && await O(a, "rust-toolchain.toml"), await O(a, ".github/dependabot.yml", [`.github/dependabot${r ? ".private" : ""}${o ? ".rust" : ""}.yml`]), r ? await Ae(a) : (await je(a), await O(a, "SECURITY.md", [], (e) => e.replaceAll(Ce, () => t.id))), x("Configuration files checked");
81
81
  } catch (e) {
82
82
  console.error("❌ Error checking configuration files", e), process.exit(1);
83
83
  }
84
84
  }
85
- async function we(e, t) {
85
+ async function Te(e, t) {
86
86
  ["github"].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is NOT required by this project") : [
87
87
  "app",
88
88
  "api",
89
89
  "development",
90
90
  "eslint",
91
91
  "kb"
92
- ].includes(e.typeId) ? console.info("⚠️ File 'eslint.config.js' is UNIQUE to this project") : await k(t, "eslint.config.js", ["eslint.config.default.js"]);
92
+ ].includes(e.typeId) ? console.info("⚠️ File 'eslint.config.js' is UNIQUE to this project") : await O(t, "eslint.config.js", ["eslint.config.default.js"]);
93
93
  }
94
- function Te(e, t) {
95
- e.typeId === "development" ? console.info("ℹ️ File '.prettierrc.json' is the template") : e.typeId === "app" ? console.info("⚠️ File '.prettierrc.json' is UNIQUE to this project") : t.prettier === O ? console.info(`ℹ️ Prettier configuration is '${O}'`) : console.info(`❌ Prettier configuration is NOT '${O}'`);
94
+ function Ee(e, t) {
95
+ e.typeId === "development" ? console.info("ℹ️ File '.prettierrc.json' is the template") : e.typeId === "app" ? console.info("⚠️ File '.prettierrc.json' is UNIQUE to this project") : t.prettier === D ? console.info(`ℹ️ Prettier configuration is '${D}'`) : console.info(`❌ Prettier configuration is NOT '${D}'`);
96
96
  }
97
- async function Ee(e, t) {
97
+ async function De(e, t) {
98
98
  ["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.json' is NOT required by this project") : [
99
99
  "connector",
100
100
  "cookbook",
@@ -103,12 +103,12 @@ async function Ee(e, t) {
103
103
  "presenter",
104
104
  "shared",
105
105
  "tool"
106
- ].includes(e.typeId) ? await k(t, "tsconfig.json") : console.info("⚠️ File 'tsconfig.json' is UNIQUE to this project");
107
- }
108
- async function De(e, t) {
109
- ["github"].includes(e.typeId) ? console.info("ℹ️ File 'scripts/tsconfig.json' is NOT required by this project") : await k(t, "scripts/tsconfig.json");
106
+ ].includes(e.typeId) ? await O(t, "tsconfig.json") : console.info("⚠️ File 'tsconfig.json' is UNIQUE to this project");
110
107
  }
111
108
  async function Oe(e, t) {
109
+ ["github"].includes(e.typeId) ? console.info("ℹ️ File 'scripts/tsconfig.json' is NOT required by this project") : await O(t, "scripts/tsconfig.json");
110
+ }
111
+ async function ke(e, t) {
112
112
  if ([
113
113
  "eslint",
114
114
  "github",
@@ -131,26 +131,26 @@ async function Oe(e, t) {
131
131
  break;
132
132
  default: n = ["vite.config.default.ts"];
133
133
  }
134
- await k(t, "vite.config.ts", n);
134
+ await O(t, "vite.config.ts", n);
135
135
  }
136
136
  }
137
- async function ke(t) {
138
- for (let n of [".github/workflows/ci.yml", ".github/workflows/publish.yml"]) await e(n) !== null && await k(t, n);
137
+ async function Ae(t) {
138
+ for (let n of [".github/workflows/ci.yml", ".github/workflows/publish.yml"]) await e(n) !== null && await O(t, n);
139
139
  console.info("ℹ️ CodeQL and Scorecard workflows and file 'SECURITY.md' are NOT required by this project");
140
140
  }
141
- async function Ae(e) {
142
- await k(e, ".github/workflows/ci.yml"), await k(e, ".github/workflows/codeql.yml"), await k(e, ".github/workflows/publish.yml"), await k(e, ".github/workflows/scorecard.yml");
141
+ async function je(e) {
142
+ await O(e, ".github/workflows/ci.yml"), await O(e, ".github/workflows/codeql.yml"), await O(e, ".github/workflows/publish.yml"), await O(e, ".github/workflows/scorecard.yml");
143
143
  }
144
- async function je(e, t) {
144
+ async function Me(e, t) {
145
145
  [
146
146
  "app",
147
147
  "api",
148
148
  "github",
149
149
  "kb"
150
- ].includes(e.typeId) ? console.info("ℹ️ File 'vitest.config.ts' is NOT required by this project") : await k(t, "vitest.config.ts");
150
+ ].includes(e.typeId) ? console.info("ℹ️ File 'vitest.config.ts' is NOT required by this project") : await O(t, "vitest.config.ts");
151
151
  }
152
- async function k(e, t, n = [], r = (e) => e) {
153
- let i = D.resolve(process.cwd(), t), o = n.length > 0 ? n : [t], s;
152
+ async function O(e, t, n = [], r = (e) => e) {
153
+ let i = E.resolve(process.cwd(), t), o = n.length > 0 ? n : [t], s;
154
154
  try {
155
155
  s = await a(i);
156
156
  } catch (e) {
@@ -161,7 +161,7 @@ async function k(e, t, n = [], r = (e) => e) {
161
161
  return;
162
162
  }
163
163
  for (let n of o) {
164
- let i = D.resolve(e, `../${n}`), o = r(await a(i));
164
+ let i = E.resolve(e, `../${n}`), o = r(await a(i));
165
165
  if (s === o) {
166
166
  console.info(`ℹ️ File '${t}' is the same as '${n}'`);
167
167
  return;
@@ -171,16 +171,16 @@ async function k(e, t, n = [], r = (e) => e) {
171
171
  }
172
172
  //#endregion
173
173
  //#region src/actions/checkDependencies.ts
174
- async function Me() {
174
+ async function Ne() {
175
175
  try {
176
- s("Check Dependencies"), await o("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), T("2️⃣ Check using 'npm-check-updates'");
176
+ s("Check Dependencies"), await o("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), w("2️⃣ Check using 'npm-check-updates'");
177
177
  let e = {};
178
178
  try {
179
- e = await w(D.resolve(process.cwd(), ".ncurc.json"));
179
+ e = await C(E.resolve(process.cwd(), ".ncurc.json"));
180
180
  } catch (e) {
181
181
  if (e.code !== "ENOENT") throw e;
182
182
  }
183
- await ue({
183
+ await de({
184
184
  interactive: !0,
185
185
  upgrade: !0,
186
186
  dep: "dev,prod,peer,optional",
@@ -198,12 +198,12 @@ async function Me() {
198
198
  "--no-strict-allow-scripts",
199
199
  "--no-fund"
200
200
  ], !0);
201
- let t = await Ne();
201
+ let t = await Pe();
202
202
  t.length > 0 ? await o("5️⃣ Move install-script pins to installed versions", "npm", [
203
203
  "install-scripts",
204
204
  "approve",
205
205
  ...t
206
- ]) : T("5️⃣ No pinned install-script approvals to move"), process.platform === "darwin" ? await o("6️⃣ Remove unused install-script entries", "npm", ["install-scripts", "prune"]) : T("6️⃣ Skipped removing unused install-script entries (macOS only)"), t.length > 0 && await o("7️⃣ Run install scripts skipped in steps 3 and 4", "npm", [
206
+ ]) : w("5️⃣ No pinned install-script approvals to move"), process.platform === "darwin" ? await o("6️⃣ Remove unused install-script entries", "npm", ["install-scripts", "prune"]) : w("6️⃣ Skipped removing unused install-script entries (macOS only)"), t.length > 0 && await o("7️⃣ Run install scripts skipped in steps 3 and 4", "npm", [
207
207
  "rebuild",
208
208
  ...t,
209
209
  "--no-strict-allow-scripts"
@@ -212,61 +212,61 @@ async function Me() {
212
212
  "--strict-allow-scripts",
213
213
  "--no-audit",
214
214
  "--no-fund"
215
- ]), S("Dependencies checked");
215
+ ]), x("Dependencies checked");
216
216
  } catch (e) {
217
217
  console.error("❌ Error checking dependencies", e), process.exit(1);
218
218
  }
219
219
  }
220
- async function Ne() {
221
- let { allowScripts: e = {} } = await w(D.resolve(process.cwd(), "package.json")), t = Object.entries(e).filter(([e, t]) => t && e.lastIndexOf("@") > 0).map(([e]) => e.slice(0, e.lastIndexOf("@")));
220
+ async function Pe() {
221
+ let { allowScripts: e = {} } = await C(E.resolve(process.cwd(), "package.json")), t = Object.entries(e).filter(([e, t]) => t && e.lastIndexOf("@") > 0).map(([e]) => e.slice(0, e.lastIndexOf("@")));
222
222
  return [...new Set(t)];
223
223
  }
224
224
  //#endregion
225
225
  //#region src/actions/checkProject.ts
226
- async function Pe() {
227
- await Ce(), await Me();
226
+ async function Fe() {
227
+ await we(), await Ne();
228
228
  }
229
229
  //#endregion
230
230
  //#region src/actions/documentActions.ts
231
- var Fe = "<!-- SUPPORTED_ACTIONS_START -->", Ie = "<!-- SUPPORTED_ACTIONS_END -->", Le = "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.", Re = {
231
+ var Ie = "<!-- SUPPORTED_ACTIONS_START -->", Le = "<!-- SUPPORTED_ACTIONS_END -->", Re = "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.", ze = {
232
232
  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.",
233
233
  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.",
234
234
  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.",
235
235
  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."
236
- }, ze = "The table below lists all connector actions and highlights those supported by this connector.";
237
- async function Be() {
236
+ }, Be = "The table below lists all connector actions and highlights those supported by this connector.";
237
+ async function Ve() {
238
238
  try {
239
- s("Document Actions"), T("1️⃣ Insert actions description and table into 'README.md'");
240
- let e = (await w("config.json")).actionNames ?? [], t = g(e), n = r(e), i = `## Supported Actions\n\n${Le}\n\n${Re[t]} ${ze}\n\n${n}`;
241
- await _(i, Fe, Ie), S("Actions documented");
239
+ s("Document Actions"), w("1️⃣ Insert actions description and table into 'README.md'");
240
+ let e = (await C("config.json")).actionNames ?? [], t = g(e), n = r(e), i = `## Supported Actions\n\n${Re}\n\n${ze[t]} ${Be}\n\n${n}`;
241
+ await _(i, Ie, Le), x("Actions documented");
242
242
  } catch (e) {
243
243
  console.error("❌ Error documenting actions", e), process.exit(1);
244
244
  }
245
245
  }
246
246
  //#endregion
247
247
  //#region src/actions/documentContributingLicense.ts
248
- async function Ve() {
248
+ async function He() {
249
249
  try {
250
250
  s("Document Contributing & License");
251
- let [e, t] = await Promise.all([w("package.json"), w("config.json")]), { owner: n, repository: r } = C(e, "document contributing and license"), i = He(e), a = Ue(t.firstCreatedAt);
252
- T("1️⃣ Insert contributing and license content into 'README.md'"), await l(), await _(We(n, r, i, a), ee, ie), S("Contributing & license documented");
251
+ let [e, t] = await Promise.all([C("package.json"), C("config.json")]), { owner: n, repository: r } = S(e, "document contributing and license"), i = Ue(e), a = We(t.firstCreatedAt);
252
+ w("1️⃣ Insert contributing and license content into 'README.md'"), await l(), await _(Ge(n, r, i, a), ee, ie), x("Contributing & license documented");
253
253
  } catch (e) {
254
254
  console.error("❌ Error documenting contributing and license", e), process.exit(1);
255
255
  }
256
256
  }
257
- function He(e) {
257
+ function Ue(e) {
258
258
  let t = e.author, n = typeof t == "string" ? t : t?.name;
259
259
  if (n == null || n === "") throw Error("package.json 'author' field is required to document contributing and license.");
260
260
  let r = n.indexOf("<"), i = r === -1 ? -1 : n.indexOf(">", r);
261
261
  return i === -1 ? n.trim() : [n.slice(0, r).trim(), n.slice(i + 1).trim()].filter((e) => e !== "").join(" ");
262
262
  }
263
- function Ue(e) {
263
+ function We(e) {
264
264
  let t = (/* @__PURE__ */ new Date()).getFullYear();
265
265
  if (e == null) return String(t);
266
266
  let n = new Date(e).getFullYear();
267
267
  return n === t ? String(t) : `${String(n)}-present`;
268
268
  }
269
- function We(e, t, n, r) {
269
+ function Ge(e, t, n, r) {
270
270
  return `## Contributing
271
271
 
272
272
  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.
@@ -281,8 +281,8 @@ This project is licensed under the MIT License, permitting free use, modificatio
281
281
  }
282
282
  //#endregion
283
283
  //#region src/utilities/rustCrates.ts
284
- var A = "licenses/cargoMetadata.json", j = "licenses/cargoTree.txt", Ge = 1e3, Ke = 1e4, qe = "dpuse-development (https://github.com/dpuse/dpuse-development)", Je = /^(?:copying|licen[cs]e|unlicense)/i, Ye = "wasm32-unknown-unknown";
285
- async function Xe(n, r) {
284
+ var k = "licenses/cargoMetadata.json", A = "licenses/cargoTree.txt", Ke = 1e3, qe = 1e4, Je = "dpuse-development (https://github.com/dpuse/dpuse-development)", Ye = /^(?:copying|licen[cs]e|unlicense)/i, Xe = "wasm32-unknown-unknown";
285
+ async function Ze(n, r) {
286
286
  if (await e("rust/Cargo.toml") === null) return null;
287
287
  let i = [
288
288
  "--manifest-path",
@@ -295,22 +295,22 @@ async function Xe(n, r) {
295
295
  "--edges",
296
296
  "normal,no-proc-macro",
297
297
  "--target",
298
- Ye,
298
+ Xe,
299
299
  "--prefix",
300
300
  "depth",
301
301
  "--format",
302
302
  "{p}|{l}|{r}"
303
303
  ];
304
- await t(n, "cargo", o, j), await t(n, "cargo", [
304
+ await t(n, "cargo", o, A), await t(n, "cargo", [
305
305
  "metadata",
306
306
  ...i,
307
307
  "--format-version",
308
308
  "1",
309
309
  "--filter-platform",
310
- Ye
311
- ], A);
312
- let s = Ze(await a(j)), c = await w(A);
313
- await E.rm(j, { force: !0 }), await E.rm(A, { force: !0 });
310
+ Xe
311
+ ], k);
312
+ let s = Qe(await a(A)), c = await C(k);
313
+ await T.rm(A, { force: !0 }), await T.rm(k, { force: !0 });
314
314
  let l = /* @__PURE__ */ new Map();
315
315
  for (let e of s) e.isOwn || l.has(`${e.name}@${e.version}`) || l.set(`${e.name}@${e.version}`, {
316
316
  name: e.name,
@@ -323,9 +323,9 @@ async function Xe(n, r) {
323
323
  latestPublishedDate: ""
324
324
  });
325
325
  let u = l.values().toArray();
326
- Qe(u, r);
327
- for (let e of u) e.licenseFiles = await tt(e, c);
328
- return await nt(n, u), {
326
+ $e(u, r);
327
+ for (let e of u) e.licenseFiles = await nt(e, c);
328
+ return await rt(n, u), {
329
329
  crates: u,
330
330
  treeItems: s.map(({ name: e, version: t, depth: n, isOwn: r }) => ({
331
331
  name: e,
@@ -335,7 +335,7 @@ async function Xe(n, r) {
335
335
  }))
336
336
  };
337
337
  }
338
- function Ze(e) {
338
+ function Qe(e) {
339
339
  let t = [];
340
340
  for (let n of e.split("\n")) {
341
341
  let [e = "", r = "", i = ""] = n.trim().split("|", 3), a = /^\d+/.exec(e)?.[0];
@@ -352,49 +352,49 @@ function Ze(e) {
352
352
  }
353
353
  return t;
354
354
  }
355
- function Qe(e, t) {
356
- let n = t.split(";").filter((e) => $e(e)), r = e.filter((e) => !et(e.licenseExpression, n));
355
+ function $e(e, t) {
356
+ let n = t.split(";").filter((e) => et(e)), r = e.filter((e) => !tt(e.licenseExpression, n));
357
357
  if (r.length === 0) return;
358
358
  let i = r.map((e) => `${e.name}@${e.version} (${e.licenseExpression === "" ? "no licence" : e.licenseExpression})`).join(", ");
359
359
  throw Error(`Rust crates with licences not allowed: ${i}.`);
360
360
  }
361
- function $e(e) {
361
+ function et(e) {
362
362
  try {
363
- return pe(e, [e]);
363
+ return me(e, [e]);
364
364
  } catch {
365
365
  return !1;
366
366
  }
367
367
  }
368
- function et(e, t) {
368
+ function tt(e, t) {
369
369
  try {
370
- return pe(e.replaceAll("/", " OR "), t);
370
+ return me(e.replaceAll("/", " OR "), t);
371
371
  } catch {
372
372
  return !1;
373
373
  }
374
374
  }
375
- async function tt(e, t) {
375
+ async function nt(e, t) {
376
376
  let n = t.packages.find((t) => t.name === e.name && t.version === e.version);
377
377
  if (n == null) return [];
378
- let r = D.dirname(n.manifest_path), i = (await E.readdir(r)).filter((e) => Je.test(e)).toSorted((e, t) => e.localeCompare(t, "en"));
379
- await E.mkdir("licenses/downloads", { recursive: !0 });
378
+ let r = E.dirname(n.manifest_path), i = (await T.readdir(r)).filter((e) => Ye.test(e)).toSorted((e, t) => e.localeCompare(t, "en"));
379
+ await T.mkdir("licenses/downloads", { recursive: !0 });
380
380
  let a = [];
381
381
  for (let t of i) {
382
382
  let n = `downloads/${e.name}@${e.version}-${t}`;
383
- await E.copyFile(D.join(r, t), D.join("licenses", n)), a.push({
383
+ await T.copyFile(E.join(r, t), E.join("licenses", n)), a.push({
384
384
  label: t,
385
385
  path: n
386
386
  });
387
387
  }
388
388
  return a;
389
389
  }
390
- async function nt(e, t) {
391
- T(`${e} - fetch release dates from crates.io`);
390
+ async function rt(e, t) {
391
+ w(`${e} - fetch release dates from crates.io`);
392
392
  for (let [e, n] of t.entries()) {
393
- e > 0 && await fe(Ge), console.info(`⚙️ Fetching '${n.name}' (${String(e + 1)} of ${String(t.length)})...`);
393
+ e > 0 && await pe(Ke), console.info(`⚙️ Fetching '${n.name}' (${String(e + 1)} of ${String(t.length)})...`);
394
394
  try {
395
395
  let e = await fetch(`https://crates.io/api/v1/crates/${encodeURIComponent(n.name)}`, {
396
- headers: { "User-Agent": qe },
397
- signal: AbortSignal.timeout(Ke)
396
+ headers: { "User-Agent": Je },
397
+ signal: AbortSignal.timeout(qe)
398
398
  });
399
399
  if (!e.ok) continue;
400
400
  let t = await e.json(), r = new Map((t.versions ?? []).map((e) => [e.num, e.created_at]));
@@ -404,77 +404,77 @@ async function nt(e, t) {
404
404
  }
405
405
  //#endregion
406
406
  //#region src/actions/documentDependencies.ts
407
- var M = "<!-- DEPENDENCY_LICENSES_START -->", N = "<!-- DEPENDENCY_LICENSES_END -->", P = "## Dependency Licenses", rt = `bundle-analysis-reports/${ae}`, F = "licenses/licenseTree.json", it = "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.", at = `The dependency tree below lists every package in this project — direct and transitive — along with its installed version, release date, and update status. ${it}`, ot = `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. ${it}`;
408
- async function st(e = "MIT") {
407
+ var j = "<!-- DEPENDENCY_LICENSES_START -->", M = "<!-- DEPENDENCY_LICENSES_END -->", N = "## Dependency Licenses", it = `bundle-analysis-reports/${oe}`, P = "licenses/licenseTree.json", at = "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.", ot = `The dependency tree below lists every package in this project — direct and transitive — along with its installed version, release date, and update status. ${at}`, st = `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. ${at}`;
408
+ async function ct(e = "MIT") {
409
409
  try {
410
410
  s("Document Dependencies");
411
- let n = await w("package.json"), r = n.name ?? "";
411
+ let n = await C("package.json"), r = n.name ?? "";
412
412
  if (ne.has(r)) {
413
- await ct(r), S("Dependencies documented");
413
+ await lt(r), x("Dependencies documented");
414
414
  return;
415
415
  }
416
416
  await f("1️⃣ Clear downloaded licenses", "licenses/downloads");
417
- let i = await _t(), a = await vt();
417
+ let i = await vt(), a = await yt();
418
418
  if (a === null) {
419
- let r = St(i);
420
- await gt("2️⃣ Identify production licenses", e, [n.name ?? "", ...r], !0), await t("3️⃣ Identify transitive dependencies", "npm", [
419
+ let r = Ct(i);
420
+ await _t("2️⃣ Identify production licenses", e, [n.name ?? "", ...r], !0), await t("3️⃣ Identify transitive dependencies", "npm", [
421
421
  "ls",
422
422
  "--all",
423
423
  "--json",
424
424
  "--omit=dev"
425
- ], F), await lt("4️⃣ ", e, new Set(r));
425
+ ], P), await ut("4️⃣ ", e, new Set(r));
426
426
  } else {
427
- let r = yt(a, i), o = bt(i), s = o.filter((e) => !r.has(e));
428
- await gt("2️⃣ Identify shipped licenses", e, [n.name ?? "", ...s], !1), xt(r, new Set(o)), await t("3️⃣ Identify transitive dependencies", "npm", [
427
+ let r = bt(a, i), o = xt(i), s = o.filter((e) => !r.has(e));
428
+ await _t("2️⃣ Identify shipped licenses", e, [n.name ?? "", ...s], !1), St(r, new Set(o)), await t("3️⃣ Identify transitive dependencies", "npm", [
429
429
  "ls",
430
430
  "--all",
431
431
  "--json"
432
- ], F, !0);
433
- let c = await Xe("4️⃣ Identify Rust crates compiled into the WebAssembly", e), l = {
432
+ ], P, !0);
433
+ let c = await Ze("4️⃣ Identify Rust crates compiled into the WebAssembly", e), l = {
434
434
  allowedLicenses: e,
435
- productionNames: mt(n),
435
+ productionNames: ht(n),
436
436
  rustCrates: c,
437
437
  shippedKeys: r
438
438
  };
439
- await ut(c === null ? "4️⃣ " : "5️⃣ ", l);
439
+ await dt(c === null ? "4️⃣ " : "5️⃣ ", l);
440
440
  }
441
- S("Dependencies documented");
441
+ x("Dependencies documented");
442
442
  } catch (e) {
443
443
  console.error("❌ Error documenting dependencies", e), process.exit(1);
444
444
  }
445
445
  }
446
- async function ct(e) {
447
- T(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`);
446
+ async function lt(e) {
447
+ w(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`);
448
448
  let t = `> [!WARNING]\n> Dependency licenses are not documented here: ${e} is a development-only tool and is never part of a production release.`;
449
- await _(`${P}\n\n${t}`, M, N);
449
+ await _(`${N}\n\n${t}`, j, M);
450
450
  }
451
- async function lt(e, t, n) {
452
- T(`${e} Insert licenses into 'README.md'`);
453
- let r = await w(F), i = await ht(), a = `${z(t, !1)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
454
- for (let e of i.values()) a += B(e);
451
+ async function ut(e, t, n) {
452
+ w(`${e} Insert licenses into 'README.md'`);
453
+ let r = await C(P), i = await gt(), a = `${Dt(t, !1)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
454
+ for (let e of i.values()) a += I(e);
455
455
  let o = [];
456
- r.dependencies != null && Dt(r.dependencies, i, n, o, 0);
457
- let s = `${at}\n\n${o.join("\n")}`;
458
- await _(`${P}\n\n${a.trimEnd()}\n\n### Dependency Tree\n\n${s}`, M, N);
459
- }
460
- async function ut(e, t) {
461
- T(`${e} Insert licenses into 'README.md'`);
462
- let { allowedLicenses: n, productionNames: r, rustCrates: i, shippedKeys: a } = t, o = await ht(), s = new Map((i?.crates ?? []).map((e) => [`${e.name}@${e.version}`, ft(e)])), c = i !== null, l = c ? "|Type|Dependency|Version|License(s)|Document|\n|:-|:-|:-:|:-|:-|" : "|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|", u = `${z(n, !0, c)}\n\n${l}\n`;
463
- for (let e of o.values().toArray().toSorted(dt)) u += B(e, c ? "JavaScript" : void 0);
464
- for (let e of s.values().toArray().toSorted(dt)) u += B(e, "Rust");
465
- let d = await w(F), f = Object.entries(d.dependencies ?? {}).toSorted(([e], [t]) => Number(!r.has(e)) - Number(!r.has(t))), p = [];
466
- V(f, {
456
+ r.dependencies != null && jt(r.dependencies, i, n, o, 0);
457
+ let s = `${ot}\n\n${o.join("\n")}`;
458
+ await _(`${N}\n\n${a.trimEnd()}\n\n### Dependency Tree\n\n${s}`, j, M);
459
+ }
460
+ async function dt(e, t) {
461
+ w(`${e} Insert licenses into 'README.md'`);
462
+ let { allowedLicenses: n, productionNames: r, rustCrates: i, shippedKeys: a } = t, o = await gt(), s = new Map((i?.crates ?? []).map((e) => [`${e.name}@${e.version}`, pt(e)])), c = i !== null, l = c ? "|Type|Dependency|Version|License(s)|Document|\n|:-|:-|:-:|:-|:-|" : "|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|", u = `${Dt(n, !0, c)}\n\n${l}\n`;
463
+ for (let e of o.values().toArray().toSorted(ft)) u += I(e, c ? "JavaScript" : void 0);
464
+ for (let e of s.values().toArray().toSorted(ft)) u += I(e, "Rust");
465
+ let d = await C(P), f = Object.entries(d.dependencies ?? {}).toSorted(([e], [t]) => Number(!r.has(e)) - Number(!r.has(t))), p = [];
466
+ L(f, {
467
467
  licensesByKey: o,
468
468
  shippedKeys: a,
469
469
  shownKeys: /* @__PURE__ */ new Set()
470
470
  }, p, 0, !1);
471
- let m = p.length === 0 ? "None." : p.join("\n"), h = (i?.treeItems ?? []).map((e) => pt(e, s)).join("\n"), g = c ? `${ot}\n\n#### JavaScript\n\n${m}\n\n#### Rust\n\n${h}` : `${ot}\n\n${m}`;
472
- await _(`${P}\n\n${u.trimEnd()}\n\n### Dependency Tree\n\n${g}`, M, N);
471
+ let m = p.length === 0 ? "None." : p.join("\n"), h = (i?.treeItems ?? []).map((e) => mt(e, s)).join("\n"), g = c ? `${st}\n\n#### JavaScript\n\n${m}\n\n#### Rust\n\n${h}` : `${st}\n\n${m}`;
472
+ await _(`${N}\n\n${u.trimEnd()}\n\n### Dependency Tree\n\n${g}`, j, M);
473
473
  }
474
- function dt(e, t) {
474
+ function ft(e, t) {
475
475
  return e.name.localeCompare(t.name, "en") || e.installedVersion.localeCompare(t.installedVersion, "en");
476
476
  }
477
- function ft(e) {
477
+ function pt(e) {
478
478
  return {
479
479
  name: e.name,
480
480
  repository: e.repository,
@@ -487,27 +487,27 @@ function ft(e) {
487
487
  licenseFiles: e.licenseFiles
488
488
  };
489
489
  }
490
- function pt(e, t) {
490
+ function mt(e, t) {
491
491
  let n = " ".repeat(e.depth);
492
- return e.isOwn ? `${n}- **${e.name}** ${e.version} — this project's Rust code, compiled into its WebAssembly` : H(e.name, e.version, t.get(`${e.name}@${e.version}`), n);
492
+ 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);
493
493
  }
494
- function mt(e) {
494
+ function ht(e) {
495
495
  return /* @__PURE__ */ new Set([
496
496
  ...Object.keys(e.dependencies ?? {}),
497
497
  ...Object.keys(e.optionalDependencies ?? {}),
498
498
  ...Object.keys(e.peerDependencies ?? {})
499
499
  ]);
500
500
  }
501
- async function ht() {
502
- let e = await w("licenses/licenses.json"), t = /* @__PURE__ */ new Map();
503
- for (let [n, r] of Object.entries(e)) t.set(n, Tt(n, r));
501
+ async function gt() {
502
+ let e = await C("licenses/licenses.json"), t = /* @__PURE__ */ new Map();
503
+ for (let [n, r] of Object.entries(e)) t.set(n, kt(n, r));
504
504
  return await Promise.all(t.values().map(async (e) => {
505
- let t = await Et(e.name, e.installedVersion);
505
+ let t = await At(e.name, e.installedVersion);
506
506
  e.latestVersion = t.latestVersion, e.latestPublishedDate = t.latestPublishedDate, e.publishedDate = t.publishedDate;
507
507
  })), t;
508
508
  }
509
- async function gt(e, t, n, r) {
510
- T(e), await new Promise((e, i) => {
509
+ async function _t(e, t, n, r) {
510
+ w(e), await new Promise((e, i) => {
511
511
  let a = {
512
512
  start: process.cwd(),
513
513
  production: r,
@@ -519,63 +519,63 @@ async function gt(e, t, n, r) {
519
519
  excludePackages: n.join(";"),
520
520
  out: "licenses/licenses.json"
521
521
  };
522
- de(a, (t) => {
522
+ fe(a, (t) => {
523
523
  t == null ? e() : i(t);
524
524
  });
525
525
  });
526
526
  }
527
- async function _t() {
527
+ async function vt() {
528
528
  let t = await e("package-lock.json");
529
529
  return t === null ? {} : JSON.parse(t).packages ?? {};
530
530
  }
531
- async function vt() {
532
- let t = await e(rt);
531
+ async function yt() {
532
+ let t = await e(it);
533
533
  return t === null ? null : JSON.parse(t);
534
534
  }
535
- function yt(e, t) {
535
+ function bt(e, t) {
536
536
  let n = new Set(e.packages);
537
537
  for (let r of e.external) {
538
- let e = R(t, "", r);
539
- if (e !== void 0) for (let r of [e, ...L(t, e)]) {
538
+ let e = Et(t, "", r);
539
+ if (e !== void 0) for (let r of [e, ...wt(t, e)]) {
540
540
  let e = t[r];
541
- e?.version !== void 0 && n.add(I(r, e));
541
+ e?.version !== void 0 && n.add(F(r, e));
542
542
  }
543
543
  }
544
544
  return n;
545
545
  }
546
- function bt(e) {
546
+ function xt(e) {
547
547
  let t = /* @__PURE__ */ new Set();
548
- for (let [n, r] of Object.entries(e)) n !== "" && r.version !== void 0 && t.add(I(n, r));
548
+ for (let [n, r] of Object.entries(e)) n !== "" && r.version !== void 0 && t.add(F(n, r));
549
549
  return [...t];
550
550
  }
551
- function xt(e, t) {
551
+ function St(e, t) {
552
552
  let n = [...e.difference(t)];
553
553
  n.length > 0 && console.warn(`⚠️ Not installed, so not checked; rebuild to refresh the record: ${n.join(", ")}`);
554
554
  }
555
- function I(e, t) {
555
+ function F(e, t) {
556
556
  return `${t.name ?? e.slice(e.lastIndexOf("node_modules/") + 13)}@${String(t.version)}`;
557
557
  }
558
- function St(e) {
559
- let t = L(e, ""), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
558
+ function Ct(e) {
559
+ let t = wt(e, ""), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
560
560
  for (let [i, a] of Object.entries(e)) {
561
561
  if (i === "" || a.version === void 0) continue;
562
- let e = I(i, a);
562
+ let e = F(i, a);
563
563
  t.has(i) ? n.add(e) : r.add(e);
564
564
  }
565
565
  return r.values().filter((e) => !n.has(e)).toArray();
566
566
  }
567
- function L(e, t) {
567
+ function wt(e, t) {
568
568
  let n = /* @__PURE__ */ new Set(), r = [t];
569
569
  for (; r.length > 0;) {
570
570
  let t = r.pop() ?? "", i = e[t];
571
- if (i !== void 0) for (let a of Ct(i)) {
572
- let i = R(e, t, a);
571
+ if (i !== void 0) for (let a of Tt(i)) {
572
+ let i = Et(e, t, a);
573
573
  i === void 0 || n.has(i) || (n.add(i), r.push(i));
574
574
  }
575
575
  }
576
576
  return n;
577
577
  }
578
- function Ct(e) {
578
+ function Tt(e) {
579
579
  let t = Object.keys(e.peerDependencies ?? {}).filter((t) => e.peerDependenciesMeta?.[t]?.optional !== !0);
580
580
  return [
581
581
  ...Object.keys(e.dependencies ?? {}),
@@ -583,7 +583,7 @@ function Ct(e) {
583
583
  ...t
584
584
  ];
585
585
  }
586
- function R(e, t, n) {
586
+ function Et(e, t, n) {
587
587
  let r = t;
588
588
  for (;;) {
589
589
  let t = r === "" ? `node_modules/${n}` : `${r}/node_modules/${n}`, i = e[t];
@@ -593,14 +593,14 @@ function R(e, t, n) {
593
593
  r = a === -1 ? "" : r.slice(0, a);
594
594
  }
595
595
  }
596
- function z(e, t, n = !1) {
597
- let r = wt(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.";
596
+ function Dt(e, t, n = !1) {
597
+ let r = Ot(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.";
598
598
  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.`;
599
599
  }
600
- function wt(e) {
600
+ function Ot(e) {
601
601
  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))}`;
602
602
  }
603
- function Tt(e, t) {
603
+ function kt(e, t) {
604
604
  let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
605
605
  return {
606
606
  name: r,
@@ -617,7 +617,7 @@ function Tt(e, t) {
617
617
  }]
618
618
  };
619
619
  }
620
- async function Et(e, t) {
620
+ async function At(e, t) {
621
621
  try {
622
622
  let n = await fetch(`https://registry.npmjs.org/${encodeURIComponent(e)}`);
623
623
  if (n.ok) {
@@ -635,40 +635,40 @@ async function Et(e, t) {
635
635
  publishedDate: ""
636
636
  };
637
637
  }
638
- function B(e, t) {
638
+ function I(e, t) {
639
639
  let n = e.licenseFiles.length === 0 ? "⚠️ No license file" : e.licenseFiles.map((e) => `[${e.label}](licenses/${e.path})`).join(" ");
640
640
  return `${t === void 0 ? "" : `|${t}`}|[${e.name}](${e.repository})|${e.installedVersion}|${e.licenseTypes}|${n}|\n`;
641
641
  }
642
- function Dt(e, t, n, r, i) {
642
+ function jt(e, t, n, r, i) {
643
643
  let a = " ".repeat(i);
644
644
  for (let [o, s] of Object.entries(e)) {
645
645
  if (s.version === void 0) continue;
646
646
  let e = s.version;
647
- n.has(`${o}@${e}`) || (r.push(H(o, e, t.get(`${o}@${e}`), a)), s.dependencies != null && Dt(s.dependencies, t, n, r, i + 1));
647
+ n.has(`${o}@${e}`) || (r.push(R(o, e, t.get(`${o}@${e}`), a)), s.dependencies != null && jt(s.dependencies, t, n, r, i + 1));
648
648
  }
649
649
  }
650
- function V(e, t, n, r, i) {
650
+ function L(e, t, n, r, i) {
651
651
  for (let [a, o] of e) {
652
652
  if (o.version === void 0) continue;
653
653
  let e = `${a}@${o.version}`, s = Object.entries(o.dependencies ?? {});
654
654
  if (!t.shippedKeys.has(e)) {
655
- V(s, t, n, r, !0);
655
+ L(s, t, n, r, !0);
656
656
  continue;
657
657
  }
658
- i && t.shownKeys.has(e) || (t.shownKeys.add(e), n.push(H(a, o.version, t.licensesByKey.get(e), " ".repeat(r))), V(s, t, n, r + 1, !1));
658
+ 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));
659
659
  }
660
660
  }
661
- function H(e, t, n, r) {
662
- return `${r}- **${n == null ? e : `[${e}](${n.repository})`}** ${t}${Ot(n)}`;
661
+ function R(e, t, n, r) {
662
+ return `${r}- **${n == null ? e : `[${e}](${n.repository})`}** ${t}${Mt(n)}`;
663
663
  }
664
- function Ot(e) {
664
+ function Mt(e) {
665
665
  if (e == null) return "";
666
- let t = e.publishedDate ? U(e.publishedDate.split("T", 1)[0]) : "";
666
+ let t = e.publishedDate ? z(e.publishedDate.split("T", 1)[0]) : "";
667
667
  if (e.latestVersion === "" || e.latestVersion === e.installedVersion) return t === "" ? "" : ` — ${t}`;
668
- let n = e.latestPublishedDate ? U(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `latest: ${e.latestVersion} ❗` : `latest: ${e.latestVersion} — ${n} ❗`;
668
+ let n = e.latestPublishedDate ? z(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `latest: ${e.latestVersion} ❗` : `latest: ${e.latestVersion} — ${n} ❗`;
669
669
  return t === "" ? ` — → ${r}` : ` — ${t} → ${r}`;
670
670
  }
671
- function U(e) {
671
+ function z(e) {
672
672
  if (e == null || e === "") return "n/a";
673
673
  let t = e.split("T", 1)[0];
674
674
  if (t == null || t === "") return "n/a";
@@ -677,31 +677,31 @@ function U(e) {
677
677
  }
678
678
  //#endregion
679
679
  //#region src/actions/documentOpening.ts
680
- var kt = "<!-- OPENING_START -->", At = "<!-- OPENING_END -->";
681
- async function jt() {
680
+ var Nt = "<!-- OPENING_START -->", Pt = "<!-- OPENING_END -->";
681
+ async function Ft() {
682
682
  try {
683
- s("Document Opening"), T("1️⃣ Insert opening content into 'README.md'");
684
- let e = await w("package.json"), t = await w("config.json"), { owner: n, repository: r } = C(e, "document opening"), i = Mt(e), a = Pt(t), o = m(t.id), c = Ft(n, r, i, o.uploadGroupName === void 0 ? void 0 : t.id, o.publishedTo === "npm" ? Nt(e) : void 0, e.description, a);
685
- await _(c, kt, At), S("Opening documented");
683
+ s("Document Opening"), w("1️⃣ Insert opening content into 'README.md'");
684
+ let e = await C("package.json"), t = await C("config.json"), { owner: n, repository: r } = S(e, "document opening"), i = It(e), a = Rt(t), o = m(t.id), c = zt(n, r, i, o.uploadGroupName === void 0 ? void 0 : t.id, o.publishedTo === "npm" ? Lt(e) : void 0, e.description, a);
685
+ await _(c, Nt, Pt), x("Opening documented");
686
686
  } catch (e) {
687
687
  console.error("❌ Error documenting opening", e), process.exit(1);
688
688
  }
689
689
  }
690
- function Mt(e) {
690
+ function It(e) {
691
691
  let t = e.license;
692
692
  if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
693
693
  return t;
694
694
  }
695
- function Nt(e) {
695
+ function Lt(e) {
696
696
  let t = e.name;
697
697
  if (t == null || t === "") throw Error("package.json 'name' field is required to document opening.");
698
698
  return t;
699
699
  }
700
- function Pt(e) {
700
+ function Rt(e) {
701
701
  let t = e.description.en?.trim();
702
702
  return t === void 0 || t === "" ? void 0 : t;
703
703
  }
704
- function Ft(e, t, n, r, i, a, o) {
704
+ function zt(e, t, n, r, i, a, o) {
705
705
  let s = `https://github.com/${e}/${t}`, c = n.replaceAll("-", "--"), l = encodeURIComponent(`https://api.dpuse.app/configs/${r ?? ""}`);
706
706
  return `[![License: ${n}](https://img.shields.io/badge/License-${c}-blue.svg)](./LICENSE)${r === void 0 ? "" : `\n[![DPUse version](https://img.shields.io/badge/dynamic/json?url=${l}&query=%24.data.version&prefix=v&label=DPUse&color=f6821f)](${s}/releases/latest)`}${i === void 0 ? "" : `\n[![npm version](https://img.shields.io/npm/v/${i}?color=cb3837&label=npm)](https://www.npmjs.com/package/${i})`}
707
707
  [![CI](${s}/actions/workflows/ci.yml/badge.svg)](${s}/actions/workflows/ci.yml)${a == null || a === "" ? "" : `\n\n${a}`}
@@ -722,43 +722,43 @@ In addition, DPUse provides [Tools](https://www.dpuse.app) used by the applicati
722
722
  }
723
723
  //#endregion
724
724
  //#region src/actions/documentQualitySecurity.ts
725
- var It = {
725
+ var Bt = {
726
726
  "Branch-Protection": 3,
727
727
  "Code-Review": 0,
728
728
  Contributors: 0
729
- }, Lt = /* @__PURE__ */ new Set(["CII-Best-Practices"]), Rt = "coverage/coverage-final.json", zt = "coverage/coverage-summary.json", Bt = 80, Vt = 60, Ht = "code-health-reports/vitest/badge.json", Ut = {
729
+ }, Vt = /* @__PURE__ */ new Set(["CII-Best-Practices"]), Ht = "coverage/coverage-final.json", Ut = "coverage/coverage-summary.json", Wt = 80, Gt = 60, Kt = "code-health-reports/vitest/badge.json", qt = {
730
730
  actions: "GitHub Actions",
731
731
  "javascript-typescript": "JavaScript/TypeScript",
732
732
  rust: "Rust"
733
- }, Wt = {
733
+ }, Jt = {
734
734
  A: "brightgreen",
735
735
  B: "green",
736
736
  C: "yellow",
737
737
  D: "orange",
738
738
  F: "red"
739
- }, Gt = `${c}/health.json`, Kt = se(ce);
740
- async function qt() {
739
+ }, Yt = `${c}/health.json`, Xt = ce(le);
740
+ async function Zt() {
741
741
  try {
742
742
  s("Document Quality & Security");
743
- let e = await w("package.json"), t = await Jt(e), n = await Xt(e, t === void 0 ? [] : ["--coverage", Rt]), { owner: r, repository: i } = C(e, "document quality and security");
744
- T("4️⃣ Read security checks and settings");
745
- let a = await Qt(r, i, e);
746
- T("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
747
- let [o, c] = await Promise.all([$t(`https://github.com/${r}/${i}`), en(`github.com/${r}/${i}`)]);
748
- T("6️⃣ Insert quality and security content into 'README.md'");
749
- let d = on(r, i, {
743
+ let e = await C("package.json"), t = await Qt(e), n = await en(e, t === void 0 ? [] : ["--coverage", Ht]), { owner: r, repository: i } = S(e, "document quality and security");
744
+ w("4️⃣ Read security checks and settings");
745
+ let a = await nn(r, i, e);
746
+ w("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
747
+ let [o, c] = await Promise.all([rn(`https://github.com/${r}/${i}`), an(`github.com/${r}/${i}`)]);
748
+ w("6️⃣ Insert quality and security content into 'README.md'");
749
+ let d = un(r, i, {
750
750
  coveragePercent: t,
751
751
  fallowHealth: n,
752
752
  securitySettings: a
753
753
  }, o, c);
754
- await l(), await _(d, u, re), S("Quality & security documented");
754
+ await l(), await _(d, u, re), x("Quality & security documented");
755
755
  } catch (e) {
756
756
  console.error("❌ Error documenting quality and security", e), process.exit(1);
757
757
  }
758
758
  }
759
- async function Jt(t) {
759
+ async function Qt(t) {
760
760
  if (t.devDependencies?.["@vitest/coverage-v8"] == null) {
761
- T("1️⃣ Test coverage NOT measured, as '@vitest/coverage-v8' is not installed");
761
+ w("1️⃣ Test coverage NOT measured, as '@vitest/coverage-v8' is not installed");
762
762
  return;
763
763
  }
764
764
  await o("1️⃣ Measure test coverage", "vitest", [
@@ -766,27 +766,27 @@ async function Jt(t) {
766
766
  "--passWithNoTests",
767
767
  "--coverage"
768
768
  ]);
769
- let n = await e(zt);
769
+ let n = await e(Ut);
770
770
  if (n === null) return;
771
771
  let r = JSON.parse(n).total.lines.pct;
772
- return await Yt(r), r;
772
+ return await $t(r), r;
773
773
  }
774
- async function Yt(e) {
774
+ async function $t(e) {
775
775
  let t = [
776
776
  "red",
777
777
  "yellow",
778
778
  "brightgreen"
779
- ], n = Number(e >= Vt) + Number(e >= Bt);
780
- await i(Ht, {
779
+ ], n = Number(e >= Gt) + Number(e >= Wt);
780
+ await i(Kt, {
781
781
  schemaVersion: 1,
782
782
  label: "coverage",
783
783
  message: `${e.toFixed(1)}%`,
784
784
  color: t[n]
785
785
  });
786
786
  }
787
- async function Xt(e, n) {
787
+ async function en(e, n) {
788
788
  if (e.devDependencies?.fallow == null) {
789
- T("2️⃣ Code health NOT measured, as Fallow is not installed"), T("3️⃣ Code health report NOT required");
789
+ w("2️⃣ Code health NOT measured, as Fallow is not installed"), w("3️⃣ Code health report NOT required");
790
790
  return;
791
791
  }
792
792
  await t("2️⃣ Measure code health", "fallow", [
@@ -795,32 +795,32 @@ async function Xt(e, n) {
795
795
  "--format",
796
796
  "json",
797
797
  ...n
798
- ], Gt), await t("3️⃣ Write code health report", "fallow", ["--format", "markdown"], te, !0);
799
- let r = await w(Gt);
800
- return await Zt(r), r;
798
+ ], Yt), await t("3️⃣ Write code health report", "fallow", ["--format", "markdown"], te, !0);
799
+ let r = await C(Yt);
800
+ return await tn(r), r;
801
801
  }
802
- async function Zt(e) {
802
+ async function tn(e) {
803
803
  let { score: t, grade: n } = e.health_score;
804
804
  await i(h, {
805
805
  schemaVersion: 1,
806
806
  label: "fallow",
807
807
  message: `${n} (${String(Math.round(t))})`,
808
- color: Wt[n] ?? "lightgrey"
808
+ color: Jt[n] ?? "lightgrey"
809
809
  });
810
810
  }
811
- async function Qt(t, n, r) {
811
+ async function nn(t, n, r) {
812
812
  let [i, a, o] = await Promise.all([
813
813
  e(".github/workflows/ci.yml"),
814
814
  e(".github/dependabot.yml"),
815
815
  e(v)
816
816
  ]), s = await e(".github/workflows/codeql.yml") ?? "", [c, l, u, d] = await Promise.all([
817
- W(`repos/${t}/${n}`),
818
- W(`repos/${t}/${n}/private-vulnerability-reporting`),
819
- W(`repos/${t}/${n}/vulnerability-alerts`),
820
- W(`repos/${t}/${n}/commits/main/check-runs?per_page=100`)
817
+ B(`repos/${t}/${n}`),
818
+ B(`repos/${t}/${n}/private-vulnerability-reporting`),
819
+ B(`repos/${t}/${n}/vulnerability-alerts`),
820
+ B(`repos/${t}/${n}/commits/main/check-runs?per_page=100`)
821
821
  ]), 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;
822
822
  return {
823
- codeQLLanguages: s.matchAll(/- language: ([\w-]+)/g).filter(([, e]) => e !== "rust" || o !== null).map(([, e = ""]) => Ut[e] ?? e).toArray(),
823
+ codeQLLanguages: s.matchAll(/- language: ([\w-]+)/g).filter(([, e]) => e !== "rust" || o !== null).map(([, e = ""]) => qt[e] ?? e).toArray(),
824
824
  codeQLQueries: /queries: ([\w-]+)/.exec(s)?.[1],
825
825
  dependabotAlerts: u !== void 0,
826
826
  dependabotSecurityUpdates: p("dependabot_security_updates"),
@@ -837,37 +837,37 @@ async function Qt(t, n, r) {
837
837
  testsInCI: i?.includes("npm test") ?? !1
838
838
  };
839
839
  }
840
- async function W(e) {
840
+ async function B(e) {
841
841
  try {
842
- let { stdout: t } = await Kt("gh", ["api", e]);
842
+ let { stdout: t } = await Xt("gh", ["api", e]);
843
843
  return t;
844
844
  } catch (e) {
845
845
  if (String(e.stderr).includes("HTTP 404")) return;
846
846
  throw e;
847
847
  }
848
848
  }
849
- async function $t(e) {
849
+ async function rn(e) {
850
850
  let t = await fetch(`https://www.bestpractices.dev/projects.json?url=${encodeURIComponent(e)}`);
851
851
  if (!t.ok) throw Error(`OpenSSF Best Practices lookup failed with status ${String(t.status)}.`);
852
852
  return (await t.json()).find((t) => t.repo_url === e)?.id;
853
853
  }
854
- async function en(e) {
854
+ async function an(e) {
855
855
  let t = await fetch(`https://api.scorecard.dev/projects/${e}`);
856
856
  if (t.status !== 404) {
857
857
  if (!t.ok) throw Error(`OpenSSF Scorecard lookup failed with status ${String(t.status)}.`);
858
858
  return await t.json();
859
859
  }
860
860
  }
861
- function tn(e) {
862
- return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Lt.has(e) || It[e] !== void 0 && t >= It[e]);
861
+ function on(e) {
862
+ return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Vt.has(e) || Bt[e] !== void 0 && t >= Bt[e]);
863
863
  }
864
- function nn(e) {
864
+ function sn(e) {
865
865
  return e === !1 ? " These are handled manually." : "";
866
866
  }
867
- function G(e) {
867
+ function V(e) {
868
868
  return e === void 0 ? "❔ Unknown" : e ? "✅ On" : "❌ Off";
869
869
  }
870
- function K(e, t) {
870
+ function H(e, t) {
871
871
  return t.length === 0 ? "" : `### ${e}
872
872
 
873
873
  |Check|Status|What it does|
@@ -876,90 +876,90 @@ ${t.map((e) => `|${e.join("|")}|`).join("\n")}
876
876
 
877
877
  `;
878
878
  }
879
- function rn(e, t, n, r) {
879
+ function cn(e, t, n, r) {
880
880
  return `![${n}](https://img.shields.io/endpoint?url=${encodeURIComponent(`https://raw.githubusercontent.com/${e}/${t}/main/${r}`)})`;
881
881
  }
882
- function an(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
882
+ function ln(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
883
883
  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 = [[
884
884
  "Unit tests",
885
- G(i.testsInCI),
885
+ V(i.testsInCI),
886
886
  `[Vitest](https://vitest.dev) runs the unit tests.${o(i.testsInCI)}`
887
887
  ], [
888
888
  "Property-based tests",
889
- G(i.propertyTests),
889
+ V(i.propertyTests),
890
890
  `[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)}`
891
891
  ]];
892
892
  n !== void 0 && s.push([
893
893
  "Test coverage",
894
- G(!0),
895
- `${rn(e, t, "Coverage", Ht)} [Vitest's V8 coverage](https://vitest.dev/guide/coverage) measures the share of source lines the unit tests run. The target is ${String(Bt)}%.`
894
+ V(!0),
895
+ `${cn(e, t, "Coverage", Kt)} [Vitest's V8 coverage](https://vitest.dev/guide/coverage) measures the share of source lines the unit tests run. The target is ${String(Wt)}%.`
896
896
  ]);
897
897
  let c = `[![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}) `, l = [[
898
898
  "Code analysis",
899
- G(i.sonarCloud),
899
+ V(i.sonarCloud),
900
900
  `${i.sonarCloud ? c : ""}[SonarCloud](https://sonarcloud.io) checks every push for bugs, code smells and vulnerabilities.`
901
901
  ], [
902
902
  "Linting",
903
- G(i.lintInCI),
903
+ V(i.lintInCI),
904
904
  `[ESLint](https://eslint.org) checks the code for errors and style problems.${o(i.lintInCI)}`
905
905
  ]];
906
906
  r !== void 0 && l.unshift([
907
907
  "Code health",
908
- G(!0),
909
- `[${rn(e, t, "Fallow code health", h)}](./${te}) [Fallow](https://github.com/fallow-rs/fallow) finds unused code, duplication, complexity and dependency problems.`
908
+ V(!0),
909
+ `[${cn(e, t, "Fallow code health", h)}](./${te}) [Fallow](https://github.com/fallow-rs/fallow) finds unused code, duplication, complexity and dependency problems.`
910
910
  ]);
911
911
  let u = i.codeQLLanguages.length > 0, d = `[![CodeQL](${a}/actions/workflows/codeql.yml/badge.svg)](${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 = [
912
912
  [
913
913
  "Push protection",
914
- G(i.pushProtection),
914
+ V(i.pushProtection),
915
915
  "[GitHub push protection](https://docs.github.com/en/code-security/secret-scanning/push-protection-for-repositories-and-organizations) blocks pushes that contain credentials."
916
916
  ],
917
917
  [
918
918
  "Static analysis",
919
- G(u),
919
+ V(u),
920
920
  `${u ? d : ""}[CodeQL](https://codeql.github.com) scans${p} for security vulnerabilities, ${f}, on every push and pull request to \`main\` and weekly.`
921
921
  ],
922
922
  [
923
923
  "Secret scanning",
924
- G(i.secretScanning),
924
+ V(i.secretScanning),
925
925
  "[GitHub secret scanning](https://docs.github.com/en/code-security/secret-scanning) detects credentials, such as API keys and tokens, committed to the repository."
926
926
  ]
927
927
  ], g = "[Dependabot](https://docs.github.com/en/code-security/dependabot)", _ = [
928
928
  [
929
929
  "Vulnerability audit",
930
- G(i.npmAuditInCI),
930
+ V(i.npmAuditInCI),
931
931
  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)}`
932
932
  ],
933
933
  [
934
934
  "Supply chain risk",
935
- G(i.socket),
935
+ V(i.socket),
936
936
  "[Socket](https://socket.dev) flags malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE."
937
937
  ],
938
938
  [
939
939
  "Security alerts",
940
- G(i.dependabotAlerts),
940
+ V(i.dependabotAlerts),
941
941
  `${g} alerts when a dependency has a known vulnerability, using the GitHub Advisory Database.`
942
942
  ],
943
943
  [
944
944
  "Security updates",
945
- G(i.dependabotSecurityUpdates),
946
- `${g} opens pull requests that update vulnerable dependencies.${nn(i.dependabotSecurityUpdates)}`
945
+ V(i.dependabotSecurityUpdates),
946
+ `${g} opens pull requests that update vulnerable dependencies.${sn(i.dependabotSecurityUpdates)}`
947
947
  ],
948
948
  [
949
949
  "Version updates",
950
- G(i.dependabotVersionUpdates),
951
- `${g} opens pull requests for new dependency versions.${nn(i.dependabotVersionUpdates)}`
950
+ V(i.dependabotVersionUpdates),
951
+ `${g} opens pull requests for new dependency versions.${sn(i.dependabotVersionUpdates)}`
952
952
  ]
953
953
  ];
954
954
  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.
955
955
 
956
- ${K("Testing", s)}${K("Code Quality", l)}${K("Security Analysis", m)}${K("Dependencies", _)}`;
956
+ ${H("Testing", s)}${H("Code Quality", l)}${H("Security Analysis", m)}${H("Dependencies", _)}`;
957
957
  }
958
- function on(e, t, n, r, i) {
959
- let a = `https://github.com/${e}/${t}`, o = `github.com/${e}/${t}`, s = `https://www.bestpractices.dev/projects/${String(r)}`, c = i !== void 0 && tn(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.";
958
+ function un(e, t, n, r, i) {
959
+ let a = `https://github.com/${e}/${t}`, o = `github.com/${e}/${t}`, s = `https://www.bestpractices.dev/projects/${String(r)}`, c = i !== void 0 && on(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.";
960
960
  return `## Quality & Security
961
961
 
962
- ${an(e, t, n)}### OpenSSF 🚧
962
+ ${ln(e, t, n)}### OpenSSF 🚧
963
963
 
964
964
  ${l}[![OpenSSF Scorecard](https://api.scorecard.dev/projects/${o}/badge)](https://scorecard.dev/viewer/?uri=${o})
965
965
 
@@ -971,37 +971,37 @@ Please do not open public GitHub issues for security vulnerabilities. ${u}`;
971
971
  }
972
972
  //#endregion
973
973
  //#region src/actions/documentUsage.ts
974
- var sn = "<!-- USAGE_START -->", cn = "<!-- USAGE_END -->", ln = /* @__PURE__ */ new Set([
974
+ var dn = "<!-- USAGE_START -->", fn = "<!-- USAGE_END -->", pn = /* @__PURE__ */ new Set([
975
975
  "connector",
976
976
  "cookbook",
977
977
  "presenter"
978
- ]), un = /* @__PURE__ */ new Set(["development", "eslint"]), dn = "> [!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.", fn = "This repository manages itself using the actions it implements.", pn = "This repository is managed using the common set of actions provided by [@dpuse/dpuse-development](https://github.com/dpuse/dpuse-development).";
979
- async function mn() {
978
+ ]), mn = /* @__PURE__ */ new Set(["development", "eslint"]), hn = "> [!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.", gn = "This repository manages itself using the actions it implements.", _n = "This repository is managed using the common set of actions provided by [@dpuse/dpuse-development](https://github.com/dpuse/dpuse-development).";
979
+ async function vn() {
980
980
  try {
981
- s("Document Usage"), T("1️⃣ Insert usage content into 'README.md'");
982
- let [e, t] = await Promise.all([w("package.json"), w("config.json")]), n = hn(e), r = gn(n), i = q(e.engines?.node), a = q(e.engines?.npm), o = q(e.devDependencies?.typescript), c = _n(m(t.id), e.name), l = `${n.replace(/\.git$/, "")}/blob/main/package.json`, u = vn(c, n, r, i, a, o, `${e.name === "@dpuse/dpuse-development" ? fn : pn} See the \`scripts\` block in [package.json](${l}) for details.`);
983
- await _(u, sn, cn), S("Usage documented");
981
+ s("Document Usage"), w("1️⃣ Insert usage content into 'README.md'");
982
+ let [e, t] = await Promise.all([C("package.json"), C("config.json")]), n = yn(e), r = bn(n), i = U(e.engines?.node), a = U(e.engines?.npm), o = U(e.devDependencies?.typescript), c = xn(m(t.id), e.name), l = `${n.replace(/\.git$/, "")}/blob/main/package.json`, u = Sn(c, n, r, i, a, o, `${e.name === "@dpuse/dpuse-development" ? gn : _n} See the \`scripts\` block in [package.json](${l}) for details.`);
983
+ await _(u, dn, fn), x("Usage documented");
984
984
  } catch (e) {
985
985
  console.error("❌ Error documenting usage", e), process.exit(1);
986
986
  }
987
987
  }
988
- function hn(e) {
988
+ function yn(e) {
989
989
  let t = e.repository, n = typeof t == "string" ? t : t?.url;
990
990
  if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
991
991
  return n.replace(/^git\+/, "");
992
992
  }
993
- function gn(e) {
993
+ function bn(e) {
994
994
  return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
995
995
  }
996
- function q(e) {
996
+ function U(e) {
997
997
  if (e == null) throw Error("package.json version range is required to document usage.");
998
998
  let t = /\d+(?:\.\d+)*/.exec(e);
999
999
  if (t == null) throw Error(`Unable to parse version from '${e}'.`);
1000
1000
  return t[0];
1001
1001
  }
1002
- function _n(e, t) {
1002
+ function xn(e, t) {
1003
1003
  let { typeId: n } = e;
1004
- if (ln.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.
1004
+ if (pn.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.
1005
1005
 
1006
1006
  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.`;
1007
1007
  if (e.publishedTo === "npm") {
@@ -1012,11 +1012,11 @@ You may view or clone this repository for your own purposes, such as building a
1012
1012
  npm install ${t}
1013
1013
  \`\`\`
1014
1014
 
1015
- ${un.has(n) ? `${dn}\n\n` : ""}To work on the source instead, clone this repository.`;
1015
+ ${mn.has(n) ? `${hn}\n\n` : ""}To work on the source instead, clone this repository.`;
1016
1016
  }
1017
1017
  return "You may view or clone this repository for your own purposes.";
1018
1018
  }
1019
- function vn(e, t, n, r, i, a, o) {
1019
+ function Sn(e, t, n, r, i, a, o) {
1020
1020
  return `## Usage
1021
1021
 
1022
1022
  ${e}
@@ -1033,102 +1033,199 @@ ${o}`;
1033
1033
  }
1034
1034
  //#endregion
1035
1035
  //#region src/actions/documentApiReference.ts
1036
- var J = "API_REFERENCE.md";
1037
- async function yn() {
1036
+ var W = "API_REFERENCE.md";
1037
+ async function Cn() {
1038
1038
  try {
1039
1039
  s("Document API Reference");
1040
1040
  let { writeAPIReference: e } = await import("./apiReference-cMfpNKxR.js");
1041
- await e("1️⃣ ", J), S("API reference documented");
1041
+ await e("1️⃣ ", W), x("API reference documented");
1042
1042
  } catch (e) {
1043
1043
  console.error("❌ Error documenting API reference", e), process.exit(1);
1044
1044
  }
1045
1045
  }
1046
1046
  //#endregion
1047
1047
  //#region src/actions/documentBundleSizes.ts
1048
- var bn = "bundle-analysis-reports/sonda/index.json", xn = "<!-- BUNDLE_START -->", Sn = "<!-- BUNDLE_END -->", Y = "&nbsp;&nbsp;&nbsp;&nbsp;", X = 20, Cn = "█", wn = "▒", Tn = 100 / X / 2, En = 100 / X, Dn = "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._", On = "Bars show each row's share of its output file.", kn = "↳ rows are part of the row above.", Z = "(bundler output, whitespace & JSON)", An = `${Z} = 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.`;
1049
- async function jn(e) {
1048
+ var wn = "bundle-analysis-reports/sonda/index.json", Tn = "bundle-analysis-reports/sonda/worker.json", En = "<!-- BUNDLE_START -->", Dn = "<!-- BUNDLE_END -->", G = "&nbsp;&nbsp;&nbsp;&nbsp;", K = 20, On = "█", kn = "▒", An = 100 / K / 2, jn = 100 / K, Mn = "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._", Nn = "Bars show each row's share of its output file.", Pn = "↳ rows are part of the row above.", q = "(bundler output, whitespace & JSON)", J = "(inlined worker)", Fn = `${J} = 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.`, Y = "(Rust WebAssembly as base64", In = `${Y}…) = the compiled Rust code, embedded as base64 text, about a third larger than the binary it decodes to, which is the size given.`, Ln = `${q} = 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.`;
1049
+ async function Rn(t) {
1050
1050
  try {
1051
- s("Document Bundle Sizes"), T("1️⃣ Read bundle analysis report");
1052
- let t = await w(bn);
1053
- T("2️⃣ Insert table into 'README.md'");
1054
- let n = Mn(t, e?.moduleLevel ?? !1), r = n.includes("↳") ? `${On} ${kn}` : On;
1055
- await _(`## Bundle Analysis\n\n${Dn}\n\n${n}\n\n${r}\n\n${An}`, xn, Sn), S("Bundle sizes documented");
1051
+ s("Document Bundle Sizes"), w("1️⃣ Read bundle analysis report");
1052
+ let n = await C(wn), r = await e(Tn), i = r === null ? void 0 : JSON.parse(r), a = /* @__PURE__ */ new Map();
1053
+ for (let t of n.resources) t.kind === "asset" && a.set(t.name, await e(t.name));
1054
+ w("2️⃣ Insert table into 'README.md'");
1055
+ let o = zn(n, {
1056
+ assetContents: a,
1057
+ isModuleLevel: t?.moduleLevel ?? !1,
1058
+ workerJson: i
1059
+ }), c = [
1060
+ o.includes("↳") ? `${Nn} ${Pn}` : Nn,
1061
+ o.includes(J) ? Fn : "",
1062
+ o.includes(Y) ? In : "",
1063
+ Ln
1064
+ ].filter((e) => e !== "");
1065
+ await _(`## Bundle Analysis\n\n${Mn}\n\n${o}\n\n${c.join("\n\n")}`, En, Dn), x("Bundle sizes documented");
1056
1066
  } catch (e) {
1057
1067
  console.error("❌ Error documenting bundle sizes", e), process.exit(1);
1058
1068
  }
1059
1069
  }
1060
- function Mn(e, t) {
1061
- let n = zn(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, Wn(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), a = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
1062
- for (let [e, o] of i) {
1063
- let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted(Nn), s = i.reduce((e, [, t]) => e + t.sizes.uncompressed, 0), c = s > 0 && r > 0 ? ` · ${Yn(s, r)} of the build` : "";
1064
- a.push(`| **${e}** | ${Gn(o)}${c} |`, ...Pn(i, s, t));
1070
+ function zn(e, t) {
1071
+ let { assetContents: n, isModuleLevel: r, workerJson: i } = t, a = Z(e), o = i === void 0 ? void 0 : Z(i).values().next().value;
1072
+ for (let [e, t] of a) {
1073
+ let r = n.get(e);
1074
+ r != null && Bn(t, r, o);
1075
+ }
1076
+ 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, ir(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), l = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
1077
+ for (let [e, t] of c) {
1078
+ let n = [...a.get(e) ?? /* @__PURE__ */ new Map()].toSorted(Jn), i = n.reduce((e, [, t]) => e + t.sizes.uncompressed, 0), o = i > 0 && s > 0 ? ` · ${cr(i, s)} of the build` : "";
1079
+ l.push(`| **${e}** | ${ar(t)}${o} |`, ...Yn(n, i, r));
1080
+ }
1081
+ return l.join("\n");
1082
+ }
1083
+ function Bn(e, t, n) {
1084
+ let r = Vn(t), i = Hn(r ?? ""), a = Hn(t);
1085
+ Wn(e, {
1086
+ bytes: a.bytes - i.bytes,
1087
+ binaryBytes: a.binaryBytes - i.binaryBytes
1088
+ }), r !== void 0 && Gn(e, Buffer.byteLength(r), i, n);
1089
+ }
1090
+ function Vn(e) {
1091
+ if (!e.includes("new Worker(")) return;
1092
+ let t = /encodeURIComponent\((\w+)\)/.exec(e)?.[1];
1093
+ if (t === void 0) return;
1094
+ let n = new RegExp(String.raw`(?:var|let|const)\s+${t}\s*=\s*(["'\`])`).exec(e), r = n?.[1];
1095
+ if (n === null || r === void 0) return;
1096
+ let i = n.index + n[0].length, a = i;
1097
+ for (; a < e.length && e[a] !== r;) a += e[a] === "\\" ? 2 : 1;
1098
+ return e.slice(i, a);
1099
+ }
1100
+ function Hn(e) {
1101
+ let t = {
1102
+ bytes: 0,
1103
+ binaryBytes: 0
1104
+ };
1105
+ for (let n of e.matchAll(/data:application\/wasm;base64,([A-Za-z\d+/]*={0,2})/g)) {
1106
+ let e = n[1] ?? "";
1107
+ t.bytes += n[0].length, t.binaryBytes += Math.floor(e.length * 3 / 4) - Un(e);
1108
+ }
1109
+ return t;
1110
+ }
1111
+ function Un(e) {
1112
+ return e.endsWith("==") ? 2 : +!!e.endsWith("=");
1113
+ }
1114
+ function Wn(e, t) {
1115
+ if (t.bytes <= 0) return;
1116
+ let n = [e.get("wasm"), e.get(q)].flatMap((e) => e === void 0 ? [] : e.files.entries().map(([t, n]) => ({
1117
+ group: e,
1118
+ fileName: t,
1119
+ sizes: n
1120
+ })).toArray()).find(({ sizes: e }) => e.uncompressed >= t.bytes);
1121
+ if (n === void 0) return;
1122
+ qn(e, n.group, n.fileName, n.sizes, t.bytes);
1123
+ let r = `${Y}, ${$(t.binaryBytes)} binary)`;
1124
+ e.set(r, {
1125
+ sizes: {
1126
+ uncompressed: t.bytes,
1127
+ gzip: 0
1128
+ },
1129
+ files: /* @__PURE__ */ new Map([["", {
1130
+ uncompressed: t.bytes,
1131
+ gzip: 0
1132
+ }]])
1133
+ });
1134
+ }
1135
+ function Gn(e, t, n, r) {
1136
+ let i = e.get(q), a = i?.files.get("");
1137
+ if (i === void 0 || a === void 0 || a.uncompressed < t) return;
1138
+ qn(e, i, "", a, t);
1139
+ let o = r === void 0 ? /* @__PURE__ */ new Map([["", {
1140
+ uncompressed: t,
1141
+ gzip: 0
1142
+ }]]) : Kn(r, t, n);
1143
+ e.set(J, {
1144
+ sizes: {
1145
+ uncompressed: t,
1146
+ gzip: 0
1147
+ },
1148
+ files: o
1149
+ });
1150
+ }
1151
+ function Kn(e, t, n) {
1152
+ Wn(e, n);
1153
+ let r = /* @__PURE__ */ new Map();
1154
+ for (let [t, n] of e) if (t === "src") for (let [e, t] of n.files) r.set(e, { ...t });
1155
+ else {
1156
+ let e = n.files.size === 1 ? Qn(t, $n(n.files)) : t;
1157
+ r.set(e, { ...n.sizes });
1065
1158
  }
1066
- return a.join("\n");
1159
+ let i = r.values().reduce((e, t) => e + t.uncompressed, 0), a = r.get(q) ?? Q();
1160
+ return a.uncompressed += Math.max(0, t - i), a.uncompressed > 0 && r.set(q, a), r;
1067
1161
  }
1068
- function Nn(e, t) {
1069
- return e[0] === Z == (t[0] === Z) ? t[1].sizes.uncompressed - e[1].sizes.uncompressed : e[0] === Z ? 1 : -1;
1162
+ function qn(e, t, n, r, i) {
1163
+ 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);
1070
1164
  }
1071
- function Pn(e, t, n) {
1165
+ function Jn(e, t) {
1166
+ return e[0] === q == (t[0] === q) ? t[1].sizes.uncompressed - e[1].sizes.uncompressed : e[0] === q ? 1 : -1;
1167
+ }
1168
+ function Yn(e, t, n) {
1072
1169
  let r = [];
1073
1170
  for (let [i, { sizes: a, files: o }] of e) {
1074
1171
  if (o.size === 1) {
1075
- let e = Rn(o);
1076
- r.push(`| ${Y}${Ln(i, e)} | ${Q(a.uncompressed, t)} |`);
1172
+ let e = $n(o);
1173
+ r.push(`| ${G}${Qn(i, e)} | ${X(a.uncompressed, t)} |`);
1077
1174
  continue;
1078
1175
  }
1079
- r.push(`| ${Y}${i} | ${Q(a.uncompressed, t)} |`), n || r.push(...Fn(o, t));
1176
+ r.push(`| ${G}${i} | ${X(a.uncompressed, t)} |`), n || r.push(...Xn(o, t));
1080
1177
  }
1081
1178
  return r;
1082
1179
  }
1083
- function Fn(e, t) {
1084
- let n = [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), r = In(n, t), i = (r > 0 ? n.slice(0, -r) : n).map(([e, n]) => `| ${Y}${Y}↳ ${e} | ${Q(n.uncompressed, t, wn)} |`);
1180
+ function Xn(e, t) {
1181
+ let n = [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), r = Zn(n, t), i = (r > 0 ? n.slice(0, -r) : n).map(([e, n]) => `| ${G}${G}↳ ${e} | ${X(n.uncompressed, t, kn)} |`);
1085
1182
  if (r > 0) {
1086
1183
  let e = n.slice(-r).reduce((e, [, t]) => e + t.uncompressed, 0);
1087
- i.push(`| ${Y}${Y}↳ ${String(r)} smaller files | ${Q(e, t, wn)} |`);
1184
+ i.push(`| ${G}${G}↳ ${String(r)} smaller files | ${X(e, t, kn)} |`);
1088
1185
  }
1089
1186
  return i;
1090
1187
  }
1091
- function In(e, t) {
1188
+ function Zn(e, t) {
1092
1189
  if (t <= 0) return 0;
1093
1190
  let n = 0, r = 0;
1094
1191
  for (let [, i] of e.toReversed()) {
1095
- let e = i.uncompressed / t * 100 < Tn, a = (r + i.uncompressed) / t * 100 <= En;
1192
+ let e = i.uncompressed / t * 100 < An, a = (r + i.uncompressed) / t * 100 <= jn;
1096
1193
  if (!e || !a) break;
1097
1194
  n++, r += i.uncompressed;
1098
1195
  }
1099
1196
  return n >= 2 ? n : 0;
1100
1197
  }
1101
- function Q(e, t, n = Cn) {
1102
- return `${Kn(t > 0 ? e / t * 100 : 0, n)} · ${$(e)}`;
1198
+ function X(e, t, n = On) {
1199
+ return `${or(t > 0 ? e / t * 100 : 0, n)} · ${$(e)}`;
1103
1200
  }
1104
- function Ln(e, t) {
1201
+ function Qn(e, t) {
1105
1202
  return t === "" ? e : `${e} → ${t}`;
1106
1203
  }
1107
- function Rn(e) {
1204
+ function $n(e) {
1108
1205
  let [t] = e.keys();
1109
1206
  if (t === void 0) throw Error("Expected exactly one file");
1110
1207
  return t;
1111
1208
  }
1112
- function zn(e) {
1113
- let t = Bn(e.dependencies), n = /* @__PURE__ */ new Map();
1209
+ function Z(e) {
1210
+ let t = er(e.dependencies), n = /* @__PURE__ */ new Map();
1114
1211
  for (let r of e.resources) {
1115
1212
  if (r.kind !== "chunk" || !r.parent) continue;
1116
- let { group: e, file: i } = Vn(r.name, t), a = Wn(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
1213
+ let { group: e, file: i } = tr(r.name, t), a = ir(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
1117
1214
  n.set(r.parent, o);
1118
1215
  let s = o.get(e) ?? {
1119
- sizes: qn(),
1216
+ sizes: Q(),
1120
1217
  files: /* @__PURE__ */ new Map()
1121
1218
  };
1122
- o.set(e, s), Jn(s.sizes, a);
1123
- let c = s.files.get(i) ?? qn();
1124
- s.files.set(i, c), Jn(c, a);
1219
+ o.set(e, s), sr(s.sizes, a);
1220
+ let c = s.files.get(i) ?? Q();
1221
+ s.files.set(i, c), sr(c, a);
1125
1222
  }
1126
1223
  return n;
1127
1224
  }
1128
- function Bn(e) {
1225
+ function er(e) {
1129
1226
  return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
1130
1227
  }
1131
- function Vn(e, t) {
1228
+ function tr(e, t) {
1132
1229
  let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
1133
1230
  if (n) {
1134
1231
  let [t, r] = n;
@@ -1138,49 +1235,49 @@ function Vn(e, t) {
1138
1235
  };
1139
1236
  }
1140
1237
  return e === "[unassigned]" ? {
1141
- group: Z,
1238
+ group: q,
1142
1239
  file: ""
1143
1240
  } : e.startsWith("\0") ? {
1144
1241
  group: "(runtime)",
1145
1242
  file: e.slice(1)
1146
1243
  } : e.startsWith("rust/") ? {
1147
1244
  group: "wasm",
1148
- file: Hn(e)
1245
+ file: nr(e)
1149
1246
  } : {
1150
1247
  group: "src",
1151
- file: Un(e)
1248
+ file: rr(e)
1152
1249
  };
1153
1250
  }
1154
- function Hn(e) {
1155
- let t = e.split("/", 2)[1] ?? "", n = Un(e);
1251
+ function nr(e) {
1252
+ let t = e.split("/", 2)[1] ?? "", n = rr(e);
1156
1253
  return t !== "" && n.startsWith(t) ? `…${n.slice(t.length)}` : n;
1157
1254
  }
1158
- function Un(e) {
1255
+ function rr(e) {
1159
1256
  return e.split("/").at(-1) ?? e;
1160
1257
  }
1161
- function Wn(e) {
1258
+ function ir(e) {
1162
1259
  return {
1163
1260
  uncompressed: e.uncompressed,
1164
1261
  gzip: e.gzip ?? 0
1165
1262
  };
1166
1263
  }
1167
- function Gn(e) {
1264
+ function ar(e) {
1168
1265
  return `${$(e.uncompressed)} · gzip ${$(e.gzip)}`;
1169
1266
  }
1170
- function Kn(e, t = Cn) {
1171
- let n = Math.round(e / 100 * X);
1172
- return `\`${t.repeat(n)}${"░".repeat(X - n)}\` ${e.toFixed(1)}%`;
1267
+ function or(e, t = On) {
1268
+ let n = Math.round(e / 100 * K);
1269
+ return `\`${t.repeat(n)}${"░".repeat(K - n)}\` ${e.toFixed(1)}%`;
1173
1270
  }
1174
- function qn() {
1271
+ function Q() {
1175
1272
  return {
1176
1273
  uncompressed: 0,
1177
1274
  gzip: 0
1178
1275
  };
1179
1276
  }
1180
- function Jn(e, t) {
1277
+ function sr(e, t) {
1181
1278
  e.uncompressed += t.uncompressed, e.gzip += t.gzip;
1182
1279
  }
1183
- function Yn(e, t) {
1280
+ function cr(e, t) {
1184
1281
  return `${(e / t * 100).toFixed(1)}%`;
1185
1282
  }
1186
1283
  function $(e) {
@@ -1188,15 +1285,15 @@ function $(e) {
1188
1285
  }
1189
1286
  //#endregion
1190
1287
  //#region src/actions/documentProject.ts
1191
- async function Xn(t = "MIT", n = !1) {
1288
+ async function lr(t = "MIT", n = !1) {
1192
1289
  try {
1193
- let r = await w("config.json"), i = m(r.id).typeId === "connector";
1194
- await jt(), i && await Be(), await mn(), await st(t), await e("bundle-analysis-reports/sonda/index.json") === null ? T(`ℹ️ Bundle sizes NOT documented, as there is no '${bn}' yet. Build the project first.`) : await jn({ moduleLevel: n }), await qt(), await Ve();
1195
- let a = await e(J) !== null;
1196
- a ? await yn() : T(`ℹ️ '${J}' NOT required by this project`), await o("ℹ️ Format generated files", "prettier", [
1290
+ let r = await C("config.json"), i = m(r.id).typeId === "connector";
1291
+ await Ft(), i && await Ve(), await vn(), await ct(t), await e("bundle-analysis-reports/sonda/index.json") === null ? w(`ℹ️ Bundle sizes NOT documented, as there is no '${wn}' yet. Build the project first.`) : await Rn({ moduleLevel: n }), await Zt(), await He();
1292
+ let a = await e(W) !== null;
1293
+ a ? await Cn() : w(`ℹ️ '${W}' NOT required by this project`), await o("ℹ️ Format generated files", "prettier", [
1197
1294
  "--write",
1198
1295
  "README.md",
1199
- ...a ? [J] : []
1296
+ ...a ? [W] : []
1200
1297
  ]);
1201
1298
  } catch (e) {
1202
1299
  console.error("❌ Error documenting project", e), process.exit(1);
@@ -1204,7 +1301,7 @@ async function Xn(t = "MIT", n = !1) {
1204
1301
  }
1205
1302
  //#endregion
1206
1303
  //#region src/actions/formatCode.ts
1207
- async function Zn() {
1304
+ async function ur() {
1208
1305
  try {
1209
1306
  s("Format Code");
1210
1307
  let e = [
@@ -1216,33 +1313,33 @@ async function Zn() {
1216
1313
  "app",
1217
1314
  "src",
1218
1315
  "tests"
1219
- ].filter((e) => oe(e)).map((e) => `${e}/**`)
1316
+ ].filter((e) => se(e)).map((e) => `${e}/**`)
1220
1317
  ];
1221
- await o("1️⃣ Format", "prettier", e), S("Code formatted");
1318
+ await o("1️⃣ Format", "prettier", e), x("Code formatted");
1222
1319
  } catch (e) {
1223
1320
  console.error("❌ Error formatting code", e), process.exit(1);
1224
1321
  }
1225
1322
  }
1226
1323
  //#endregion
1227
1324
  //#region src/actions/lintCode.ts
1228
- async function Qn() {
1325
+ async function dr() {
1229
1326
  try {
1230
- s("Lint Code"), await o("1️⃣ Lint", "eslint", ["."]), S("Code linted");
1327
+ s("Lint Code"), await o("1️⃣ Lint", "eslint", ["."]), x("Code linted");
1231
1328
  } catch (e) {
1232
1329
  console.error("❌ Error linting code", e), process.exit(1);
1233
1330
  }
1234
1331
  }
1235
1332
  //#endregion
1236
1333
  //#region src/utilities/cloudflare.ts
1237
- async function $n() {
1238
- let e = await w("config.json"), t = {
1334
+ async function fr() {
1335
+ let e = await C("config.json"), t = {
1239
1336
  body: JSON.stringify(e),
1240
1337
  headers: { "Content-Type": "application/json" },
1241
1338
  method: "PUT"
1242
1339
  }, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
1243
1340
  if (!n.ok) throw Error(await n.text());
1244
1341
  }
1245
- async function er(e, t) {
1342
+ async function pr(e, t) {
1246
1343
  async function n(e, t, r) {
1247
1344
  for (let i of r) {
1248
1345
  let r = `${e}/${i}`, a = `${t}/${i}`;
@@ -1260,7 +1357,7 @@ async function er(e, t) {
1260
1357
  let r = await y(`${e}/${t}/`);
1261
1358
  await n(`${e}/${t}`, t, r);
1262
1359
  }
1263
- async function tr(e) {
1360
+ async function mr(e) {
1264
1361
  let t = e.id, n = {
1265
1362
  body: JSON.stringify(e),
1266
1363
  headers: { "Content-Type": "application/json" },
@@ -1268,7 +1365,7 @@ async function tr(e) {
1268
1365
  }, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
1269
1366
  if (!r.ok) throw Error(await r.text());
1270
1367
  }
1271
- async function nr(e, t) {
1368
+ async function hr(e, t) {
1272
1369
  let n = `v${e.version ?? "unknown"}`;
1273
1370
  async function r(e, r = "") {
1274
1371
  let i = await y(e, { withFileTypes: !0 });
@@ -1292,34 +1389,34 @@ async function nr(e, t) {
1292
1389
  }
1293
1390
  //#endregion
1294
1391
  //#region src/actions/publishProject.ts
1295
- async function rr() {
1392
+ async function gr() {
1296
1393
  try {
1297
1394
  s("Publish Project");
1298
- let e = await w("package.json"), t = await w("config.json"), n = m(t.id);
1299
- n.publishedTo === "npm" ? await o("1️⃣ Publish to npm", "npm", ["publish", "--provenance"]) : T("1️⃣ Publishing to npm NOT required"), await ir("2️⃣ ", e, t, n), n.publishedTo === "kb" && await o("3️⃣ Deploy", "npm", ["run", "deploy"]), S(`Project version '${e.version ?? "unknown"}' published.`);
1395
+ let e = await C("package.json"), t = await C("config.json"), n = m(t.id);
1396
+ n.publishedTo === "npm" ? await o("1️⃣ Publish to npm", "npm", ["publish", "--provenance"]) : w("1️⃣ Publishing to npm NOT required"), await _r("2️⃣ ", e, t, n), n.publishedTo === "kb" && await o("3️⃣ Deploy", "npm", ["run", "deploy"]), x(`Project version '${e.version ?? "unknown"}' published.`);
1300
1397
  } catch (e) {
1301
1398
  console.error("❌ Error publishing project", e), process.exit(1);
1302
1399
  }
1303
1400
  }
1304
- async function ir(e, t, n, r) {
1305
- if (r.typeId === "app") T(`${e} Register module`), await $n();
1306
- else if (r.typeId === "engine") T(`${e} Register module`), await nr(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await tr(n);
1307
- else if (r.uploadGroupName === void 0) T(`${e} Registration NOT required`);
1401
+ async function _r(e, t, n, r) {
1402
+ if (r.typeId === "app") w(`${e} Register module`), await fr();
1403
+ else if (r.typeId === "engine") w(`${e} Register module`), await hr(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await mr(n);
1404
+ else if (r.uploadGroupName === void 0) w(`${e} Registration NOT required`);
1308
1405
  else {
1309
- T(`${e} Register module`);
1406
+ w(`${e} Register module`);
1310
1407
  let i = n.id.split("-").slice(2).join("-");
1311
- await nr(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await tr(n);
1408
+ await hr(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await mr(n);
1312
1409
  }
1313
1410
  }
1314
1411
  //#endregion
1315
1412
  //#region src/actions/releaseProject.ts
1316
- async function ar(e = "MIT", t = !1) {
1413
+ async function vr(e = "MIT", t = !1) {
1317
1414
  try {
1318
1415
  s("Release Project");
1319
- let n = await w("package.json"), r = await w("config.json"), i = m(r.id);
1416
+ let n = await C("package.json"), r = await C("config.json"), i = m(r.id);
1320
1417
  await d("1️⃣ ", n);
1321
- let a = await x("2️⃣ ", n, i);
1322
- if (await xe("3️⃣ ", n), T("4️⃣ Regenerate README"), await Xn(e, t), await b("5️⃣ Stage changes", "git", ["add", "."]), await b("6️⃣ Commit changes", "git", [
1418
+ let a = await ae("2️⃣ ", n, i);
1419
+ if (await Se("3️⃣ ", n), w("4️⃣ Regenerate README"), await lr(e, t), await b("5️⃣ Stage changes", "git", ["add", "."]), await b("6️⃣ Commit changes", "git", [
1323
1420
  "commit",
1324
1421
  "-m",
1325
1422
  `v${n.version ?? "unknown"}`
@@ -1327,7 +1424,7 @@ async function ar(e = "MIT", t = !1) {
1327
1424
  "push",
1328
1425
  "origin",
1329
1426
  "main:main"
1330
- ]), await ir("8️⃣ ", n, a, i), i.publishedTo === "npm") {
1427
+ ]), await _r("8️⃣ ", n, a, i), i.publishedTo === "npm") {
1331
1428
  let e = `v${n.version ?? "unknown"}`;
1332
1429
  await o("9️⃣ Trigger GitHub release", "gh", [
1333
1430
  "release",
@@ -1338,19 +1435,19 @@ async function ar(e = "MIT", t = !1) {
1338
1435
  "--generate-notes",
1339
1436
  "--latest"
1340
1437
  ]);
1341
- } else T(`9️⃣ Publishing NOT required for package with type identifier of '${i.typeId}'.`);
1342
- S(`Project version '${n.version ?? "unknown"}' released.`);
1438
+ } else w(`9️⃣ Publishing NOT required for package with type identifier of '${i.typeId}'.`);
1439
+ x(`Project version '${n.version ?? "unknown"}' released.`);
1343
1440
  } catch (e) {
1344
1441
  console.error("❌ Error releasing project", e), process.exit(1);
1345
1442
  }
1346
1443
  }
1347
1444
  //#endregion
1348
1445
  //#region src/actions/syncProjectWithGitHub.ts
1349
- async function or() {
1446
+ async function yr() {
1350
1447
  try {
1351
1448
  s("Synchronise Project with GitHub");
1352
- let e = await w("package.json"), t = await w("config.json"), n = m(t.id);
1353
- await d("1️⃣ ", e), await x("2️⃣ ", e, n), await b("3️⃣ Stage changes", "git", ["add", "."]), await b("4️⃣ Commit changes", "git", [
1449
+ let e = await C("package.json"), t = await C("config.json"), n = m(t.id);
1450
+ await d("1️⃣ ", e), await ae("2️⃣ ", e, n), await b("3️⃣ Stage changes", "git", ["add", "."]), await b("4️⃣ Commit changes", "git", [
1354
1451
  "commit",
1355
1452
  "-m",
1356
1453
  `v${e.version ?? "unknown"}`
@@ -1358,19 +1455,19 @@ async function or() {
1358
1455
  "push",
1359
1456
  "origin",
1360
1457
  "main:main"
1361
- ]), S(`Project version '${e.version ?? "unknown"}' synchronised with GitHub.`);
1458
+ ]), x(`Project version '${e.version ?? "unknown"}' synchronised with GitHub.`);
1362
1459
  } catch (e) {
1363
1460
  console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
1364
1461
  }
1365
1462
  }
1366
1463
  //#endregion
1367
1464
  //#region src/actions/testProject.ts
1368
- var sr = [
1465
+ var br = [
1369
1466
  "1️⃣ ",
1370
1467
  "2️⃣ ",
1371
1468
  "3️⃣ ",
1372
1469
  "4️⃣ "
1373
- ], cr = [{
1470
+ ], xr = [{
1374
1471
  id: "unit",
1375
1472
  label: "Run unit tests",
1376
1473
  command: "vitest",
@@ -1383,30 +1480,30 @@ var sr = [
1383
1480
  arguments: ["test", "--pass-with-no-tests"],
1384
1481
  configFileName: "playwright.config.ts"
1385
1482
  }];
1386
- async function lr(t = ["unit"]) {
1483
+ async function Sr(t = ["unit"]) {
1387
1484
  try {
1388
1485
  s("Test Project");
1389
1486
  let n = 0;
1390
- for (let r of cr) {
1487
+ for (let r of xr) {
1391
1488
  if (!t.includes(r.id) || await e(r.configFileName) === null) continue;
1392
- let i = `${sr[n] ?? ""} ${r.label}`;
1489
+ let i = `${br[n] ?? ""} ${r.label}`;
1393
1490
  await o(i, r.command, r.arguments), n += 1;
1394
1491
  }
1395
1492
  if (n === 0) {
1396
1493
  console.warn("\n⚠️ No tests configured for this project.\n");
1397
1494
  return;
1398
1495
  }
1399
- S("Project tested");
1496
+ x("Project tested");
1400
1497
  } catch (e) {
1401
1498
  console.error("❌ Error testing project", e), process.exit(1);
1402
1499
  }
1403
1500
  }
1404
1501
  //#endregion
1405
1502
  //#region src/actions/triggerGitHubRelease.ts
1406
- async function ur() {
1503
+ async function Cr() {
1407
1504
  try {
1408
1505
  s("Trigger GitHub Release");
1409
- let e = `v${(await w("package.json")).version ?? "unknown"}`;
1506
+ let e = `v${(await C("package.json")).version ?? "unknown"}`;
1410
1507
  await o("1️⃣ Trigger GitHub release", "gh", [
1411
1508
  "release",
1412
1509
  "create",
@@ -1415,10 +1512,10 @@ async function ur() {
1415
1512
  "main",
1416
1513
  "--generate-notes",
1417
1514
  "--latest"
1418
- ]), S(`GitHub release '${e}' created.`);
1515
+ ]), x(`GitHub release '${e}' created.`);
1419
1516
  } catch (e) {
1420
1517
  console.error("❌ Error triggering GitHub release", e), process.exit(1);
1421
1518
  }
1422
1519
  }
1423
1520
  //#endregion
1424
- export { ge as auditDependencies, be as buildProject, Pe as checkProject, Xn as documentProject, Zn as formatCode, Qn as lintCode, rr as publishProject, ar as releaseProject, or as syncProjectWithGitHub, lr as testProject, ur as triggerGitHubRelease, er as uploadDirectoryToR2 };
1521
+ export { _e as auditDependencies, xe as buildProject, Fe as checkProject, lr as documentProject, ur as formatCode, dr as lintCode, gr as publishProject, vr as releaseProject, yr as syncProjectWithGitHub, Sr as testProject, Cr as triggerGitHubRelease, pr as uploadDirectoryToR2 };