@dpuse/dpuse-development 1.0.122 → 1.0.124

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.
package/README.md CHANGED
@@ -78,11 +78,11 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
78
78
 
79
79
  | Chunk/Module/File | Composition |
80
80
  | :------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------- |
81
- | **dist/dpuse-development.es.js** | 65.0 kB · gzip 20.9 kB · 65.6% of the build |
82
- |     src → documentDependencies.ts + 22 more | `██████████████████░░` 88.3% · 57.4 kB |
81
+ | **dist/dpuse-development.es.js** | 65.1 kB · gzip 21.0 kB · 65.6% of the build |
82
+ |     src → documentDependencies.ts + 22 more | `██████████████████░░` 88.3% · 57.5 kB |
83
83
  |         ↳ documentDependencies.ts | `▒▒▒▒░░░░░░░░░░░░░░░░` 17.5% · 11.4 kB |
84
84
  |         ↳ documentQualitySecurity.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 15.2% · 9.9 kB |
85
- |         ↳ documentBundleSizes.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 13.8% · 9.0 kB |
85
+ |         ↳ documentBundleSizes.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 13.9% · 9.0 kB |
86
86
  |         ↳ checkConfigFiles.ts | `▒░░░░░░░░░░░░░░░░░░░` 5.8% · 3.8 kB |
87
87
  |         ↳ rustCrates.ts | `▒░░░░░░░░░░░░░░░░░░░` 5.3% · 3.4 kB |
88
88
  |         ↳ cloudflare.ts | `▒░░░░░░░░░░░░░░░░░░░` 4.3% · 2.8 kB |
@@ -1073,50 +1073,50 @@ async function kn() {
1073
1073
  }
1074
1074
  //#endregion
1075
1075
  //#region src/actions/documentBundleSizes.ts
1076
- var An = "bundle-analysis-reports/sonda/index.json", jn = "bundle-analysis-reports/sonda/worker.json", Mn = "<!-- BUNDLE_START -->", Nn = "<!-- BUNDLE_END -->", U = "&nbsp;&nbsp;&nbsp;&nbsp;", W = 20, Pn = "█", Fn = "▒", In = 100 / W / 2, Ln = 100 / W, Rn = 48, zn = 16, Bn = "This report is updated with each release, from the bundle the release builds, using [Sonda](https://sonda.dev/), which analyses final source maps to reveal the actual effects of tree-shaking and minification rather than relying on pre-build estimates.\n\n_Note: Sonda's Vite reports currently exclude CSS files, since Vite does not generate source maps for CSS._", Vn = "Bars show each row's share of its output file.", Hn = "↳ rows are part of the row above.", Un = "+ n more = the row also holds n more files from the same package or folder, each no larger than the one named. A package can appear under several output files, each holding different files, never the same file twice.", G = "(bundler output, whitespace & JSON)", K = "(inlined worker)", Wn = `${K} = a Web Worker built separately and embedded in its output file as text. Where the build records what it contains, its rows list that; any few bytes over are the escaping needed to embed it.`, q = "(Rust WebAssembly as base64", Gn = `${q}…) = the compiled Rust code, embedded as base64 text, about a third larger than the binary it decodes to, which is the size given.`, Kn = `${G} = bytes Sonda can't trace to a source file: whitespace (indentation and line breaks), code the bundler generates (region comments, the combined import/export lines, its small runtime helper and wrappers), and imported JSON such as \`config.json\`, which the bundler doesn't map. The JSON and the generated code are real bytes that ship; the whitespace mostly disappears once compressed.`;
1077
- async function qn(t) {
1076
+ var An = "bundle-analysis-reports/sonda/index.json", jn = "bundle-analysis-reports/sonda/worker.json", Mn = "<!-- BUNDLE_START -->", Nn = "<!-- BUNDLE_END -->", U = "&nbsp;&nbsp;&nbsp;&nbsp;", W = 20, Pn = "█", Fn = "▒", In = 100 / W / 2, Ln = 100 / W, Rn = 48, zn = "This report is updated with each release, from the bundle the release builds, using [Sonda](https://sonda.dev/), which analyses final source maps to reveal the actual effects of tree-shaking and minification rather than relying on pre-build estimates.\n\n_Note: Sonda's Vite reports currently exclude CSS files, since Vite does not generate source maps for CSS._", Bn = "Bars show each row's share of its output file.", Vn = "↳ rows are part of the row above.", Hn = "+ n more = the row also holds n more files from the same package or folder, each no larger than the one named. A package can appear under several output files, each holding different files, never the same file twice.", G = "(bundler output, whitespace & JSON)", K = "(inlined worker)", Un = `${K} = a Web Worker built separately and embedded in its output file as text. Where the build records what it contains, its rows list that; any few bytes over are the escaping needed to embed it.`, q = "(Rust WebAssembly as base64", Wn = `${q}…) = the compiled Rust code, embedded as base64 text, about a third larger than the binary it decodes to, which is the size given.`, Gn = `${G} = bytes Sonda can't trace to a source file: whitespace (indentation and line breaks), code the bundler generates (region comments, the combined import/export lines, its small runtime helper and wrappers), and imported JSON such as \`config.json\`, which the bundler doesn't map. The JSON and the generated code are real bytes that ship; the whitespace mostly disappears once compressed.`;
1077
+ async function Kn(t) {
1078
1078
  try {
1079
1079
  s("Document Bundle Sizes"), C("1️⃣ Read bundle analysis report");
1080
1080
  let n = await S(An), r = await e(jn), i = r === null ? void 0 : JSON.parse(r), a = /* @__PURE__ */ new Map();
1081
1081
  for (let t of n.resources) t.kind === "asset" && a.set(t.name, await e(t.name));
1082
1082
  C("2️⃣ Insert table into 'README.md'");
1083
- let o = Jn(n, {
1083
+ let o = qn(n, {
1084
1084
  assetContents: a,
1085
1085
  isModuleLevel: t?.moduleLevel ?? !1,
1086
1086
  workerJson: i
1087
1087
  }), c = [
1088
- o.includes("↳") ? `${Vn} ${Hn}` : Vn,
1089
- / \+ \d+ more \|/.test(o) ? Un : "",
1090
- o.includes(K) ? Wn : "",
1091
- o.includes(q) ? Gn : "",
1092
- Kn
1088
+ o.includes("↳") ? `${Bn} ${Vn}` : Bn,
1089
+ / \+ \d+ more \|/.test(o) ? Hn : "",
1090
+ o.includes(K) ? Un : "",
1091
+ o.includes(q) ? Wn : "",
1092
+ Gn
1093
1093
  ].filter((e) => e !== "");
1094
- await _(`## Bundle Analysis\n\n${Bn}\n\n${o}\n\n${c.join("\n\n")}`, Mn, Nn), b("Bundle sizes documented");
1094
+ await _(`## Bundle Analysis\n\n${zn}\n\n${o}\n\n${c.join("\n\n")}`, Mn, Nn), b("Bundle sizes documented");
1095
1095
  } catch (e) {
1096
1096
  console.error("❌ Error documenting bundle sizes", e), process.exit(1);
1097
1097
  }
1098
1098
  }
1099
- function Jn(e, t) {
1100
- let { assetContents: n, isModuleLevel: r, workerJson: i } = t, a = lr(e), o = i === void 0 ? void 0 : lr(i).values().next().value;
1099
+ function qn(e, t) {
1100
+ let { assetContents: n, isModuleLevel: r, workerJson: i } = t, a = cr(e), o = i === void 0 ? void 0 : cr(i).values().next().value;
1101
1101
  for (let [e, t] of a) {
1102
1102
  let r = n.get(e);
1103
- r != null && Yn(t, r, o);
1103
+ r != null && Jn(t, r, o);
1104
1104
  }
1105
- let s = a.values().flatMap((e) => e.values().toArray()).reduce((e, t) => e + t.sizes.uncompressed, 0), c = e.resources.filter((e) => e.kind === "asset").map((e) => [e.name, mr(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), l = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
1105
+ let s = a.values().flatMap((e) => e.values().toArray()).reduce((e, t) => e + t.sizes.uncompressed, 0), c = e.resources.filter((e) => e.kind === "asset").map((e) => [e.name, pr(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), l = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
1106
1106
  for (let [e, t] of c) {
1107
- let n = [...a.get(e) ?? /* @__PURE__ */ new Map()].toSorted(rr), i = n.reduce((e, [, t]) => e + t.sizes.uncompressed, 0), o = i > 0 && s > 0 ? ` · ${yr(i, s)} of the build` : "";
1108
- l.push(Z(`**${X(e)}**`, `${hr(t)}${o}`), ...ir(n, i, r));
1107
+ let n = [...a.get(e) ?? /* @__PURE__ */ new Map()].toSorted(nr), i = n.reduce((e, [, t]) => e + t.sizes.uncompressed, 0), o = i > 0 && s > 0 ? ` · ${vr(i, s)} of the build` : "";
1108
+ l.push(Z(`**${X(e)}**`, `${mr(t)}${o}`), ...rr(n, i, r));
1109
1109
  }
1110
1110
  return l.join("\n");
1111
1111
  }
1112
- function Yn(e, t, n) {
1113
- let r = Xn(t), i = Zn(r ?? ""), a = Zn(t);
1114
- $n(e, {
1112
+ function Jn(e, t, n) {
1113
+ let r = Yn(t), i = Xn(r ?? ""), a = Xn(t);
1114
+ Qn(e, {
1115
1115
  bytes: a.bytes - i.bytes,
1116
1116
  binaryBytes: a.binaryBytes - i.binaryBytes
1117
- }), r !== void 0 && er(e, Buffer.byteLength(r), i, n);
1117
+ }), r !== void 0 && $n(e, Buffer.byteLength(r), i, n);
1118
1118
  }
1119
- function Xn(e) {
1119
+ function Yn(e) {
1120
1120
  if (!e.includes("new Worker(")) return;
1121
1121
  let t = /encodeURIComponent\((\w+)\)/.exec(e)?.[1];
1122
1122
  if (t === void 0) return;
@@ -1126,21 +1126,21 @@ function Xn(e) {
1126
1126
  for (; a < e.length && e[a] !== r;) a += e[a] === "\\" ? 2 : 1;
1127
1127
  return e.slice(i, a);
1128
1128
  }
1129
- function Zn(e) {
1129
+ function Xn(e) {
1130
1130
  let t = {
1131
1131
  bytes: 0,
1132
1132
  binaryBytes: 0
1133
1133
  };
1134
1134
  for (let n of e.matchAll(/data:application\/wasm;base64,([A-Za-z\d+/]*={0,2})/g)) {
1135
1135
  let e = n[1] ?? "";
1136
- t.bytes += n[0].length, t.binaryBytes += Math.floor(e.length * 3 / 4) - Qn(e);
1136
+ t.bytes += n[0].length, t.binaryBytes += Math.floor(e.length * 3 / 4) - Zn(e);
1137
1137
  }
1138
1138
  return t;
1139
1139
  }
1140
- function Qn(e) {
1140
+ function Zn(e) {
1141
1141
  return e.endsWith("==") ? 2 : +!!e.endsWith("=");
1142
1142
  }
1143
- function $n(e, t) {
1143
+ function Qn(e, t) {
1144
1144
  if (t.bytes <= 0) return;
1145
1145
  let n = [e.get("wasm"), e.get(G)].flatMap((e) => e === void 0 ? [] : e.files.entries().map(([t, n]) => ({
1146
1146
  group: e,
@@ -1148,7 +1148,7 @@ function $n(e, t) {
1148
1148
  sizes: n
1149
1149
  })).toArray()).find(({ sizes: e }) => e.uncompressed >= t.bytes);
1150
1150
  if (n === void 0) return;
1151
- nr(e, n.group, n.fileName, n.sizes, t.bytes);
1151
+ tr(e, n.group, n.fileName, n.sizes, t.bytes);
1152
1152
  let r = `${q}, ${Q(t.binaryBytes)} binary)`;
1153
1153
  e.set(r, {
1154
1154
  sizes: {
@@ -1161,14 +1161,14 @@ function $n(e, t) {
1161
1161
  }]])
1162
1162
  });
1163
1163
  }
1164
- function er(e, t, n, r) {
1164
+ function $n(e, t, n, r) {
1165
1165
  let i = e.get(G), a = i?.files.get("");
1166
1166
  if (i === void 0 || a === void 0 || a.uncompressed < t) return;
1167
- nr(e, i, "", a, t);
1167
+ tr(e, i, "", a, t);
1168
1168
  let o = r === void 0 ? /* @__PURE__ */ new Map([["", {
1169
1169
  uncompressed: t,
1170
1170
  gzip: 0
1171
- }]]) : tr(r, t, n);
1171
+ }]]) : er(r, t, n);
1172
1172
  e.set(K, {
1173
1173
  sizes: {
1174
1174
  uncompressed: t,
@@ -1177,44 +1177,44 @@ function er(e, t, n, r) {
1177
1177
  files: o
1178
1178
  });
1179
1179
  }
1180
- function tr(e, t, n) {
1181
- $n(e, n);
1180
+ function er(e, t, n) {
1181
+ Qn(e, n);
1182
1182
  let r = /* @__PURE__ */ new Map();
1183
1183
  for (let [t, n] of e) if (t === "src") for (let [e, t] of n.files) r.set(e, { ...t });
1184
1184
  else {
1185
- let e = n.files.size === 1 ? Y(t, cr(n.files)) : t;
1185
+ let e = n.files.size === 1 ? Y(t, sr(n.files)) : t;
1186
1186
  r.set(e, { ...n.sizes });
1187
1187
  }
1188
- let i = r.values().reduce((e, t) => e + t.uncompressed, 0), a = r.get(G) ?? _r();
1188
+ let i = r.values().reduce((e, t) => e + t.uncompressed, 0), a = r.get(G) ?? gr();
1189
1189
  return a.uncompressed += Math.max(0, t - i), a.uncompressed > 0 && r.set(G, a), r;
1190
1190
  }
1191
- function nr(e, t, n, r, i) {
1191
+ function tr(e, t, n, r, i) {
1192
1192
  if (r.uncompressed -= i, t.sizes.uncompressed -= i, r.uncompressed <= 0 && t.files.delete(n), !(t.sizes.uncompressed > 0)) for (let [n, r] of e) r === t && e.delete(n);
1193
1193
  }
1194
- function rr(e, t) {
1194
+ function nr(e, t) {
1195
1195
  return e[0] === G == (t[0] === G) ? t[1].sizes.uncompressed - e[1].sizes.uncompressed : e[0] === G ? 1 : -1;
1196
1196
  }
1197
- function ir(e, t, n) {
1197
+ function rr(e, t, n) {
1198
1198
  let r = [];
1199
1199
  for (let [i, { sizes: a, files: o }] of e) {
1200
1200
  if (o.size === 1) {
1201
- let e = cr(o);
1201
+ let e = sr(o);
1202
1202
  r.push(Z(`${U}${X(Y(i, e))}`, J(a.uncompressed, t)));
1203
1203
  continue;
1204
1204
  }
1205
- r.push(Z(`${U}${sr(i, o)}`, J(a.uncompressed, t))), n || r.push(...ar(o, t));
1205
+ r.push(Z(`${U}${or(i, o)}`, J(a.uncompressed, t))), n || r.push(...ir(o, t));
1206
1206
  }
1207
1207
  return r;
1208
1208
  }
1209
- function ar(e, t) {
1210
- let n = [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), r = or(n, t), i = (r > 0 ? n.slice(0, -r) : n).map(([e, n]) => Z(`${U}${U}↳ ${X(e)}`, J(n.uncompressed, t, Fn)));
1209
+ function ir(e, t) {
1210
+ let n = [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), r = ar(n, t), i = (r > 0 ? n.slice(0, -r) : n).map(([e, n]) => Z(`${U}${U}↳ ${X(e)}`, J(n.uncompressed, t, Fn)));
1211
1211
  if (r > 0) {
1212
1212
  let e = n.slice(-r).reduce((e, [, t]) => e + t.uncompressed, 0);
1213
1213
  i.push(Z(`${U}${U}↳ ${String(r)} smaller files`, J(e, t, Fn)));
1214
1214
  }
1215
1215
  return i;
1216
1216
  }
1217
- function or(e, t) {
1217
+ function ar(e, t) {
1218
1218
  if (t <= 0) return 0;
1219
1219
  let n = 0, r = 0;
1220
1220
  for (let [, i] of e.toReversed()) {
@@ -1225,49 +1225,48 @@ function or(e, t) {
1225
1225
  return n >= 2 ? n : 0;
1226
1226
  }
1227
1227
  function J(e, t, n = Pn) {
1228
- return `${gr(t > 0 ? e / t * 100 : 0, n)} · ${Q(e)}`;
1228
+ return `${hr(t > 0 ? e / t * 100 : 0, n)} · ${Q(e)}`;
1229
1229
  }
1230
1230
  function Y(e, t) {
1231
1231
  return t === "" ? e : `${e} → ${t}`;
1232
1232
  }
1233
- function sr(e, t) {
1233
+ function or(e, t) {
1234
1234
  if (e === K) return e;
1235
1235
  let [n] = [...t].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed)[0] ?? [""];
1236
1236
  return `${X(Y(e, n))} + ${String(t.size - 1)} more`;
1237
1237
  }
1238
1238
  function X(e) {
1239
- if (e.length <= Rn) return e;
1240
- let t = `${e.slice(0, zn)}…${e.slice(e.length - 31)}`;
1241
- return `<abbr title="${e.replaceAll("&", "&amp;").replaceAll("\"", "&quot;")}">${t}</abbr>`;
1239
+ let t = e.indexOf(" → "), n = t === -1 ? "" : e.slice(0, t + 3), r = e.slice(n.length), i = Math.max(Rn - n.length, 2);
1240
+ return r.length > i ? `${n}<abbr title="${r.replaceAll("&", "&amp;").replaceAll("\"", "&quot;")}">…${r.slice(r.length - (i - 1))}</abbr>` : e;
1242
1241
  }
1243
1242
  function Z(e, t) {
1244
1243
  return `| ${e} | ${t.replaceAll(" ", "&nbsp;")} |`;
1245
1244
  }
1246
- function cr(e) {
1245
+ function sr(e) {
1247
1246
  let [t] = e.keys();
1248
1247
  if (t === void 0) throw Error("Expected exactly one file");
1249
1248
  return t;
1250
1249
  }
1251
- function lr(e) {
1252
- let t = ur(e.dependencies), n = /* @__PURE__ */ new Map();
1250
+ function cr(e) {
1251
+ let t = lr(e.dependencies), n = /* @__PURE__ */ new Map();
1253
1252
  for (let r of e.resources) {
1254
1253
  if (r.kind !== "chunk" || !r.parent) continue;
1255
- let { group: e, file: i } = dr(r.name, t), a = mr(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
1254
+ let { group: e, file: i } = ur(r.name, t), a = pr(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
1256
1255
  n.set(r.parent, o);
1257
1256
  let s = o.get(e) ?? {
1258
- sizes: _r(),
1257
+ sizes: gr(),
1259
1258
  files: /* @__PURE__ */ new Map()
1260
1259
  };
1261
- o.set(e, s), vr(s.sizes, a);
1262
- let c = s.files.get(i) ?? _r();
1263
- s.files.set(i, c), vr(c, a);
1260
+ o.set(e, s), _r(s.sizes, a);
1261
+ let c = s.files.get(i) ?? gr();
1262
+ s.files.set(i, c), _r(c, a);
1264
1263
  }
1265
1264
  return n;
1266
1265
  }
1267
- function ur(e) {
1266
+ function lr(e) {
1268
1267
  return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
1269
1268
  }
1270
- function dr(e, t) {
1269
+ function ur(e, t) {
1271
1270
  let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
1272
1271
  if (n) {
1273
1272
  let [t, r] = n;
@@ -1284,42 +1283,42 @@ function dr(e, t) {
1284
1283
  file: e.slice(1)
1285
1284
  } : e.startsWith("rust/") ? {
1286
1285
  group: "wasm",
1287
- file: fr(e)
1286
+ file: dr(e)
1288
1287
  } : {
1289
1288
  group: "src",
1290
- file: pr(e)
1289
+ file: fr(e)
1291
1290
  };
1292
1291
  }
1293
- function fr(e) {
1294
- let t = e.split("/", 2)[1] ?? "", n = pr(e);
1292
+ function dr(e) {
1293
+ let t = e.split("/", 2)[1] ?? "", n = fr(e);
1295
1294
  return t !== "" && n.startsWith(t) ? `…${n.slice(t.length)}` : n;
1296
1295
  }
1297
- function pr(e) {
1296
+ function fr(e) {
1298
1297
  return e.split("/").at(-1) ?? e;
1299
1298
  }
1300
- function mr(e) {
1299
+ function pr(e) {
1301
1300
  return {
1302
1301
  uncompressed: e.uncompressed,
1303
1302
  gzip: e.gzip ?? 0
1304
1303
  };
1305
1304
  }
1306
- function hr(e) {
1305
+ function mr(e) {
1307
1306
  return `${Q(e.uncompressed)} · gzip ${Q(e.gzip)}`;
1308
1307
  }
1309
- function gr(e, t = Pn) {
1308
+ function hr(e, t = Pn) {
1310
1309
  let n = Math.round(e / 100 * W);
1311
1310
  return `\`${t.repeat(n)}${"░".repeat(W - n)}\` ${e.toFixed(1)}%`;
1312
1311
  }
1313
- function _r() {
1312
+ function gr() {
1314
1313
  return {
1315
1314
  uncompressed: 0,
1316
1315
  gzip: 0
1317
1316
  };
1318
1317
  }
1319
- function vr(e, t) {
1318
+ function _r(e, t) {
1320
1319
  e.uncompressed += t.uncompressed, e.gzip += t.gzip;
1321
1320
  }
1322
- function yr(e, t) {
1321
+ function vr(e, t) {
1323
1322
  return `${(e / t * 100).toFixed(1)}%`;
1324
1323
  }
1325
1324
  function Q(e) {
@@ -1327,10 +1326,10 @@ function Q(e) {
1327
1326
  }
1328
1327
  //#endregion
1329
1328
  //#region src/actions/documentProject.ts
1330
- async function br(t = "MIT", n = !1) {
1329
+ async function yr(t = "MIT", n = !1) {
1331
1330
  try {
1332
1331
  let r = await S("config.json"), i = m(r.id).typeId === "connector";
1333
- await Bt(), i && await Ge(), await wn(), await ft(t), await e("bundle-analysis-reports/sonda/index.json") === null ? C(`ℹ️ Bundle sizes NOT documented, as there is no '${An}' yet. Build the project first.`) : await qn({ moduleLevel: n }), await rn(), await Ke();
1332
+ await Bt(), i && await Ge(), await wn(), await ft(t), await e("bundle-analysis-reports/sonda/index.json") === null ? C(`ℹ️ Bundle sizes NOT documented, as there is no '${An}' yet. Build the project first.`) : await Kn({ moduleLevel: n }), await rn(), await Ke();
1334
1333
  let a = await e(H) !== null;
1335
1334
  a ? await kn() : C(`ℹ️ '${H}' NOT required by this project`), await o("ℹ️ Format generated files", "prettier", [
1336
1335
  "--write",
@@ -1343,7 +1342,7 @@ async function br(t = "MIT", n = !1) {
1343
1342
  }
1344
1343
  //#endregion
1345
1344
  //#region src/actions/formatCode.ts
1346
- async function xr() {
1345
+ async function br() {
1347
1346
  try {
1348
1347
  s("Format Code");
1349
1348
  let e = [
@@ -1364,7 +1363,7 @@ async function xr() {
1364
1363
  }
1365
1364
  //#endregion
1366
1365
  //#region src/actions/lintCode.ts
1367
- async function Sr() {
1366
+ async function xr() {
1368
1367
  try {
1369
1368
  s("Lint Code"), await o("1️⃣ Lint", "eslint", ["."]), b("Code linted");
1370
1369
  } catch (e) {
@@ -1373,7 +1372,7 @@ async function Sr() {
1373
1372
  }
1374
1373
  //#endregion
1375
1374
  //#region src/utilities/cloudflare.ts
1376
- var Cr = "dpuse-sample-data-eu", wr = {
1375
+ var Sr = "dpuse-sample-data-eu", Cr = {
1377
1376
  bin: "application/octet-stream",
1378
1377
  csv: "text/csv",
1379
1378
  json: "application/json",
@@ -1384,7 +1383,7 @@ var Cr = "dpuse-sample-data-eu", wr = {
1384
1383
  xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1385
1384
  xml: "application/xml"
1386
1385
  };
1387
- async function Tr() {
1386
+ async function wr() {
1388
1387
  let e = await S("config.json"), t = {
1389
1388
  body: JSON.stringify(e),
1390
1389
  headers: { "Content-Type": "application/json" },
@@ -1393,11 +1392,11 @@ async function Tr() {
1393
1392
  if (!n.ok) throw Error(await n.text());
1394
1393
  }
1395
1394
  async function $(e, t) {
1396
- let n = await Ar(`${e}/${t}`, t), r = Map.groupBy(n, ({ key: e }) => jr(e));
1397
- for (let [e, t] of r) await kr(t, ["--content-type", e]);
1395
+ let n = await kr(`${e}/${t}`, t), r = Map.groupBy(n, ({ key: e }) => Ar(e));
1396
+ for (let [e, t] of r) await Or(t, ["--content-type", e]);
1398
1397
  }
1399
- async function Er(e) {
1400
- await $(e, "application"), await $(e, "fileStore"), await kr(["applicationIndex.json", "fileStoreIndex.json"].map((t) => ({
1398
+ async function Tr(e) {
1399
+ await $(e, "application"), await $(e, "fileStore"), await Or(["applicationIndex.json", "fileStoreIndex.json"].map((t) => ({
1401
1400
  file: `${e}/${t}`,
1402
1401
  key: t
1403
1402
  })), [
@@ -1407,7 +1406,7 @@ async function Er(e) {
1407
1406
  "no-cache"
1408
1407
  ]);
1409
1408
  }
1410
- async function Dr(e) {
1409
+ async function Er(e) {
1411
1410
  let t = e.id, n = {
1412
1411
  body: JSON.stringify(e),
1413
1412
  headers: { "Content-Type": "application/json" },
@@ -1415,7 +1414,7 @@ async function Dr(e) {
1415
1414
  }, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
1416
1415
  if (!r.ok) throw Error(await r.text());
1417
1416
  }
1418
- async function Or(e, t) {
1417
+ async function Dr(e, t) {
1419
1418
  let n = `v${e.version ?? "unknown"}`;
1420
1419
  async function r(e, r = "") {
1421
1420
  let i = await ee(e, { withFileTypes: !0 });
@@ -1437,7 +1436,7 @@ async function Or(e, t) {
1437
1436
  }
1438
1437
  await r("dist");
1439
1438
  }
1440
- async function kr(e, t) {
1439
+ async function Or(e, t) {
1441
1440
  if (e.length === 0) return;
1442
1441
  let n = await w.mkdtemp(T.join(ge.tmpdir(), "dpuse-r2-bulk-")), r = T.join(n, "files.json");
1443
1442
  try {
@@ -1445,7 +1444,7 @@ async function kr(e, t) {
1445
1444
  "r2",
1446
1445
  "bulk",
1447
1446
  "put",
1448
- Cr,
1447
+ Sr,
1449
1448
  "--filename",
1450
1449
  r,
1451
1450
  ...t,
@@ -1459,28 +1458,28 @@ async function kr(e, t) {
1459
1458
  });
1460
1459
  }
1461
1460
  }
1462
- async function Ar(e, t) {
1461
+ async function kr(e, t) {
1463
1462
  let n = await ee(e), r = [];
1464
1463
  for (let i of n) {
1465
1464
  if (i.startsWith(".")) continue;
1466
1465
  let n = `${e}/${i}`, a = `${t}/${i}`;
1467
- (await p(n)).isDirectory() ? r.push(...await Ar(n, a)) : r.push({
1466
+ (await p(n)).isDirectory() ? r.push(...await kr(n, a)) : r.push({
1468
1467
  file: n,
1469
1468
  key: a
1470
1469
  });
1471
1470
  }
1472
1471
  return r;
1473
1472
  }
1474
- function jr(e) {
1473
+ function Ar(e) {
1475
1474
  let t = e.slice(e.lastIndexOf("/") + 1), n = t.lastIndexOf(".");
1476
1475
  if (n === -1) return t === "LICENSE" ? "text/plain" : "application/octet-stream";
1477
- let r = wr[t.slice(n + 1).toLowerCase()];
1476
+ let r = Cr[t.slice(n + 1).toLowerCase()];
1478
1477
  if (r === void 0) throw Error(`No content type for '${e}'. Add its extension to 'SAMPLE_DATA_CONTENT_TYPES'.`);
1479
1478
  return r;
1480
1479
  }
1481
1480
  //#endregion
1482
1481
  //#region src/actions/publishProject.ts
1483
- async function Mr() {
1482
+ async function jr() {
1484
1483
  try {
1485
1484
  s("Publish Project");
1486
1485
  let e = await S("package.json"), t = await S("config.json"), n = m(t.id);
@@ -1490,30 +1489,30 @@ async function Mr() {
1490
1489
  "app",
1491
1490
  "kb"
1492
1491
  ].includes(n.publishedTo);
1493
- r && await o("2️⃣ Deploy", "npm", ["run", "deploy"]), await Nr(r ? "3️⃣ " : "2️⃣ ", e, t, n), n.publishedTo === "sampleData" && (C("3️⃣ Upload sample data"), await Er("public")), b(`Project version '${e.version ?? "unknown"}' published.`);
1492
+ r && await o("2️⃣ Deploy", "npm", ["run", "deploy"]), await Mr(r ? "3️⃣ " : "2️⃣ ", e, t, n), n.publishedTo === "sampleData" && (C("3️⃣ Upload sample data"), await Tr("public")), b(`Project version '${e.version ?? "unknown"}' published.`);
1494
1493
  } catch (e) {
1495
1494
  console.error("❌ Error publishing project", e), process.exit(1);
1496
1495
  }
1497
1496
  }
1498
- async function Nr(e, t, n, r) {
1499
- if (r.typeId === "app") C(`${e} Register module`), await Tr();
1500
- else if (r.typeId === "engine") C(`${e} Register module`), await Or(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await Dr(n);
1497
+ async function Mr(e, t, n, r) {
1498
+ if (r.typeId === "app") C(`${e} Register module`), await wr();
1499
+ else if (r.typeId === "engine") C(`${e} Register module`), await Dr(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await Er(n);
1501
1500
  else if (r.uploadGroupName === void 0) C(`${e} Registration NOT required`);
1502
1501
  else {
1503
1502
  C(`${e} Register module`);
1504
1503
  let i = n.id.split("-").slice(2).join("-");
1505
- await Or(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await Dr(n);
1504
+ await Dr(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await Er(n);
1506
1505
  }
1507
1506
  }
1508
1507
  //#endregion
1509
1508
  //#region src/actions/releaseProject.ts
1510
- async function Pr(e = "MIT", t = !1) {
1509
+ async function Nr(e = "MIT", t = !1) {
1511
1510
  try {
1512
1511
  s("Release Project");
1513
1512
  let n = await S("package.json"), r = await S("config.json"), i = m(r.id);
1514
1513
  await d("1️⃣ ", n);
1515
1514
  let a = await oe("2️⃣ ", n, i);
1516
- if (await Ee("3️⃣ ", n), C("4️⃣ Regenerate README"), await br(e, t), await y("5️⃣ Stage changes", "git", ["add", "."]), await y("6️⃣ Commit changes", "git", [
1515
+ if (await Ee("3️⃣ ", n), C("4️⃣ Regenerate README"), await yr(e, t), await y("5️⃣ Stage changes", "git", ["add", "."]), await y("6️⃣ Commit changes", "git", [
1517
1516
  "commit",
1518
1517
  "-m",
1519
1518
  `v${n.version ?? "unknown"}`
@@ -1521,7 +1520,7 @@ async function Pr(e = "MIT", t = !1) {
1521
1520
  "push",
1522
1521
  "origin",
1523
1522
  "main:main"
1524
- ]), await Nr("8️⃣ ", n, a, i), i.publishedTo === "npm") {
1523
+ ]), await Mr("8️⃣ ", n, a, i), i.publishedTo === "npm") {
1525
1524
  let e = `v${n.version ?? "unknown"}`;
1526
1525
  await o("9️⃣ Trigger GitHub release", "gh", [
1527
1526
  "release",
@@ -1540,7 +1539,7 @@ async function Pr(e = "MIT", t = !1) {
1540
1539
  }
1541
1540
  //#endregion
1542
1541
  //#region src/actions/syncProjectWithGitHub.ts
1543
- async function Fr() {
1542
+ async function Pr() {
1544
1543
  try {
1545
1544
  s("Synchronise Project with GitHub");
1546
1545
  let e = await S("package.json"), t = await S("config.json"), n = m(t.id);
@@ -1559,12 +1558,12 @@ async function Fr() {
1559
1558
  }
1560
1559
  //#endregion
1561
1560
  //#region src/actions/testProject.ts
1562
- var Ir = [
1561
+ var Fr = [
1563
1562
  "1️⃣ ",
1564
1563
  "2️⃣ ",
1565
1564
  "3️⃣ ",
1566
1565
  "4️⃣ "
1567
- ], Lr = [{
1566
+ ], Ir = [{
1568
1567
  id: "unit",
1569
1568
  label: "Run unit tests",
1570
1569
  command: "vitest",
@@ -1577,13 +1576,13 @@ var Ir = [
1577
1576
  arguments: ["test", "--pass-with-no-tests"],
1578
1577
  configFileName: "playwright.config.ts"
1579
1578
  }];
1580
- async function Rr(t = ["unit"]) {
1579
+ async function Lr(t = ["unit"]) {
1581
1580
  try {
1582
1581
  s("Test Project");
1583
1582
  let n = 0;
1584
- for (let r of Lr) {
1583
+ for (let r of Ir) {
1585
1584
  if (!t.includes(r.id) || await e(r.configFileName) === null) continue;
1586
- let i = `${Ir[n] ?? ""} ${r.label}`;
1585
+ let i = `${Fr[n] ?? ""} ${r.label}`;
1587
1586
  await o(i, r.command, r.arguments), n += 1;
1588
1587
  }
1589
1588
  if (n === 0) {
@@ -1597,7 +1596,7 @@ async function Rr(t = ["unit"]) {
1597
1596
  }
1598
1597
  //#endregion
1599
1598
  //#region src/actions/triggerGitHubRelease.ts
1600
- async function zr() {
1599
+ async function Rr() {
1601
1600
  try {
1602
1601
  s("Trigger GitHub Release");
1603
1602
  let e = `v${(await S("package.json")).version ?? "unknown"}`;
@@ -1615,4 +1614,4 @@ async function zr() {
1615
1614
  }
1616
1615
  }
1617
1616
  //#endregion
1618
- export { ye as auditDependencies, Te as buildProject, ze as checkProject, br as documentProject, xr as formatCode, Sr as lintCode, Mr as publishProject, Pr as releaseProject, Fr as syncProjectWithGitHub, Rr as testProject, zr as triggerGitHubRelease, $ as uploadDirectoryToR2 };
1617
+ export { ye as auditDependencies, Te as buildProject, ze as checkProject, yr as documentProject, br as formatCode, xr as lintCode, jr as publishProject, Nr as releaseProject, Pr as syncProjectWithGitHub, Lr as testProject, Rr as triggerGitHubRelease, $ as uploadDirectoryToR2 };