@dpuse/dpuse-development 0.3.816 → 0.3.818

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