@dpuse/dpuse-development 0.3.758 → 0.3.765

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
@@ -124,12 +124,12 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
124
124
 
125
125
  |Chunk/Module/File|Composition|
126
126
  |:------ |:-----------|
127
- | dist/dpuse-development.es.js | 330.6 kB · gzip 85.5 kB |
128
- |     acorn → dist/acorn.mjs | `████████░░░░░░░░░░░░` 39.6% |
129
- |     acorn-typescript → lib/index.mjs | `███████░░░░░░░░░░░░░` 34.7% |
130
- |     src | `███░░░░░░░░░░░░░░░░░` 15.6% |
127
+ | dist/dpuse-development.es.js | 331.1 kB · gzip 85.7 kB |
128
+ |     acorn → dist/acorn.mjs | `████████░░░░░░░░░░░░` 39.5% |
129
+ |     acorn-typescript → lib/index.mjs | `███████░░░░░░░░░░░░░` 34.6% |
130
+ |     src | `███░░░░░░░░░░░░░░░░░` 15.7% |
131
131
  |         documentGovernance.ts | `█░░░░░░░░░░░░░░░░░░░` 2.7% |
132
- |         documentApiReference.ts | `░░░░░░░░░░░░░░░░░░░░` 2.1% |
132
+ |         documentApiReference.ts | `░░░░░░░░░░░░░░░░░░░░` 2.2% |
133
133
  |         documentDependencies.ts | `░░░░░░░░░░░░░░░░░░░░` 1.7% |
134
134
  |         manageProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.7% |
135
135
  |         index.ts | `░░░░░░░░░░░░░░░░░░░░` 1.6% |
@@ -7078,11 +7078,11 @@ async function va(e) {
7078
7078
  q(`${e} Write '${ma}'`);
7079
7079
  let t = ya(await W("package.json"));
7080
7080
  if (t.length === 0) throw Error("package.json 'exports' must name at least one import path with types to document the API reference.");
7081
- let n = l.createProgram(t.map(({ sourcePath: e }) => e), ba()), r = n.getTypeChecker(), i = Ea(n, r);
7081
+ let n = l.createProgram(t.map(({ sourcePath: e }) => e), ba()), r = n.getTypeChecker(), i = Da(n, r);
7082
7082
  await Gn(ma, `# API Reference\n\n${ga}\n\n${t.map(({ importPath: e, sourcePath: t }) => {
7083
7083
  let a = n.getSourceFile(t);
7084
7084
  if (a === void 0) throw Error(`Unable to read '${t}', the source of '${e}'.`);
7085
- return La(e, xa(r, a, i));
7085
+ return Ra(e, xa(r, a, i));
7086
7086
  }).join("\n\n")}\n`);
7087
7087
  }
7088
7088
  function ya(e) {
@@ -7108,55 +7108,72 @@ function ba() {
7108
7108
  function xa(e, t, n) {
7109
7109
  let r = new Map(ha.map((e) => [e, []])), i = e.getSymbolAtLocation(t), a = i === void 0 ? [] : e.getExportsOfModule(i);
7110
7110
  for (let t of a) {
7111
- let i = Na(e, t), a = Sa(e, Pa(t, i), i, n);
7112
- a !== void 0 && r.get(a.kind)?.push(a.text);
7111
+ let i = Pa(e, t), a = Sa(e, Fa(t, i), i, n);
7112
+ a !== void 0 && r.get(a.kind)?.push({
7113
+ ...a,
7114
+ description: Ca(e, i)
7115
+ });
7113
7116
  }
7114
- for (let e of r.values()) e.sort((e, t) => e.localeCompare(t));
7117
+ for (let e of r.values()) e.sort((e, t) => e.name.localeCompare(t.name));
7115
7118
  return r;
7116
7119
  }
7117
7120
  function Sa(e, t, n, r) {
7118
7121
  let [i] = (n.flags & (l.SymbolFlags.Function | l.SymbolFlags.Variable)) === 0 ? [] : e.getSignaturesOfType(e.getTypeOfSymbol(n), l.SignatureKind.Call), a = t.endsWith("Schema");
7119
7122
  return i !== void 0 && !a ? {
7123
+ detail: `(${i.parameters.map((t) => Ia(e, t)).join(", ")})`,
7120
7124
  kind: "Functions",
7121
- text: `${t}(${i.parameters.map((t) => Fa(e, t)).join(", ")})`
7125
+ name: t,
7126
+ origin: ""
7122
7127
  } : (n.flags & l.SymbolFlags.Class) === 0 ? a && (n.flags & l.SymbolFlags.Variable) !== 0 ? {
7128
+ detail: "",
7123
7129
  kind: "Schemas",
7124
- text: t
7130
+ name: t,
7131
+ origin: ""
7125
7132
  } : (n.flags & l.SymbolFlags.Variable) === 0 ? (n.flags & (l.SymbolFlags.Enum | l.SymbolFlags.Interface | l.SymbolFlags.TypeAlias)) === 0 ? void 0 : {
7133
+ detail: "",
7126
7134
  kind: "Types",
7127
- text: `${t}${wa(e, n, r)}`
7135
+ name: t,
7136
+ origin: Ta(e, n, r)
7128
7137
  } : {
7138
+ detail: `: ${wa(e, n)}`,
7129
7139
  kind: "Constants",
7130
- text: `${t}: ${Ca(e, n)}`
7140
+ name: t,
7141
+ origin: ""
7131
7142
  } : {
7143
+ detail: "",
7132
7144
  kind: "Classes",
7133
- text: `${t}${wa(e, n, r)}`
7145
+ name: t,
7146
+ origin: Ta(e, n, r)
7134
7147
  };
7135
7148
  }
7136
7149
  function Ca(e, t) {
7150
+ let n = l.displayPartsToString(t.getDocumentationComment(e)).replaceAll(/\s+/g, " ").trim();
7151
+ return n === "" ? void 0 : n;
7152
+ }
7153
+ function wa(e, t) {
7137
7154
  let n = t.valueDeclaration, r = n !== void 0 && l.isVariableDeclaration(n) ? n : void 0, i = r?.initializer, a = i !== void 0 && l.isAsExpression(i) && !l.isConstTypeReference(i.type), o = r?.type ?? (a ? i.type : void 0);
7138
- return o === void 0 ? e.typeToString(e.getBaseTypeOfLiteralType(e.getTypeOfSymbol(t)), n) : Ia(o);
7155
+ return o === void 0 ? e.typeToString(e.getBaseTypeOfLiteralType(e.getTypeOfSymbol(t)), n) : La(o);
7139
7156
  }
7140
- function wa(e, t, n) {
7141
- let r = (t.declarations ?? []).flatMap((e) => l.isClassDeclaration(e) || l.isInterfaceDeclaration(e) ? [...e.heritageClauses ?? []] : []).map((e) => `${e.token === l.SyntaxKind.ExtendsKeyword ? "extends" : "implements"} ${e.types.map((e) => e.getText()).join(", ")}`), i = t.declarations?.find((e) => l.isTypeAliasDeclaration(e)), a = i === void 0 ? void 0 : Oa(i);
7157
+ function Ta(e, t, n) {
7158
+ let r = (t.declarations ?? []).flatMap((e) => l.isClassDeclaration(e) || l.isInterfaceDeclaration(e) ? [...e.heritageClauses ?? []] : []).map((e) => `${e.token === l.SyntaxKind.ExtendsKeyword ? "extends" : "implements"} ${e.types.map((e) => e.getText()).join(", ")}`), i = t.declarations?.find((e) => l.isTypeAliasDeclaration(e)), a = i === void 0 ? void 0 : ka(i);
7142
7159
  if (i !== void 0 && a !== void 0) {
7143
7160
  r.push(`inferred from ${a.getText()}`);
7144
- let t = ka(e, i), o = t === void 0 ? [] : Ta(e, t, i.name.text, n);
7161
+ let t = Aa(e, i), o = t === void 0 ? [] : Ea(e, t, i.name.text, n);
7145
7162
  o.length > 0 && r.push(`extends ${o.join(", ")}`);
7146
7163
  }
7147
7164
  return r.length === 0 ? "" : ` (${r.join(", ")})`;
7148
7165
  }
7149
- function Ta(e, t, n, r) {
7166
+ function Ea(e, t, n, r) {
7150
7167
  return t.properties.flatMap((t) => {
7151
- let i = l.isSpreadAssignment(t) ? ja(e, t.expression) : void 0;
7168
+ let i = l.isSpreadAssignment(t) ? Ma(e, t.expression) : void 0;
7152
7169
  if (i === void 0) return [];
7153
7170
  let a = r.get(i);
7154
- return a === n ? Ta(e, i, n, r) : a === void 0 ? [] : [a];
7171
+ return a === n ? Ea(e, i, n, r) : a === void 0 ? [] : [a];
7155
7172
  });
7156
7173
  }
7157
- function Ea(e, t) {
7174
+ function Da(e, t) {
7158
7175
  let n = /* @__PURE__ */ new Map(), r = e.getSourceFiles().filter((t) => !t.isDeclarationFile && !e.isSourceFileFromExternalLibrary(t)).flatMap((e) => e.statements.filter((e) => l.isTypeAliasDeclaration(e)));
7159
- for (let e of r) for (let { addedFieldCount: r, group: i } of Da(t, e)) n.set(i, [...n.get(i) ?? [], {
7176
+ for (let e of r) for (let { addedFieldCount: r, group: i } of Oa(t, e)) n.set(i, [...n.get(i) ?? [], {
7160
7177
  addedFieldCount: r,
7161
7178
  typeName: e.name.text
7162
7179
  }]);
@@ -7167,14 +7184,14 @@ function Ea(e, t) {
7167
7184
  }
7168
7185
  return i;
7169
7186
  }
7170
- function Da(e, t) {
7171
- let n = ka(e, t);
7187
+ function Oa(e, t) {
7188
+ let n = Aa(e, t);
7172
7189
  if (n === void 0) return [];
7173
7190
  let r = l.isVariableDeclaration(n.parent) ? [{
7174
7191
  addedFieldCount: 0,
7175
7192
  group: n
7176
7193
  }] : [], i = n.properties.flatMap((t) => {
7177
- let r = l.isSpreadAssignment(t) ? ja(e, t.expression) : void 0;
7194
+ let r = l.isSpreadAssignment(t) ? Ma(e, t.expression) : void 0;
7178
7195
  return r === void 0 ? [] : [{
7179
7196
  addedFieldCount: n.properties.length - 1,
7180
7197
  group: r
@@ -7182,77 +7199,84 @@ function Da(e, t) {
7182
7199
  });
7183
7200
  return [...r, ...i];
7184
7201
  }
7185
- function Oa(e) {
7186
- let [t] = Aa(e.type, "InferOutput") ? e.type.typeArguments ?? [] : [];
7202
+ function ka(e) {
7203
+ let [t] = ja(e.type, "InferOutput") ? e.type.typeArguments ?? [] : [];
7187
7204
  if (t === void 0) return;
7188
7205
  if (l.isTypeQueryNode(t)) return t.exprName;
7189
- let [n] = Aa(t, "ReturnType") ? t.typeArguments ?? [] : [], [r] = n !== void 0 && l.isTypeQueryNode(n) ? n.typeArguments ?? [] : [];
7206
+ let [n] = ja(t, "ReturnType") ? t.typeArguments ?? [] : [], [r] = n !== void 0 && l.isTypeQueryNode(n) ? n.typeArguments ?? [] : [];
7190
7207
  return r !== void 0 && l.isTypeQueryNode(r) ? r.exprName : void 0;
7191
7208
  }
7192
- function ka(e, t) {
7193
- let n = Oa(t), r = n === void 0 ? void 0 : Ma(e, n);
7209
+ function Aa(e, t) {
7210
+ let n = ka(t), r = n === void 0 ? void 0 : Na(e, n);
7194
7211
  if (r === void 0) return;
7195
7212
  if (l.isObjectLiteralExpression(r)) return r;
7196
7213
  let [i] = l.isCallExpression(r) ? r.arguments : [];
7197
- return i === void 0 ? void 0 : ja(e, i);
7214
+ return i === void 0 ? void 0 : Ma(e, i);
7198
7215
  }
7199
- function Aa(e, t) {
7216
+ function ja(e, t) {
7200
7217
  return l.isTypeReferenceNode(e) ? (l.isQualifiedName(e.typeName) ? e.typeName.right : e.typeName).text === t : !1;
7201
7218
  }
7202
- function ja(e, t) {
7219
+ function Ma(e, t) {
7203
7220
  if (l.isObjectLiteralExpression(t)) return t;
7204
- let n = Ma(e, t);
7221
+ let n = Na(e, t);
7205
7222
  return n !== void 0 && l.isObjectLiteralExpression(n) ? n : void 0;
7206
7223
  }
7207
- function Ma(e, t) {
7208
- let n = e.getSymbolAtLocation(t), r = n === void 0 ? void 0 : Na(e, n).valueDeclaration;
7224
+ function Na(e, t) {
7225
+ let n = e.getSymbolAtLocation(t), r = n === void 0 ? void 0 : Pa(e, n).valueDeclaration;
7209
7226
  return r !== void 0 && l.isVariableDeclaration(r) ? r.initializer : void 0;
7210
7227
  }
7211
- function Na(e, t) {
7228
+ function Pa(e, t) {
7212
7229
  return (t.flags & l.SymbolFlags.Alias) === 0 ? t : e.getAliasedSymbol(t);
7213
7230
  }
7214
- function Pa(e, t) {
7231
+ function Fa(e, t) {
7215
7232
  if (e.name !== "default") return e.name;
7216
7233
  let n = t.declarations?.map((e) => l.getNameOfDeclaration(e)?.getText()).find((e) => e !== void 0);
7217
7234
  return n === void 0 || n === "default" ? "default" : `default (${n})`;
7218
7235
  }
7219
- function Fa(e, t) {
7220
- let n = t.valueDeclaration, r = n !== void 0 && l.isParameter(n) ? n : void 0, i = r?.questionToken !== void 0 || r?.initializer !== void 0, a = r?.type === void 0 ? e.typeToString(e.getTypeOfSymbol(t), n) : Ia(r.type);
7236
+ function Ia(e, t) {
7237
+ let n = t.valueDeclaration, r = n !== void 0 && l.isParameter(n) ? n : void 0, i = r?.questionToken !== void 0 || r?.initializer !== void 0, a = r?.type === void 0 ? e.typeToString(e.getTypeOfSymbol(t), n) : La(r.type);
7221
7238
  return `${t.name}${i ? "?" : ""}: ${a}`;
7222
7239
  }
7223
- function Ia(e) {
7240
+ function La(e) {
7224
7241
  return e.getText().replaceAll(/\s+/g, " ");
7225
7242
  }
7226
- function La(e, t) {
7243
+ function Ra(e, t) {
7227
7244
  let n = ha.flatMap((e) => {
7228
- let n = t.get(e) ?? [], r = n.map((e) => `- ${e}`);
7245
+ let n = t.get(e) ?? [], r = n.map((e) => za(e));
7229
7246
  return n.length === 0 ? [] : [`### ${e}\n\n${r.join("\n")}`];
7230
7247
  });
7231
7248
  return [`## ${e}`, ...n].join("\n\n");
7232
7249
  }
7250
+ function za({ description: e, detail: t, name: n, origin: r }) {
7251
+ let i = `- **\`${n}\`**${t === "" ? "" : `\`${t}\``}${Ba(r)}`;
7252
+ return e === void 0 ? i : `${i}\n > ${e}`;
7253
+ }
7254
+ function Ba(e) {
7255
+ return e.replaceAll(/[\\`*<]|(?<![\da-z])_|_(?![\da-z])/gi, (e) => `\\${e}`);
7256
+ }
7233
7257
  //#endregion
7234
7258
  //#region src/actions/documentOpening.ts
7235
- var Ra = "<!-- OPENING_START -->", za = "<!-- OPENING_END -->";
7236
- async function Ba() {
7259
+ var Va = "<!-- OPENING_START -->", Ha = "<!-- OPENING_END -->";
7260
+ async function Ua() {
7237
7261
  try {
7238
7262
  G("Document Opening"), q("1️⃣ Insert opening content into 'README.md'");
7239
7263
  let e = await W("package.json"), t = await W("config.json"), { owner: n, repo: r } = qn(e, "document opening");
7240
- await Wn(Ua(n, r, Va(e), Ha(t), e.devDependencies?.fallow != null), Ra, za), K("Opening documented");
7264
+ await Wn(Ka(n, r, Wa(e), Ga(t), e.devDependencies?.fallow != null), Va, Ha), K("Opening documented");
7241
7265
  } catch (e) {
7242
7266
  console.error("❌ Error documenting opening", e), process.exit(1);
7243
7267
  }
7244
7268
  }
7245
- function Va(e) {
7269
+ function Wa(e) {
7246
7270
  let t = e.license;
7247
7271
  if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
7248
7272
  return t;
7249
7273
  }
7250
- function Ha(e) {
7274
+ function Ga(e) {
7251
7275
  let t = e.description.en;
7252
7276
  if (t == null || t.length === 0) throw Error("config.json 'description.en' field is required to document opening.");
7253
7277
  return t;
7254
7278
  }
7255
- function Ua(e, t, n, r, i) {
7279
+ function Ka(e, t, n, r, i) {
7256
7280
  let a = `https://github.com/${e}/${t}`, o = n.replaceAll("-", "--"), s = encodeURIComponent(`https://raw.githubusercontent.com/${e}/${t}/main/${Nn}`);
7257
7281
  return `[![License: ${n}](https://img.shields.io/badge/License-${o}-blue.svg)](./LICENSE)
7258
7282
  [![DPUse version](https://img.shields.io/github/v/release/${e}/${t}?color=f6821f&label=DPUse)](${a}/releases/latest)
@@ -7280,12 +7304,12 @@ ${r}`;
7280
7304
  }
7281
7305
  //#endregion
7282
7306
  //#region src/actions/documentUsage.ts
7283
- var Wa = "<!-- USAGE_START -->", Ga = "<!-- USAGE_END -->", Ka = /* @__PURE__ */ new Set([
7307
+ var qa = "<!-- USAGE_START -->", Ja = "<!-- USAGE_END -->", Ya = /* @__PURE__ */ new Set([
7284
7308
  "connector",
7285
7309
  "context",
7286
7310
  "cookbook",
7287
7311
  "presenter"
7288
- ]), qa = [
7312
+ ]), Xa = [
7289
7313
  ["build", "Builds the project."],
7290
7314
  ["build:ts", "Builds the TypeScript source."],
7291
7315
  ["test", "Runs the tests."],
@@ -7304,35 +7328,35 @@ var Wa = "<!-- USAGE_START -->", Ga = "<!-- USAGE_END -->", Ka = /* @__PURE__ */
7304
7328
  ["sync", "Bumps the version, then commits and pushes to GitHub."],
7305
7329
  ["release", "Bumps the version, commits and pushes, and creates a GitHub release."],
7306
7330
  ["publish", "Registers the released version with DPUse."]
7307
- ], Ja = /* @__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", Xa = "Cloned or forked code is unsupported and isn't guaranteed to remain compatible with the DPUse Engine as it evolves.";
7308
- async function Za() {
7331
+ ], Za = /* @__PURE__ */ new Set(["development", "eslint"]), Qa = "> [!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", $a = "Cloned or forked code is unsupported and isn't guaranteed to remain compatible with the DPUse Engine as it evolves.";
7332
+ async function eo() {
7309
7333
  try {
7310
7334
  G("Document Usage"), q("1️⃣ Insert usage content into 'README.md'");
7311
- let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = Qa(e), r = $a(n), i = eo(e.engines?.node), a = eo(e.engines?.npm), o = eo(e.devDependencies?.typescript);
7312
- await Wn(io(to(Kn(t.id), e.name), n, r, i, a, o, no(e)), Wa, Ga), K("Usage documented");
7335
+ let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = to(e), r = no(n), i = ro(e.engines?.node), a = ro(e.engines?.npm), o = ro(e.devDependencies?.typescript);
7336
+ await Wn(so(io(Kn(t.id), e.name), n, r, i, a, o, ao(e)), qa, Ja), K("Usage documented");
7313
7337
  } catch (e) {
7314
7338
  console.error("❌ Error documenting usage", e), process.exit(1);
7315
7339
  }
7316
7340
  }
7317
- function Qa(e) {
7341
+ function to(e) {
7318
7342
  let t = e.repository, n = typeof t == "string" ? t : t?.url;
7319
7343
  if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
7320
7344
  return n.replace(/^git\+/, "");
7321
7345
  }
7322
- function $a(e) {
7346
+ function no(e) {
7323
7347
  return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
7324
7348
  }
7325
- function eo(e) {
7349
+ function ro(e) {
7326
7350
  if (e == null) throw Error("package.json version range is required to document usage.");
7327
7351
  let t = /\d+(?:\.\d+)*/.exec(e);
7328
7352
  if (t == null) throw Error(`Unable to parse version from '${e}'.`);
7329
7353
  return t[0];
7330
7354
  }
7331
- function to(e, t) {
7355
+ function io(e, t) {
7332
7356
  let { typeId: n } = e;
7333
- if (Ka.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.
7357
+ if (Ya.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.
7334
7358
 
7335
- 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. ${Xa}`;
7359
+ 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. ${$a}`;
7336
7360
  if (e.publishedTo === "npm") {
7337
7361
  if (t == null || t === "") throw Error("package.json 'name' field is required to document usage.");
7338
7362
  return `This package is published to the [public npm registry](https://www.npmjs.com/package/${t}). Install it with:
@@ -7341,18 +7365,18 @@ You may view or clone this repository for your own purposes, such as building a
7341
7365
  npm install ${t}
7342
7366
  \`\`\`
7343
7367
 
7344
- ${Ja.has(n) ? Ya : ""}To work on the source instead, clone this repository. ${Xa}`;
7368
+ ${Za.has(n) ? Qa : ""}To work on the source instead, clone this repository. ${$a}`;
7345
7369
  }
7346
- return `You may view or clone this repository for your own purposes. ${Xa}`;
7370
+ return `You may view or clone this repository for your own purposes. ${$a}`;
7347
7371
  }
7348
- function no(e) {
7349
- 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 = qa.filter(([e]) => i(e)).map(([e, t]) => `|\`${ro(e)}\`|${t}|`);
7372
+ function ao(e) {
7373
+ 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 = Xa.filter(([e]) => i(e)).map(([e, t]) => `|\`${oo(e)}\`|${t}|`);
7350
7374
  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")}`;
7351
7375
  }
7352
- function ro(e) {
7376
+ function oo(e) {
7353
7377
  return e === "test" ? "npm test" : `npm run ${e}`;
7354
7378
  }
7355
- function io(e, t, n, r, i, a, o) {
7379
+ function so(e, t, n, r, i, a, o) {
7356
7380
  return `## Usage
7357
7381
 
7358
7382
  ${e}
@@ -7367,7 +7391,7 @@ _Requires [Node.js](https://nodejs.org/) ${r} or later, [npm](https://www.npmjs.
7367
7391
  }
7368
7392
  //#endregion
7369
7393
  //#region src/actions/formatCode.ts
7370
- async function ao() {
7394
+ async function co() {
7371
7395
  try {
7372
7396
  G("Format Code"), await U("1️⃣ Format", "prettier", [
7373
7397
  "--write",
@@ -7386,7 +7410,7 @@ async function ao() {
7386
7410
  }
7387
7411
  //#endregion
7388
7412
  //#region src/actions/lintCode.ts
7389
- async function oo() {
7413
+ async function lo() {
7390
7414
  try {
7391
7415
  G("Lint Code"), await U("1️⃣ Lint", "eslint", ["."]), K("Code linted");
7392
7416
  } catch (e) {
@@ -7395,7 +7419,7 @@ async function oo() {
7395
7419
  }
7396
7420
  //#endregion
7397
7421
  //#region src/utilities/cloudflare.ts
7398
- async function so() {
7422
+ async function uo() {
7399
7423
  let e = await W("config.json"), t = {
7400
7424
  body: JSON.stringify(e),
7401
7425
  headers: { "Content-Type": "application/json" },
@@ -7403,7 +7427,7 @@ async function so() {
7403
7427
  }, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
7404
7428
  if (!n.ok) throw Error(await n.text());
7405
7429
  }
7406
- async function co(e, t) {
7430
+ async function fo(e, t) {
7407
7431
  async function n(e, t, r) {
7408
7432
  for (let i of r) {
7409
7433
  let r = `${e}/${i}`, a = `${t}/${i}`;
@@ -7421,7 +7445,7 @@ async function co(e, t) {
7421
7445
  let r = await Rn(`${e}/${t}/`);
7422
7446
  await n(`${e}/${t}`, t, r);
7423
7447
  }
7424
- async function lo(e) {
7448
+ async function po(e) {
7425
7449
  let t = e.id, n = {
7426
7450
  body: JSON.stringify(e),
7427
7451
  headers: { "Content-Type": "application/json" },
@@ -7429,7 +7453,7 @@ async function lo(e) {
7429
7453
  }, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
7430
7454
  if (!r.ok) throw Error(await r.text());
7431
7455
  }
7432
- async function uo(e, t) {
7456
+ async function mo(e, t) {
7433
7457
  let n = `v${e.version ?? "unknown"}`;
7434
7458
  async function r(e, r = "") {
7435
7459
  let i = await Rn(e, { withFileTypes: !0 });
@@ -7453,24 +7477,24 @@ async function uo(e, t) {
7453
7477
  }
7454
7478
  //#endregion
7455
7479
  //#region node_modules/valibot/dist/index.mjs
7456
- var fo = {
7480
+ var ho = {
7457
7481
  lang: void 0,
7458
7482
  message: void 0,
7459
7483
  abortEarly: void 0,
7460
7484
  abortPipeEarly: void 0
7461
7485
  };
7462
7486
  /* @__NO_SIDE_EFFECTS__ */
7463
- function po(e) {
7487
+ function go(e) {
7464
7488
  return e ? {
7465
7489
  lang: e?.lang ?? void 0,
7466
7490
  message: e?.message,
7467
7491
  abortEarly: e?.abortEarly ?? void 0,
7468
7492
  abortPipeEarly: e?.abortPipeEarly ?? void 0
7469
- } : fo;
7493
+ } : ho;
7470
7494
  }
7471
7495
  /* @__NO_SIDE_EFFECTS__ */
7472
- function mo(e, t, n) {
7473
- let r = e["~run"]({ value: t }, /* @__PURE__ */ po(n));
7496
+ function _o(e, t, n) {
7497
+ let r = e["~run"]({ value: t }, /* @__PURE__ */ go(n));
7474
7498
  return {
7475
7499
  typed: r.typed,
7476
7500
  success: !r.issues,
@@ -7480,21 +7504,21 @@ function mo(e, t, n) {
7480
7504
  }
7481
7505
  //#endregion
7482
7506
  //#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModulePresenter.es.js
7483
- var ho = Vi([
7507
+ var vo = Vi([
7484
7508
  "list",
7485
7509
  "render",
7486
7510
  "setColorMode"
7487
- ]), go = /* @__PURE__ */ Q({
7511
+ ]), yo = /* @__PURE__ */ Q({
7488
7512
  ...Yi,
7489
7513
  typeId: /* @__PURE__ */ Ni("presenter"),
7490
- actionNames: /* @__PURE__ */ ji(ho),
7514
+ actionNames: /* @__PURE__ */ ji(vo),
7491
7515
  presentations: /* @__PURE__ */ ji(qi)
7492
- }), _o = [
7516
+ }), bo = [
7493
7517
  "1️⃣ ",
7494
7518
  "2️⃣ ",
7495
7519
  "3️⃣ ",
7496
7520
  "4️⃣ "
7497
- ], vo = [{
7521
+ ], xo = [{
7498
7522
  id: "unit",
7499
7523
  label: "Run unit tests",
7500
7524
  command: "vitest",
@@ -7507,36 +7531,36 @@ var ho = Vi([
7507
7531
  arguments: ["test", "--pass-with-no-tests"],
7508
7532
  configFileName: "playwright.config.ts"
7509
7533
  }];
7510
- async function yo() {
7534
+ async function So() {
7511
7535
  try {
7512
7536
  G("Build Project"), await U("1️⃣ Bundle project", "vite", ["build"]), await Hn("API_REFERENCE.md") === null ? q(`2️⃣ '${ma}' NOT required by this project`) : await va("2️⃣ "), K("Project built");
7513
7537
  } catch (e) {
7514
7538
  console.error("❌ Error building project", e), process.exit(1);
7515
7539
  }
7516
7540
  }
7517
- async function bo() {
7541
+ async function Co() {
7518
7542
  try {
7519
7543
  G("Publish Project");
7520
7544
  let e = await W("package.json"), t = await W("config.json");
7521
- await ko("1️⃣ ", e, t, Kn(t.id)), K(`Project version '${e.version ?? "unknown"}' published.`);
7545
+ await Mo("1️⃣ ", e, t, Kn(t.id)), K(`Project version '${e.version ?? "unknown"}' published.`);
7522
7546
  } catch (e) {
7523
7547
  console.error("❌ Error publishing project", e), process.exit(1);
7524
7548
  }
7525
7549
  }
7526
- async function xo() {
7550
+ async function wo() {
7527
7551
  try {
7528
7552
  G("Release Project");
7529
7553
  let e = await W("package.json"), t = await W("config.json");
7530
- await Oo("1️⃣ ", e);
7554
+ await jo("1️⃣ ", e);
7531
7555
  let n = Kn(t.id);
7532
7556
  switch (n.typeId) {
7533
7557
  case "connector":
7534
- t = await Co("2️⃣ ", e);
7558
+ t = await Eo("2️⃣ ", e);
7535
7559
  break;
7536
7560
  case "presenter":
7537
- t = await wo("2️⃣ ", e);
7561
+ t = await Do("2️⃣ ", e);
7538
7562
  break;
7539
- default: t = await So("2️⃣ ", e);
7563
+ default: t = await To("2️⃣ ", e);
7540
7564
  }
7541
7565
  await U("3️⃣ Bundle project", "vite", ["build"]), await zn("4️⃣ Stage changes", "git", ["add", "."]), await zn("5️⃣ Commit changes", "git", [
7542
7566
  "commit",
@@ -7546,7 +7570,7 @@ async function xo() {
7546
7570
  "push",
7547
7571
  "origin",
7548
7572
  "main:main"
7549
- ]), await ko("7️⃣ ", e, t, n), n.publishedTo === "npm" ? await U("8️⃣ Create GitHub release", "gh", [
7573
+ ]), await Mo("7️⃣ ", e, t, n), n.publishedTo === "npm" ? await U("8️⃣ Create GitHub release", "gh", [
7550
7574
  "release",
7551
7575
  "create",
7552
7576
  `v${e.version ?? "unknown"}`,
@@ -7559,39 +7583,39 @@ async function xo() {
7559
7583
  console.error("❌ Error releasing project", e), process.exit(1);
7560
7584
  }
7561
7585
  }
7562
- async function So(e, t) {
7586
+ async function To(e, t) {
7563
7587
  q(`${e} Build project configuration`);
7564
7588
  let n = await W("config.json");
7565
7589
  return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await Hn("logo.svg"), n.iconDark ??= await Hn("logoDark.svg"), await Un("config.json", n), n;
7566
7590
  }
7567
- async function Co(e, t) {
7591
+ async function Eo(e, t) {
7568
7592
  q(`${e} Build connector project configuration`);
7569
- let [n, r] = await Promise.all([W("config.json"), Vn("src/index.ts")]), i = /* @__PURE__ */ mo(na, n);
7593
+ let [n, r] = await Promise.all([W("config.json"), Vn("src/index.ts")]), i = /* @__PURE__ */ _o(na, n);
7570
7594
  if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
7571
7595
  let a = Yn(r);
7572
- return await To(t, n, a, oa(a));
7596
+ return await Oo(t, n, a, oa(a));
7573
7597
  }
7574
- async function wo(e, t) {
7598
+ async function Do(e, t) {
7575
7599
  q(`${e} Build presenter project configuration`);
7576
- let [n, r] = await Promise.all([W("config.json"), Vn("src/index.ts")]), i = /* @__PURE__ */ mo(go, n);
7600
+ let [n, r] = await Promise.all([W("config.json"), Vn("src/index.ts")]), i = /* @__PURE__ */ _o(yo, n);
7577
7601
  if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
7578
- return await To(t, n, Yn(r));
7602
+ return await Oo(t, n, Yn(r));
7579
7603
  }
7580
- async function To(e, t, n, r) {
7604
+ async function Oo(e, t, n, r) {
7581
7605
  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 Un("config.json", t), t;
7582
7606
  }
7583
- async function Eo() {
7607
+ async function ko() {
7584
7608
  try {
7585
7609
  G("Synchronise Project with GitHub");
7586
7610
  let e = await W("package.json"), t = await W("config.json");
7587
- switch (await Oo("1️⃣ ", e), Kn(t.id).typeId) {
7611
+ switch (await jo("1️⃣ ", e), Kn(t.id).typeId) {
7588
7612
  case "connector":
7589
- await Co("2️⃣ ", e);
7613
+ await Eo("2️⃣ ", e);
7590
7614
  break;
7591
7615
  case "presenter":
7592
- await wo("2️⃣ ", e);
7616
+ await Do("2️⃣ ", e);
7593
7617
  break;
7594
- default: await So("2️⃣ ", e);
7618
+ default: await To("2️⃣ ", e);
7595
7619
  }
7596
7620
  await zn("3️⃣ Stage changes", "git", ["add", "."]), await zn("4️⃣ Commit changes", "git", [
7597
7621
  "commit",
@@ -7606,14 +7630,14 @@ async function Eo() {
7606
7630
  console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
7607
7631
  }
7608
7632
  }
7609
- async function Do(e = ["unit"], t = !1) {
7633
+ async function Ao(e = ["unit"], t = !1) {
7610
7634
  try {
7611
7635
  G("Test Project");
7612
7636
  let n = 0;
7613
- for (let r of vo) {
7637
+ for (let r of xo) {
7614
7638
  if (!e.includes(r.id) || await Hn(r.configFileName) === null) continue;
7615
7639
  let i = t && r.id === "unit" ? ["--coverage"] : [];
7616
- await U(`${_o[n] ?? ""} ${r.label}`, r.command, [...r.arguments, ...i]), n += 1;
7640
+ await U(`${bo[n] ?? ""} ${r.label}`, r.command, [...r.arguments, ...i]), n += 1;
7617
7641
  }
7618
7642
  if (n === 0) {
7619
7643
  console.warn("\n⚠️ No tests configured for this project.\n");
@@ -7624,7 +7648,7 @@ async function Do(e = ["unit"], t = !1) {
7624
7648
  console.error("❌ Error testing project", e), process.exit(1);
7625
7649
  }
7626
7650
  }
7627
- async function Oo(e, t, n = "./") {
7651
+ async function jo(e, t, n = "./") {
7628
7652
  if (q(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
7629
7653
  else {
7630
7654
  let e = t.version, n = t.version.split(".");
@@ -7632,15 +7656,15 @@ async function Oo(e, t, n = "./") {
7632
7656
  }
7633
7657
  await Un(`${n}package.json`, t);
7634
7658
  }
7635
- async function ko(e, t, n, r) {
7636
- if (r.typeId === "app") q(`${e} Register module`), await so();
7637
- else if (r.typeId === "engine") q(`${e} Register module`), await uo(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await lo(n);
7659
+ async function Mo(e, t, n, r) {
7660
+ if (r.typeId === "app") q(`${e} Register module`), await uo();
7661
+ else if (r.typeId === "engine") q(`${e} Register module`), await mo(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await po(n);
7638
7662
  else if (r.uploadGroupName === void 0) q(`${e} Registration NOT required`);
7639
7663
  else {
7640
7664
  q(`${e} Register module`);
7641
7665
  let i = n.id.split("-").slice(2).join("-");
7642
- await uo(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await lo(n);
7666
+ await mo(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await po(n);
7643
7667
  }
7644
7668
  }
7645
7669
  //#endregion
7646
- export { Qn as auditDependencies, yo as buildProject, tr as checkConfigFiles, lr as checkDependencies, _a as documentAPIReference, pa as documentActions, vr as documentBundleSizes, Br as documentDependencies, ci as documentGovernance, Ba as documentOpening, Za as documentUsage, ao as formatCode, oo as lintCode, bo as publishProject, xo as releaseProject, Eo as syncProjectWithGitHub, Do as testProject, co as uploadDirectoryToR2 };
7670
+ export { Qn as auditDependencies, So as buildProject, tr as checkConfigFiles, lr as checkDependencies, _a as documentAPIReference, pa as documentActions, vr as documentBundleSizes, Br as documentDependencies, ci as documentGovernance, Ua as documentOpening, eo as documentUsage, co as formatCode, lo as lintCode, Co as publishProject, wo as releaseProject, ko as syncProjectWithGitHub, Ao as testProject, fo as uploadDirectoryToR2 };