@dpuse/dpuse-development 0.3.817 → 0.3.819

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