@dpuse/dpuse-development 0.3.751 → 0.3.754

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.
@@ -5655,7 +5655,7 @@ function An(e) {
5655
5655
  }
5656
5656
  //#endregion
5657
5657
  //#region src/utilities/index.ts
5658
- var jn = [
5658
+ var jn = "code-health-reports/fallow", Mn = `${jn}/badge.json`, Nn = `${jn}/index.md`, Pn = [
5659
5659
  {
5660
5660
  idPrefix: "dpuse-app",
5661
5661
  typeId: "app",
@@ -5740,8 +5740,8 @@ var jn = [
5740
5740
  publishedTo: "github",
5741
5741
  uploadGroupName: void 0
5742
5742
  }
5743
- ], Mn = r(i);
5744
- async function Nn(e, r) {
5743
+ ], Fn = r(i);
5744
+ async function In(e, r) {
5745
5745
  e !== void 0 && q(`${e} - clear(${r})`);
5746
5746
  let i;
5747
5747
  try {
@@ -5762,12 +5762,12 @@ async function Nn(e, r) {
5762
5762
  }
5763
5763
  }));
5764
5764
  }
5765
- async function Pn(e, n) {
5765
+ async function Ln(e, n) {
5766
5766
  return t.readdir(e, n);
5767
5767
  }
5768
- async function Fn(e, n, r, i) {
5768
+ async function Rn(e, n, r, i) {
5769
5769
  e !== void 0 && q(`${e} - exec(${n} ${r.join(" ")})`);
5770
- let { stdout: a, stderr: o } = await Mn(n, r);
5770
+ let { stdout: a, stderr: o } = await Fn(n, r);
5771
5771
  i === void 0 ? a.trim() && console.log(a.trim()) : await t.writeFile(i, a.trim(), "utf-8"), o.trim() && console.error(o.trim());
5772
5772
  }
5773
5773
  async function U(e, t, n, r = !1, i = !1) {
@@ -5780,7 +5780,7 @@ async function U(e, t, n, r = !1, i = !1) {
5780
5780
  });
5781
5781
  });
5782
5782
  }
5783
- async function In(e, r, i, o, s = !1) {
5783
+ async function zn(e, r, i, o, s = !1) {
5784
5784
  return q(`${e} - spawn(${r} ${i.join(" ")}) > ${o}`), new Promise((e, c) => {
5785
5785
  let l = a(r, i, {
5786
5786
  shell: !1,
@@ -5806,10 +5806,10 @@ async function In(e, r, i, o, s = !1) {
5806
5806
  async function W(e) {
5807
5807
  return JSON.parse(await t.readFile(e, "utf-8"));
5808
5808
  }
5809
- async function Ln(e) {
5809
+ async function Bn(e) {
5810
5810
  return await t.readFile(e, "utf-8");
5811
5811
  }
5812
- async function Rn(e) {
5812
+ async function Vn(e) {
5813
5813
  try {
5814
5814
  return await t.readFile(e, "utf-8");
5815
5815
  } catch (e) {
@@ -5817,13 +5817,13 @@ async function Rn(e) {
5817
5817
  throw e;
5818
5818
  }
5819
5819
  }
5820
- async function zn(e, n) {
5820
+ async function Hn(e, n) {
5821
5821
  await t.writeFile(e, JSON.stringify(n, void 0, 4), "utf-8");
5822
5822
  }
5823
- async function Bn(e, t, n) {
5824
- await Vn("README.md", qn(await Ln("./README.md"), e, t, n));
5823
+ async function Un(e, t, n) {
5824
+ await Wn("README.md", Xn(await Bn("./README.md"), e, t, n));
5825
5825
  }
5826
- async function Vn(e, n) {
5826
+ async function Wn(e, n) {
5827
5827
  await t.writeFile(e, n, "utf-8");
5828
5828
  }
5829
5829
  function G(e) {
@@ -5836,12 +5836,12 @@ function K(e) {
5836
5836
  function q(e) {
5837
5837
  console.info(`\n${e}\n`);
5838
5838
  }
5839
- function Hn(e) {
5840
- let t = jn.find((t) => e.startsWith(t.idPrefix));
5839
+ function Gn(e) {
5840
+ let t = Pn.find((t) => e.startsWith(t.idPrefix));
5841
5841
  if (!t) throw Error(`Failed to locate module type configuration for identifier '${e}'.`);
5842
5842
  return t;
5843
5843
  }
5844
- function Un(e, t) {
5844
+ function Kn(e, t) {
5845
5845
  let n = e.repository, r = typeof n == "string" ? n : n?.url;
5846
5846
  if (r == null || r === "") throw Error(`package.json 'repository' field is required to ${t}.`);
5847
5847
  let i = r.replace(/^git\+/, "").replace(/\.git$/, ""), a = /github\.com[/:]([^/]+)\/([^/]+)$/.exec(i);
@@ -5851,16 +5851,16 @@ function Un(e, t) {
5851
5851
  repo: a[2]
5852
5852
  };
5853
5853
  }
5854
- async function Wn(e) {
5854
+ async function qn(e) {
5855
5855
  return await t.stat(e);
5856
5856
  }
5857
- function Gn(e) {
5857
+ function Jn(e) {
5858
5858
  let t = k.extend(An()).parse(e, {
5859
5859
  ecmaVersion: "latest",
5860
5860
  sourceType: "module",
5861
5861
  locations: !0
5862
5862
  }), n = [];
5863
- return Kn(t, (e) => {
5863
+ return Yn(t, (e) => {
5864
5864
  if (e.type !== "MethodDefinition") return;
5865
5865
  let t = e, r = t.key;
5866
5866
  if (r.type !== "Identifier") return;
@@ -5868,7 +5868,7 @@ function Gn(e) {
5868
5868
  i && i !== "constructor" && t.accessibility !== "private" && n.push(i);
5869
5869
  }), n;
5870
5870
  }
5871
- function Kn(e, t) {
5871
+ function Yn(e, t) {
5872
5872
  t(e);
5873
5873
  for (let [n, r] of Object.entries(e)) {
5874
5874
  if ([
@@ -5881,12 +5881,12 @@ function Kn(e, t) {
5881
5881
  let e = r;
5882
5882
  if (Array.isArray(e)) for (let n of e) {
5883
5883
  let e = n;
5884
- e && typeof e.type == "string" && Kn(e, t);
5884
+ e && typeof e.type == "string" && Yn(e, t);
5885
5885
  }
5886
- else e && typeof e == "object" && typeof e.type == "string" && Kn(e, t);
5886
+ else e && typeof e == "object" && typeof e.type == "string" && Yn(e, t);
5887
5887
  }
5888
5888
  }
5889
- function qn(e, t, n, r) {
5889
+ function Xn(e, t, n, r) {
5890
5890
  let i = e.indexOf(n), a = e.indexOf(r);
5891
5891
  if (i === -1 || a === -1) throw Error(`Markers ${n}-${r} not found in content.`);
5892
5892
  let o = t.trim();
@@ -5894,7 +5894,7 @@ function qn(e, t, n, r) {
5894
5894
  }
5895
5895
  //#endregion
5896
5896
  //#region src/actions/auditDependencies.ts
5897
- async function Jn() {
5897
+ async function Zn() {
5898
5898
  try {
5899
5899
  G("Audit Dependencies"), await U("1️⃣ Check using 'npm audit'", "npm", ["audit"]), K("Dependencies audited");
5900
5900
  } catch (e) {
@@ -5903,42 +5903,40 @@ async function Jn() {
5903
5903
  }
5904
5904
  //#endregion
5905
5905
  //#region src/actions/checkConfigFiles.ts
5906
- var Yn = "@dpuse/dpuse-development/prettierrc", Xn = "dpuse-development";
5907
- async function Zn() {
5906
+ var Qn = "@dpuse/dpuse-development/prettierrc", $n = "dpuse-development";
5907
+ async function er() {
5908
5908
  try {
5909
5909
  G("Check configuration files"), q("1️⃣ Check individual files");
5910
- let e = await W("config.json"), t = await W("package.json"), r = t.private === !0, i = Hn(e.id), a = n.dirname(o(import.meta.url));
5911
- await J(a, ".editorconfig"), await Qn(i, a), await J(a, ".gitignore", [".gitignore_default"]), await J(a, ".markdownlint.json"), await J(a, ".ncurc.json"), await $n(i, a), await J(a, "LICENSE"), await tr(i, a), await nr(i, a), await rr(i, a), await ar(i, a), er(i, t), await J(a, ".github/dependabot.yml", [r ? ".github/dependabot.private.yml" : ".github/dependabot.yml"]), r ? console.info("ℹ️ GitHub workflows and file 'SECURITY.md' are NOT required by this project") : (await ir(i, a), await J(a, "SECURITY.md", [], (t) => t.replaceAll(Xn, () => e.id))), K("Configuration files checked");
5910
+ let e = await W("config.json"), t = await W("package.json"), r = t.private === !0, i = Gn(e.id), a = n.dirname(o(import.meta.url));
5911
+ await J(a, ".editorconfig"), await J(a, ".gitattributes"), await J(a, ".gitignore", [".gitignore_default"]), await J(a, ".markdownlint.json"), await J(a, ".ncurc.json"), await tr(i, a), await J(a, "LICENSE"), await rr(i, a), await ir(i, a), await ar(i, a), await sr(i, a), nr(i, t), await J(a, ".github/dependabot.yml", [r ? ".github/dependabot.private.yml" : ".github/dependabot.yml"]), r ? console.info("ℹ️ GitHub workflows and file 'SECURITY.md' are NOT required by this project") : (await or(i, a), await J(a, "SECURITY.md", [], (t) => t.replaceAll($n, () => e.id))), K("Configuration files checked");
5912
5912
  } catch (e) {
5913
5913
  console.error("❌ Error checking configuration files", e), process.exit(1);
5914
5914
  }
5915
5915
  }
5916
- async function Qn(e, t) {
5917
- ["development"].includes(e.typeId) ? console.info("ℹ️ File '.gitattributes' is UNIQUE to this project") : await J(t, ".gitattributes", [".gitattributes_default"]);
5918
- }
5919
- async function $n(e, t) {
5916
+ async function tr(e, t) {
5920
5917
  ["github", "kb"].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is NOT required by this project") : [
5921
5918
  "app",
5922
5919
  "api",
5923
5920
  "development",
5924
5921
  "eslint"
5925
- ].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is UNIQUE to this project") : await J(t, "eslint.config.js", ["eslint.config.default.js"]);
5922
+ ].includes(e.typeId) ? console.info("⚠️ File 'eslint.config.js' is UNIQUE to this project") : await J(t, "eslint.config.js", ["eslint.config.default.js"]);
5926
5923
  }
5927
- function er(e, t) {
5928
- ["app", "development"].includes(e.typeId) ? console.info("ℹ️ File '.prettierrc.json' is UNIQUE to this project") : t.prettier === Yn ? console.info(`ℹ️ Prettier configuration is '${Yn}'`) : console.info(`⚠️ Prettier configuration is NOT '${Yn}'`);
5924
+ function nr(e, t) {
5925
+ 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 === Qn ? console.info(`ℹ️ Prettier configuration is '${Qn}'`) : console.info(`❌ Prettier configuration is NOT '${Qn}'`);
5929
5926
  }
5930
- async function tr(e, t) {
5927
+ async function rr(e, t) {
5931
5928
  ["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.json' is NOT required by this project") : [
5932
5929
  "connector",
5930
+ "development",
5933
5931
  "engine",
5934
5932
  "shared",
5935
5933
  "tool"
5936
- ].includes(e.typeId) ? await J(t, "tsconfig.json", ["tsconfig.default.json"]) : console.info("ℹ️ File 'tsconfig.json' is UNIQUE to this project");
5934
+ ].includes(e.typeId) ? await J(t, "tsconfig.json") : console.info("⚠️ File 'tsconfig.json' is UNIQUE to this project");
5937
5935
  }
5938
- async function nr(e, t) {
5936
+ async function ir(e, t) {
5939
5937
  ["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.scripts.json' is NOT required by this project") : await J(t, "tsconfig.scripts.json");
5940
5938
  }
5941
- async function rr(e, t) {
5939
+ async function ar(e, t) {
5942
5940
  if ([
5943
5941
  "eslint",
5944
5942
  "github",
@@ -5950,16 +5948,16 @@ async function rr(e, t) {
5950
5948
  "development",
5951
5949
  "engine",
5952
5950
  "shared"
5953
- ].includes(e.typeId)) console.info("ℹ️ File 'vite.config.ts' is UNIQUE to this project");
5951
+ ].includes(e.typeId)) console.info("⚠️ File 'vite.config.ts' is UNIQUE to this project");
5954
5952
  else {
5955
5953
  let n;
5956
5954
  n = e.typeId === "connector" ? ["vite.config.default.ts", "vite.config.wasm.ts"] : e.typeId === "tool" ? ["vite.config.tool.ts"] : ["vite.config.default.ts"], await J(t, "vite.config.ts", n);
5957
5955
  }
5958
5956
  }
5959
- async function ir(e, t) {
5957
+ async function or(e, t) {
5960
5958
  await J(t, ".github/workflows/ci.yml"), await J(t, ".github/workflows/codeql.yml"), await J(t, ".github/workflows/publish.yml", [e.publishedTo === "npm" ? ".github/workflows/publish.yml" : ".github/publish.cloudflare.yml"]), await J(t, ".github/workflows/scorecard.yml");
5961
5959
  }
5962
- async function ar(e, t) {
5960
+ async function sr(e, t) {
5963
5961
  [
5964
5962
  "app",
5965
5963
  "api",
@@ -5971,26 +5969,26 @@ async function ar(e, t) {
5971
5969
  async function J(e, t, r = [], i = (e) => e) {
5972
5970
  let a = n.resolve(process.cwd(), t), o = r.length > 0 ? r : [t], s;
5973
5971
  try {
5974
- s = await Ln(a);
5972
+ s = await Bn(a);
5975
5973
  } catch (e) {
5976
5974
  if (e.code !== "ENOENT") throw e;
5977
5975
  }
5978
5976
  if (s === void 0) {
5979
- console.info(`⚠️ File '${t}' is MISSING`);
5977
+ console.info(`❌ File '${t}' is MISSING`);
5980
5978
  return;
5981
5979
  }
5982
5980
  for (let r of o) {
5983
- let a = i(await Ln(n.resolve(e, `../${r}`)));
5981
+ let a = i(await Bn(n.resolve(e, `../${r}`)));
5984
5982
  if (s === a) {
5985
5983
  console.info(`ℹ️ File '${t.split("_", 1)[0] ?? t}' is the same as '${r}'`);
5986
5984
  return;
5987
5985
  }
5988
5986
  }
5989
- console.info(`⚠️ File '${t.split("_", 1)[0] ?? t}' is NOT the same`);
5987
+ console.info(`❌ File '${t.split("_", 1)[0] ?? t}' is NOT the same`);
5990
5988
  }
5991
5989
  //#endregion
5992
5990
  //#region src/actions/checkDependencies.ts
5993
- async function or() {
5991
+ async function cr() {
5994
5992
  try {
5995
5993
  G("Check Dependencies"), await U("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), q("2️⃣ Check using 'npm-check-updates'");
5996
5994
  let e = {};
@@ -6010,7 +6008,7 @@ async function or() {
6010
6008
  "--prefer-online",
6011
6009
  "--no-strict-allow-scripts"
6012
6010
  ]);
6013
- let t = await sr();
6011
+ let t = await lr();
6014
6012
  t.length > 0 ? await U("4️⃣ Move install-script pins to installed versions", "npm", [
6015
6013
  "install-scripts",
6016
6014
  "approve",
@@ -6024,85 +6022,85 @@ async function or() {
6024
6022
  console.error("❌ Error checking dependencies", e), process.exit(1);
6025
6023
  }
6026
6024
  }
6027
- async function sr() {
6025
+ async function lr() {
6028
6026
  let { allowScripts: e = {} } = await W(n.resolve(process.cwd(), "package.json")), t = Object.entries(e).filter(([e, t]) => t && e.lastIndexOf("@") > 0).map(([e]) => e.slice(0, e.lastIndexOf("@")));
6029
6027
  return [...new Set(t)];
6030
6028
  }
6031
6029
  //#endregion
6032
6030
  //#region src/actions/documentBundleSizes.ts
6033
- var cr = "<!-- BUNDLE_START -->", lr = "<!-- BUNDLE_END -->", ur = "&nbsp;&nbsp;&nbsp;&nbsp;", dr = 20, fr = "The Bundle Analysis Report is generated automatically on each release 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._", pr = "(bundler output, whitespace & JSON)", mr = `${pr} = 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.`;
6034
- async function hr(e) {
6031
+ var ur = "<!-- BUNDLE_START -->", dr = "<!-- BUNDLE_END -->", fr = "&nbsp;&nbsp;&nbsp;&nbsp;", pr = 20, mr = "This report is updated each time the project is built, 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._", hr = "(bundler output, whitespace & JSON)", gr = `${hr} = 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.`;
6032
+ async function _r(e) {
6035
6033
  try {
6036
6034
  G("Document Bundle Sizes"), q("1️⃣ Read bundle analysis report");
6037
6035
  let t = await W("./bundle-analysis-reports/sonda/index.json");
6038
- q("2️⃣ Insert table into 'README.md'"), await Bn(`## Bundle Analysis\n\n${fr}\n\n${gr(t, e?.moduleLevel ?? !1)}\n\n${mr}`, cr, lr), K("Bundle sizes documented");
6036
+ q("2️⃣ Insert table into 'README.md'"), await Un(`## Bundle Analysis\n\n${mr}\n\n${vr(t, e?.moduleLevel ?? !1)}\n\n${gr}`, ur, dr), K("Bundle sizes documented");
6039
6037
  } catch (e) {
6040
6038
  console.error("❌ Error documenting bundle sizes", e), process.exit(1);
6041
6039
  }
6042
6040
  }
6043
- function gr(e, t) {
6044
- let n = Cr(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, Dr(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), a = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
6041
+ function vr(e, t) {
6042
+ let n = Tr(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, kr(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), a = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
6045
6043
  for (let [e, o] of i) {
6046
- let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted((e, t) => t[1].sizes.uncompressed - e[1].sizes.uncompressed), s = i.length === 1 ? _r(e, o, xr(i), r, t) : vr(e, o, i, r, t);
6044
+ let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted((e, t) => t[1].sizes.uncompressed - e[1].sizes.uncompressed), s = i.length === 1 ? yr(e, o, Cr(i), r, t) : br(e, o, i, r, t);
6047
6045
  a.push(...s);
6048
6046
  }
6049
6047
  return a.join("\n");
6050
6048
  }
6051
- function _r(e, t, n, r, i) {
6049
+ function yr(e, t, n, r, i) {
6052
6050
  let [a, { sizes: o, files: s }] = n, c = r > 0 ? o.uncompressed / r * 100 : 0;
6053
- if (s.size === 1) return [`| ${e} → ${br(a, Sr(s))} | ${Or(t)} · ${kr(c)} |`];
6054
- let l = [`| ${e} → ${a} | ${Or(t)} · ${kr(c)} |`];
6055
- return i || l.push(...yr(s, ur, r)), l;
6051
+ if (s.size === 1) return [`| ${e} → ${Sr(a, wr(s))} | ${Ar(t)} · ${jr(c)} |`];
6052
+ let l = [`| ${e} → ${a} | ${Ar(t)} · ${jr(c)} |`];
6053
+ return i || l.push(...xr(s, fr, r)), l;
6056
6054
  }
6057
- function vr(e, t, n, r, i) {
6058
- let a = [`| ${e} | ${Or(t)} |`];
6055
+ function br(e, t, n, r, i) {
6056
+ let a = [`| ${e} | ${Ar(t)} |`];
6059
6057
  for (let [e, { sizes: t, files: o }] of n) {
6060
6058
  let n = r > 0 ? t.uncompressed / r * 100 : 0;
6061
6059
  if (o.size === 1) {
6062
- let t = Sr(o);
6063
- a.push(`| ${ur}${br(e, t)} | ${kr(n)} |`);
6060
+ let t = wr(o);
6061
+ a.push(`| ${fr}${Sr(e, t)} | ${jr(n)} |`);
6064
6062
  continue;
6065
6063
  }
6066
- a.push(`| ${ur}${e} | ${kr(n)} |`), i || a.push(...yr(o, `${ur}${ur}`, r));
6064
+ a.push(`| ${fr}${e} | ${jr(n)} |`), i || a.push(...xr(o, `${fr}${fr}`, r));
6067
6065
  }
6068
6066
  return a;
6069
6067
  }
6070
- function yr(e, t, n) {
6071
- return [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed).map(([e, r]) => `| ${t}${e} | ${kr(n > 0 ? r.uncompressed / n * 100 : 0)} |`);
6068
+ function xr(e, t, n) {
6069
+ return [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed).map(([e, r]) => `| ${t}${e} | ${jr(n > 0 ? r.uncompressed / n * 100 : 0)} |`);
6072
6070
  }
6073
- function br(e, t) {
6071
+ function Sr(e, t) {
6074
6072
  return t === "" ? e : `${e} → ${t}`;
6075
6073
  }
6076
- function xr(e) {
6074
+ function Cr(e) {
6077
6075
  let [t] = e;
6078
6076
  if (t === void 0) throw Error("Expected exactly one entry");
6079
6077
  return t;
6080
6078
  }
6081
- function Sr(e) {
6079
+ function wr(e) {
6082
6080
  let [t] = e.keys();
6083
6081
  if (t === void 0) throw Error("Expected exactly one file");
6084
6082
  return t;
6085
6083
  }
6086
- function Cr(e) {
6087
- let t = wr(e.dependencies), n = /* @__PURE__ */ new Map();
6084
+ function Tr(e) {
6085
+ let t = Er(e.dependencies), n = /* @__PURE__ */ new Map();
6088
6086
  for (let r of e.resources) {
6089
6087
  if (r.kind !== "chunk" || !r.parent) continue;
6090
- let { group: e, file: i } = Tr(r.name, t), a = Dr(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
6088
+ let { group: e, file: i } = Dr(r.name, t), a = kr(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
6091
6089
  n.set(r.parent, o);
6092
6090
  let s = o.get(e) ?? {
6093
- sizes: Ar(),
6091
+ sizes: Mr(),
6094
6092
  files: /* @__PURE__ */ new Map()
6095
6093
  };
6096
- o.set(e, s), jr(s.sizes, a);
6097
- let c = s.files.get(i) ?? Ar();
6098
- s.files.set(i, c), jr(c, a);
6094
+ o.set(e, s), Nr(s.sizes, a);
6095
+ let c = s.files.get(i) ?? Mr();
6096
+ s.files.set(i, c), Nr(c, a);
6099
6097
  }
6100
6098
  return n;
6101
6099
  }
6102
- function wr(e) {
6100
+ function Er(e) {
6103
6101
  return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
6104
6102
  }
6105
- function Tr(e, t) {
6103
+ function Dr(e, t) {
6106
6104
  let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
6107
6105
  if (n) {
6108
6106
  let [t, r] = n;
@@ -6112,56 +6110,56 @@ function Tr(e, t) {
6112
6110
  };
6113
6111
  }
6114
6112
  return e === "[unassigned]" ? {
6115
- group: pr,
6113
+ group: hr,
6116
6114
  file: ""
6117
6115
  } : e.startsWith("\0") ? {
6118
6116
  group: "(runtime)",
6119
6117
  file: e.slice(1)
6120
6118
  } : {
6121
6119
  group: e.startsWith("rust/") || e.includes("vite-plugin-wasm") ? "wasm" : "src",
6122
- file: Er(e)
6120
+ file: Or(e)
6123
6121
  };
6124
6122
  }
6125
- function Er(e) {
6123
+ function Or(e) {
6126
6124
  return e.split("/").at(-1) ?? e;
6127
6125
  }
6128
- function Dr(e) {
6126
+ function kr(e) {
6129
6127
  return {
6130
6128
  uncompressed: e.uncompressed,
6131
6129
  gzip: e.gzip ?? 0
6132
6130
  };
6133
6131
  }
6134
- function Or(e) {
6135
- return `${Mr(e.uncompressed)} · gzip ${Mr(e.gzip)}`;
6132
+ function Ar(e) {
6133
+ return `${Pr(e.uncompressed)} · gzip ${Pr(e.gzip)}`;
6136
6134
  }
6137
- function kr(e) {
6138
- let t = Math.round(e / 100 * dr);
6139
- return `\`${"█".repeat(t)}${"░".repeat(dr - t)}\` ${e.toFixed(1)}%`;
6135
+ function jr(e) {
6136
+ let t = Math.round(e / 100 * pr);
6137
+ return `\`${"█".repeat(t)}${"░".repeat(pr - t)}\` ${e.toFixed(1)}%`;
6140
6138
  }
6141
- function Ar() {
6139
+ function Mr() {
6142
6140
  return {
6143
6141
  uncompressed: 0,
6144
6142
  gzip: 0
6145
6143
  };
6146
6144
  }
6147
- function jr(e, t) {
6145
+ function Nr(e, t) {
6148
6146
  e.uncompressed += t.uncompressed, e.gzip += t.gzip;
6149
6147
  }
6150
- function Mr(e) {
6148
+ function Pr(e) {
6151
6149
  return e < 1024 ? `${String(e)} B` : `${(e / 1024).toFixed(1)} kB`;
6152
6150
  }
6153
6151
  //#endregion
6154
6152
  //#region src/actions/documentDependencies.ts
6155
- var Nr = "<!-- DEPENDENCY_LICENSES_START -->", Pr = "<!-- DEPENDENCY_LICENSES_END -->", Fr = "## Dependency Licenses", Ir = "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.";
6156
- async function Lr(e = "MIT") {
6153
+ var Fr = "<!-- DEPENDENCY_LICENSES_START -->", Ir = "<!-- DEPENDENCY_LICENSES_END -->", Lr = "## Dependency Licenses", Rr = "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.";
6154
+ async function zr(e = "MIT") {
6157
6155
  try {
6158
6156
  G("Document Dependencies");
6159
6157
  let t = await W("package.json");
6160
6158
  if (t.name === "@dpuse/dpuse-development" || t.name === "@dpuse/eslint-config-dpuse") {
6161
- await Rr(t.name), K("Dependencies documented");
6159
+ await Br(t.name), K("Dependencies documented");
6162
6160
  return;
6163
6161
  }
6164
- await Nn("1️⃣ Clear downloaded licenses", "licenses/downloads"), q("2️⃣ Identify production licenses"), await new Promise((n, r) => {
6162
+ await In("1️⃣ Clear downloaded licenses", "licenses/downloads"), q("2️⃣ Identify production licenses"), await new Promise((n, r) => {
6165
6163
  let i = {
6166
6164
  start: process.cwd(),
6167
6165
  production: !0,
@@ -6176,41 +6174,41 @@ async function Lr(e = "MIT") {
6176
6174
  c(i, (e) => {
6177
6175
  e == null ? n() : r(e);
6178
6176
  });
6179
- }), await In("3️⃣ Identify transitive dependencies", "npm", [
6177
+ }), await zn("3️⃣ Identify transitive dependencies", "npm", [
6180
6178
  "ls",
6181
6179
  "--all",
6182
6180
  "--json",
6183
6181
  "--omit=dev"
6184
- ], "licenses/licenseTree.json"), await zr("4️⃣ ", e), K("Dependencies documented");
6182
+ ], "licenses/licenseTree.json"), await Vr("4️⃣ ", e), K("Dependencies documented");
6185
6183
  } catch (e) {
6186
6184
  console.error("❌ Error documenting dependencies", e), process.exit(1);
6187
6185
  }
6188
6186
  }
6189
- async function Rr(e) {
6190
- q(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`), await Bn(`${Fr}\n\n${`> [!WARNING]\n> Dependency licenses are not documented here: ${e} is a development-only tool and is never part of a production release.`}`, Nr, Pr);
6187
+ async function Br(e) {
6188
+ q(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`), await Un(`${Lr}\n\n${`> [!WARNING]\n> Dependency licenses are not documented here: ${e} is a development-only tool and is never part of a production release.`}`, Fr, Ir);
6191
6189
  }
6192
- async function zr(e, t) {
6190
+ async function Vr(e, t) {
6193
6191
  q(`${e} Insert licenses into 'README.md'`);
6194
6192
  let [n, r] = await Promise.all([W("licenses/licenses.json"), W("licenses/licenseTree.json")]), i = /* @__PURE__ */ new Map();
6195
- for (let [e, t] of Object.entries(n)) i.set(e, Hr(e, t));
6193
+ for (let [e, t] of Object.entries(n)) i.set(e, Wr(e, t));
6196
6194
  await Promise.all(i.values().map(async (e) => {
6197
- let t = await Ur(e.name, e.installedVersion);
6195
+ let t = await Gr(e.name, e.installedVersion);
6198
6196
  e.latestVersion = t.latestVersion, e.latestPublishedDate = t.latestPublishedDate, e.publishedDate = t.publishedDate;
6199
6197
  }));
6200
- let a = `${Br(t)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
6201
- for (let e of i.values()) a += Wr(e);
6198
+ let a = `${Hr(t)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
6199
+ for (let e of i.values()) a += Kr(e);
6202
6200
  let o = [];
6203
- r.dependencies != null && Gr(r.dependencies, i, o, 0);
6204
- let s = `${Ir}\n\n${o.join("\n")}`;
6205
- await Bn(`${Fr}\n\n${a.trimEnd()}\n\n### Dependency Tree\n\n${s}`, Nr, Pr);
6201
+ r.dependencies != null && qr(r.dependencies, i, o, 0);
6202
+ let s = `${Rr}\n\n${o.join("\n")}`;
6203
+ await Un(`${Lr}\n\n${a.trimEnd()}\n\n### Dependency Tree\n\n${s}`, Fr, Ir);
6206
6204
  }
6207
- function Br(e) {
6208
- return `License data is collected automatically on each release 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 ${Vr(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.`;
6205
+ function Hr(e) {
6206
+ 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 ${Ur(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.`;
6209
6207
  }
6210
- function Vr(e) {
6208
+ function Ur(e) {
6211
6209
  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))}`;
6212
6210
  }
6213
- function Hr(e, t) {
6211
+ function Wr(e, t) {
6214
6212
  let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
6215
6213
  return {
6216
6214
  name: r,
@@ -6224,7 +6222,7 @@ function Hr(e, t) {
6224
6222
  ...t.licenseFile != null && { licenseFileLink: t.licenseFile }
6225
6223
  };
6226
6224
  }
6227
- async function Ur(e, t) {
6225
+ async function Gr(e, t) {
6228
6226
  try {
6229
6227
  let n = await fetch(`https://registry.npmjs.org/${encodeURIComponent(e)}`);
6230
6228
  if (n.ok) {
@@ -6242,25 +6240,25 @@ async function Ur(e, t) {
6242
6240
  publishedDate: ""
6243
6241
  };
6244
6242
  }
6245
- function Wr(e) {
6243
+ function Kr(e) {
6246
6244
  let t = e.licenseFileLink == null || e.licenseFileLink === "" ? "⚠️ No license file" : `[LICENSE](licenses/${e.licenseFileLink})`;
6247
6245
  return `|[${e.name}](${e.repository})|${e.installedVersion}|${e.licenseTypes}|${t}|\n`;
6248
6246
  }
6249
- function Gr(e, t, n, r) {
6247
+ function qr(e, t, n, r) {
6250
6248
  let i = " ".repeat(r);
6251
6249
  for (let [a, o] of Object.entries(e)) {
6252
- let e = o.version ?? "", s = t.get(`${a}@${e}`), c = s == null ? a : `[${a}](${s.repository})`, l = Kr(s);
6253
- n.push(`${i}- **${c}** ${e}${l}`), o.dependencies != null && Gr(o.dependencies, t, n, r + 1);
6250
+ let e = o.version ?? "", s = t.get(`${a}@${e}`), c = s == null ? a : `[${a}](${s.repository})`, l = Jr(s);
6251
+ n.push(`${i}- **${c}** ${e}${l}`), o.dependencies != null && qr(o.dependencies, t, n, r + 1);
6254
6252
  }
6255
6253
  }
6256
- function Kr(e) {
6254
+ function Jr(e) {
6257
6255
  if (e == null) return "";
6258
- let t = e.publishedDate ? qr(e.publishedDate.split("T", 1)[0]) : "";
6256
+ let t = e.publishedDate ? Yr(e.publishedDate.split("T", 1)[0]) : "";
6259
6257
  if (e.latestVersion === "" || e.latestVersion === e.installedVersion) return t === "" ? "" : ` — ${t}`;
6260
- let n = e.latestPublishedDate ? qr(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `**latest**: ${e.latestVersion} ❗` : `**latest**: ${e.latestVersion} — ${n} ❗`;
6258
+ let n = e.latestPublishedDate ? Yr(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `**latest**: ${e.latestVersion} ❗` : `**latest**: ${e.latestVersion} — ${n} ❗`;
6261
6259
  return t === "" ? ` — → ${r}` : ` — ${t} → ${r}`;
6262
6260
  }
6263
- function qr(e) {
6261
+ function Yr(e) {
6264
6262
  if (e == null || e === "") return "n/a";
6265
6263
  let t = e.split("T", 1)[0];
6266
6264
  if (t == null || t === "") return "n/a";
@@ -6269,81 +6267,89 @@ function qr(e) {
6269
6267
  }
6270
6268
  //#endregion
6271
6269
  //#region src/actions/documentGovernance.ts
6272
- var Jr = "<!-- GOVERNANCE_START -->", Yr = "<!-- GOVERNANCE_END -->", Xr = {
6270
+ var Xr = "<!-- GOVERNANCE_START -->", Zr = "<!-- GOVERNANCE_END -->", Qr = {
6273
6271
  "Branch-Protection": 3,
6274
6272
  "Code-Review": 0,
6275
6273
  Contributors: 0
6276
- }, Zr = /* @__PURE__ */ new Set(["CII-Best-Practices"]), Qr = {
6274
+ }, $r = /* @__PURE__ */ new Set(["CII-Best-Practices"]), ei = "coverage/coverage-final.json", ti = "coverage/coverage-summary.json", ni = 80, ri = {
6277
6275
  actions: "GitHub Actions",
6278
6276
  "javascript-typescript": "JavaScript/TypeScript",
6279
6277
  rust: "Rust"
6280
- }, $r = "code-health-reports/fallow", ei = {
6278
+ }, ii = {
6281
6279
  A: "brightgreen",
6282
6280
  B: "green",
6283
6281
  C: "yellow",
6284
6282
  D: "orange",
6285
6283
  F: "red"
6286
- }, ti = `${$r}/health.json`, ni = `${$r}/index.md`, ri = r(i);
6287
- async function ii() {
6284
+ }, ai = `${jn}/health.json`, oi = r(i);
6285
+ async function si() {
6288
6286
  try {
6289
6287
  G("Document Governance");
6290
- let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = await ai(e), { owner: r, repo: i } = Un(e, "document governance");
6291
- q("3️⃣ Read security checks and settings");
6292
- let a = await si(r, i, e);
6293
- q("4️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
6294
- let [o, s] = await Promise.all([li(`https://github.com/${r}/${i}`), ui(`github.com/${r}/${i}`)]);
6295
- q("5️⃣ Insert governance content into 'README.md'"), await Bn(hi(r, i, fi(e), pi(t.firstCreatedAt), n, o, a, s), Jr, Yr), K("Governance documented");
6288
+ let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = await ci(e), r = await li(e, n === void 0 ? [] : ["--coverage", ei]), { owner: i, repo: a } = Kn(e, "document governance");
6289
+ q("4️⃣ Read security checks and settings");
6290
+ let o = await di(i, a, e);
6291
+ q("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
6292
+ let [s, c] = await Promise.all([pi(`https://github.com/${i}/${a}`), mi(`github.com/${i}/${a}`)]);
6293
+ q("6️⃣ Insert governance content into 'README.md'"), await Un(bi(i, a, gi(e), _i(t.firstCreatedAt), {
6294
+ coveragePercent: n,
6295
+ fallowHealth: r,
6296
+ securitySettings: o
6297
+ }, s, c), Xr, Zr), K("Governance documented");
6296
6298
  } catch (e) {
6297
6299
  console.error("❌ Error documenting governance", e), process.exit(1);
6298
6300
  }
6299
6301
  }
6300
- async function ai(e) {
6302
+ async function ci(e) {
6303
+ if (e.devDependencies?.["@vitest/coverage-v8"] == null) {
6304
+ q("1️⃣ Test coverage NOT measured, as '@vitest/coverage-v8' is not installed");
6305
+ return;
6306
+ }
6307
+ await U("1️⃣ Measure test coverage", "vitest", [
6308
+ "run",
6309
+ "--passWithNoTests",
6310
+ "--coverage"
6311
+ ]);
6312
+ let t = await Vn(ti);
6313
+ return t === null ? void 0 : JSON.parse(t).total.lines.pct;
6314
+ }
6315
+ async function li(e, t) {
6301
6316
  if (e.devDependencies?.fallow == null) {
6302
- q("1️⃣ Code health NOT measured, as Fallow is not installed"), q("2️⃣ Code health report NOT required");
6317
+ q("2️⃣ Code health NOT measured, as Fallow is not installed"), q("3️⃣ Code health report NOT required");
6303
6318
  return;
6304
6319
  }
6305
- return await In("1️⃣ Measure code health", "fallow", [
6320
+ await zn("2️⃣ Measure code health", "fallow", [
6306
6321
  "health",
6307
6322
  "--report-only",
6308
6323
  "--format",
6309
- "json"
6310
- ], ti), await In("2️⃣ Write code health report", "fallow", ["--format", "markdown"], ni, !0), await W(ti);
6324
+ "json",
6325
+ ...t
6326
+ ], ai), await zn("3️⃣ Write code health report", "fallow", ["--format", "markdown"], Nn, !0);
6327
+ let n = await W(ai);
6328
+ return await ui(n), n;
6311
6329
  }
6312
- function oi(e) {
6313
- let { score: t, grade: n } = e.health_score, { functions_above_threshold: r, functions_analyzed: i, average_maintainability: a } = e.summary, o = e.vital_signs;
6314
- return `### Code Health
6315
-
6316
- [![Fallow code health](${`https://img.shields.io/badge/fallow-${encodeURIComponent(`${n} (${String(Math.round(t))})`).replaceAll("-", "--").replaceAll("(", "%28").replaceAll(")", "%29")}-${ei[n] ?? "lightgrey"}`})](./${ni})
6317
-
6318
- [Fallow](https://github.com/fallow-rs/fallow) analyses the TypeScript source on each release for unused code, duplication, complexity, and dependency hygiene. See the [full Fallow report](./${ni}) for every finding.
6319
-
6320
- |Measure|Value|
6321
- |:-|-:|
6322
- |Health score|${t.toFixed(1)} (${n})|
6323
- |Maintainability (average)|${a.toFixed(1)}|
6324
- |Unused files|${o.dead_file_pct.toFixed(1)}%|
6325
- |Unused exports|${o.dead_export_pct.toFixed(1)}%|
6326
- |Duplicated code|${o.duplication_pct.toFixed(1)}%|
6327
- |Functions over the complexity limits|${String(r)} of ${String(i)}|
6328
- |Unused dependencies|${String(o.unused_dep_count)}|
6329
- |Circular dependencies|${String(o.circular_dep_count)}|
6330
- |Hotspots (complex and often changed)|${String(o.hotspot_count)}|
6331
-
6332
- `;
6330
+ async function ui(e) {
6331
+ let { score: t, grade: n } = e.health_score;
6332
+ await Hn(Mn, {
6333
+ schemaVersion: 1,
6334
+ label: "fallow",
6335
+ message: `${n} (${String(Math.round(t))})`,
6336
+ color: ii[n] ?? "lightgrey"
6337
+ });
6333
6338
  }
6334
- async function si(e, t, n) {
6339
+ async function di(e, t, n) {
6335
6340
  let [r, i, a] = await Promise.all([
6336
- Rn(".github/workflows/ci.yml"),
6337
- Rn(".github/workflows/codeql.yml"),
6338
- Rn(".github/dependabot.yml")
6341
+ Vn(".github/workflows/ci.yml"),
6342
+ Vn(".github/workflows/codeql.yml"),
6343
+ Vn(".github/dependabot.yml")
6339
6344
  ]), [o, s, c, l] = await Promise.all([
6340
- ci(`repos/${e}/${t}`),
6341
- ci(`repos/${e}/${t}/private-vulnerability-reporting`),
6342
- ci(`repos/${e}/${t}/vulnerability-alerts`),
6343
- ci(`repos/${e}/${t}/commits/main/check-runs?per_page=100`)
6345
+ fi(`repos/${e}/${t}`),
6346
+ fi(`repos/${e}/${t}/private-vulnerability-reporting`),
6347
+ fi(`repos/${e}/${t}/vulnerability-alerts`),
6348
+ fi(`repos/${e}/${t}/commits/main/check-runs?per_page=100`)
6344
6349
  ]), 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;
6345
6350
  return {
6346
- codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) => Qr[e] ?? e).toArray(),
6351
+ codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) => ri[e] ?? e).toArray(),
6352
+ codeQLQueries: /queries: ([\w-]+)/.exec(i ?? "")?.[1],
6347
6353
  dependabotAlerts: c !== void 0,
6348
6354
  dependabotSecurityUpdates: d("dependabot_security_updates"),
6349
6355
  dependabotVersionUpdates: p > m,
@@ -6358,37 +6364,37 @@ async function si(e, t, n) {
6358
6364
  testsInCI: r?.includes("npm test") ?? !1
6359
6365
  };
6360
6366
  }
6361
- async function ci(e) {
6367
+ async function fi(e) {
6362
6368
  try {
6363
- let { stdout: t } = await ri("gh", ["api", e]);
6369
+ let { stdout: t } = await oi("gh", ["api", e]);
6364
6370
  return t;
6365
6371
  } catch (e) {
6366
6372
  if (String(e.stderr).includes("HTTP 404")) return;
6367
6373
  throw e;
6368
6374
  }
6369
6375
  }
6370
- async function li(e) {
6376
+ async function pi(e) {
6371
6377
  let t = await fetch(`https://www.bestpractices.dev/projects.json?url=${encodeURIComponent(e)}`);
6372
6378
  if (!t.ok) throw Error(`OpenSSF Best Practices lookup failed with status ${String(t.status)}.`);
6373
6379
  return (await t.json()).find((t) => t.repo_url === e)?.id;
6374
6380
  }
6375
- async function ui(e) {
6381
+ async function mi(e) {
6376
6382
  let t = await fetch(`https://api.scorecard.dev/projects/${e}`);
6377
6383
  if (t.status !== 404) {
6378
6384
  if (!t.ok) throw Error(`OpenSSF Scorecard lookup failed with status ${String(t.status)}.`);
6379
6385
  return await t.json();
6380
6386
  }
6381
6387
  }
6382
- function di(e) {
6383
- return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Zr.has(e) || Xr[e] !== void 0 && t >= Xr[e]);
6388
+ function hi(e) {
6389
+ return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || $r.has(e) || Qr[e] !== void 0 && t >= Qr[e]);
6384
6390
  }
6385
- function fi(e) {
6391
+ function gi(e) {
6386
6392
  let t = e.author, n = typeof t == "string" ? t : t?.name;
6387
6393
  if (n == null || n === "") throw Error("package.json 'author' field is required to document governance.");
6388
6394
  let r = n.indexOf("<"), i = r === -1 ? -1 : n.indexOf(">", r);
6389
- return (i === -1 ? n : n.slice(0, r).trimEnd() + n.slice(i + 1).trimStart()).trim();
6395
+ return i === -1 ? n.trim() : [n.slice(0, r).trim(), n.slice(i + 1).trim()].filter((e) => e !== "").join(" ");
6390
6396
  }
6391
- function pi(e) {
6397
+ function _i(e) {
6392
6398
  let t = (/* @__PURE__ */ new Date()).getFullYear();
6393
6399
  if (e == null) return String(t);
6394
6400
  let n = new Date(e).getFullYear();
@@ -6397,98 +6403,112 @@ function pi(e) {
6397
6403
  function Y(e, t = "On") {
6398
6404
  return e === void 0 ? "❔ Unknown" : e ? `✅ ${t}` : "❌ Off";
6399
6405
  }
6400
- function mi(e, t, n) {
6401
- let r = `https://github.com/${e}/${t}`, i = Y(n.codeQLLanguages.length > 0, n.codeQLLanguages.join(", "));
6402
- return `### Checks & Settings
6403
-
6404
- Read from the repository each time this README is generated, so the status is current as of the latest release.
6406
+ function vi(e, t) {
6407
+ return t.length === 0 ? "" : `### ${e}
6405
6408
 
6406
6409
  |Check or setting|Status|What it does|
6407
6410
  |:-|:-|:-|
6408
- ${[
6409
- [
6410
- `[CodeQL](${r}/security/code-scanning)`,
6411
- i,
6412
- "Static analysis for security vulnerabilities and coding errors, on every push and pull request to `main` and weekly."
6413
- ],
6411
+ ${t.map((e) => `|${e.join("|")}|`).join("\n")}
6412
+
6413
+ `;
6414
+ }
6415
+ function yi(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
6416
+ let a = `https://github.com/${e}/${t}`, o = [[
6417
+ `[SonarCloud](https://sonarcloud.io/summary/new_code?id=${e}_${t})`,
6418
+ Y(i.sonarCloud),
6419
+ "Code quality and security analysis on every push: bugs, code smells and vulnerabilities."
6420
+ ]];
6421
+ if (r !== void 0) {
6422
+ let { score: e, grade: t } = r.health_score;
6423
+ o.unshift([
6424
+ `[Fallow](./${Nn})`,
6425
+ `✅ ${t} (${String(Math.round(e))})`,
6426
+ "Unused code, duplication, complexity and dependency hygiene."
6427
+ ]);
6428
+ }
6429
+ let s = i.codeQLQueries === "security-extended" ? "using the extended security queries" : "using the default queries", c = [
6414
6430
  [
6415
- `[SonarCloud](https://sonarcloud.io/summary/new_code?id=${e}_${t})`,
6416
- Y(n.sonarCloud),
6417
- "Code quality and security analysis on every push: bugs, code smells and vulnerabilities."
6431
+ `[CodeQL](${a}/security/code-scanning)`,
6432
+ Y(i.codeQLLanguages.length > 0, i.codeQLLanguages.join(", ")),
6433
+ `Static analysis for security vulnerabilities, ${s}, on every push and pull request to \`main\` and weekly.`
6418
6434
  ],
6419
6435
  [
6420
- "Unit tests",
6421
- Y(n.testsInCI),
6422
- "Run in CI on every push to `main`."
6436
+ "Secret scanning",
6437
+ Y(i.secretScanning),
6438
+ "Detects credentials, such as API keys and tokens, committed to the repository."
6423
6439
  ],
6424
6440
  [
6425
- "Property-based tests",
6426
- Y(n.propertyTests, "fast-check"),
6427
- "Fuzz testing: many random inputs per test to find edge cases, run with the unit tests."
6428
- ],
6441
+ "Push protection",
6442
+ Y(i.pushProtection),
6443
+ "Blocks pushes that contain credentials."
6444
+ ]
6445
+ ], l = [[
6446
+ "Unit tests",
6447
+ Y(i.testsInCI),
6448
+ "Run in CI on every push to `main`."
6449
+ ], [
6450
+ "Property-based tests",
6451
+ Y(i.propertyTests, "fast-check"),
6452
+ "Fuzz testing: many random inputs per test to find edge cases, run with the unit tests."
6453
+ ]];
6454
+ if (n !== void 0) {
6455
+ let e = n >= ni ? "✅" : "⚠️";
6456
+ l.push([
6457
+ "Test coverage",
6458
+ `${e} ${n.toFixed(1)}% of lines`,
6459
+ `Share of source lines the unit tests run. The target is ${String(ni)}%.`
6460
+ ]);
6461
+ }
6462
+ let u = [
6429
6463
  [
6430
6464
  "npm audit",
6431
- Y(n.npmAuditInCI),
6432
- n.npmAuditLevel === void 0 ? "Fails CI when any dependency has a known vulnerability." : `Fails CI when a dependency has a known vulnerability of ${n.npmAuditLevel} severity or above.`
6465
+ Y(i.npmAuditInCI),
6466
+ i.npmAuditLevel === void 0 ? "Fails CI when any dependency has a known vulnerability." : `Fails CI when a dependency has a known vulnerability of ${i.npmAuditLevel} severity or above.`
6433
6467
  ],
6434
6468
  [
6435
6469
  "[Socket.dev](https://socket.dev)",
6436
- Y(n.socket),
6470
+ Y(i.socket),
6437
6471
  "Flags supply chain risk in dependencies: malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE."
6438
6472
  ],
6439
6473
  [
6440
6474
  "Dependabot alerts",
6441
- Y(n.dependabotAlerts),
6475
+ Y(i.dependabotAlerts),
6442
6476
  "Alerts when a dependency has a known vulnerability, using the GitHub Advisory Database."
6443
6477
  ],
6444
6478
  [
6445
6479
  "Dependabot security updates",
6446
- Y(n.dependabotSecurityUpdates),
6480
+ Y(i.dependabotSecurityUpdates),
6447
6481
  "Opens pull requests that update vulnerable dependencies."
6448
6482
  ],
6449
6483
  [
6450
6484
  "Dependabot version updates",
6451
- Y(n.dependabotVersionUpdates),
6485
+ Y(i.dependabotVersionUpdates),
6452
6486
  "Opens pull requests for new dependency versions."
6453
- ],
6454
- [
6455
- "Secret scanning",
6456
- Y(n.secretScanning),
6457
- "Detects credentials, such as API keys and tokens, committed to the repository."
6458
- ],
6459
- [
6460
- "Push protection",
6461
- Y(n.pushProtection),
6462
- "Blocks pushes that contain credentials."
6463
- ],
6464
- [
6465
- "Private vulnerability reporting",
6466
- Y(n.privateVulnerabilityReporting),
6467
- "Lets anyone report a vulnerability privately. See [Reporting Vulnerabilities](#reporting-vulnerabilities)."
6468
6487
  ]
6469
- ].map((e) => `|${e.join("|")}|`).join("\n")}
6488
+ ];
6489
+ return `This section is updated each time \`npm run document\` is run. Settings come from the repository's workflow files and GitHub, and test coverage and the Fallow score are measured at the same time.
6470
6490
 
6471
- `;
6491
+ ${vi("Testing", l)}${vi("Code Quality", o)}${vi("Security Analysis", c)}${vi("Dependencies", u)}`;
6472
6492
  }
6473
- function hi(e, t, n, r, i, a, o, s) {
6474
- let c = `https://github.com/${e}/${t}`, l = `github.com/${e}/${t}`, u = `https://www.bestpractices.dev/projects/${String(a)}`, d = s !== void 0 && di(s) ? "\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." : "", f = a === void 0 ? "" : `[![OpenSSF Best Practices](${u}/badge)](${u})\n`, p = o.privateVulnerabilityReporting === !0 ? `Use [GitHub private vulnerability reporting](${c}/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.";
6475
- return `## Security & Quality
6493
+ function bi(e, t, n, r, i, a, o) {
6494
+ let s = `https://github.com/${e}/${t}`, c = `github.com/${e}/${t}`, l = `https://www.bestpractices.dev/projects/${String(a)}`, u = o !== void 0 && hi(o) ? "\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." : "", d = a === void 0 ? "" : `[![OpenSSF Best Practices](${l}/badge)](${l})\n`, f = i.securitySettings.privateVulnerabilityReporting === !0 ? `Use [GitHub private vulnerability reporting](${s}/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.";
6495
+ return `## Quality & Security
6476
6496
 
6477
- ${mi(e, t, o)}${i === void 0 ? "" : oi(i)}### Reporting Vulnerabilities
6497
+ ${yi(e, t, i)}### OpenSSF 🚧
6478
6498
 
6479
- Please do not open public GitHub issues for security vulnerabilities. ${p}
6499
+ ${d}[![OpenSSF Scorecard](https://api.scorecard.dev/projects/${c}/badge)](https://scorecard.dev/viewer/?uri=${c})
6480
6500
 
6481
- ### OpenSSF 🚧
6501
+ This project is working towards the [OpenSSF Best Practices](https://www.bestpractices.dev) Passing badge, a self-certification covering security policy, vulnerability reporting, build processes, code quality, and more. Currently the [OpenSSF Scorecard](https://scorecard.dev) provides an independent automated assessment of the project's security practices and is an ongoing area of improvement.${u}
6482
6502
 
6483
- ${f}[![OpenSSF Scorecard](https://api.scorecard.dev/projects/${l}/badge)](https://scorecard.dev/viewer/?uri=${l})
6503
+ ### Reporting Vulnerabilities
6484
6504
 
6485
- This project is working towards the [OpenSSF Best Practices](https://www.bestpractices.dev) Passing badge, a self-certification covering security policy, vulnerability reporting, build processes, code quality, and more. Currently the [OpenSSF Scorecard](https://scorecard.dev) provides an independent automated assessment of the project's security practices and is an ongoing area of improvement.${d}
6505
+ Please do not open public GitHub issues for security vulnerabilities. ${f}
6486
6506
 
6487
6507
  ## Contributing
6488
6508
 
6489
6509
  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.
6490
6510
 
6491
- For security vulnerabilities, see [Reporting Vulnerabilities](#reporting-vulnerabilities). For bugs, inconsistencies, or other feedback, [open a GitHub issue](${c}/issues) — feedback is read, but responses and fixes are at the maintainer's discretion.
6511
+ For security vulnerabilities, see [Reporting Vulnerabilities](#reporting-vulnerabilities). For bugs, inconsistencies, or other feedback, [open a GitHub issue](${s}/issues) — feedback is read, but responses and fixes are at the maintainer's discretion.
6492
6512
 
6493
6513
  ## License
6494
6514
 
@@ -6498,28 +6518,28 @@ This project is licensed under the MIT License, permitting free use, modificatio
6498
6518
  }
6499
6519
  //#endregion
6500
6520
  //#region node_modules/@dpuse/dpuse-shared/dist/componentConfig.schema-DT3mO5rS.js
6501
- var gi = {
6521
+ var xi = {
6502
6522
  lang: void 0,
6503
6523
  message: void 0,
6504
6524
  abortEarly: void 0,
6505
6525
  abortPipeEarly: void 0
6506
6526
  };
6507
6527
  /* @__NO_SIDE_EFFECTS__ */
6508
- function _i(e) {
6528
+ function Si(e) {
6509
6529
  return e ? {
6510
6530
  lang: e?.lang ?? void 0,
6511
6531
  message: e?.message,
6512
6532
  abortEarly: e?.abortEarly ?? void 0,
6513
6533
  abortPipeEarly: e?.abortPipeEarly ?? void 0
6514
- } : gi;
6534
+ } : xi;
6515
6535
  }
6516
6536
  /* @__NO_SIDE_EFFECTS__ */
6517
- function vi(e) {
6537
+ function Ci(e) {
6518
6538
  let t = typeof e;
6519
6539
  return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
6520
6540
  }
6521
6541
  function X(e, t, n, r, i) {
6522
- let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */ vi(a), c = {
6542
+ let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */ Ci(a), c = {
6523
6543
  kind: e.kind,
6524
6544
  type: e.type,
6525
6545
  input: a,
@@ -6536,39 +6556,39 @@ function X(e, t, n, r, i) {
6536
6556
  u !== void 0 && (c.message = typeof u == "function" ? u(c) : u), l && (n.typed = !1), n.issues ? n.issues.push(c) : n.issues = [c];
6537
6557
  }
6538
6558
  /* @__NO_SIDE_EFFECTS__ */
6539
- function yi(e, t) {
6559
+ function wi(e, t) {
6540
6560
  return e === t || Number.isNaN(e) && Number.isNaN(t);
6541
6561
  }
6542
6562
  /* @__NO_SIDE_EFFECTS__ */
6543
- function bi(e, t) {
6563
+ function Ti(e, t) {
6544
6564
  return Object.prototype.hasOwnProperty.call(e, t) && t !== "__proto__" && t !== "prototype" && t !== "constructor";
6545
6565
  }
6546
6566
  /* @__NO_SIDE_EFFECTS__ */
6547
- function xi(e, t) {
6567
+ function Ei(e, t) {
6548
6568
  let n = [...new Set(e)];
6549
6569
  return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
6550
6570
  }
6551
- function Si(e) {
6571
+ function Di(e) {
6552
6572
  return e["~standard"] = {
6553
6573
  version: 1,
6554
6574
  vendor: "valibot",
6555
- validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */ _i())
6575
+ validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */ Si())
6556
6576
  }, e;
6557
6577
  }
6558
6578
  /* @__NO_SIDE_EFFECTS__ */
6559
- function Ci(e, t, n) {
6579
+ function Oi(e, t, n) {
6560
6580
  return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
6561
6581
  }
6562
6582
  /* @__NO_SIDE_EFFECTS__ */
6563
- function wi(e, t, n) {
6583
+ function ki(e, t, n) {
6564
6584
  return typeof e.default == "function" ? e.default(t, n) : e.default;
6565
6585
  }
6566
6586
  /* @__NO_SIDE_EFFECTS__ */
6567
- function Ti(e, t) {
6568
- return Si({
6587
+ function Ai(e, t) {
6588
+ return Di({
6569
6589
  kind: "schema",
6570
6590
  type: "array",
6571
- reference: Ti,
6591
+ reference: Ai,
6572
6592
  expects: "Array",
6573
6593
  async: !1,
6574
6594
  item: e,
@@ -6601,11 +6621,11 @@ function Ti(e, t) {
6601
6621
  });
6602
6622
  }
6603
6623
  /* @__NO_SIDE_EFFECTS__ */
6604
- function Ei(e) {
6605
- return Si({
6624
+ function ji(e) {
6625
+ return Di({
6606
6626
  kind: "schema",
6607
6627
  type: "boolean",
6608
- reference: Ei,
6628
+ reference: ji,
6609
6629
  expects: "boolean",
6610
6630
  async: !1,
6611
6631
  message: e,
@@ -6615,23 +6635,23 @@ function Ei(e) {
6615
6635
  });
6616
6636
  }
6617
6637
  /* @__NO_SIDE_EFFECTS__ */
6618
- function Di(e, t) {
6619
- return Si({
6638
+ function Mi(e, t) {
6639
+ return Di({
6620
6640
  kind: "schema",
6621
6641
  type: "literal",
6622
- reference: Di,
6623
- expects: /* @__PURE__ */ vi(e),
6642
+ reference: Mi,
6643
+ expects: /* @__PURE__ */ Ci(e),
6624
6644
  async: !1,
6625
6645
  literal: e,
6626
6646
  message: t,
6627
6647
  "~run"(e, t) {
6628
- return /* @__PURE__ */ yi(e.value, this.literal) ? e.typed = !0 : X(this, "type", e, t), e;
6648
+ return /* @__PURE__ */ wi(e.value, this.literal) ? e.typed = !0 : X(this, "type", e, t), e;
6629
6649
  }
6630
6650
  });
6631
6651
  }
6632
6652
  /* @__NO_SIDE_EFFECTS__ */
6633
6653
  function Z(e, t) {
6634
- return Si({
6654
+ return Di({
6635
6655
  kind: "schema",
6636
6656
  type: "nullable",
6637
6657
  reference: Z,
@@ -6640,16 +6660,16 @@ function Z(e, t) {
6640
6660
  wrapped: e,
6641
6661
  default: t,
6642
6662
  "~run"(e, t) {
6643
- return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ wi(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
6663
+ return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ ki(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
6644
6664
  }
6645
6665
  });
6646
6666
  }
6647
6667
  /* @__NO_SIDE_EFFECTS__ */
6648
- function Oi(e) {
6649
- return Si({
6668
+ function Ni(e) {
6669
+ return Di({
6650
6670
  kind: "schema",
6651
6671
  type: "number",
6652
- reference: Oi,
6672
+ reference: Ni,
6653
6673
  expects: "number",
6654
6674
  async: !1,
6655
6675
  message: e,
@@ -6659,26 +6679,26 @@ function Oi(e) {
6659
6679
  });
6660
6680
  }
6661
6681
  /* @__NO_SIDE_EFFECTS__ */
6662
- function ki(e, t) {
6663
- return Si({
6682
+ function Pi(e, t) {
6683
+ return Di({
6664
6684
  kind: "schema",
6665
6685
  type: "optional",
6666
- reference: ki,
6686
+ reference: Pi,
6667
6687
  expects: `(${e.expects} | undefined)`,
6668
6688
  async: !1,
6669
6689
  wrapped: e,
6670
6690
  default: t,
6671
6691
  "~run"(e, t) {
6672
- return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ wi(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
6692
+ return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ ki(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
6673
6693
  }
6674
6694
  });
6675
6695
  }
6676
6696
  /* @__NO_SIDE_EFFECTS__ */
6677
- function Ai(e, t, n) {
6678
- return Si({
6697
+ function Fi(e, t, n) {
6698
+ return Di({
6679
6699
  kind: "schema",
6680
6700
  type: "record",
6681
- reference: Ai,
6701
+ reference: Fi,
6682
6702
  expects: "Object",
6683
6703
  async: !1,
6684
6704
  key: e,
@@ -6688,7 +6708,7 @@ function Ai(e, t, n) {
6688
6708
  let n = e.value;
6689
6709
  if (n && typeof n == "object") {
6690
6710
  e.typed = !0, e.value = {};
6691
- for (let r in n) if (/* @__PURE__ */ bi(n, r)) {
6711
+ for (let r in n) if (/* @__PURE__ */ Ti(n, r)) {
6692
6712
  let i = n[r], a = this.key["~run"]({ value: r }, t);
6693
6713
  if (a.issues) {
6694
6714
  let o = {
@@ -6728,7 +6748,7 @@ function Ai(e, t, n) {
6728
6748
  }
6729
6749
  /* @__NO_SIDE_EFFECTS__ */
6730
6750
  function Q(e, t) {
6731
- return Si({
6751
+ return Di({
6732
6752
  kind: "schema",
6733
6753
  type: "strict_object",
6734
6754
  reference: Q,
@@ -6743,7 +6763,7 @@ function Q(e, t) {
6743
6763
  for (let r in this.entries) {
6744
6764
  let i = this.entries[r];
6745
6765
  if (r in n || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
6746
- let a = r in n ? n[r] : /* @__PURE__ */ wi(i), o = i["~run"]({ value: a }, t);
6766
+ let a = r in n ? n[r] : /* @__PURE__ */ ki(i), o = i["~run"]({ value: a }, t);
6747
6767
  if (o.issues) {
6748
6768
  let i = {
6749
6769
  type: "object",
@@ -6759,7 +6779,7 @@ function Q(e, t) {
6759
6779
  }
6760
6780
  }
6761
6781
  o.typed || (e.typed = !1), e.value[r] = o.value;
6762
- } else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ Ci(i);
6782
+ } else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ Oi(i);
6763
6783
  else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (X(this, "key", e, t, {
6764
6784
  input: void 0,
6765
6785
  expected: `"${r}"`,
@@ -6795,7 +6815,7 @@ function Q(e, t) {
6795
6815
  }
6796
6816
  /* @__NO_SIDE_EFFECTS__ */
6797
6817
  function $(e) {
6798
- return Si({
6818
+ return Di({
6799
6819
  kind: "schema",
6800
6820
  type: "string",
6801
6821
  reference: $,
@@ -6808,19 +6828,19 @@ function $(e) {
6808
6828
  });
6809
6829
  }
6810
6830
  /* @__NO_SIDE_EFFECTS__ */
6811
- function ji(e) {
6831
+ function Ii(e) {
6812
6832
  let t;
6813
6833
  if (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);
6814
6834
  else t = n.issues;
6815
6835
  return t;
6816
6836
  }
6817
6837
  /* @__NO_SIDE_EFFECTS__ */
6818
- function Mi(e, t) {
6819
- return Si({
6838
+ function Li(e, t) {
6839
+ return Di({
6820
6840
  kind: "schema",
6821
6841
  type: "union",
6822
- reference: Mi,
6823
- expects: /* @__PURE__ */ xi(e.map((e) => e.expects), "|"),
6842
+ reference: Li,
6843
+ expects: /* @__PURE__ */ Ei(e.map((e) => e.expects), "|"),
6824
6844
  async: !1,
6825
6845
  options: e,
6826
6846
  message: t,
@@ -6839,29 +6859,29 @@ function Mi(e, t) {
6839
6859
  if (n) return n;
6840
6860
  if (r) {
6841
6861
  if (r.length === 1) return r[0];
6842
- X(this, "type", e, t, { issues: /* @__PURE__ */ ji(r) }), e.typed = !0;
6862
+ X(this, "type", e, t, { issues: /* @__PURE__ */ Ii(r) }), e.typed = !0;
6843
6863
  } else if (i?.length === 1) return i[0];
6844
- else X(this, "type", e, t, { issues: /* @__PURE__ */ ji(i) });
6864
+ else X(this, "type", e, t, { issues: /* @__PURE__ */ Ii(i) });
6845
6865
  return e;
6846
6866
  }
6847
6867
  });
6848
6868
  }
6849
- var Ni = /* @__PURE__ */ Q({
6869
+ var Ri = /* @__PURE__ */ Q({
6850
6870
  en: /* @__PURE__ */ $(),
6851
6871
  es: /* @__PURE__ */ $()
6852
- }), Pi = {
6872
+ }), zi = {
6853
6873
  id: /* @__PURE__ */ $(),
6854
6874
  label: /* @__PURE__ */ Q({
6855
- en: /* @__PURE__ */ ki(/* @__PURE__ */ $()),
6856
- es: /* @__PURE__ */ ki(/* @__PURE__ */ $())
6875
+ en: /* @__PURE__ */ Pi(/* @__PURE__ */ $()),
6876
+ es: /* @__PURE__ */ Pi(/* @__PURE__ */ $())
6857
6877
  }),
6858
6878
  description: /* @__PURE__ */ Q({
6859
- en: /* @__PURE__ */ ki(/* @__PURE__ */ $()),
6860
- es: /* @__PURE__ */ ki(/* @__PURE__ */ $())
6879
+ en: /* @__PURE__ */ Pi(/* @__PURE__ */ $()),
6880
+ es: /* @__PURE__ */ Pi(/* @__PURE__ */ $())
6861
6881
  }),
6862
6882
  icon: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
6863
6883
  iconDark: /* @__PURE__ */ Z(/* @__PURE__ */ $())
6864
- }, Fi = (e) => /* @__PURE__ */ Mi(e.map((e) => /* @__PURE__ */ Di(e))), Ii = Fi([
6884
+ }, Bi = (e) => /* @__PURE__ */ Li(e.map((e) => /* @__PURE__ */ Mi(e))), Vi = Bi([
6865
6885
  "app",
6866
6886
  "connector",
6867
6887
  "connectorConnection",
@@ -6883,33 +6903,33 @@ var Ni = /* @__PURE__ */ Q({
6883
6903
  "presenter",
6884
6904
  "presenterPresentation",
6885
6905
  "tool"
6886
- ]), Li = Fi([
6906
+ ]), Hi = Bi([
6887
6907
  "danger",
6888
6908
  "success",
6889
6909
  "warning"
6890
- ]), Ri = Fi([
6910
+ ]), Ui = Bi([
6891
6911
  "alpha",
6892
6912
  "beta",
6893
6913
  "releaseCandidate",
6894
6914
  "generalAvailability"
6895
- ]), zi = /* @__PURE__ */ Q({
6896
- color: Li,
6915
+ ]), Wi = /* @__PURE__ */ Q({
6916
+ color: Hi,
6897
6917
  label: /* @__PURE__ */ $()
6898
- }), Bi = {
6899
- ...Pi,
6900
- typeId: Ii
6901
- }, Vi = /* @__PURE__ */ Q({
6902
- ...Bi,
6903
- order: /* @__PURE__ */ Oi(),
6918
+ }), Gi = {
6919
+ ...zi,
6920
+ typeId: Vi
6921
+ }, Ki = /* @__PURE__ */ Q({
6922
+ ...Gi,
6923
+ order: /* @__PURE__ */ Ni(),
6904
6924
  path: /* @__PURE__ */ $()
6905
- }), Hi = {
6906
- ...Bi,
6907
- firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ Oi()),
6908
- lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ Oi()),
6909
- status: /* @__PURE__ */ Z(zi),
6910
- statusId: /* @__PURE__ */ Z(Ri)
6925
+ }), qi = {
6926
+ ...Gi,
6927
+ firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ Ni()),
6928
+ lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ Ni()),
6929
+ status: /* @__PURE__ */ Z(Wi),
6930
+ statusId: /* @__PURE__ */ Z(Ui)
6911
6931
  };
6912
- ({ ...Hi }), Fi([
6932
+ ({ ...qi }), Bi([
6913
6933
  "app",
6914
6934
  "engine",
6915
6935
  "connector",
@@ -6919,17 +6939,17 @@ var Ni = /* @__PURE__ */ Q({
6919
6939
  ]);
6920
6940
  //#endregion
6921
6941
  //#region node_modules/@dpuse/dpuse-shared/dist/moduleConfig.schema-aYmFWSrn.js
6922
- var Ui = {
6923
- ...Hi,
6942
+ var Ji = {
6943
+ ...qi,
6924
6944
  vendorAccountURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
6925
6945
  vendorDocumentationURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
6926
6946
  vendorHomeURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
6927
6947
  version: /* @__PURE__ */ $()
6928
6948
  };
6929
- ({ ...Ui });
6949
+ ({ ...Ji });
6930
6950
  //#endregion
6931
6951
  //#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModuleConnector.es.js
6932
- var Wi = Fi([
6952
+ var Yi = Bi([
6933
6953
  "abortOperation",
6934
6954
  "auditObjectContent",
6935
6955
  "createObject",
@@ -6945,39 +6965,39 @@ var Wi = Fi([
6945
6965
  "retrieveChunks",
6946
6966
  "retrieveRecords",
6947
6967
  "upsertRecords"
6948
- ]), Gi = Fi([
6968
+ ]), Xi = Bi([
6949
6969
  "application",
6950
6970
  "curatedDataset",
6951
6971
  "database",
6952
6972
  "fileStore"
6953
- ]), Ki = /* @__PURE__ */ Q({ label: Ni }), qi = Fi([
6973
+ ]), Zi = /* @__PURE__ */ Q({ label: Ri }), Qi = Bi([
6954
6974
  "bidirectional",
6955
6975
  "destination",
6956
6976
  "source",
6957
6977
  "unknown"
6958
- ]), Ji = /* @__PURE__ */ Q({ label: Ni }), Yi = /* @__PURE__ */ Q({
6959
- authMethodId: Fi([
6978
+ ]), $i = /* @__PURE__ */ Q({ label: Ri }), ea = /* @__PURE__ */ Q({
6979
+ authMethodId: Bi([
6960
6980
  "apiKey",
6961
6981
  "disabled",
6962
6982
  "oAuth2",
6963
6983
  "none"
6964
6984
  ]),
6965
- activeConnectionCount: /* @__PURE__ */ ki(/* @__PURE__ */ Oi()),
6966
- canDescribe: /* @__PURE__ */ ki(/* @__PURE__ */ Ei()),
6967
- id: /* @__PURE__ */ ki(/* @__PURE__ */ $()),
6968
- label: /* @__PURE__ */ ki(Ni),
6969
- maxConnectionCount: /* @__PURE__ */ Z(/* @__PURE__ */ Oi()),
6970
- params: /* @__PURE__ */ ki(/* @__PURE__ */ Ti(/* @__PURE__ */ Ai(/* @__PURE__ */ $(), /* @__PURE__ */ $())))
6971
- }), Xi = /* @__PURE__ */ Q({
6972
- ...Ui,
6973
- typeId: /* @__PURE__ */ Di("connector"),
6974
- actionNames: /* @__PURE__ */ Ti(Wi),
6975
- category: /* @__PURE__ */ Z(Ki),
6976
- categoryId: Gi,
6977
- implementations: /* @__PURE__ */ Ai(/* @__PURE__ */ $(), Yi),
6978
- usage: /* @__PURE__ */ Z(Ji),
6979
- usageId: /* @__PURE__ */ Z(qi)
6980
- }), Zi = {
6985
+ activeConnectionCount: /* @__PURE__ */ Pi(/* @__PURE__ */ Ni()),
6986
+ canDescribe: /* @__PURE__ */ Pi(/* @__PURE__ */ ji()),
6987
+ id: /* @__PURE__ */ Pi(/* @__PURE__ */ $()),
6988
+ label: /* @__PURE__ */ Pi(Ri),
6989
+ maxConnectionCount: /* @__PURE__ */ Z(/* @__PURE__ */ Ni()),
6990
+ params: /* @__PURE__ */ Pi(/* @__PURE__ */ Ai(/* @__PURE__ */ Fi(/* @__PURE__ */ $(), /* @__PURE__ */ $())))
6991
+ }), ta = /* @__PURE__ */ Q({
6992
+ ...Ji,
6993
+ typeId: /* @__PURE__ */ Mi("connector"),
6994
+ actionNames: /* @__PURE__ */ Ai(Yi),
6995
+ category: /* @__PURE__ */ Z(Zi),
6996
+ categoryId: Xi,
6997
+ implementations: /* @__PURE__ */ Fi(/* @__PURE__ */ $(), ea),
6998
+ usage: /* @__PURE__ */ Z($i),
6999
+ usageId: /* @__PURE__ */ Z(Qi)
7000
+ }), na = {
6981
7001
  abortOperation: "Abort Operation",
6982
7002
  auditObjectContent: "Audit Object Content",
6983
7003
  createObject: "Create Object",
@@ -6993,12 +7013,12 @@ var Wi = Fi([
6993
7013
  retrieveChunks: "Retrieve Chunks",
6994
7014
  retrieveRecords: "Retrieve Records",
6995
7015
  upsertRecords: "Upsert Records"
6996
- }, Qi = /* @__PURE__ */ new Set([
7016
+ }, ra = /* @__PURE__ */ new Set([
6997
7017
  "createObject",
6998
7018
  "dropObject",
6999
7019
  "removeRecords",
7000
7020
  "upsertRecords"
7001
- ]), $i = /* @__PURE__ */ new Set([
7021
+ ]), ia = /* @__PURE__ */ new Set([
7002
7022
  "auditObjectContent",
7003
7023
  "findObject",
7004
7024
  "getInfo",
@@ -7009,65 +7029,65 @@ var Wi = Fi([
7009
7029
  "retrieveChunks",
7010
7030
  "retrieveRecords"
7011
7031
  ]);
7012
- function ea(e) {
7032
+ function aa(e) {
7013
7033
  let t = !1, n = !1;
7014
- for (let r of e) $i.has(r) && (t = !0), Qi.has(r) && (n = !0);
7034
+ for (let r of e) ia.has(r) && (t = !0), ra.has(r) && (n = !0);
7015
7035
  return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "unknown";
7016
7036
  }
7017
- function ta(e) {
7037
+ function oa(e) {
7018
7038
  let t = new Set(e), n = "|Action|Supported|\n";
7019
7039
  n += "|:----|:-------:|\n";
7020
- for (let e of Object.keys(Zi)) n += `| ${Zi[e]} | ${t.has(e) ? "✓" : ""} |\n`;
7040
+ for (let e of Object.keys(na)) n += `| ${na[e]} | ${t.has(e) ? "✓" : ""} |\n`;
7021
7041
  return n;
7022
7042
  }
7023
7043
  //#endregion
7024
7044
  //#region src/actions/documentActions.ts
7025
- var na = "<!-- CONNECTOR_ACTIONS_START -->", ra = "<!-- CONNECTOR_ACTIONS_END -->", ia = "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.", aa = {
7045
+ var sa = "<!-- CONNECTOR_ACTIONS_START -->", ca = "<!-- CONNECTOR_ACTIONS_END -->", la = "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.", ua = {
7026
7046
  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.",
7027
7047
  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.",
7028
7048
  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.",
7029
7049
  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."
7030
- }, oa = "The table below lists all connector actions and highlights those supported by this connector.";
7031
- async function sa() {
7050
+ }, da = "The table below lists all connector actions and highlights those supported by this connector.";
7051
+ async function fa() {
7032
7052
  try {
7033
7053
  G("Document Actions"), q("1️⃣ Insert actions description and table into 'README.md'");
7034
- let e = (await W("config.json")).actionNames ?? [], t = ea(e), n = ta(e);
7035
- await Bn(`${ia}\n\n${aa[t]} ${oa}\n\n${n}`, na, ra), K("Actions documented");
7054
+ let e = (await W("config.json")).actionNames ?? [], t = aa(e), n = oa(e);
7055
+ await Un(`${la}\n\n${ua[t]} ${da}\n\n${n}`, sa, ca), K("Actions documented");
7036
7056
  } catch (e) {
7037
7057
  console.error("❌ Error documenting actions", e), process.exit(1);
7038
7058
  }
7039
7059
  }
7040
7060
  //#endregion
7041
7061
  //#region src/actions/documentOpening.ts
7042
- var ca = "<!-- OPENING_START -->", la = "<!-- OPENING_END -->";
7043
- async function ua() {
7062
+ var pa = "<!-- OPENING_START -->", ma = "<!-- OPENING_END -->";
7063
+ async function ha() {
7044
7064
  try {
7045
7065
  G("Document Opening"), q("1️⃣ Insert opening content into 'README.md'");
7046
- let e = await W("package.json"), t = await W("config.json"), { owner: n, repo: r } = Un(e, "document opening");
7047
- await Bn(pa(n, r, da(e), fa(t)), ca, la), K("Opening documented");
7066
+ let e = await W("package.json"), t = await W("config.json"), { owner: n, repo: r } = Kn(e, "document opening");
7067
+ await Un(va(n, r, ga(e), _a(t), e.devDependencies?.fallow != null), pa, ma), K("Opening documented");
7048
7068
  } catch (e) {
7049
7069
  console.error("❌ Error documenting opening", e), process.exit(1);
7050
7070
  }
7051
7071
  }
7052
- function da(e) {
7072
+ function ga(e) {
7053
7073
  let t = e.license;
7054
7074
  if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
7055
7075
  return t;
7056
7076
  }
7057
- function fa(e) {
7077
+ function _a(e) {
7058
7078
  let t = e.description.en;
7059
7079
  if (t == null || t.length === 0) throw Error("config.json 'description.en' field is required to document opening.");
7060
7080
  return t;
7061
7081
  }
7062
- function pa(e, t, n, r) {
7063
- let i = `https://github.com/${e}/${t}`;
7064
- return `[![License: ${n}](https://img.shields.io/badge/License-${n.replaceAll("-", "--")}-blue.svg)](./LICENSE)
7065
- [![DPUse version](https://img.shields.io/github/v/release/${e}/${t}?color=f6821f&label=DPUse)](${i}/releases/latest)
7066
- [![CI](${i}/actions/workflows/ci.yml/badge.svg)](${i}/actions/workflows/ci.yml)
7067
- [![CodeQL](${i}/actions/workflows/codeql.yml/badge.svg)](${i}/actions/workflows/codeql.yml)
7068
- [![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})
7082
+ function va(e, t, n, r, i) {
7083
+ let a = `https://github.com/${e}/${t}`, o = n.replaceAll("-", "--"), s = encodeURIComponent(`https://raw.githubusercontent.com/${e}/${t}/main/${Mn}`);
7084
+ return `[![License: ${n}](https://img.shields.io/badge/License-${o}-blue.svg)](./LICENSE)
7085
+ [![DPUse version](https://img.shields.io/github/v/release/${e}/${t}?color=f6821f&label=DPUse)](${a}/releases/latest)
7086
+ [![CI](${a}/actions/workflows/ci.yml/badge.svg)](${a}/actions/workflows/ci.yml)
7087
+ [![CodeQL](${a}/actions/workflows/codeql.yml/badge.svg)](${a}/actions/workflows/codeql.yml)
7088
+ ${i ? `[![Fallow code health](https://img.shields.io/endpoint?url=${s})](./${Nn})\n` : ""}[![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})
7069
7089
 
7070
- [Documentation](https://www.dpuse.app) · [Report a Vulnerability](${i}/security/advisories/new) · [Open an Issue](${i}/issues)
7090
+ [Documentation](https://www.dpuse.app) · [Report a Vulnerability](${a}/security/advisories/new) · [Open an Issue](${a}/issues)
7071
7091
 
7072
7092
  ## About DPUse
7073
7093
 
@@ -7087,12 +7107,12 @@ ${r}`;
7087
7107
  }
7088
7108
  //#endregion
7089
7109
  //#region src/actions/documentUsage.ts
7090
- var ma = "<!-- USAGE_START -->", ha = "<!-- USAGE_END -->", ga = /* @__PURE__ */ new Set([
7110
+ var ya = "<!-- USAGE_START -->", ba = "<!-- USAGE_END -->", xa = /* @__PURE__ */ new Set([
7091
7111
  "connector",
7092
7112
  "context",
7093
7113
  "cookbook",
7094
7114
  "presenter"
7095
- ]), _a = [
7115
+ ]), Sa = [
7096
7116
  ["build", "Builds the project."],
7097
7117
  ["build:ts", "Builds the TypeScript source."],
7098
7118
  ["test", "Runs the tests."],
@@ -7108,39 +7128,39 @@ var ma = "<!-- USAGE_START -->", ha = "<!-- USAGE_END -->", ga = /* @__PURE__ */
7108
7128
  ["documentUsage", "Regenerates the README's Usage section."],
7109
7129
  ["documentDependencies", "Regenerates the README's dependency licence report."],
7110
7130
  ["documentBundleSizes", "Regenerates the README's bundle size report."],
7111
- ["documentGovernance", "Regenerates the README's Security & Quality, Contributing and License sections."],
7131
+ ["documentGovernance", "Regenerates the README's Quality & Security, Contributing and License sections."],
7112
7132
  ["sync", "Bumps the version, then commits and pushes to GitHub."],
7113
7133
  ["release", "Bumps the version, commits and pushes, and creates a GitHub release."],
7114
7134
  ["publish", "Registers the released version with DPUse."]
7115
- ], va = /* @__PURE__ */ new Set(["development", "eslint"]), ya = "> [!WARNING]\n> This project is currently published to npm, but 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.\n\n", ba = "Cloned or forked code is unsupported and isn't guaranteed to remain compatible with the DPUse Engine as it evolves.";
7116
- async function xa() {
7135
+ ], Ca = /* @__PURE__ */ new Set(["development", "eslint"]), wa = "> [!WARNING]\n> This project is currently published to npm, but 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.\n\n", Ta = "Cloned or forked code is unsupported and isn't guaranteed to remain compatible with the DPUse Engine as it evolves.";
7136
+ async function Ea() {
7117
7137
  try {
7118
7138
  G("Document Usage"), q("1️⃣ Insert usage content into 'README.md'");
7119
- let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = Sa(e), r = Ca(n), i = wa(e.engines?.node), a = wa(e.engines?.npm), o = wa(e.devDependencies?.typescript);
7120
- await Bn(Oa(Ta(Hn(t.id), e.name), n, r, i, a, o, Ea(e)), ma, ha), K("Usage documented");
7139
+ let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = Da(e), r = Oa(n), i = ka(e.engines?.node), a = ka(e.engines?.npm), o = ka(e.devDependencies?.typescript);
7140
+ await Un(Na(Aa(Gn(t.id), e.name), n, r, i, a, o, ja(e)), ya, ba), K("Usage documented");
7121
7141
  } catch (e) {
7122
7142
  console.error("❌ Error documenting usage", e), process.exit(1);
7123
7143
  }
7124
7144
  }
7125
- function Sa(e) {
7145
+ function Da(e) {
7126
7146
  let t = e.repository, n = typeof t == "string" ? t : t?.url;
7127
7147
  if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
7128
7148
  return n.replace(/^git\+/, "");
7129
7149
  }
7130
- function Ca(e) {
7150
+ function Oa(e) {
7131
7151
  return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
7132
7152
  }
7133
- function wa(e) {
7153
+ function ka(e) {
7134
7154
  if (e == null) throw Error("package.json version range is required to document usage.");
7135
7155
  let t = /\d+(?:\.\d+)*/.exec(e);
7136
7156
  if (t == null) throw Error(`Unable to parse version from '${e}'.`);
7137
7157
  return t[0];
7138
7158
  }
7139
- function Ta(e, t) {
7159
+ function Aa(e, t) {
7140
7160
  let { typeId: n } = e;
7141
- if (ga.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.
7161
+ if (xa.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.
7142
7162
 
7143
- 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. ${ba}`;
7163
+ 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. ${Ta}`;
7144
7164
  if (e.publishedTo === "npm") {
7145
7165
  if (t == null || t === "") throw Error("package.json 'name' field is required to document usage.");
7146
7166
  return `This package is published to the [public npm registry](https://www.npmjs.com/package/${t}). Install it with:
@@ -7149,18 +7169,18 @@ You may view or clone this repository for your own purposes, such as building a
7149
7169
  npm install ${t}
7150
7170
  \`\`\`
7151
7171
 
7152
- ${va.has(n) ? ya : ""}To work on the source instead, clone this repository. ${ba}`;
7172
+ ${Ca.has(n) ? wa : ""}To work on the source instead, clone this repository. ${Ta}`;
7153
7173
  }
7154
- return `You may view or clone this repository for your own purposes. ${ba}`;
7174
+ return `You may view or clone this repository for your own purposes. ${Ta}`;
7155
7175
  }
7156
- function Ea(e) {
7157
- let t = e.scripts ?? {}, n = e.name === "@dpuse/dpuse-development", r = new Set(Object.keys(t).filter((e) => n ? t[e]?.includes("dpuse-development.es.js") : t[e]?.includes("@dpuse/dpuse-development"))), i = (e) => r.has(e) || (t[e] ?? "").matchAll(/npm run ([\w:]+)/g).some(([, e = ""]) => r.has(e)), a = _a.filter(([e]) => i(e)).map(([e, t]) => `|\`${Da(e)}\`|${t}|`);
7176
+ function ja(e) {
7177
+ let t = e.scripts ?? {}, n = e.name === "@dpuse/dpuse-development", r = new Set(Object.keys(t).filter((e) => n ? t[e]?.includes("dpuse-development.es.js") : t[e]?.includes("@dpuse/dpuse-development"))), i = (e) => r.has(e) || (t[e] ?? "").matchAll(/npm run ([\w:]+)/g).some(([, e = ""]) => r.has(e)), a = Sa.filter(([e]) => i(e)).map(([e, t]) => `|\`${Ma(e)}\`|${t}|`);
7158
7178
  return a.length === 0 ? "" : `\n\n${n ? "This repository provides these commands to every DPUse project, and uses them itself:" : "Repository tasks run through npm scripts provided by [@dpuse/dpuse-development](https://github.com/dpuse/dpuse-development):"}\n\n|Command|What it does|\n|:-|:-|\n${a.join("\n")}`;
7159
7179
  }
7160
- function Da(e) {
7180
+ function Ma(e) {
7161
7181
  return e === "test" ? "npm test" : `npm run ${e}`;
7162
7182
  }
7163
- function Oa(e, t, n, r, i, a, o) {
7183
+ function Na(e, t, n, r, i, a, o) {
7164
7184
  return `## Usage
7165
7185
 
7166
7186
  ${e}
@@ -7175,14 +7195,18 @@ _Requires [Node.js](https://nodejs.org/) ${r} or later, [npm](https://www.npmjs.
7175
7195
  }
7176
7196
  //#endregion
7177
7197
  //#region src/actions/formatCode.ts
7178
- async function ka() {
7198
+ async function Pa() {
7179
7199
  try {
7180
7200
  G("Format Code"), await U("1️⃣ Format", "prettier", [
7181
7201
  "--write",
7182
7202
  "*.json",
7183
7203
  "*.md",
7184
7204
  "*.ts",
7185
- ...["app", "src"].filter((t) => e(t)).map((e) => `${e}/**`)
7205
+ ...[
7206
+ "app",
7207
+ "src",
7208
+ "tests"
7209
+ ].filter((t) => e(t)).map((e) => `${e}/**`)
7186
7210
  ]), K("Code formatted");
7187
7211
  } catch (e) {
7188
7212
  console.error("❌ Error formatting code", e), process.exit(1);
@@ -7190,7 +7214,7 @@ async function ka() {
7190
7214
  }
7191
7215
  //#endregion
7192
7216
  //#region src/actions/lintCode.ts
7193
- async function Aa() {
7217
+ async function Fa() {
7194
7218
  try {
7195
7219
  G("Lint Code"), await U("1️⃣ Lint", "eslint", ["."]), K("Code linted");
7196
7220
  } catch (e) {
@@ -7199,7 +7223,7 @@ async function Aa() {
7199
7223
  }
7200
7224
  //#endregion
7201
7225
  //#region src/utilities/cloudflare.ts
7202
- async function ja() {
7226
+ async function Ia() {
7203
7227
  let e = await W("config.json"), t = {
7204
7228
  body: JSON.stringify(e),
7205
7229
  headers: { "Content-Type": "application/json" },
@@ -7207,11 +7231,11 @@ async function ja() {
7207
7231
  }, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
7208
7232
  if (!n.ok) throw Error(await n.text());
7209
7233
  }
7210
- async function Ma(e, t) {
7234
+ async function La(e, t) {
7211
7235
  async function n(e, t, r) {
7212
7236
  for (let i of r) {
7213
7237
  let r = `${e}/${i}`, a = `${t}/${i}`;
7214
- (await Wn(r)).isDirectory() ? await n(r, a, await Pn(r)) : (console.info(`⚙️ Uploading '${e}/${i}'...`), await Fn(void 0, "wrangler", [
7238
+ (await qn(r)).isDirectory() ? await n(r, a, await Ln(r)) : (console.info(`⚙️ Uploading '${e}/${i}'...`), await Rn(void 0, "wrangler", [
7215
7239
  "r2",
7216
7240
  "object",
7217
7241
  "put",
@@ -7222,10 +7246,10 @@ async function Ma(e, t) {
7222
7246
  ]));
7223
7247
  }
7224
7248
  }
7225
- let r = await Pn(`${e}/${t}/`);
7249
+ let r = await Ln(`${e}/${t}/`);
7226
7250
  await n(`${e}/${t}`, t, r);
7227
7251
  }
7228
- async function Na(e) {
7252
+ async function Ra(e) {
7229
7253
  let t = e.id, n = {
7230
7254
  body: JSON.stringify(e),
7231
7255
  headers: { "Content-Type": "application/json" },
@@ -7233,14 +7257,14 @@ async function Na(e) {
7233
7257
  }, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
7234
7258
  if (!r.ok) throw Error(await r.text());
7235
7259
  }
7236
- async function Pa(e, t) {
7260
+ async function za(e, t) {
7237
7261
  let n = `v${e.version ?? "unknown"}`;
7238
7262
  async function r(e, r = "") {
7239
- let i = await Pn(e, { withFileTypes: !0 });
7263
+ let i = await Ln(e, { withFileTypes: !0 });
7240
7264
  for (let a of i) {
7241
7265
  if (a.isDirectory() || a.name.endsWith(".map")) continue;
7242
7266
  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;
7243
- console.info(`⚙️ Uploading '${o}' → '${s}'...`), await Fn(void 0, "wrangler", [
7267
+ console.info(`⚙️ Uploading '${o}' → '${s}'...`), await Rn(void 0, "wrangler", [
7244
7268
  "r2",
7245
7269
  "object",
7246
7270
  "put",
@@ -7257,24 +7281,24 @@ async function Pa(e, t) {
7257
7281
  }
7258
7282
  //#endregion
7259
7283
  //#region node_modules/valibot/dist/index.mjs
7260
- var Fa = {
7284
+ var Ba = {
7261
7285
  lang: void 0,
7262
7286
  message: void 0,
7263
7287
  abortEarly: void 0,
7264
7288
  abortPipeEarly: void 0
7265
7289
  };
7266
7290
  /* @__NO_SIDE_EFFECTS__ */
7267
- function Ia(e) {
7291
+ function Va(e) {
7268
7292
  return e ? {
7269
7293
  lang: e?.lang ?? void 0,
7270
7294
  message: e?.message,
7271
7295
  abortEarly: e?.abortEarly ?? void 0,
7272
7296
  abortPipeEarly: e?.abortPipeEarly ?? void 0
7273
- } : Fa;
7297
+ } : Ba;
7274
7298
  }
7275
7299
  /* @__NO_SIDE_EFFECTS__ */
7276
- function La(e, t, n) {
7277
- let r = e["~run"]({ value: t }, /* @__PURE__ */ Ia(n));
7300
+ function Ha(e, t, n) {
7301
+ let r = e["~run"]({ value: t }, /* @__PURE__ */ Va(n));
7278
7302
  return {
7279
7303
  typed: r.typed,
7280
7304
  success: !r.issues,
@@ -7284,21 +7308,21 @@ function La(e, t, n) {
7284
7308
  }
7285
7309
  //#endregion
7286
7310
  //#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModulePresenter.es.js
7287
- var Ra = Fi([
7311
+ var Ua = Bi([
7288
7312
  "list",
7289
7313
  "render",
7290
7314
  "setColorMode"
7291
- ]), za = /* @__PURE__ */ Q({
7292
- ...Ui,
7293
- typeId: /* @__PURE__ */ Di("presenter"),
7294
- actionNames: /* @__PURE__ */ Ti(Ra),
7295
- presentations: /* @__PURE__ */ Ti(Vi)
7296
- }), Ba = [
7315
+ ]), Wa = /* @__PURE__ */ Q({
7316
+ ...Ji,
7317
+ typeId: /* @__PURE__ */ Mi("presenter"),
7318
+ actionNames: /* @__PURE__ */ Ai(Ua),
7319
+ presentations: /* @__PURE__ */ Ai(Ki)
7320
+ }), Ga = [
7297
7321
  "1️⃣ ",
7298
7322
  "2️⃣ ",
7299
7323
  "3️⃣ ",
7300
7324
  "4️⃣ "
7301
- ], Va = [{
7325
+ ], Ka = [{
7302
7326
  id: "unit",
7303
7327
  label: "Run unit tests",
7304
7328
  command: "vitest",
@@ -7311,46 +7335,46 @@ var Ra = Fi([
7311
7335
  arguments: ["test", "--pass-with-no-tests"],
7312
7336
  configFileName: "playwright.config.ts"
7313
7337
  }];
7314
- async function Ha() {
7338
+ async function qa() {
7315
7339
  try {
7316
7340
  G("Build Project"), await U("1️⃣ Bundle project", "vite", ["build"]), K("Project built");
7317
7341
  } catch (e) {
7318
7342
  console.error("❌ Error building project", e), process.exit(1);
7319
7343
  }
7320
7344
  }
7321
- async function Ua() {
7345
+ async function Ja() {
7322
7346
  try {
7323
7347
  G("Publish Project");
7324
7348
  let e = await W("package.json"), t = await W("config.json");
7325
- await Qa("1️⃣ ", e, t, Hn(t.id)), K(`Project version '${e.version ?? "unknown"}' published.`);
7349
+ await ro("1️⃣ ", e, t, Gn(t.id)), K(`Project version '${e.version ?? "unknown"}' published.`);
7326
7350
  } catch (e) {
7327
7351
  console.error("❌ Error publishing project", e), process.exit(1);
7328
7352
  }
7329
7353
  }
7330
- async function Wa() {
7354
+ async function Ya() {
7331
7355
  try {
7332
7356
  G("Release Project");
7333
7357
  let e = await W("package.json"), t = await W("config.json");
7334
- await Za("1️⃣ ", e);
7335
- let n = Hn(t.id);
7358
+ await no("1️⃣ ", e);
7359
+ let n = Gn(t.id);
7336
7360
  switch (n.typeId) {
7337
7361
  case "connector":
7338
- t = await Ka("2️⃣ ", e);
7362
+ t = await Za("2️⃣ ", e);
7339
7363
  break;
7340
7364
  case "presenter":
7341
- t = await qa("2️⃣ ", e);
7365
+ t = await Qa("2️⃣ ", e);
7342
7366
  break;
7343
- default: t = await Ga("2️⃣ ", e);
7367
+ default: t = await Xa("2️⃣ ", e);
7344
7368
  }
7345
- await U("3️⃣ Bundle project", "vite", ["build"]), await Fn("4️⃣ Stage changes", "git", ["add", "."]), await Fn("5️⃣ Commit changes", "git", [
7369
+ await U("3️⃣ Bundle project", "vite", ["build"]), await Rn("4️⃣ Stage changes", "git", ["add", "."]), await Rn("5️⃣ Commit changes", "git", [
7346
7370
  "commit",
7347
7371
  "-m",
7348
7372
  `v${e.version ?? "unknown"}`
7349
- ]), await Fn("6️⃣ Push changes", "git", [
7373
+ ]), await Rn("6️⃣ Push changes", "git", [
7350
7374
  "push",
7351
7375
  "origin",
7352
7376
  "main:main"
7353
- ]), await Qa("7️⃣ ", e, t, n), n.publishedTo === "npm" ? await U("8️⃣ Create GitHub release", "gh", [
7377
+ ]), await ro("7️⃣ ", e, t, n), n.publishedTo === "npm" ? await U("8️⃣ Create GitHub release", "gh", [
7354
7378
  "release",
7355
7379
  "create",
7356
7380
  `v${e.version ?? "unknown"}`,
@@ -7363,45 +7387,45 @@ async function Wa() {
7363
7387
  console.error("❌ Error releasing project", e), process.exit(1);
7364
7388
  }
7365
7389
  }
7366
- async function Ga(e, t) {
7390
+ async function Xa(e, t) {
7367
7391
  q(`${e} Build project configuration`);
7368
7392
  let n = await W("config.json");
7369
- return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await Rn("logo.svg"), n.iconDark ??= await Rn("logoDark.svg"), await zn("config.json", n), n;
7393
+ return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await Vn("logo.svg"), n.iconDark ??= await Vn("logoDark.svg"), await Hn("config.json", n), n;
7370
7394
  }
7371
- async function Ka(e, t) {
7395
+ async function Za(e, t) {
7372
7396
  q(`${e} Build connector project configuration`);
7373
- let [n, r] = await Promise.all([W("config.json"), Ln("src/index.ts")]), i = /* @__PURE__ */ La(Xi, n);
7397
+ let [n, r] = await Promise.all([W("config.json"), Bn("src/index.ts")]), i = /* @__PURE__ */ Ha(ta, n);
7374
7398
  if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
7375
- let a = Gn(r);
7376
- return await Ja(t, n, a, ea(a));
7399
+ let a = Jn(r);
7400
+ return await $a(t, n, a, aa(a));
7377
7401
  }
7378
- async function qa(e, t) {
7402
+ async function Qa(e, t) {
7379
7403
  q(`${e} Build presenter project configuration`);
7380
- let [n, r] = await Promise.all([W("config.json"), Ln("src/index.ts")]), i = /* @__PURE__ */ La(za, n);
7404
+ let [n, r] = await Promise.all([W("config.json"), Bn("src/index.ts")]), i = /* @__PURE__ */ Ha(Wa, n);
7381
7405
  if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
7382
- return await Ja(t, n, Gn(r));
7406
+ return await $a(t, n, Jn(r));
7383
7407
  }
7384
- async function Ja(e, t, n, r) {
7385
- return n.length > 0 ? (console.info(`ℹ️ Implements ${String(n.length)} operations:`), console.table(n)) : console.warn("⚠️ Implements no operations"), r === "unknown" ? console.warn("⚠️ No usage identified") : r && console.info(`ℹ️ Supports '${r}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.actionNames = n, r !== void 0 && (t.usageId = r), await zn("config.json", t), t;
7408
+ async function $a(e, t, n, r) {
7409
+ return n.length > 0 ? (console.info(`ℹ️ Implements ${String(n.length)} operations:`), console.table(n)) : console.warn("⚠️ Implements no operations"), r === "unknown" ? console.warn("⚠️ No usage identified") : r && console.info(`ℹ️ Supports '${r}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.actionNames = n, r !== void 0 && (t.usageId = r), await Hn("config.json", t), t;
7386
7410
  }
7387
- async function Ya() {
7411
+ async function eo() {
7388
7412
  try {
7389
7413
  G("Synchronise Project with GitHub");
7390
7414
  let e = await W("package.json"), t = await W("config.json");
7391
- switch (await Za("1️⃣ ", e), Hn(t.id).typeId) {
7415
+ switch (await no("1️⃣ ", e), Gn(t.id).typeId) {
7392
7416
  case "connector":
7393
- await Ka("2️⃣ ", e);
7417
+ await Za("2️⃣ ", e);
7394
7418
  break;
7395
7419
  case "presenter":
7396
- await qa("2️⃣ ", e);
7420
+ await Qa("2️⃣ ", e);
7397
7421
  break;
7398
- default: await Ga("2️⃣ ", e);
7422
+ default: await Xa("2️⃣ ", e);
7399
7423
  }
7400
- await Fn("3️⃣ Stage changes", "git", ["add", "."]), await Fn("4️⃣ Commit changes", "git", [
7424
+ await Rn("3️⃣ Stage changes", "git", ["add", "."]), await Rn("4️⃣ Commit changes", "git", [
7401
7425
  "commit",
7402
7426
  "-m",
7403
7427
  `v${e.version ?? "unknown"}`
7404
- ]), await Fn("5️⃣ Push changes", "git", [
7428
+ ]), await Rn("5️⃣ Push changes", "git", [
7405
7429
  "push",
7406
7430
  "origin",
7407
7431
  "main:main"
@@ -7410,14 +7434,14 @@ async function Ya() {
7410
7434
  console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
7411
7435
  }
7412
7436
  }
7413
- async function Xa(e = ["unit"], t = !1) {
7437
+ async function to(e = ["unit"], t = !1) {
7414
7438
  try {
7415
7439
  G("Test Project");
7416
7440
  let n = 0;
7417
- for (let r of Va) {
7418
- if (!e.includes(r.id) || await Rn(r.configFileName) === null) continue;
7441
+ for (let r of Ka) {
7442
+ if (!e.includes(r.id) || await Vn(r.configFileName) === null) continue;
7419
7443
  let i = t && r.id === "unit" ? ["--coverage"] : [];
7420
- await U(`${Ba[n] ?? ""} ${r.label}`, r.command, [...r.arguments, ...i]), n += 1;
7444
+ await U(`${Ga[n] ?? ""} ${r.label}`, r.command, [...r.arguments, ...i]), n += 1;
7421
7445
  }
7422
7446
  if (n === 0) {
7423
7447
  console.warn("\n⚠️ No tests configured for this project.\n");
@@ -7428,25 +7452,23 @@ async function Xa(e = ["unit"], t = !1) {
7428
7452
  console.error("❌ Error testing project", e), process.exit(1);
7429
7453
  }
7430
7454
  }
7431
- async function Za(e, t, n = "./") {
7455
+ async function no(e, t, n = "./") {
7432
7456
  if (q(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
7433
7457
  else {
7434
7458
  let e = t.version, n = t.version.split(".");
7435
7459
  t.version = `${n[0] ?? "unknown"}.${n[1] ?? "unknown"}.${String(Number(n[2]) + 1)}`, console.info(`Project version bumped from '${e}' to '${t.version}'.`);
7436
7460
  }
7437
- await zn(`${n}package.json`, t);
7461
+ await Hn(`${n}package.json`, t);
7438
7462
  }
7439
- async function Qa(e, t, n, r) {
7440
- if (r.typeId === "app") q(`${e} Register module`), await ja();
7441
- else if (r.typeId === "engine") q(`${e} Register module`), await Pa(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await Na(n);
7463
+ async function ro(e, t, n, r) {
7464
+ if (r.typeId === "app") q(`${e} Register module`), await Ia();
7465
+ else if (r.typeId === "engine") q(`${e} Register module`), await za(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await Ra(n);
7442
7466
  else if (r.uploadGroupName === void 0) q(`${e} Registration NOT required`);
7443
7467
  else {
7444
7468
  q(`${e} Register module`);
7445
7469
  let i = n.id.split("-").slice(2).join("-");
7446
- await Pa(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await Na(n);
7470
+ await za(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await Ra(n);
7447
7471
  }
7448
7472
  }
7449
7473
  //#endregion
7450
- export { Jn as auditDependencies, Ha as buildProject, Zn as checkConfigFiles, or as checkDependencies, sa as documentActions, hr as documentBundleSizes, Lr as documentDependencies, ii as documentGovernance, ua as documentOpening, xa as documentUsage, ka as formatCode, Aa as lintCode, Ua as publishProject, Wa as releaseProject, Ya as syncProjectWithGitHub, Xa as testProject, Ma as uploadDirectoryToR2 };
7451
-
7452
- //# sourceMappingURL=dpuse-development.es.js.map
7474
+ export { Zn as auditDependencies, qa as buildProject, er as checkConfigFiles, cr as checkDependencies, fa as documentActions, _r as documentBundleSizes, zr as documentDependencies, si as documentGovernance, ha as documentOpening, Ea as documentUsage, Pa as formatCode, Fa as lintCode, Ja as publishProject, Ya as releaseProject, eo as syncProjectWithGitHub, to as testProject, La as uploadDirectoryToR2 };