@dpuse/dpuse-development 0.3.751 → 0.3.753
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/.github/workflows/codeql.yml +3 -0
- package/README.md +63 -46
- package/dist/dpuse-development.es.js +450 -424
- package/dist/dpuse-development.es.js.map +1 -1
- package/dist/types/src/utilities/index.d.ts +3 -3
- package/package.json +6 -2
- package/vitest.config.ts +3 -2
- package/dist/types/eslint.config.d.ts +0 -3
- package/dist/types/eslint.config.default.d.ts +0 -3
- package/dist/types/tests/utilities/index.fuzz.test.d.ts +0 -1
- package/dist/types/vite.config.d.ts +0 -2
- package/dist/types/vite.config.default.d.ts +0 -2
- package/dist/types/vite.config.tool.d.ts +0 -2
- package/dist/types/vite.config.wasm.d.ts +0 -2
- package/dist/types/vitest.config.d.ts +0 -2
|
@@ -5655,7 +5655,7 @@ function An(e) {
|
|
|
5655
5655
|
}
|
|
5656
5656
|
//#endregion
|
|
5657
5657
|
//#region src/utilities/index.ts
|
|
5658
|
-
var jn = [
|
|
5658
|
+
var jn = "code-health-reports/fallow", Mn = `${jn}/badge.json`, Nn = `${jn}/index.md`, Pn = [
|
|
5659
5659
|
{
|
|
5660
5660
|
idPrefix: "dpuse-app",
|
|
5661
5661
|
typeId: "app",
|
|
@@ -5740,8 +5740,8 @@ var jn = [
|
|
|
5740
5740
|
publishedTo: "github",
|
|
5741
5741
|
uploadGroupName: void 0
|
|
5742
5742
|
}
|
|
5743
|
-
],
|
|
5744
|
-
async function
|
|
5743
|
+
], Fn = r(i);
|
|
5744
|
+
async function In(e, r) {
|
|
5745
5745
|
e !== void 0 && q(`${e} - clear(${r})`);
|
|
5746
5746
|
let i;
|
|
5747
5747
|
try {
|
|
@@ -5762,12 +5762,12 @@ async function Nn(e, r) {
|
|
|
5762
5762
|
}
|
|
5763
5763
|
}));
|
|
5764
5764
|
}
|
|
5765
|
-
async function
|
|
5765
|
+
async function Ln(e, n) {
|
|
5766
5766
|
return t.readdir(e, n);
|
|
5767
5767
|
}
|
|
5768
|
-
async function
|
|
5768
|
+
async function Rn(e, n, r, i) {
|
|
5769
5769
|
e !== void 0 && q(`${e} - exec(${n} ${r.join(" ")})`);
|
|
5770
|
-
let { stdout: a, stderr: o } = await
|
|
5770
|
+
let { stdout: a, stderr: o } = await Fn(n, r);
|
|
5771
5771
|
i === void 0 ? a.trim() && console.log(a.trim()) : await t.writeFile(i, a.trim(), "utf-8"), o.trim() && console.error(o.trim());
|
|
5772
5772
|
}
|
|
5773
5773
|
async function U(e, t, n, r = !1, i = !1) {
|
|
@@ -5780,7 +5780,7 @@ async function U(e, t, n, r = !1, i = !1) {
|
|
|
5780
5780
|
});
|
|
5781
5781
|
});
|
|
5782
5782
|
}
|
|
5783
|
-
async function
|
|
5783
|
+
async function zn(e, r, i, o, s = !1) {
|
|
5784
5784
|
return q(`${e} - spawn(${r} ${i.join(" ")}) > ${o}`), new Promise((e, c) => {
|
|
5785
5785
|
let l = a(r, i, {
|
|
5786
5786
|
shell: !1,
|
|
@@ -5806,10 +5806,10 @@ async function In(e, r, i, o, s = !1) {
|
|
|
5806
5806
|
async function W(e) {
|
|
5807
5807
|
return JSON.parse(await t.readFile(e, "utf-8"));
|
|
5808
5808
|
}
|
|
5809
|
-
async function
|
|
5809
|
+
async function Bn(e) {
|
|
5810
5810
|
return await t.readFile(e, "utf-8");
|
|
5811
5811
|
}
|
|
5812
|
-
async function
|
|
5812
|
+
async function Vn(e) {
|
|
5813
5813
|
try {
|
|
5814
5814
|
return await t.readFile(e, "utf-8");
|
|
5815
5815
|
} catch (e) {
|
|
@@ -5817,13 +5817,13 @@ async function Rn(e) {
|
|
|
5817
5817
|
throw e;
|
|
5818
5818
|
}
|
|
5819
5819
|
}
|
|
5820
|
-
async function
|
|
5820
|
+
async function Hn(e, n) {
|
|
5821
5821
|
await t.writeFile(e, JSON.stringify(n, void 0, 4), "utf-8");
|
|
5822
5822
|
}
|
|
5823
|
-
async function
|
|
5824
|
-
await
|
|
5823
|
+
async function Un(e, t, n) {
|
|
5824
|
+
await Wn("README.md", Xn(await Bn("./README.md"), e, t, n));
|
|
5825
5825
|
}
|
|
5826
|
-
async function
|
|
5826
|
+
async function Wn(e, n) {
|
|
5827
5827
|
await t.writeFile(e, n, "utf-8");
|
|
5828
5828
|
}
|
|
5829
5829
|
function G(e) {
|
|
@@ -5836,12 +5836,12 @@ function K(e) {
|
|
|
5836
5836
|
function q(e) {
|
|
5837
5837
|
console.info(`\n${e}\n`);
|
|
5838
5838
|
}
|
|
5839
|
-
function
|
|
5840
|
-
let t =
|
|
5839
|
+
function Gn(e) {
|
|
5840
|
+
let t = Pn.find((t) => e.startsWith(t.idPrefix));
|
|
5841
5841
|
if (!t) throw Error(`Failed to locate module type configuration for identifier '${e}'.`);
|
|
5842
5842
|
return t;
|
|
5843
5843
|
}
|
|
5844
|
-
function
|
|
5844
|
+
function Kn(e, t) {
|
|
5845
5845
|
let n = e.repository, r = typeof n == "string" ? n : n?.url;
|
|
5846
5846
|
if (r == null || r === "") throw Error(`package.json 'repository' field is required to ${t}.`);
|
|
5847
5847
|
let i = r.replace(/^git\+/, "").replace(/\.git$/, ""), a = /github\.com[/:]([^/]+)\/([^/]+)$/.exec(i);
|
|
@@ -5851,16 +5851,16 @@ function Un(e, t) {
|
|
|
5851
5851
|
repo: a[2]
|
|
5852
5852
|
};
|
|
5853
5853
|
}
|
|
5854
|
-
async function
|
|
5854
|
+
async function qn(e) {
|
|
5855
5855
|
return await t.stat(e);
|
|
5856
5856
|
}
|
|
5857
|
-
function
|
|
5857
|
+
function Jn(e) {
|
|
5858
5858
|
let t = k.extend(An()).parse(e, {
|
|
5859
5859
|
ecmaVersion: "latest",
|
|
5860
5860
|
sourceType: "module",
|
|
5861
5861
|
locations: !0
|
|
5862
5862
|
}), n = [];
|
|
5863
|
-
return
|
|
5863
|
+
return Yn(t, (e) => {
|
|
5864
5864
|
if (e.type !== "MethodDefinition") return;
|
|
5865
5865
|
let t = e, r = t.key;
|
|
5866
5866
|
if (r.type !== "Identifier") return;
|
|
@@ -5868,7 +5868,7 @@ function Gn(e) {
|
|
|
5868
5868
|
i && i !== "constructor" && t.accessibility !== "private" && n.push(i);
|
|
5869
5869
|
}), n;
|
|
5870
5870
|
}
|
|
5871
|
-
function
|
|
5871
|
+
function Yn(e, t) {
|
|
5872
5872
|
t(e);
|
|
5873
5873
|
for (let [n, r] of Object.entries(e)) {
|
|
5874
5874
|
if ([
|
|
@@ -5881,12 +5881,12 @@ function Kn(e, t) {
|
|
|
5881
5881
|
let e = r;
|
|
5882
5882
|
if (Array.isArray(e)) for (let n of e) {
|
|
5883
5883
|
let e = n;
|
|
5884
|
-
e && typeof e.type == "string" &&
|
|
5884
|
+
e && typeof e.type == "string" && Yn(e, t);
|
|
5885
5885
|
}
|
|
5886
|
-
else e && typeof e == "object" && typeof e.type == "string" &&
|
|
5886
|
+
else e && typeof e == "object" && typeof e.type == "string" && Yn(e, t);
|
|
5887
5887
|
}
|
|
5888
5888
|
}
|
|
5889
|
-
function
|
|
5889
|
+
function Xn(e, t, n, r) {
|
|
5890
5890
|
let i = e.indexOf(n), a = e.indexOf(r);
|
|
5891
5891
|
if (i === -1 || a === -1) throw Error(`Markers ${n}-${r} not found in content.`);
|
|
5892
5892
|
let o = t.trim();
|
|
@@ -5894,7 +5894,7 @@ function qn(e, t, n, r) {
|
|
|
5894
5894
|
}
|
|
5895
5895
|
//#endregion
|
|
5896
5896
|
//#region src/actions/auditDependencies.ts
|
|
5897
|
-
async function
|
|
5897
|
+
async function Zn() {
|
|
5898
5898
|
try {
|
|
5899
5899
|
G("Audit Dependencies"), await U("1️⃣ Check using 'npm audit'", "npm", ["audit"]), K("Dependencies audited");
|
|
5900
5900
|
} catch (e) {
|
|
@@ -5903,20 +5903,20 @@ async function Jn() {
|
|
|
5903
5903
|
}
|
|
5904
5904
|
//#endregion
|
|
5905
5905
|
//#region src/actions/checkConfigFiles.ts
|
|
5906
|
-
var
|
|
5907
|
-
async function
|
|
5906
|
+
var Qn = "@dpuse/dpuse-development/prettierrc", $n = "dpuse-development";
|
|
5907
|
+
async function er() {
|
|
5908
5908
|
try {
|
|
5909
5909
|
G("Check configuration files"), q("1️⃣ Check individual files");
|
|
5910
|
-
let e = await W("config.json"), t = await W("package.json"), r = t.private === !0, i =
|
|
5911
|
-
await J(a, ".editorconfig"), await
|
|
5910
|
+
let e = await W("config.json"), t = await W("package.json"), r = t.private === !0, i = Gn(e.id), a = n.dirname(o(import.meta.url));
|
|
5911
|
+
await J(a, ".editorconfig"), await tr(i, a), await J(a, ".gitignore", [".gitignore_default"]), await J(a, ".markdownlint.json"), await J(a, ".ncurc.json"), await nr(i, a), await J(a, "LICENSE"), await ir(i, a), await ar(i, a), await or(i, a), await cr(i, a), rr(i, t), await J(a, ".github/dependabot.yml", [r ? ".github/dependabot.private.yml" : ".github/dependabot.yml"]), r ? console.info("ℹ️ GitHub workflows and file 'SECURITY.md' are NOT required by this project") : (await sr(i, a), await J(a, "SECURITY.md", [], (t) => t.replaceAll($n, () => e.id))), K("Configuration files checked");
|
|
5912
5912
|
} catch (e) {
|
|
5913
5913
|
console.error("❌ Error checking configuration files", e), process.exit(1);
|
|
5914
5914
|
}
|
|
5915
5915
|
}
|
|
5916
|
-
async function
|
|
5916
|
+
async function tr(e, t) {
|
|
5917
5917
|
["development"].includes(e.typeId) ? console.info("ℹ️ File '.gitattributes' is UNIQUE to this project") : await J(t, ".gitattributes", [".gitattributes_default"]);
|
|
5918
5918
|
}
|
|
5919
|
-
async function
|
|
5919
|
+
async function nr(e, t) {
|
|
5920
5920
|
["github", "kb"].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is NOT required by this project") : [
|
|
5921
5921
|
"app",
|
|
5922
5922
|
"api",
|
|
@@ -5924,10 +5924,10 @@ async function $n(e, t) {
|
|
|
5924
5924
|
"eslint"
|
|
5925
5925
|
].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is UNIQUE to this project") : await J(t, "eslint.config.js", ["eslint.config.default.js"]);
|
|
5926
5926
|
}
|
|
5927
|
-
function
|
|
5928
|
-
["app", "development"].includes(e.typeId) ? console.info("ℹ️ File '.prettierrc.json' is UNIQUE to this project") : t.prettier ===
|
|
5927
|
+
function rr(e, t) {
|
|
5928
|
+
["app", "development"].includes(e.typeId) ? console.info("ℹ️ File '.prettierrc.json' is UNIQUE to this project") : t.prettier === Qn ? console.info(`ℹ️ Prettier configuration is '${Qn}'`) : console.info(`⚠️ Prettier configuration is NOT '${Qn}'`);
|
|
5929
5929
|
}
|
|
5930
|
-
async function
|
|
5930
|
+
async function ir(e, t) {
|
|
5931
5931
|
["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.json' is NOT required by this project") : [
|
|
5932
5932
|
"connector",
|
|
5933
5933
|
"engine",
|
|
@@ -5935,10 +5935,10 @@ async function tr(e, t) {
|
|
|
5935
5935
|
"tool"
|
|
5936
5936
|
].includes(e.typeId) ? await J(t, "tsconfig.json", ["tsconfig.default.json"]) : console.info("ℹ️ File 'tsconfig.json' is UNIQUE to this project");
|
|
5937
5937
|
}
|
|
5938
|
-
async function
|
|
5938
|
+
async function ar(e, t) {
|
|
5939
5939
|
["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.scripts.json' is NOT required by this project") : await J(t, "tsconfig.scripts.json");
|
|
5940
5940
|
}
|
|
5941
|
-
async function
|
|
5941
|
+
async function or(e, t) {
|
|
5942
5942
|
if ([
|
|
5943
5943
|
"eslint",
|
|
5944
5944
|
"github",
|
|
@@ -5956,10 +5956,10 @@ async function rr(e, t) {
|
|
|
5956
5956
|
n = e.typeId === "connector" ? ["vite.config.default.ts", "vite.config.wasm.ts"] : e.typeId === "tool" ? ["vite.config.tool.ts"] : ["vite.config.default.ts"], await J(t, "vite.config.ts", n);
|
|
5957
5957
|
}
|
|
5958
5958
|
}
|
|
5959
|
-
async function
|
|
5959
|
+
async function sr(e, t) {
|
|
5960
5960
|
await J(t, ".github/workflows/ci.yml"), await J(t, ".github/workflows/codeql.yml"), await J(t, ".github/workflows/publish.yml", [e.publishedTo === "npm" ? ".github/workflows/publish.yml" : ".github/publish.cloudflare.yml"]), await J(t, ".github/workflows/scorecard.yml");
|
|
5961
5961
|
}
|
|
5962
|
-
async function
|
|
5962
|
+
async function cr(e, t) {
|
|
5963
5963
|
[
|
|
5964
5964
|
"app",
|
|
5965
5965
|
"api",
|
|
@@ -5971,7 +5971,7 @@ async function ar(e, t) {
|
|
|
5971
5971
|
async function J(e, t, r = [], i = (e) => e) {
|
|
5972
5972
|
let a = n.resolve(process.cwd(), t), o = r.length > 0 ? r : [t], s;
|
|
5973
5973
|
try {
|
|
5974
|
-
s = await
|
|
5974
|
+
s = await Bn(a);
|
|
5975
5975
|
} catch (e) {
|
|
5976
5976
|
if (e.code !== "ENOENT") throw e;
|
|
5977
5977
|
}
|
|
@@ -5980,7 +5980,7 @@ async function J(e, t, r = [], i = (e) => e) {
|
|
|
5980
5980
|
return;
|
|
5981
5981
|
}
|
|
5982
5982
|
for (let r of o) {
|
|
5983
|
-
let a = i(await
|
|
5983
|
+
let a = i(await Bn(n.resolve(e, `../${r}`)));
|
|
5984
5984
|
if (s === a) {
|
|
5985
5985
|
console.info(`ℹ️ File '${t.split("_", 1)[0] ?? t}' is the same as '${r}'`);
|
|
5986
5986
|
return;
|
|
@@ -5990,7 +5990,7 @@ async function J(e, t, r = [], i = (e) => e) {
|
|
|
5990
5990
|
}
|
|
5991
5991
|
//#endregion
|
|
5992
5992
|
//#region src/actions/checkDependencies.ts
|
|
5993
|
-
async function
|
|
5993
|
+
async function lr() {
|
|
5994
5994
|
try {
|
|
5995
5995
|
G("Check Dependencies"), await U("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), q("2️⃣ Check using 'npm-check-updates'");
|
|
5996
5996
|
let e = {};
|
|
@@ -6010,7 +6010,7 @@ async function or() {
|
|
|
6010
6010
|
"--prefer-online",
|
|
6011
6011
|
"--no-strict-allow-scripts"
|
|
6012
6012
|
]);
|
|
6013
|
-
let t = await
|
|
6013
|
+
let t = await ur();
|
|
6014
6014
|
t.length > 0 ? await U("4️⃣ Move install-script pins to installed versions", "npm", [
|
|
6015
6015
|
"install-scripts",
|
|
6016
6016
|
"approve",
|
|
@@ -6024,85 +6024,85 @@ async function or() {
|
|
|
6024
6024
|
console.error("❌ Error checking dependencies", e), process.exit(1);
|
|
6025
6025
|
}
|
|
6026
6026
|
}
|
|
6027
|
-
async function
|
|
6027
|
+
async function ur() {
|
|
6028
6028
|
let { allowScripts: e = {} } = await W(n.resolve(process.cwd(), "package.json")), t = Object.entries(e).filter(([e, t]) => t && e.lastIndexOf("@") > 0).map(([e]) => e.slice(0, e.lastIndexOf("@")));
|
|
6029
6029
|
return [...new Set(t)];
|
|
6030
6030
|
}
|
|
6031
6031
|
//#endregion
|
|
6032
6032
|
//#region src/actions/documentBundleSizes.ts
|
|
6033
|
-
var
|
|
6034
|
-
async function
|
|
6033
|
+
var dr = "<!-- BUNDLE_START -->", fr = "<!-- BUNDLE_END -->", pr = " ", mr = 20, hr = "This report is updated each time the project is built, 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._", gr = "(bundler output, whitespace & JSON)", _r = `${gr} = 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.`;
|
|
6034
|
+
async function vr(e) {
|
|
6035
6035
|
try {
|
|
6036
6036
|
G("Document Bundle Sizes"), q("1️⃣ Read bundle analysis report");
|
|
6037
6037
|
let t = await W("./bundle-analysis-reports/sonda/index.json");
|
|
6038
|
-
q("2️⃣ Insert table into 'README.md'"), await
|
|
6038
|
+
q("2️⃣ Insert table into 'README.md'"), await Un(`## Bundle Analysis\n\n${hr}\n\n${yr(t, e?.moduleLevel ?? !1)}\n\n${_r}`, dr, fr), K("Bundle sizes documented");
|
|
6039
6039
|
} catch (e) {
|
|
6040
6040
|
console.error("❌ Error documenting bundle sizes", e), process.exit(1);
|
|
6041
6041
|
}
|
|
6042
6042
|
}
|
|
6043
|
-
function
|
|
6044
|
-
let n =
|
|
6043
|
+
function yr(e, t) {
|
|
6044
|
+
let n = Er(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, Ar(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), a = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
|
|
6045
6045
|
for (let [e, o] of i) {
|
|
6046
|
-
let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted((e, t) => t[1].sizes.uncompressed - e[1].sizes.uncompressed), s = i.length === 1 ?
|
|
6046
|
+
let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted((e, t) => t[1].sizes.uncompressed - e[1].sizes.uncompressed), s = i.length === 1 ? br(e, o, wr(i), r, t) : xr(e, o, i, r, t);
|
|
6047
6047
|
a.push(...s);
|
|
6048
6048
|
}
|
|
6049
6049
|
return a.join("\n");
|
|
6050
6050
|
}
|
|
6051
|
-
function
|
|
6051
|
+
function br(e, t, n, r, i) {
|
|
6052
6052
|
let [a, { sizes: o, files: s }] = n, c = r > 0 ? o.uncompressed / r * 100 : 0;
|
|
6053
|
-
if (s.size === 1) return [`| ${e} → ${
|
|
6054
|
-
let l = [`| ${e} → ${a} | ${
|
|
6055
|
-
return i || l.push(...
|
|
6053
|
+
if (s.size === 1) return [`| ${e} → ${Cr(a, Tr(s))} | ${jr(t)} · ${Mr(c)} |`];
|
|
6054
|
+
let l = [`| ${e} → ${a} | ${jr(t)} · ${Mr(c)} |`];
|
|
6055
|
+
return i || l.push(...Sr(s, pr, r)), l;
|
|
6056
6056
|
}
|
|
6057
|
-
function
|
|
6058
|
-
let a = [`| ${e} | ${
|
|
6057
|
+
function xr(e, t, n, r, i) {
|
|
6058
|
+
let a = [`| ${e} | ${jr(t)} |`];
|
|
6059
6059
|
for (let [e, { sizes: t, files: o }] of n) {
|
|
6060
6060
|
let n = r > 0 ? t.uncompressed / r * 100 : 0;
|
|
6061
6061
|
if (o.size === 1) {
|
|
6062
|
-
let t =
|
|
6063
|
-
a.push(`| ${
|
|
6062
|
+
let t = Tr(o);
|
|
6063
|
+
a.push(`| ${pr}${Cr(e, t)} | ${Mr(n)} |`);
|
|
6064
6064
|
continue;
|
|
6065
6065
|
}
|
|
6066
|
-
a.push(`| ${
|
|
6066
|
+
a.push(`| ${pr}${e} | ${Mr(n)} |`), i || a.push(...Sr(o, `${pr}${pr}`, r));
|
|
6067
6067
|
}
|
|
6068
6068
|
return a;
|
|
6069
6069
|
}
|
|
6070
|
-
function
|
|
6071
|
-
return [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed).map(([e, r]) => `| ${t}${e} | ${
|
|
6070
|
+
function Sr(e, t, n) {
|
|
6071
|
+
return [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed).map(([e, r]) => `| ${t}${e} | ${Mr(n > 0 ? r.uncompressed / n * 100 : 0)} |`);
|
|
6072
6072
|
}
|
|
6073
|
-
function
|
|
6073
|
+
function Cr(e, t) {
|
|
6074
6074
|
return t === "" ? e : `${e} → ${t}`;
|
|
6075
6075
|
}
|
|
6076
|
-
function
|
|
6076
|
+
function wr(e) {
|
|
6077
6077
|
let [t] = e;
|
|
6078
6078
|
if (t === void 0) throw Error("Expected exactly one entry");
|
|
6079
6079
|
return t;
|
|
6080
6080
|
}
|
|
6081
|
-
function
|
|
6081
|
+
function Tr(e) {
|
|
6082
6082
|
let [t] = e.keys();
|
|
6083
6083
|
if (t === void 0) throw Error("Expected exactly one file");
|
|
6084
6084
|
return t;
|
|
6085
6085
|
}
|
|
6086
|
-
function
|
|
6087
|
-
let t =
|
|
6086
|
+
function Er(e) {
|
|
6087
|
+
let t = Dr(e.dependencies), n = /* @__PURE__ */ new Map();
|
|
6088
6088
|
for (let r of e.resources) {
|
|
6089
6089
|
if (r.kind !== "chunk" || !r.parent) continue;
|
|
6090
|
-
let { group: e, file: i } =
|
|
6090
|
+
let { group: e, file: i } = Or(r.name, t), a = Ar(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
|
|
6091
6091
|
n.set(r.parent, o);
|
|
6092
6092
|
let s = o.get(e) ?? {
|
|
6093
|
-
sizes:
|
|
6093
|
+
sizes: Nr(),
|
|
6094
6094
|
files: /* @__PURE__ */ new Map()
|
|
6095
6095
|
};
|
|
6096
|
-
o.set(e, s),
|
|
6097
|
-
let c = s.files.get(i) ??
|
|
6098
|
-
s.files.set(i, c),
|
|
6096
|
+
o.set(e, s), Pr(s.sizes, a);
|
|
6097
|
+
let c = s.files.get(i) ?? Nr();
|
|
6098
|
+
s.files.set(i, c), Pr(c, a);
|
|
6099
6099
|
}
|
|
6100
6100
|
return n;
|
|
6101
6101
|
}
|
|
6102
|
-
function
|
|
6102
|
+
function Dr(e) {
|
|
6103
6103
|
return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
|
|
6104
6104
|
}
|
|
6105
|
-
function
|
|
6105
|
+
function Or(e, t) {
|
|
6106
6106
|
let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
|
|
6107
6107
|
if (n) {
|
|
6108
6108
|
let [t, r] = n;
|
|
@@ -6112,56 +6112,56 @@ function Tr(e, t) {
|
|
|
6112
6112
|
};
|
|
6113
6113
|
}
|
|
6114
6114
|
return e === "[unassigned]" ? {
|
|
6115
|
-
group:
|
|
6115
|
+
group: gr,
|
|
6116
6116
|
file: ""
|
|
6117
6117
|
} : e.startsWith("\0") ? {
|
|
6118
6118
|
group: "(runtime)",
|
|
6119
6119
|
file: e.slice(1)
|
|
6120
6120
|
} : {
|
|
6121
6121
|
group: e.startsWith("rust/") || e.includes("vite-plugin-wasm") ? "wasm" : "src",
|
|
6122
|
-
file:
|
|
6122
|
+
file: kr(e)
|
|
6123
6123
|
};
|
|
6124
6124
|
}
|
|
6125
|
-
function
|
|
6125
|
+
function kr(e) {
|
|
6126
6126
|
return e.split("/").at(-1) ?? e;
|
|
6127
6127
|
}
|
|
6128
|
-
function
|
|
6128
|
+
function Ar(e) {
|
|
6129
6129
|
return {
|
|
6130
6130
|
uncompressed: e.uncompressed,
|
|
6131
6131
|
gzip: e.gzip ?? 0
|
|
6132
6132
|
};
|
|
6133
6133
|
}
|
|
6134
|
-
function
|
|
6135
|
-
return `${
|
|
6134
|
+
function jr(e) {
|
|
6135
|
+
return `${Fr(e.uncompressed)} · gzip ${Fr(e.gzip)}`;
|
|
6136
6136
|
}
|
|
6137
|
-
function
|
|
6138
|
-
let t = Math.round(e / 100 *
|
|
6139
|
-
return `\`${"█".repeat(t)}${"░".repeat(
|
|
6137
|
+
function Mr(e) {
|
|
6138
|
+
let t = Math.round(e / 100 * mr);
|
|
6139
|
+
return `\`${"█".repeat(t)}${"░".repeat(mr - t)}\` ${e.toFixed(1)}%`;
|
|
6140
6140
|
}
|
|
6141
|
-
function
|
|
6141
|
+
function Nr() {
|
|
6142
6142
|
return {
|
|
6143
6143
|
uncompressed: 0,
|
|
6144
6144
|
gzip: 0
|
|
6145
6145
|
};
|
|
6146
6146
|
}
|
|
6147
|
-
function
|
|
6147
|
+
function Pr(e, t) {
|
|
6148
6148
|
e.uncompressed += t.uncompressed, e.gzip += t.gzip;
|
|
6149
6149
|
}
|
|
6150
|
-
function
|
|
6150
|
+
function Fr(e) {
|
|
6151
6151
|
return e < 1024 ? `${String(e)} B` : `${(e / 1024).toFixed(1)} kB`;
|
|
6152
6152
|
}
|
|
6153
6153
|
//#endregion
|
|
6154
6154
|
//#region src/actions/documentDependencies.ts
|
|
6155
|
-
var
|
|
6156
|
-
async function
|
|
6155
|
+
var Ir = "<!-- DEPENDENCY_LICENSES_START -->", Lr = "<!-- DEPENDENCY_LICENSES_END -->", Rr = "## Dependency Licenses", zr = "The dependency tree below lists every package in this project — direct and transitive — along with its installed version, release date, and update status. 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.";
|
|
6156
|
+
async function Br(e = "MIT") {
|
|
6157
6157
|
try {
|
|
6158
6158
|
G("Document Dependencies");
|
|
6159
6159
|
let t = await W("package.json");
|
|
6160
6160
|
if (t.name === "@dpuse/dpuse-development" || t.name === "@dpuse/eslint-config-dpuse") {
|
|
6161
|
-
await
|
|
6161
|
+
await Vr(t.name), K("Dependencies documented");
|
|
6162
6162
|
return;
|
|
6163
6163
|
}
|
|
6164
|
-
await
|
|
6164
|
+
await In("1️⃣ Clear downloaded licenses", "licenses/downloads"), q("2️⃣ Identify production licenses"), await new Promise((n, r) => {
|
|
6165
6165
|
let i = {
|
|
6166
6166
|
start: process.cwd(),
|
|
6167
6167
|
production: !0,
|
|
@@ -6176,41 +6176,41 @@ async function Lr(e = "MIT") {
|
|
|
6176
6176
|
c(i, (e) => {
|
|
6177
6177
|
e == null ? n() : r(e);
|
|
6178
6178
|
});
|
|
6179
|
-
}), await
|
|
6179
|
+
}), await zn("3️⃣ Identify transitive dependencies", "npm", [
|
|
6180
6180
|
"ls",
|
|
6181
6181
|
"--all",
|
|
6182
6182
|
"--json",
|
|
6183
6183
|
"--omit=dev"
|
|
6184
|
-
], "licenses/licenseTree.json"), await
|
|
6184
|
+
], "licenses/licenseTree.json"), await Hr("4️⃣ ", e), K("Dependencies documented");
|
|
6185
6185
|
} catch (e) {
|
|
6186
6186
|
console.error("❌ Error documenting dependencies", e), process.exit(1);
|
|
6187
6187
|
}
|
|
6188
6188
|
}
|
|
6189
|
-
async function
|
|
6190
|
-
q(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`), await
|
|
6189
|
+
async function Vr(e) {
|
|
6190
|
+
q(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`), await Un(`${Rr}\n\n${`> [!WARNING]\n> Dependency licenses are not documented here: ${e} is a development-only tool and is never part of a production release.`}`, Ir, Lr);
|
|
6191
6191
|
}
|
|
6192
|
-
async function
|
|
6192
|
+
async function Hr(e, t) {
|
|
6193
6193
|
q(`${e} Insert licenses into 'README.md'`);
|
|
6194
6194
|
let [n, r] = await Promise.all([W("licenses/licenses.json"), W("licenses/licenseTree.json")]), i = /* @__PURE__ */ new Map();
|
|
6195
|
-
for (let [e, t] of Object.entries(n)) i.set(e,
|
|
6195
|
+
for (let [e, t] of Object.entries(n)) i.set(e, Gr(e, t));
|
|
6196
6196
|
await Promise.all(i.values().map(async (e) => {
|
|
6197
|
-
let t = await
|
|
6197
|
+
let t = await Kr(e.name, e.installedVersion);
|
|
6198
6198
|
e.latestVersion = t.latestVersion, e.latestPublishedDate = t.latestPublishedDate, e.publishedDate = t.publishedDate;
|
|
6199
6199
|
}));
|
|
6200
|
-
let a = `${
|
|
6201
|
-
for (let e of i.values()) a +=
|
|
6200
|
+
let a = `${Ur(t)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
|
|
6201
|
+
for (let e of i.values()) a += qr(e);
|
|
6202
6202
|
let o = [];
|
|
6203
|
-
r.dependencies != null &&
|
|
6204
|
-
let s = `${
|
|
6205
|
-
await
|
|
6203
|
+
r.dependencies != null && Jr(r.dependencies, i, o, 0);
|
|
6204
|
+
let s = `${zr}\n\n${o.join("\n")}`;
|
|
6205
|
+
await Un(`${Rr}\n\n${a.trimEnd()}\n\n### Dependency Tree\n\n${s}`, Ir, Lr);
|
|
6206
6206
|
}
|
|
6207
|
-
function
|
|
6208
|
-
return `License data is
|
|
6207
|
+
function Ur(e) {
|
|
6208
|
+
return `License data is updated each time \`npm run document\` is run, using [license-checker](https://github.com/RSeidelsohn/license-checker-rseidelsohn). The following table lists all production dependencies. These dependencies (including transitive ones) have been checked and confirmed to use ${Wr(e.split(";"))} — all permissive, commercially-friendly licenses. Users of the uploaded library are covered by these checks; developers cloning this repository should independently verify development dependencies.`;
|
|
6209
6209
|
}
|
|
6210
|
-
function
|
|
6210
|
+
function Wr(e) {
|
|
6211
6211
|
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))}`;
|
|
6212
6212
|
}
|
|
6213
|
-
function
|
|
6213
|
+
function Gr(e, t) {
|
|
6214
6214
|
let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
|
|
6215
6215
|
return {
|
|
6216
6216
|
name: r,
|
|
@@ -6224,7 +6224,7 @@ function Hr(e, t) {
|
|
|
6224
6224
|
...t.licenseFile != null && { licenseFileLink: t.licenseFile }
|
|
6225
6225
|
};
|
|
6226
6226
|
}
|
|
6227
|
-
async function
|
|
6227
|
+
async function Kr(e, t) {
|
|
6228
6228
|
try {
|
|
6229
6229
|
let n = await fetch(`https://registry.npmjs.org/${encodeURIComponent(e)}`);
|
|
6230
6230
|
if (n.ok) {
|
|
@@ -6242,25 +6242,25 @@ async function Ur(e, t) {
|
|
|
6242
6242
|
publishedDate: ""
|
|
6243
6243
|
};
|
|
6244
6244
|
}
|
|
6245
|
-
function
|
|
6245
|
+
function qr(e) {
|
|
6246
6246
|
let t = e.licenseFileLink == null || e.licenseFileLink === "" ? "⚠️ No license file" : `[LICENSE](licenses/${e.licenseFileLink})`;
|
|
6247
6247
|
return `|[${e.name}](${e.repository})|${e.installedVersion}|${e.licenseTypes}|${t}|\n`;
|
|
6248
6248
|
}
|
|
6249
|
-
function
|
|
6249
|
+
function Jr(e, t, n, r) {
|
|
6250
6250
|
let i = " ".repeat(r);
|
|
6251
6251
|
for (let [a, o] of Object.entries(e)) {
|
|
6252
|
-
let e = o.version ?? "", s = t.get(`${a}@${e}`), c = s == null ? a : `[${a}](${s.repository})`, l =
|
|
6253
|
-
n.push(`${i}- **${c}** ${e}${l}`), o.dependencies != null &&
|
|
6252
|
+
let e = o.version ?? "", s = t.get(`${a}@${e}`), c = s == null ? a : `[${a}](${s.repository})`, l = Yr(s);
|
|
6253
|
+
n.push(`${i}- **${c}** ${e}${l}`), o.dependencies != null && Jr(o.dependencies, t, n, r + 1);
|
|
6254
6254
|
}
|
|
6255
6255
|
}
|
|
6256
|
-
function
|
|
6256
|
+
function Yr(e) {
|
|
6257
6257
|
if (e == null) return "";
|
|
6258
|
-
let t = e.publishedDate ?
|
|
6258
|
+
let t = e.publishedDate ? Xr(e.publishedDate.split("T", 1)[0]) : "";
|
|
6259
6259
|
if (e.latestVersion === "" || e.latestVersion === e.installedVersion) return t === "" ? "" : ` — ${t}`;
|
|
6260
|
-
let n = e.latestPublishedDate ?
|
|
6260
|
+
let n = e.latestPublishedDate ? Xr(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `**latest**: ${e.latestVersion} ❗` : `**latest**: ${e.latestVersion} — ${n} ❗`;
|
|
6261
6261
|
return t === "" ? ` — → ${r}` : ` — ${t} → ${r}`;
|
|
6262
6262
|
}
|
|
6263
|
-
function
|
|
6263
|
+
function Xr(e) {
|
|
6264
6264
|
if (e == null || e === "") return "n/a";
|
|
6265
6265
|
let t = e.split("T", 1)[0];
|
|
6266
6266
|
if (t == null || t === "") return "n/a";
|
|
@@ -6269,81 +6269,89 @@ function qr(e) {
|
|
|
6269
6269
|
}
|
|
6270
6270
|
//#endregion
|
|
6271
6271
|
//#region src/actions/documentGovernance.ts
|
|
6272
|
-
var
|
|
6272
|
+
var Zr = "<!-- GOVERNANCE_START -->", Qr = "<!-- GOVERNANCE_END -->", $r = {
|
|
6273
6273
|
"Branch-Protection": 3,
|
|
6274
6274
|
"Code-Review": 0,
|
|
6275
6275
|
Contributors: 0
|
|
6276
|
-
},
|
|
6276
|
+
}, ei = /* @__PURE__ */ new Set(["CII-Best-Practices"]), ti = "coverage/coverage-final.json", ni = "coverage/coverage-summary.json", ri = 80, ii = {
|
|
6277
6277
|
actions: "GitHub Actions",
|
|
6278
6278
|
"javascript-typescript": "JavaScript/TypeScript",
|
|
6279
6279
|
rust: "Rust"
|
|
6280
|
-
},
|
|
6280
|
+
}, ai = {
|
|
6281
6281
|
A: "brightgreen",
|
|
6282
6282
|
B: "green",
|
|
6283
6283
|
C: "yellow",
|
|
6284
6284
|
D: "orange",
|
|
6285
6285
|
F: "red"
|
|
6286
|
-
},
|
|
6287
|
-
async function
|
|
6286
|
+
}, oi = `${jn}/health.json`, si = r(i);
|
|
6287
|
+
async function ci() {
|
|
6288
6288
|
try {
|
|
6289
6289
|
G("Document Governance");
|
|
6290
|
-
let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = await
|
|
6291
|
-
q("
|
|
6292
|
-
let
|
|
6293
|
-
q("
|
|
6294
|
-
let [
|
|
6295
|
-
q("
|
|
6290
|
+
let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = await li(e), r = await ui(e, n === void 0 ? [] : ["--coverage", ti]), { owner: i, repo: a } = Kn(e, "document governance");
|
|
6291
|
+
q("4️⃣ Read security checks and settings");
|
|
6292
|
+
let o = await fi(i, a, e);
|
|
6293
|
+
q("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
|
|
6294
|
+
let [s, c] = await Promise.all([mi(`https://github.com/${i}/${a}`), hi(`github.com/${i}/${a}`)]);
|
|
6295
|
+
q("6️⃣ Insert governance content into 'README.md'"), await Un(xi(i, a, _i(e), vi(t.firstCreatedAt), {
|
|
6296
|
+
coveragePercent: n,
|
|
6297
|
+
fallowHealth: r,
|
|
6298
|
+
securitySettings: o
|
|
6299
|
+
}, s, c), Zr, Qr), K("Governance documented");
|
|
6296
6300
|
} catch (e) {
|
|
6297
6301
|
console.error("❌ Error documenting governance", e), process.exit(1);
|
|
6298
6302
|
}
|
|
6299
6303
|
}
|
|
6300
|
-
async function
|
|
6304
|
+
async function li(e) {
|
|
6305
|
+
if (e.devDependencies?.["@vitest/coverage-v8"] == null) {
|
|
6306
|
+
q("1️⃣ Test coverage NOT measured, as '@vitest/coverage-v8' is not installed");
|
|
6307
|
+
return;
|
|
6308
|
+
}
|
|
6309
|
+
await U("1️⃣ Measure test coverage", "vitest", [
|
|
6310
|
+
"run",
|
|
6311
|
+
"--passWithNoTests",
|
|
6312
|
+
"--coverage"
|
|
6313
|
+
]);
|
|
6314
|
+
let t = await Vn(ni);
|
|
6315
|
+
return t === null ? void 0 : JSON.parse(t).total.lines.pct;
|
|
6316
|
+
}
|
|
6317
|
+
async function ui(e, t) {
|
|
6301
6318
|
if (e.devDependencies?.fallow == null) {
|
|
6302
|
-
q("
|
|
6319
|
+
q("2️⃣ Code health NOT measured, as Fallow is not installed"), q("3️⃣ Code health report NOT required");
|
|
6303
6320
|
return;
|
|
6304
6321
|
}
|
|
6305
|
-
|
|
6322
|
+
await zn("2️⃣ Measure code health", "fallow", [
|
|
6306
6323
|
"health",
|
|
6307
6324
|
"--report-only",
|
|
6308
6325
|
"--format",
|
|
6309
|
-
"json"
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|Maintainability (average)|${a.toFixed(1)}|
|
|
6324
|
-
|Unused files|${o.dead_file_pct.toFixed(1)}%|
|
|
6325
|
-
|Unused exports|${o.dead_export_pct.toFixed(1)}%|
|
|
6326
|
-
|Duplicated code|${o.duplication_pct.toFixed(1)}%|
|
|
6327
|
-
|Functions over the complexity limits|${String(r)} of ${String(i)}|
|
|
6328
|
-
|Unused dependencies|${String(o.unused_dep_count)}|
|
|
6329
|
-
|Circular dependencies|${String(o.circular_dep_count)}|
|
|
6330
|
-
|Hotspots (complex and often changed)|${String(o.hotspot_count)}|
|
|
6331
|
-
|
|
6332
|
-
`;
|
|
6326
|
+
"json",
|
|
6327
|
+
...t
|
|
6328
|
+
], oi), await zn("3️⃣ Write code health report", "fallow", ["--format", "markdown"], Nn, !0);
|
|
6329
|
+
let n = await W(oi);
|
|
6330
|
+
return await di(n), n;
|
|
6331
|
+
}
|
|
6332
|
+
async function di(e) {
|
|
6333
|
+
let { score: t, grade: n } = e.health_score;
|
|
6334
|
+
await Hn(Mn, {
|
|
6335
|
+
schemaVersion: 1,
|
|
6336
|
+
label: "fallow",
|
|
6337
|
+
message: `${n} (${String(Math.round(t))})`,
|
|
6338
|
+
color: ai[n] ?? "lightgrey"
|
|
6339
|
+
});
|
|
6333
6340
|
}
|
|
6334
|
-
async function
|
|
6341
|
+
async function fi(e, t, n) {
|
|
6335
6342
|
let [r, i, a] = await Promise.all([
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6343
|
+
Vn(".github/workflows/ci.yml"),
|
|
6344
|
+
Vn(".github/workflows/codeql.yml"),
|
|
6345
|
+
Vn(".github/dependabot.yml")
|
|
6339
6346
|
]), [o, s, c, l] = await Promise.all([
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6347
|
+
pi(`repos/${e}/${t}`),
|
|
6348
|
+
pi(`repos/${e}/${t}/private-vulnerability-reporting`),
|
|
6349
|
+
pi(`repos/${e}/${t}/vulnerability-alerts`),
|
|
6350
|
+
pi(`repos/${e}/${t}/commits/main/check-runs?per_page=100`)
|
|
6344
6351
|
]), u = o === void 0 ? void 0 : JSON.parse(o).security_and_analysis, d = (e) => u?.[e] === void 0 ? void 0 : u[e].status === "enabled", f = new Set((l === void 0 ? [] : JSON.parse(l).check_runs).map((e) => e.app?.slug)), p = a?.match(/package-ecosystem:/g)?.length ?? 0, m = a?.match(/open-pull-requests-limit: 0\b/g)?.length ?? 0;
|
|
6345
6352
|
return {
|
|
6346
|
-
codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) =>
|
|
6353
|
+
codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) => ii[e] ?? e).toArray(),
|
|
6354
|
+
codeQLQueries: /queries: ([\w-]+)/.exec(i ?? "")?.[1],
|
|
6347
6355
|
dependabotAlerts: c !== void 0,
|
|
6348
6356
|
dependabotSecurityUpdates: d("dependabot_security_updates"),
|
|
6349
6357
|
dependabotVersionUpdates: p > m,
|
|
@@ -6358,37 +6366,37 @@ async function si(e, t, n) {
|
|
|
6358
6366
|
testsInCI: r?.includes("npm test") ?? !1
|
|
6359
6367
|
};
|
|
6360
6368
|
}
|
|
6361
|
-
async function
|
|
6369
|
+
async function pi(e) {
|
|
6362
6370
|
try {
|
|
6363
|
-
let { stdout: t } = await
|
|
6371
|
+
let { stdout: t } = await si("gh", ["api", e]);
|
|
6364
6372
|
return t;
|
|
6365
6373
|
} catch (e) {
|
|
6366
6374
|
if (String(e.stderr).includes("HTTP 404")) return;
|
|
6367
6375
|
throw e;
|
|
6368
6376
|
}
|
|
6369
6377
|
}
|
|
6370
|
-
async function
|
|
6378
|
+
async function mi(e) {
|
|
6371
6379
|
let t = await fetch(`https://www.bestpractices.dev/projects.json?url=${encodeURIComponent(e)}`);
|
|
6372
6380
|
if (!t.ok) throw Error(`OpenSSF Best Practices lookup failed with status ${String(t.status)}.`);
|
|
6373
6381
|
return (await t.json()).find((t) => t.repo_url === e)?.id;
|
|
6374
6382
|
}
|
|
6375
|
-
async function
|
|
6383
|
+
async function hi(e) {
|
|
6376
6384
|
let t = await fetch(`https://api.scorecard.dev/projects/${e}`);
|
|
6377
6385
|
if (t.status !== 404) {
|
|
6378
6386
|
if (!t.ok) throw Error(`OpenSSF Scorecard lookup failed with status ${String(t.status)}.`);
|
|
6379
6387
|
return await t.json();
|
|
6380
6388
|
}
|
|
6381
6389
|
}
|
|
6382
|
-
function
|
|
6383
|
-
return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 ||
|
|
6390
|
+
function gi(e) {
|
|
6391
|
+
return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || ei.has(e) || $r[e] !== void 0 && t >= $r[e]);
|
|
6384
6392
|
}
|
|
6385
|
-
function
|
|
6393
|
+
function _i(e) {
|
|
6386
6394
|
let t = e.author, n = typeof t == "string" ? t : t?.name;
|
|
6387
6395
|
if (n == null || n === "") throw Error("package.json 'author' field is required to document governance.");
|
|
6388
6396
|
let r = n.indexOf("<"), i = r === -1 ? -1 : n.indexOf(">", r);
|
|
6389
|
-
return
|
|
6397
|
+
return i === -1 ? n.trim() : [n.slice(0, r).trim(), n.slice(i + 1).trim()].filter((e) => e !== "").join(" ");
|
|
6390
6398
|
}
|
|
6391
|
-
function
|
|
6399
|
+
function vi(e) {
|
|
6392
6400
|
let t = (/* @__PURE__ */ new Date()).getFullYear();
|
|
6393
6401
|
if (e == null) return String(t);
|
|
6394
6402
|
let n = new Date(e).getFullYear();
|
|
@@ -6397,98 +6405,112 @@ function pi(e) {
|
|
|
6397
6405
|
function Y(e, t = "On") {
|
|
6398
6406
|
return e === void 0 ? "❔ Unknown" : e ? `✅ ${t}` : "❌ Off";
|
|
6399
6407
|
}
|
|
6400
|
-
function
|
|
6401
|
-
|
|
6402
|
-
return `### Checks & Settings
|
|
6403
|
-
|
|
6404
|
-
Read from the repository each time this README is generated, so the status is current as of the latest release.
|
|
6408
|
+
function yi(e, t) {
|
|
6409
|
+
return t.length === 0 ? "" : `### ${e}
|
|
6405
6410
|
|
|
6406
6411
|
|Check or setting|Status|What it does|
|
|
6407
6412
|
|:-|:-|:-|
|
|
6408
|
-
${
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6413
|
+
${t.map((e) => `|${e.join("|")}|`).join("\n")}
|
|
6414
|
+
|
|
6415
|
+
`;
|
|
6416
|
+
}
|
|
6417
|
+
function bi(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
|
|
6418
|
+
let a = `https://github.com/${e}/${t}`, o = [[
|
|
6419
|
+
`[SonarCloud](https://sonarcloud.io/summary/new_code?id=${e}_${t})`,
|
|
6420
|
+
Y(i.sonarCloud),
|
|
6421
|
+
"Code quality and security analysis on every push: bugs, code smells and vulnerabilities."
|
|
6422
|
+
]];
|
|
6423
|
+
if (r !== void 0) {
|
|
6424
|
+
let { score: e, grade: t } = r.health_score;
|
|
6425
|
+
o.unshift([
|
|
6426
|
+
`[Fallow](./${Nn})`,
|
|
6427
|
+
`✅ ${t} (${String(Math.round(e))})`,
|
|
6428
|
+
"Unused code, duplication, complexity and dependency hygiene."
|
|
6429
|
+
]);
|
|
6430
|
+
}
|
|
6431
|
+
let s = i.codeQLQueries === "security-extended" ? "using the extended security queries" : "using the default queries", c = [
|
|
6414
6432
|
[
|
|
6415
|
-
`[
|
|
6416
|
-
Y(
|
|
6417
|
-
|
|
6433
|
+
`[CodeQL](${a}/security/code-scanning)`,
|
|
6434
|
+
Y(i.codeQLLanguages.length > 0, i.codeQLLanguages.join(", ")),
|
|
6435
|
+
`Static analysis for security vulnerabilities, ${s}, on every push and pull request to \`main\` and weekly.`
|
|
6418
6436
|
],
|
|
6419
6437
|
[
|
|
6420
|
-
"
|
|
6421
|
-
Y(
|
|
6422
|
-
"
|
|
6438
|
+
"Secret scanning",
|
|
6439
|
+
Y(i.secretScanning),
|
|
6440
|
+
"Detects credentials, such as API keys and tokens, committed to the repository."
|
|
6423
6441
|
],
|
|
6424
6442
|
[
|
|
6425
|
-
"
|
|
6426
|
-
Y(
|
|
6427
|
-
"
|
|
6428
|
-
]
|
|
6443
|
+
"Push protection",
|
|
6444
|
+
Y(i.pushProtection),
|
|
6445
|
+
"Blocks pushes that contain credentials."
|
|
6446
|
+
]
|
|
6447
|
+
], l = [[
|
|
6448
|
+
"Unit tests",
|
|
6449
|
+
Y(i.testsInCI),
|
|
6450
|
+
"Run in CI on every push to `main`."
|
|
6451
|
+
], [
|
|
6452
|
+
"Property-based tests",
|
|
6453
|
+
Y(i.propertyTests, "fast-check"),
|
|
6454
|
+
"Fuzz testing: many random inputs per test to find edge cases, run with the unit tests."
|
|
6455
|
+
]];
|
|
6456
|
+
if (n !== void 0) {
|
|
6457
|
+
let e = n >= ri ? "✅" : "⚠️";
|
|
6458
|
+
l.push([
|
|
6459
|
+
"Test coverage",
|
|
6460
|
+
`${e} ${n.toFixed(1)}% of lines`,
|
|
6461
|
+
`Share of source lines the unit tests run. The target is ${String(ri)}%.`
|
|
6462
|
+
]);
|
|
6463
|
+
}
|
|
6464
|
+
let u = [
|
|
6429
6465
|
[
|
|
6430
6466
|
"npm audit",
|
|
6431
|
-
Y(
|
|
6432
|
-
|
|
6467
|
+
Y(i.npmAuditInCI),
|
|
6468
|
+
i.npmAuditLevel === void 0 ? "Fails CI when any dependency has a known vulnerability." : `Fails CI when a dependency has a known vulnerability of ${i.npmAuditLevel} severity or above.`
|
|
6433
6469
|
],
|
|
6434
6470
|
[
|
|
6435
6471
|
"[Socket.dev](https://socket.dev)",
|
|
6436
|
-
Y(
|
|
6472
|
+
Y(i.socket),
|
|
6437
6473
|
"Flags supply chain risk in dependencies: malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE."
|
|
6438
6474
|
],
|
|
6439
6475
|
[
|
|
6440
6476
|
"Dependabot alerts",
|
|
6441
|
-
Y(
|
|
6477
|
+
Y(i.dependabotAlerts),
|
|
6442
6478
|
"Alerts when a dependency has a known vulnerability, using the GitHub Advisory Database."
|
|
6443
6479
|
],
|
|
6444
6480
|
[
|
|
6445
6481
|
"Dependabot security updates",
|
|
6446
|
-
Y(
|
|
6482
|
+
Y(i.dependabotSecurityUpdates),
|
|
6447
6483
|
"Opens pull requests that update vulnerable dependencies."
|
|
6448
6484
|
],
|
|
6449
6485
|
[
|
|
6450
6486
|
"Dependabot version updates",
|
|
6451
|
-
Y(
|
|
6487
|
+
Y(i.dependabotVersionUpdates),
|
|
6452
6488
|
"Opens pull requests for new dependency versions."
|
|
6453
|
-
],
|
|
6454
|
-
[
|
|
6455
|
-
"Secret scanning",
|
|
6456
|
-
Y(n.secretScanning),
|
|
6457
|
-
"Detects credentials, such as API keys and tokens, committed to the repository."
|
|
6458
|
-
],
|
|
6459
|
-
[
|
|
6460
|
-
"Push protection",
|
|
6461
|
-
Y(n.pushProtection),
|
|
6462
|
-
"Blocks pushes that contain credentials."
|
|
6463
|
-
],
|
|
6464
|
-
[
|
|
6465
|
-
"Private vulnerability reporting",
|
|
6466
|
-
Y(n.privateVulnerabilityReporting),
|
|
6467
|
-
"Lets anyone report a vulnerability privately. See [Reporting Vulnerabilities](#reporting-vulnerabilities)."
|
|
6468
6489
|
]
|
|
6469
|
-
]
|
|
6490
|
+
];
|
|
6491
|
+
return `This section is updated each time \`npm run document\` is run. Settings come from the repository's workflow files and GitHub, and test coverage and the Fallow score are measured at the same time.
|
|
6470
6492
|
|
|
6471
|
-
`;
|
|
6493
|
+
${yi("Testing", l)}${yi("Code Quality", o)}${yi("Security Analysis", c)}${yi("Dependencies", u)}`;
|
|
6472
6494
|
}
|
|
6473
|
-
function
|
|
6474
|
-
let
|
|
6475
|
-
return `##
|
|
6495
|
+
function xi(e, t, n, r, i, a, o) {
|
|
6496
|
+
let s = `https://github.com/${e}/${t}`, c = `github.com/${e}/${t}`, l = `https://www.bestpractices.dev/projects/${String(a)}`, u = o !== void 0 && gi(o) ? "\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." : "", d = a === void 0 ? "" : `[](${l})\n`, f = i.securitySettings.privateVulnerabilityReporting === !0 ? `Use [GitHub private vulnerability reporting](${s}/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.";
|
|
6497
|
+
return `## Quality & Security
|
|
6476
6498
|
|
|
6477
|
-
${
|
|
6499
|
+
${bi(e, t, i)}### OpenSSF 🚧
|
|
6478
6500
|
|
|
6479
|
-
|
|
6501
|
+
${d}[](https://scorecard.dev/viewer/?uri=${c})
|
|
6480
6502
|
|
|
6481
|
-
|
|
6503
|
+
This project is working towards the [OpenSSF Best Practices](https://www.bestpractices.dev) Passing badge, a self-certification covering security policy, vulnerability reporting, build processes, code quality, and more. Currently the [OpenSSF Scorecard](https://scorecard.dev) provides an independent automated assessment of the project's security practices and is an ongoing area of improvement.${u}
|
|
6482
6504
|
|
|
6483
|
-
|
|
6505
|
+
### Reporting Vulnerabilities
|
|
6484
6506
|
|
|
6485
|
-
|
|
6507
|
+
Please do not open public GitHub issues for security vulnerabilities. ${f}
|
|
6486
6508
|
|
|
6487
6509
|
## Contributing
|
|
6488
6510
|
|
|
6489
6511
|
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.
|
|
6490
6512
|
|
|
6491
|
-
For security vulnerabilities, see [Reporting Vulnerabilities](#reporting-vulnerabilities). For bugs, inconsistencies, or other feedback, [open a GitHub issue](${
|
|
6513
|
+
For security vulnerabilities, see [Reporting Vulnerabilities](#reporting-vulnerabilities). For bugs, inconsistencies, or other feedback, [open a GitHub issue](${s}/issues) — feedback is read, but responses and fixes are at the maintainer's discretion.
|
|
6492
6514
|
|
|
6493
6515
|
## License
|
|
6494
6516
|
|
|
@@ -6498,28 +6520,28 @@ This project is licensed under the MIT License, permitting free use, modificatio
|
|
|
6498
6520
|
}
|
|
6499
6521
|
//#endregion
|
|
6500
6522
|
//#region node_modules/@dpuse/dpuse-shared/dist/componentConfig.schema-DT3mO5rS.js
|
|
6501
|
-
var
|
|
6523
|
+
var Si = {
|
|
6502
6524
|
lang: void 0,
|
|
6503
6525
|
message: void 0,
|
|
6504
6526
|
abortEarly: void 0,
|
|
6505
6527
|
abortPipeEarly: void 0
|
|
6506
6528
|
};
|
|
6507
6529
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6508
|
-
function
|
|
6530
|
+
function Ci(e) {
|
|
6509
6531
|
return e ? {
|
|
6510
6532
|
lang: e?.lang ?? void 0,
|
|
6511
6533
|
message: e?.message,
|
|
6512
6534
|
abortEarly: e?.abortEarly ?? void 0,
|
|
6513
6535
|
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
6514
|
-
} :
|
|
6536
|
+
} : Si;
|
|
6515
6537
|
}
|
|
6516
6538
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6517
|
-
function
|
|
6539
|
+
function wi(e) {
|
|
6518
6540
|
let t = typeof e;
|
|
6519
6541
|
return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
|
|
6520
6542
|
}
|
|
6521
6543
|
function X(e, t, n, r, i) {
|
|
6522
|
-
let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */
|
|
6544
|
+
let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */ wi(a), c = {
|
|
6523
6545
|
kind: e.kind,
|
|
6524
6546
|
type: e.type,
|
|
6525
6547
|
input: a,
|
|
@@ -6536,39 +6558,39 @@ function X(e, t, n, r, i) {
|
|
|
6536
6558
|
u !== void 0 && (c.message = typeof u == "function" ? u(c) : u), l && (n.typed = !1), n.issues ? n.issues.push(c) : n.issues = [c];
|
|
6537
6559
|
}
|
|
6538
6560
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6539
|
-
function
|
|
6561
|
+
function Ti(e, t) {
|
|
6540
6562
|
return e === t || Number.isNaN(e) && Number.isNaN(t);
|
|
6541
6563
|
}
|
|
6542
6564
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6543
|
-
function
|
|
6565
|
+
function Ei(e, t) {
|
|
6544
6566
|
return Object.prototype.hasOwnProperty.call(e, t) && t !== "__proto__" && t !== "prototype" && t !== "constructor";
|
|
6545
6567
|
}
|
|
6546
6568
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6547
|
-
function
|
|
6569
|
+
function Di(e, t) {
|
|
6548
6570
|
let n = [...new Set(e)];
|
|
6549
6571
|
return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
|
|
6550
6572
|
}
|
|
6551
|
-
function
|
|
6573
|
+
function Oi(e) {
|
|
6552
6574
|
return e["~standard"] = {
|
|
6553
6575
|
version: 1,
|
|
6554
6576
|
vendor: "valibot",
|
|
6555
|
-
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */
|
|
6577
|
+
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */ Ci())
|
|
6556
6578
|
}, e;
|
|
6557
6579
|
}
|
|
6558
6580
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6559
|
-
function
|
|
6581
|
+
function ki(e, t, n) {
|
|
6560
6582
|
return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
|
|
6561
6583
|
}
|
|
6562
6584
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6563
|
-
function
|
|
6585
|
+
function Ai(e, t, n) {
|
|
6564
6586
|
return typeof e.default == "function" ? e.default(t, n) : e.default;
|
|
6565
6587
|
}
|
|
6566
6588
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6567
|
-
function
|
|
6568
|
-
return
|
|
6589
|
+
function ji(e, t) {
|
|
6590
|
+
return Oi({
|
|
6569
6591
|
kind: "schema",
|
|
6570
6592
|
type: "array",
|
|
6571
|
-
reference:
|
|
6593
|
+
reference: ji,
|
|
6572
6594
|
expects: "Array",
|
|
6573
6595
|
async: !1,
|
|
6574
6596
|
item: e,
|
|
@@ -6601,11 +6623,11 @@ function Ti(e, t) {
|
|
|
6601
6623
|
});
|
|
6602
6624
|
}
|
|
6603
6625
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6604
|
-
function
|
|
6605
|
-
return
|
|
6626
|
+
function Mi(e) {
|
|
6627
|
+
return Oi({
|
|
6606
6628
|
kind: "schema",
|
|
6607
6629
|
type: "boolean",
|
|
6608
|
-
reference:
|
|
6630
|
+
reference: Mi,
|
|
6609
6631
|
expects: "boolean",
|
|
6610
6632
|
async: !1,
|
|
6611
6633
|
message: e,
|
|
@@ -6615,23 +6637,23 @@ function Ei(e) {
|
|
|
6615
6637
|
});
|
|
6616
6638
|
}
|
|
6617
6639
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6618
|
-
function
|
|
6619
|
-
return
|
|
6640
|
+
function Ni(e, t) {
|
|
6641
|
+
return Oi({
|
|
6620
6642
|
kind: "schema",
|
|
6621
6643
|
type: "literal",
|
|
6622
|
-
reference:
|
|
6623
|
-
expects: /* @__PURE__ */
|
|
6644
|
+
reference: Ni,
|
|
6645
|
+
expects: /* @__PURE__ */ wi(e),
|
|
6624
6646
|
async: !1,
|
|
6625
6647
|
literal: e,
|
|
6626
6648
|
message: t,
|
|
6627
6649
|
"~run"(e, t) {
|
|
6628
|
-
return /* @__PURE__ */
|
|
6650
|
+
return /* @__PURE__ */ Ti(e.value, this.literal) ? e.typed = !0 : X(this, "type", e, t), e;
|
|
6629
6651
|
}
|
|
6630
6652
|
});
|
|
6631
6653
|
}
|
|
6632
6654
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6633
6655
|
function Z(e, t) {
|
|
6634
|
-
return
|
|
6656
|
+
return Oi({
|
|
6635
6657
|
kind: "schema",
|
|
6636
6658
|
type: "nullable",
|
|
6637
6659
|
reference: Z,
|
|
@@ -6640,16 +6662,16 @@ function Z(e, t) {
|
|
|
6640
6662
|
wrapped: e,
|
|
6641
6663
|
default: t,
|
|
6642
6664
|
"~run"(e, t) {
|
|
6643
|
-
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
6665
|
+
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ Ai(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
6644
6666
|
}
|
|
6645
6667
|
});
|
|
6646
6668
|
}
|
|
6647
6669
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6648
|
-
function
|
|
6649
|
-
return
|
|
6670
|
+
function Pi(e) {
|
|
6671
|
+
return Oi({
|
|
6650
6672
|
kind: "schema",
|
|
6651
6673
|
type: "number",
|
|
6652
|
-
reference:
|
|
6674
|
+
reference: Pi,
|
|
6653
6675
|
expects: "number",
|
|
6654
6676
|
async: !1,
|
|
6655
6677
|
message: e,
|
|
@@ -6659,26 +6681,26 @@ function Oi(e) {
|
|
|
6659
6681
|
});
|
|
6660
6682
|
}
|
|
6661
6683
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6662
|
-
function
|
|
6663
|
-
return
|
|
6684
|
+
function Fi(e, t) {
|
|
6685
|
+
return Oi({
|
|
6664
6686
|
kind: "schema",
|
|
6665
6687
|
type: "optional",
|
|
6666
|
-
reference:
|
|
6688
|
+
reference: Fi,
|
|
6667
6689
|
expects: `(${e.expects} | undefined)`,
|
|
6668
6690
|
async: !1,
|
|
6669
6691
|
wrapped: e,
|
|
6670
6692
|
default: t,
|
|
6671
6693
|
"~run"(e, t) {
|
|
6672
|
-
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
6694
|
+
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ Ai(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
6673
6695
|
}
|
|
6674
6696
|
});
|
|
6675
6697
|
}
|
|
6676
6698
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6677
|
-
function
|
|
6678
|
-
return
|
|
6699
|
+
function Ii(e, t, n) {
|
|
6700
|
+
return Oi({
|
|
6679
6701
|
kind: "schema",
|
|
6680
6702
|
type: "record",
|
|
6681
|
-
reference:
|
|
6703
|
+
reference: Ii,
|
|
6682
6704
|
expects: "Object",
|
|
6683
6705
|
async: !1,
|
|
6684
6706
|
key: e,
|
|
@@ -6688,7 +6710,7 @@ function Ai(e, t, n) {
|
|
|
6688
6710
|
let n = e.value;
|
|
6689
6711
|
if (n && typeof n == "object") {
|
|
6690
6712
|
e.typed = !0, e.value = {};
|
|
6691
|
-
for (let r in n) if (/* @__PURE__ */
|
|
6713
|
+
for (let r in n) if (/* @__PURE__ */ Ei(n, r)) {
|
|
6692
6714
|
let i = n[r], a = this.key["~run"]({ value: r }, t);
|
|
6693
6715
|
if (a.issues) {
|
|
6694
6716
|
let o = {
|
|
@@ -6728,7 +6750,7 @@ function Ai(e, t, n) {
|
|
|
6728
6750
|
}
|
|
6729
6751
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6730
6752
|
function Q(e, t) {
|
|
6731
|
-
return
|
|
6753
|
+
return Oi({
|
|
6732
6754
|
kind: "schema",
|
|
6733
6755
|
type: "strict_object",
|
|
6734
6756
|
reference: Q,
|
|
@@ -6743,7 +6765,7 @@ function Q(e, t) {
|
|
|
6743
6765
|
for (let r in this.entries) {
|
|
6744
6766
|
let i = this.entries[r];
|
|
6745
6767
|
if (r in n || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
|
|
6746
|
-
let a = r in n ? n[r] : /* @__PURE__ */
|
|
6768
|
+
let a = r in n ? n[r] : /* @__PURE__ */ Ai(i), o = i["~run"]({ value: a }, t);
|
|
6747
6769
|
if (o.issues) {
|
|
6748
6770
|
let i = {
|
|
6749
6771
|
type: "object",
|
|
@@ -6759,7 +6781,7 @@ function Q(e, t) {
|
|
|
6759
6781
|
}
|
|
6760
6782
|
}
|
|
6761
6783
|
o.typed || (e.typed = !1), e.value[r] = o.value;
|
|
6762
|
-
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */
|
|
6784
|
+
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ ki(i);
|
|
6763
6785
|
else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (X(this, "key", e, t, {
|
|
6764
6786
|
input: void 0,
|
|
6765
6787
|
expected: `"${r}"`,
|
|
@@ -6795,7 +6817,7 @@ function Q(e, t) {
|
|
|
6795
6817
|
}
|
|
6796
6818
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6797
6819
|
function $(e) {
|
|
6798
|
-
return
|
|
6820
|
+
return Oi({
|
|
6799
6821
|
kind: "schema",
|
|
6800
6822
|
type: "string",
|
|
6801
6823
|
reference: $,
|
|
@@ -6808,19 +6830,19 @@ function $(e) {
|
|
|
6808
6830
|
});
|
|
6809
6831
|
}
|
|
6810
6832
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6811
|
-
function
|
|
6833
|
+
function Li(e) {
|
|
6812
6834
|
let t;
|
|
6813
6835
|
if (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);
|
|
6814
6836
|
else t = n.issues;
|
|
6815
6837
|
return t;
|
|
6816
6838
|
}
|
|
6817
6839
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6818
|
-
function
|
|
6819
|
-
return
|
|
6840
|
+
function Ri(e, t) {
|
|
6841
|
+
return Oi({
|
|
6820
6842
|
kind: "schema",
|
|
6821
6843
|
type: "union",
|
|
6822
|
-
reference:
|
|
6823
|
-
expects: /* @__PURE__ */
|
|
6844
|
+
reference: Ri,
|
|
6845
|
+
expects: /* @__PURE__ */ Di(e.map((e) => e.expects), "|"),
|
|
6824
6846
|
async: !1,
|
|
6825
6847
|
options: e,
|
|
6826
6848
|
message: t,
|
|
@@ -6839,29 +6861,29 @@ function Mi(e, t) {
|
|
|
6839
6861
|
if (n) return n;
|
|
6840
6862
|
if (r) {
|
|
6841
6863
|
if (r.length === 1) return r[0];
|
|
6842
|
-
X(this, "type", e, t, { issues: /* @__PURE__ */
|
|
6864
|
+
X(this, "type", e, t, { issues: /* @__PURE__ */ Li(r) }), e.typed = !0;
|
|
6843
6865
|
} else if (i?.length === 1) return i[0];
|
|
6844
|
-
else X(this, "type", e, t, { issues: /* @__PURE__ */
|
|
6866
|
+
else X(this, "type", e, t, { issues: /* @__PURE__ */ Li(i) });
|
|
6845
6867
|
return e;
|
|
6846
6868
|
}
|
|
6847
6869
|
});
|
|
6848
6870
|
}
|
|
6849
|
-
var
|
|
6871
|
+
var zi = /* @__PURE__ */ Q({
|
|
6850
6872
|
en: /* @__PURE__ */ $(),
|
|
6851
6873
|
es: /* @__PURE__ */ $()
|
|
6852
|
-
}),
|
|
6874
|
+
}), Bi = {
|
|
6853
6875
|
id: /* @__PURE__ */ $(),
|
|
6854
6876
|
label: /* @__PURE__ */ Q({
|
|
6855
|
-
en: /* @__PURE__ */
|
|
6856
|
-
es: /* @__PURE__ */
|
|
6877
|
+
en: /* @__PURE__ */ Fi(/* @__PURE__ */ $()),
|
|
6878
|
+
es: /* @__PURE__ */ Fi(/* @__PURE__ */ $())
|
|
6857
6879
|
}),
|
|
6858
6880
|
description: /* @__PURE__ */ Q({
|
|
6859
|
-
en: /* @__PURE__ */
|
|
6860
|
-
es: /* @__PURE__ */
|
|
6881
|
+
en: /* @__PURE__ */ Fi(/* @__PURE__ */ $()),
|
|
6882
|
+
es: /* @__PURE__ */ Fi(/* @__PURE__ */ $())
|
|
6861
6883
|
}),
|
|
6862
6884
|
icon: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6863
6885
|
iconDark: /* @__PURE__ */ Z(/* @__PURE__ */ $())
|
|
6864
|
-
},
|
|
6886
|
+
}, Vi = (e) => /* @__PURE__ */ Ri(e.map((e) => /* @__PURE__ */ Ni(e))), Hi = Vi([
|
|
6865
6887
|
"app",
|
|
6866
6888
|
"connector",
|
|
6867
6889
|
"connectorConnection",
|
|
@@ -6883,33 +6905,33 @@ var Ni = /* @__PURE__ */ Q({
|
|
|
6883
6905
|
"presenter",
|
|
6884
6906
|
"presenterPresentation",
|
|
6885
6907
|
"tool"
|
|
6886
|
-
]),
|
|
6908
|
+
]), Ui = Vi([
|
|
6887
6909
|
"danger",
|
|
6888
6910
|
"success",
|
|
6889
6911
|
"warning"
|
|
6890
|
-
]),
|
|
6912
|
+
]), Wi = Vi([
|
|
6891
6913
|
"alpha",
|
|
6892
6914
|
"beta",
|
|
6893
6915
|
"releaseCandidate",
|
|
6894
6916
|
"generalAvailability"
|
|
6895
|
-
]),
|
|
6896
|
-
color:
|
|
6917
|
+
]), Gi = /* @__PURE__ */ Q({
|
|
6918
|
+
color: Ui,
|
|
6897
6919
|
label: /* @__PURE__ */ $()
|
|
6898
|
-
}),
|
|
6899
|
-
...Pi,
|
|
6900
|
-
typeId: Ii
|
|
6901
|
-
}, Vi = /* @__PURE__ */ Q({
|
|
6920
|
+
}), Ki = {
|
|
6902
6921
|
...Bi,
|
|
6903
|
-
|
|
6922
|
+
typeId: Hi
|
|
6923
|
+
}, qi = /* @__PURE__ */ Q({
|
|
6924
|
+
...Ki,
|
|
6925
|
+
order: /* @__PURE__ */ Pi(),
|
|
6904
6926
|
path: /* @__PURE__ */ $()
|
|
6905
|
-
}),
|
|
6906
|
-
...
|
|
6907
|
-
firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
6908
|
-
lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
6909
|
-
status: /* @__PURE__ */ Z(
|
|
6910
|
-
statusId: /* @__PURE__ */ Z(
|
|
6927
|
+
}), Ji = {
|
|
6928
|
+
...Ki,
|
|
6929
|
+
firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ Pi()),
|
|
6930
|
+
lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ Pi()),
|
|
6931
|
+
status: /* @__PURE__ */ Z(Gi),
|
|
6932
|
+
statusId: /* @__PURE__ */ Z(Wi)
|
|
6911
6933
|
};
|
|
6912
|
-
({ ...
|
|
6934
|
+
({ ...Ji }), Vi([
|
|
6913
6935
|
"app",
|
|
6914
6936
|
"engine",
|
|
6915
6937
|
"connector",
|
|
@@ -6919,17 +6941,17 @@ var Ni = /* @__PURE__ */ Q({
|
|
|
6919
6941
|
]);
|
|
6920
6942
|
//#endregion
|
|
6921
6943
|
//#region node_modules/@dpuse/dpuse-shared/dist/moduleConfig.schema-aYmFWSrn.js
|
|
6922
|
-
var
|
|
6923
|
-
...
|
|
6944
|
+
var Yi = {
|
|
6945
|
+
...Ji,
|
|
6924
6946
|
vendorAccountURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6925
6947
|
vendorDocumentationURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6926
6948
|
vendorHomeURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6927
6949
|
version: /* @__PURE__ */ $()
|
|
6928
6950
|
};
|
|
6929
|
-
({ ...
|
|
6951
|
+
({ ...Yi });
|
|
6930
6952
|
//#endregion
|
|
6931
6953
|
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModuleConnector.es.js
|
|
6932
|
-
var
|
|
6954
|
+
var Xi = Vi([
|
|
6933
6955
|
"abortOperation",
|
|
6934
6956
|
"auditObjectContent",
|
|
6935
6957
|
"createObject",
|
|
@@ -6945,39 +6967,39 @@ var Wi = Fi([
|
|
|
6945
6967
|
"retrieveChunks",
|
|
6946
6968
|
"retrieveRecords",
|
|
6947
6969
|
"upsertRecords"
|
|
6948
|
-
]),
|
|
6970
|
+
]), Zi = Vi([
|
|
6949
6971
|
"application",
|
|
6950
6972
|
"curatedDataset",
|
|
6951
6973
|
"database",
|
|
6952
6974
|
"fileStore"
|
|
6953
|
-
]),
|
|
6975
|
+
]), Qi = /* @__PURE__ */ Q({ label: zi }), $i = Vi([
|
|
6954
6976
|
"bidirectional",
|
|
6955
6977
|
"destination",
|
|
6956
6978
|
"source",
|
|
6957
6979
|
"unknown"
|
|
6958
|
-
]),
|
|
6959
|
-
authMethodId:
|
|
6980
|
+
]), ea = /* @__PURE__ */ Q({ label: zi }), ta = /* @__PURE__ */ Q({
|
|
6981
|
+
authMethodId: Vi([
|
|
6960
6982
|
"apiKey",
|
|
6961
6983
|
"disabled",
|
|
6962
6984
|
"oAuth2",
|
|
6963
6985
|
"none"
|
|
6964
6986
|
]),
|
|
6965
|
-
activeConnectionCount: /* @__PURE__ */
|
|
6966
|
-
canDescribe: /* @__PURE__ */
|
|
6967
|
-
id: /* @__PURE__ */
|
|
6968
|
-
label: /* @__PURE__ */
|
|
6969
|
-
maxConnectionCount: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
6970
|
-
params: /* @__PURE__ */
|
|
6971
|
-
}),
|
|
6972
|
-
...
|
|
6973
|
-
typeId: /* @__PURE__ */
|
|
6974
|
-
actionNames: /* @__PURE__ */
|
|
6975
|
-
category: /* @__PURE__ */ Z(
|
|
6976
|
-
categoryId:
|
|
6977
|
-
implementations: /* @__PURE__ */
|
|
6978
|
-
usage: /* @__PURE__ */ Z(
|
|
6979
|
-
usageId: /* @__PURE__ */ Z(
|
|
6980
|
-
}),
|
|
6987
|
+
activeConnectionCount: /* @__PURE__ */ Fi(/* @__PURE__ */ Pi()),
|
|
6988
|
+
canDescribe: /* @__PURE__ */ Fi(/* @__PURE__ */ Mi()),
|
|
6989
|
+
id: /* @__PURE__ */ Fi(/* @__PURE__ */ $()),
|
|
6990
|
+
label: /* @__PURE__ */ Fi(zi),
|
|
6991
|
+
maxConnectionCount: /* @__PURE__ */ Z(/* @__PURE__ */ Pi()),
|
|
6992
|
+
params: /* @__PURE__ */ Fi(/* @__PURE__ */ ji(/* @__PURE__ */ Ii(/* @__PURE__ */ $(), /* @__PURE__ */ $())))
|
|
6993
|
+
}), na = /* @__PURE__ */ Q({
|
|
6994
|
+
...Yi,
|
|
6995
|
+
typeId: /* @__PURE__ */ Ni("connector"),
|
|
6996
|
+
actionNames: /* @__PURE__ */ ji(Xi),
|
|
6997
|
+
category: /* @__PURE__ */ Z(Qi),
|
|
6998
|
+
categoryId: Zi,
|
|
6999
|
+
implementations: /* @__PURE__ */ Ii(/* @__PURE__ */ $(), ta),
|
|
7000
|
+
usage: /* @__PURE__ */ Z(ea),
|
|
7001
|
+
usageId: /* @__PURE__ */ Z($i)
|
|
7002
|
+
}), ra = {
|
|
6981
7003
|
abortOperation: "Abort Operation",
|
|
6982
7004
|
auditObjectContent: "Audit Object Content",
|
|
6983
7005
|
createObject: "Create Object",
|
|
@@ -6993,12 +7015,12 @@ var Wi = Fi([
|
|
|
6993
7015
|
retrieveChunks: "Retrieve Chunks",
|
|
6994
7016
|
retrieveRecords: "Retrieve Records",
|
|
6995
7017
|
upsertRecords: "Upsert Records"
|
|
6996
|
-
},
|
|
7018
|
+
}, ia = /* @__PURE__ */ new Set([
|
|
6997
7019
|
"createObject",
|
|
6998
7020
|
"dropObject",
|
|
6999
7021
|
"removeRecords",
|
|
7000
7022
|
"upsertRecords"
|
|
7001
|
-
]),
|
|
7023
|
+
]), aa = /* @__PURE__ */ new Set([
|
|
7002
7024
|
"auditObjectContent",
|
|
7003
7025
|
"findObject",
|
|
7004
7026
|
"getInfo",
|
|
@@ -7009,65 +7031,65 @@ var Wi = Fi([
|
|
|
7009
7031
|
"retrieveChunks",
|
|
7010
7032
|
"retrieveRecords"
|
|
7011
7033
|
]);
|
|
7012
|
-
function
|
|
7034
|
+
function oa(e) {
|
|
7013
7035
|
let t = !1, n = !1;
|
|
7014
|
-
for (let r of e)
|
|
7036
|
+
for (let r of e) aa.has(r) && (t = !0), ia.has(r) && (n = !0);
|
|
7015
7037
|
return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "unknown";
|
|
7016
7038
|
}
|
|
7017
|
-
function
|
|
7039
|
+
function sa(e) {
|
|
7018
7040
|
let t = new Set(e), n = "|Action|Supported|\n";
|
|
7019
7041
|
n += "|:----|:-------:|\n";
|
|
7020
|
-
for (let e of Object.keys(
|
|
7042
|
+
for (let e of Object.keys(ra)) n += `| ${ra[e]} | ${t.has(e) ? "✓" : ""} |\n`;
|
|
7021
7043
|
return n;
|
|
7022
7044
|
}
|
|
7023
7045
|
//#endregion
|
|
7024
7046
|
//#region src/actions/documentActions.ts
|
|
7025
|
-
var
|
|
7047
|
+
var ca = "<!-- CONNECTOR_ACTIONS_START -->", la = "<!-- CONNECTOR_ACTIONS_END -->", ua = "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.", da = {
|
|
7026
7048
|
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.",
|
|
7027
7049
|
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.",
|
|
7028
7050
|
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.",
|
|
7029
7051
|
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."
|
|
7030
|
-
},
|
|
7031
|
-
async function
|
|
7052
|
+
}, fa = "The table below lists all connector actions and highlights those supported by this connector.";
|
|
7053
|
+
async function pa() {
|
|
7032
7054
|
try {
|
|
7033
7055
|
G("Document Actions"), q("1️⃣ Insert actions description and table into 'README.md'");
|
|
7034
|
-
let e = (await W("config.json")).actionNames ?? [], t =
|
|
7035
|
-
await
|
|
7056
|
+
let e = (await W("config.json")).actionNames ?? [], t = oa(e), n = sa(e);
|
|
7057
|
+
await Un(`${ua}\n\n${da[t]} ${fa}\n\n${n}`, ca, la), K("Actions documented");
|
|
7036
7058
|
} catch (e) {
|
|
7037
7059
|
console.error("❌ Error documenting actions", e), process.exit(1);
|
|
7038
7060
|
}
|
|
7039
7061
|
}
|
|
7040
7062
|
//#endregion
|
|
7041
7063
|
//#region src/actions/documentOpening.ts
|
|
7042
|
-
var
|
|
7043
|
-
async function
|
|
7064
|
+
var ma = "<!-- OPENING_START -->", ha = "<!-- OPENING_END -->";
|
|
7065
|
+
async function ga() {
|
|
7044
7066
|
try {
|
|
7045
7067
|
G("Document Opening"), q("1️⃣ Insert opening content into 'README.md'");
|
|
7046
|
-
let e = await W("package.json"), t = await W("config.json"), { owner: n, repo: r } =
|
|
7047
|
-
await
|
|
7068
|
+
let e = await W("package.json"), t = await W("config.json"), { owner: n, repo: r } = Kn(e, "document opening");
|
|
7069
|
+
await Un(ya(n, r, _a(e), va(t), e.devDependencies?.fallow != null), ma, ha), K("Opening documented");
|
|
7048
7070
|
} catch (e) {
|
|
7049
7071
|
console.error("❌ Error documenting opening", e), process.exit(1);
|
|
7050
7072
|
}
|
|
7051
7073
|
}
|
|
7052
|
-
function
|
|
7074
|
+
function _a(e) {
|
|
7053
7075
|
let t = e.license;
|
|
7054
7076
|
if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
|
|
7055
7077
|
return t;
|
|
7056
7078
|
}
|
|
7057
|
-
function
|
|
7079
|
+
function va(e) {
|
|
7058
7080
|
let t = e.description.en;
|
|
7059
7081
|
if (t == null || t.length === 0) throw Error("config.json 'description.en' field is required to document opening.");
|
|
7060
7082
|
return t;
|
|
7061
7083
|
}
|
|
7062
|
-
function
|
|
7063
|
-
let
|
|
7064
|
-
return `[](${
|
|
7066
|
-
[](https://sonarcloud.io/summary/new_code?id=${e}_${t})
|
|
7084
|
+
function ya(e, t, n, r, i) {
|
|
7085
|
+
let a = `https://github.com/${e}/${t}`, o = n.replaceAll("-", "--"), s = encodeURIComponent(`https://raw.githubusercontent.com/${e}/${t}/main/${Mn}`);
|
|
7086
|
+
return `[](./LICENSE)
|
|
7087
|
+
[](${a}/releases/latest)
|
|
7088
|
+
[](${a}/actions/workflows/ci.yml)
|
|
7089
|
+
[](${a}/actions/workflows/codeql.yml)
|
|
7090
|
+
${i ? `[](./${Nn})\n` : ""}[](https://sonarcloud.io/summary/new_code?id=${e}_${t})
|
|
7069
7091
|
|
|
7070
|
-
[Documentation](https://www.dpuse.app) · [Report a Vulnerability](${
|
|
7092
|
+
[Documentation](https://www.dpuse.app) · [Report a Vulnerability](${a}/security/advisories/new) · [Open an Issue](${a}/issues)
|
|
7071
7093
|
|
|
7072
7094
|
## About DPUse
|
|
7073
7095
|
|
|
@@ -7087,12 +7109,12 @@ ${r}`;
|
|
|
7087
7109
|
}
|
|
7088
7110
|
//#endregion
|
|
7089
7111
|
//#region src/actions/documentUsage.ts
|
|
7090
|
-
var
|
|
7112
|
+
var ba = "<!-- USAGE_START -->", xa = "<!-- USAGE_END -->", Sa = /* @__PURE__ */ new Set([
|
|
7091
7113
|
"connector",
|
|
7092
7114
|
"context",
|
|
7093
7115
|
"cookbook",
|
|
7094
7116
|
"presenter"
|
|
7095
|
-
]),
|
|
7117
|
+
]), Ca = [
|
|
7096
7118
|
["build", "Builds the project."],
|
|
7097
7119
|
["build:ts", "Builds the TypeScript source."],
|
|
7098
7120
|
["test", "Runs the tests."],
|
|
@@ -7108,39 +7130,39 @@ var ma = "<!-- USAGE_START -->", ha = "<!-- USAGE_END -->", ga = /* @__PURE__ */
|
|
|
7108
7130
|
["documentUsage", "Regenerates the README's Usage section."],
|
|
7109
7131
|
["documentDependencies", "Regenerates the README's dependency licence report."],
|
|
7110
7132
|
["documentBundleSizes", "Regenerates the README's bundle size report."],
|
|
7111
|
-
["documentGovernance", "Regenerates the README's
|
|
7133
|
+
["documentGovernance", "Regenerates the README's Quality & Security, Contributing and License sections."],
|
|
7112
7134
|
["sync", "Bumps the version, then commits and pushes to GitHub."],
|
|
7113
7135
|
["release", "Bumps the version, commits and pushes, and creates a GitHub release."],
|
|
7114
7136
|
["publish", "Registers the released version with DPUse."]
|
|
7115
|
-
],
|
|
7116
|
-
async function
|
|
7137
|
+
], wa = /* @__PURE__ */ new Set(["development", "eslint"]), Ta = "> [!WARNING]\n> This project is currently published to npm, but is not designed for general use. It is custom built for the DPUse CI/CD process. You are welcome to clone and customise it for your own purposes, but you will need to adapt it to your own project structure and tooling.\n\n", Ea = "Cloned or forked code is unsupported and isn't guaranteed to remain compatible with the DPUse Engine as it evolves.";
|
|
7138
|
+
async function Da() {
|
|
7117
7139
|
try {
|
|
7118
7140
|
G("Document Usage"), q("1️⃣ Insert usage content into 'README.md'");
|
|
7119
|
-
let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n =
|
|
7120
|
-
await
|
|
7141
|
+
let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = Oa(e), r = ka(n), i = Aa(e.engines?.node), a = Aa(e.engines?.npm), o = Aa(e.devDependencies?.typescript);
|
|
7142
|
+
await Un(Pa(ja(Gn(t.id), e.name), n, r, i, a, o, Ma(e)), ba, xa), K("Usage documented");
|
|
7121
7143
|
} catch (e) {
|
|
7122
7144
|
console.error("❌ Error documenting usage", e), process.exit(1);
|
|
7123
7145
|
}
|
|
7124
7146
|
}
|
|
7125
|
-
function
|
|
7147
|
+
function Oa(e) {
|
|
7126
7148
|
let t = e.repository, n = typeof t == "string" ? t : t?.url;
|
|
7127
7149
|
if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
|
|
7128
7150
|
return n.replace(/^git\+/, "");
|
|
7129
7151
|
}
|
|
7130
|
-
function
|
|
7152
|
+
function ka(e) {
|
|
7131
7153
|
return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
|
|
7132
7154
|
}
|
|
7133
|
-
function
|
|
7155
|
+
function Aa(e) {
|
|
7134
7156
|
if (e == null) throw Error("package.json version range is required to document usage.");
|
|
7135
7157
|
let t = /\d+(?:\.\d+)*/.exec(e);
|
|
7136
7158
|
if (t == null) throw Error(`Unable to parse version from '${e}'.`);
|
|
7137
7159
|
return t[0];
|
|
7138
7160
|
}
|
|
7139
|
-
function
|
|
7161
|
+
function ja(e, t) {
|
|
7140
7162
|
let { typeId: n } = e;
|
|
7141
|
-
if (
|
|
7163
|
+
if (Sa.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.
|
|
7142
7164
|
|
|
7143
|
-
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. ${
|
|
7165
|
+
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. ${Ea}`;
|
|
7144
7166
|
if (e.publishedTo === "npm") {
|
|
7145
7167
|
if (t == null || t === "") throw Error("package.json 'name' field is required to document usage.");
|
|
7146
7168
|
return `This package is published to the [public npm registry](https://www.npmjs.com/package/${t}). Install it with:
|
|
@@ -7149,18 +7171,18 @@ You may view or clone this repository for your own purposes, such as building a
|
|
|
7149
7171
|
npm install ${t}
|
|
7150
7172
|
\`\`\`
|
|
7151
7173
|
|
|
7152
|
-
${
|
|
7174
|
+
${wa.has(n) ? Ta : ""}To work on the source instead, clone this repository. ${Ea}`;
|
|
7153
7175
|
}
|
|
7154
|
-
return `You may view or clone this repository for your own purposes. ${
|
|
7176
|
+
return `You may view or clone this repository for your own purposes. ${Ea}`;
|
|
7155
7177
|
}
|
|
7156
|
-
function
|
|
7157
|
-
let t = e.scripts ?? {}, n = e.name === "@dpuse/dpuse-development", r = new Set(Object.keys(t).filter((e) => n ? t[e]?.includes("dpuse-development.es.js") : t[e]?.includes("@dpuse/dpuse-development"))), i = (e) => r.has(e) || (t[e] ?? "").matchAll(/npm run ([\w:]+)/g).some(([, e = ""]) => r.has(e)), a =
|
|
7178
|
+
function Ma(e) {
|
|
7179
|
+
let t = e.scripts ?? {}, n = e.name === "@dpuse/dpuse-development", r = new Set(Object.keys(t).filter((e) => n ? t[e]?.includes("dpuse-development.es.js") : t[e]?.includes("@dpuse/dpuse-development"))), i = (e) => r.has(e) || (t[e] ?? "").matchAll(/npm run ([\w:]+)/g).some(([, e = ""]) => r.has(e)), a = Ca.filter(([e]) => i(e)).map(([e, t]) => `|\`${Na(e)}\`|${t}|`);
|
|
7158
7180
|
return a.length === 0 ? "" : `\n\n${n ? "This repository provides these commands to every DPUse project, and uses them itself:" : "Repository tasks run through npm scripts provided by [@dpuse/dpuse-development](https://github.com/dpuse/dpuse-development):"}\n\n|Command|What it does|\n|:-|:-|\n${a.join("\n")}`;
|
|
7159
7181
|
}
|
|
7160
|
-
function
|
|
7182
|
+
function Na(e) {
|
|
7161
7183
|
return e === "test" ? "npm test" : `npm run ${e}`;
|
|
7162
7184
|
}
|
|
7163
|
-
function
|
|
7185
|
+
function Pa(e, t, n, r, i, a, o) {
|
|
7164
7186
|
return `## Usage
|
|
7165
7187
|
|
|
7166
7188
|
${e}
|
|
@@ -7175,14 +7197,18 @@ _Requires [Node.js](https://nodejs.org/) ${r} or later, [npm](https://www.npmjs.
|
|
|
7175
7197
|
}
|
|
7176
7198
|
//#endregion
|
|
7177
7199
|
//#region src/actions/formatCode.ts
|
|
7178
|
-
async function
|
|
7200
|
+
async function Fa() {
|
|
7179
7201
|
try {
|
|
7180
7202
|
G("Format Code"), await U("1️⃣ Format", "prettier", [
|
|
7181
7203
|
"--write",
|
|
7182
7204
|
"*.json",
|
|
7183
7205
|
"*.md",
|
|
7184
7206
|
"*.ts",
|
|
7185
|
-
...[
|
|
7207
|
+
...[
|
|
7208
|
+
"app",
|
|
7209
|
+
"src",
|
|
7210
|
+
"tests"
|
|
7211
|
+
].filter((t) => e(t)).map((e) => `${e}/**`)
|
|
7186
7212
|
]), K("Code formatted");
|
|
7187
7213
|
} catch (e) {
|
|
7188
7214
|
console.error("❌ Error formatting code", e), process.exit(1);
|
|
@@ -7190,7 +7216,7 @@ async function ka() {
|
|
|
7190
7216
|
}
|
|
7191
7217
|
//#endregion
|
|
7192
7218
|
//#region src/actions/lintCode.ts
|
|
7193
|
-
async function
|
|
7219
|
+
async function Ia() {
|
|
7194
7220
|
try {
|
|
7195
7221
|
G("Lint Code"), await U("1️⃣ Lint", "eslint", ["."]), K("Code linted");
|
|
7196
7222
|
} catch (e) {
|
|
@@ -7199,7 +7225,7 @@ async function Aa() {
|
|
|
7199
7225
|
}
|
|
7200
7226
|
//#endregion
|
|
7201
7227
|
//#region src/utilities/cloudflare.ts
|
|
7202
|
-
async function
|
|
7228
|
+
async function La() {
|
|
7203
7229
|
let e = await W("config.json"), t = {
|
|
7204
7230
|
body: JSON.stringify(e),
|
|
7205
7231
|
headers: { "Content-Type": "application/json" },
|
|
@@ -7207,11 +7233,11 @@ async function ja() {
|
|
|
7207
7233
|
}, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
|
|
7208
7234
|
if (!n.ok) throw Error(await n.text());
|
|
7209
7235
|
}
|
|
7210
|
-
async function
|
|
7236
|
+
async function Ra(e, t) {
|
|
7211
7237
|
async function n(e, t, r) {
|
|
7212
7238
|
for (let i of r) {
|
|
7213
7239
|
let r = `${e}/${i}`, a = `${t}/${i}`;
|
|
7214
|
-
(await
|
|
7240
|
+
(await qn(r)).isDirectory() ? await n(r, a, await Ln(r)) : (console.info(`⚙️ Uploading '${e}/${i}'...`), await Rn(void 0, "wrangler", [
|
|
7215
7241
|
"r2",
|
|
7216
7242
|
"object",
|
|
7217
7243
|
"put",
|
|
@@ -7222,10 +7248,10 @@ async function Ma(e, t) {
|
|
|
7222
7248
|
]));
|
|
7223
7249
|
}
|
|
7224
7250
|
}
|
|
7225
|
-
let r = await
|
|
7251
|
+
let r = await Ln(`${e}/${t}/`);
|
|
7226
7252
|
await n(`${e}/${t}`, t, r);
|
|
7227
7253
|
}
|
|
7228
|
-
async function
|
|
7254
|
+
async function za(e) {
|
|
7229
7255
|
let t = e.id, n = {
|
|
7230
7256
|
body: JSON.stringify(e),
|
|
7231
7257
|
headers: { "Content-Type": "application/json" },
|
|
@@ -7233,14 +7259,14 @@ async function Na(e) {
|
|
|
7233
7259
|
}, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
|
|
7234
7260
|
if (!r.ok) throw Error(await r.text());
|
|
7235
7261
|
}
|
|
7236
|
-
async function
|
|
7262
|
+
async function Ba(e, t) {
|
|
7237
7263
|
let n = `v${e.version ?? "unknown"}`;
|
|
7238
7264
|
async function r(e, r = "") {
|
|
7239
|
-
let i = await
|
|
7265
|
+
let i = await Ln(e, { withFileTypes: !0 });
|
|
7240
7266
|
for (let a of i) {
|
|
7241
7267
|
if (a.isDirectory() || a.name.endsWith(".map")) continue;
|
|
7242
7268
|
let i = `${e}/${a.name}`, o = r ? `${r}/${a.name}` : a.name, s = `${t}_${n}/${o}`.replaceAll("\\", "/"), c = a.name.endsWith(".css") ? "text/css" : "application/octet-stream", l = a.name.endsWith(".js") ? "application/javascript" : c;
|
|
7243
|
-
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await
|
|
7269
|
+
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await Rn(void 0, "wrangler", [
|
|
7244
7270
|
"r2",
|
|
7245
7271
|
"object",
|
|
7246
7272
|
"put",
|
|
@@ -7257,24 +7283,24 @@ async function Pa(e, t) {
|
|
|
7257
7283
|
}
|
|
7258
7284
|
//#endregion
|
|
7259
7285
|
//#region node_modules/valibot/dist/index.mjs
|
|
7260
|
-
var
|
|
7286
|
+
var Va = {
|
|
7261
7287
|
lang: void 0,
|
|
7262
7288
|
message: void 0,
|
|
7263
7289
|
abortEarly: void 0,
|
|
7264
7290
|
abortPipeEarly: void 0
|
|
7265
7291
|
};
|
|
7266
7292
|
/* @__NO_SIDE_EFFECTS__ */
|
|
7267
|
-
function
|
|
7293
|
+
function Ha(e) {
|
|
7268
7294
|
return e ? {
|
|
7269
7295
|
lang: e?.lang ?? void 0,
|
|
7270
7296
|
message: e?.message,
|
|
7271
7297
|
abortEarly: e?.abortEarly ?? void 0,
|
|
7272
7298
|
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
7273
|
-
} :
|
|
7299
|
+
} : Va;
|
|
7274
7300
|
}
|
|
7275
7301
|
/* @__NO_SIDE_EFFECTS__ */
|
|
7276
|
-
function
|
|
7277
|
-
let r = e["~run"]({ value: t }, /* @__PURE__ */
|
|
7302
|
+
function Ua(e, t, n) {
|
|
7303
|
+
let r = e["~run"]({ value: t }, /* @__PURE__ */ Ha(n));
|
|
7278
7304
|
return {
|
|
7279
7305
|
typed: r.typed,
|
|
7280
7306
|
success: !r.issues,
|
|
@@ -7284,21 +7310,21 @@ function La(e, t, n) {
|
|
|
7284
7310
|
}
|
|
7285
7311
|
//#endregion
|
|
7286
7312
|
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModulePresenter.es.js
|
|
7287
|
-
var
|
|
7313
|
+
var Wa = Vi([
|
|
7288
7314
|
"list",
|
|
7289
7315
|
"render",
|
|
7290
7316
|
"setColorMode"
|
|
7291
|
-
]),
|
|
7292
|
-
...
|
|
7293
|
-
typeId: /* @__PURE__ */
|
|
7294
|
-
actionNames: /* @__PURE__ */
|
|
7295
|
-
presentations: /* @__PURE__ */
|
|
7296
|
-
}),
|
|
7317
|
+
]), Ga = /* @__PURE__ */ Q({
|
|
7318
|
+
...Yi,
|
|
7319
|
+
typeId: /* @__PURE__ */ Ni("presenter"),
|
|
7320
|
+
actionNames: /* @__PURE__ */ ji(Wa),
|
|
7321
|
+
presentations: /* @__PURE__ */ ji(qi)
|
|
7322
|
+
}), Ka = [
|
|
7297
7323
|
"1️⃣ ",
|
|
7298
7324
|
"2️⃣ ",
|
|
7299
7325
|
"3️⃣ ",
|
|
7300
7326
|
"4️⃣ "
|
|
7301
|
-
],
|
|
7327
|
+
], qa = [{
|
|
7302
7328
|
id: "unit",
|
|
7303
7329
|
label: "Run unit tests",
|
|
7304
7330
|
command: "vitest",
|
|
@@ -7311,46 +7337,46 @@ var Ra = Fi([
|
|
|
7311
7337
|
arguments: ["test", "--pass-with-no-tests"],
|
|
7312
7338
|
configFileName: "playwright.config.ts"
|
|
7313
7339
|
}];
|
|
7314
|
-
async function
|
|
7340
|
+
async function Ja() {
|
|
7315
7341
|
try {
|
|
7316
7342
|
G("Build Project"), await U("1️⃣ Bundle project", "vite", ["build"]), K("Project built");
|
|
7317
7343
|
} catch (e) {
|
|
7318
7344
|
console.error("❌ Error building project", e), process.exit(1);
|
|
7319
7345
|
}
|
|
7320
7346
|
}
|
|
7321
|
-
async function
|
|
7347
|
+
async function Ya() {
|
|
7322
7348
|
try {
|
|
7323
7349
|
G("Publish Project");
|
|
7324
7350
|
let e = await W("package.json"), t = await W("config.json");
|
|
7325
|
-
await
|
|
7351
|
+
await io("1️⃣ ", e, t, Gn(t.id)), K(`Project version '${e.version ?? "unknown"}' published.`);
|
|
7326
7352
|
} catch (e) {
|
|
7327
7353
|
console.error("❌ Error publishing project", e), process.exit(1);
|
|
7328
7354
|
}
|
|
7329
7355
|
}
|
|
7330
|
-
async function
|
|
7356
|
+
async function Xa() {
|
|
7331
7357
|
try {
|
|
7332
7358
|
G("Release Project");
|
|
7333
7359
|
let e = await W("package.json"), t = await W("config.json");
|
|
7334
|
-
await
|
|
7335
|
-
let n =
|
|
7360
|
+
await ro("1️⃣ ", e);
|
|
7361
|
+
let n = Gn(t.id);
|
|
7336
7362
|
switch (n.typeId) {
|
|
7337
7363
|
case "connector":
|
|
7338
|
-
t = await
|
|
7364
|
+
t = await Qa("2️⃣ ", e);
|
|
7339
7365
|
break;
|
|
7340
7366
|
case "presenter":
|
|
7341
|
-
t = await
|
|
7367
|
+
t = await $a("2️⃣ ", e);
|
|
7342
7368
|
break;
|
|
7343
|
-
default: t = await
|
|
7369
|
+
default: t = await Za("2️⃣ ", e);
|
|
7344
7370
|
}
|
|
7345
|
-
await U("3️⃣ Bundle project", "vite", ["build"]), await
|
|
7371
|
+
await U("3️⃣ Bundle project", "vite", ["build"]), await Rn("4️⃣ Stage changes", "git", ["add", "."]), await Rn("5️⃣ Commit changes", "git", [
|
|
7346
7372
|
"commit",
|
|
7347
7373
|
"-m",
|
|
7348
7374
|
`v${e.version ?? "unknown"}`
|
|
7349
|
-
]), await
|
|
7375
|
+
]), await Rn("6️⃣ Push changes", "git", [
|
|
7350
7376
|
"push",
|
|
7351
7377
|
"origin",
|
|
7352
7378
|
"main:main"
|
|
7353
|
-
]), await
|
|
7379
|
+
]), await io("7️⃣ ", e, t, n), n.publishedTo === "npm" ? await U("8️⃣ Create GitHub release", "gh", [
|
|
7354
7380
|
"release",
|
|
7355
7381
|
"create",
|
|
7356
7382
|
`v${e.version ?? "unknown"}`,
|
|
@@ -7363,45 +7389,45 @@ async function Wa() {
|
|
|
7363
7389
|
console.error("❌ Error releasing project", e), process.exit(1);
|
|
7364
7390
|
}
|
|
7365
7391
|
}
|
|
7366
|
-
async function
|
|
7392
|
+
async function Za(e, t) {
|
|
7367
7393
|
q(`${e} Build project configuration`);
|
|
7368
7394
|
let n = await W("config.json");
|
|
7369
|
-
return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await
|
|
7395
|
+
return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await Vn("logo.svg"), n.iconDark ??= await Vn("logoDark.svg"), await Hn("config.json", n), n;
|
|
7370
7396
|
}
|
|
7371
|
-
async function
|
|
7397
|
+
async function Qa(e, t) {
|
|
7372
7398
|
q(`${e} Build connector project configuration`);
|
|
7373
|
-
let [n, r] = await Promise.all([W("config.json"),
|
|
7399
|
+
let [n, r] = await Promise.all([W("config.json"), Bn("src/index.ts")]), i = /* @__PURE__ */ Ua(na, n);
|
|
7374
7400
|
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
7375
|
-
let a =
|
|
7376
|
-
return await
|
|
7401
|
+
let a = Jn(r);
|
|
7402
|
+
return await eo(t, n, a, oa(a));
|
|
7377
7403
|
}
|
|
7378
|
-
async function
|
|
7404
|
+
async function $a(e, t) {
|
|
7379
7405
|
q(`${e} Build presenter project configuration`);
|
|
7380
|
-
let [n, r] = await Promise.all([W("config.json"),
|
|
7406
|
+
let [n, r] = await Promise.all([W("config.json"), Bn("src/index.ts")]), i = /* @__PURE__ */ Ua(Ga, n);
|
|
7381
7407
|
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
7382
|
-
return await
|
|
7408
|
+
return await eo(t, n, Jn(r));
|
|
7383
7409
|
}
|
|
7384
|
-
async function
|
|
7385
|
-
return n.length > 0 ? (console.info(`ℹ️ Implements ${String(n.length)} operations:`), console.table(n)) : console.warn("⚠️ Implements no operations"), r === "unknown" ? console.warn("⚠️ No usage identified") : r && console.info(`ℹ️ Supports '${r}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.actionNames = n, r !== void 0 && (t.usageId = r), await
|
|
7410
|
+
async function eo(e, t, n, r) {
|
|
7411
|
+
return n.length > 0 ? (console.info(`ℹ️ Implements ${String(n.length)} operations:`), console.table(n)) : console.warn("⚠️ Implements no operations"), r === "unknown" ? console.warn("⚠️ No usage identified") : r && console.info(`ℹ️ Supports '${r}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.actionNames = n, r !== void 0 && (t.usageId = r), await Hn("config.json", t), t;
|
|
7386
7412
|
}
|
|
7387
|
-
async function
|
|
7413
|
+
async function to() {
|
|
7388
7414
|
try {
|
|
7389
7415
|
G("Synchronise Project with GitHub");
|
|
7390
7416
|
let e = await W("package.json"), t = await W("config.json");
|
|
7391
|
-
switch (await
|
|
7417
|
+
switch (await ro("1️⃣ ", e), Gn(t.id).typeId) {
|
|
7392
7418
|
case "connector":
|
|
7393
|
-
await
|
|
7419
|
+
await Qa("2️⃣ ", e);
|
|
7394
7420
|
break;
|
|
7395
7421
|
case "presenter":
|
|
7396
|
-
await
|
|
7422
|
+
await $a("2️⃣ ", e);
|
|
7397
7423
|
break;
|
|
7398
|
-
default: await
|
|
7424
|
+
default: await Za("2️⃣ ", e);
|
|
7399
7425
|
}
|
|
7400
|
-
await
|
|
7426
|
+
await Rn("3️⃣ Stage changes", "git", ["add", "."]), await Rn("4️⃣ Commit changes", "git", [
|
|
7401
7427
|
"commit",
|
|
7402
7428
|
"-m",
|
|
7403
7429
|
`v${e.version ?? "unknown"}`
|
|
7404
|
-
]), await
|
|
7430
|
+
]), await Rn("5️⃣ Push changes", "git", [
|
|
7405
7431
|
"push",
|
|
7406
7432
|
"origin",
|
|
7407
7433
|
"main:main"
|
|
@@ -7410,14 +7436,14 @@ async function Ya() {
|
|
|
7410
7436
|
console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
|
|
7411
7437
|
}
|
|
7412
7438
|
}
|
|
7413
|
-
async function
|
|
7439
|
+
async function no(e = ["unit"], t = !1) {
|
|
7414
7440
|
try {
|
|
7415
7441
|
G("Test Project");
|
|
7416
7442
|
let n = 0;
|
|
7417
|
-
for (let r of
|
|
7418
|
-
if (!e.includes(r.id) || await
|
|
7443
|
+
for (let r of qa) {
|
|
7444
|
+
if (!e.includes(r.id) || await Vn(r.configFileName) === null) continue;
|
|
7419
7445
|
let i = t && r.id === "unit" ? ["--coverage"] : [];
|
|
7420
|
-
await U(`${
|
|
7446
|
+
await U(`${Ka[n] ?? ""} ${r.label}`, r.command, [...r.arguments, ...i]), n += 1;
|
|
7421
7447
|
}
|
|
7422
7448
|
if (n === 0) {
|
|
7423
7449
|
console.warn("\n⚠️ No tests configured for this project.\n");
|
|
@@ -7428,25 +7454,25 @@ async function Xa(e = ["unit"], t = !1) {
|
|
|
7428
7454
|
console.error("❌ Error testing project", e), process.exit(1);
|
|
7429
7455
|
}
|
|
7430
7456
|
}
|
|
7431
|
-
async function
|
|
7457
|
+
async function ro(e, t, n = "./") {
|
|
7432
7458
|
if (q(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
|
|
7433
7459
|
else {
|
|
7434
7460
|
let e = t.version, n = t.version.split(".");
|
|
7435
7461
|
t.version = `${n[0] ?? "unknown"}.${n[1] ?? "unknown"}.${String(Number(n[2]) + 1)}`, console.info(`Project version bumped from '${e}' to '${t.version}'.`);
|
|
7436
7462
|
}
|
|
7437
|
-
await
|
|
7463
|
+
await Hn(`${n}package.json`, t);
|
|
7438
7464
|
}
|
|
7439
|
-
async function
|
|
7440
|
-
if (r.typeId === "app") q(`${e} Register module`), await
|
|
7441
|
-
else if (r.typeId === "engine") q(`${e} Register module`), await
|
|
7465
|
+
async function io(e, t, n, r) {
|
|
7466
|
+
if (r.typeId === "app") q(`${e} Register module`), await La();
|
|
7467
|
+
else if (r.typeId === "engine") q(`${e} Register module`), await Ba(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await za(n);
|
|
7442
7468
|
else if (r.uploadGroupName === void 0) q(`${e} Registration NOT required`);
|
|
7443
7469
|
else {
|
|
7444
7470
|
q(`${e} Register module`);
|
|
7445
7471
|
let i = n.id.split("-").slice(2).join("-");
|
|
7446
|
-
await
|
|
7472
|
+
await Ba(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await za(n);
|
|
7447
7473
|
}
|
|
7448
7474
|
}
|
|
7449
7475
|
//#endregion
|
|
7450
|
-
export {
|
|
7476
|
+
export { Zn as auditDependencies, Ja as buildProject, er as checkConfigFiles, lr as checkDependencies, pa as documentActions, vr as documentBundleSizes, Br as documentDependencies, ci as documentGovernance, ga as documentOpening, Da as documentUsage, Fa as formatCode, Ia as lintCode, Ya as publishProject, Xa as releaseProject, to as syncProjectWithGitHub, no as testProject, Ra as uploadDirectoryToR2 };
|
|
7451
7477
|
|
|
7452
7478
|
//# sourceMappingURL=dpuse-development.es.js.map
|