@dpuse/dpuse-development 0.3.756 → 0.3.758

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
@@ -101,6 +101,10 @@ The package implements the following actions:
101
101
 
102
102
  All actions are designed to be run from `package.json` scripts and assume that the project follows the standard DPUse directory structure and that it includes a `config.json` file in the root directory.
103
103
 
104
+ ## API Reference
105
+
106
+ See [API_REFERENCE.md](./API_REFERENCE.md) for the complete API reference, including every exported action and type.
107
+
104
108
  <!-- DEPENDENCY_LICENSES_START -->
105
109
 
106
110
  ## Dependency Licenses
@@ -120,18 +124,18 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
120
124
 
121
125
  |Chunk/Module/File|Composition|
122
126
  |:------ |:-----------|
123
- | dist/dpuse-development.es.js | 326.9 kB · gzip 84.4 kB |
124
- | &nbsp;&nbsp;&nbsp;&nbsp;acorn → dist/acorn.mjs | `████████░░░░░░░░░░░░` 40.0% |
125
- | &nbsp;&nbsp;&nbsp;&nbsp;acorn-typescript → lib/index.mjs | `███████░░░░░░░░░░░░░` 35.0% |
126
- | &nbsp;&nbsp;&nbsp;&nbsp;src | `███░░░░░░░░░░░░░░░░░` 14.7% |
127
+ | dist/dpuse-development.es.js | 330.6 kB · gzip 85.5 kB |
128
+ | &nbsp;&nbsp;&nbsp;&nbsp;acorn → dist/acorn.mjs | `████████░░░░░░░░░░░░` 39.6% |
129
+ | &nbsp;&nbsp;&nbsp;&nbsp;acorn-typescript → lib/index.mjs | `███████░░░░░░░░░░░░░` 34.7% |
130
+ | &nbsp;&nbsp;&nbsp;&nbsp;src | `███░░░░░░░░░░░░░░░░░` 15.6% |
127
131
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentGovernance.ts | `█░░░░░░░░░░░░░░░░░░░` 2.7% |
132
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentApiReference.ts | `░░░░░░░░░░░░░░░░░░░░` 2.1% |
128
133
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentDependencies.ts | `░░░░░░░░░░░░░░░░░░░░` 1.7% |
129
134
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;manageProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.7% |
130
135
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;index.ts | `░░░░░░░░░░░░░░░░░░░░` 1.6% |
131
136
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentUsage.ts | `░░░░░░░░░░░░░░░░░░░░` 1.3% |
132
137
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentBundleSizes.ts | `░░░░░░░░░░░░░░░░░░░░` 1.3% |
133
138
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;checkConfigFiles.ts | `░░░░░░░░░░░░░░░░░░░░` 1.1% |
134
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentApiReference.ts | `░░░░░░░░░░░░░░░░░░░░` 1.0% |
135
139
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentActions.ts | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
136
140
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentOpening.ts | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
137
141
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cloudflare.ts | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
@@ -139,8 +143,8 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
139
143
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;formatCode.ts | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
140
144
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;auditDependencies.ts | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
141
145
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lintCode.ts | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
142
- | &nbsp;&nbsp;&nbsp;&nbsp;(bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 6.7% |
143
- | &nbsp;&nbsp;&nbsp;&nbsp;@dpuse/dpuse-shared | `█░░░░░░░░░░░░░░░░░░░` 3.5% |
146
+ | &nbsp;&nbsp;&nbsp;&nbsp;(bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 6.6% |
147
+ | &nbsp;&nbsp;&nbsp;&nbsp;@dpuse/dpuse-shared | `█░░░░░░░░░░░░░░░░░░░` 3.4% |
144
148
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dist/componentConfig.schema-DT3mO5rS.js | `█░░░░░░░░░░░░░░░░░░░` 2.6% |
145
149
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dist/dpuse-shared-componentModuleConnector.es.js | `░░░░░░░░░░░░░░░░░░░░` 0.7% |
146
150
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dist/moduleConfig.schema-aYmFWSrn.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
@@ -163,7 +167,7 @@ This section is updated each time `npm run document` is run. Settings come from
163
167
  |:-|:-|:-|
164
168
  |Unit tests|✅ On|Run in CI on every push to `main`.|
165
169
  |Property-based tests|✅ fast-check|Fuzz testing: many random inputs per test to find edge cases, run with the unit tests.|
166
- |Test coverage|✅ 99.6% of lines|Share of source lines the unit tests run. The target is 80%.|
170
+ |Test coverage|✅ 99.7% of lines|Share of source lines the unit tests run. The target is 80%.|
167
171
 
168
172
  ### Code Quality
169
173
 
@@ -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();
7081
+ let n = l.createProgram(t.map(({ sourcePath: e }) => e), ba()), r = n.getTypeChecker(), i = Ea(n, r);
7082
7082
  await Gn(ma, `# API Reference\n\n${ga}\n\n${t.map(({ importPath: e, sourcePath: t }) => {
7083
- let i = n.getSourceFile(t);
7084
- if (i === void 0) throw Error(`Unable to read '${t}', the source of '${e}'.`);
7085
- return Ta(e, xa(r, i));
7083
+ let a = n.getSourceFile(t);
7084
+ if (a === void 0) throw Error(`Unable to read '${t}', the source of '${e}'.`);
7085
+ return La(e, xa(r, a, i));
7086
7086
  }).join("\n\n")}\n`);
7087
7087
  }
7088
7088
  function ya(e) {
@@ -7105,41 +7105,125 @@ function ba() {
7105
7105
  let { config: t } = l.readConfigFile(e, (e) => l.sys.readFile(e));
7106
7106
  return l.parseJsonConfigFileContent(t, l.sys, process.cwd()).options;
7107
7107
  }
7108
- function xa(e, t) {
7109
- let n = new Map(ha.map((e) => [e, []])), r = e.getSymbolAtLocation(t), i = r === void 0 ? [] : e.getExportsOfModule(r);
7110
- for (let t of i) {
7111
- let r = (t.flags & l.SymbolFlags.Alias) === 0 ? t : e.getAliasedSymbol(t), i = Sa(e, Ca(t, r), r);
7112
- i !== void 0 && n.get(i.kind)?.push(i.text);
7108
+ function xa(e, t, n) {
7109
+ let r = new Map(ha.map((e) => [e, []])), i = e.getSymbolAtLocation(t), a = i === void 0 ? [] : e.getExportsOfModule(i);
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);
7113
7113
  }
7114
- for (let e of n.values()) e.sort((e, t) => e.localeCompare(t));
7115
- return n;
7114
+ for (let e of r.values()) e.sort((e, t) => e.localeCompare(t));
7115
+ return r;
7116
7116
  }
7117
- function Sa(e, t, n) {
7118
- let [r] = (n.flags & (l.SymbolFlags.Function | l.SymbolFlags.Variable)) === 0 ? [] : e.getSignaturesOfType(e.getTypeOfSymbol(n), l.SignatureKind.Call), i = t.endsWith("Schema");
7119
- return r !== void 0 && !i ? {
7117
+ function Sa(e, t, n, r) {
7118
+ let [i] = (n.flags & (l.SymbolFlags.Function | l.SymbolFlags.Variable)) === 0 ? [] : e.getSignaturesOfType(e.getTypeOfSymbol(n), l.SignatureKind.Call), a = t.endsWith("Schema");
7119
+ return i !== void 0 && !a ? {
7120
7120
  kind: "Functions",
7121
- text: `${t}(${r.parameters.map((e) => wa(e)).join(", ")})`
7122
- } : (n.flags & l.SymbolFlags.Class) === 0 ? (n.flags & l.SymbolFlags.Variable) === 0 ? (n.flags & (l.SymbolFlags.Enum | l.SymbolFlags.Interface | l.SymbolFlags.TypeAlias)) === 0 ? void 0 : {
7123
- kind: "Types",
7121
+ text: `${t}(${i.parameters.map((t) => Fa(e, t)).join(", ")})`
7122
+ } : (n.flags & l.SymbolFlags.Class) === 0 ? a && (n.flags & l.SymbolFlags.Variable) !== 0 ? {
7123
+ kind: "Schemas",
7124
7124
  text: t
7125
+ } : (n.flags & l.SymbolFlags.Variable) === 0 ? (n.flags & (l.SymbolFlags.Enum | l.SymbolFlags.Interface | l.SymbolFlags.TypeAlias)) === 0 ? void 0 : {
7126
+ kind: "Types",
7127
+ text: `${t}${wa(e, n, r)}`
7125
7128
  } : {
7126
- kind: i ? "Schemas" : "Constants",
7127
- text: t
7129
+ kind: "Constants",
7130
+ text: `${t}: ${Ca(e, n)}`
7128
7131
  } : {
7129
7132
  kind: "Classes",
7130
- text: t
7133
+ text: `${t}${wa(e, n, r)}`
7131
7134
  };
7132
7135
  }
7133
7136
  function Ca(e, t) {
7137
+ 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);
7139
+ }
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);
7142
+ if (i !== void 0 && a !== void 0) {
7143
+ r.push(`inferred from ${a.getText()}`);
7144
+ let t = ka(e, i), o = t === void 0 ? [] : Ta(e, t, i.name.text, n);
7145
+ o.length > 0 && r.push(`extends ${o.join(", ")}`);
7146
+ }
7147
+ return r.length === 0 ? "" : ` (${r.join(", ")})`;
7148
+ }
7149
+ function Ta(e, t, n, r) {
7150
+ return t.properties.flatMap((t) => {
7151
+ let i = l.isSpreadAssignment(t) ? ja(e, t.expression) : void 0;
7152
+ if (i === void 0) return [];
7153
+ let a = r.get(i);
7154
+ return a === n ? Ta(e, i, n, r) : a === void 0 ? [] : [a];
7155
+ });
7156
+ }
7157
+ function Ea(e, t) {
7158
+ 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) ?? [], {
7160
+ addedFieldCount: r,
7161
+ typeName: e.name.text
7162
+ }]);
7163
+ let i = /* @__PURE__ */ new Map();
7164
+ for (let [e, t] of n) {
7165
+ let n = Math.min(...t.map(({ addedFieldCount: e }) => e)), [r, ...a] = t.filter(({ addedFieldCount: e }) => e === n);
7166
+ r !== void 0 && a.length === 0 && i.set(e, r.typeName);
7167
+ }
7168
+ return i;
7169
+ }
7170
+ function Da(e, t) {
7171
+ let n = ka(e, t);
7172
+ if (n === void 0) return [];
7173
+ let r = l.isVariableDeclaration(n.parent) ? [{
7174
+ addedFieldCount: 0,
7175
+ group: n
7176
+ }] : [], i = n.properties.flatMap((t) => {
7177
+ let r = l.isSpreadAssignment(t) ? ja(e, t.expression) : void 0;
7178
+ return r === void 0 ? [] : [{
7179
+ addedFieldCount: n.properties.length - 1,
7180
+ group: r
7181
+ }];
7182
+ });
7183
+ return [...r, ...i];
7184
+ }
7185
+ function Oa(e) {
7186
+ let [t] = Aa(e.type, "InferOutput") ? e.type.typeArguments ?? [] : [];
7187
+ if (t === void 0) return;
7188
+ if (l.isTypeQueryNode(t)) return t.exprName;
7189
+ let [n] = Aa(t, "ReturnType") ? t.typeArguments ?? [] : [], [r] = n !== void 0 && l.isTypeQueryNode(n) ? n.typeArguments ?? [] : [];
7190
+ return r !== void 0 && l.isTypeQueryNode(r) ? r.exprName : void 0;
7191
+ }
7192
+ function ka(e, t) {
7193
+ let n = Oa(t), r = n === void 0 ? void 0 : Ma(e, n);
7194
+ if (r === void 0) return;
7195
+ if (l.isObjectLiteralExpression(r)) return r;
7196
+ let [i] = l.isCallExpression(r) ? r.arguments : [];
7197
+ return i === void 0 ? void 0 : ja(e, i);
7198
+ }
7199
+ function Aa(e, t) {
7200
+ return l.isTypeReferenceNode(e) ? (l.isQualifiedName(e.typeName) ? e.typeName.right : e.typeName).text === t : !1;
7201
+ }
7202
+ function ja(e, t) {
7203
+ if (l.isObjectLiteralExpression(t)) return t;
7204
+ let n = Ma(e, t);
7205
+ return n !== void 0 && l.isObjectLiteralExpression(n) ? n : void 0;
7206
+ }
7207
+ function Ma(e, t) {
7208
+ let n = e.getSymbolAtLocation(t), r = n === void 0 ? void 0 : Na(e, n).valueDeclaration;
7209
+ return r !== void 0 && l.isVariableDeclaration(r) ? r.initializer : void 0;
7210
+ }
7211
+ function Na(e, t) {
7212
+ return (t.flags & l.SymbolFlags.Alias) === 0 ? t : e.getAliasedSymbol(t);
7213
+ }
7214
+ function Pa(e, t) {
7134
7215
  if (e.name !== "default") return e.name;
7135
7216
  let n = t.declarations?.map((e) => l.getNameOfDeclaration(e)?.getText()).find((e) => e !== void 0);
7136
7217
  return n === void 0 || n === "default" ? "default" : `default (${n})`;
7137
7218
  }
7138
- function wa(e) {
7139
- let t = e.valueDeclaration, n = t !== void 0 && l.isParameter(t) && (t.questionToken !== void 0 || t.initializer !== void 0);
7140
- return `${e.name}${n ? "?" : ""}`;
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);
7221
+ return `${t.name}${i ? "?" : ""}: ${a}`;
7222
+ }
7223
+ function Ia(e) {
7224
+ return e.getText().replaceAll(/\s+/g, " ");
7141
7225
  }
7142
- function Ta(e, t) {
7226
+ function La(e, t) {
7143
7227
  let n = ha.flatMap((e) => {
7144
7228
  let n = t.get(e) ?? [], r = n.map((e) => `- ${e}`);
7145
7229
  return n.length === 0 ? [] : [`### ${e}\n\n${r.join("\n")}`];
@@ -7148,27 +7232,27 @@ function Ta(e, t) {
7148
7232
  }
7149
7233
  //#endregion
7150
7234
  //#region src/actions/documentOpening.ts
7151
- var Ea = "<!-- OPENING_START -->", Da = "<!-- OPENING_END -->";
7152
- async function Oa() {
7235
+ var Ra = "<!-- OPENING_START -->", za = "<!-- OPENING_END -->";
7236
+ async function Ba() {
7153
7237
  try {
7154
7238
  G("Document Opening"), q("1️⃣ Insert opening content into 'README.md'");
7155
7239
  let e = await W("package.json"), t = await W("config.json"), { owner: n, repo: r } = qn(e, "document opening");
7156
- await Wn(ja(n, r, ka(e), Aa(t), e.devDependencies?.fallow != null), Ea, Da), K("Opening documented");
7240
+ await Wn(Ua(n, r, Va(e), Ha(t), e.devDependencies?.fallow != null), Ra, za), K("Opening documented");
7157
7241
  } catch (e) {
7158
7242
  console.error("❌ Error documenting opening", e), process.exit(1);
7159
7243
  }
7160
7244
  }
7161
- function ka(e) {
7245
+ function Va(e) {
7162
7246
  let t = e.license;
7163
7247
  if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
7164
7248
  return t;
7165
7249
  }
7166
- function Aa(e) {
7250
+ function Ha(e) {
7167
7251
  let t = e.description.en;
7168
7252
  if (t == null || t.length === 0) throw Error("config.json 'description.en' field is required to document opening.");
7169
7253
  return t;
7170
7254
  }
7171
- function ja(e, t, n, r, i) {
7255
+ function Ua(e, t, n, r, i) {
7172
7256
  let a = `https://github.com/${e}/${t}`, o = n.replaceAll("-", "--"), s = encodeURIComponent(`https://raw.githubusercontent.com/${e}/${t}/main/${Nn}`);
7173
7257
  return `[![License: ${n}](https://img.shields.io/badge/License-${o}-blue.svg)](./LICENSE)
7174
7258
  [![DPUse version](https://img.shields.io/github/v/release/${e}/${t}?color=f6821f&label=DPUse)](${a}/releases/latest)
@@ -7196,12 +7280,12 @@ ${r}`;
7196
7280
  }
7197
7281
  //#endregion
7198
7282
  //#region src/actions/documentUsage.ts
7199
- var Ma = "<!-- USAGE_START -->", Na = "<!-- USAGE_END -->", Pa = /* @__PURE__ */ new Set([
7283
+ var Wa = "<!-- USAGE_START -->", Ga = "<!-- USAGE_END -->", Ka = /* @__PURE__ */ new Set([
7200
7284
  "connector",
7201
7285
  "context",
7202
7286
  "cookbook",
7203
7287
  "presenter"
7204
- ]), Fa = [
7288
+ ]), qa = [
7205
7289
  ["build", "Builds the project."],
7206
7290
  ["build:ts", "Builds the TypeScript source."],
7207
7291
  ["test", "Runs the tests."],
@@ -7220,35 +7304,35 @@ var Ma = "<!-- USAGE_START -->", Na = "<!-- USAGE_END -->", Pa = /* @__PURE__ */
7220
7304
  ["sync", "Bumps the version, then commits and pushes to GitHub."],
7221
7305
  ["release", "Bumps the version, commits and pushes, and creates a GitHub release."],
7222
7306
  ["publish", "Registers the released version with DPUse."]
7223
- ], Ia = /* @__PURE__ */ new Set(["development", "eslint"]), La = "> [!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", Ra = "Cloned or forked code is unsupported and isn't guaranteed to remain compatible with the DPUse Engine as it evolves.";
7224
- async function za() {
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() {
7225
7309
  try {
7226
7310
  G("Document Usage"), q("1️⃣ Insert usage content into 'README.md'");
7227
- let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = Ba(e), r = Va(n), i = Ha(e.engines?.node), a = Ha(e.engines?.npm), o = Ha(e.devDependencies?.typescript);
7228
- await Wn(Ka(Ua(Kn(t.id), e.name), n, r, i, a, o, Wa(e)), Ma, Na), K("Usage documented");
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");
7229
7313
  } catch (e) {
7230
7314
  console.error("❌ Error documenting usage", e), process.exit(1);
7231
7315
  }
7232
7316
  }
7233
- function Ba(e) {
7317
+ function Qa(e) {
7234
7318
  let t = e.repository, n = typeof t == "string" ? t : t?.url;
7235
7319
  if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
7236
7320
  return n.replace(/^git\+/, "");
7237
7321
  }
7238
- function Va(e) {
7322
+ function $a(e) {
7239
7323
  return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
7240
7324
  }
7241
- function Ha(e) {
7325
+ function eo(e) {
7242
7326
  if (e == null) throw Error("package.json version range is required to document usage.");
7243
7327
  let t = /\d+(?:\.\d+)*/.exec(e);
7244
7328
  if (t == null) throw Error(`Unable to parse version from '${e}'.`);
7245
7329
  return t[0];
7246
7330
  }
7247
- function Ua(e, t) {
7331
+ function to(e, t) {
7248
7332
  let { typeId: n } = e;
7249
- if (Pa.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.
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.
7250
7334
 
7251
- 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. ${Ra}`;
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}`;
7252
7336
  if (e.publishedTo === "npm") {
7253
7337
  if (t == null || t === "") throw Error("package.json 'name' field is required to document usage.");
7254
7338
  return `This package is published to the [public npm registry](https://www.npmjs.com/package/${t}). Install it with:
@@ -7257,18 +7341,18 @@ You may view or clone this repository for your own purposes, such as building a
7257
7341
  npm install ${t}
7258
7342
  \`\`\`
7259
7343
 
7260
- ${Ia.has(n) ? La : ""}To work on the source instead, clone this repository. ${Ra}`;
7344
+ ${Ja.has(n) ? Ya : ""}To work on the source instead, clone this repository. ${Xa}`;
7261
7345
  }
7262
- return `You may view or clone this repository for your own purposes. ${Ra}`;
7346
+ return `You may view or clone this repository for your own purposes. ${Xa}`;
7263
7347
  }
7264
- function Wa(e) {
7265
- 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 = Fa.filter(([e]) => i(e)).map(([e, t]) => `|\`${Ga(e)}\`|${t}|`);
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}|`);
7266
7350
  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")}`;
7267
7351
  }
7268
- function Ga(e) {
7352
+ function ro(e) {
7269
7353
  return e === "test" ? "npm test" : `npm run ${e}`;
7270
7354
  }
7271
- function Ka(e, t, n, r, i, a, o) {
7355
+ function io(e, t, n, r, i, a, o) {
7272
7356
  return `## Usage
7273
7357
 
7274
7358
  ${e}
@@ -7283,7 +7367,7 @@ _Requires [Node.js](https://nodejs.org/) ${r} or later, [npm](https://www.npmjs.
7283
7367
  }
7284
7368
  //#endregion
7285
7369
  //#region src/actions/formatCode.ts
7286
- async function qa() {
7370
+ async function ao() {
7287
7371
  try {
7288
7372
  G("Format Code"), await U("1️⃣ Format", "prettier", [
7289
7373
  "--write",
@@ -7302,7 +7386,7 @@ async function qa() {
7302
7386
  }
7303
7387
  //#endregion
7304
7388
  //#region src/actions/lintCode.ts
7305
- async function Ja() {
7389
+ async function oo() {
7306
7390
  try {
7307
7391
  G("Lint Code"), await U("1️⃣ Lint", "eslint", ["."]), K("Code linted");
7308
7392
  } catch (e) {
@@ -7311,7 +7395,7 @@ async function Ja() {
7311
7395
  }
7312
7396
  //#endregion
7313
7397
  //#region src/utilities/cloudflare.ts
7314
- async function Ya() {
7398
+ async function so() {
7315
7399
  let e = await W("config.json"), t = {
7316
7400
  body: JSON.stringify(e),
7317
7401
  headers: { "Content-Type": "application/json" },
@@ -7319,7 +7403,7 @@ async function Ya() {
7319
7403
  }, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
7320
7404
  if (!n.ok) throw Error(await n.text());
7321
7405
  }
7322
- async function Xa(e, t) {
7406
+ async function co(e, t) {
7323
7407
  async function n(e, t, r) {
7324
7408
  for (let i of r) {
7325
7409
  let r = `${e}/${i}`, a = `${t}/${i}`;
@@ -7337,7 +7421,7 @@ async function Xa(e, t) {
7337
7421
  let r = await Rn(`${e}/${t}/`);
7338
7422
  await n(`${e}/${t}`, t, r);
7339
7423
  }
7340
- async function Za(e) {
7424
+ async function lo(e) {
7341
7425
  let t = e.id, n = {
7342
7426
  body: JSON.stringify(e),
7343
7427
  headers: { "Content-Type": "application/json" },
@@ -7345,7 +7429,7 @@ async function Za(e) {
7345
7429
  }, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
7346
7430
  if (!r.ok) throw Error(await r.text());
7347
7431
  }
7348
- async function Qa(e, t) {
7432
+ async function uo(e, t) {
7349
7433
  let n = `v${e.version ?? "unknown"}`;
7350
7434
  async function r(e, r = "") {
7351
7435
  let i = await Rn(e, { withFileTypes: !0 });
@@ -7369,24 +7453,24 @@ async function Qa(e, t) {
7369
7453
  }
7370
7454
  //#endregion
7371
7455
  //#region node_modules/valibot/dist/index.mjs
7372
- var $a = {
7456
+ var fo = {
7373
7457
  lang: void 0,
7374
7458
  message: void 0,
7375
7459
  abortEarly: void 0,
7376
7460
  abortPipeEarly: void 0
7377
7461
  };
7378
7462
  /* @__NO_SIDE_EFFECTS__ */
7379
- function eo(e) {
7463
+ function po(e) {
7380
7464
  return e ? {
7381
7465
  lang: e?.lang ?? void 0,
7382
7466
  message: e?.message,
7383
7467
  abortEarly: e?.abortEarly ?? void 0,
7384
7468
  abortPipeEarly: e?.abortPipeEarly ?? void 0
7385
- } : $a;
7469
+ } : fo;
7386
7470
  }
7387
7471
  /* @__NO_SIDE_EFFECTS__ */
7388
- function to(e, t, n) {
7389
- let r = e["~run"]({ value: t }, /* @__PURE__ */ eo(n));
7472
+ function mo(e, t, n) {
7473
+ let r = e["~run"]({ value: t }, /* @__PURE__ */ po(n));
7390
7474
  return {
7391
7475
  typed: r.typed,
7392
7476
  success: !r.issues,
@@ -7396,21 +7480,21 @@ function to(e, t, n) {
7396
7480
  }
7397
7481
  //#endregion
7398
7482
  //#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModulePresenter.es.js
7399
- var no = Vi([
7483
+ var ho = Vi([
7400
7484
  "list",
7401
7485
  "render",
7402
7486
  "setColorMode"
7403
- ]), ro = /* @__PURE__ */ Q({
7487
+ ]), go = /* @__PURE__ */ Q({
7404
7488
  ...Yi,
7405
7489
  typeId: /* @__PURE__ */ Ni("presenter"),
7406
- actionNames: /* @__PURE__ */ ji(no),
7490
+ actionNames: /* @__PURE__ */ ji(ho),
7407
7491
  presentations: /* @__PURE__ */ ji(qi)
7408
- }), io = [
7492
+ }), _o = [
7409
7493
  "1️⃣ ",
7410
7494
  "2️⃣ ",
7411
7495
  "3️⃣ ",
7412
7496
  "4️⃣ "
7413
- ], ao = [{
7497
+ ], vo = [{
7414
7498
  id: "unit",
7415
7499
  label: "Run unit tests",
7416
7500
  command: "vitest",
@@ -7423,36 +7507,36 @@ var no = Vi([
7423
7507
  arguments: ["test", "--pass-with-no-tests"],
7424
7508
  configFileName: "playwright.config.ts"
7425
7509
  }];
7426
- async function oo() {
7510
+ async function yo() {
7427
7511
  try {
7428
7512
  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");
7429
7513
  } catch (e) {
7430
7514
  console.error("❌ Error building project", e), process.exit(1);
7431
7515
  }
7432
7516
  }
7433
- async function so() {
7517
+ async function bo() {
7434
7518
  try {
7435
7519
  G("Publish Project");
7436
7520
  let e = await W("package.json"), t = await W("config.json");
7437
- await _o("1️⃣ ", e, t, Kn(t.id)), K(`Project version '${e.version ?? "unknown"}' published.`);
7521
+ await ko("1️⃣ ", e, t, Kn(t.id)), K(`Project version '${e.version ?? "unknown"}' published.`);
7438
7522
  } catch (e) {
7439
7523
  console.error("❌ Error publishing project", e), process.exit(1);
7440
7524
  }
7441
7525
  }
7442
- async function co() {
7526
+ async function xo() {
7443
7527
  try {
7444
7528
  G("Release Project");
7445
7529
  let e = await W("package.json"), t = await W("config.json");
7446
- await go("1️⃣ ", e);
7530
+ await Oo("1️⃣ ", e);
7447
7531
  let n = Kn(t.id);
7448
7532
  switch (n.typeId) {
7449
7533
  case "connector":
7450
- t = await uo("2️⃣ ", e);
7534
+ t = await Co("2️⃣ ", e);
7451
7535
  break;
7452
7536
  case "presenter":
7453
- t = await fo("2️⃣ ", e);
7537
+ t = await wo("2️⃣ ", e);
7454
7538
  break;
7455
- default: t = await lo("2️⃣ ", e);
7539
+ default: t = await So("2️⃣ ", e);
7456
7540
  }
7457
7541
  await U("3️⃣ Bundle project", "vite", ["build"]), await zn("4️⃣ Stage changes", "git", ["add", "."]), await zn("5️⃣ Commit changes", "git", [
7458
7542
  "commit",
@@ -7462,7 +7546,7 @@ async function co() {
7462
7546
  "push",
7463
7547
  "origin",
7464
7548
  "main:main"
7465
- ]), await _o("7️⃣ ", e, t, n), n.publishedTo === "npm" ? await U("8️⃣ Create GitHub release", "gh", [
7549
+ ]), await ko("7️⃣ ", e, t, n), n.publishedTo === "npm" ? await U("8️⃣ Create GitHub release", "gh", [
7466
7550
  "release",
7467
7551
  "create",
7468
7552
  `v${e.version ?? "unknown"}`,
@@ -7475,39 +7559,39 @@ async function co() {
7475
7559
  console.error("❌ Error releasing project", e), process.exit(1);
7476
7560
  }
7477
7561
  }
7478
- async function lo(e, t) {
7562
+ async function So(e, t) {
7479
7563
  q(`${e} Build project configuration`);
7480
7564
  let n = await W("config.json");
7481
7565
  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;
7482
7566
  }
7483
- async function uo(e, t) {
7567
+ async function Co(e, t) {
7484
7568
  q(`${e} Build connector project configuration`);
7485
- let [n, r] = await Promise.all([W("config.json"), Vn("src/index.ts")]), i = /* @__PURE__ */ to(na, n);
7569
+ let [n, r] = await Promise.all([W("config.json"), Vn("src/index.ts")]), i = /* @__PURE__ */ mo(na, n);
7486
7570
  if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
7487
7571
  let a = Yn(r);
7488
- return await po(t, n, a, oa(a));
7572
+ return await To(t, n, a, oa(a));
7489
7573
  }
7490
- async function fo(e, t) {
7574
+ async function wo(e, t) {
7491
7575
  q(`${e} Build presenter project configuration`);
7492
- let [n, r] = await Promise.all([W("config.json"), Vn("src/index.ts")]), i = /* @__PURE__ */ to(ro, n);
7576
+ let [n, r] = await Promise.all([W("config.json"), Vn("src/index.ts")]), i = /* @__PURE__ */ mo(go, n);
7493
7577
  if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
7494
- return await po(t, n, Yn(r));
7578
+ return await To(t, n, Yn(r));
7495
7579
  }
7496
- async function po(e, t, n, r) {
7580
+ async function To(e, t, n, r) {
7497
7581
  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;
7498
7582
  }
7499
- async function mo() {
7583
+ async function Eo() {
7500
7584
  try {
7501
7585
  G("Synchronise Project with GitHub");
7502
7586
  let e = await W("package.json"), t = await W("config.json");
7503
- switch (await go("1️⃣ ", e), Kn(t.id).typeId) {
7587
+ switch (await Oo("1️⃣ ", e), Kn(t.id).typeId) {
7504
7588
  case "connector":
7505
- await uo("2️⃣ ", e);
7589
+ await Co("2️⃣ ", e);
7506
7590
  break;
7507
7591
  case "presenter":
7508
- await fo("2️⃣ ", e);
7592
+ await wo("2️⃣ ", e);
7509
7593
  break;
7510
- default: await lo("2️⃣ ", e);
7594
+ default: await So("2️⃣ ", e);
7511
7595
  }
7512
7596
  await zn("3️⃣ Stage changes", "git", ["add", "."]), await zn("4️⃣ Commit changes", "git", [
7513
7597
  "commit",
@@ -7522,14 +7606,14 @@ async function mo() {
7522
7606
  console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
7523
7607
  }
7524
7608
  }
7525
- async function ho(e = ["unit"], t = !1) {
7609
+ async function Do(e = ["unit"], t = !1) {
7526
7610
  try {
7527
7611
  G("Test Project");
7528
7612
  let n = 0;
7529
- for (let r of ao) {
7613
+ for (let r of vo) {
7530
7614
  if (!e.includes(r.id) || await Hn(r.configFileName) === null) continue;
7531
7615
  let i = t && r.id === "unit" ? ["--coverage"] : [];
7532
- await U(`${io[n] ?? ""} ${r.label}`, r.command, [...r.arguments, ...i]), n += 1;
7616
+ await U(`${_o[n] ?? ""} ${r.label}`, r.command, [...r.arguments, ...i]), n += 1;
7533
7617
  }
7534
7618
  if (n === 0) {
7535
7619
  console.warn("\n⚠️ No tests configured for this project.\n");
@@ -7540,7 +7624,7 @@ async function ho(e = ["unit"], t = !1) {
7540
7624
  console.error("❌ Error testing project", e), process.exit(1);
7541
7625
  }
7542
7626
  }
7543
- async function go(e, t, n = "./") {
7627
+ async function Oo(e, t, n = "./") {
7544
7628
  if (q(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
7545
7629
  else {
7546
7630
  let e = t.version, n = t.version.split(".");
@@ -7548,15 +7632,15 @@ async function go(e, t, n = "./") {
7548
7632
  }
7549
7633
  await Un(`${n}package.json`, t);
7550
7634
  }
7551
- async function _o(e, t, n, r) {
7552
- if (r.typeId === "app") q(`${e} Register module`), await Ya();
7553
- else if (r.typeId === "engine") q(`${e} Register module`), await Qa(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await Za(n);
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);
7554
7638
  else if (r.uploadGroupName === void 0) q(`${e} Registration NOT required`);
7555
7639
  else {
7556
7640
  q(`${e} Register module`);
7557
7641
  let i = n.id.split("-").slice(2).join("-");
7558
- await Qa(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await Za(n);
7642
+ await uo(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await lo(n);
7559
7643
  }
7560
7644
  }
7561
7645
  //#endregion
7562
- export { Qn as auditDependencies, oo as buildProject, tr as checkConfigFiles, lr as checkDependencies, _a as documentAPIReference, pa as documentActions, vr as documentBundleSizes, Br as documentDependencies, ci as documentGovernance, Oa as documentOpening, za as documentUsage, qa as formatCode, Ja as lintCode, so as publishProject, co as releaseProject, mo as syncProjectWithGitHub, ho as testProject, Xa as uploadDirectoryToR2 };
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 };