@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 |
|
|
128
|
-
| acorn → dist/acorn.mjs | `████████░░░░░░░░░░░░` 39.
|
|
129
|
-
| acorn-typescript → lib/index.mjs | `███████░░░░░░░░░░░░░` 34.
|
|
130
|
-
| src | `███░░░░░░░░░░░░░░░░░` 15.
|
|
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.
|
|
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 =
|
|
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
|
|
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 =
|
|
7112
|
-
a !== void 0 && r.get(a.kind)?.push(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7135
|
+
name: t,
|
|
7136
|
+
origin: Ta(e, n, r)
|
|
7128
7137
|
} : {
|
|
7138
|
+
detail: `: ${wa(e, n)}`,
|
|
7129
7139
|
kind: "Constants",
|
|
7130
|
-
|
|
7140
|
+
name: t,
|
|
7141
|
+
origin: ""
|
|
7131
7142
|
} : {
|
|
7143
|
+
detail: "",
|
|
7132
7144
|
kind: "Classes",
|
|
7133
|
-
|
|
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) :
|
|
7155
|
+
return o === void 0 ? e.typeToString(e.getBaseTypeOfLiteralType(e.getTypeOfSymbol(t)), n) : La(o);
|
|
7139
7156
|
}
|
|
7140
|
-
function
|
|
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 :
|
|
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 =
|
|
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
|
|
7166
|
+
function Ea(e, t, n, r) {
|
|
7150
7167
|
return t.properties.flatMap((t) => {
|
|
7151
|
-
let i = l.isSpreadAssignment(t) ?
|
|
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 ?
|
|
7171
|
+
return a === n ? Ea(e, i, n, r) : a === void 0 ? [] : [a];
|
|
7155
7172
|
});
|
|
7156
7173
|
}
|
|
7157
|
-
function
|
|
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
|
|
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
|
|
7171
|
-
let n =
|
|
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) ?
|
|
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
|
|
7186
|
-
let [t] =
|
|
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] =
|
|
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
|
|
7193
|
-
let 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 :
|
|
7214
|
+
return i === void 0 ? void 0 : Ma(e, i);
|
|
7198
7215
|
}
|
|
7199
|
-
function
|
|
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
|
|
7219
|
+
function Ma(e, t) {
|
|
7203
7220
|
if (l.isObjectLiteralExpression(t)) return t;
|
|
7204
|
-
let n =
|
|
7221
|
+
let n = Na(e, t);
|
|
7205
7222
|
return n !== void 0 && l.isObjectLiteralExpression(n) ? n : void 0;
|
|
7206
7223
|
}
|
|
7207
|
-
function
|
|
7208
|
-
let n = e.getSymbolAtLocation(t), r = n === void 0 ? void 0 :
|
|
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
|
|
7228
|
+
function Pa(e, t) {
|
|
7212
7229
|
return (t.flags & l.SymbolFlags.Alias) === 0 ? t : e.getAliasedSymbol(t);
|
|
7213
7230
|
}
|
|
7214
|
-
function
|
|
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
|
|
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) :
|
|
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
|
|
7240
|
+
function La(e) {
|
|
7224
7241
|
return e.getText().replaceAll(/\s+/g, " ");
|
|
7225
7242
|
}
|
|
7226
|
-
function
|
|
7243
|
+
function Ra(e, t) {
|
|
7227
7244
|
let n = ha.flatMap((e) => {
|
|
7228
|
-
let n = t.get(e) ?? [], r = n.map((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
|
|
7236
|
-
async function
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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)
|
|
7258
7282
|
[](${a}/releases/latest)
|
|
@@ -7280,12 +7304,12 @@ ${r}`;
|
|
|
7280
7304
|
}
|
|
7281
7305
|
//#endregion
|
|
7282
7306
|
//#region src/actions/documentUsage.ts
|
|
7283
|
-
var
|
|
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
|
-
]),
|
|
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
|
-
],
|
|
7308
|
-
async function
|
|
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 =
|
|
7312
|
-
await Wn(io(
|
|
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
|
|
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
|
|
7346
|
+
function no(e) {
|
|
7323
7347
|
return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
|
|
7324
7348
|
}
|
|
7325
|
-
function
|
|
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
|
|
7355
|
+
function io(e, t) {
|
|
7332
7356
|
let { typeId: n } = e;
|
|
7333
|
-
if (
|
|
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. ${
|
|
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
|
-
${
|
|
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. ${
|
|
7370
|
+
return `You may view or clone this repository for your own purposes. ${$a}`;
|
|
7347
7371
|
}
|
|
7348
|
-
function
|
|
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 =
|
|
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
|
|
7376
|
+
function oo(e) {
|
|
7353
7377
|
return e === "test" ? "npm test" : `npm run ${e}`;
|
|
7354
7378
|
}
|
|
7355
|
-
function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
} :
|
|
7493
|
+
} : ho;
|
|
7470
7494
|
}
|
|
7471
7495
|
/* @__NO_SIDE_EFFECTS__ */
|
|
7472
|
-
function
|
|
7473
|
-
let r = e["~run"]({ value: t }, /* @__PURE__ */
|
|
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
|
|
7507
|
+
var vo = Vi([
|
|
7484
7508
|
"list",
|
|
7485
7509
|
"render",
|
|
7486
7510
|
"setColorMode"
|
|
7487
|
-
]),
|
|
7511
|
+
]), yo = /* @__PURE__ */ Q({
|
|
7488
7512
|
...Yi,
|
|
7489
7513
|
typeId: /* @__PURE__ */ Ni("presenter"),
|
|
7490
|
-
actionNames: /* @__PURE__ */ ji(
|
|
7514
|
+
actionNames: /* @__PURE__ */ ji(vo),
|
|
7491
7515
|
presentations: /* @__PURE__ */ ji(qi)
|
|
7492
|
-
}),
|
|
7516
|
+
}), bo = [
|
|
7493
7517
|
"1️⃣ ",
|
|
7494
7518
|
"2️⃣ ",
|
|
7495
7519
|
"3️⃣ ",
|
|
7496
7520
|
"4️⃣ "
|
|
7497
|
-
],
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
7554
|
+
await jo("1️⃣ ", e);
|
|
7531
7555
|
let n = Kn(t.id);
|
|
7532
7556
|
switch (n.typeId) {
|
|
7533
7557
|
case "connector":
|
|
7534
|
-
t = await
|
|
7558
|
+
t = await Eo("2️⃣ ", e);
|
|
7535
7559
|
break;
|
|
7536
7560
|
case "presenter":
|
|
7537
|
-
t = await
|
|
7561
|
+
t = await Do("2️⃣ ", e);
|
|
7538
7562
|
break;
|
|
7539
|
-
default: t = await
|
|
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
|
|
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
|
|
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
|
|
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__ */
|
|
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
|
|
7596
|
+
return await Oo(t, n, a, oa(a));
|
|
7573
7597
|
}
|
|
7574
|
-
async function
|
|
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__ */
|
|
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
|
|
7602
|
+
return await Oo(t, n, Yn(r));
|
|
7579
7603
|
}
|
|
7580
|
-
async function
|
|
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
|
|
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
|
|
7611
|
+
switch (await jo("1️⃣ ", e), Kn(t.id).typeId) {
|
|
7588
7612
|
case "connector":
|
|
7589
|
-
await
|
|
7613
|
+
await Eo("2️⃣ ", e);
|
|
7590
7614
|
break;
|
|
7591
7615
|
case "presenter":
|
|
7592
|
-
await
|
|
7616
|
+
await Do("2️⃣ ", e);
|
|
7593
7617
|
break;
|
|
7594
|
-
default: await
|
|
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
|
|
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
|
|
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(`${
|
|
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
|
|
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
|
|
7636
|
-
if (r.typeId === "app") q(`${e} Register module`), await
|
|
7637
|
-
else if (r.typeId === "engine") q(`${e} Register module`), await
|
|
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
|
|
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,
|
|
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 };
|