@dpuse/dpuse-development 1.0.111 → 1.0.113
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 +12 -12
- package/dist/dpuse-development.es.js +291 -300
- package/dist/dpuse-development.es.js.map +1 -1
- package/package.json +3 -3
- package/vite.config.default.ts +1 -1
- package/vite.config.presenter.ts +1 -1
- package/vite.config.tool.ts +1 -1
|
@@ -9,17 +9,9 @@ import { run as fe } from "npm-check-updates";
|
|
|
9
9
|
import { init as pe } from "license-checker-rseidelsohn";
|
|
10
10
|
import { setTimeout as me } from "node:timers/promises";
|
|
11
11
|
import he from "spdx-satisfies";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
get: ((e) => t[e]).bind(null, s),
|
|
16
|
-
enumerable: !(r = ve(t, s)) || r.enumerable
|
|
17
|
-
});
|
|
18
|
-
return e;
|
|
19
|
-
}, we = (e, t, n) => (n = e == null ? {} : ge(be(e)), Ce(t || !e || !e.__esModule || !xe.call(e, "default") ? _e(n, "default", {
|
|
20
|
-
value: e,
|
|
21
|
-
enumerable: !0
|
|
22
|
-
}) : n, e)), Te = [
|
|
12
|
+
import ge from "node:os";
|
|
13
|
+
//#region src/actions/auditDependencies_.json
|
|
14
|
+
var _e = [
|
|
23
15
|
{
|
|
24
16
|
id: "GHSA-ch52-4w7c-c8xp",
|
|
25
17
|
reason: "'http-cache-semantics', used by the licence checker, which only reads the npm registry locally, with no shared cache to leak from",
|
|
@@ -35,80 +27,80 @@ var ge = Object.create, _e = Object.defineProperty, ve = Object.getOwnPropertyDe
|
|
|
35
27
|
reason: "'braces', used by ESLint's file matching in dpuse-app, which only reads glob patterns from the project's own config",
|
|
36
28
|
reviewBy: "2026-12-31"
|
|
37
29
|
}
|
|
38
|
-
],
|
|
39
|
-
async function
|
|
30
|
+
], ve = /* @__PURE__ */ new Set(["critical", "high"]);
|
|
31
|
+
async function ye() {
|
|
40
32
|
try {
|
|
41
33
|
s("Audit Dependencies");
|
|
42
34
|
let e = await S("package.json");
|
|
43
35
|
re.has(e.name ?? "") ? C(`1️⃣ Shipped dependencies NOT checked: ${e.name ?? ""} is a development-only tool`) : await o("1️⃣ Check shipped dependencies for any vulnerability", "npm", ["audit", "--omit=dev"]);
|
|
44
36
|
let t = await n("2️⃣ Check all dependencies for high or critical vulnerabilities", "npm", ["audit", "--json"]), r = JSON.parse(t);
|
|
45
37
|
if (r.error !== void 0) throw Error(r.error.summary);
|
|
46
|
-
let i =
|
|
38
|
+
let i = xe(Ce(r));
|
|
47
39
|
if (i.length > 0) throw Error(`${String(i.length)} high or critical vulnerabilities found`);
|
|
48
40
|
b("Dependencies audited");
|
|
49
41
|
} catch (e) {
|
|
50
42
|
console.error("❌ Error auditing dependencies", e), process.exit(1);
|
|
51
43
|
}
|
|
52
44
|
}
|
|
53
|
-
async function
|
|
45
|
+
async function be(e) {
|
|
54
46
|
let t = JSON.parse(await n(e, "npm", ["audit", "--json"]));
|
|
55
47
|
if (t.error !== void 0) {
|
|
56
48
|
console.warn(`⚠️ Could not check the allow list: ${t.error.summary}`);
|
|
57
49
|
return;
|
|
58
50
|
}
|
|
59
51
|
let r = 0;
|
|
60
|
-
for (let e of
|
|
61
|
-
let t =
|
|
52
|
+
for (let e of Ce(t)) {
|
|
53
|
+
let t = ve.has(e.severity) ? Se(e) : void 0;
|
|
62
54
|
t !== void 0 && (console.warn(`⚠️ ${t.id} ('${e.name}') is on the allow list, so the CI audit ignores it: ${t.reason}`), r++);
|
|
63
55
|
}
|
|
64
56
|
r === 0 && console.info("ℹ️ None of the reported advisories are on the allow list");
|
|
65
57
|
}
|
|
66
|
-
function
|
|
58
|
+
function xe(e) {
|
|
67
59
|
let t = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), n = [];
|
|
68
60
|
for (let r of e) {
|
|
69
|
-
if (!
|
|
70
|
-
let e =
|
|
61
|
+
if (!ve.has(r.severity)) continue;
|
|
62
|
+
let e = Se(r);
|
|
71
63
|
e === void 0 ? (console.error(`❌ ${r.severity} '${r.name}': ${r.title} (${r.url})`), n.push(r)) : e.reviewBy < t ? console.warn(`⚠️ Ignored ${e.id}, but its review date ${e.reviewBy} has passed: ${e.reason}`) : console.info(`ℹ️ Ignored ${e.id}: ${e.reason}`);
|
|
72
64
|
}
|
|
73
65
|
return n;
|
|
74
66
|
}
|
|
75
|
-
function
|
|
67
|
+
function Se(e) {
|
|
76
68
|
let t = e.url.slice(e.url.lastIndexOf("/") + 1);
|
|
77
|
-
return
|
|
69
|
+
return _e.find((e) => e.id === t);
|
|
78
70
|
}
|
|
79
|
-
function
|
|
71
|
+
function Ce(e) {
|
|
80
72
|
let t = /* @__PURE__ */ new Map(), n = Object.values(e.vulnerabilities ?? {});
|
|
81
73
|
for (let e of n) for (let n of e.via) typeof n != "string" && t.set(n.url, n);
|
|
82
74
|
return t.values().toArray();
|
|
83
75
|
}
|
|
84
76
|
//#endregion
|
|
85
77
|
//#region src/actions/buildProject.ts
|
|
86
|
-
var
|
|
87
|
-
async function
|
|
78
|
+
var we = "build:wasm";
|
|
79
|
+
async function Te() {
|
|
88
80
|
try {
|
|
89
|
-
s("Build Project"), await
|
|
81
|
+
s("Build Project"), await Ee("1️⃣ ", await S("package.json")), b("Project built");
|
|
90
82
|
} catch (e) {
|
|
91
83
|
console.error("❌ Error building project", e), process.exit(1);
|
|
92
84
|
}
|
|
93
85
|
}
|
|
94
|
-
async function
|
|
95
|
-
t.scripts?.[
|
|
86
|
+
async function Ee(e, t) {
|
|
87
|
+
t.scripts?.[we] != null && await o(`${e} Build WebAssembly`, "npm", ["run", we]), await o(`${e} Bundle project`, "vite", ["build"]);
|
|
96
88
|
}
|
|
97
89
|
//#endregion
|
|
98
90
|
//#region src/actions/checkConfigFiles.ts
|
|
99
|
-
var E = "@dpuse/dpuse-development/prettierrc",
|
|
100
|
-
async function
|
|
91
|
+
var E = "@dpuse/dpuse-development/prettierrc", De = "dpuse-development";
|
|
92
|
+
async function Oe() {
|
|
101
93
|
try {
|
|
102
94
|
s("Check configuration files"), C("1️⃣ Check individual files");
|
|
103
95
|
let t = await S("config.json"), n = await S("package.json"), r = n.private === !0, i = m(t.id), a = T.dirname(de(import.meta.url));
|
|
104
|
-
await D(a, ".editorconfig"), await D(a, ".gitattributes"), await D(a, ".gitignore", [".gitignore_default"]), await D(a, ".markdownlint.json"), await D(a, ".ncurc.json"), await
|
|
96
|
+
await D(a, ".editorconfig"), await D(a, ".gitattributes"), await D(a, ".gitignore", [".gitignore_default"]), await D(a, ".markdownlint.json"), await D(a, ".ncurc.json"), await ke(i, a), await D(a, "LICENSE"), await je(i, a), await Me(i, a), await Ne(i, a), await Ie(i, a), Ae(i, n);
|
|
105
97
|
let o = await e(v) !== null;
|
|
106
|
-
o && await D(a, "rust-toolchain.toml"), await D(a, ".github/dependabot.yml", [`.github/dependabot${r ? ".private" : ""}${o ? ".rust" : ""}.yml`]), r ? await
|
|
98
|
+
o && await D(a, "rust-toolchain.toml"), await D(a, ".github/dependabot.yml", [`.github/dependabot${r ? ".private" : ""}${o ? ".rust" : ""}.yml`]), r ? await Pe(a) : (await Fe(a), await D(a, "SECURITY.md", [], (e) => e.replaceAll(De, () => t.id))), b("Configuration files checked");
|
|
107
99
|
} catch (e) {
|
|
108
100
|
console.error("❌ Error checking configuration files", e), process.exit(1);
|
|
109
101
|
}
|
|
110
102
|
}
|
|
111
|
-
async function
|
|
103
|
+
async function ke(e, t) {
|
|
112
104
|
["github"].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is NOT required by this project") : [
|
|
113
105
|
"app",
|
|
114
106
|
"api",
|
|
@@ -117,10 +109,10 @@ async function Le(e, t) {
|
|
|
117
109
|
"kb"
|
|
118
110
|
].includes(e.typeId) ? console.info("⚠️ File 'eslint.config.js' is UNIQUE to this project") : await D(t, "eslint.config.js", ["eslint.config.default.js"]);
|
|
119
111
|
}
|
|
120
|
-
function
|
|
112
|
+
function Ae(e, t) {
|
|
121
113
|
e.typeId === "development" ? console.info("ℹ️ File '.prettierrc.json' is the template") : e.typeId === "app" ? console.info("⚠️ File '.prettierrc.json' is UNIQUE to this project") : t.prettier === E ? console.info(`ℹ️ Prettier configuration is '${E}'`) : console.info(`❌ Prettier configuration is NOT '${E}'`);
|
|
122
114
|
}
|
|
123
|
-
async function
|
|
115
|
+
async function je(e, t) {
|
|
124
116
|
["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.json' is NOT required by this project") : [
|
|
125
117
|
"connector",
|
|
126
118
|
"cookbook",
|
|
@@ -131,14 +123,15 @@ async function ze(e, t) {
|
|
|
131
123
|
"tool"
|
|
132
124
|
].includes(e.typeId) ? await D(t, "tsconfig.json") : console.info("⚠️ File 'tsconfig.json' is UNIQUE to this project");
|
|
133
125
|
}
|
|
134
|
-
async function
|
|
126
|
+
async function Me(e, t) {
|
|
135
127
|
["github"].includes(e.typeId) ? console.info("ℹ️ File 'scripts/tsconfig.json' is NOT required by this project") : await D(t, "scripts/tsconfig.json");
|
|
136
128
|
}
|
|
137
|
-
async function
|
|
129
|
+
async function Ne(e, t) {
|
|
138
130
|
if ([
|
|
139
131
|
"eslint",
|
|
140
132
|
"github",
|
|
141
|
-
"kb"
|
|
133
|
+
"kb",
|
|
134
|
+
"resources"
|
|
142
135
|
].includes(e.typeId)) console.info("ℹ️ File 'vite.config.ts' is NOT required by this project");
|
|
143
136
|
else if ([
|
|
144
137
|
"app",
|
|
@@ -160,14 +153,14 @@ async function Ve(e, t) {
|
|
|
160
153
|
await D(t, "vite.config.ts", n);
|
|
161
154
|
}
|
|
162
155
|
}
|
|
163
|
-
async function
|
|
156
|
+
async function Pe(t) {
|
|
164
157
|
for (let n of [".github/workflows/ci.yml", ".github/workflows/publish.yml"]) await e(n) !== null && await D(t, n);
|
|
165
158
|
console.info("ℹ️ CodeQL and Scorecard workflows and file 'SECURITY.md' are NOT required by this project");
|
|
166
159
|
}
|
|
167
|
-
async function
|
|
160
|
+
async function Fe(e) {
|
|
168
161
|
await D(e, ".github/workflows/ci.yml"), await D(e, ".github/workflows/codeql.yml"), await D(e, ".github/workflows/publish.yml"), await D(e, ".github/workflows/scorecard.yml");
|
|
169
162
|
}
|
|
170
|
-
async function
|
|
163
|
+
async function Ie(e, t) {
|
|
171
164
|
[
|
|
172
165
|
"app",
|
|
173
166
|
"api",
|
|
@@ -197,7 +190,7 @@ async function D(e, t, n = [], r = (e) => e) {
|
|
|
197
190
|
}
|
|
198
191
|
//#endregion
|
|
199
192
|
//#region src/actions/checkDependencies.ts
|
|
200
|
-
async function
|
|
193
|
+
async function Le() {
|
|
201
194
|
try {
|
|
202
195
|
s("Check Dependencies"), await o("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), C("2️⃣ Check using 'npm-check-updates'");
|
|
203
196
|
let e = {};
|
|
@@ -223,8 +216,8 @@ async function Ge() {
|
|
|
223
216
|
"fix",
|
|
224
217
|
"--no-strict-allow-scripts",
|
|
225
218
|
"--no-fund"
|
|
226
|
-
], !0), await
|
|
227
|
-
let t = await
|
|
219
|
+
], !0), await be("4️⃣ Name the advisories above that the CI audit ignores");
|
|
220
|
+
let t = await Re();
|
|
228
221
|
t.length > 0 ? await o("5️⃣ Move install-script pins to installed versions", "npm", [
|
|
229
222
|
"install-scripts",
|
|
230
223
|
"approve",
|
|
@@ -243,56 +236,56 @@ async function Ge() {
|
|
|
243
236
|
console.error("❌ Error checking dependencies", e), process.exit(1);
|
|
244
237
|
}
|
|
245
238
|
}
|
|
246
|
-
async function
|
|
239
|
+
async function Re() {
|
|
247
240
|
let { allowScripts: e = {} } = await S(T.resolve(process.cwd(), "package.json")), t = Object.entries(e).filter(([e, t]) => t && e.lastIndexOf("@") > 0).map(([e]) => e.slice(0, e.lastIndexOf("@")));
|
|
248
241
|
return [...new Set(t)];
|
|
249
242
|
}
|
|
250
243
|
//#endregion
|
|
251
244
|
//#region src/actions/checkProject.ts
|
|
252
|
-
async function
|
|
253
|
-
await
|
|
245
|
+
async function ze() {
|
|
246
|
+
await Oe(), await Le();
|
|
254
247
|
}
|
|
255
248
|
//#endregion
|
|
256
249
|
//#region src/actions/documentActions.ts
|
|
257
|
-
var
|
|
250
|
+
var Be = "<!-- SUPPORTED_ACTIONS_START -->", Ve = "<!-- SUPPORTED_ACTIONS_END -->", He = "Connectors conform to a unified interface contract by implementing a specific subset of standard actions. These standardised actions allow the DPUse application to interact with any underlying data source in the same way, enabling Connectors to be built independently and loaded dynamically at runtime.", Ue = {
|
|
258
251
|
source: "This connector is a Source connector that supports only read actions. Connectors can also function as a Destination (write-only) or Bidirectional (read/write), depending on the actions they support.",
|
|
259
252
|
destination: "This connector is a Destination connector that supports only write actions. Connectors can also function as a Source (read-only) or Bidirectional (read/write), depending on the actions they support.",
|
|
260
253
|
bidirectional: "This connector is a Bidirectional connector that supports both read and write actions. Connectors can also function as a Source (read-only) or Destination (write-only), depending on the actions they support.",
|
|
261
254
|
unknown: "This connector does not yet implement any read or write actions, so its type cannot be determined. Connectors function as a Source (read-only), a Destination (write-only), or Bidirectional (read/write), depending on the actions they support."
|
|
262
|
-
},
|
|
263
|
-
async function
|
|
255
|
+
}, We = "The table below lists all connector actions and highlights those supported by this connector.";
|
|
256
|
+
async function Ge() {
|
|
264
257
|
try {
|
|
265
258
|
s("Document Actions"), C("1️⃣ Insert actions description and table into 'README.md'");
|
|
266
|
-
let e = (await S("config.json")).actionNames ?? [], t = r(e), n = g(e), i = `## Supported Actions\n\n${
|
|
267
|
-
await _(i,
|
|
259
|
+
let e = (await S("config.json")).actionNames ?? [], t = r(e), n = g(e), i = `## Supported Actions\n\n${He}\n\n${Ue[t]} ${We}\n\n${n}`;
|
|
260
|
+
await _(i, Be, Ve), b("Actions documented");
|
|
268
261
|
} catch (e) {
|
|
269
262
|
console.error("❌ Error documenting actions", e), process.exit(1);
|
|
270
263
|
}
|
|
271
264
|
}
|
|
272
265
|
//#endregion
|
|
273
266
|
//#region src/actions/documentContributingLicense.ts
|
|
274
|
-
async function
|
|
267
|
+
async function Ke() {
|
|
275
268
|
try {
|
|
276
269
|
s("Document Contributing & License");
|
|
277
|
-
let [e, t] = await Promise.all([S("package.json"), S("config.json")]), { owner: n, repository: r } = x(e, "document contributing and license"), i =
|
|
278
|
-
C("1️⃣ Insert contributing and license content into 'README.md'"), await l(), await _(
|
|
270
|
+
let [e, t] = await Promise.all([S("package.json"), S("config.json")]), { owner: n, repository: r } = x(e, "document contributing and license"), i = qe(e), a = Je(t.firstCreatedAt);
|
|
271
|
+
C("1️⃣ Insert contributing and license content into 'README.md'"), await l(), await _(Ye(n, r, i, a), te, ae), b("Contributing & license documented");
|
|
279
272
|
} catch (e) {
|
|
280
273
|
console.error("❌ Error documenting contributing and license", e), process.exit(1);
|
|
281
274
|
}
|
|
282
275
|
}
|
|
283
|
-
function
|
|
276
|
+
function qe(e) {
|
|
284
277
|
let t = e.author, n = typeof t == "string" ? t : t?.name;
|
|
285
278
|
if (n == null || n === "") throw Error("package.json 'author' field is required to document contributing and license.");
|
|
286
279
|
let r = n.indexOf("<"), i = r === -1 ? -1 : n.indexOf(">", r);
|
|
287
280
|
return i === -1 ? n.trim() : [n.slice(0, r).trim(), n.slice(i + 1).trim()].filter((e) => e !== "").join(" ");
|
|
288
281
|
}
|
|
289
|
-
function
|
|
282
|
+
function Je(e) {
|
|
290
283
|
let t = (/* @__PURE__ */ new Date()).getFullYear();
|
|
291
284
|
if (e == null) return String(t);
|
|
292
285
|
let n = new Date(e).getFullYear();
|
|
293
286
|
return n === t ? String(t) : `${String(n)}-present`;
|
|
294
287
|
}
|
|
295
|
-
function
|
|
288
|
+
function Ye(e, t, n, r) {
|
|
296
289
|
return `## Contributing
|
|
297
290
|
|
|
298
291
|
This repository is maintained solely by its owner and does not, at present, accept external contributions into the canonical repo. Its source is published openly under the MIT License — every DPUse project is fully open source except DPUse Engine, which remains closed and proprietary.
|
|
@@ -307,8 +300,8 @@ This project is licensed under the MIT License, permitting free use, modificatio
|
|
|
307
300
|
}
|
|
308
301
|
//#endregion
|
|
309
302
|
//#region src/utilities/rustCrates.ts
|
|
310
|
-
var O = "licenses/cargoMetadata.json", k = "licenses/cargoTree.txt",
|
|
311
|
-
async function
|
|
303
|
+
var O = "licenses/cargoMetadata.json", k = "licenses/cargoTree.txt", Xe = 1e3, Ze = 1e4, Qe = "dpuse-development (https://github.com/dpuse/dpuse-development)", $e = /^(?:copying|licen[cs]e|unlicense)/i, et = "wasm32-unknown-unknown";
|
|
304
|
+
async function tt(n, r) {
|
|
312
305
|
if (await e("rust/Cargo.toml") === null) return null;
|
|
313
306
|
let i = [
|
|
314
307
|
"--manifest-path",
|
|
@@ -321,7 +314,7 @@ async function lt(n, r) {
|
|
|
321
314
|
"--edges",
|
|
322
315
|
"normal,no-proc-macro",
|
|
323
316
|
"--target",
|
|
324
|
-
|
|
317
|
+
et,
|
|
325
318
|
"--prefix",
|
|
326
319
|
"depth",
|
|
327
320
|
"--format",
|
|
@@ -333,9 +326,9 @@ async function lt(n, r) {
|
|
|
333
326
|
"--format-version",
|
|
334
327
|
"1",
|
|
335
328
|
"--filter-platform",
|
|
336
|
-
|
|
329
|
+
et
|
|
337
330
|
], O);
|
|
338
|
-
let s =
|
|
331
|
+
let s = nt(await a(k)), c = await S(O);
|
|
339
332
|
await w.rm(k, { force: !0 }), await w.rm(O, { force: !0 });
|
|
340
333
|
let l = /* @__PURE__ */ new Map();
|
|
341
334
|
for (let e of s) e.isOwn || l.has(`${e.name}@${e.version}`) || l.set(`${e.name}@${e.version}`, {
|
|
@@ -349,9 +342,9 @@ async function lt(n, r) {
|
|
|
349
342
|
latestPublishedDate: ""
|
|
350
343
|
});
|
|
351
344
|
let u = l.values().toArray();
|
|
352
|
-
|
|
353
|
-
for (let e of u) e.licenseFiles = await
|
|
354
|
-
return await
|
|
345
|
+
rt(u, r);
|
|
346
|
+
for (let e of u) e.licenseFiles = await ot(e, c);
|
|
347
|
+
return await st(n, u), {
|
|
355
348
|
crates: u,
|
|
356
349
|
treeItems: s.map(({ name: e, version: t, depth: n, isOwn: r }) => ({
|
|
357
350
|
name: e,
|
|
@@ -361,7 +354,7 @@ async function lt(n, r) {
|
|
|
361
354
|
}))
|
|
362
355
|
};
|
|
363
356
|
}
|
|
364
|
-
function
|
|
357
|
+
function nt(e) {
|
|
365
358
|
let t = [];
|
|
366
359
|
for (let n of e.split("\n")) {
|
|
367
360
|
let [e = "", r = "", i = ""] = n.trim().split("|", 3), a = /^\d+/.exec(e)?.[0];
|
|
@@ -378,30 +371,30 @@ function ut(e) {
|
|
|
378
371
|
}
|
|
379
372
|
return t;
|
|
380
373
|
}
|
|
381
|
-
function
|
|
382
|
-
let n = t.split(";").filter((e) =>
|
|
374
|
+
function rt(e, t) {
|
|
375
|
+
let n = t.split(";").filter((e) => it(e)), r = e.filter((e) => !at(e.licenseExpression, n));
|
|
383
376
|
if (r.length === 0) return;
|
|
384
377
|
let i = r.map((e) => `${e.name}@${e.version} (${e.licenseExpression === "" ? "no licence" : e.licenseExpression})`).join(", ");
|
|
385
378
|
throw Error(`Rust crates with licences not allowed: ${i}.`);
|
|
386
379
|
}
|
|
387
|
-
function
|
|
380
|
+
function it(e) {
|
|
388
381
|
try {
|
|
389
382
|
return he(e, [e]);
|
|
390
383
|
} catch {
|
|
391
384
|
return !1;
|
|
392
385
|
}
|
|
393
386
|
}
|
|
394
|
-
function
|
|
387
|
+
function at(e, t) {
|
|
395
388
|
try {
|
|
396
389
|
return he(e.replaceAll("/", " OR "), t);
|
|
397
390
|
} catch {
|
|
398
391
|
return !1;
|
|
399
392
|
}
|
|
400
393
|
}
|
|
401
|
-
async function
|
|
394
|
+
async function ot(e, t) {
|
|
402
395
|
let n = t.packages.find((t) => t.name === e.name && t.version === e.version);
|
|
403
396
|
if (n == null) return [];
|
|
404
|
-
let r = T.dirname(n.manifest_path), i = (await w.readdir(r)).filter((e) =>
|
|
397
|
+
let r = T.dirname(n.manifest_path), i = (await w.readdir(r)).filter((e) => $e.test(e)).toSorted((e, t) => e.localeCompare(t, "en"));
|
|
405
398
|
await w.mkdir("licenses/downloads", { recursive: !0 });
|
|
406
399
|
let a = [];
|
|
407
400
|
for (let t of i) {
|
|
@@ -413,14 +406,14 @@ async function mt(e, t) {
|
|
|
413
406
|
}
|
|
414
407
|
return a;
|
|
415
408
|
}
|
|
416
|
-
async function
|
|
409
|
+
async function st(e, t) {
|
|
417
410
|
C(`${e} - fetch release dates from crates.io`);
|
|
418
411
|
for (let [e, n] of t.entries()) {
|
|
419
|
-
e > 0 && await me(
|
|
412
|
+
e > 0 && await me(Xe), console.info(`⚙️ Fetching '${n.name}' (${String(e + 1)} of ${String(t.length)})...`);
|
|
420
413
|
try {
|
|
421
414
|
let e = await fetch(`https://crates.io/api/v1/crates/${encodeURIComponent(n.name)}`, {
|
|
422
|
-
headers: { "User-Agent":
|
|
423
|
-
signal: AbortSignal.timeout(
|
|
415
|
+
headers: { "User-Agent": Qe },
|
|
416
|
+
signal: AbortSignal.timeout(Ze)
|
|
424
417
|
});
|
|
425
418
|
if (!e.ok) continue;
|
|
426
419
|
let t = await e.json(), r = new Map((t.versions ?? []).map((e) => [e.num, e.created_at]));
|
|
@@ -430,77 +423,77 @@ async function ht(e, t) {
|
|
|
430
423
|
}
|
|
431
424
|
//#endregion
|
|
432
425
|
//#region src/actions/documentDependencies.ts
|
|
433
|
-
var A = "<!-- DEPENDENCY_LICENSES_START -->", j = "<!-- DEPENDENCY_LICENSES_END -->", M = "## Dependency Licenses",
|
|
434
|
-
async function
|
|
426
|
+
var A = "<!-- DEPENDENCY_LICENSES_START -->", j = "<!-- DEPENDENCY_LICENSES_END -->", M = "## Dependency Licenses", ct = `bundle-analysis-reports/${se}`, N = "licenses/licenseTree.json", lt = "Packages flagged ❗ have a newer version available; ⚠️ indicates a package that hasn't been updated in the last 6 months or longer. Neither flag necessarily indicates a problem: we let new releases stabilise before upgrading, and some packages are mature and stable (have limited or no dependencies), so they require no active development.", ut = `The dependency tree below lists every package in this project — direct and transitive — along with its installed version, release date, and update status. ${lt}`, dt = `The dependency tree below shows how each package in the table above is reached — direct and transitive — along with its installed version, release date, and update status. A package that does not ship itself, such as one whose parts are bundled separately, is left out and what ships beneath it is shown in its place. ${lt}`;
|
|
427
|
+
async function ft(e = "MIT") {
|
|
435
428
|
try {
|
|
436
429
|
s("Document Dependencies");
|
|
437
430
|
let n = await S("package.json"), r = n.name ?? "";
|
|
438
431
|
if (re.has(r)) {
|
|
439
|
-
await
|
|
432
|
+
await pt(r), b("Dependencies documented");
|
|
440
433
|
return;
|
|
441
434
|
}
|
|
442
435
|
await f("1️⃣ Clear downloaded licenses", "licenses/downloads");
|
|
443
|
-
let i = await
|
|
436
|
+
let i = await St(), a = await Ct();
|
|
444
437
|
if (a === null) {
|
|
445
|
-
let r =
|
|
446
|
-
await
|
|
438
|
+
let r = Dt(i);
|
|
439
|
+
await xt("2️⃣ Identify production licenses", e, [n.name ?? "", ...r], !0), await t("3️⃣ Identify transitive dependencies", "npm", [
|
|
447
440
|
"ls",
|
|
448
441
|
"--all",
|
|
449
442
|
"--json",
|
|
450
443
|
"--omit=dev"
|
|
451
|
-
], N), await
|
|
444
|
+
], N), await mt("4️⃣ ", e, new Set(r));
|
|
452
445
|
} else {
|
|
453
|
-
let r =
|
|
454
|
-
await
|
|
446
|
+
let r = wt(a, i), o = Tt(i), s = o.filter((e) => !r.has(e));
|
|
447
|
+
await xt("2️⃣ Identify shipped licenses", e, [n.name ?? "", ...s], !1), Et(r, new Set(o)), await t("3️⃣ Identify transitive dependencies", "npm", [
|
|
455
448
|
"ls",
|
|
456
449
|
"--all",
|
|
457
450
|
"--json"
|
|
458
451
|
], N, !0);
|
|
459
|
-
let c = await
|
|
452
|
+
let c = await tt("4️⃣ Identify Rust crates compiled into the WebAssembly", e), l = {
|
|
460
453
|
allowedLicenses: e,
|
|
461
|
-
productionNames:
|
|
454
|
+
productionNames: yt(n),
|
|
462
455
|
rustCrates: c,
|
|
463
456
|
shippedKeys: r
|
|
464
457
|
};
|
|
465
|
-
await
|
|
458
|
+
await ht(c === null ? "4️⃣ " : "5️⃣ ", l);
|
|
466
459
|
}
|
|
467
460
|
b("Dependencies documented");
|
|
468
461
|
} catch (e) {
|
|
469
462
|
console.error("❌ Error documenting dependencies", e), process.exit(1);
|
|
470
463
|
}
|
|
471
464
|
}
|
|
472
|
-
async function
|
|
465
|
+
async function pt(e) {
|
|
473
466
|
C(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`);
|
|
474
467
|
let t = `> [!WARNING]\n> Dependency licenses are not documented here: ${e} is a development-only tool and is never part of a production release.`;
|
|
475
468
|
await _(`${M}\n\n${t}`, A, j);
|
|
476
469
|
}
|
|
477
|
-
async function
|
|
470
|
+
async function mt(e, t, n) {
|
|
478
471
|
C(`${e} Insert licenses into 'README.md'`);
|
|
479
|
-
let r = await S(N), i = await
|
|
480
|
-
for (let e of i.values()) a +=
|
|
472
|
+
let r = await S(N), i = await bt(), a = `${jt(t, !1)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
|
|
473
|
+
for (let e of i.values()) a += F(e);
|
|
481
474
|
let o = [];
|
|
482
|
-
r.dependencies != null &&
|
|
483
|
-
let s = `${
|
|
475
|
+
r.dependencies != null && I(r.dependencies, i, n, o, 0);
|
|
476
|
+
let s = `${ut}\n\n${o.join("\n")}`;
|
|
484
477
|
await _(`${M}\n\n${a.trimEnd()}\n\n### Dependency Tree\n\n${s}`, A, j);
|
|
485
478
|
}
|
|
486
|
-
async function
|
|
479
|
+
async function ht(e, t) {
|
|
487
480
|
C(`${e} Insert licenses into 'README.md'`);
|
|
488
|
-
let { allowedLicenses: n, productionNames: r, rustCrates: i, shippedKeys: a } = t, o = await
|
|
489
|
-
for (let e of o.values().toArray().toSorted(
|
|
490
|
-
for (let e of s.values().toArray().toSorted(
|
|
481
|
+
let { allowedLicenses: n, productionNames: r, rustCrates: i, shippedKeys: a } = t, o = await bt(), s = new Map((i?.crates ?? []).map((e) => [`${e.name}@${e.version}`, _t(e)])), c = i !== null, l = c ? "|Type|Dependency|Version|License(s)|Document|\n|:-|:-|:-:|:-|:-|" : "|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|", u = `${jt(n, !0, c)}\n\n${l}\n`;
|
|
482
|
+
for (let e of o.values().toArray().toSorted(gt)) u += F(e, c ? "JavaScript" : void 0);
|
|
483
|
+
for (let e of s.values().toArray().toSorted(gt)) u += F(e, "Rust");
|
|
491
484
|
let d = await S(N), f = Object.entries(d.dependencies ?? {}).toSorted(([e], [t]) => Number(!r.has(e)) - Number(!r.has(t))), p = [];
|
|
492
485
|
L(f, {
|
|
493
486
|
licensesByKey: o,
|
|
494
487
|
shippedKeys: a,
|
|
495
488
|
shownKeys: /* @__PURE__ */ new Set()
|
|
496
489
|
}, p, 0, !1);
|
|
497
|
-
let m = p.length === 0 ? "None." : p.join("\n"), h = (i?.treeItems ?? []).map((e) =>
|
|
490
|
+
let m = p.length === 0 ? "None." : p.join("\n"), h = (i?.treeItems ?? []).map((e) => vt(e, s)).join("\n"), g = c ? `${dt}\n\n#### JavaScript\n\n${m}\n\n#### Rust\n\n${h}` : `${dt}\n\n${m}`;
|
|
498
491
|
await _(`${M}\n\n${u.trimEnd()}\n\n### Dependency Tree\n\n${g}`, A, j);
|
|
499
492
|
}
|
|
500
|
-
function
|
|
493
|
+
function gt(e, t) {
|
|
501
494
|
return e.name.localeCompare(t.name, "en") || e.installedVersion.localeCompare(t.installedVersion, "en");
|
|
502
495
|
}
|
|
503
|
-
function
|
|
496
|
+
function _t(e) {
|
|
504
497
|
return {
|
|
505
498
|
name: e.name,
|
|
506
499
|
repository: e.repository,
|
|
@@ -513,26 +506,26 @@ function Tt(e) {
|
|
|
513
506
|
licenseFiles: e.licenseFiles
|
|
514
507
|
};
|
|
515
508
|
}
|
|
516
|
-
function
|
|
509
|
+
function vt(e, t) {
|
|
517
510
|
let n = " ".repeat(e.depth);
|
|
518
511
|
return e.isOwn ? `${n}- **${e.name}** ${e.version} — this project's Rust code, compiled into its WebAssembly` : R(e.name, e.version, t.get(`${e.name}@${e.version}`), n);
|
|
519
512
|
}
|
|
520
|
-
function
|
|
513
|
+
function yt(e) {
|
|
521
514
|
return /* @__PURE__ */ new Set([
|
|
522
515
|
...Object.keys(e.dependencies ?? {}),
|
|
523
516
|
...Object.keys(e.optionalDependencies ?? {}),
|
|
524
517
|
...Object.keys(e.peerDependencies ?? {})
|
|
525
518
|
]);
|
|
526
519
|
}
|
|
527
|
-
async function
|
|
520
|
+
async function bt() {
|
|
528
521
|
let e = await S("licenses/licenses.json"), t = /* @__PURE__ */ new Map();
|
|
529
|
-
for (let [n, r] of Object.entries(e)) t.set(n,
|
|
522
|
+
for (let [n, r] of Object.entries(e)) t.set(n, Nt(n, r));
|
|
530
523
|
return await Promise.all(t.values().map(async (e) => {
|
|
531
|
-
let t = await
|
|
524
|
+
let t = await Pt(e.name, e.installedVersion);
|
|
532
525
|
e.latestVersion = t.latestVersion, e.latestPublishedDate = t.latestPublishedDate, e.publishedDate = t.publishedDate;
|
|
533
526
|
})), t;
|
|
534
527
|
}
|
|
535
|
-
async function
|
|
528
|
+
async function xt(e, t, n, r) {
|
|
536
529
|
C(e), await new Promise((e, i) => {
|
|
537
530
|
let a = {
|
|
538
531
|
start: process.cwd(),
|
|
@@ -550,39 +543,39 @@ async function kt(e, t, n, r) {
|
|
|
550
543
|
});
|
|
551
544
|
});
|
|
552
545
|
}
|
|
553
|
-
async function
|
|
546
|
+
async function St() {
|
|
554
547
|
let t = await e("package-lock.json");
|
|
555
548
|
return t === null ? {} : JSON.parse(t).packages ?? {};
|
|
556
549
|
}
|
|
557
|
-
async function
|
|
558
|
-
let t = await e(
|
|
550
|
+
async function Ct() {
|
|
551
|
+
let t = await e(ct);
|
|
559
552
|
return t === null ? null : JSON.parse(t);
|
|
560
553
|
}
|
|
561
|
-
function
|
|
554
|
+
function wt(e, t) {
|
|
562
555
|
let n = new Set(e.packages);
|
|
563
556
|
for (let r of e.external) {
|
|
564
|
-
let e =
|
|
565
|
-
if (e !== void 0) for (let r of [e, ...
|
|
557
|
+
let e = At(t, "", r);
|
|
558
|
+
if (e !== void 0) for (let r of [e, ...Ot(t, e)]) {
|
|
566
559
|
let e = t[r];
|
|
567
560
|
e?.version !== void 0 && n.add(P(r, e));
|
|
568
561
|
}
|
|
569
562
|
}
|
|
570
563
|
return n;
|
|
571
564
|
}
|
|
572
|
-
function
|
|
565
|
+
function Tt(e) {
|
|
573
566
|
let t = /* @__PURE__ */ new Set();
|
|
574
567
|
for (let [n, r] of Object.entries(e)) n !== "" && r.version !== void 0 && t.add(P(n, r));
|
|
575
568
|
return [...t];
|
|
576
569
|
}
|
|
577
|
-
function
|
|
570
|
+
function Et(e, t) {
|
|
578
571
|
let n = [...e.difference(t)];
|
|
579
572
|
n.length > 0 && console.warn(`⚠️ Not installed, so not checked; rebuild to refresh the record: ${n.join(", ")}`);
|
|
580
573
|
}
|
|
581
574
|
function P(e, t) {
|
|
582
575
|
return `${t.name ?? e.slice(e.lastIndexOf("node_modules/") + 13)}@${String(t.version)}`;
|
|
583
576
|
}
|
|
584
|
-
function
|
|
585
|
-
let t =
|
|
577
|
+
function Dt(e) {
|
|
578
|
+
let t = Ot(e, ""), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
586
579
|
for (let [i, a] of Object.entries(e)) {
|
|
587
580
|
if (i === "" || a.version === void 0) continue;
|
|
588
581
|
let e = P(i, a);
|
|
@@ -590,18 +583,18 @@ function Ft(e) {
|
|
|
590
583
|
}
|
|
591
584
|
return r.values().filter((e) => !n.has(e)).toArray();
|
|
592
585
|
}
|
|
593
|
-
function
|
|
586
|
+
function Ot(e, t) {
|
|
594
587
|
let n = /* @__PURE__ */ new Set(), r = [t];
|
|
595
588
|
for (; r.length > 0;) {
|
|
596
589
|
let t = r.pop() ?? "", i = e[t];
|
|
597
|
-
if (i !== void 0) for (let a of
|
|
598
|
-
let i =
|
|
590
|
+
if (i !== void 0) for (let a of kt(i)) {
|
|
591
|
+
let i = At(e, t, a);
|
|
599
592
|
i === void 0 || n.has(i) || (n.add(i), r.push(i));
|
|
600
593
|
}
|
|
601
594
|
}
|
|
602
595
|
return n;
|
|
603
596
|
}
|
|
604
|
-
function
|
|
597
|
+
function kt(e) {
|
|
605
598
|
let t = Object.keys(e.peerDependencies ?? {}).filter((t) => e.peerDependenciesMeta?.[t]?.optional !== !0);
|
|
606
599
|
return [
|
|
607
600
|
...Object.keys(e.dependencies ?? {}),
|
|
@@ -609,7 +602,7 @@ function Lt(e) {
|
|
|
609
602
|
...t
|
|
610
603
|
];
|
|
611
604
|
}
|
|
612
|
-
function
|
|
605
|
+
function At(e, t, n) {
|
|
613
606
|
let r = t;
|
|
614
607
|
for (;;) {
|
|
615
608
|
let t = r === "" ? `node_modules/${n}` : `${r}/node_modules/${n}`, i = e[t];
|
|
@@ -619,14 +612,14 @@ function Rt(e, t, n) {
|
|
|
619
612
|
r = a === -1 ? "" : r.slice(0, a);
|
|
620
613
|
}
|
|
621
614
|
}
|
|
622
|
-
function
|
|
623
|
-
let r =
|
|
615
|
+
function jt(e, t, n = !1) {
|
|
616
|
+
let r = Mt(e.split(";")), i = n ? "[license-checker](https://github.com/RSeidelsohn/license-checker-rseidelsohn) and [cargo tree](https://doc.rust-lang.org/cargo/commands/cargo-tree.html)" : "[license-checker](https://github.com/RSeidelsohn/license-checker-rseidelsohn)", a = "The following table lists every package whose code, styles or assets are included in this project's build, as recorded by the build itself. Modules loaded at run time are not included; each documents its own.";
|
|
624
617
|
return `License data is updated each time \`npm run document\` is run, using ${i}. ${t ? n ? `${a} It also lists every Rust crate compiled into its WebAssembly, as resolved by Cargo; macros and other crates used only while compiling put none of their code in it, so are left out.` : a : "The following table lists all production dependencies. This project has no build record, so the list is taken from its declared dependencies."} These dependencies have been checked and confirmed to use ${r}, all of which allow commercial use. All are used unmodified, so any licence conditions that apply only to modified versions are not triggered. Developers cloning this repository should independently verify development dependencies.`;
|
|
625
618
|
}
|
|
626
|
-
function
|
|
619
|
+
function Mt(e) {
|
|
627
620
|
return e.length === 1 ? e[0] ?? "" : e.length === 2 ? `${String(e[0])} or ${String(e[1])}` : `${e.slice(0, -1).join(", ")}, or ${String(e.at(-1))}`;
|
|
628
621
|
}
|
|
629
|
-
function
|
|
622
|
+
function Nt(e, t) {
|
|
630
623
|
let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
|
|
631
624
|
return {
|
|
632
625
|
name: r,
|
|
@@ -643,7 +636,7 @@ function Bt(e, t) {
|
|
|
643
636
|
}]
|
|
644
637
|
};
|
|
645
638
|
}
|
|
646
|
-
async function
|
|
639
|
+
async function Pt(e, t) {
|
|
647
640
|
try {
|
|
648
641
|
let n = await fetch(`https://registry.npmjs.org/${encodeURIComponent(e)}`);
|
|
649
642
|
if (n.ok) {
|
|
@@ -661,16 +654,16 @@ async function Vt(e, t) {
|
|
|
661
654
|
publishedDate: ""
|
|
662
655
|
};
|
|
663
656
|
}
|
|
664
|
-
function
|
|
657
|
+
function F(e, t) {
|
|
665
658
|
let n = e.licenseFiles.length === 0 ? "⚠️ No license file" : e.licenseFiles.map((e) => `[${e.label}](licenses/${e.path})`).join(" ");
|
|
666
659
|
return `${t === void 0 ? "" : `|${t}`}|[${e.name}](${e.repository})|${e.installedVersion}|${e.licenseTypes}|${n}|\n`;
|
|
667
660
|
}
|
|
668
|
-
function
|
|
661
|
+
function I(e, t, n, r, i) {
|
|
669
662
|
let a = " ".repeat(i);
|
|
670
663
|
for (let [o, s] of Object.entries(e)) {
|
|
671
664
|
if (s.version === void 0) continue;
|
|
672
665
|
let e = s.version;
|
|
673
|
-
n.has(`${o}@${e}`) || (r.push(R(o, e, t.get(`${o}@${e}`), a)), s.dependencies != null &&
|
|
666
|
+
n.has(`${o}@${e}`) || (r.push(R(o, e, t.get(`${o}@${e}`), a)), s.dependencies != null && I(s.dependencies, t, n, r, i + 1));
|
|
674
667
|
}
|
|
675
668
|
}
|
|
676
669
|
function L(e, t, n, r, i) {
|
|
@@ -685,16 +678,16 @@ function L(e, t, n, r, i) {
|
|
|
685
678
|
}
|
|
686
679
|
}
|
|
687
680
|
function R(e, t, n, r) {
|
|
688
|
-
return `${r}- **${n == null ? e : `[${e}](${n.repository})`}** ${t}${
|
|
681
|
+
return `${r}- **${n == null ? e : `[${e}](${n.repository})`}** ${t}${Ft(n)}`;
|
|
689
682
|
}
|
|
690
|
-
function
|
|
683
|
+
function Ft(e) {
|
|
691
684
|
if (e == null) return "";
|
|
692
|
-
let t = e.publishedDate ?
|
|
685
|
+
let t = e.publishedDate ? It(e.publishedDate.split("T", 1)[0]) : "";
|
|
693
686
|
if (e.latestVersion === "" || e.latestVersion === e.installedVersion) return t === "" ? "" : ` — ${t}`;
|
|
694
|
-
let n = e.latestPublishedDate ?
|
|
687
|
+
let n = e.latestPublishedDate ? It(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `latest: ${e.latestVersion} ❗` : `latest: ${e.latestVersion} — ${n} ❗`;
|
|
695
688
|
return t === "" ? ` — → ${r}` : ` — ${t} → ${r}`;
|
|
696
689
|
}
|
|
697
|
-
function
|
|
690
|
+
function It(e) {
|
|
698
691
|
if (e == null || e === "") return "n/a";
|
|
699
692
|
let t = e.split("T", 1)[0];
|
|
700
693
|
if (t == null || t === "") return "n/a";
|
|
@@ -703,31 +696,31 @@ function Wt(e) {
|
|
|
703
696
|
}
|
|
704
697
|
//#endregion
|
|
705
698
|
//#region src/actions/documentOpening.ts
|
|
706
|
-
var
|
|
707
|
-
async function
|
|
699
|
+
var Lt = "<!-- OPENING_START -->", Rt = "<!-- OPENING_END -->";
|
|
700
|
+
async function zt() {
|
|
708
701
|
try {
|
|
709
702
|
s("Document Opening"), C("1️⃣ Insert opening content into 'README.md'");
|
|
710
|
-
let e = await S("package.json"), t = await S("config.json"), { owner: n, repository: r } = x(e, "document opening"), i =
|
|
711
|
-
await _(c,
|
|
703
|
+
let e = await S("package.json"), t = await S("config.json"), { owner: n, repository: r } = x(e, "document opening"), i = Bt(e), a = Ht(t), o = m(t.id), c = Ut(n, r, i, o.uploadGroupName === void 0 ? void 0 : t.id, o.publishedTo === "npm" ? Vt(e) : void 0, e.description, a);
|
|
704
|
+
await _(c, Lt, Rt), b("Opening documented");
|
|
712
705
|
} catch (e) {
|
|
713
706
|
console.error("❌ Error documenting opening", e), process.exit(1);
|
|
714
707
|
}
|
|
715
708
|
}
|
|
716
|
-
function
|
|
709
|
+
function Bt(e) {
|
|
717
710
|
let t = e.license;
|
|
718
711
|
if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
|
|
719
712
|
return t;
|
|
720
713
|
}
|
|
721
|
-
function
|
|
714
|
+
function Vt(e) {
|
|
722
715
|
let t = e.name;
|
|
723
716
|
if (t == null || t === "") throw Error("package.json 'name' field is required to document opening.");
|
|
724
717
|
return t;
|
|
725
718
|
}
|
|
726
|
-
function
|
|
719
|
+
function Ht(e) {
|
|
727
720
|
let t = e.description.en?.trim();
|
|
728
721
|
return t === void 0 || t === "" ? void 0 : t;
|
|
729
722
|
}
|
|
730
|
-
function
|
|
723
|
+
function Ut(e, t, n, r, i, a, o) {
|
|
731
724
|
let s = `https://github.com/${e}/${t}`, c = n.replaceAll("-", "--"), l = encodeURIComponent(`https://api.dpuse.app/configs/${r ?? ""}`);
|
|
732
725
|
return `[](./LICENSE)${r === void 0 ? "" : `\n[](${s}/releases/latest)`}${i === void 0 ? "" : `\n[](https://www.npmjs.com/package/${i})`}
|
|
733
726
|
[](${s}/actions/workflows/ci.yml)${a == null || a === "" ? "" : `\n\n${a}`}
|
|
@@ -748,31 +741,31 @@ In addition, DPUse provides [Tools](https://www.dpuse.app) used by the applicati
|
|
|
748
741
|
}
|
|
749
742
|
//#endregion
|
|
750
743
|
//#region src/actions/documentQualitySecurity.ts
|
|
751
|
-
var
|
|
744
|
+
var Wt = {
|
|
752
745
|
"Branch-Protection": 3,
|
|
753
746
|
"Code-Review": 0,
|
|
754
747
|
Contributors: 0
|
|
755
|
-
},
|
|
748
|
+
}, Gt = /* @__PURE__ */ new Set(["CII-Best-Practices"]), Kt = "coverage/coverage-final.json", qt = "coverage/coverage-summary.json", Jt = 80, Yt = 60, Xt = "code-health-reports/vitest/badge.json", Zt = {
|
|
756
749
|
actions: "GitHub Actions",
|
|
757
750
|
"javascript-typescript": "JavaScript/TypeScript",
|
|
758
751
|
rust: "Rust"
|
|
759
|
-
},
|
|
752
|
+
}, Qt = {
|
|
760
753
|
A: "brightgreen",
|
|
761
754
|
B: "green",
|
|
762
755
|
C: "yellow",
|
|
763
756
|
D: "orange",
|
|
764
757
|
F: "red"
|
|
765
|
-
},
|
|
766
|
-
async function
|
|
758
|
+
}, $t = `${c}/health.json`, en = le(ue);
|
|
759
|
+
async function tn() {
|
|
767
760
|
try {
|
|
768
761
|
s("Document Quality & Security");
|
|
769
|
-
let e = await S("package.json"), t = await
|
|
762
|
+
let e = await S("package.json"), t = await nn(e), n = await an(e, t === void 0 ? [] : ["--coverage", Kt]), { owner: r, repository: i } = x(e, "document quality and security");
|
|
770
763
|
C("4️⃣ Read security checks and settings");
|
|
771
|
-
let a = await
|
|
764
|
+
let a = await sn(r, i, e);
|
|
772
765
|
C("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
|
|
773
|
-
let [o, c] = await Promise.all([
|
|
766
|
+
let [o, c] = await Promise.all([cn(`https://github.com/${r}/${i}`), ln(`github.com/${r}/${i}`)]);
|
|
774
767
|
C("6️⃣ Insert quality and security content into 'README.md'");
|
|
775
|
-
let d =
|
|
768
|
+
let d = mn(r, i, {
|
|
776
769
|
coveragePercent: t,
|
|
777
770
|
fallowHealth: n,
|
|
778
771
|
securitySettings: a
|
|
@@ -782,7 +775,7 @@ async function un() {
|
|
|
782
775
|
console.error("❌ Error documenting quality and security", e), process.exit(1);
|
|
783
776
|
}
|
|
784
777
|
}
|
|
785
|
-
async function
|
|
778
|
+
async function nn(t) {
|
|
786
779
|
if (t.devDependencies?.["@vitest/coverage-v8"] == null) {
|
|
787
780
|
C("1️⃣ Test coverage NOT measured, as '@vitest/coverage-v8' is not installed");
|
|
788
781
|
return;
|
|
@@ -792,25 +785,25 @@ async function dn(t) {
|
|
|
792
785
|
"--passWithNoTests",
|
|
793
786
|
"--coverage"
|
|
794
787
|
]);
|
|
795
|
-
let n = await e(
|
|
788
|
+
let n = await e(qt);
|
|
796
789
|
if (n === null) return;
|
|
797
790
|
let r = JSON.parse(n).total.lines.pct;
|
|
798
|
-
return await
|
|
791
|
+
return await rn(r), r;
|
|
799
792
|
}
|
|
800
|
-
async function
|
|
793
|
+
async function rn(e) {
|
|
801
794
|
let t = [
|
|
802
795
|
"red",
|
|
803
796
|
"yellow",
|
|
804
797
|
"brightgreen"
|
|
805
|
-
], n = Number(e >=
|
|
806
|
-
await i(
|
|
798
|
+
], n = Number(e >= Yt) + Number(e >= Jt);
|
|
799
|
+
await i(Xt, {
|
|
807
800
|
schemaVersion: 1,
|
|
808
801
|
label: "coverage",
|
|
809
802
|
message: `${e.toFixed(1)}%`,
|
|
810
803
|
color: t[n]
|
|
811
804
|
});
|
|
812
805
|
}
|
|
813
|
-
async function
|
|
806
|
+
async function an(e, n) {
|
|
814
807
|
if (e.devDependencies?.fallow == null) {
|
|
815
808
|
C("2️⃣ Code health NOT measured, as Fallow is not installed"), C("3️⃣ Code health report NOT required");
|
|
816
809
|
return;
|
|
@@ -821,20 +814,20 @@ async function pn(e, n) {
|
|
|
821
814
|
"--format",
|
|
822
815
|
"json",
|
|
823
816
|
...n
|
|
824
|
-
],
|
|
825
|
-
let r = await S(
|
|
826
|
-
return await
|
|
817
|
+
], $t), await t("3️⃣ Write code health report", "fallow", ["--format", "markdown"], ne, !0);
|
|
818
|
+
let r = await S($t);
|
|
819
|
+
return await on(r), r;
|
|
827
820
|
}
|
|
828
|
-
async function
|
|
821
|
+
async function on(e) {
|
|
829
822
|
let { score: t, grade: n } = e.health_score;
|
|
830
823
|
await i(h, {
|
|
831
824
|
schemaVersion: 1,
|
|
832
825
|
label: "fallow",
|
|
833
826
|
message: `${n} (${String(Math.round(t))})`,
|
|
834
|
-
color:
|
|
827
|
+
color: Qt[n] ?? "lightgrey"
|
|
835
828
|
});
|
|
836
829
|
}
|
|
837
|
-
async function
|
|
830
|
+
async function sn(t, n, r) {
|
|
838
831
|
let [i, a, o] = await Promise.all([
|
|
839
832
|
e(".github/workflows/ci.yml"),
|
|
840
833
|
e(".github/dependabot.yml"),
|
|
@@ -846,7 +839,7 @@ async function hn(t, n, r) {
|
|
|
846
839
|
z(`repos/${t}/${n}/commits/main/check-runs?per_page=100`)
|
|
847
840
|
]), f = c === void 0 ? void 0 : JSON.parse(c).security_and_analysis, p = (e) => f?.[e] === void 0 ? void 0 : f[e].status === "enabled", m = new Set((d === void 0 ? [] : JSON.parse(d).check_runs).map((e) => e.app?.slug)), h = a?.match(/package-ecosystem:/g)?.length ?? 0, g = a?.match(/open-pull-requests-limit: 0\b/g)?.length ?? 0;
|
|
848
841
|
return {
|
|
849
|
-
codeQLLanguages: s.matchAll(/- language: ([\w-]+)/g).filter(([, e]) => e !== "rust" || o !== null).map(([, e = ""]) =>
|
|
842
|
+
codeQLLanguages: s.matchAll(/- language: ([\w-]+)/g).filter(([, e]) => e !== "rust" || o !== null).map(([, e = ""]) => Zt[e] ?? e).toArray(),
|
|
850
843
|
codeQLQueries: /queries: ([\w-]+)/.exec(s)?.[1],
|
|
851
844
|
dependabotAlerts: u !== void 0,
|
|
852
845
|
dependabotSecurityUpdates: p("dependabot_security_updates"),
|
|
@@ -865,29 +858,29 @@ async function hn(t, n, r) {
|
|
|
865
858
|
}
|
|
866
859
|
async function z(e) {
|
|
867
860
|
try {
|
|
868
|
-
let { stdout: t } = await
|
|
861
|
+
let { stdout: t } = await en("gh", ["api", e]);
|
|
869
862
|
return t;
|
|
870
863
|
} catch (e) {
|
|
871
864
|
if (String(e.stderr).includes("HTTP 404")) return;
|
|
872
865
|
throw e;
|
|
873
866
|
}
|
|
874
867
|
}
|
|
875
|
-
async function
|
|
868
|
+
async function cn(e) {
|
|
876
869
|
let t = await fetch(`https://www.bestpractices.dev/projects.json?url=${encodeURIComponent(e)}`);
|
|
877
870
|
if (!t.ok) throw Error(`OpenSSF Best Practices lookup failed with status ${String(t.status)}.`);
|
|
878
871
|
return (await t.json()).find((t) => t.repo_url === e)?.id;
|
|
879
872
|
}
|
|
880
|
-
async function
|
|
873
|
+
async function ln(e) {
|
|
881
874
|
let t = await fetch(`https://api.scorecard.dev/projects/${e}`);
|
|
882
875
|
if (t.status !== 404) {
|
|
883
876
|
if (!t.ok) throw Error(`OpenSSF Scorecard lookup failed with status ${String(t.status)}.`);
|
|
884
877
|
return await t.json();
|
|
885
878
|
}
|
|
886
879
|
}
|
|
887
|
-
function
|
|
888
|
-
return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 ||
|
|
880
|
+
function un(e) {
|
|
881
|
+
return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Gt.has(e) || Wt[e] !== void 0 && t >= Wt[e]);
|
|
889
882
|
}
|
|
890
|
-
function
|
|
883
|
+
function dn(e) {
|
|
891
884
|
return e === !1 ? " These are handled manually." : "";
|
|
892
885
|
}
|
|
893
886
|
function B(e) {
|
|
@@ -902,10 +895,10 @@ ${t.map((e) => `|${e.join("|")}|`).join("\n")}
|
|
|
902
895
|
|
|
903
896
|
`;
|
|
904
897
|
}
|
|
905
|
-
function
|
|
898
|
+
function fn(e, t, n, r) {
|
|
906
899
|
return `})`;
|
|
907
900
|
}
|
|
908
|
-
function
|
|
901
|
+
function pn(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
|
|
909
902
|
let a = `https://github.com/${e}/${t}`, o = (e) => e ? ` Part of the [CI workflow](${a}/actions/workflows/ci.yml) on every push and pull request to \`main\`.` : "", s = [[
|
|
910
903
|
"Unit tests",
|
|
911
904
|
B(i.testsInCI),
|
|
@@ -918,7 +911,7 @@ function xn(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i })
|
|
|
918
911
|
n !== void 0 && s.push([
|
|
919
912
|
"Test coverage",
|
|
920
913
|
B(!0),
|
|
921
|
-
`${
|
|
914
|
+
`${fn(e, t, "Coverage", Xt)} [Vitest's V8 coverage](https://vitest.dev/guide/coverage) measures the share of source lines the unit tests run. The target is ${String(Jt)}%.`
|
|
922
915
|
]);
|
|
923
916
|
let c = `[](https://sonarcloud.io/summary/new_code?id=${e}_${t}) `, l = [[
|
|
924
917
|
"Code analysis",
|
|
@@ -932,7 +925,7 @@ function xn(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i })
|
|
|
932
925
|
r !== void 0 && l.unshift([
|
|
933
926
|
"Code health",
|
|
934
927
|
B(!0),
|
|
935
|
-
`[${
|
|
928
|
+
`[${fn(e, t, "Fallow code health", h)}](./${ne}) [Fallow](https://github.com/fallow-rs/fallow) finds unused code, duplication, complexity and dependency problems.`
|
|
936
929
|
]);
|
|
937
930
|
let u = i.codeQLLanguages.length > 0, d = `[](${a}/security/code-scanning) `, f = i.codeQLQueries === "security-extended" ? "using the extended security queries" : "using the default queries", p = u ? ` ${i.codeQLLanguages.join(" and ")}` : "", m = [
|
|
938
931
|
[
|
|
@@ -969,23 +962,23 @@ function xn(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i })
|
|
|
969
962
|
[
|
|
970
963
|
"Security updates",
|
|
971
964
|
B(i.dependabotSecurityUpdates),
|
|
972
|
-
`${g} opens pull requests that update vulnerable dependencies.${
|
|
965
|
+
`${g} opens pull requests that update vulnerable dependencies.${dn(i.dependabotSecurityUpdates)}`
|
|
973
966
|
],
|
|
974
967
|
[
|
|
975
968
|
"Version updates",
|
|
976
969
|
B(i.dependabotVersionUpdates),
|
|
977
|
-
`${g} opens pull requests for new dependency versions.${
|
|
970
|
+
`${g} opens pull requests for new dependency versions.${dn(i.dependabotVersionUpdates)}`
|
|
978
971
|
]
|
|
979
972
|
];
|
|
980
973
|
return `This section is updated each time \`npm run document\` is run. Settings come from the repository's workflow files and GitHub. Test coverage and the Fallow score are measured at the same time.
|
|
981
974
|
|
|
982
975
|
${V("Testing", s)}${V("Code Quality", l)}${V("Security Analysis", m)}${V("Dependencies", _)}`;
|
|
983
976
|
}
|
|
984
|
-
function
|
|
985
|
-
let a = `https://github.com/${e}/${t}`, o = `github.com/${e}/${t}`, s = `https://www.bestpractices.dev/projects/${String(r)}`, c = i !== void 0 &&
|
|
977
|
+
function mn(e, t, n, r, i) {
|
|
978
|
+
let a = `https://github.com/${e}/${t}`, o = `github.com/${e}/${t}`, s = `https://www.bestpractices.dev/projects/${String(r)}`, c = i !== void 0 && un(i) ? "\n\n> [!NOTE]\n> Apart from the Best Practices badge above, the remaining Scorecard gaps need multi-person review or a pull-request workflow, which this solo-maintained project doesn't use." : "", l = r === void 0 ? "" : `[](${s})\n`, u = n.securitySettings.privateVulnerabilityReporting === !0 ? `Use [GitHub private vulnerability reporting](${a}/security/advisories/new) instead. See [SECURITY.md](./SECURITY.md) for the full disclosure policy, contact details, and expected response times.` : "See [SECURITY.md](./SECURITY.md) for how to report one privately, the full disclosure policy, and expected response times.";
|
|
986
979
|
return `## Quality & Security
|
|
987
980
|
|
|
988
|
-
${
|
|
981
|
+
${pn(e, t, n)}### OpenSSF 🚧
|
|
989
982
|
|
|
990
983
|
${l}[](https://scorecard.dev/viewer/?uri=${o})
|
|
991
984
|
|
|
@@ -997,26 +990,26 @@ Please do not open public GitHub issues for security vulnerabilities. ${u}`;
|
|
|
997
990
|
}
|
|
998
991
|
//#endregion
|
|
999
992
|
//#region src/actions/documentUsage.ts
|
|
1000
|
-
var
|
|
993
|
+
var hn = "<!-- USAGE_START -->", gn = "<!-- USAGE_END -->", _n = /* @__PURE__ */ new Set([
|
|
1001
994
|
"connector",
|
|
1002
995
|
"cookbook",
|
|
1003
996
|
"presenter"
|
|
1004
|
-
]),
|
|
1005
|
-
async function
|
|
997
|
+
]), vn = /* @__PURE__ */ new Set(["development", "eslint"]), yn = "> [!WARNING]\n> This project 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.", bn = "This repository manages itself using the actions it implements.", xn = "This repository is managed using the common set of actions provided by [@dpuse/dpuse-development](https://github.com/dpuse/dpuse-development).";
|
|
998
|
+
async function Sn() {
|
|
1006
999
|
try {
|
|
1007
1000
|
s("Document Usage"), C("1️⃣ Insert usage content into 'README.md'");
|
|
1008
|
-
let [e, t] = await Promise.all([S("package.json"), S("config.json")]), n =
|
|
1009
|
-
await _(u,
|
|
1001
|
+
let [e, t] = await Promise.all([S("package.json"), S("config.json")]), n = Cn(e), r = wn(n), i = H(e.engines?.node), a = H(e.engines?.npm), o = H(e.devDependencies?.typescript), c = Tn(m(t.id), e.name), l = `${n.replace(/\.git$/, "")}/blob/main/package.json`, u = En(c, n, r, i, a, o, `${e.name === "@dpuse/dpuse-development" ? bn : xn} See the \`scripts\` block in [package.json](${l}) for details.`);
|
|
1002
|
+
await _(u, hn, gn), b("Usage documented");
|
|
1010
1003
|
} catch (e) {
|
|
1011
1004
|
console.error("❌ Error documenting usage", e), process.exit(1);
|
|
1012
1005
|
}
|
|
1013
1006
|
}
|
|
1014
|
-
function
|
|
1007
|
+
function Cn(e) {
|
|
1015
1008
|
let t = e.repository, n = typeof t == "string" ? t : t?.url;
|
|
1016
1009
|
if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
|
|
1017
1010
|
return n.replace(/^git\+/, "");
|
|
1018
1011
|
}
|
|
1019
|
-
function
|
|
1012
|
+
function wn(e) {
|
|
1020
1013
|
return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
|
|
1021
1014
|
}
|
|
1022
1015
|
function H(e) {
|
|
@@ -1025,9 +1018,9 @@ function H(e) {
|
|
|
1025
1018
|
if (t == null) throw Error(`Unable to parse version from '${e}'.`);
|
|
1026
1019
|
return t[0];
|
|
1027
1020
|
}
|
|
1028
|
-
function
|
|
1021
|
+
function Tn(e, t) {
|
|
1029
1022
|
let { typeId: n } = e;
|
|
1030
|
-
if (
|
|
1023
|
+
if (_n.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.
|
|
1031
1024
|
|
|
1032
1025
|
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.`;
|
|
1033
1026
|
if (e.publishedTo === "npm") {
|
|
@@ -1038,11 +1031,11 @@ You may view or clone this repository for your own purposes, such as building a
|
|
|
1038
1031
|
npm install ${t}
|
|
1039
1032
|
\`\`\`
|
|
1040
1033
|
|
|
1041
|
-
${
|
|
1034
|
+
${vn.has(n) ? `${yn}\n\n` : ""}To work on the source instead, clone this repository.`;
|
|
1042
1035
|
}
|
|
1043
1036
|
return "You may view or clone this repository for your own purposes.";
|
|
1044
1037
|
}
|
|
1045
|
-
function
|
|
1038
|
+
function En(e, t, n, r, i, a, o) {
|
|
1046
1039
|
return `## Usage
|
|
1047
1040
|
|
|
1048
1041
|
${e}
|
|
@@ -1060,7 +1053,7 @@ ${o}`;
|
|
|
1060
1053
|
//#endregion
|
|
1061
1054
|
//#region src/actions/documentApiReference.ts
|
|
1062
1055
|
var U = "API_REFERENCE.md";
|
|
1063
|
-
async function
|
|
1056
|
+
async function Dn() {
|
|
1064
1057
|
try {
|
|
1065
1058
|
s("Document API Reference");
|
|
1066
1059
|
let { writeAPIReference: e } = await import("./apiReference-D4xooSV0.js");
|
|
@@ -1071,49 +1064,49 @@ async function Fn() {
|
|
|
1071
1064
|
}
|
|
1072
1065
|
//#endregion
|
|
1073
1066
|
//#region src/actions/documentBundleSizes.ts
|
|
1074
|
-
var
|
|
1075
|
-
async function
|
|
1067
|
+
var On = "bundle-analysis-reports/sonda/index.json", kn = "bundle-analysis-reports/sonda/worker.json", An = "<!-- BUNDLE_START -->", jn = "<!-- BUNDLE_END -->", W = " ", G = 20, Mn = "█", Nn = "▒", Pn = 100 / G / 2, Fn = 100 / G, In = "This report is updated with each release, from the bundle the release builds, using [Sonda](https://sonda.dev/), which analyses final source maps to reveal the actual effects of tree-shaking and minification rather than relying on pre-build estimates.\n\n_Note: Sonda's Vite reports currently exclude CSS files, since Vite does not generate source maps for CSS._", Ln = "Bars show each row's share of its output file.", Rn = "↳ rows are part of the row above.", K = "(bundler output, whitespace & JSON)", q = "(inlined worker)", zn = `${q} = a Web Worker built separately and embedded in its output file as text. Where the build records what it contains, its rows list that; any few bytes over are the escaping needed to embed it.`, J = "(Rust WebAssembly as base64", Bn = `${J}…) = the compiled Rust code, embedded as base64 text, about a third larger than the binary it decodes to, which is the size given.`, Vn = `${K} = bytes Sonda can't trace to a source file: whitespace (indentation and line breaks), code the bundler generates (region comments, the combined import/export lines, its small runtime helper and wrappers), and imported JSON such as \`config.json\`, which the bundler doesn't map. The JSON and the generated code are real bytes that ship; the whitespace mostly disappears once compressed.`;
|
|
1068
|
+
async function Hn(t) {
|
|
1076
1069
|
try {
|
|
1077
1070
|
s("Document Bundle Sizes"), C("1️⃣ Read bundle analysis report");
|
|
1078
|
-
let n = await S(
|
|
1071
|
+
let n = await S(On), r = await e(kn), i = r === null ? void 0 : JSON.parse(r), a = /* @__PURE__ */ new Map();
|
|
1079
1072
|
for (let t of n.resources) t.kind === "asset" && a.set(t.name, await e(t.name));
|
|
1080
1073
|
C("2️⃣ Insert table into 'README.md'");
|
|
1081
|
-
let o =
|
|
1074
|
+
let o = Un(n, {
|
|
1082
1075
|
assetContents: a,
|
|
1083
1076
|
isModuleLevel: t?.moduleLevel ?? !1,
|
|
1084
1077
|
workerJson: i
|
|
1085
1078
|
}), c = [
|
|
1086
|
-
o.includes("↳") ? `${
|
|
1087
|
-
o.includes(q) ?
|
|
1088
|
-
o.includes(J) ?
|
|
1089
|
-
|
|
1079
|
+
o.includes("↳") ? `${Ln} ${Rn}` : Ln,
|
|
1080
|
+
o.includes(q) ? zn : "",
|
|
1081
|
+
o.includes(J) ? Bn : "",
|
|
1082
|
+
Vn
|
|
1090
1083
|
].filter((e) => e !== "");
|
|
1091
|
-
await _(`## Bundle Analysis\n\n${
|
|
1084
|
+
await _(`## Bundle Analysis\n\n${In}\n\n${o}\n\n${c.join("\n\n")}`, An, jn), b("Bundle sizes documented");
|
|
1092
1085
|
} catch (e) {
|
|
1093
1086
|
console.error("❌ Error documenting bundle sizes", e), process.exit(1);
|
|
1094
1087
|
}
|
|
1095
1088
|
}
|
|
1096
|
-
function
|
|
1097
|
-
let { assetContents: n, isModuleLevel: r, workerJson: i } = t, a =
|
|
1089
|
+
function Un(e, t) {
|
|
1090
|
+
let { assetContents: n, isModuleLevel: r, workerJson: i } = t, a = ir(e), o = i === void 0 ? void 0 : ir(i).values().next().value;
|
|
1098
1091
|
for (let [e, t] of a) {
|
|
1099
1092
|
let r = n.get(e);
|
|
1100
|
-
r != null &&
|
|
1093
|
+
r != null && Wn(t, r, o);
|
|
1101
1094
|
}
|
|
1102
|
-
let s = a.values().flatMap((e) => e.values().toArray()).reduce((e, t) => e + t.sizes.uncompressed, 0), c = e.resources.filter((e) => e.kind === "asset").map((e) => [e.name,
|
|
1095
|
+
let s = a.values().flatMap((e) => e.values().toArray()).reduce((e, t) => e + t.sizes.uncompressed, 0), c = e.resources.filter((e) => e.kind === "asset").map((e) => [e.name, lr(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), l = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
|
|
1103
1096
|
for (let [e, t] of c) {
|
|
1104
|
-
let n = [...a.get(e) ?? /* @__PURE__ */ new Map()].toSorted(
|
|
1105
|
-
l.push(`| **${e}** | ${
|
|
1097
|
+
let n = [...a.get(e) ?? /* @__PURE__ */ new Map()].toSorted(Qn), i = n.reduce((e, [, t]) => e + t.sizes.uncompressed, 0), o = i > 0 && s > 0 ? ` · ${fr(i, s)} of the build` : "";
|
|
1098
|
+
l.push(`| **${e}** | ${ur(t)}${o} |`, ...$n(n, i, r));
|
|
1106
1099
|
}
|
|
1107
1100
|
return l.join("\n");
|
|
1108
1101
|
}
|
|
1109
|
-
function
|
|
1110
|
-
let r =
|
|
1111
|
-
|
|
1102
|
+
function Wn(e, t, n) {
|
|
1103
|
+
let r = Gn(t), i = Kn(r ?? ""), a = Kn(t);
|
|
1104
|
+
Jn(e, {
|
|
1112
1105
|
bytes: a.bytes - i.bytes,
|
|
1113
1106
|
binaryBytes: a.binaryBytes - i.binaryBytes
|
|
1114
|
-
}), r !== void 0 &&
|
|
1107
|
+
}), r !== void 0 && Yn(e, Buffer.byteLength(r), i, n);
|
|
1115
1108
|
}
|
|
1116
|
-
function
|
|
1109
|
+
function Gn(e) {
|
|
1117
1110
|
if (!e.includes("new Worker(")) return;
|
|
1118
1111
|
let t = /encodeURIComponent\((\w+)\)/.exec(e)?.[1];
|
|
1119
1112
|
if (t === void 0) return;
|
|
@@ -1123,21 +1116,21 @@ function $n(e) {
|
|
|
1123
1116
|
for (; a < e.length && e[a] !== r;) a += e[a] === "\\" ? 2 : 1;
|
|
1124
1117
|
return e.slice(i, a);
|
|
1125
1118
|
}
|
|
1126
|
-
function
|
|
1119
|
+
function Kn(e) {
|
|
1127
1120
|
let t = {
|
|
1128
1121
|
bytes: 0,
|
|
1129
1122
|
binaryBytes: 0
|
|
1130
1123
|
};
|
|
1131
1124
|
for (let n of e.matchAll(/data:application\/wasm;base64,([A-Za-z\d+/]*={0,2})/g)) {
|
|
1132
1125
|
let e = n[1] ?? "";
|
|
1133
|
-
t.bytes += n[0].length, t.binaryBytes += Math.floor(e.length * 3 / 4) -
|
|
1126
|
+
t.bytes += n[0].length, t.binaryBytes += Math.floor(e.length * 3 / 4) - qn(e);
|
|
1134
1127
|
}
|
|
1135
1128
|
return t;
|
|
1136
1129
|
}
|
|
1137
|
-
function
|
|
1130
|
+
function qn(e) {
|
|
1138
1131
|
return e.endsWith("==") ? 2 : +!!e.endsWith("=");
|
|
1139
1132
|
}
|
|
1140
|
-
function
|
|
1133
|
+
function Jn(e, t) {
|
|
1141
1134
|
if (t.bytes <= 0) return;
|
|
1142
1135
|
let n = [e.get("wasm"), e.get(K)].flatMap((e) => e === void 0 ? [] : e.files.entries().map(([t, n]) => ({
|
|
1143
1136
|
group: e,
|
|
@@ -1145,7 +1138,7 @@ function nr(e, t) {
|
|
|
1145
1138
|
sizes: n
|
|
1146
1139
|
})).toArray()).find(({ sizes: e }) => e.uncompressed >= t.bytes);
|
|
1147
1140
|
if (n === void 0) return;
|
|
1148
|
-
|
|
1141
|
+
Zn(e, n.group, n.fileName, n.sizes, t.bytes);
|
|
1149
1142
|
let r = `${J}, ${Q(t.binaryBytes)} binary)`;
|
|
1150
1143
|
e.set(r, {
|
|
1151
1144
|
sizes: {
|
|
@@ -1158,14 +1151,14 @@ function nr(e, t) {
|
|
|
1158
1151
|
}]])
|
|
1159
1152
|
});
|
|
1160
1153
|
}
|
|
1161
|
-
function
|
|
1154
|
+
function Yn(e, t, n, r) {
|
|
1162
1155
|
let i = e.get(K), a = i?.files.get("");
|
|
1163
1156
|
if (i === void 0 || a === void 0 || a.uncompressed < t) return;
|
|
1164
|
-
|
|
1157
|
+
Zn(e, i, "", a, t);
|
|
1165
1158
|
let o = r === void 0 ? /* @__PURE__ */ new Map([["", {
|
|
1166
1159
|
uncompressed: t,
|
|
1167
1160
|
gzip: 0
|
|
1168
|
-
}]]) :
|
|
1161
|
+
}]]) : Xn(r, t, n);
|
|
1169
1162
|
e.set(q, {
|
|
1170
1163
|
sizes: {
|
|
1171
1164
|
uncompressed: t,
|
|
@@ -1174,84 +1167,84 @@ function rr(e, t, n, r) {
|
|
|
1174
1167
|
files: o
|
|
1175
1168
|
});
|
|
1176
1169
|
}
|
|
1177
|
-
function
|
|
1178
|
-
|
|
1170
|
+
function Xn(e, t, n) {
|
|
1171
|
+
Jn(e, n);
|
|
1179
1172
|
let r = /* @__PURE__ */ new Map();
|
|
1180
1173
|
for (let [t, n] of e) if (t === "src") for (let [e, t] of n.files) r.set(e, { ...t });
|
|
1181
1174
|
else {
|
|
1182
|
-
let e = n.files.size === 1 ?
|
|
1175
|
+
let e = n.files.size === 1 ? nr(t, rr(n.files)) : t;
|
|
1183
1176
|
r.set(e, { ...n.sizes });
|
|
1184
1177
|
}
|
|
1185
|
-
let i = r.values().reduce((e, t) => e + t.uncompressed, 0), a = r.get(K) ??
|
|
1178
|
+
let i = r.values().reduce((e, t) => e + t.uncompressed, 0), a = r.get(K) ?? X();
|
|
1186
1179
|
return a.uncompressed += Math.max(0, t - i), a.uncompressed > 0 && r.set(K, a), r;
|
|
1187
1180
|
}
|
|
1188
|
-
function
|
|
1181
|
+
function Zn(e, t, n, r, i) {
|
|
1189
1182
|
if (r.uncompressed -= i, t.sizes.uncompressed -= i, r.uncompressed <= 0 && t.files.delete(n), !(t.sizes.uncompressed > 0)) for (let [n, r] of e) r === t && e.delete(n);
|
|
1190
1183
|
}
|
|
1191
|
-
function
|
|
1184
|
+
function Qn(e, t) {
|
|
1192
1185
|
return e[0] === K == (t[0] === K) ? t[1].sizes.uncompressed - e[1].sizes.uncompressed : e[0] === K ? 1 : -1;
|
|
1193
1186
|
}
|
|
1194
|
-
function
|
|
1187
|
+
function $n(e, t, n) {
|
|
1195
1188
|
let r = [];
|
|
1196
1189
|
for (let [i, { sizes: a, files: o }] of e) {
|
|
1197
1190
|
if (o.size === 1) {
|
|
1198
|
-
let e =
|
|
1199
|
-
r.push(`| ${W}${
|
|
1191
|
+
let e = rr(o);
|
|
1192
|
+
r.push(`| ${W}${nr(i, e)} | ${Y(a.uncompressed, t)} |`);
|
|
1200
1193
|
continue;
|
|
1201
1194
|
}
|
|
1202
|
-
r.push(`| ${W}${i} | ${Y(a.uncompressed, t)} |`), n || r.push(...
|
|
1195
|
+
r.push(`| ${W}${i} | ${Y(a.uncompressed, t)} |`), n || r.push(...er(o, t));
|
|
1203
1196
|
}
|
|
1204
1197
|
return r;
|
|
1205
1198
|
}
|
|
1206
|
-
function
|
|
1207
|
-
let n = [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), r =
|
|
1199
|
+
function er(e, t) {
|
|
1200
|
+
let n = [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), r = tr(n, t), i = (r > 0 ? n.slice(0, -r) : n).map(([e, n]) => `| ${W}${W}↳ ${e} | ${Y(n.uncompressed, t, Nn)} |`);
|
|
1208
1201
|
if (r > 0) {
|
|
1209
1202
|
let e = n.slice(-r).reduce((e, [, t]) => e + t.uncompressed, 0);
|
|
1210
|
-
i.push(`| ${W}${W}↳ ${String(r)} smaller files | ${Y(e, t,
|
|
1203
|
+
i.push(`| ${W}${W}↳ ${String(r)} smaller files | ${Y(e, t, Nn)} |`);
|
|
1211
1204
|
}
|
|
1212
1205
|
return i;
|
|
1213
1206
|
}
|
|
1214
|
-
function
|
|
1207
|
+
function tr(e, t) {
|
|
1215
1208
|
if (t <= 0) return 0;
|
|
1216
1209
|
let n = 0, r = 0;
|
|
1217
1210
|
for (let [, i] of e.toReversed()) {
|
|
1218
|
-
let e = i.uncompressed / t * 100 <
|
|
1211
|
+
let e = i.uncompressed / t * 100 < Pn, a = (r + i.uncompressed) / t * 100 <= Fn;
|
|
1219
1212
|
if (!e || !a) break;
|
|
1220
1213
|
n++, r += i.uncompressed;
|
|
1221
1214
|
}
|
|
1222
1215
|
return n >= 2 ? n : 0;
|
|
1223
1216
|
}
|
|
1224
|
-
function Y(e, t, n =
|
|
1225
|
-
return `${
|
|
1217
|
+
function Y(e, t, n = Mn) {
|
|
1218
|
+
return `${dr(t > 0 ? e / t * 100 : 0, n)} · ${Q(e)}`;
|
|
1226
1219
|
}
|
|
1227
|
-
function
|
|
1220
|
+
function nr(e, t) {
|
|
1228
1221
|
return t === "" ? e : `${e} → ${t}`;
|
|
1229
1222
|
}
|
|
1230
|
-
function
|
|
1223
|
+
function rr(e) {
|
|
1231
1224
|
let [t] = e.keys();
|
|
1232
1225
|
if (t === void 0) throw Error("Expected exactly one file");
|
|
1233
1226
|
return t;
|
|
1234
1227
|
}
|
|
1235
|
-
function
|
|
1236
|
-
let t =
|
|
1228
|
+
function ir(e) {
|
|
1229
|
+
let t = ar(e.dependencies), n = /* @__PURE__ */ new Map();
|
|
1237
1230
|
for (let r of e.resources) {
|
|
1238
1231
|
if (r.kind !== "chunk" || !r.parent) continue;
|
|
1239
|
-
let { group: e, file: i } =
|
|
1232
|
+
let { group: e, file: i } = or(r.name, t), a = lr(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
|
|
1240
1233
|
n.set(r.parent, o);
|
|
1241
1234
|
let s = o.get(e) ?? {
|
|
1242
|
-
sizes:
|
|
1235
|
+
sizes: X(),
|
|
1243
1236
|
files: /* @__PURE__ */ new Map()
|
|
1244
1237
|
};
|
|
1245
|
-
o.set(e, s),
|
|
1246
|
-
let c = s.files.get(i) ??
|
|
1247
|
-
s.files.set(i, c),
|
|
1238
|
+
o.set(e, s), Z(s.sizes, a);
|
|
1239
|
+
let c = s.files.get(i) ?? X();
|
|
1240
|
+
s.files.set(i, c), Z(c, a);
|
|
1248
1241
|
}
|
|
1249
1242
|
return n;
|
|
1250
1243
|
}
|
|
1251
|
-
function
|
|
1244
|
+
function ar(e) {
|
|
1252
1245
|
return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
|
|
1253
1246
|
}
|
|
1254
|
-
function
|
|
1247
|
+
function or(e, t) {
|
|
1255
1248
|
let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
|
|
1256
1249
|
if (n) {
|
|
1257
1250
|
let [t, r] = n;
|
|
@@ -1268,42 +1261,42 @@ function mr(e, t) {
|
|
|
1268
1261
|
file: e.slice(1)
|
|
1269
1262
|
} : e.startsWith("rust/") ? {
|
|
1270
1263
|
group: "wasm",
|
|
1271
|
-
file:
|
|
1264
|
+
file: sr(e)
|
|
1272
1265
|
} : {
|
|
1273
1266
|
group: "src",
|
|
1274
|
-
file:
|
|
1267
|
+
file: cr(e)
|
|
1275
1268
|
};
|
|
1276
1269
|
}
|
|
1277
|
-
function
|
|
1278
|
-
let t = e.split("/", 2)[1] ?? "", n =
|
|
1270
|
+
function sr(e) {
|
|
1271
|
+
let t = e.split("/", 2)[1] ?? "", n = cr(e);
|
|
1279
1272
|
return t !== "" && n.startsWith(t) ? `…${n.slice(t.length)}` : n;
|
|
1280
1273
|
}
|
|
1281
|
-
function
|
|
1274
|
+
function cr(e) {
|
|
1282
1275
|
return e.split("/").at(-1) ?? e;
|
|
1283
1276
|
}
|
|
1284
|
-
function
|
|
1277
|
+
function lr(e) {
|
|
1285
1278
|
return {
|
|
1286
1279
|
uncompressed: e.uncompressed,
|
|
1287
1280
|
gzip: e.gzip ?? 0
|
|
1288
1281
|
};
|
|
1289
1282
|
}
|
|
1290
|
-
function
|
|
1283
|
+
function ur(e) {
|
|
1291
1284
|
return `${Q(e.uncompressed)} · gzip ${Q(e.gzip)}`;
|
|
1292
1285
|
}
|
|
1293
|
-
function
|
|
1286
|
+
function dr(e, t = Mn) {
|
|
1294
1287
|
let n = Math.round(e / 100 * G);
|
|
1295
1288
|
return `\`${t.repeat(n)}${"░".repeat(G - n)}\` ${e.toFixed(1)}%`;
|
|
1296
1289
|
}
|
|
1297
|
-
function
|
|
1290
|
+
function X() {
|
|
1298
1291
|
return {
|
|
1299
1292
|
uncompressed: 0,
|
|
1300
1293
|
gzip: 0
|
|
1301
1294
|
};
|
|
1302
1295
|
}
|
|
1303
|
-
function
|
|
1296
|
+
function Z(e, t) {
|
|
1304
1297
|
e.uncompressed += t.uncompressed, e.gzip += t.gzip;
|
|
1305
1298
|
}
|
|
1306
|
-
function
|
|
1299
|
+
function fr(e, t) {
|
|
1307
1300
|
return `${(e / t * 100).toFixed(1)}%`;
|
|
1308
1301
|
}
|
|
1309
1302
|
function Q(e) {
|
|
@@ -1311,12 +1304,12 @@ function Q(e) {
|
|
|
1311
1304
|
}
|
|
1312
1305
|
//#endregion
|
|
1313
1306
|
//#region src/actions/documentProject.ts
|
|
1314
|
-
async function
|
|
1307
|
+
async function pr(t = "MIT", n = !1) {
|
|
1315
1308
|
try {
|
|
1316
1309
|
let r = await S("config.json"), i = m(r.id).typeId === "connector";
|
|
1317
|
-
await
|
|
1310
|
+
await zt(), i && await Ge(), await Sn(), await ft(t), await e("bundle-analysis-reports/sonda/index.json") === null ? C(`ℹ️ Bundle sizes NOT documented, as there is no '${On}' yet. Build the project first.`) : await Hn({ moduleLevel: n }), await tn(), await Ke();
|
|
1318
1311
|
let a = await e(U) !== null;
|
|
1319
|
-
a ? await
|
|
1312
|
+
a ? await Dn() : C(`ℹ️ '${U}' NOT required by this project`), await o("ℹ️ Format generated files", "prettier", [
|
|
1320
1313
|
"--write",
|
|
1321
1314
|
"README.md",
|
|
1322
1315
|
...a ? [U] : []
|
|
@@ -1327,7 +1320,7 @@ async function xr(t = "MIT", n = !1) {
|
|
|
1327
1320
|
}
|
|
1328
1321
|
//#endregion
|
|
1329
1322
|
//#region src/actions/formatCode.ts
|
|
1330
|
-
async function
|
|
1323
|
+
async function mr() {
|
|
1331
1324
|
try {
|
|
1332
1325
|
s("Format Code");
|
|
1333
1326
|
let e = [
|
|
@@ -1348,7 +1341,7 @@ async function Sr() {
|
|
|
1348
1341
|
}
|
|
1349
1342
|
//#endregion
|
|
1350
1343
|
//#region src/actions/lintCode.ts
|
|
1351
|
-
async function
|
|
1344
|
+
async function hr() {
|
|
1352
1345
|
try {
|
|
1353
1346
|
s("Lint Code"), await o("1️⃣ Lint", "eslint", ["."]), b("Code linted");
|
|
1354
1347
|
} catch (e) {
|
|
@@ -1357,9 +1350,7 @@ async function Cr() {
|
|
|
1357
1350
|
}
|
|
1358
1351
|
//#endregion
|
|
1359
1352
|
//#region src/utilities/cloudflare.ts
|
|
1360
|
-
var
|
|
1361
|
-
t.exports = {};
|
|
1362
|
-
})))(), 1), Tr = "dpuse-sample-data-eu", Er = {
|
|
1353
|
+
var gr = "dpuse-sample-data-eu", _r = {
|
|
1363
1354
|
bin: "application/octet-stream",
|
|
1364
1355
|
csv: "text/csv",
|
|
1365
1356
|
json: "application/json",
|
|
@@ -1370,7 +1361,7 @@ var wr = /* @__PURE__ */ we((/* @__PURE__ */ Se(((e, t) => {
|
|
|
1370
1361
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
1371
1362
|
xml: "application/xml"
|
|
1372
1363
|
};
|
|
1373
|
-
async function
|
|
1364
|
+
async function vr() {
|
|
1374
1365
|
let e = await S("config.json"), t = {
|
|
1375
1366
|
body: JSON.stringify(e),
|
|
1376
1367
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1379,11 +1370,11 @@ async function Dr() {
|
|
|
1379
1370
|
if (!n.ok) throw Error(await n.text());
|
|
1380
1371
|
}
|
|
1381
1372
|
async function $(e, t) {
|
|
1382
|
-
let n = await
|
|
1383
|
-
for (let [e, t] of r) await
|
|
1373
|
+
let n = await Cr(`${e}/${t}`, t), r = Map.groupBy(n, ({ key: e }) => wr(e));
|
|
1374
|
+
for (let [e, t] of r) await Sr(t, ["--content-type", e]);
|
|
1384
1375
|
}
|
|
1385
|
-
async function
|
|
1386
|
-
await $(e, "application"), await $(e, "fileStore"), await
|
|
1376
|
+
async function yr(e) {
|
|
1377
|
+
await $(e, "application"), await $(e, "fileStore"), await Sr(["applicationIndex.json", "fileStoreIndex.json"].map((t) => ({
|
|
1387
1378
|
file: `${e}/${t}`,
|
|
1388
1379
|
key: t
|
|
1389
1380
|
})), [
|
|
@@ -1393,7 +1384,7 @@ async function Or(e) {
|
|
|
1393
1384
|
"no-cache"
|
|
1394
1385
|
]);
|
|
1395
1386
|
}
|
|
1396
|
-
async function
|
|
1387
|
+
async function br(e) {
|
|
1397
1388
|
let t = e.id, n = {
|
|
1398
1389
|
body: JSON.stringify(e),
|
|
1399
1390
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1401,7 +1392,7 @@ async function kr(e) {
|
|
|
1401
1392
|
}, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
|
|
1402
1393
|
if (!r.ok) throw Error(await r.text());
|
|
1403
1394
|
}
|
|
1404
|
-
async function
|
|
1395
|
+
async function xr(e, t) {
|
|
1405
1396
|
let n = `v${e.version ?? "unknown"}`;
|
|
1406
1397
|
async function r(e, r = "") {
|
|
1407
1398
|
let i = await ee(e, { withFileTypes: !0 });
|
|
@@ -1423,15 +1414,15 @@ async function Ar(e, t) {
|
|
|
1423
1414
|
}
|
|
1424
1415
|
await r("dist");
|
|
1425
1416
|
}
|
|
1426
|
-
async function
|
|
1417
|
+
async function Sr(e, t) {
|
|
1427
1418
|
if (e.length === 0) return;
|
|
1428
|
-
let n = await w.mkdtemp(T.join(
|
|
1419
|
+
let n = await w.mkdtemp(T.join(ge.tmpdir(), "dpuse-r2-bulk-")), r = T.join(n, "files.json");
|
|
1429
1420
|
try {
|
|
1430
1421
|
await i(r, e), console.info(`⚙️ Uploading ${String(e.length)} files (${t.join(" ")})...`), await y(void 0, "wrangler", [
|
|
1431
1422
|
"r2",
|
|
1432
1423
|
"bulk",
|
|
1433
1424
|
"put",
|
|
1434
|
-
|
|
1425
|
+
gr,
|
|
1435
1426
|
"--filename",
|
|
1436
1427
|
r,
|
|
1437
1428
|
...t,
|
|
@@ -1445,55 +1436,55 @@ async function jr(e, t) {
|
|
|
1445
1436
|
});
|
|
1446
1437
|
}
|
|
1447
1438
|
}
|
|
1448
|
-
async function
|
|
1439
|
+
async function Cr(e, t) {
|
|
1449
1440
|
let n = await ee(e), r = [];
|
|
1450
1441
|
for (let i of n) {
|
|
1451
1442
|
if (i.startsWith(".")) continue;
|
|
1452
1443
|
let n = `${e}/${i}`, a = `${t}/${i}`;
|
|
1453
|
-
(await p(n)).isDirectory() ? r.push(...await
|
|
1444
|
+
(await p(n)).isDirectory() ? r.push(...await Cr(n, a)) : r.push({
|
|
1454
1445
|
file: n,
|
|
1455
1446
|
key: a
|
|
1456
1447
|
});
|
|
1457
1448
|
}
|
|
1458
1449
|
return r;
|
|
1459
1450
|
}
|
|
1460
|
-
function
|
|
1451
|
+
function wr(e) {
|
|
1461
1452
|
let t = e.slice(e.lastIndexOf("/") + 1), n = t.lastIndexOf(".");
|
|
1462
1453
|
if (n === -1) return t === "LICENSE" ? "text/plain" : "application/octet-stream";
|
|
1463
|
-
let r =
|
|
1454
|
+
let r = _r[t.slice(n + 1).toLowerCase()];
|
|
1464
1455
|
if (r === void 0) throw Error(`No content type for '${e}'. Add its extension to 'SAMPLE_DATA_CONTENT_TYPES'.`);
|
|
1465
1456
|
return r;
|
|
1466
1457
|
}
|
|
1467
1458
|
//#endregion
|
|
1468
1459
|
//#region src/actions/publishProject.ts
|
|
1469
|
-
async function
|
|
1460
|
+
async function Tr() {
|
|
1470
1461
|
try {
|
|
1471
1462
|
s("Publish Project");
|
|
1472
1463
|
let e = await S("package.json"), t = await S("config.json"), n = m(t.id);
|
|
1473
|
-
n.publishedTo === "npm" ? await o("1️⃣ Publish to npm", "npm", ["publish", "--provenance"]) : C("1️⃣ Publishing to npm NOT required"), await
|
|
1464
|
+
n.publishedTo === "npm" ? await o("1️⃣ Publish to npm", "npm", ["publish", "--provenance"]) : C("1️⃣ Publishing to npm NOT required"), await Er("2️⃣ ", e, t, n), n.publishedTo === "kb" ? await o("3️⃣ Deploy", "npm", ["run", "deploy"]) : n.publishedTo === "sampleData" && (C("3️⃣ Upload sample data"), await yr("public")), b(`Project version '${e.version ?? "unknown"}' published.`);
|
|
1474
1465
|
} catch (e) {
|
|
1475
1466
|
console.error("❌ Error publishing project", e), process.exit(1);
|
|
1476
1467
|
}
|
|
1477
1468
|
}
|
|
1478
|
-
async function
|
|
1479
|
-
if (r.typeId === "app") C(`${e} Register module`), await
|
|
1480
|
-
else if (r.typeId === "engine") C(`${e} Register module`), await
|
|
1469
|
+
async function Er(e, t, n, r) {
|
|
1470
|
+
if (r.typeId === "app") C(`${e} Register module`), await vr();
|
|
1471
|
+
else if (r.typeId === "engine") C(`${e} Register module`), await xr(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await br(n);
|
|
1481
1472
|
else if (r.uploadGroupName === void 0) C(`${e} Registration NOT required`);
|
|
1482
1473
|
else {
|
|
1483
1474
|
C(`${e} Register module`);
|
|
1484
1475
|
let i = n.id.split("-").slice(2).join("-");
|
|
1485
|
-
await
|
|
1476
|
+
await xr(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await br(n);
|
|
1486
1477
|
}
|
|
1487
1478
|
}
|
|
1488
1479
|
//#endregion
|
|
1489
1480
|
//#region src/actions/releaseProject.ts
|
|
1490
|
-
async function
|
|
1481
|
+
async function Dr(e = "MIT", t = !1) {
|
|
1491
1482
|
try {
|
|
1492
1483
|
s("Release Project");
|
|
1493
1484
|
let n = await S("package.json"), r = await S("config.json"), i = m(r.id);
|
|
1494
1485
|
await d("1️⃣ ", n);
|
|
1495
1486
|
let a = await oe("2️⃣ ", n, i);
|
|
1496
|
-
if (await
|
|
1487
|
+
if (await Ee("3️⃣ ", n), C("4️⃣ Regenerate README"), await pr(e, t), await y("5️⃣ Stage changes", "git", ["add", "."]), await y("6️⃣ Commit changes", "git", [
|
|
1497
1488
|
"commit",
|
|
1498
1489
|
"-m",
|
|
1499
1490
|
`v${n.version ?? "unknown"}`
|
|
@@ -1501,7 +1492,7 @@ async function Ir(e = "MIT", t = !1) {
|
|
|
1501
1492
|
"push",
|
|
1502
1493
|
"origin",
|
|
1503
1494
|
"main:main"
|
|
1504
|
-
]), await
|
|
1495
|
+
]), await Er("8️⃣ ", n, a, i), i.publishedTo === "npm") {
|
|
1505
1496
|
let e = `v${n.version ?? "unknown"}`;
|
|
1506
1497
|
await o("9️⃣ Trigger GitHub release", "gh", [
|
|
1507
1498
|
"release",
|
|
@@ -1520,7 +1511,7 @@ async function Ir(e = "MIT", t = !1) {
|
|
|
1520
1511
|
}
|
|
1521
1512
|
//#endregion
|
|
1522
1513
|
//#region src/actions/syncProjectWithGitHub.ts
|
|
1523
|
-
async function
|
|
1514
|
+
async function Or() {
|
|
1524
1515
|
try {
|
|
1525
1516
|
s("Synchronise Project with GitHub");
|
|
1526
1517
|
let e = await S("package.json"), t = await S("config.json"), n = m(t.id);
|
|
@@ -1539,12 +1530,12 @@ async function Lr() {
|
|
|
1539
1530
|
}
|
|
1540
1531
|
//#endregion
|
|
1541
1532
|
//#region src/actions/testProject.ts
|
|
1542
|
-
var
|
|
1533
|
+
var kr = [
|
|
1543
1534
|
"1️⃣ ",
|
|
1544
1535
|
"2️⃣ ",
|
|
1545
1536
|
"3️⃣ ",
|
|
1546
1537
|
"4️⃣ "
|
|
1547
|
-
],
|
|
1538
|
+
], Ar = [{
|
|
1548
1539
|
id: "unit",
|
|
1549
1540
|
label: "Run unit tests",
|
|
1550
1541
|
command: "vitest",
|
|
@@ -1557,13 +1548,13 @@ var Rr = [
|
|
|
1557
1548
|
arguments: ["test", "--pass-with-no-tests"],
|
|
1558
1549
|
configFileName: "playwright.config.ts"
|
|
1559
1550
|
}];
|
|
1560
|
-
async function
|
|
1551
|
+
async function jr(t = ["unit"]) {
|
|
1561
1552
|
try {
|
|
1562
1553
|
s("Test Project");
|
|
1563
1554
|
let n = 0;
|
|
1564
|
-
for (let r of
|
|
1555
|
+
for (let r of Ar) {
|
|
1565
1556
|
if (!t.includes(r.id) || await e(r.configFileName) === null) continue;
|
|
1566
|
-
let i = `${
|
|
1557
|
+
let i = `${kr[n] ?? ""} ${r.label}`;
|
|
1567
1558
|
await o(i, r.command, r.arguments), n += 1;
|
|
1568
1559
|
}
|
|
1569
1560
|
if (n === 0) {
|
|
@@ -1577,7 +1568,7 @@ async function Br(t = ["unit"]) {
|
|
|
1577
1568
|
}
|
|
1578
1569
|
//#endregion
|
|
1579
1570
|
//#region src/actions/triggerGitHubRelease.ts
|
|
1580
|
-
async function
|
|
1571
|
+
async function Mr() {
|
|
1581
1572
|
try {
|
|
1582
1573
|
s("Trigger GitHub Release");
|
|
1583
1574
|
let e = `v${(await S("package.json")).version ?? "unknown"}`;
|
|
@@ -1595,4 +1586,4 @@ async function Vr() {
|
|
|
1595
1586
|
}
|
|
1596
1587
|
}
|
|
1597
1588
|
//#endregion
|
|
1598
|
-
export {
|
|
1589
|
+
export { ye as auditDependencies, Te as buildProject, ze as checkProject, pr as documentProject, mr as formatCode, hr as lintCode, Tr as publishProject, Dr as releaseProject, Or as syncProjectWithGitHub, jr as testProject, Mr as triggerGitHubRelease, $ as uploadDirectoryToR2 };
|