@dpuse/dpuse-development 1.0.6 → 1.0.108
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 +15 -12
- package/dist/dpuse-development.es.js +329 -327
- package/dist/dpuse-development.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { C as e, D as t, E as n, M as r, O as i, S as a, T as o, _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, j as g, k as _, l as v, m as y, n as ee, o as te, p as b, r as ne, s as re, t as ie, u as
|
|
2
|
-
import { SHIPPED_PACKAGES_FILE_NAME as
|
|
3
|
-
import { existsSync as
|
|
4
|
-
import
|
|
5
|
-
import { promisify as
|
|
6
|
-
import { execFile as
|
|
7
|
-
import { fileURLToPath as
|
|
8
|
-
import { run as
|
|
9
|
-
import { init as
|
|
10
|
-
import { setTimeout as
|
|
11
|
-
import
|
|
1
|
+
import { C as e, D as t, E as n, M as r, O as i, S as a, T as o, _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, j as g, k as _, l as v, m as y, n as ee, o as te, p as b, r as ne, s as re, t as ie, u as x, v as S, w as C, x as w, y as T } from "./utilities-BLjGg0iM.js";
|
|
2
|
+
import { SHIPPED_PACKAGES_FILE_NAME as ae } from "./vite.es.js";
|
|
3
|
+
import { existsSync as oe, promises as E } from "node:fs";
|
|
4
|
+
import D from "node:path";
|
|
5
|
+
import { promisify as se } from "node:util";
|
|
6
|
+
import { execFile as ce } from "node:child_process";
|
|
7
|
+
import { fileURLToPath as le } from "node:url";
|
|
8
|
+
import { run as ue } from "npm-check-updates";
|
|
9
|
+
import { init as de } from "license-checker-rseidelsohn";
|
|
10
|
+
import { setTimeout as fe } from "node:timers/promises";
|
|
11
|
+
import pe from "spdx-satisfies";
|
|
12
12
|
//#region src/actions/auditDependencies_.json
|
|
13
|
-
var
|
|
13
|
+
var me = [
|
|
14
14
|
{
|
|
15
15
|
id: "GHSA-ch52-4w7c-c8xp",
|
|
16
16
|
reason: "'http-cache-semantics', used by the licence checker, which only reads the npm registry locally, with no shared cache to leak from",
|
|
@@ -26,75 +26,75 @@ var he = [
|
|
|
26
26
|
reason: "'braces', used by ESLint's file matching in dpuse-app, which only reads glob patterns from the project's own config",
|
|
27
27
|
reviewBy: "2026-12-31"
|
|
28
28
|
}
|
|
29
|
-
],
|
|
30
|
-
async function
|
|
29
|
+
], he = /* @__PURE__ */ new Set(["critical", "high"]);
|
|
30
|
+
async function ge() {
|
|
31
31
|
try {
|
|
32
32
|
s("Audit Dependencies");
|
|
33
|
-
let e = await
|
|
34
|
-
ne.has(e.name ?? "") ?
|
|
33
|
+
let e = await w("package.json");
|
|
34
|
+
ne.has(e.name ?? "") ? T(`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"]);
|
|
35
35
|
let t = await n("2️⃣ Check all dependencies for high or critical vulnerabilities", "npm", ["audit", "--json"]), r = JSON.parse(t);
|
|
36
36
|
if (r.error !== void 0) throw Error(r.error.summary);
|
|
37
|
-
let i = ve(
|
|
37
|
+
let i = _e(ve(r));
|
|
38
38
|
if (i.length > 0) throw Error(`${String(i.length)} high or critical vulnerabilities found`);
|
|
39
|
-
|
|
39
|
+
S("Dependencies audited");
|
|
40
40
|
} catch (e) {
|
|
41
41
|
console.error("❌ Error auditing dependencies", e), process.exit(1);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function _e(e) {
|
|
45
45
|
let t = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), n = [];
|
|
46
46
|
for (let r of e) {
|
|
47
|
-
if (!
|
|
48
|
-
let e = r.url.slice(r.url.lastIndexOf("/") + 1), i =
|
|
47
|
+
if (!he.has(r.severity)) continue;
|
|
48
|
+
let e = r.url.slice(r.url.lastIndexOf("/") + 1), i = me.find((t) => t.id === e);
|
|
49
49
|
i === void 0 ? (console.error(`❌ ${r.severity} '${r.name}': ${r.title} (${r.url})`), n.push(r)) : i.reviewBy < t ? console.warn(`⚠️ Ignored ${e}, but its review date ${i.reviewBy} has passed: ${i.reason}`) : console.info(`ℹ️ Ignored ${e}: ${i.reason}`);
|
|
50
50
|
}
|
|
51
51
|
return n;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function ve(e) {
|
|
54
54
|
let t = /* @__PURE__ */ new Map(), n = Object.values(e.vulnerabilities ?? {});
|
|
55
55
|
for (let e of n) for (let n of e.via) typeof n != "string" && t.set(n.url, n);
|
|
56
56
|
return t.values().toArray();
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/actions/buildProject.ts
|
|
60
|
-
var
|
|
61
|
-
async function
|
|
60
|
+
var ye = "build:wasm";
|
|
61
|
+
async function be() {
|
|
62
62
|
try {
|
|
63
|
-
s("Build Project"), await
|
|
63
|
+
s("Build Project"), await xe("1️⃣ ", await w("package.json")), S("Project built");
|
|
64
64
|
} catch (e) {
|
|
65
65
|
console.error("❌ Error building project", e), process.exit(1);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
async function
|
|
69
|
-
t.scripts?.[
|
|
68
|
+
async function xe(e, t) {
|
|
69
|
+
t.scripts?.[ye] != null && await o(`${e} Build WebAssembly`, "npm", ["run", ye]), await o(`${e} Bundle project`, "vite", ["build"]);
|
|
70
70
|
}
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/actions/checkConfigFiles.ts
|
|
73
|
-
var
|
|
74
|
-
async function
|
|
73
|
+
var O = "@dpuse/dpuse-development/prettierrc", Se = "dpuse-development";
|
|
74
|
+
async function Ce() {
|
|
75
75
|
try {
|
|
76
|
-
s("Check configuration files"),
|
|
77
|
-
let t = await
|
|
78
|
-
await
|
|
76
|
+
s("Check configuration files"), T("1️⃣ Check individual files");
|
|
77
|
+
let t = await w("config.json"), n = await w("package.json"), r = n.private === !0, i = m(t.id), a = D.dirname(le(import.meta.url));
|
|
78
|
+
await k(a, ".editorconfig"), await k(a, ".gitattributes"), await k(a, ".gitignore", [".gitignore_default"]), await k(a, ".markdownlint.json"), await k(a, ".ncurc.json"), await we(i, a), await k(a, "LICENSE"), await Ee(i, a), await De(i, a), await Oe(i, a), await je(i, a), Te(i, n);
|
|
79
79
|
let o = await e(v) !== null;
|
|
80
|
-
o && await
|
|
80
|
+
o && await k(a, "rust-toolchain.toml"), await k(a, ".github/dependabot.yml", [`.github/dependabot${r ? ".private" : ""}${o ? ".rust" : ""}.yml`]), r ? await ke(a) : (await Ae(a), await k(a, "SECURITY.md", [], (e) => e.replaceAll(Se, () => t.id))), S("Configuration files checked");
|
|
81
81
|
} catch (e) {
|
|
82
82
|
console.error("❌ Error checking configuration files", e), process.exit(1);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
async function
|
|
85
|
+
async function we(e, t) {
|
|
86
86
|
["github"].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is NOT required by this project") : [
|
|
87
87
|
"app",
|
|
88
88
|
"api",
|
|
89
89
|
"development",
|
|
90
90
|
"eslint",
|
|
91
91
|
"kb"
|
|
92
|
-
].includes(e.typeId) ? console.info("⚠️ File 'eslint.config.js' is UNIQUE to this project") : await
|
|
92
|
+
].includes(e.typeId) ? console.info("⚠️ File 'eslint.config.js' is UNIQUE to this project") : await k(t, "eslint.config.js", ["eslint.config.default.js"]);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
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 ===
|
|
94
|
+
function Te(e, t) {
|
|
95
|
+
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 === O ? console.info(`ℹ️ Prettier configuration is '${O}'`) : console.info(`❌ Prettier configuration is NOT '${O}'`);
|
|
96
96
|
}
|
|
97
|
-
async function
|
|
97
|
+
async function Ee(e, t) {
|
|
98
98
|
["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.json' is NOT required by this project") : [
|
|
99
99
|
"connector",
|
|
100
100
|
"cookbook",
|
|
@@ -103,12 +103,12 @@ async function De(e, t) {
|
|
|
103
103
|
"presenter",
|
|
104
104
|
"shared",
|
|
105
105
|
"tool"
|
|
106
|
-
].includes(e.typeId) ? await
|
|
106
|
+
].includes(e.typeId) ? await k(t, "tsconfig.json") : console.info("⚠️ File 'tsconfig.json' is UNIQUE to this project");
|
|
107
107
|
}
|
|
108
|
-
async function
|
|
109
|
-
["github"].includes(e.typeId) ? console.info("ℹ️ File 'scripts/tsconfig.json' is NOT required by this project") : await
|
|
108
|
+
async function De(e, t) {
|
|
109
|
+
["github"].includes(e.typeId) ? console.info("ℹ️ File 'scripts/tsconfig.json' is NOT required by this project") : await k(t, "scripts/tsconfig.json");
|
|
110
110
|
}
|
|
111
|
-
async function
|
|
111
|
+
async function Oe(e, t) {
|
|
112
112
|
if ([
|
|
113
113
|
"eslint",
|
|
114
114
|
"github",
|
|
@@ -131,26 +131,26 @@ async function ke(e, t) {
|
|
|
131
131
|
break;
|
|
132
132
|
default: n = ["vite.config.default.ts"];
|
|
133
133
|
}
|
|
134
|
-
await
|
|
134
|
+
await k(t, "vite.config.ts", n);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
async function
|
|
138
|
-
for (let n of [".github/workflows/ci.yml", ".github/workflows/publish.yml"]) await e(n) !== null && await
|
|
137
|
+
async function ke(t) {
|
|
138
|
+
for (let n of [".github/workflows/ci.yml", ".github/workflows/publish.yml"]) await e(n) !== null && await k(t, n);
|
|
139
139
|
console.info("ℹ️ CodeQL and Scorecard workflows and file 'SECURITY.md' are NOT required by this project");
|
|
140
140
|
}
|
|
141
|
-
async function
|
|
142
|
-
await
|
|
141
|
+
async function Ae(e) {
|
|
142
|
+
await k(e, ".github/workflows/ci.yml"), await k(e, ".github/workflows/codeql.yml"), await k(e, ".github/workflows/publish.yml"), await k(e, ".github/workflows/scorecard.yml");
|
|
143
143
|
}
|
|
144
|
-
async function
|
|
144
|
+
async function je(e, t) {
|
|
145
145
|
[
|
|
146
146
|
"app",
|
|
147
147
|
"api",
|
|
148
148
|
"github",
|
|
149
149
|
"kb"
|
|
150
|
-
].includes(e.typeId) ? console.info("ℹ️ File 'vitest.config.ts' is NOT required by this project") : await
|
|
150
|
+
].includes(e.typeId) ? console.info("ℹ️ File 'vitest.config.ts' is NOT required by this project") : await k(t, "vitest.config.ts");
|
|
151
151
|
}
|
|
152
|
-
async function
|
|
153
|
-
let i =
|
|
152
|
+
async function k(e, t, n = [], r = (e) => e) {
|
|
153
|
+
let i = D.resolve(process.cwd(), t), o = n.length > 0 ? n : [t], s;
|
|
154
154
|
try {
|
|
155
155
|
s = await a(i);
|
|
156
156
|
} catch (e) {
|
|
@@ -161,7 +161,7 @@ async function O(e, t, n = [], r = (e) => e) {
|
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
163
|
for (let n of o) {
|
|
164
|
-
let i =
|
|
164
|
+
let i = D.resolve(e, `../${n}`), o = r(await a(i));
|
|
165
165
|
if (s === o) {
|
|
166
166
|
console.info(`ℹ️ File '${t}' is the same as '${n}'`);
|
|
167
167
|
return;
|
|
@@ -171,16 +171,16 @@ async function O(e, t, n = [], r = (e) => e) {
|
|
|
171
171
|
}
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region src/actions/checkDependencies.ts
|
|
174
|
-
async function
|
|
174
|
+
async function Me() {
|
|
175
175
|
try {
|
|
176
|
-
s("Check Dependencies"), await o("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0),
|
|
176
|
+
s("Check Dependencies"), await o("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), T("2️⃣ Check using 'npm-check-updates'");
|
|
177
177
|
let e = {};
|
|
178
178
|
try {
|
|
179
|
-
e = await
|
|
179
|
+
e = await w(D.resolve(process.cwd(), ".ncurc.json"));
|
|
180
180
|
} catch (e) {
|
|
181
181
|
if (e.code !== "ENOENT") throw e;
|
|
182
182
|
}
|
|
183
|
-
await
|
|
183
|
+
await ue({
|
|
184
184
|
interactive: !0,
|
|
185
185
|
upgrade: !0,
|
|
186
186
|
dep: "dev,prod,peer,optional",
|
|
@@ -198,12 +198,12 @@ async function Ne() {
|
|
|
198
198
|
"--no-strict-allow-scripts",
|
|
199
199
|
"--no-fund"
|
|
200
200
|
], !0);
|
|
201
|
-
let t = await
|
|
201
|
+
let t = await Ne();
|
|
202
202
|
t.length > 0 ? await o("5️⃣ Move install-script pins to installed versions", "npm", [
|
|
203
203
|
"install-scripts",
|
|
204
204
|
"approve",
|
|
205
205
|
...t
|
|
206
|
-
]) :
|
|
206
|
+
]) : T("5️⃣ No pinned install-script approvals to move"), process.platform === "darwin" ? await o("6️⃣ Remove unused install-script entries", "npm", ["install-scripts", "prune"]) : T("6️⃣ Skipped removing unused install-script entries (macOS only)"), t.length > 0 && await o("7️⃣ Run install scripts skipped in steps 3 and 4", "npm", [
|
|
207
207
|
"rebuild",
|
|
208
208
|
...t,
|
|
209
209
|
"--no-strict-allow-scripts"
|
|
@@ -212,61 +212,61 @@ async function Ne() {
|
|
|
212
212
|
"--strict-allow-scripts",
|
|
213
213
|
"--no-audit",
|
|
214
214
|
"--no-fund"
|
|
215
|
-
]),
|
|
215
|
+
]), S("Dependencies checked");
|
|
216
216
|
} catch (e) {
|
|
217
217
|
console.error("❌ Error checking dependencies", e), process.exit(1);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
async function
|
|
221
|
-
let { allowScripts: e = {} } = await
|
|
220
|
+
async function Ne() {
|
|
221
|
+
let { allowScripts: e = {} } = await w(D.resolve(process.cwd(), "package.json")), t = Object.entries(e).filter(([e, t]) => t && e.lastIndexOf("@") > 0).map(([e]) => e.slice(0, e.lastIndexOf("@")));
|
|
222
222
|
return [...new Set(t)];
|
|
223
223
|
}
|
|
224
224
|
//#endregion
|
|
225
225
|
//#region src/actions/checkProject.ts
|
|
226
|
-
async function
|
|
227
|
-
await
|
|
226
|
+
async function Pe() {
|
|
227
|
+
await Ce(), await Me();
|
|
228
228
|
}
|
|
229
229
|
//#endregion
|
|
230
230
|
//#region src/actions/documentActions.ts
|
|
231
|
-
var
|
|
231
|
+
var Fe = "<!-- SUPPORTED_ACTIONS_START -->", Ie = "<!-- SUPPORTED_ACTIONS_END -->", Le = "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.", Re = {
|
|
232
232
|
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.",
|
|
233
233
|
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.",
|
|
234
234
|
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.",
|
|
235
235
|
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."
|
|
236
|
-
},
|
|
237
|
-
async function
|
|
236
|
+
}, ze = "The table below lists all connector actions and highlights those supported by this connector.";
|
|
237
|
+
async function Be() {
|
|
238
238
|
try {
|
|
239
|
-
s("Document Actions"),
|
|
240
|
-
let e = (await
|
|
241
|
-
await _(i,
|
|
239
|
+
s("Document Actions"), T("1️⃣ Insert actions description and table into 'README.md'");
|
|
240
|
+
let e = (await w("config.json")).actionNames ?? [], t = g(e), n = r(e), i = `## Supported Actions\n\n${Le}\n\n${Re[t]} ${ze}\n\n${n}`;
|
|
241
|
+
await _(i, Fe, Ie), S("Actions documented");
|
|
242
242
|
} catch (e) {
|
|
243
243
|
console.error("❌ Error documenting actions", e), process.exit(1);
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
//#endregion
|
|
247
247
|
//#region src/actions/documentContributingLicense.ts
|
|
248
|
-
async function
|
|
248
|
+
async function Ve() {
|
|
249
249
|
try {
|
|
250
250
|
s("Document Contributing & License");
|
|
251
|
-
let [e, t] = await Promise.all([
|
|
252
|
-
|
|
251
|
+
let [e, t] = await Promise.all([w("package.json"), w("config.json")]), { owner: n, repository: r } = C(e, "document contributing and license"), i = He(e), a = Ue(t.firstCreatedAt);
|
|
252
|
+
T("1️⃣ Insert contributing and license content into 'README.md'"), await l(), await _(We(n, r, i, a), ee, ie), S("Contributing & license documented");
|
|
253
253
|
} catch (e) {
|
|
254
254
|
console.error("❌ Error documenting contributing and license", e), process.exit(1);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function He(e) {
|
|
258
258
|
let t = e.author, n = typeof t == "string" ? t : t?.name;
|
|
259
259
|
if (n == null || n === "") throw Error("package.json 'author' field is required to document contributing and license.");
|
|
260
260
|
let r = n.indexOf("<"), i = r === -1 ? -1 : n.indexOf(">", r);
|
|
261
261
|
return i === -1 ? n.trim() : [n.slice(0, r).trim(), n.slice(i + 1).trim()].filter((e) => e !== "").join(" ");
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Ue(e) {
|
|
264
264
|
let t = (/* @__PURE__ */ new Date()).getFullYear();
|
|
265
265
|
if (e == null) return String(t);
|
|
266
266
|
let n = new Date(e).getFullYear();
|
|
267
267
|
return n === t ? String(t) : `${String(n)}-present`;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function We(e, t, n, r) {
|
|
270
270
|
return `## Contributing
|
|
271
271
|
|
|
272
272
|
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.
|
|
@@ -281,8 +281,8 @@ This project is licensed under the MIT License, permitting free use, modificatio
|
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
283
|
//#region src/utilities/rustCrates.ts
|
|
284
|
-
var
|
|
285
|
-
async function
|
|
284
|
+
var A = "licenses/cargoMetadata.json", j = "licenses/cargoTree.txt", Ge = 1e3, Ke = 1e4, qe = "dpuse-development (https://github.com/dpuse/dpuse-development)", Je = /^(?:copying|licen[cs]e|unlicense)/i, Ye = "wasm32-unknown-unknown";
|
|
285
|
+
async function Xe(n, r) {
|
|
286
286
|
if (await e("rust/Cargo.toml") === null) return null;
|
|
287
287
|
let i = [
|
|
288
288
|
"--manifest-path",
|
|
@@ -295,22 +295,22 @@ async function Ze(n, r) {
|
|
|
295
295
|
"--edges",
|
|
296
296
|
"normal,no-proc-macro",
|
|
297
297
|
"--target",
|
|
298
|
-
|
|
298
|
+
Ye,
|
|
299
299
|
"--prefix",
|
|
300
300
|
"depth",
|
|
301
301
|
"--format",
|
|
302
302
|
"{p}|{l}|{r}"
|
|
303
303
|
];
|
|
304
|
-
await t(n, "cargo", o,
|
|
304
|
+
await t(n, "cargo", o, j), await t(n, "cargo", [
|
|
305
305
|
"metadata",
|
|
306
306
|
...i,
|
|
307
307
|
"--format-version",
|
|
308
308
|
"1",
|
|
309
309
|
"--filter-platform",
|
|
310
|
-
|
|
311
|
-
],
|
|
312
|
-
let s =
|
|
313
|
-
await
|
|
310
|
+
Ye
|
|
311
|
+
], A);
|
|
312
|
+
let s = Ze(await a(j)), c = await w(A);
|
|
313
|
+
await E.rm(j, { force: !0 }), await E.rm(A, { force: !0 });
|
|
314
314
|
let l = /* @__PURE__ */ new Map();
|
|
315
315
|
for (let e of s) e.isOwn || l.has(`${e.name}@${e.version}`) || l.set(`${e.name}@${e.version}`, {
|
|
316
316
|
name: e.name,
|
|
@@ -323,9 +323,9 @@ async function Ze(n, r) {
|
|
|
323
323
|
latestPublishedDate: ""
|
|
324
324
|
});
|
|
325
325
|
let u = l.values().toArray();
|
|
326
|
-
|
|
327
|
-
for (let e of u) e.licenseFiles = await
|
|
328
|
-
return await
|
|
326
|
+
Qe(u, r);
|
|
327
|
+
for (let e of u) e.licenseFiles = await tt(e, c);
|
|
328
|
+
return await nt(n, u), {
|
|
329
329
|
crates: u,
|
|
330
330
|
treeItems: s.map(({ name: e, version: t, depth: n, isOwn: r }) => ({
|
|
331
331
|
name: e,
|
|
@@ -335,7 +335,7 @@ async function Ze(n, r) {
|
|
|
335
335
|
}))
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Ze(e) {
|
|
339
339
|
let t = [];
|
|
340
340
|
for (let n of e.split("\n")) {
|
|
341
341
|
let [e = "", r = "", i = ""] = n.trim().split("|", 3), a = /^\d+/.exec(e)?.[0];
|
|
@@ -352,49 +352,49 @@ function Qe(e) {
|
|
|
352
352
|
}
|
|
353
353
|
return t;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
let n = t.split(";").filter((e) =>
|
|
355
|
+
function Qe(e, t) {
|
|
356
|
+
let n = t.split(";").filter((e) => $e(e)), r = e.filter((e) => !et(e.licenseExpression, n));
|
|
357
357
|
if (r.length === 0) return;
|
|
358
358
|
let i = r.map((e) => `${e.name}@${e.version} (${e.licenseExpression === "" ? "no licence" : e.licenseExpression})`).join(", ");
|
|
359
359
|
throw Error(`Rust crates with licences not allowed: ${i}.`);
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function $e(e) {
|
|
362
362
|
try {
|
|
363
|
-
return
|
|
363
|
+
return pe(e, [e]);
|
|
364
364
|
} catch {
|
|
365
365
|
return !1;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function et(e, t) {
|
|
369
369
|
try {
|
|
370
|
-
return
|
|
370
|
+
return pe(e.replaceAll("/", " OR "), t);
|
|
371
371
|
} catch {
|
|
372
372
|
return !1;
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
-
async function
|
|
375
|
+
async function tt(e, t) {
|
|
376
376
|
let n = t.packages.find((t) => t.name === e.name && t.version === e.version);
|
|
377
377
|
if (n == null) return [];
|
|
378
|
-
let r =
|
|
379
|
-
await
|
|
378
|
+
let r = D.dirname(n.manifest_path), i = (await E.readdir(r)).filter((e) => Je.test(e)).toSorted((e, t) => e.localeCompare(t, "en"));
|
|
379
|
+
await E.mkdir("licenses/downloads", { recursive: !0 });
|
|
380
380
|
let a = [];
|
|
381
381
|
for (let t of i) {
|
|
382
382
|
let n = `downloads/${e.name}@${e.version}-${t}`;
|
|
383
|
-
await
|
|
383
|
+
await E.copyFile(D.join(r, t), D.join("licenses", n)), a.push({
|
|
384
384
|
label: t,
|
|
385
385
|
path: n
|
|
386
386
|
});
|
|
387
387
|
}
|
|
388
388
|
return a;
|
|
389
389
|
}
|
|
390
|
-
async function
|
|
391
|
-
|
|
390
|
+
async function nt(e, t) {
|
|
391
|
+
T(`${e} - fetch release dates from crates.io`);
|
|
392
392
|
for (let [e, n] of t.entries()) {
|
|
393
|
-
e > 0 && await
|
|
393
|
+
e > 0 && await fe(Ge), console.info(`⚙️ Fetching '${n.name}' (${String(e + 1)} of ${String(t.length)})...`);
|
|
394
394
|
try {
|
|
395
395
|
let e = await fetch(`https://crates.io/api/v1/crates/${encodeURIComponent(n.name)}`, {
|
|
396
|
-
headers: { "User-Agent":
|
|
397
|
-
signal: AbortSignal.timeout(
|
|
396
|
+
headers: { "User-Agent": qe },
|
|
397
|
+
signal: AbortSignal.timeout(Ke)
|
|
398
398
|
});
|
|
399
399
|
if (!e.ok) continue;
|
|
400
400
|
let t = await e.json(), r = new Map((t.versions ?? []).map((e) => [e.num, e.created_at]));
|
|
@@ -404,75 +404,77 @@ async function rt(e, t) {
|
|
|
404
404
|
}
|
|
405
405
|
//#endregion
|
|
406
406
|
//#region src/actions/documentDependencies.ts
|
|
407
|
-
var
|
|
407
|
+
var M = "<!-- DEPENDENCY_LICENSES_START -->", N = "<!-- DEPENDENCY_LICENSES_END -->", P = "## Dependency Licenses", rt = `bundle-analysis-reports/${ae}`, F = "licenses/licenseTree.json", it = "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.", at = `The dependency tree below lists every package in this project — direct and transitive — along with its installed version, release date, and update status. ${it}`, ot = `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. ${it}`;
|
|
408
408
|
async function st(e = "MIT") {
|
|
409
409
|
try {
|
|
410
410
|
s("Document Dependencies");
|
|
411
|
-
let n = await
|
|
411
|
+
let n = await w("package.json"), r = n.name ?? "";
|
|
412
412
|
if (ne.has(r)) {
|
|
413
|
-
await ct(r),
|
|
413
|
+
await ct(r), S("Dependencies documented");
|
|
414
414
|
return;
|
|
415
415
|
}
|
|
416
416
|
await f("1️⃣ Clear downloaded licenses", "licenses/downloads");
|
|
417
|
-
let i = await
|
|
417
|
+
let i = await _t(), a = await vt();
|
|
418
418
|
if (a === null) {
|
|
419
|
-
let r =
|
|
420
|
-
await
|
|
419
|
+
let r = St(i);
|
|
420
|
+
await gt("2️⃣ Identify production licenses", e, [n.name ?? "", ...r], !0), await t("3️⃣ Identify transitive dependencies", "npm", [
|
|
421
421
|
"ls",
|
|
422
422
|
"--all",
|
|
423
423
|
"--json",
|
|
424
424
|
"--omit=dev"
|
|
425
|
-
],
|
|
425
|
+
], F), await lt("4️⃣ ", e, new Set(r));
|
|
426
426
|
} else {
|
|
427
|
-
let r =
|
|
428
|
-
await
|
|
427
|
+
let r = yt(a, i), o = bt(i), s = o.filter((e) => !r.has(e));
|
|
428
|
+
await gt("2️⃣ Identify shipped licenses", e, [n.name ?? "", ...s], !1), xt(r, new Set(o)), await t("3️⃣ Identify transitive dependencies", "npm", [
|
|
429
429
|
"ls",
|
|
430
430
|
"--all",
|
|
431
431
|
"--json"
|
|
432
|
-
],
|
|
433
|
-
let c = await
|
|
432
|
+
], F, !0);
|
|
433
|
+
let c = await Xe("4️⃣ Identify Rust crates compiled into the WebAssembly", e), l = {
|
|
434
434
|
allowedLicenses: e,
|
|
435
|
-
productionNames:
|
|
435
|
+
productionNames: mt(n),
|
|
436
436
|
rustCrates: c,
|
|
437
437
|
shippedKeys: r
|
|
438
438
|
};
|
|
439
439
|
await ut(c === null ? "4️⃣ " : "5️⃣ ", l);
|
|
440
440
|
}
|
|
441
|
-
|
|
441
|
+
S("Dependencies documented");
|
|
442
442
|
} catch (e) {
|
|
443
443
|
console.error("❌ Error documenting dependencies", e), process.exit(1);
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
async function ct(e) {
|
|
447
|
-
|
|
447
|
+
T(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`);
|
|
448
448
|
let t = `> [!WARNING]\n> Dependency licenses are not documented here: ${e} is a development-only tool and is never part of a production release.`;
|
|
449
|
-
await _(`${
|
|
449
|
+
await _(`${P}\n\n${t}`, M, N);
|
|
450
450
|
}
|
|
451
451
|
async function lt(e, t, n) {
|
|
452
|
-
|
|
453
|
-
let r = await
|
|
454
|
-
for (let e of i.values()) a +=
|
|
452
|
+
T(`${e} Insert licenses into 'README.md'`);
|
|
453
|
+
let r = await w(F), i = await ht(), a = `${z(t, !1)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
|
|
454
|
+
for (let e of i.values()) a += B(e);
|
|
455
455
|
let o = [];
|
|
456
|
-
r.dependencies != null &&
|
|
456
|
+
r.dependencies != null && Dt(r.dependencies, i, n, o, 0);
|
|
457
457
|
let s = `${at}\n\n${o.join("\n")}`;
|
|
458
|
-
await _(`${
|
|
458
|
+
await _(`${P}\n\n${a.trimEnd()}\n\n### Dependency Tree\n\n${s}`, M, N);
|
|
459
459
|
}
|
|
460
460
|
async function ut(e, t) {
|
|
461
|
-
|
|
462
|
-
let { allowedLicenses: n, productionNames: r, rustCrates: i, shippedKeys: a } = t, o = await
|
|
463
|
-
for (let e of
|
|
464
|
-
|
|
465
|
-
|
|
461
|
+
T(`${e} Insert licenses into 'README.md'`);
|
|
462
|
+
let { allowedLicenses: n, productionNames: r, rustCrates: i, shippedKeys: a } = t, o = await ht(), s = new Map((i?.crates ?? []).map((e) => [`${e.name}@${e.version}`, ft(e)])), c = i !== null, l = c ? "|Type|Dependency|Version|License(s)|Document|\n|:-|:-|:-:|:-|:-|" : "|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|", u = `${z(n, !0, c)}\n\n${l}\n`;
|
|
463
|
+
for (let e of o.values().toArray().toSorted(dt)) u += B(e, c ? "JavaScript" : void 0);
|
|
464
|
+
for (let e of s.values().toArray().toSorted(dt)) u += B(e, "Rust");
|
|
465
|
+
let d = await w(F), f = Object.entries(d.dependencies ?? {}).toSorted(([e], [t]) => Number(!r.has(e)) - Number(!r.has(t))), p = [];
|
|
466
|
+
V(f, {
|
|
466
467
|
licensesByKey: o,
|
|
467
468
|
shippedKeys: a,
|
|
468
469
|
shownKeys: /* @__PURE__ */ new Set()
|
|
469
|
-
},
|
|
470
|
-
let p = i?.treeItems ?? []
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
470
|
+
}, p, 0, !1);
|
|
471
|
+
let m = p.length === 0 ? "None." : p.join("\n"), h = (i?.treeItems ?? []).map((e) => pt(e, s)).join("\n"), g = c ? `${ot}\n\n#### JavaScript\n\n${m}\n\n#### Rust\n\n${h}` : `${ot}\n\n${m}`;
|
|
472
|
+
await _(`${P}\n\n${u.trimEnd()}\n\n### Dependency Tree\n\n${g}`, M, N);
|
|
473
|
+
}
|
|
474
|
+
function dt(e, t) {
|
|
475
|
+
return e.name.localeCompare(t.name, "en") || e.installedVersion.localeCompare(t.installedVersion, "en");
|
|
474
476
|
}
|
|
475
|
-
function
|
|
477
|
+
function ft(e) {
|
|
476
478
|
return {
|
|
477
479
|
name: e.name,
|
|
478
480
|
repository: e.repository,
|
|
@@ -485,27 +487,27 @@ function dt(e) {
|
|
|
485
487
|
licenseFiles: e.licenseFiles
|
|
486
488
|
};
|
|
487
489
|
}
|
|
488
|
-
function
|
|
490
|
+
function pt(e, t) {
|
|
489
491
|
let n = " ".repeat(e.depth);
|
|
490
|
-
return e.isOwn ? `${n}- **${e.name}** ${e.version} — this project's Rust code, compiled into its WebAssembly` :
|
|
492
|
+
return e.isOwn ? `${n}- **${e.name}** ${e.version} — this project's Rust code, compiled into its WebAssembly` : H(e.name, e.version, t.get(`${e.name}@${e.version}`), n);
|
|
491
493
|
}
|
|
492
|
-
function
|
|
494
|
+
function mt(e) {
|
|
493
495
|
return /* @__PURE__ */ new Set([
|
|
494
496
|
...Object.keys(e.dependencies ?? {}),
|
|
495
497
|
...Object.keys(e.optionalDependencies ?? {}),
|
|
496
498
|
...Object.keys(e.peerDependencies ?? {})
|
|
497
499
|
]);
|
|
498
500
|
}
|
|
499
|
-
async function
|
|
500
|
-
let e = await
|
|
501
|
-
for (let [n, r] of Object.entries(e)) t.set(n,
|
|
501
|
+
async function ht() {
|
|
502
|
+
let e = await w("licenses/licenses.json"), t = /* @__PURE__ */ new Map();
|
|
503
|
+
for (let [n, r] of Object.entries(e)) t.set(n, Tt(n, r));
|
|
502
504
|
return await Promise.all(t.values().map(async (e) => {
|
|
503
|
-
let t = await
|
|
505
|
+
let t = await Et(e.name, e.installedVersion);
|
|
504
506
|
e.latestVersion = t.latestVersion, e.latestPublishedDate = t.latestPublishedDate, e.publishedDate = t.publishedDate;
|
|
505
507
|
})), t;
|
|
506
508
|
}
|
|
507
|
-
async function
|
|
508
|
-
|
|
509
|
+
async function gt(e, t, n, r) {
|
|
510
|
+
T(e), await new Promise((e, i) => {
|
|
509
511
|
let a = {
|
|
510
512
|
start: process.cwd(),
|
|
511
513
|
production: r,
|
|
@@ -517,63 +519,63 @@ async function mt(e, t, n, r) {
|
|
|
517
519
|
excludePackages: n.join(";"),
|
|
518
520
|
out: "licenses/licenses.json"
|
|
519
521
|
};
|
|
520
|
-
|
|
522
|
+
de(a, (t) => {
|
|
521
523
|
t == null ? e() : i(t);
|
|
522
524
|
});
|
|
523
525
|
});
|
|
524
526
|
}
|
|
525
|
-
async function
|
|
527
|
+
async function _t() {
|
|
526
528
|
let t = await e("package-lock.json");
|
|
527
529
|
return t === null ? {} : JSON.parse(t).packages ?? {};
|
|
528
530
|
}
|
|
529
|
-
async function
|
|
530
|
-
let t = await e(
|
|
531
|
+
async function vt() {
|
|
532
|
+
let t = await e(rt);
|
|
531
533
|
return t === null ? null : JSON.parse(t);
|
|
532
534
|
}
|
|
533
|
-
function
|
|
535
|
+
function yt(e, t) {
|
|
534
536
|
let n = new Set(e.packages);
|
|
535
537
|
for (let r of e.external) {
|
|
536
|
-
let e =
|
|
537
|
-
if (e !== void 0) for (let r of [e, ...
|
|
538
|
+
let e = R(t, "", r);
|
|
539
|
+
if (e !== void 0) for (let r of [e, ...L(t, e)]) {
|
|
538
540
|
let e = t[r];
|
|
539
|
-
e?.version !== void 0 && n.add(
|
|
541
|
+
e?.version !== void 0 && n.add(I(r, e));
|
|
540
542
|
}
|
|
541
543
|
}
|
|
542
544
|
return n;
|
|
543
545
|
}
|
|
544
|
-
function
|
|
546
|
+
function bt(e) {
|
|
545
547
|
let t = /* @__PURE__ */ new Set();
|
|
546
|
-
for (let [n, r] of Object.entries(e)) n !== "" && r.version !== void 0 && t.add(
|
|
548
|
+
for (let [n, r] of Object.entries(e)) n !== "" && r.version !== void 0 && t.add(I(n, r));
|
|
547
549
|
return [...t];
|
|
548
550
|
}
|
|
549
|
-
function
|
|
551
|
+
function xt(e, t) {
|
|
550
552
|
let n = [...e.difference(t)];
|
|
551
553
|
n.length > 0 && console.warn(`⚠️ Not installed, so not checked; rebuild to refresh the record: ${n.join(", ")}`);
|
|
552
554
|
}
|
|
553
|
-
function
|
|
555
|
+
function I(e, t) {
|
|
554
556
|
return `${t.name ?? e.slice(e.lastIndexOf("node_modules/") + 13)}@${String(t.version)}`;
|
|
555
557
|
}
|
|
556
|
-
function
|
|
557
|
-
let t =
|
|
558
|
+
function St(e) {
|
|
559
|
+
let t = L(e, ""), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
558
560
|
for (let [i, a] of Object.entries(e)) {
|
|
559
561
|
if (i === "" || a.version === void 0) continue;
|
|
560
|
-
let e =
|
|
562
|
+
let e = I(i, a);
|
|
561
563
|
t.has(i) ? n.add(e) : r.add(e);
|
|
562
564
|
}
|
|
563
565
|
return r.values().filter((e) => !n.has(e)).toArray();
|
|
564
566
|
}
|
|
565
|
-
function
|
|
567
|
+
function L(e, t) {
|
|
566
568
|
let n = /* @__PURE__ */ new Set(), r = [t];
|
|
567
569
|
for (; r.length > 0;) {
|
|
568
570
|
let t = r.pop() ?? "", i = e[t];
|
|
569
|
-
if (i !== void 0) for (let a of
|
|
570
|
-
let i =
|
|
571
|
+
if (i !== void 0) for (let a of Ct(i)) {
|
|
572
|
+
let i = R(e, t, a);
|
|
571
573
|
i === void 0 || n.has(i) || (n.add(i), r.push(i));
|
|
572
574
|
}
|
|
573
575
|
}
|
|
574
576
|
return n;
|
|
575
577
|
}
|
|
576
|
-
function
|
|
578
|
+
function Ct(e) {
|
|
577
579
|
let t = Object.keys(e.peerDependencies ?? {}).filter((t) => e.peerDependenciesMeta?.[t]?.optional !== !0);
|
|
578
580
|
return [
|
|
579
581
|
...Object.keys(e.dependencies ?? {}),
|
|
@@ -581,7 +583,7 @@ function St(e) {
|
|
|
581
583
|
...t
|
|
582
584
|
];
|
|
583
585
|
}
|
|
584
|
-
function
|
|
586
|
+
function R(e, t, n) {
|
|
585
587
|
let r = t;
|
|
586
588
|
for (;;) {
|
|
587
589
|
let t = r === "" ? `node_modules/${n}` : `${r}/node_modules/${n}`, i = e[t];
|
|
@@ -591,14 +593,14 @@ function Ct(e, t, n) {
|
|
|
591
593
|
r = a === -1 ? "" : r.slice(0, a);
|
|
592
594
|
}
|
|
593
595
|
}
|
|
594
|
-
function
|
|
595
|
-
let r =
|
|
596
|
+
function z(e, t, n = !1) {
|
|
597
|
+
let r = wt(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.";
|
|
596
598
|
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.`;
|
|
597
599
|
}
|
|
598
|
-
function
|
|
600
|
+
function wt(e) {
|
|
599
601
|
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))}`;
|
|
600
602
|
}
|
|
601
|
-
function
|
|
603
|
+
function Tt(e, t) {
|
|
602
604
|
let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
|
|
603
605
|
return {
|
|
604
606
|
name: r,
|
|
@@ -615,7 +617,7 @@ function Et(e, t) {
|
|
|
615
617
|
}]
|
|
616
618
|
};
|
|
617
619
|
}
|
|
618
|
-
async function
|
|
620
|
+
async function Et(e, t) {
|
|
619
621
|
try {
|
|
620
622
|
let n = await fetch(`https://registry.npmjs.org/${encodeURIComponent(e)}`);
|
|
621
623
|
if (n.ok) {
|
|
@@ -633,75 +635,75 @@ async function Dt(e, t) {
|
|
|
633
635
|
publishedDate: ""
|
|
634
636
|
};
|
|
635
637
|
}
|
|
636
|
-
function
|
|
637
|
-
let
|
|
638
|
-
return
|
|
638
|
+
function B(e, t) {
|
|
639
|
+
let n = e.licenseFiles.length === 0 ? "⚠️ No license file" : e.licenseFiles.map((e) => `[${e.label}](licenses/${e.path})`).join(" ");
|
|
640
|
+
return `${t === void 0 ? "" : `|${t}`}|[${e.name}](${e.repository})|${e.installedVersion}|${e.licenseTypes}|${n}|\n`;
|
|
639
641
|
}
|
|
640
|
-
function
|
|
642
|
+
function Dt(e, t, n, r, i) {
|
|
641
643
|
let a = " ".repeat(i);
|
|
642
644
|
for (let [o, s] of Object.entries(e)) {
|
|
643
645
|
if (s.version === void 0) continue;
|
|
644
646
|
let e = s.version;
|
|
645
|
-
n.has(`${o}@${e}`) || (r.push(
|
|
647
|
+
n.has(`${o}@${e}`) || (r.push(H(o, e, t.get(`${o}@${e}`), a)), s.dependencies != null && Dt(s.dependencies, t, n, r, i + 1));
|
|
646
648
|
}
|
|
647
649
|
}
|
|
648
|
-
function
|
|
650
|
+
function V(e, t, n, r, i) {
|
|
649
651
|
for (let [a, o] of e) {
|
|
650
652
|
if (o.version === void 0) continue;
|
|
651
653
|
let e = `${a}@${o.version}`, s = Object.entries(o.dependencies ?? {});
|
|
652
654
|
if (!t.shippedKeys.has(e)) {
|
|
653
|
-
|
|
655
|
+
V(s, t, n, r, !0);
|
|
654
656
|
continue;
|
|
655
657
|
}
|
|
656
|
-
i && t.shownKeys.has(e) || (t.shownKeys.add(e), n.push(
|
|
658
|
+
i && t.shownKeys.has(e) || (t.shownKeys.add(e), n.push(H(a, o.version, t.licensesByKey.get(e), " ".repeat(r))), V(s, t, n, r + 1, !1));
|
|
657
659
|
}
|
|
658
660
|
}
|
|
659
|
-
function
|
|
660
|
-
return `${r}- **${n == null ? e : `[${e}](${n.repository})`}** ${t}${
|
|
661
|
+
function H(e, t, n, r) {
|
|
662
|
+
return `${r}- **${n == null ? e : `[${e}](${n.repository})`}** ${t}${Ot(n)}`;
|
|
661
663
|
}
|
|
662
|
-
function
|
|
664
|
+
function Ot(e) {
|
|
663
665
|
if (e == null) return "";
|
|
664
|
-
let t = e.publishedDate ?
|
|
666
|
+
let t = e.publishedDate ? U(e.publishedDate.split("T", 1)[0]) : "";
|
|
665
667
|
if (e.latestVersion === "" || e.latestVersion === e.installedVersion) return t === "" ? "" : ` — ${t}`;
|
|
666
|
-
let n = e.latestPublishedDate ?
|
|
668
|
+
let n = e.latestPublishedDate ? U(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `latest: ${e.latestVersion} ❗` : `latest: ${e.latestVersion} — ${n} ❗`;
|
|
667
669
|
return t === "" ? ` — → ${r}` : ` — ${t} → ${r}`;
|
|
668
670
|
}
|
|
669
|
-
function
|
|
671
|
+
function U(e) {
|
|
670
672
|
if (e == null || e === "") return "n/a";
|
|
671
673
|
let t = e.split("T", 1)[0];
|
|
672
674
|
if (t == null || t === "") return "n/a";
|
|
673
675
|
let n = new Date(t), r = /* @__PURE__ */ new Date(), i = (r.getFullYear() - n.getFullYear()) * 12 + (r.getMonth() - n.getMonth());
|
|
674
|
-
return r.getDate() < n.getDate() && --i, i === 0 ? `this month: ${t}` : i === 1 ?
|
|
676
|
+
return r.getDate() < n.getDate() && --i, i === 0 ? `this month: ${t}` : i === 1 ? `1 mth ago: ${t}` : i <= 6 ? `${String(i)} mths ago: ${t}` : `${String(i)} mths ago: ${t} ⚠️`;
|
|
675
677
|
}
|
|
676
678
|
//#endregion
|
|
677
679
|
//#region src/actions/documentOpening.ts
|
|
678
|
-
var
|
|
679
|
-
async function
|
|
680
|
+
var kt = "<!-- OPENING_START -->", At = "<!-- OPENING_END -->";
|
|
681
|
+
async function jt() {
|
|
680
682
|
try {
|
|
681
|
-
s("Document Opening"),
|
|
682
|
-
let e = await
|
|
683
|
-
await _(c,
|
|
683
|
+
s("Document Opening"), T("1️⃣ Insert opening content into 'README.md'");
|
|
684
|
+
let e = await w("package.json"), t = await w("config.json"), { owner: n, repository: r } = C(e, "document opening"), i = Mt(e), a = Pt(t), o = m(t.id), c = Ft(n, r, i, o.uploadGroupName === void 0 ? void 0 : t.id, o.publishedTo === "npm" ? Nt(e) : void 0, e.description, a);
|
|
685
|
+
await _(c, kt, At), S("Opening documented");
|
|
684
686
|
} catch (e) {
|
|
685
687
|
console.error("❌ Error documenting opening", e), process.exit(1);
|
|
686
688
|
}
|
|
687
689
|
}
|
|
688
|
-
function
|
|
690
|
+
function Mt(e) {
|
|
689
691
|
let t = e.license;
|
|
690
692
|
if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
|
|
691
693
|
return t;
|
|
692
694
|
}
|
|
693
|
-
function
|
|
695
|
+
function Nt(e) {
|
|
694
696
|
let t = e.name;
|
|
695
697
|
if (t == null || t === "") throw Error("package.json 'name' field is required to document opening.");
|
|
696
698
|
return t;
|
|
697
699
|
}
|
|
698
|
-
function
|
|
700
|
+
function Pt(e) {
|
|
699
701
|
let t = e.description.en?.trim();
|
|
700
702
|
return t === void 0 || t === "" ? void 0 : t;
|
|
701
703
|
}
|
|
702
|
-
function
|
|
703
|
-
let s = `https://github.com/${e}/${t}
|
|
704
|
-
return `[ {
|
|
705
|
+
let s = `https://github.com/${e}/${t}`, c = n.replaceAll("-", "--"), l = encodeURIComponent(`https://api.dpuse.app/configs/${r ?? ""}`);
|
|
706
|
+
return `[](./LICENSE)${r === void 0 ? "" : `\n[](${s}/releases/latest)`}${i === void 0 ? "" : `\n[](https://www.npmjs.com/package/${i})`}
|
|
705
707
|
[](${s}/actions/workflows/ci.yml)${a == null || a === "" ? "" : `\n\n${a}`}
|
|
706
708
|
|
|
707
709
|
[Report a Vulnerability](${s}/security/advisories/new) · [Open an Issue](${s}/issues)
|
|
@@ -720,11 +722,11 @@ In addition, DPUse provides [Tools](https://www.dpuse.app) used by the applicati
|
|
|
720
722
|
}
|
|
721
723
|
//#endregion
|
|
722
724
|
//#region src/actions/documentQualitySecurity.ts
|
|
723
|
-
var
|
|
725
|
+
var It = {
|
|
724
726
|
"Branch-Protection": 3,
|
|
725
727
|
"Code-Review": 0,
|
|
726
728
|
Contributors: 0
|
|
727
|
-
},
|
|
729
|
+
}, Lt = /* @__PURE__ */ new Set(["CII-Best-Practices"]), Rt = "coverage/coverage-final.json", zt = "coverage/coverage-summary.json", Bt = 80, Vt = 60, Ht = "code-health-reports/vitest/badge.json", Ut = {
|
|
728
730
|
actions: "GitHub Actions",
|
|
729
731
|
"javascript-typescript": "JavaScript/TypeScript",
|
|
730
732
|
rust: "Rust"
|
|
@@ -734,29 +736,29 @@ var V = {
|
|
|
734
736
|
C: "yellow",
|
|
735
737
|
D: "orange",
|
|
736
738
|
F: "red"
|
|
737
|
-
}, Gt = `${c}/health.json`, Kt = ce
|
|
739
|
+
}, Gt = `${c}/health.json`, Kt = se(ce);
|
|
738
740
|
async function qt() {
|
|
739
741
|
try {
|
|
740
742
|
s("Document Quality & Security");
|
|
741
|
-
let e = await
|
|
742
|
-
|
|
743
|
+
let e = await w("package.json"), t = await Jt(e), n = await Xt(e, t === void 0 ? [] : ["--coverage", Rt]), { owner: r, repository: i } = C(e, "document quality and security");
|
|
744
|
+
T("4️⃣ Read security checks and settings");
|
|
743
745
|
let a = await Qt(r, i, e);
|
|
744
|
-
|
|
746
|
+
T("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
|
|
745
747
|
let [o, c] = await Promise.all([$t(`https://github.com/${r}/${i}`), en(`github.com/${r}/${i}`)]);
|
|
746
|
-
|
|
748
|
+
T("6️⃣ Insert quality and security content into 'README.md'");
|
|
747
749
|
let d = on(r, i, {
|
|
748
750
|
coveragePercent: t,
|
|
749
751
|
fallowHealth: n,
|
|
750
752
|
securitySettings: a
|
|
751
753
|
}, o, c);
|
|
752
|
-
await l(), await _(d, u, re),
|
|
754
|
+
await l(), await _(d, u, re), S("Quality & security documented");
|
|
753
755
|
} catch (e) {
|
|
754
756
|
console.error("❌ Error documenting quality and security", e), process.exit(1);
|
|
755
757
|
}
|
|
756
758
|
}
|
|
757
759
|
async function Jt(t) {
|
|
758
760
|
if (t.devDependencies?.["@vitest/coverage-v8"] == null) {
|
|
759
|
-
|
|
761
|
+
T("1️⃣ Test coverage NOT measured, as '@vitest/coverage-v8' is not installed");
|
|
760
762
|
return;
|
|
761
763
|
}
|
|
762
764
|
await o("1️⃣ Measure test coverage", "vitest", [
|
|
@@ -764,7 +766,7 @@ async function Jt(t) {
|
|
|
764
766
|
"--passWithNoTests",
|
|
765
767
|
"--coverage"
|
|
766
768
|
]);
|
|
767
|
-
let n = await e(
|
|
769
|
+
let n = await e(zt);
|
|
768
770
|
if (n === null) return;
|
|
769
771
|
let r = JSON.parse(n).total.lines.pct;
|
|
770
772
|
return await Yt(r), r;
|
|
@@ -774,7 +776,7 @@ async function Yt(e) {
|
|
|
774
776
|
"red",
|
|
775
777
|
"yellow",
|
|
776
778
|
"brightgreen"
|
|
777
|
-
], n = Number(e >= Vt) + Number(e >=
|
|
779
|
+
], n = Number(e >= Vt) + Number(e >= Bt);
|
|
778
780
|
await i(Ht, {
|
|
779
781
|
schemaVersion: 1,
|
|
780
782
|
label: "coverage",
|
|
@@ -784,7 +786,7 @@ async function Yt(e) {
|
|
|
784
786
|
}
|
|
785
787
|
async function Xt(e, n) {
|
|
786
788
|
if (e.devDependencies?.fallow == null) {
|
|
787
|
-
|
|
789
|
+
T("2️⃣ Code health NOT measured, as Fallow is not installed"), T("3️⃣ Code health report NOT required");
|
|
788
790
|
return;
|
|
789
791
|
}
|
|
790
792
|
await t("2️⃣ Measure code health", "fallow", [
|
|
@@ -794,7 +796,7 @@ async function Xt(e, n) {
|
|
|
794
796
|
"json",
|
|
795
797
|
...n
|
|
796
798
|
], Gt), await t("3️⃣ Write code health report", "fallow", ["--format", "markdown"], te, !0);
|
|
797
|
-
let r = await
|
|
799
|
+
let r = await w(Gt);
|
|
798
800
|
return await Zt(r), r;
|
|
799
801
|
}
|
|
800
802
|
async function Zt(e) {
|
|
@@ -812,10 +814,10 @@ async function Qt(t, n, r) {
|
|
|
812
814
|
e(".github/dependabot.yml"),
|
|
813
815
|
e(v)
|
|
814
816
|
]), s = await e(".github/workflows/codeql.yml") ?? "", [c, l, u, d] = await Promise.all([
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
817
|
+
W(`repos/${t}/${n}`),
|
|
818
|
+
W(`repos/${t}/${n}/private-vulnerability-reporting`),
|
|
819
|
+
W(`repos/${t}/${n}/vulnerability-alerts`),
|
|
820
|
+
W(`repos/${t}/${n}/commits/main/check-runs?per_page=100`)
|
|
819
821
|
]), 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;
|
|
820
822
|
return {
|
|
821
823
|
codeQLLanguages: s.matchAll(/- language: ([\w-]+)/g).filter(([, e]) => e !== "rust" || o !== null).map(([, e = ""]) => Ut[e] ?? e).toArray(),
|
|
@@ -835,7 +837,7 @@ async function Qt(t, n, r) {
|
|
|
835
837
|
testsInCI: i?.includes("npm test") ?? !1
|
|
836
838
|
};
|
|
837
839
|
}
|
|
838
|
-
async function
|
|
840
|
+
async function W(e) {
|
|
839
841
|
try {
|
|
840
842
|
let { stdout: t } = await Kt("gh", ["api", e]);
|
|
841
843
|
return t;
|
|
@@ -857,15 +859,15 @@ async function en(e) {
|
|
|
857
859
|
}
|
|
858
860
|
}
|
|
859
861
|
function tn(e) {
|
|
860
|
-
return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 ||
|
|
862
|
+
return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Lt.has(e) || It[e] !== void 0 && t >= It[e]);
|
|
861
863
|
}
|
|
862
864
|
function nn(e) {
|
|
863
865
|
return e === !1 ? " These are handled manually." : "";
|
|
864
866
|
}
|
|
865
|
-
function
|
|
867
|
+
function G(e) {
|
|
866
868
|
return e === void 0 ? "❔ Unknown" : e ? "✅ On" : "❌ Off";
|
|
867
869
|
}
|
|
868
|
-
function
|
|
870
|
+
function K(e, t) {
|
|
869
871
|
return t.length === 0 ? "" : `### ${e}
|
|
870
872
|
|
|
871
873
|
|Check|Status|What it does|
|
|
@@ -880,78 +882,78 @@ function rn(e, t, n, r) {
|
|
|
880
882
|
function an(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
|
|
881
883
|
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 = [[
|
|
882
884
|
"Unit tests",
|
|
883
|
-
|
|
885
|
+
G(i.testsInCI),
|
|
884
886
|
`[Vitest](https://vitest.dev) runs the unit tests.${o(i.testsInCI)}`
|
|
885
887
|
], [
|
|
886
888
|
"Property-based tests",
|
|
887
|
-
|
|
889
|
+
G(i.propertyTests),
|
|
888
890
|
`[fast-check](https://fast-check.dev) runs many random inputs per test to find edge cases, alongside the unit tests.${o(i.propertyTests && i.testsInCI)}`
|
|
889
891
|
]];
|
|
890
892
|
n !== void 0 && s.push([
|
|
891
893
|
"Test coverage",
|
|
892
|
-
|
|
893
|
-
`${rn(e, t, "Coverage", Ht)} [Vitest's V8 coverage](https://vitest.dev/guide/coverage) measures the share of source lines the unit tests run. The target is ${String(
|
|
894
|
+
G(!0),
|
|
895
|
+
`${rn(e, t, "Coverage", Ht)} [Vitest's V8 coverage](https://vitest.dev/guide/coverage) measures the share of source lines the unit tests run. The target is ${String(Bt)}%.`
|
|
894
896
|
]);
|
|
895
897
|
let c = `[](https://sonarcloud.io/summary/new_code?id=${e}_${t}) `, l = [[
|
|
896
898
|
"Code analysis",
|
|
897
|
-
|
|
899
|
+
G(i.sonarCloud),
|
|
898
900
|
`${i.sonarCloud ? c : ""}[SonarCloud](https://sonarcloud.io) checks every push for bugs, code smells and vulnerabilities.`
|
|
899
901
|
], [
|
|
900
902
|
"Linting",
|
|
901
|
-
|
|
903
|
+
G(i.lintInCI),
|
|
902
904
|
`[ESLint](https://eslint.org) checks the code for errors and style problems.${o(i.lintInCI)}`
|
|
903
905
|
]];
|
|
904
906
|
r !== void 0 && l.unshift([
|
|
905
907
|
"Code health",
|
|
906
|
-
|
|
908
|
+
G(!0),
|
|
907
909
|
`[${rn(e, t, "Fallow code health", h)}](./${te}) [Fallow](https://github.com/fallow-rs/fallow) finds unused code, duplication, complexity and dependency problems.`
|
|
908
910
|
]);
|
|
909
911
|
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 = [
|
|
910
912
|
[
|
|
911
913
|
"Push protection",
|
|
912
|
-
|
|
914
|
+
G(i.pushProtection),
|
|
913
915
|
"[GitHub push protection](https://docs.github.com/en/code-security/secret-scanning/push-protection-for-repositories-and-organizations) blocks pushes that contain credentials."
|
|
914
916
|
],
|
|
915
917
|
[
|
|
916
918
|
"Static analysis",
|
|
917
|
-
|
|
919
|
+
G(u),
|
|
918
920
|
`${u ? d : ""}[CodeQL](https://codeql.github.com) scans${p} for security vulnerabilities, ${f}, on every push and pull request to \`main\` and weekly.`
|
|
919
921
|
],
|
|
920
922
|
[
|
|
921
923
|
"Secret scanning",
|
|
922
|
-
|
|
924
|
+
G(i.secretScanning),
|
|
923
925
|
"[GitHub secret scanning](https://docs.github.com/en/code-security/secret-scanning) detects credentials, such as API keys and tokens, committed to the repository."
|
|
924
926
|
]
|
|
925
927
|
], g = "[Dependabot](https://docs.github.com/en/code-security/dependabot)", _ = [
|
|
926
928
|
[
|
|
927
929
|
"Vulnerability audit",
|
|
928
|
-
|
|
930
|
+
G(i.npmAuditInCI),
|
|
929
931
|
i.npmAuditLevel === void 0 ? `[npm audit](https://docs.npmjs.com/cli/commands/npm-audit) fails when a shipped dependency has any known vulnerability, or a development dependency has a high or critical one.${o(i.npmAuditInCI)}` : `[npm audit](https://docs.npmjs.com/cli/commands/npm-audit) fails when a dependency has a known vulnerability of ${i.npmAuditLevel} severity or above.${o(i.npmAuditInCI)}`
|
|
930
932
|
],
|
|
931
933
|
[
|
|
932
934
|
"Supply chain risk",
|
|
933
|
-
|
|
935
|
+
G(i.socket),
|
|
934
936
|
"[Socket](https://socket.dev) flags malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE."
|
|
935
937
|
],
|
|
936
938
|
[
|
|
937
939
|
"Security alerts",
|
|
938
|
-
|
|
940
|
+
G(i.dependabotAlerts),
|
|
939
941
|
`${g} alerts when a dependency has a known vulnerability, using the GitHub Advisory Database.`
|
|
940
942
|
],
|
|
941
943
|
[
|
|
942
944
|
"Security updates",
|
|
943
|
-
|
|
945
|
+
G(i.dependabotSecurityUpdates),
|
|
944
946
|
`${g} opens pull requests that update vulnerable dependencies.${nn(i.dependabotSecurityUpdates)}`
|
|
945
947
|
],
|
|
946
948
|
[
|
|
947
949
|
"Version updates",
|
|
948
|
-
|
|
950
|
+
G(i.dependabotVersionUpdates),
|
|
949
951
|
`${g} opens pull requests for new dependency versions.${nn(i.dependabotVersionUpdates)}`
|
|
950
952
|
]
|
|
951
953
|
];
|
|
952
954
|
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.
|
|
953
955
|
|
|
954
|
-
${
|
|
956
|
+
${K("Testing", s)}${K("Code Quality", l)}${K("Security Analysis", m)}${K("Dependencies", _)}`;
|
|
955
957
|
}
|
|
956
958
|
function on(e, t, n, r, i) {
|
|
957
959
|
let a = `https://github.com/${e}/${t}`, o = `github.com/${e}/${t}`, s = `https://www.bestpractices.dev/projects/${String(r)}`, c = i !== void 0 && tn(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.";
|
|
@@ -976,9 +978,9 @@ var sn = "<!-- USAGE_START -->", cn = "<!-- USAGE_END -->", ln = /* @__PURE__ */
|
|
|
976
978
|
]), un = /* @__PURE__ */ new Set(["development", "eslint"]), dn = "> [!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.", fn = "This repository manages itself using the actions it implements.", pn = "This repository is managed using the common set of actions provided by [@dpuse/dpuse-development](https://github.com/dpuse/dpuse-development).";
|
|
977
979
|
async function mn() {
|
|
978
980
|
try {
|
|
979
|
-
s("Document Usage"),
|
|
980
|
-
let [e, t] = await Promise.all([
|
|
981
|
-
await _(u, sn, cn),
|
|
981
|
+
s("Document Usage"), T("1️⃣ Insert usage content into 'README.md'");
|
|
982
|
+
let [e, t] = await Promise.all([w("package.json"), w("config.json")]), n = hn(e), r = gn(n), i = q(e.engines?.node), a = q(e.engines?.npm), o = q(e.devDependencies?.typescript), c = _n(m(t.id), e.name), l = `${n.replace(/\.git$/, "")}/blob/main/package.json`, u = vn(c, n, r, i, a, o, `${e.name === "@dpuse/dpuse-development" ? fn : pn} See the \`scripts\` block in [package.json](${l}) for details.`);
|
|
983
|
+
await _(u, sn, cn), S("Usage documented");
|
|
982
984
|
} catch (e) {
|
|
983
985
|
console.error("❌ Error documenting usage", e), process.exit(1);
|
|
984
986
|
}
|
|
@@ -991,7 +993,7 @@ function hn(e) {
|
|
|
991
993
|
function gn(e) {
|
|
992
994
|
return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
|
|
993
995
|
}
|
|
994
|
-
function
|
|
996
|
+
function q(e) {
|
|
995
997
|
if (e == null) throw Error("package.json version range is required to document usage.");
|
|
996
998
|
let t = /\d+(?:\.\d+)*/.exec(e);
|
|
997
999
|
if (t == null) throw Error(`Unable to parse version from '${e}'.`);
|
|
@@ -1031,102 +1033,102 @@ ${o}`;
|
|
|
1031
1033
|
}
|
|
1032
1034
|
//#endregion
|
|
1033
1035
|
//#region src/actions/documentApiReference.ts
|
|
1034
|
-
var
|
|
1036
|
+
var J = "API_REFERENCE.md";
|
|
1035
1037
|
async function yn() {
|
|
1036
1038
|
try {
|
|
1037
1039
|
s("Document API Reference");
|
|
1038
1040
|
let { writeAPIReference: e } = await import("./apiReference-cMfpNKxR.js");
|
|
1039
|
-
await e("1️⃣ ",
|
|
1041
|
+
await e("1️⃣ ", J), S("API reference documented");
|
|
1040
1042
|
} catch (e) {
|
|
1041
1043
|
console.error("❌ Error documenting API reference", e), process.exit(1);
|
|
1042
1044
|
}
|
|
1043
1045
|
}
|
|
1044
1046
|
//#endregion
|
|
1045
1047
|
//#region src/actions/documentBundleSizes.ts
|
|
1046
|
-
var
|
|
1047
|
-
async function
|
|
1048
|
+
var bn = "bundle-analysis-reports/sonda/index.json", xn = "<!-- BUNDLE_START -->", Sn = "<!-- BUNDLE_END -->", Y = " ", X = 20, Cn = "█", wn = "▒", Tn = 100 / X / 2, En = 100 / X, Dn = "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._", On = "Bars show each row's share of its output file.", kn = "↳ rows are part of the row above.", Z = "(bundler output, whitespace & JSON)", An = `${Z} = 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.`;
|
|
1049
|
+
async function jn(e) {
|
|
1048
1050
|
try {
|
|
1049
|
-
s("Document Bundle Sizes"),
|
|
1050
|
-
let t = await
|
|
1051
|
-
|
|
1052
|
-
let n =
|
|
1053
|
-
await _(`## Bundle Analysis\n\n${
|
|
1051
|
+
s("Document Bundle Sizes"), T("1️⃣ Read bundle analysis report");
|
|
1052
|
+
let t = await w(bn);
|
|
1053
|
+
T("2️⃣ Insert table into 'README.md'");
|
|
1054
|
+
let n = Mn(t, e?.moduleLevel ?? !1), r = n.includes("↳") ? `${On} ${kn}` : On;
|
|
1055
|
+
await _(`## Bundle Analysis\n\n${Dn}\n\n${n}\n\n${r}\n\n${An}`, xn, Sn), S("Bundle sizes documented");
|
|
1054
1056
|
} catch (e) {
|
|
1055
1057
|
console.error("❌ Error documenting bundle sizes", e), process.exit(1);
|
|
1056
1058
|
}
|
|
1057
1059
|
}
|
|
1058
|
-
function
|
|
1059
|
-
let n =
|
|
1060
|
+
function Mn(e, t) {
|
|
1061
|
+
let n = zn(e), r = n.values().flatMap((e) => e.values().toArray()).reduce((e, t) => e + t.sizes.uncompressed, 0), i = e.resources.filter((e) => e.kind === "asset").map((e) => [e.name, Wn(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), a = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
|
|
1060
1062
|
for (let [e, o] of i) {
|
|
1061
|
-
let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted(
|
|
1062
|
-
a.push(`| **${e}** | ${
|
|
1063
|
+
let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted(Nn), s = i.reduce((e, [, t]) => e + t.sizes.uncompressed, 0), c = s > 0 && r > 0 ? ` · ${Yn(s, r)} of the build` : "";
|
|
1064
|
+
a.push(`| **${e}** | ${Gn(o)}${c} |`, ...Pn(i, s, t));
|
|
1063
1065
|
}
|
|
1064
1066
|
return a.join("\n");
|
|
1065
1067
|
}
|
|
1066
|
-
function
|
|
1068
|
+
function Nn(e, t) {
|
|
1067
1069
|
return e[0] === Z == (t[0] === Z) ? t[1].sizes.uncompressed - e[1].sizes.uncompressed : e[0] === Z ? 1 : -1;
|
|
1068
1070
|
}
|
|
1069
|
-
function
|
|
1071
|
+
function Pn(e, t, n) {
|
|
1070
1072
|
let r = [];
|
|
1071
1073
|
for (let [i, { sizes: a, files: o }] of e) {
|
|
1072
1074
|
if (o.size === 1) {
|
|
1073
|
-
let e =
|
|
1074
|
-
r.push(`| ${Y}${
|
|
1075
|
+
let e = Rn(o);
|
|
1076
|
+
r.push(`| ${Y}${Ln(i, e)} | ${Q(a.uncompressed, t)} |`);
|
|
1075
1077
|
continue;
|
|
1076
1078
|
}
|
|
1077
|
-
r.push(`| ${Y}${i} | ${Q(a.uncompressed, t)} |`), n || r.push(...
|
|
1079
|
+
r.push(`| ${Y}${i} | ${Q(a.uncompressed, t)} |`), n || r.push(...Fn(o, t));
|
|
1078
1080
|
}
|
|
1079
1081
|
return r;
|
|
1080
1082
|
}
|
|
1081
|
-
function
|
|
1082
|
-
let n = [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), r =
|
|
1083
|
+
function Fn(e, t) {
|
|
1084
|
+
let n = [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), r = In(n, t), i = (r > 0 ? n.slice(0, -r) : n).map(([e, n]) => `| ${Y}${Y}↳ ${e} | ${Q(n.uncompressed, t, wn)} |`);
|
|
1083
1085
|
if (r > 0) {
|
|
1084
1086
|
let e = n.slice(-r).reduce((e, [, t]) => e + t.uncompressed, 0);
|
|
1085
|
-
i.push(`| ${Y}${Y}↳ ${String(r)} smaller files | ${Q(e, t,
|
|
1087
|
+
i.push(`| ${Y}${Y}↳ ${String(r)} smaller files | ${Q(e, t, wn)} |`);
|
|
1086
1088
|
}
|
|
1087
1089
|
return i;
|
|
1088
1090
|
}
|
|
1089
|
-
function
|
|
1091
|
+
function In(e, t) {
|
|
1090
1092
|
if (t <= 0) return 0;
|
|
1091
1093
|
let n = 0, r = 0;
|
|
1092
1094
|
for (let [, i] of e.toReversed()) {
|
|
1093
|
-
let e = i.uncompressed / t * 100 <
|
|
1095
|
+
let e = i.uncompressed / t * 100 < Tn, a = (r + i.uncompressed) / t * 100 <= En;
|
|
1094
1096
|
if (!e || !a) break;
|
|
1095
1097
|
n++, r += i.uncompressed;
|
|
1096
1098
|
}
|
|
1097
1099
|
return n >= 2 ? n : 0;
|
|
1098
1100
|
}
|
|
1099
|
-
function Q(e, t, n =
|
|
1100
|
-
return `${
|
|
1101
|
+
function Q(e, t, n = Cn) {
|
|
1102
|
+
return `${Kn(t > 0 ? e / t * 100 : 0, n)} · ${$(e)}`;
|
|
1101
1103
|
}
|
|
1102
|
-
function
|
|
1104
|
+
function Ln(e, t) {
|
|
1103
1105
|
return t === "" ? e : `${e} → ${t}`;
|
|
1104
1106
|
}
|
|
1105
|
-
function
|
|
1107
|
+
function Rn(e) {
|
|
1106
1108
|
let [t] = e.keys();
|
|
1107
1109
|
if (t === void 0) throw Error("Expected exactly one file");
|
|
1108
1110
|
return t;
|
|
1109
1111
|
}
|
|
1110
|
-
function
|
|
1111
|
-
let t =
|
|
1112
|
+
function zn(e) {
|
|
1113
|
+
let t = Bn(e.dependencies), n = /* @__PURE__ */ new Map();
|
|
1112
1114
|
for (let r of e.resources) {
|
|
1113
1115
|
if (r.kind !== "chunk" || !r.parent) continue;
|
|
1114
|
-
let { group: e, file: i } =
|
|
1116
|
+
let { group: e, file: i } = Vn(r.name, t), a = Wn(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
|
|
1115
1117
|
n.set(r.parent, o);
|
|
1116
1118
|
let s = o.get(e) ?? {
|
|
1117
|
-
sizes:
|
|
1119
|
+
sizes: qn(),
|
|
1118
1120
|
files: /* @__PURE__ */ new Map()
|
|
1119
1121
|
};
|
|
1120
|
-
o.set(e, s),
|
|
1121
|
-
let c = s.files.get(i) ??
|
|
1122
|
-
s.files.set(i, c),
|
|
1122
|
+
o.set(e, s), Jn(s.sizes, a);
|
|
1123
|
+
let c = s.files.get(i) ?? qn();
|
|
1124
|
+
s.files.set(i, c), Jn(c, a);
|
|
1123
1125
|
}
|
|
1124
1126
|
return n;
|
|
1125
1127
|
}
|
|
1126
|
-
function
|
|
1128
|
+
function Bn(e) {
|
|
1127
1129
|
return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
|
|
1128
1130
|
}
|
|
1129
|
-
function
|
|
1131
|
+
function Vn(e, t) {
|
|
1130
1132
|
let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
|
|
1131
1133
|
if (n) {
|
|
1132
1134
|
let [t, r] = n;
|
|
@@ -1143,42 +1145,42 @@ function Bn(e, t) {
|
|
|
1143
1145
|
file: e.slice(1)
|
|
1144
1146
|
} : e.startsWith("rust/") ? {
|
|
1145
1147
|
group: "wasm",
|
|
1146
|
-
file:
|
|
1148
|
+
file: Hn(e)
|
|
1147
1149
|
} : {
|
|
1148
1150
|
group: "src",
|
|
1149
|
-
file:
|
|
1151
|
+
file: Un(e)
|
|
1150
1152
|
};
|
|
1151
1153
|
}
|
|
1152
|
-
function
|
|
1153
|
-
let t = e.split("/", 2)[1] ?? "", n =
|
|
1154
|
+
function Hn(e) {
|
|
1155
|
+
let t = e.split("/", 2)[1] ?? "", n = Un(e);
|
|
1154
1156
|
return t !== "" && n.startsWith(t) ? `…${n.slice(t.length)}` : n;
|
|
1155
1157
|
}
|
|
1156
|
-
function
|
|
1158
|
+
function Un(e) {
|
|
1157
1159
|
return e.split("/").at(-1) ?? e;
|
|
1158
1160
|
}
|
|
1159
|
-
function
|
|
1161
|
+
function Wn(e) {
|
|
1160
1162
|
return {
|
|
1161
1163
|
uncompressed: e.uncompressed,
|
|
1162
1164
|
gzip: e.gzip ?? 0
|
|
1163
1165
|
};
|
|
1164
1166
|
}
|
|
1165
|
-
function
|
|
1167
|
+
function Gn(e) {
|
|
1166
1168
|
return `${$(e.uncompressed)} · gzip ${$(e.gzip)}`;
|
|
1167
1169
|
}
|
|
1168
|
-
function
|
|
1170
|
+
function Kn(e, t = Cn) {
|
|
1169
1171
|
let n = Math.round(e / 100 * X);
|
|
1170
1172
|
return `\`${t.repeat(n)}${"░".repeat(X - n)}\` ${e.toFixed(1)}%`;
|
|
1171
1173
|
}
|
|
1172
|
-
function
|
|
1174
|
+
function qn() {
|
|
1173
1175
|
return {
|
|
1174
1176
|
uncompressed: 0,
|
|
1175
1177
|
gzip: 0
|
|
1176
1178
|
};
|
|
1177
1179
|
}
|
|
1178
|
-
function
|
|
1180
|
+
function Jn(e, t) {
|
|
1179
1181
|
e.uncompressed += t.uncompressed, e.gzip += t.gzip;
|
|
1180
1182
|
}
|
|
1181
|
-
function
|
|
1183
|
+
function Yn(e, t) {
|
|
1182
1184
|
return `${(e / t * 100).toFixed(1)}%`;
|
|
1183
1185
|
}
|
|
1184
1186
|
function $(e) {
|
|
@@ -1186,15 +1188,15 @@ function $(e) {
|
|
|
1186
1188
|
}
|
|
1187
1189
|
//#endregion
|
|
1188
1190
|
//#region src/actions/documentProject.ts
|
|
1189
|
-
async function
|
|
1191
|
+
async function Xn(t = "MIT", n = !1) {
|
|
1190
1192
|
try {
|
|
1191
|
-
let r = await
|
|
1192
|
-
await
|
|
1193
|
-
let a = await e(
|
|
1194
|
-
a ? await yn() :
|
|
1193
|
+
let r = await w("config.json"), i = m(r.id).typeId === "connector";
|
|
1194
|
+
await jt(), i && await Be(), await mn(), await st(t), await e("bundle-analysis-reports/sonda/index.json") === null ? T(`ℹ️ Bundle sizes NOT documented, as there is no '${bn}' yet. Build the project first.`) : await jn({ moduleLevel: n }), await qt(), await Ve();
|
|
1195
|
+
let a = await e(J) !== null;
|
|
1196
|
+
a ? await yn() : T(`ℹ️ '${J}' NOT required by this project`), await o("ℹ️ Format generated files", "prettier", [
|
|
1195
1197
|
"--write",
|
|
1196
1198
|
"README.md",
|
|
1197
|
-
...a ? [
|
|
1199
|
+
...a ? [J] : []
|
|
1198
1200
|
]);
|
|
1199
1201
|
} catch (e) {
|
|
1200
1202
|
console.error("❌ Error documenting project", e), process.exit(1);
|
|
@@ -1202,7 +1204,7 @@ async function Yn(t = "MIT", n = !1) {
|
|
|
1202
1204
|
}
|
|
1203
1205
|
//#endregion
|
|
1204
1206
|
//#region src/actions/formatCode.ts
|
|
1205
|
-
async function
|
|
1207
|
+
async function Zn() {
|
|
1206
1208
|
try {
|
|
1207
1209
|
s("Format Code");
|
|
1208
1210
|
let e = [
|
|
@@ -1214,33 +1216,33 @@ async function Xn() {
|
|
|
1214
1216
|
"app",
|
|
1215
1217
|
"src",
|
|
1216
1218
|
"tests"
|
|
1217
|
-
].filter((e) =>
|
|
1219
|
+
].filter((e) => oe(e)).map((e) => `${e}/**`)
|
|
1218
1220
|
];
|
|
1219
|
-
await o("1️⃣ Format", "prettier", e),
|
|
1221
|
+
await o("1️⃣ Format", "prettier", e), S("Code formatted");
|
|
1220
1222
|
} catch (e) {
|
|
1221
1223
|
console.error("❌ Error formatting code", e), process.exit(1);
|
|
1222
1224
|
}
|
|
1223
1225
|
}
|
|
1224
1226
|
//#endregion
|
|
1225
1227
|
//#region src/actions/lintCode.ts
|
|
1226
|
-
async function
|
|
1228
|
+
async function Qn() {
|
|
1227
1229
|
try {
|
|
1228
|
-
s("Lint Code"), await o("1️⃣ Lint", "eslint", ["."]),
|
|
1230
|
+
s("Lint Code"), await o("1️⃣ Lint", "eslint", ["."]), S("Code linted");
|
|
1229
1231
|
} catch (e) {
|
|
1230
1232
|
console.error("❌ Error linting code", e), process.exit(1);
|
|
1231
1233
|
}
|
|
1232
1234
|
}
|
|
1233
1235
|
//#endregion
|
|
1234
1236
|
//#region src/utilities/cloudflare.ts
|
|
1235
|
-
async function
|
|
1236
|
-
let e = await
|
|
1237
|
+
async function $n() {
|
|
1238
|
+
let e = await w("config.json"), t = {
|
|
1237
1239
|
body: JSON.stringify(e),
|
|
1238
1240
|
headers: { "Content-Type": "application/json" },
|
|
1239
1241
|
method: "PUT"
|
|
1240
1242
|
}, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
|
|
1241
1243
|
if (!n.ok) throw Error(await n.text());
|
|
1242
1244
|
}
|
|
1243
|
-
async function
|
|
1245
|
+
async function er(e, t) {
|
|
1244
1246
|
async function n(e, t, r) {
|
|
1245
1247
|
for (let i of r) {
|
|
1246
1248
|
let r = `${e}/${i}`, a = `${t}/${i}`;
|
|
@@ -1258,7 +1260,7 @@ async function $n(e, t) {
|
|
|
1258
1260
|
let r = await y(`${e}/${t}/`);
|
|
1259
1261
|
await n(`${e}/${t}`, t, r);
|
|
1260
1262
|
}
|
|
1261
|
-
async function
|
|
1263
|
+
async function tr(e) {
|
|
1262
1264
|
let t = e.id, n = {
|
|
1263
1265
|
body: JSON.stringify(e),
|
|
1264
1266
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1266,7 +1268,7 @@ async function er(e) {
|
|
|
1266
1268
|
}, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
|
|
1267
1269
|
if (!r.ok) throw Error(await r.text());
|
|
1268
1270
|
}
|
|
1269
|
-
async function
|
|
1271
|
+
async function nr(e, t) {
|
|
1270
1272
|
let n = `v${e.version ?? "unknown"}`;
|
|
1271
1273
|
async function r(e, r = "") {
|
|
1272
1274
|
let i = await y(e, { withFileTypes: !0 });
|
|
@@ -1290,34 +1292,34 @@ async function tr(e, t) {
|
|
|
1290
1292
|
}
|
|
1291
1293
|
//#endregion
|
|
1292
1294
|
//#region src/actions/publishProject.ts
|
|
1293
|
-
async function
|
|
1295
|
+
async function rr() {
|
|
1294
1296
|
try {
|
|
1295
1297
|
s("Publish Project");
|
|
1296
|
-
let e = await
|
|
1297
|
-
n.publishedTo === "npm" ? await o("1️⃣ Publish to npm", "npm", ["publish", "--provenance"]) :
|
|
1298
|
+
let e = await w("package.json"), t = await w("config.json"), n = m(t.id);
|
|
1299
|
+
n.publishedTo === "npm" ? await o("1️⃣ Publish to npm", "npm", ["publish", "--provenance"]) : T("1️⃣ Publishing to npm NOT required"), await ir("2️⃣ ", e, t, n), n.publishedTo === "kb" && await o("3️⃣ Deploy", "npm", ["run", "deploy"]), S(`Project version '${e.version ?? "unknown"}' published.`);
|
|
1298
1300
|
} catch (e) {
|
|
1299
1301
|
console.error("❌ Error publishing project", e), process.exit(1);
|
|
1300
1302
|
}
|
|
1301
1303
|
}
|
|
1302
|
-
async function
|
|
1303
|
-
if (r.typeId === "app")
|
|
1304
|
-
else if (r.typeId === "engine")
|
|
1305
|
-
else if (r.uploadGroupName === void 0)
|
|
1304
|
+
async function ir(e, t, n, r) {
|
|
1305
|
+
if (r.typeId === "app") T(`${e} Register module`), await $n();
|
|
1306
|
+
else if (r.typeId === "engine") T(`${e} Register module`), await nr(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await tr(n);
|
|
1307
|
+
else if (r.uploadGroupName === void 0) T(`${e} Registration NOT required`);
|
|
1306
1308
|
else {
|
|
1307
|
-
|
|
1309
|
+
T(`${e} Register module`);
|
|
1308
1310
|
let i = n.id.split("-").slice(2).join("-");
|
|
1309
|
-
await
|
|
1311
|
+
await nr(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await tr(n);
|
|
1310
1312
|
}
|
|
1311
1313
|
}
|
|
1312
1314
|
//#endregion
|
|
1313
1315
|
//#region src/actions/releaseProject.ts
|
|
1314
|
-
async function
|
|
1316
|
+
async function ar(e = "MIT", t = !1) {
|
|
1315
1317
|
try {
|
|
1316
1318
|
s("Release Project");
|
|
1317
|
-
let n = await
|
|
1319
|
+
let n = await w("package.json"), r = await w("config.json"), i = m(r.id);
|
|
1318
1320
|
await d("1️⃣ ", n);
|
|
1319
|
-
let a = await
|
|
1320
|
-
if (await
|
|
1321
|
+
let a = await x("2️⃣ ", n, i);
|
|
1322
|
+
if (await xe("3️⃣ ", n), T("4️⃣ Regenerate README"), await Xn(e, t), await b("5️⃣ Stage changes", "git", ["add", "."]), await b("6️⃣ Commit changes", "git", [
|
|
1321
1323
|
"commit",
|
|
1322
1324
|
"-m",
|
|
1323
1325
|
`v${n.version ?? "unknown"}`
|
|
@@ -1325,7 +1327,7 @@ async function ir(e = "MIT", t = !1) {
|
|
|
1325
1327
|
"push",
|
|
1326
1328
|
"origin",
|
|
1327
1329
|
"main:main"
|
|
1328
|
-
]), await
|
|
1330
|
+
]), await ir("8️⃣ ", n, a, i), i.publishedTo === "npm") {
|
|
1329
1331
|
let e = `v${n.version ?? "unknown"}`;
|
|
1330
1332
|
await o("9️⃣ Trigger GitHub release", "gh", [
|
|
1331
1333
|
"release",
|
|
@@ -1336,19 +1338,19 @@ async function ir(e = "MIT", t = !1) {
|
|
|
1336
1338
|
"--generate-notes",
|
|
1337
1339
|
"--latest"
|
|
1338
1340
|
]);
|
|
1339
|
-
} else
|
|
1340
|
-
|
|
1341
|
+
} else T(`9️⃣ Publishing NOT required for package with type identifier of '${i.typeId}'.`);
|
|
1342
|
+
S(`Project version '${n.version ?? "unknown"}' released.`);
|
|
1341
1343
|
} catch (e) {
|
|
1342
1344
|
console.error("❌ Error releasing project", e), process.exit(1);
|
|
1343
1345
|
}
|
|
1344
1346
|
}
|
|
1345
1347
|
//#endregion
|
|
1346
1348
|
//#region src/actions/syncProjectWithGitHub.ts
|
|
1347
|
-
async function
|
|
1349
|
+
async function or() {
|
|
1348
1350
|
try {
|
|
1349
1351
|
s("Synchronise Project with GitHub");
|
|
1350
|
-
let e = await
|
|
1351
|
-
await d("1️⃣ ", e), await
|
|
1352
|
+
let e = await w("package.json"), t = await w("config.json"), n = m(t.id);
|
|
1353
|
+
await d("1️⃣ ", e), await x("2️⃣ ", e, n), await b("3️⃣ Stage changes", "git", ["add", "."]), await b("4️⃣ Commit changes", "git", [
|
|
1352
1354
|
"commit",
|
|
1353
1355
|
"-m",
|
|
1354
1356
|
`v${e.version ?? "unknown"}`
|
|
@@ -1356,19 +1358,19 @@ async function ar() {
|
|
|
1356
1358
|
"push",
|
|
1357
1359
|
"origin",
|
|
1358
1360
|
"main:main"
|
|
1359
|
-
]),
|
|
1361
|
+
]), S(`Project version '${e.version ?? "unknown"}' synchronised with GitHub.`);
|
|
1360
1362
|
} catch (e) {
|
|
1361
1363
|
console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
|
|
1362
1364
|
}
|
|
1363
1365
|
}
|
|
1364
1366
|
//#endregion
|
|
1365
1367
|
//#region src/actions/testProject.ts
|
|
1366
|
-
var
|
|
1368
|
+
var sr = [
|
|
1367
1369
|
"1️⃣ ",
|
|
1368
1370
|
"2️⃣ ",
|
|
1369
1371
|
"3️⃣ ",
|
|
1370
1372
|
"4️⃣ "
|
|
1371
|
-
],
|
|
1373
|
+
], cr = [{
|
|
1372
1374
|
id: "unit",
|
|
1373
1375
|
label: "Run unit tests",
|
|
1374
1376
|
command: "vitest",
|
|
@@ -1381,30 +1383,30 @@ var or = [
|
|
|
1381
1383
|
arguments: ["test", "--pass-with-no-tests"],
|
|
1382
1384
|
configFileName: "playwright.config.ts"
|
|
1383
1385
|
}];
|
|
1384
|
-
async function
|
|
1386
|
+
async function lr(t = ["unit"]) {
|
|
1385
1387
|
try {
|
|
1386
1388
|
s("Test Project");
|
|
1387
1389
|
let n = 0;
|
|
1388
|
-
for (let r of
|
|
1390
|
+
for (let r of cr) {
|
|
1389
1391
|
if (!t.includes(r.id) || await e(r.configFileName) === null) continue;
|
|
1390
|
-
let i = `${
|
|
1392
|
+
let i = `${sr[n] ?? ""} ${r.label}`;
|
|
1391
1393
|
await o(i, r.command, r.arguments), n += 1;
|
|
1392
1394
|
}
|
|
1393
1395
|
if (n === 0) {
|
|
1394
1396
|
console.warn("\n⚠️ No tests configured for this project.\n");
|
|
1395
1397
|
return;
|
|
1396
1398
|
}
|
|
1397
|
-
|
|
1399
|
+
S("Project tested");
|
|
1398
1400
|
} catch (e) {
|
|
1399
1401
|
console.error("❌ Error testing project", e), process.exit(1);
|
|
1400
1402
|
}
|
|
1401
1403
|
}
|
|
1402
1404
|
//#endregion
|
|
1403
1405
|
//#region src/actions/triggerGitHubRelease.ts
|
|
1404
|
-
async function
|
|
1406
|
+
async function ur() {
|
|
1405
1407
|
try {
|
|
1406
1408
|
s("Trigger GitHub Release");
|
|
1407
|
-
let e = `v${(await
|
|
1409
|
+
let e = `v${(await w("package.json")).version ?? "unknown"}`;
|
|
1408
1410
|
await o("1️⃣ Trigger GitHub release", "gh", [
|
|
1409
1411
|
"release",
|
|
1410
1412
|
"create",
|
|
@@ -1413,10 +1415,10 @@ async function lr() {
|
|
|
1413
1415
|
"main",
|
|
1414
1416
|
"--generate-notes",
|
|
1415
1417
|
"--latest"
|
|
1416
|
-
]),
|
|
1418
|
+
]), S(`GitHub release '${e}' created.`);
|
|
1417
1419
|
} catch (e) {
|
|
1418
1420
|
console.error("❌ Error triggering GitHub release", e), process.exit(1);
|
|
1419
1421
|
}
|
|
1420
1422
|
}
|
|
1421
1423
|
//#endregion
|
|
1422
|
-
export {
|
|
1424
|
+
export { ge as auditDependencies, be as buildProject, Pe as checkProject, Xn as documentProject, Zn as formatCode, Qn as lintCode, rr as publishProject, ar as releaseProject, or as syncProjectWithGitHub, lr as testProject, ur as triggerGitHubRelease, er as uploadDirectoryToR2 };
|