@dpuse/dpuse-development 0.3.799 → 0.3.800

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,52 +1,58 @@
1
- import { C as e, E as t, O as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, k as m, l as h, m as g, n as _, o as ee, p as v, r as y, s as te, t as ne, u as re, v as b, w as x, x as S, y as C } from "./utilities-DxgaXApN.js";
2
- import { existsSync as ie } from "node:fs";
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 y, v as b, w as x, x as S, y as C } from "./utilities-Bo8LfncX.js";
2
+ import { existsSync as ae } from "node:fs";
3
3
  import w from "node:path";
4
- import { promisify as ae } from "node:util";
5
- import { execFile as oe } from "node:child_process";
6
- import { fileURLToPath as se } from "node:url";
7
- import { run as ce } from "npm-check-updates";
8
- import { init as le } from "license-checker-rseidelsohn";
4
+ import { promisify as oe } from "node:util";
5
+ import { execFile as se } from "node:child_process";
6
+ import { fileURLToPath as ce } from "node:url";
7
+ import { run as le } from "npm-check-updates";
8
+ import { init as ue } from "license-checker-rseidelsohn";
9
9
  //#region src/actions/auditDependencies.ts
10
- async function ue() {
10
+ async function de() {
11
11
  try {
12
- f("Audit Dependencies"), await e("1️⃣ Check shipped dependencies for any vulnerability", "npm", ["audit", "--omit=dev"]), await e("2️⃣ Check all dependencies for high or critical vulnerabilities", "npm", ["audit", "--audit-level=high"]), d("Dependencies audited");
12
+ f("Audit Dependencies"), await x("1️⃣ Check shipped dependencies for any vulnerability", "npm", ["audit", "--omit=dev"]), await x("2️⃣ Check all dependencies for high or critical vulnerabilities", "npm", ["audit", "--audit-level=high"]), o("Dependencies audited");
13
13
  } catch (e) {
14
14
  console.error("❌ Error auditing dependencies", e), process.exit(1);
15
15
  }
16
16
  }
17
17
  //#endregion
18
18
  //#region src/actions/buildProject.ts
19
- async function de() {
19
+ var T = "build:wasm";
20
+ async function fe() {
20
21
  try {
21
- f("Build Project"), await e("1️⃣ Bundle project", "vite", ["build"]), d("Project built");
22
+ f("Build Project"), await E("1️⃣ ", await c("package.json")), o("Project built");
22
23
  } catch (e) {
23
24
  console.error("❌ Error building project", e), process.exit(1);
24
25
  }
25
26
  }
27
+ async function E(e, t) {
28
+ t.scripts?.[T] != null && await x(`${e} Build WebAssembly`, "npm", ["run", T]), await x(`${e} Bundle project`, "vite", ["build"]);
29
+ }
26
30
  //#endregion
27
31
  //#region src/actions/checkConfigFiles.ts
28
- var T = "@dpuse/dpuse-development/prettierrc", fe = "dpuse-development";
29
- async function pe() {
32
+ var D = "@dpuse/dpuse-development/prettierrc", pe = "dpuse-development";
33
+ async function me() {
30
34
  try {
31
- f("Check configuration files"), a("1️⃣ Check individual files");
32
- let e = await C("config.json"), t = await C("package.json"), n = t.private === !0, r = v(e.id), i = w.dirname(se(import.meta.url));
33
- await E(i, ".editorconfig"), await E(i, ".gitattributes"), await E(i, ".gitignore", [".gitignore_default"]), await E(i, ".markdownlint.json"), await E(i, ".ncurc.json"), await me(r, i), await E(i, "LICENSE"), await ge(r, i), await _e(r, i), await ve(r, i), await be(r, i), he(r, t), await E(i, ".github/dependabot.yml", [n ? ".github/dependabot.private.yml" : ".github/dependabot.yml"]), n ? console.info("ℹ️ GitHub workflows and file 'SECURITY.md' are NOT required by this project") : (await ye(r, i), await E(i, "SECURITY.md", [], (t) => t.replaceAll(fe, () => e.id))), d("Configuration files checked");
35
+ f("Check configuration files"), b("1️⃣ Check individual files");
36
+ let e = await c("config.json"), t = await c("package.json"), n = t.private === !0, r = _(e.id), a = w.dirname(ce(import.meta.url));
37
+ await O(a, ".editorconfig"), await O(a, ".gitattributes"), await O(a, ".gitignore", [".gitignore_default"]), await O(a, ".markdownlint.json"), await O(a, ".ncurc.json"), await he(r, a), await O(a, "LICENSE"), await _e(r, a), await ve(r, a), await ye(r, a), await xe(r, a), ge(r, t);
38
+ let s = await i(l) !== null;
39
+ s && await O(a, "rust-toolchain.toml"), await O(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 be(a), await O(a, "SECURITY.md", [], (t) => t.replaceAll(pe, () => e.id))), o("Configuration files checked");
34
40
  } catch (e) {
35
41
  console.error("❌ Error checking configuration files", e), process.exit(1);
36
42
  }
37
43
  }
38
- async function me(e, t) {
44
+ async function he(e, t) {
39
45
  ["github", "kb"].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is NOT required by this project") : [
40
46
  "app",
41
47
  "api",
42
48
  "development",
43
49
  "eslint"
44
- ].includes(e.typeId) ? console.info("⚠️ File 'eslint.config.js' is UNIQUE to this project") : await E(t, "eslint.config.js", ["eslint.config.default.js"]);
50
+ ].includes(e.typeId) ? console.info("⚠️ File 'eslint.config.js' is UNIQUE to this project") : await O(t, "eslint.config.js", ["eslint.config.default.js"]);
45
51
  }
46
- function he(e, t) {
47
- 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}'`);
52
+ function ge(e, t) {
53
+ e.typeId === "development" ? console.info("ℹ️ File '.prettierrc.json' is the template") : e.typeId === "app" ? console.info("⚠️ File '.prettierrc.json' is UNIQUE to this project") : t.prettier === D ? console.info(`ℹ️ Prettier configuration is '${D}'`) : console.info(`❌ Prettier configuration is NOT '${D}'`);
48
54
  }
49
- async function ge(e, t) {
55
+ async function _e(e, t) {
50
56
  ["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.json' is NOT required by this project") : [
51
57
  "connector",
52
58
  "development",
@@ -54,12 +60,12 @@ async function ge(e, t) {
54
60
  "presenter",
55
61
  "shared",
56
62
  "tool"
57
- ].includes(e.typeId) ? await E(t, "tsconfig.json") : console.info("⚠️ File 'tsconfig.json' is UNIQUE to this project");
58
- }
59
- async function _e(e, t) {
60
- ["github"].includes(e.typeId) ? console.info("ℹ️ File 'scripts/tsconfig.json' is NOT required by this project") : await E(t, "scripts/tsconfig.json");
63
+ ].includes(e.typeId) ? await O(t, "tsconfig.json") : console.info("⚠️ File 'tsconfig.json' is UNIQUE to this project");
61
64
  }
62
65
  async function ve(e, t) {
66
+ ["github"].includes(e.typeId) ? console.info("ℹ️ File 'scripts/tsconfig.json' is NOT required by this project") : await O(t, "scripts/tsconfig.json");
67
+ }
68
+ async function ye(e, t) {
63
69
  if ([
64
70
  "eslint",
65
71
  "github",
@@ -85,25 +91,25 @@ async function ve(e, t) {
85
91
  break;
86
92
  default: n = ["vite.config.default.ts"];
87
93
  }
88
- await E(t, "vite.config.ts", n);
94
+ await O(t, "vite.config.ts", n);
89
95
  }
90
96
  }
91
- async function ye(e, t) {
92
- await E(t, ".github/workflows/ci.yml"), await E(t, ".github/workflows/codeql.yml"), await E(t, ".github/workflows/publish.yml", [e.publishedTo === "npm" ? ".github/workflows/publish.yml" : ".github/publish.cloudflare.yml"]), await E(t, ".github/workflows/scorecard.yml");
97
+ async function be(e) {
98
+ await O(e, ".github/workflows/ci.yml"), await O(e, ".github/workflows/codeql.yml"), await O(e, ".github/workflows/publish.yml"), await O(e, ".github/workflows/scorecard.yml");
93
99
  }
94
- async function be(e, t) {
100
+ async function xe(e, t) {
95
101
  [
96
102
  "app",
97
103
  "api",
98
104
  "eslint",
99
105
  "github",
100
106
  "kb"
101
- ].includes(e.typeId) ? console.info("ℹ️ File 'vitest.config.ts' is NOT required by this project") : await E(t, "vitest.config.ts");
107
+ ].includes(e.typeId) ? console.info("ℹ️ File 'vitest.config.ts' is NOT required by this project") : await O(t, "vitest.config.ts");
102
108
  }
103
- async function E(e, t, n = [], r = (e) => e) {
109
+ async function O(e, t, n = [], r = (e) => e) {
104
110
  let i = w.resolve(process.cwd(), t), a = n.length > 0 ? n : [t], o;
105
111
  try {
106
- o = await s(i);
112
+ o = await S(i);
107
113
  } catch (e) {
108
114
  if (e.code !== "ENOENT") throw e;
109
115
  }
@@ -112,7 +118,7 @@ async function E(e, t, n = [], r = (e) => e) {
112
118
  return;
113
119
  }
114
120
  for (let n of a) {
115
- let i = w.resolve(e, `../${n}`), a = r(await s(i));
121
+ let i = w.resolve(e, `../${n}`), a = r(await S(i));
116
122
  if (o === a) {
117
123
  console.info(`ℹ️ File '${t}' is the same as '${n}'`);
118
124
  return;
@@ -122,102 +128,102 @@ async function E(e, t, n = [], r = (e) => e) {
122
128
  }
123
129
  //#endregion
124
130
  //#region src/actions/checkDependencies.ts
125
- async function xe() {
131
+ async function Se() {
126
132
  try {
127
- f("Check Dependencies"), await e("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), a("2️⃣ Check using 'npm-check-updates'");
128
- let t = {};
133
+ f("Check Dependencies"), await x("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), b("2️⃣ Check using 'npm-check-updates'");
134
+ let e = {};
129
135
  try {
130
- t = await C(w.resolve(process.cwd(), ".ncurc.json"));
136
+ e = await c(w.resolve(process.cwd(), ".ncurc.json"));
131
137
  } catch (e) {
132
138
  if (e.code !== "ENOENT") throw e;
133
139
  }
134
- await ce({
140
+ await le({
135
141
  interactive: !0,
136
142
  upgrade: !0,
137
143
  dep: "dev,prod,peer,optional",
138
144
  install: "never",
139
- ...t
140
- }), await e("3️⃣ Install updated dependencies", "npm", [
145
+ ...e
146
+ }), await x("3️⃣ Install updated dependencies", "npm", [
141
147
  "install",
142
148
  "--prefer-online",
143
149
  "--no-strict-allow-scripts",
144
150
  "--no-audit",
145
151
  "--no-fund"
146
- ]), await e("4️⃣ Fix vulnerabilities where a compatible upgrade exists", "npm", [
152
+ ]), await x("4️⃣ Fix vulnerabilities where a compatible upgrade exists", "npm", [
147
153
  "audit",
148
154
  "fix",
149
155
  "--no-strict-allow-scripts",
150
156
  "--no-fund"
151
157
  ], !0);
152
- let n = await Se();
153
- n.length > 0 ? await e("5️⃣ Move install-script pins to installed versions", "npm", [
158
+ let t = await Ce();
159
+ t.length > 0 ? await x("5️⃣ Move install-script pins to installed versions", "npm", [
154
160
  "install-scripts",
155
161
  "approve",
156
- ...n
157
- ]) : a("5️⃣ No pinned install-script approvals to move"), process.platform === "darwin" ? await e("6️⃣ Remove unused install-script entries", "npm", ["install-scripts", "prune"]) : a("6️⃣ Skipped removing unused install-script entries (macOS only)"), n.length > 0 && await e("7️⃣ Run install scripts skipped in steps 3 and 4", "npm", [
162
+ ...t
163
+ ]) : b("5️⃣ No pinned install-script approvals to move"), process.platform === "darwin" ? await x("6️⃣ Remove unused install-script entries", "npm", ["install-scripts", "prune"]) : b("6️⃣ Skipped removing unused install-script entries (macOS only)"), t.length > 0 && await x("7️⃣ Run install scripts skipped in steps 3 and 4", "npm", [
158
164
  "rebuild",
159
- ...n,
165
+ ...t,
160
166
  "--no-strict-allow-scripts"
161
- ]), await e("8️⃣ Confirm every install script is reviewed", "npm", [
167
+ ]), await x("8️⃣ Confirm every install script is reviewed", "npm", [
162
168
  "install",
163
169
  "--strict-allow-scripts",
164
170
  "--no-audit",
165
171
  "--no-fund"
166
- ]), d("Dependencies checked");
172
+ ]), o("Dependencies checked");
167
173
  } catch (e) {
168
174
  console.error("❌ Error checking dependencies", e), process.exit(1);
169
175
  }
170
176
  }
171
- async function Se() {
172
- let { allowScripts: e = {} } = await C(w.resolve(process.cwd(), "package.json")), t = Object.entries(e).filter(([e, t]) => t && e.lastIndexOf("@") > 0).map(([e]) => e.slice(0, e.lastIndexOf("@")));
177
+ async function Ce() {
178
+ let { allowScripts: e = {} } = await c(w.resolve(process.cwd(), "package.json")), t = Object.entries(e).filter(([e, t]) => t && e.lastIndexOf("@") > 0).map(([e]) => e.slice(0, e.lastIndexOf("@")));
173
179
  return [...new Set(t)];
174
180
  }
175
181
  //#endregion
176
182
  //#region src/actions/checkProject.ts
177
- async function Ce() {
178
- await pe(), await xe();
183
+ async function we() {
184
+ await me(), await Se();
179
185
  }
180
186
  //#endregion
181
187
  //#region src/actions/documentActions.ts
182
- var we = "<!-- CONNECTOR_ACTIONS_START -->", Te = "<!-- CONNECTOR_ACTIONS_END -->", Ee = "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.", De = {
188
+ var Te = "<!-- CONNECTOR_ACTIONS_START -->", Ee = "<!-- CONNECTOR_ACTIONS_END -->", De = "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.", Oe = {
183
189
  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.",
184
190
  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.",
185
191
  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.",
186
192
  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."
187
- }, Oe = "The table below lists all connector actions and highlights those supported by this connector.";
188
- async function ke() {
193
+ }, ke = "The table below lists all connector actions and highlights those supported by this connector.";
194
+ async function Ae() {
189
195
  try {
190
- f("Document Actions"), a("1️⃣ Insert actions description and table into 'README.md'");
191
- let e = (await C("config.json")).actionNames ?? [], r = n(e), i = m(e), o = `${Ee}\n\n${De[r]} ${Oe}\n\n${i}`;
192
- await t(o, we, Te), d("Actions documented");
196
+ f("Document Actions"), b("1️⃣ Insert actions description and table into 'README.md'");
197
+ let t = (await c("config.json")).actionNames ?? [], r = h(t), i = e(t), a = `${De}\n\n${Oe[r]} ${ke}\n\n${i}`;
198
+ await n(a, Te, Ee), o("Actions documented");
193
199
  } catch (e) {
194
200
  console.error("❌ Error documenting actions", e), process.exit(1);
195
201
  }
196
202
  }
197
203
  //#endregion
198
204
  //#region src/actions/documentContributingLicense.ts
199
- async function Ae() {
205
+ async function je() {
200
206
  try {
201
207
  f("Document Contributing & License");
202
- let [e, n] = await Promise.all([C("package.json"), C("config.json")]), { owner: i, repo: o } = r(e, "document contributing and license"), s = je(e), c = Me(n.firstCreatedAt);
203
- a("1️⃣ Insert contributing and license content into 'README.md'"), await b(), await t(Ne(i, o, s, c), _, ne), d("Contributing & license documented");
208
+ let [e, r] = await Promise.all([c("package.json"), c("config.json")]), { owner: i, repo: a } = t(e, "document contributing and license"), s = Me(e), l = Ne(r.firstCreatedAt);
209
+ b("1️⃣ Insert contributing and license content into 'README.md'"), await C(), await n(Pe(i, a, s, l), ee, ie), o("Contributing & license documented");
204
210
  } catch (e) {
205
211
  console.error("❌ Error documenting contributing and license", e), process.exit(1);
206
212
  }
207
213
  }
208
- function je(e) {
214
+ function Me(e) {
209
215
  let t = e.author, n = typeof t == "string" ? t : t?.name;
210
216
  if (n == null || n === "") throw Error("package.json 'author' field is required to document contributing and license.");
211
217
  let r = n.indexOf("<"), i = r === -1 ? -1 : n.indexOf(">", r);
212
218
  return i === -1 ? n.trim() : [n.slice(0, r).trim(), n.slice(i + 1).trim()].filter((e) => e !== "").join(" ");
213
219
  }
214
- function Me(e) {
220
+ function Ne(e) {
215
221
  let t = (/* @__PURE__ */ new Date()).getFullYear();
216
222
  if (e == null) return String(t);
217
223
  let n = new Date(e).getFullYear();
218
224
  return n === t ? String(t) : `${String(n)}-present`;
219
225
  }
220
- function Ne(e, t, n, r) {
226
+ function Pe(e, t, n, r) {
221
227
  return `## Contributing
222
228
 
223
229
  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.
@@ -232,18 +238,18 @@ This project is licensed under the MIT License, permitting free use, modificatio
232
238
  }
233
239
  //#endregion
234
240
  //#region src/actions/documentDependencies.ts
235
- var D = "<!-- DEPENDENCY_LICENSES_START -->", O = "<!-- DEPENDENCY_LICENSES_END -->", k = "## Dependency Licenses", Pe = "The dependency tree below lists every package in this project — direct and transitive — along with its installed version, release date, and update status. 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.";
236
- async function Fe(e = "MIT") {
241
+ var k = "<!-- DEPENDENCY_LICENSES_START -->", A = "<!-- DEPENDENCY_LICENSES_END -->", j = "## Dependency Licenses", Fe = "The dependency tree below lists every package in this project — direct and transitive — along with its installed version, release date, and update status. 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.";
242
+ async function Ie(e = "MIT") {
237
243
  try {
238
244
  f("Document Dependencies");
239
- let t = await C("package.json");
245
+ let t = await c("package.json");
240
246
  if (t.name === "@dpuse/dpuse-development" || t.name === "@dpuse/eslint-config-dpuse") {
241
- await Ie(t.name), d("Dependencies documented");
247
+ await Le(t.name), o("Dependencies documented");
242
248
  return;
243
249
  }
244
- await re("1️⃣ Clear downloaded licenses", "licenses/downloads");
245
- let n = await Re();
246
- a("2️⃣ Identify production licenses"), await new Promise((r, i) => {
250
+ await u("1️⃣ Clear downloaded licenses", "licenses/downloads");
251
+ let n = await ze();
252
+ b("2️⃣ Identify production licenses"), await new Promise((r, i) => {
247
253
  let a = {
248
254
  start: process.cwd(),
249
255
  production: !0,
@@ -255,41 +261,41 @@ async function Fe(e = "MIT") {
255
261
  excludePackages: [t.name ?? "", ...n].join(";"),
256
262
  out: "licenses/licenses.json"
257
263
  };
258
- le(a, (e) => {
264
+ ue(a, (e) => {
259
265
  e == null ? r() : i(e);
260
266
  });
261
- }), await x("3️⃣ Identify transitive dependencies", "npm", [
267
+ }), await a("3️⃣ Identify transitive dependencies", "npm", [
262
268
  "ls",
263
269
  "--all",
264
270
  "--json",
265
271
  "--omit=dev"
266
- ], "licenses/licenseTree.json"), await Le("4️⃣ ", e, new Set(n)), d("Dependencies documented");
272
+ ], "licenses/licenseTree.json"), await Re("4️⃣ ", e, new Set(n)), o("Dependencies documented");
267
273
  } catch (e) {
268
274
  console.error("❌ Error documenting dependencies", e), process.exit(1);
269
275
  }
270
276
  }
271
- async function Ie(e) {
272
- a(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`);
273
- let n = `> [!WARNING]\n> Dependency licenses are not documented here: ${e} is a development-only tool and is never part of a production release.`;
274
- await t(`${k}\n\n${n}`, D, O);
275
- }
276
- async function Le(e, n, r) {
277
- a(`${e} Insert licenses into 'README.md'`);
278
- let [i, o] = await Promise.all([C("licenses/licenses.json"), C("licenses/licenseTree.json")]), s = /* @__PURE__ */ new Map();
279
- for (let [e, t] of Object.entries(i)) s.set(e, Ve(e, t));
280
- await Promise.all(s.values().map(async (e) => {
281
- let t = await He(e.name, e.installedVersion);
277
+ async function Le(e) {
278
+ b(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`);
279
+ let t = `> [!WARNING]\n> Dependency licenses are not documented here: ${e} is a development-only tool and is never part of a production release.`;
280
+ await n(`${j}\n\n${t}`, k, A);
281
+ }
282
+ async function Re(e, t, r) {
283
+ b(`${e} Insert licenses into 'README.md'`);
284
+ let [i, a] = await Promise.all([c("licenses/licenses.json"), c("licenses/licenseTree.json")]), o = /* @__PURE__ */ new Map();
285
+ for (let [e, t] of Object.entries(i)) o.set(e, He(e, t));
286
+ await Promise.all(o.values().map(async (e) => {
287
+ let t = await Ue(e.name, e.installedVersion);
282
288
  e.latestVersion = t.latestVersion, e.latestPublishedDate = t.latestPublishedDate, e.publishedDate = t.publishedDate;
283
289
  }));
284
- let c = `${ze(n)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
285
- for (let e of s.values()) c += Ue(e);
290
+ let s = `${Be(t)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
291
+ for (let e of o.values()) s += We(e);
286
292
  let l = [];
287
- o.dependencies != null && A(o.dependencies, s, r, l, 0);
288
- let u = `${Pe}\n\n${l.join("\n")}`;
289
- await t(`${k}\n\n${c.trimEnd()}\n\n### Dependency Tree\n\n${u}`, D, O);
293
+ a.dependencies != null && M(a.dependencies, o, r, l, 0);
294
+ let u = `${Fe}\n\n${l.join("\n")}`;
295
+ await n(`${j}\n\n${s.trimEnd()}\n\n### Dependency Tree\n\n${u}`, k, A);
290
296
  }
291
- async function Re() {
292
- let e = await S("package-lock.json"), t = e === null ? {} : JSON.parse(e).packages ?? {}, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
297
+ async function ze() {
298
+ let e = await i("package-lock.json"), t = e === null ? {} : JSON.parse(e).packages ?? {}, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
293
299
  for (let [e, i] of Object.entries(t)) {
294
300
  if (e === "" || i.version === void 0) continue;
295
301
  let t = `${i.name ?? e.slice(e.lastIndexOf("node_modules/") + 13)}@${i.version}`;
@@ -297,13 +303,13 @@ async function Re() {
297
303
  }
298
304
  return r.values().filter((e) => !n.has(e)).toArray();
299
305
  }
300
- function ze(e) {
301
- return `License data is updated each time \`npm run document\` is run, using [license-checker](https://github.com/RSeidelsohn/license-checker-rseidelsohn). The following table lists all production dependencies. These dependencies (including transitive ones) have been checked and confirmed to use ${Be(e.split(";"))} — all permissive, commercially-friendly licenses. Users of the uploaded library are covered by these checks; developers cloning this repository should independently verify development dependencies.`;
302
- }
303
306
  function Be(e) {
307
+ return `License data is updated each time \`npm run document\` is run, using [license-checker](https://github.com/RSeidelsohn/license-checker-rseidelsohn). The following table lists all production dependencies. These dependencies (including transitive ones) have been checked and confirmed to use ${Ve(e.split(";"))} — all permissive, commercially-friendly licenses. Users of the uploaded library are covered by these checks; developers cloning this repository should independently verify development dependencies.`;
308
+ }
309
+ function Ve(e) {
304
310
  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))}`;
305
311
  }
306
- function Ve(e, t) {
312
+ function He(e, t) {
307
313
  let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
308
314
  return {
309
315
  name: r,
@@ -317,7 +323,7 @@ function Ve(e, t) {
317
323
  ...t.licenseFile != null && { licenseFileLink: t.licenseFile }
318
324
  };
319
325
  }
320
- async function He(e, t) {
326
+ async function Ue(e, t) {
321
327
  try {
322
328
  let n = await fetch(`https://registry.npmjs.org/${encodeURIComponent(e)}`);
323
329
  if (n.ok) {
@@ -335,27 +341,27 @@ async function He(e, t) {
335
341
  publishedDate: ""
336
342
  };
337
343
  }
338
- function Ue(e) {
344
+ function We(e) {
339
345
  let t = e.licenseFileLink == null || e.licenseFileLink === "" ? "⚠️ No license file" : `[LICENSE](licenses/${e.licenseFileLink})`;
340
346
  return `|[${e.name}](${e.repository})|${e.installedVersion}|${e.licenseTypes}|${t}|\n`;
341
347
  }
342
- function A(e, t, n, r, i) {
348
+ function M(e, t, n, r, i) {
343
349
  let a = " ".repeat(i);
344
350
  for (let [o, s] of Object.entries(e)) {
345
351
  let e = s.version ?? "";
346
352
  if (n.has(`${o}@${e}`)) continue;
347
- let c = t.get(`${o}@${e}`), l = c == null ? o : `[${o}](${c.repository})`, u = We(c);
348
- r.push(`${a}- **${l}** ${e}${u}`), s.dependencies != null && A(s.dependencies, t, n, r, i + 1);
353
+ let c = t.get(`${o}@${e}`), l = c == null ? o : `[${o}](${c.repository})`, u = Ge(c);
354
+ r.push(`${a}- **${l}** ${e}${u}`), s.dependencies != null && M(s.dependencies, t, n, r, i + 1);
349
355
  }
350
356
  }
351
- function We(e) {
357
+ function Ge(e) {
352
358
  if (e == null) return "";
353
- let t = e.publishedDate ? j(e.publishedDate.split("T", 1)[0]) : "";
359
+ let t = e.publishedDate ? N(e.publishedDate.split("T", 1)[0]) : "";
354
360
  if (e.latestVersion === "" || e.latestVersion === e.installedVersion) return t === "" ? "" : ` — ${t}`;
355
- let n = e.latestPublishedDate ? j(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `**latest**: ${e.latestVersion} ❗` : `**latest**: ${e.latestVersion} — ${n} ❗`;
361
+ let n = e.latestPublishedDate ? N(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `**latest**: ${e.latestVersion} ❗` : `**latest**: ${e.latestVersion} — ${n} ❗`;
356
362
  return t === "" ? ` — → ${r}` : ` — ${t} → ${r}`;
357
363
  }
358
- function j(e) {
364
+ function N(e) {
359
365
  if (e == null || e === "") return "n/a";
360
366
  let t = e.split("T", 1)[0];
361
367
  if (t == null || t === "") return "n/a";
@@ -364,31 +370,31 @@ function j(e) {
364
370
  }
365
371
  //#endregion
366
372
  //#region src/actions/documentOpening.ts
367
- var Ge = "<!-- OPENING_START -->", Ke = "<!-- OPENING_END -->";
368
- async function qe() {
373
+ var Ke = "<!-- OPENING_START -->", qe = "<!-- OPENING_END -->";
374
+ async function Je() {
369
375
  try {
370
- f("Document Opening"), a("1️⃣ Insert opening content into 'README.md'");
371
- let e = await C("package.json"), n = await C("config.json"), { owner: i, repo: o } = r(e, "document opening"), s = Je(e), c = Xe(n), l = Ze(i, o, s, v(n.id).publishedTo === "npm" ? Ye(e) : void 0, e.description, c);
372
- await t(l, Ge, Ke), d("Opening documented");
376
+ f("Document Opening"), b("1️⃣ Insert opening content into 'README.md'");
377
+ let e = await c("package.json"), r = await c("config.json"), { owner: i, repo: a } = t(e, "document opening"), s = Ye(e), l = Ze(r), u = Qe(i, a, s, _(r.id).publishedTo === "npm" ? Xe(e) : void 0, e.description, l);
378
+ await n(u, Ke, qe), o("Opening documented");
373
379
  } catch (e) {
374
380
  console.error("❌ Error documenting opening", e), process.exit(1);
375
381
  }
376
382
  }
377
- function Je(e) {
383
+ function Ye(e) {
378
384
  let t = e.license;
379
385
  if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
380
386
  return t;
381
387
  }
382
- function Ye(e) {
388
+ function Xe(e) {
383
389
  let t = e.name;
384
390
  if (t == null || t === "") throw Error("package.json 'name' field is required to document opening.");
385
391
  return t;
386
392
  }
387
- function Xe(e) {
393
+ function Ze(e) {
388
394
  let t = e.description.en, n = (Array.isArray(t) ? t : [t]).filter((e) => typeof e == "string" && e !== "");
389
395
  return n.length === 0 ? void 0 : n.join("\n\n");
390
396
  }
391
- function Ze(e, t, n, r, i, a) {
397
+ function Qe(e, t, n, r, i, a) {
392
398
  let o = `https://github.com/${e}/${t}`;
393
399
  return `[![License: ${n}](https://img.shields.io/badge/License-${n.replaceAll("-", "--")}-blue.svg)](./LICENSE)
394
400
  [![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})`}
@@ -410,11 +416,11 @@ In addition, DPUse provides [Tools](https://www.dpuse.app) used by the applicati
410
416
  }
411
417
  //#endregion
412
418
  //#region src/actions/documentQualitySecurity.ts
413
- var M = {
419
+ var P = {
414
420
  "Branch-Protection": 3,
415
421
  "Code-Review": 0,
416
422
  Contributors: 0
417
- }, Qe = /* @__PURE__ */ new Set(["CII-Best-Practices"]), $e = "coverage/coverage-final.json", et = "coverage/coverage-summary.json", tt = 80, nt = 60, N = "code-health-reports/vitest/badge.json", rt = {
423
+ }, $e = /* @__PURE__ */ new Set(["CII-Best-Practices"]), et = "coverage/coverage-final.json", tt = "coverage/coverage-summary.json", F = 80, nt = 60, I = "code-health-reports/vitest/badge.json", rt = {
418
424
  actions: "GitHub Actions",
419
425
  "javascript-typescript": "JavaScript/TypeScript",
420
426
  rust: "Rust"
@@ -424,48 +430,48 @@ var M = {
424
430
  C: "yellow",
425
431
  D: "orange",
426
432
  F: "red"
427
- }, P = `${p}/health.json`, at = ae(oe);
433
+ }, L = `${m}/health.json`, at = oe(se);
428
434
  async function ot() {
429
435
  try {
430
436
  f("Document Quality & Security");
431
- let e = await C("package.json"), n = await st(e), i = await lt(e, n === void 0 ? [] : ["--coverage", $e]), { owner: o, repo: s } = r(e, "document quality and security");
432
- a("4️⃣ Read security checks and settings");
433
- let c = await dt(o, s, e);
434
- a("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
435
- let [l, u] = await Promise.all([ft(`https://github.com/${o}/${s}`), pt(`github.com/${o}/${s}`)]);
436
- a("6️⃣ Insert quality and security content into 'README.md'");
437
- let p = gt(o, s, {
438
- coveragePercent: n,
437
+ let e = await c("package.json"), r = await st(e), i = await lt(e, r === void 0 ? [] : ["--coverage", et]), { owner: a, repo: s } = t(e, "document quality and security");
438
+ b("4️⃣ Read security checks and settings");
439
+ let l = await dt(a, s, e);
440
+ b("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
441
+ let [u, d] = await Promise.all([ft(`https://github.com/${a}/${s}`), pt(`github.com/${a}/${s}`)]);
442
+ b("6️⃣ Insert quality and security content into 'README.md'");
443
+ let p = gt(a, s, {
444
+ coveragePercent: r,
439
445
  fallowHealth: i,
440
- securitySettings: c
441
- }, l, u);
442
- await b(), await t(p, te, ee), d("Quality & security documented");
446
+ securitySettings: l
447
+ }, u, d);
448
+ await C(), await n(p, re, te), o("Quality & security documented");
443
449
  } catch (e) {
444
450
  console.error("❌ Error documenting quality and security", e), process.exit(1);
445
451
  }
446
452
  }
447
- async function st(t) {
448
- if (t.devDependencies?.["@vitest/coverage-v8"] == null) {
449
- a("1️⃣ Test coverage NOT measured, as '@vitest/coverage-v8' is not installed");
453
+ async function st(e) {
454
+ if (e.devDependencies?.["@vitest/coverage-v8"] == null) {
455
+ b("1️⃣ Test coverage NOT measured, as '@vitest/coverage-v8' is not installed");
450
456
  return;
451
457
  }
452
- await e("1️⃣ Measure test coverage", "vitest", [
458
+ await x("1️⃣ Measure test coverage", "vitest", [
453
459
  "run",
454
460
  "--passWithNoTests",
455
461
  "--coverage"
456
462
  ]);
457
- let n = await S(et);
458
- if (n === null) return;
459
- let r = JSON.parse(n).total.lines.pct;
460
- return await ct(r), r;
463
+ let t = await i(tt);
464
+ if (t === null) return;
465
+ let n = JSON.parse(t).total.lines.pct;
466
+ return await ct(n), n;
461
467
  }
462
468
  async function ct(e) {
463
469
  let t = [
464
470
  "red",
465
471
  "yellow",
466
472
  "brightgreen"
467
- ], n = Number(e >= nt) + Number(e >= tt);
468
- await i(N, {
473
+ ], n = Number(e >= nt) + Number(e >= F);
474
+ await r(I, {
469
475
  schemaVersion: 1,
470
476
  label: "coverage",
471
477
  message: `${e.toFixed(1)}%`,
@@ -474,22 +480,22 @@ async function ct(e) {
474
480
  }
475
481
  async function lt(e, t) {
476
482
  if (e.devDependencies?.fallow == null) {
477
- a("2️⃣ Code health NOT measured, as Fallow is not installed"), a("3️⃣ Code health report NOT required");
483
+ b("2️⃣ Code health NOT measured, as Fallow is not installed"), b("3️⃣ Code health report NOT required");
478
484
  return;
479
485
  }
480
- await x("2️⃣ Measure code health", "fallow", [
486
+ await a("2️⃣ Measure code health", "fallow", [
481
487
  "health",
482
488
  "--report-only",
483
489
  "--format",
484
490
  "json",
485
491
  ...t
486
- ], P), await x("3️⃣ Write code health report", "fallow", ["--format", "markdown"], o, !0);
487
- let n = await C(P);
492
+ ], L), await a("3️⃣ Write code health report", "fallow", ["--format", "markdown"], s, !0);
493
+ let n = await c(L);
488
494
  return await ut(n), n;
489
495
  }
490
496
  async function ut(e) {
491
497
  let { score: t, grade: n } = e.health_score;
492
- await i(y, {
498
+ await r(ne, {
493
499
  schemaVersion: 1,
494
500
  label: "fallow",
495
501
  message: `${n} (${String(Math.round(t))})`,
@@ -497,35 +503,36 @@ async function ut(e) {
497
503
  });
498
504
  }
499
505
  async function dt(e, t, n) {
500
- let [r, i, a] = await Promise.all([
501
- S(".github/workflows/ci.yml"),
502
- S(".github/workflows/codeql.yml"),
503
- S(".github/dependabot.yml")
504
- ]), [o, s, c, l] = await Promise.all([
505
- F(`repos/${e}/${t}`),
506
- F(`repos/${e}/${t}/private-vulnerability-reporting`),
507
- F(`repos/${e}/${t}/vulnerability-alerts`),
508
- F(`repos/${e}/${t}/commits/main/check-runs?per_page=100`)
509
- ]), u = o === void 0 ? void 0 : JSON.parse(o).security_and_analysis, d = (e) => u?.[e] === void 0 ? void 0 : u[e].status === "enabled", f = new Set((l === void 0 ? [] : JSON.parse(l).check_runs).map((e) => e.app?.slug)), p = a?.match(/package-ecosystem:/g)?.length ?? 0, m = a?.match(/open-pull-requests-limit: 0\b/g)?.length ?? 0;
506
+ let [r, a, o, s] = await Promise.all([
507
+ i(".github/workflows/ci.yml"),
508
+ i(".github/workflows/codeql.yml"),
509
+ i(".github/dependabot.yml"),
510
+ i(l)
511
+ ]), [c, u, d, f] = await Promise.all([
512
+ R(`repos/${e}/${t}`),
513
+ R(`repos/${e}/${t}/private-vulnerability-reporting`),
514
+ R(`repos/${e}/${t}/vulnerability-alerts`),
515
+ R(`repos/${e}/${t}/commits/main/check-runs?per_page=100`)
516
+ ]), 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;
510
517
  return {
511
- codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) => rt[e] ?? e).toArray(),
512
- codeQLQueries: /queries: ([\w-]+)/.exec(i ?? "")?.[1],
513
- dependabotAlerts: c !== void 0,
514
- dependabotSecurityUpdates: d("dependabot_security_updates"),
515
- dependabotVersionUpdates: p > m,
518
+ codeQLLanguages: (a ?? "").matchAll(/- language: ([\w-]+)/g).filter(([, e]) => e !== "rust" || s !== null).map(([, e = ""]) => rt[e] ?? e).toArray(),
519
+ codeQLQueries: /queries: ([\w-]+)/.exec(a ?? "")?.[1],
520
+ dependabotAlerts: d !== void 0,
521
+ dependabotSecurityUpdates: m("dependabot_security_updates"),
522
+ dependabotVersionUpdates: g > _,
516
523
  lintInCI: (r ?? "").includes("npm run lint"),
517
524
  npmAuditInCI: /npm (?:run )?audit/.test(r ?? ""),
518
525
  npmAuditLevel: /npm audit --audit-level=(\w+)/.exec(r ?? "")?.[1],
519
- privateVulnerabilityReporting: s === void 0 ? void 0 : JSON.parse(s).enabled,
526
+ privateVulnerabilityReporting: u === void 0 ? void 0 : JSON.parse(u).enabled,
520
527
  propertyTests: n.devDependencies?.["fast-check"] != null,
521
- pushProtection: d("secret_scanning_push_protection"),
522
- secretScanning: d("secret_scanning"),
523
- socket: f.has("socket-security"),
524
- sonarCloud: f.has("sonarqubecloud"),
528
+ pushProtection: m("secret_scanning_push_protection"),
529
+ secretScanning: m("secret_scanning"),
530
+ socket: h.has("socket-security"),
531
+ sonarCloud: h.has("sonarqubecloud"),
525
532
  testsInCI: r?.includes("npm test") ?? !1
526
533
  };
527
534
  }
528
- async function F(e) {
535
+ async function R(e) {
529
536
  try {
530
537
  let { stdout: t } = await at("gh", ["api", e]);
531
538
  return t;
@@ -547,15 +554,15 @@ async function pt(e) {
547
554
  }
548
555
  }
549
556
  function mt(e) {
550
- return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Qe.has(e) || M[e] !== void 0 && t >= M[e]);
557
+ return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || $e.has(e) || P[e] !== void 0 && t >= P[e]);
551
558
  }
552
- function I(e) {
559
+ function z(e) {
553
560
  return e === !1 ? " These are handled manually." : "";
554
561
  }
555
- function L(e) {
562
+ function B(e) {
556
563
  return e === void 0 ? "❔ Unknown" : e ? "✅ On" : "❌ Off";
557
564
  }
558
- function R(e, t) {
565
+ function V(e, t) {
559
566
  return t.length === 0 ? "" : `### ${e}
560
567
 
561
568
  |Check|Status|What it does|
@@ -564,84 +571,84 @@ ${t.map((e) => `|${e.join("|")}|`).join("\n")}
564
571
 
565
572
  `;
566
573
  }
567
- function z(e, t, n, r) {
574
+ function H(e, t, n, r) {
568
575
  return `![${n}](https://img.shields.io/endpoint?url=${encodeURIComponent(`https://raw.githubusercontent.com/${e}/${t}/main/${r}`)})`;
569
576
  }
570
577
  function ht(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
571
- let a = `https://github.com/${e}/${t}`, s = (e) => e ? ` Part of the [CI workflow](${a}/actions/workflows/ci.yml) on every push and pull request to \`main\`.` : "", c = [[
578
+ 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 = [[
572
579
  "Unit tests",
573
- L(i.testsInCI),
574
- `[Vitest](https://vitest.dev) runs the unit tests.${s(i.testsInCI)}`
580
+ B(i.testsInCI),
581
+ `[Vitest](https://vitest.dev) runs the unit tests.${o(i.testsInCI)}`
575
582
  ], [
576
583
  "Property-based tests",
577
- L(i.propertyTests),
578
- `[fast-check](https://fast-check.dev) runs many random inputs per test to find edge cases, alongside the unit tests.${s(i.propertyTests && i.testsInCI)}`
584
+ B(i.propertyTests),
585
+ `[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)}`
579
586
  ]];
580
587
  n !== void 0 && c.push([
581
588
  "Test coverage",
582
- L(!0),
583
- `${z(e, t, "Coverage", N)} [Vitest's V8 coverage](https://vitest.dev/guide/coverage) measures the share of source lines the unit tests run. The target is ${String(tt)}%.`
589
+ B(!0),
590
+ `${H(e, t, "Coverage", I)} [Vitest's V8 coverage](https://vitest.dev/guide/coverage) measures the share of source lines the unit tests run. The target is ${String(F)}%.`
584
591
  ]);
585
592
  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 = [[
586
593
  "Code analysis",
587
- L(i.sonarCloud),
594
+ B(i.sonarCloud),
588
595
  `${i.sonarCloud ? l : ""}[SonarCloud](https://sonarcloud.io) checks every push for bugs, code smells and vulnerabilities.`
589
596
  ], [
590
597
  "Linting",
591
- L(i.lintInCI),
592
- `[ESLint](https://eslint.org) checks the code for errors and style problems.${s(i.lintInCI)}`
598
+ B(i.lintInCI),
599
+ `[ESLint](https://eslint.org) checks the code for errors and style problems.${o(i.lintInCI)}`
593
600
  ]];
594
601
  r !== void 0 && u.unshift([
595
602
  "Code health",
596
- L(!0),
597
- `[${z(e, t, "Fallow code health", y)}](./${o}) [Fallow](https://github.com/fallow-rs/fallow) finds unused code, duplication, complexity and dependency problems.`
603
+ B(!0),
604
+ `[${H(e, t, "Fallow code health", ne)}](./${s}) [Fallow](https://github.com/fallow-rs/fallow) finds unused code, duplication, complexity and dependency problems.`
598
605
  ]);
599
606
  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 = [
600
607
  [
601
608
  "Push protection",
602
- L(i.pushProtection),
609
+ B(i.pushProtection),
603
610
  "[GitHub push protection](https://docs.github.com/en/code-security/secret-scanning/push-protection-for-repositories-and-organizations) blocks pushes that contain credentials."
604
611
  ],
605
612
  [
606
613
  "Static analysis",
607
- L(d),
614
+ B(d),
608
615
  `${d ? f : ""}[CodeQL](https://codeql.github.com) scans${m} for security vulnerabilities, ${p}, on every push and pull request to \`main\` and weekly.`
609
616
  ],
610
617
  [
611
618
  "Secret scanning",
612
- L(i.secretScanning),
619
+ B(i.secretScanning),
613
620
  "[GitHub secret scanning](https://docs.github.com/en/code-security/secret-scanning) detects credentials, such as API keys and tokens, committed to the repository."
614
621
  ]
615
622
  ], g = "[Dependabot](https://docs.github.com/en/code-security/dependabot)", _ = [
616
623
  [
617
624
  "Vulnerability audit",
618
- L(i.npmAuditInCI),
619
- i.npmAuditLevel === void 0 ? `[npm audit](https://docs.npmjs.com/cli/commands/npm-audit) fails when a shipped dependency has any known vulnerability, or a development dependency has a high or critical one.${s(i.npmAuditInCI)}` : `[npm audit](https://docs.npmjs.com/cli/commands/npm-audit) fails when a dependency has a known vulnerability of ${i.npmAuditLevel} severity or above.${s(i.npmAuditInCI)}`
625
+ B(i.npmAuditInCI),
626
+ 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)}`
620
627
  ],
621
628
  [
622
629
  "Supply chain risk",
623
- L(i.socket),
630
+ B(i.socket),
624
631
  "[Socket](https://socket.dev) flags malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE."
625
632
  ],
626
633
  [
627
634
  "Security alerts",
628
- L(i.dependabotAlerts),
635
+ B(i.dependabotAlerts),
629
636
  `${g} alerts when a dependency has a known vulnerability, using the GitHub Advisory Database.`
630
637
  ],
631
638
  [
632
639
  "Security updates",
633
- L(i.dependabotSecurityUpdates),
634
- `${g} opens pull requests that update vulnerable dependencies.${I(i.dependabotSecurityUpdates)}`
640
+ B(i.dependabotSecurityUpdates),
641
+ `${g} opens pull requests that update vulnerable dependencies.${z(i.dependabotSecurityUpdates)}`
635
642
  ],
636
643
  [
637
644
  "Version updates",
638
- L(i.dependabotVersionUpdates),
639
- `${g} opens pull requests for new dependency versions.${I(i.dependabotVersionUpdates)}`
645
+ B(i.dependabotVersionUpdates),
646
+ `${g} opens pull requests for new dependency versions.${z(i.dependabotVersionUpdates)}`
640
647
  ]
641
648
  ];
642
649
  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.
643
650
 
644
- ${R("Testing", c)}${R("Code Quality", u)}${R("Security Analysis", h)}${R("Dependencies", _)}`;
651
+ ${V("Testing", c)}${V("Code Quality", u)}${V("Security Analysis", h)}${V("Dependencies", _)}`;
645
652
  }
646
653
  function gt(e, t, n, r, i) {
647
654
  let a = `https://github.com/${e}/${t}`, o = `github.com/${e}/${t}`, s = `https://www.bestpractices.dev/projects/${String(r)}`, c = i !== void 0 && mt(i) ? "\n\n> [!NOTE]\n> Apart from the Best Practices badge above, the remaining Scorecard gaps need multi-person review or a pull-request workflow, which this solo-maintained project doesn't use." : "", l = r === void 0 ? "" : `[![OpenSSF Best Practices](${s}/badge)](${s})\n`, u = n.securitySettings.privateVulnerabilityReporting === !0 ? `Use [GitHub private vulnerability reporting](${a}/security/advisories/new) instead. See [SECURITY.md](./SECURITY.md) for the full disclosure policy, contact details, and expected response times.` : "See [SECURITY.md](./SECURITY.md) for how to report one privately, the full disclosure policy, and expected response times.";
@@ -666,9 +673,9 @@ var _t = "<!-- USAGE_START -->", vt = "<!-- USAGE_END -->", yt = /* @__PURE__ */
666
673
  ]), bt = /* @__PURE__ */ new Set(["development", "eslint"]), xt = "> [!WARNING]\n> This project is not designed for general use. It is custom built for the DPUse CI/CD process. You are welcome to clone and customise it for your own purposes, but you will need to adapt it to your own project structure and tooling.", St = "This repository manages itself using the actions it implements.", Ct = "This repository is managed using the common set of actions provided by [@dpuse/dpuse-development](https://github.com/dpuse/dpuse-development).";
667
674
  async function wt() {
668
675
  try {
669
- f("Document Usage"), a("1️⃣ Insert usage content into 'README.md'");
670
- let [e, n] = await Promise.all([C("package.json"), C("config.json")]), r = Tt(e), i = Et(r), o = B(e.engines?.node), s = B(e.engines?.npm), c = B(e.devDependencies?.typescript), l = Dt(v(n.id), e.name), u = `${r.replace(/\.git$/, "")}/blob/main/package.json`, p = Ot(l, r, i, o, s, c, `${e.name === "@dpuse/dpuse-development" ? St : Ct} See the \`scripts\` block in [package.json](${u}) for details.`);
671
- await t(p, _t, vt), d("Usage documented");
676
+ f("Document Usage"), b("1️⃣ Insert usage content into 'README.md'");
677
+ let [e, t] = await Promise.all([c("package.json"), c("config.json")]), r = Tt(e), i = Et(r), a = U(e.engines?.node), s = U(e.engines?.npm), l = U(e.devDependencies?.typescript), u = Dt(_(t.id), e.name), d = `${r.replace(/\.git$/, "")}/blob/main/package.json`, p = Ot(u, r, i, a, s, l, `${e.name === "@dpuse/dpuse-development" ? St : Ct} See the \`scripts\` block in [package.json](${d}) for details.`);
678
+ await n(p, _t, vt), o("Usage documented");
672
679
  } catch (e) {
673
680
  console.error("❌ Error documenting usage", e), process.exit(1);
674
681
  }
@@ -681,7 +688,7 @@ function Tt(e) {
681
688
  function Et(e) {
682
689
  return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
683
690
  }
684
- function B(e) {
691
+ function U(e) {
685
692
  if (e == null) throw Error("package.json version range is required to document usage.");
686
693
  let t = /\d+(?:\.\d+)*/.exec(e);
687
694
  if (t == null) throw Error(`Unable to parse version from '${e}'.`);
@@ -721,93 +728,93 @@ ${o}`;
721
728
  }
722
729
  //#endregion
723
730
  //#region src/actions/documentApiReference.ts
724
- var V = "API_REFERENCE.md";
731
+ var W = "API_REFERENCE.md";
725
732
  async function kt() {
726
733
  try {
727
734
  f("Document API Reference");
728
- let { writeAPIReference: e } = await import("./apiReference-DCzx5xFp.js");
729
- await e("1️⃣ ", V), d("API reference documented");
735
+ let { writeAPIReference: e } = await import("./apiReference-BazeHifT.js");
736
+ await e("1️⃣ ", W), o("API reference documented");
730
737
  } catch (e) {
731
738
  console.error("❌ Error documenting API reference", e), process.exit(1);
732
739
  }
733
740
  }
734
741
  //#endregion
735
742
  //#region src/actions/documentBundleSizes.ts
736
- var H = "bundle-analysis-reports/sonda/index.json", At = "<!-- BUNDLE_START -->", jt = "<!-- BUNDLE_END -->", U = "&nbsp;&nbsp;&nbsp;&nbsp;", W = 20, Mt = "This report is updated with each release, from the bundle the release builds, using [Sonda](https://sonda.dev/), which analyses final source maps to reveal the actual effects of tree-shaking and minification rather than relying on pre-build estimates.\n\n_Note: Sonda's Vite reports currently exclude CSS files, since Vite does not generate source maps for CSS._", G = "(bundler output, whitespace & JSON)", Nt = `${G} = bytes Sonda can't trace to a source file: whitespace (indentation and line breaks), code the bundler generates (region comments, the combined import/export lines, its small runtime helper and wrappers), and imported JSON such as \`config.json\`, which the bundler doesn't map. The JSON and the generated code are real bytes that ship; the whitespace mostly disappears once compressed.`;
743
+ var G = "bundle-analysis-reports/sonda/index.json", At = "<!-- BUNDLE_START -->", jt = "<!-- BUNDLE_END -->", K = "&nbsp;&nbsp;&nbsp;&nbsp;", q = 20, Mt = "This report is updated with each release, from the bundle the release builds, using [Sonda](https://sonda.dev/), which analyses final source maps to reveal the actual effects of tree-shaking and minification rather than relying on pre-build estimates.\n\n_Note: Sonda's Vite reports currently exclude CSS files, since Vite does not generate source maps for CSS._", J = "(bundler output, whitespace & JSON)", Nt = `${J} = 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.`;
737
744
  async function Pt(e) {
738
745
  try {
739
- f("Document Bundle Sizes"), a("1️⃣ Read bundle analysis report");
740
- let n = await C(H);
741
- a("2️⃣ Insert table into 'README.md'");
742
- let r = Ft(n, e?.moduleLevel ?? !1);
743
- await t(`## Bundle Analysis\n\n${Mt}\n\n${r}\n\n${Nt}`, At, jt), d("Bundle sizes documented");
746
+ f("Document Bundle Sizes"), b("1️⃣ Read bundle analysis report");
747
+ let t = await c(G);
748
+ b("2️⃣ Insert table into 'README.md'");
749
+ let r = Ft(t, e?.moduleLevel ?? !1);
750
+ await n(`## Bundle Analysis\n\n${Mt}\n\n${r}\n\n${Nt}`, At, jt), o("Bundle sizes documented");
744
751
  } catch (e) {
745
752
  console.error("❌ Error documenting bundle sizes", e), process.exit(1);
746
753
  }
747
754
  }
748
755
  function Ft(e, t) {
749
- let n = zt(e), r = n.values().flatMap((e) => e.values().toArray()).reduce((e, t) => e + t.sizes.uncompressed, 0), i = e.resources.filter((e) => e.kind === "asset").map((e) => [e.name, Y(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), a = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
756
+ let n = Vt(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, Gt(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), a = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
750
757
  for (let [e, o] of i) {
751
- let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted((e, t) => t[1].sizes.uncompressed - e[1].sizes.uncompressed), s = i.length === 1 ? It(e, o, Rt(i), r, t) : Lt(e, o, i, r, t);
758
+ let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted((e, t) => t[1].sizes.uncompressed - e[1].sizes.uncompressed), s = i.length === 1 ? It(e, o, zt(i), r, t) : Lt(e, o, i, r, t);
752
759
  a.push(...s);
753
760
  }
754
761
  return a.join("\n");
755
762
  }
756
763
  function It(e, t, n, r, i) {
757
764
  let [a, { sizes: o, files: s }] = n, c = r > 0 ? o.uncompressed / r * 100 : 0;
758
- if (s.size === 1) return [`| ${e} → ${q(a, J(s))} | ${X(t)} · ${Z(c)} |`];
765
+ if (s.size === 1) return [`| ${e} → ${Rt(a, Bt(s))} | ${X(t)} · ${Z(c)} |`];
759
766
  let l = [`| ${e} → ${a} | ${X(t)} · ${Z(c)} |`];
760
- return i || l.push(...K(s, U, r)), l;
767
+ return i || l.push(...Y(s, K, r)), l;
761
768
  }
762
769
  function Lt(e, t, n, r, i) {
763
770
  let a = [`| ${e} | ${X(t)} |`];
764
771
  for (let [e, { sizes: t, files: o }] of n) {
765
772
  let n = r > 0 ? t.uncompressed / r * 100 : 0;
766
773
  if (o.size === 1) {
767
- let t = J(o);
768
- a.push(`| ${U}${q(e, t)} | ${Z(n)} |`);
774
+ let t = Bt(o);
775
+ a.push(`| ${K}${Rt(e, t)} | ${Z(n)} |`);
769
776
  continue;
770
777
  }
771
- a.push(`| ${U}${e} | ${Z(n)} |`), i || a.push(...K(o, `${U}${U}`, r));
778
+ a.push(`| ${K}${e} | ${Z(n)} |`), i || a.push(...Y(o, `${K}${K}`, r));
772
779
  }
773
780
  return a;
774
781
  }
775
- function K(e, t, n) {
782
+ function Y(e, t, n) {
776
783
  return [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed).map(([e, r]) => `| ${t}${e} | ${Z(n > 0 ? r.uncompressed / n * 100 : 0)} |`);
777
784
  }
778
- function q(e, t) {
785
+ function Rt(e, t) {
779
786
  return t === "" ? e : `${e} → ${t}`;
780
787
  }
781
- function Rt(e) {
788
+ function zt(e) {
782
789
  let [t] = e;
783
790
  if (t === void 0) throw Error("Expected exactly one entry");
784
791
  return t;
785
792
  }
786
- function J(e) {
793
+ function Bt(e) {
787
794
  let [t] = e.keys();
788
795
  if (t === void 0) throw Error("Expected exactly one file");
789
796
  return t;
790
797
  }
791
- function zt(e) {
792
- let t = Bt(e.dependencies), n = /* @__PURE__ */ new Map();
798
+ function Vt(e) {
799
+ let t = Ht(e.dependencies), n = /* @__PURE__ */ new Map();
793
800
  for (let r of e.resources) {
794
801
  if (r.kind !== "chunk" || !r.parent) continue;
795
- let { group: e, file: i } = Vt(r.name, t), a = Y(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
802
+ let { group: e, file: i } = Ut(r.name, t), a = Gt(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
796
803
  n.set(r.parent, o);
797
804
  let s = o.get(e) ?? {
798
- sizes: Q(),
805
+ sizes: Kt(),
799
806
  files: /* @__PURE__ */ new Map()
800
807
  };
801
- o.set(e, s), $(s.sizes, a);
802
- let c = s.files.get(i) ?? Q();
803
- s.files.set(i, c), $(c, a);
808
+ o.set(e, s), qt(s.sizes, a);
809
+ let c = s.files.get(i) ?? Kt();
810
+ s.files.set(i, c), qt(c, a);
804
811
  }
805
812
  return n;
806
813
  }
807
- function Bt(e) {
814
+ function Ht(e) {
808
815
  return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
809
816
  }
810
- function Vt(e, t) {
817
+ function Ut(e, t) {
811
818
  let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
812
819
  if (n) {
813
820
  let [t, r] = n;
@@ -817,55 +824,55 @@ function Vt(e, t) {
817
824
  };
818
825
  }
819
826
  return e === "[unassigned]" ? {
820
- group: G,
827
+ group: J,
821
828
  file: ""
822
829
  } : e.startsWith("\0") ? {
823
830
  group: "(runtime)",
824
831
  file: e.slice(1)
825
832
  } : {
826
833
  group: e.startsWith("rust/") || e.includes("vite-plugin-wasm") ? "wasm" : "src",
827
- file: Ht(e)
834
+ file: Wt(e)
828
835
  };
829
836
  }
830
- function Ht(e) {
837
+ function Wt(e) {
831
838
  return e.split("/").at(-1) ?? e;
832
839
  }
833
- function Y(e) {
840
+ function Gt(e) {
834
841
  return {
835
842
  uncompressed: e.uncompressed,
836
843
  gzip: e.gzip ?? 0
837
844
  };
838
845
  }
839
846
  function X(e) {
840
- return `${Ut(e.uncompressed)} · gzip ${Ut(e.gzip)}`;
847
+ return `${Jt(e.uncompressed)} · gzip ${Jt(e.gzip)}`;
841
848
  }
842
849
  function Z(e) {
843
- let t = Math.round(e / 100 * W);
844
- return `\`${"█".repeat(t)}${"░".repeat(W - t)}\` ${e.toFixed(1)}%`;
850
+ let t = Math.round(e / 100 * q);
851
+ return `\`${"█".repeat(t)}${"░".repeat(q - t)}\` ${e.toFixed(1)}%`;
845
852
  }
846
- function Q() {
853
+ function Kt() {
847
854
  return {
848
855
  uncompressed: 0,
849
856
  gzip: 0
850
857
  };
851
858
  }
852
- function $(e, t) {
859
+ function qt(e, t) {
853
860
  e.uncompressed += t.uncompressed, e.gzip += t.gzip;
854
861
  }
855
- function Ut(e) {
862
+ function Jt(e) {
856
863
  return e < 1024 ? `${String(e)} B` : `${(e / 1024).toFixed(1)} kB`;
857
864
  }
858
865
  //#endregion
859
866
  //#region src/actions/documentProject.ts
860
- async function Wt(t = "MIT", n = !1) {
867
+ async function Q(e = "MIT", t = !1) {
861
868
  try {
862
- let r = await C("config.json"), i = v(r.id).typeId === "connector";
863
- await qe(), i && await ke(), await wt(), await Fe(t), await S("bundle-analysis-reports/sonda/index.json") === null ? a(`ℹ️ Bundle sizes NOT documented, as there is no '${H}' yet. Build the project first.`) : await Pt({ moduleLevel: n }), await ot(), await Ae();
864
- let o = await S(V) !== null;
865
- o ? await kt() : a(`ℹ️ '${V}' NOT required by this project`), await e("ℹ️ Format generated files", "prettier", [
869
+ let n = await c("config.json"), r = _(n.id).typeId === "connector";
870
+ await Je(), r && await Ae(), await wt(), await Ie(e), await i("bundle-analysis-reports/sonda/index.json") === null ? b(`ℹ️ Bundle sizes NOT documented, as there is no '${G}' yet. Build the project first.`) : await Pt({ moduleLevel: t }), await ot(), await je();
871
+ let a = await i(W) !== null;
872
+ a ? await kt() : b(`ℹ️ '${W}' NOT required by this project`), await x("ℹ️ Format generated files", "prettier", [
866
873
  "--write",
867
874
  "README.md",
868
- ...o ? [V] : []
875
+ ...a ? [W] : []
869
876
  ]);
870
877
  } catch (e) {
871
878
  console.error("❌ Error documenting project", e), process.exit(1);
@@ -873,10 +880,10 @@ async function Wt(t = "MIT", n = !1) {
873
880
  }
874
881
  //#endregion
875
882
  //#region src/actions/formatCode.ts
876
- async function Gt() {
883
+ async function Yt() {
877
884
  try {
878
885
  f("Format Code");
879
- let t = [
886
+ let e = [
880
887
  "--write",
881
888
  "*.json",
882
889
  "*.md",
@@ -885,37 +892,37 @@ async function Gt() {
885
892
  "app",
886
893
  "src",
887
894
  "tests"
888
- ].filter((e) => ie(e)).map((e) => `${e}/**`)
895
+ ].filter((e) => ae(e)).map((e) => `${e}/**`)
889
896
  ];
890
- await e("1️⃣ Format", "prettier", t), d("Code formatted");
897
+ await x("1️⃣ Format", "prettier", e), o("Code formatted");
891
898
  } catch (e) {
892
899
  console.error("❌ Error formatting code", e), process.exit(1);
893
900
  }
894
901
  }
895
902
  //#endregion
896
903
  //#region src/actions/lintCode.ts
897
- async function Kt() {
904
+ async function Xt() {
898
905
  try {
899
- f("Lint Code"), await e("1️⃣ Lint", "eslint", ["."]), d("Code linted");
906
+ f("Lint Code"), await x("1️⃣ Lint", "eslint", ["."]), o("Code linted");
900
907
  } catch (e) {
901
908
  console.error("❌ Error linting code", e), process.exit(1);
902
909
  }
903
910
  }
904
911
  //#endregion
905
912
  //#region src/utilities/cloudflare.ts
906
- async function qt() {
907
- let e = await C("config.json"), t = {
913
+ async function Zt() {
914
+ let e = await c("config.json"), t = {
908
915
  body: JSON.stringify(e),
909
916
  headers: { "Content-Type": "application/json" },
910
917
  method: "PUT"
911
918
  }, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
912
919
  if (!n.ok) throw Error(await n.text());
913
920
  }
914
- async function Jt(e, t) {
921
+ async function Qt(e, t) {
915
922
  async function n(e, t, r) {
916
923
  for (let i of r) {
917
924
  let r = `${e}/${i}`, a = `${t}/${i}`;
918
- (await g(r)).isDirectory() ? await n(r, a, await u(r)) : (console.info(`⚙️ Uploading '${e}/${i}'...`), await l(void 0, "wrangler", [
925
+ (await p(r)).isDirectory() ? await n(r, a, await v(r)) : (console.info(`⚙️ Uploading '${e}/${i}'...`), await d(void 0, "wrangler", [
919
926
  "r2",
920
927
  "object",
921
928
  "put",
@@ -926,10 +933,10 @@ async function Jt(e, t) {
926
933
  ]));
927
934
  }
928
935
  }
929
- let r = await u(`${e}/${t}/`);
936
+ let r = await v(`${e}/${t}/`);
930
937
  await n(`${e}/${t}`, t, r);
931
938
  }
932
- async function Yt(e) {
939
+ async function $t(e) {
933
940
  let t = e.id, n = {
934
941
  body: JSON.stringify(e),
935
942
  headers: { "Content-Type": "application/json" },
@@ -937,21 +944,21 @@ async function Yt(e) {
937
944
  }, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
938
945
  if (!r.ok) throw Error(await r.text());
939
946
  }
940
- async function Xt(e, t) {
947
+ async function en(e, t) {
941
948
  let n = `v${e.version ?? "unknown"}`;
942
949
  async function r(e, r = "") {
943
- let i = await u(e, { withFileTypes: !0 });
950
+ let i = await v(e, { withFileTypes: !0 });
944
951
  for (let a of i) {
945
952
  if (a.isDirectory() || a.name.endsWith(".map")) continue;
946
- 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", u = a.name.endsWith(".js") ? "application/javascript" : c;
947
- console.info(`⚙️ Uploading '${o}' → '${s}'...`), await l(void 0, "wrangler", [
953
+ 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;
954
+ console.info(`⚙️ Uploading '${o}' → '${s}'...`), await d(void 0, "wrangler", [
948
955
  "r2",
949
956
  "object",
950
957
  "put",
951
958
  s,
952
959
  `--file=${i}`,
953
960
  "--content-type",
954
- u,
961
+ l,
955
962
  "--jurisdiction=eu",
956
963
  "--remote"
957
964
  ]);
@@ -961,85 +968,85 @@ async function Xt(e, t) {
961
968
  }
962
969
  //#endregion
963
970
  //#region src/actions/publishProject.ts
964
- async function Zt() {
971
+ async function tn() {
965
972
  try {
966
973
  f("Publish Project");
967
- let e = await C("package.json"), t = await C("config.json");
968
- await Qt("1️⃣ ", e, t, v(t.id)), d(`Project version '${e.version ?? "unknown"}' published.`);
974
+ let e = await c("package.json"), t = await c("config.json"), n = _(t.id);
975
+ n.publishedTo === "npm" ? await x("1️⃣ Publish to npm", "npm", ["publish", "--provenance"]) : b("1️⃣ Publishing to npm NOT required"), await $("2️⃣ ", e, t, n), o(`Project version '${e.version ?? "unknown"}' published.`);
969
976
  } catch (e) {
970
977
  console.error("❌ Error publishing project", e), process.exit(1);
971
978
  }
972
979
  }
973
- async function Qt(e, t, n, r) {
974
- if (r.typeId === "app") a(`${e} Register module`), await qt();
975
- else if (r.typeId === "engine") a(`${e} Register module`), await Xt(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await Yt(n);
976
- else if (r.uploadGroupName === void 0) a(`${e} Registration NOT required`);
980
+ async function $(e, t, n, r) {
981
+ if (r.typeId === "app") b(`${e} Register module`), await Zt();
982
+ else if (r.typeId === "engine") b(`${e} Register module`), await en(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await $t(n);
983
+ else if (r.uploadGroupName === void 0) b(`${e} Registration NOT required`);
977
984
  else {
978
- a(`${e} Register module`);
985
+ b(`${e} Register module`);
979
986
  let i = n.id.split("-").slice(2).join("-");
980
- await Xt(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await Yt(n);
987
+ await en(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await $t(n);
981
988
  }
982
989
  }
983
990
  //#endregion
984
991
  //#region src/actions/releaseProject.ts
985
- async function $t(t = "MIT", n = !1) {
992
+ async function nn(e = "MIT", t = !1) {
986
993
  try {
987
994
  f("Release Project");
988
- let r = await C("package.json"), i = await C("config.json"), o = v(i.id);
989
- await h("1️⃣ ", r);
990
- let s = await c("2️⃣ ", r, o);
991
- if (await e("3️⃣ Bundle project", "vite", ["build"]), a("4️⃣ Regenerate README"), await Wt(t, n), await l("5️⃣ Stage changes", "git", ["add", "."]), await l("6️⃣ Commit changes", "git", [
995
+ let n = await c("package.json"), r = await c("config.json"), i = _(r.id);
996
+ await y("1️⃣ ", n);
997
+ let a = await g("2️⃣ ", n, i);
998
+ if (await E("3️⃣ ", n), b("4️⃣ Regenerate README"), await Q(e, t), await d("5️⃣ Stage changes", "git", ["add", "."]), await d("6️⃣ Commit changes", "git", [
992
999
  "commit",
993
1000
  "-m",
994
- `v${r.version ?? "unknown"}`
995
- ]), await l("7️⃣ Push changes", "git", [
1001
+ `v${n.version ?? "unknown"}`
1002
+ ]), await d("7️⃣ Push changes", "git", [
996
1003
  "push",
997
1004
  "origin",
998
1005
  "main:main"
999
- ]), await Qt("8️⃣ ", r, s, o), o.publishedTo === "npm") {
1000
- let t = `v${r.version ?? "unknown"}`;
1001
- await e("9️⃣ Create GitHub release", "gh", [
1006
+ ]), await $("8️⃣ ", n, a, i), i.publishedTo === "npm") {
1007
+ let e = `v${n.version ?? "unknown"}`;
1008
+ await x("9️⃣ Create GitHub release", "gh", [
1002
1009
  "release",
1003
1010
  "create",
1004
- t,
1011
+ e,
1005
1012
  "--target",
1006
1013
  "main",
1007
1014
  "--generate-notes",
1008
1015
  "--latest"
1009
1016
  ]);
1010
- } else a(`9️⃣ Publishing NOT required for package with type identifier of '${o.typeId}'.`);
1011
- d(`Project version '${r.version ?? "unknown"}' released.`);
1017
+ } else b(`9️⃣ Publishing NOT required for package with type identifier of '${i.typeId}'.`);
1018
+ o(`Project version '${n.version ?? "unknown"}' released.`);
1012
1019
  } catch (e) {
1013
1020
  console.error("❌ Error releasing project", e), process.exit(1);
1014
1021
  }
1015
1022
  }
1016
1023
  //#endregion
1017
1024
  //#region src/actions/syncProjectWithGitHub.ts
1018
- async function en() {
1025
+ async function rn() {
1019
1026
  try {
1020
1027
  f("Synchronise Project with GitHub");
1021
- let e = await C("package.json"), t = await C("config.json"), n = v(t.id);
1022
- await h("1️⃣ ", e), await c("2️⃣ ", e, n), await l("3️⃣ Stage changes", "git", ["add", "."]), await l("4️⃣ Commit changes", "git", [
1028
+ let e = await c("package.json"), t = await c("config.json"), n = _(t.id);
1029
+ await y("1️⃣ ", e), await g("2️⃣ ", e, n), await d("3️⃣ Stage changes", "git", ["add", "."]), await d("4️⃣ Commit changes", "git", [
1023
1030
  "commit",
1024
1031
  "-m",
1025
1032
  `v${e.version ?? "unknown"}`
1026
- ]), await l("5️⃣ Push changes", "git", [
1033
+ ]), await d("5️⃣ Push changes", "git", [
1027
1034
  "push",
1028
1035
  "origin",
1029
1036
  "main:main"
1030
- ]), d(`Project version '${e.version ?? "unknown"}' synchronised with GitHub.`);
1037
+ ]), o(`Project version '${e.version ?? "unknown"}' synchronised with GitHub.`);
1031
1038
  } catch (e) {
1032
1039
  console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
1033
1040
  }
1034
1041
  }
1035
1042
  //#endregion
1036
1043
  //#region src/actions/testProject.ts
1037
- var tn = [
1044
+ var an = [
1038
1045
  "1️⃣ ",
1039
1046
  "2️⃣ ",
1040
1047
  "3️⃣ ",
1041
1048
  "4️⃣ "
1042
- ], nn = [{
1049
+ ], on = [{
1043
1050
  id: "unit",
1044
1051
  label: "Run unit tests",
1045
1052
  command: "vitest",
@@ -1052,23 +1059,23 @@ var tn = [
1052
1059
  arguments: ["test", "--pass-with-no-tests"],
1053
1060
  configFileName: "playwright.config.ts"
1054
1061
  }];
1055
- async function rn(t = ["unit"]) {
1062
+ async function sn(e = ["unit"]) {
1056
1063
  try {
1057
1064
  f("Test Project");
1058
- let n = 0;
1059
- for (let r of nn) {
1060
- if (!t.includes(r.id) || await S(r.configFileName) === null) continue;
1061
- let i = `${tn[n] ?? ""} ${r.label}`;
1062
- await e(i, r.command, r.arguments), n += 1;
1065
+ let t = 0;
1066
+ for (let n of on) {
1067
+ if (!e.includes(n.id) || await i(n.configFileName) === null) continue;
1068
+ let r = `${an[t] ?? ""} ${n.label}`;
1069
+ await x(r, n.command, n.arguments), t += 1;
1063
1070
  }
1064
- if (n === 0) {
1071
+ if (t === 0) {
1065
1072
  console.warn("\n⚠️ No tests configured for this project.\n");
1066
1073
  return;
1067
1074
  }
1068
- d("Project tested");
1075
+ o("Project tested");
1069
1076
  } catch (e) {
1070
1077
  console.error("❌ Error testing project", e), process.exit(1);
1071
1078
  }
1072
1079
  }
1073
1080
  //#endregion
1074
- export { ue as auditDependencies, de as buildProject, Ce as checkProject, Wt as documentProject, Gt as formatCode, Kt as lintCode, Zt as publishProject, $t as releaseProject, en as syncProjectWithGitHub, rn as testProject, Jt as uploadDirectoryToR2 };
1081
+ export { de as auditDependencies, fe as buildProject, we as checkProject, Q as documentProject, Yt as formatCode, Xt as lintCode, tn as publishProject, nn as releaseProject, rn as syncProjectWithGitHub, sn as testProject, Qt as uploadDirectoryToR2 };