@dpuse/dpuse-development 0.3.750 → 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/dependabot.private.yml +9 -0
- package/.github/dependabot.yml +15 -0
- package/.github/publish.cloudflare.yml +67 -0
- package/.github/workflows/ci.yml +64 -0
- package/.github/workflows/codeql.yml +47 -0
- package/.github/workflows/publish.yml +66 -0
- package/.github/workflows/scorecard.yml +44 -0
- package/README.md +54 -63
- package/SECURITY.md +22 -0
- package/dist/dpuse-development.es.js +462 -425
- package/dist/dpuse-development.es.js.map +1 -1
- package/dist/types/src/utilities/index.d.ts +3 -3
- package/package.json +12 -5
- package/vite.config.default.ts +5 -4
- package/vite.config.tool.ts +5 -4
- package/vite.config.wasm.ts +5 -4
- 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,19 +5903,20 @@ async function Jn() {
|
|
|
5903
5903
|
}
|
|
5904
5904
|
//#endregion
|
|
5905
5905
|
//#region src/actions/checkConfigFiles.ts
|
|
5906
|
-
|
|
5906
|
+
var Qn = "@dpuse/dpuse-development/prettierrc", $n = "dpuse-development";
|
|
5907
|
+
async function er() {
|
|
5907
5908
|
try {
|
|
5908
5909
|
G("Check configuration files"), q("1️⃣ Check individual files");
|
|
5909
|
-
let e =
|
|
5910
|
-
await J(
|
|
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");
|
|
5911
5912
|
} catch (e) {
|
|
5912
5913
|
console.error("❌ Error checking configuration files", e), process.exit(1);
|
|
5913
5914
|
}
|
|
5914
5915
|
}
|
|
5915
|
-
async function
|
|
5916
|
+
async function tr(e, t) {
|
|
5916
5917
|
["development"].includes(e.typeId) ? console.info("ℹ️ File '.gitattributes' is UNIQUE to this project") : await J(t, ".gitattributes", [".gitattributes_default"]);
|
|
5917
5918
|
}
|
|
5918
|
-
async function
|
|
5919
|
+
async function nr(e, t) {
|
|
5919
5920
|
["github", "kb"].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is NOT required by this project") : [
|
|
5920
5921
|
"app",
|
|
5921
5922
|
"api",
|
|
@@ -5923,7 +5924,10 @@ async function Zn(e, t) {
|
|
|
5923
5924
|
"eslint"
|
|
5924
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"]);
|
|
5925
5926
|
}
|
|
5926
|
-
|
|
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
|
+
}
|
|
5930
|
+
async function ir(e, t) {
|
|
5927
5931
|
["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.json' is NOT required by this project") : [
|
|
5928
5932
|
"connector",
|
|
5929
5933
|
"engine",
|
|
@@ -5931,10 +5935,10 @@ async function Qn(e, t) {
|
|
|
5931
5935
|
"tool"
|
|
5932
5936
|
].includes(e.typeId) ? await J(t, "tsconfig.json", ["tsconfig.default.json"]) : console.info("ℹ️ File 'tsconfig.json' is UNIQUE to this project");
|
|
5933
5937
|
}
|
|
5934
|
-
async function
|
|
5938
|
+
async function ar(e, t) {
|
|
5935
5939
|
["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.scripts.json' is NOT required by this project") : await J(t, "tsconfig.scripts.json");
|
|
5936
5940
|
}
|
|
5937
|
-
async function
|
|
5941
|
+
async function or(e, t) {
|
|
5938
5942
|
if ([
|
|
5939
5943
|
"eslint",
|
|
5940
5944
|
"github",
|
|
@@ -5952,7 +5956,10 @@ async function er(e, t) {
|
|
|
5952
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);
|
|
5953
5957
|
}
|
|
5954
5958
|
}
|
|
5955
|
-
async function
|
|
5959
|
+
async function sr(e, t) {
|
|
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
|
+
}
|
|
5962
|
+
async function cr(e, t) {
|
|
5956
5963
|
[
|
|
5957
5964
|
"app",
|
|
5958
5965
|
"api",
|
|
@@ -5961,16 +5968,20 @@ async function tr(e, t) {
|
|
|
5961
5968
|
"kb"
|
|
5962
5969
|
].includes(e.typeId) ? console.info("ℹ️ File 'vitest.config.ts' is NOT required by this project") : await J(t, "vitest.config.ts");
|
|
5963
5970
|
}
|
|
5964
|
-
async function J(e, t, r = []) {
|
|
5965
|
-
let
|
|
5971
|
+
async function J(e, t, r = [], i = (e) => e) {
|
|
5972
|
+
let a = n.resolve(process.cwd(), t), o = r.length > 0 ? r : [t], s;
|
|
5966
5973
|
try {
|
|
5967
|
-
|
|
5974
|
+
s = await Bn(a);
|
|
5968
5975
|
} catch (e) {
|
|
5969
5976
|
if (e.code !== "ENOENT") throw e;
|
|
5970
5977
|
}
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5978
|
+
if (s === void 0) {
|
|
5979
|
+
console.info(`⚠️ File '${t}' is MISSING`);
|
|
5980
|
+
return;
|
|
5981
|
+
}
|
|
5982
|
+
for (let r of o) {
|
|
5983
|
+
let a = i(await Bn(n.resolve(e, `../${r}`)));
|
|
5984
|
+
if (s === a) {
|
|
5974
5985
|
console.info(`ℹ️ File '${t.split("_", 1)[0] ?? t}' is the same as '${r}'`);
|
|
5975
5986
|
return;
|
|
5976
5987
|
}
|
|
@@ -5979,7 +5990,7 @@ async function J(e, t, r = []) {
|
|
|
5979
5990
|
}
|
|
5980
5991
|
//#endregion
|
|
5981
5992
|
//#region src/actions/checkDependencies.ts
|
|
5982
|
-
async function
|
|
5993
|
+
async function lr() {
|
|
5983
5994
|
try {
|
|
5984
5995
|
G("Check Dependencies"), await U("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), q("2️⃣ Check using 'npm-check-updates'");
|
|
5985
5996
|
let e = {};
|
|
@@ -5999,7 +6010,7 @@ async function nr() {
|
|
|
5999
6010
|
"--prefer-online",
|
|
6000
6011
|
"--no-strict-allow-scripts"
|
|
6001
6012
|
]);
|
|
6002
|
-
let t = await
|
|
6013
|
+
let t = await ur();
|
|
6003
6014
|
t.length > 0 ? await U("4️⃣ Move install-script pins to installed versions", "npm", [
|
|
6004
6015
|
"install-scripts",
|
|
6005
6016
|
"approve",
|
|
@@ -6013,85 +6024,85 @@ async function nr() {
|
|
|
6013
6024
|
console.error("❌ Error checking dependencies", e), process.exit(1);
|
|
6014
6025
|
}
|
|
6015
6026
|
}
|
|
6016
|
-
async function
|
|
6027
|
+
async function ur() {
|
|
6017
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("@")));
|
|
6018
6029
|
return [...new Set(t)];
|
|
6019
6030
|
}
|
|
6020
6031
|
//#endregion
|
|
6021
6032
|
//#region src/actions/documentBundleSizes.ts
|
|
6022
|
-
var
|
|
6023
|
-
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) {
|
|
6024
6035
|
try {
|
|
6025
6036
|
G("Document Bundle Sizes"), q("1️⃣ Read bundle analysis report");
|
|
6026
6037
|
let t = await W("./bundle-analysis-reports/sonda/index.json");
|
|
6027
|
-
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");
|
|
6028
6039
|
} catch (e) {
|
|
6029
6040
|
console.error("❌ Error documenting bundle sizes", e), process.exit(1);
|
|
6030
6041
|
}
|
|
6031
6042
|
}
|
|
6032
|
-
function
|
|
6033
|
-
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|", "|:------ |:-----------|"];
|
|
6034
6045
|
for (let [e, o] of i) {
|
|
6035
|
-
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);
|
|
6036
6047
|
a.push(...s);
|
|
6037
6048
|
}
|
|
6038
6049
|
return a.join("\n");
|
|
6039
6050
|
}
|
|
6040
|
-
function
|
|
6051
|
+
function br(e, t, n, r, i) {
|
|
6041
6052
|
let [a, { sizes: o, files: s }] = n, c = r > 0 ? o.uncompressed / r * 100 : 0;
|
|
6042
|
-
if (s.size === 1) return [`| ${e} → ${
|
|
6043
|
-
let l = [`| ${e} → ${a} | ${
|
|
6044
|
-
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;
|
|
6045
6056
|
}
|
|
6046
|
-
function
|
|
6047
|
-
let a = [`| ${e} | ${
|
|
6057
|
+
function xr(e, t, n, r, i) {
|
|
6058
|
+
let a = [`| ${e} | ${jr(t)} |`];
|
|
6048
6059
|
for (let [e, { sizes: t, files: o }] of n) {
|
|
6049
6060
|
let n = r > 0 ? t.uncompressed / r * 100 : 0;
|
|
6050
6061
|
if (o.size === 1) {
|
|
6051
|
-
let t =
|
|
6052
|
-
a.push(`| ${
|
|
6062
|
+
let t = Tr(o);
|
|
6063
|
+
a.push(`| ${pr}${Cr(e, t)} | ${Mr(n)} |`);
|
|
6053
6064
|
continue;
|
|
6054
6065
|
}
|
|
6055
|
-
a.push(`| ${
|
|
6066
|
+
a.push(`| ${pr}${e} | ${Mr(n)} |`), i || a.push(...Sr(o, `${pr}${pr}`, r));
|
|
6056
6067
|
}
|
|
6057
6068
|
return a;
|
|
6058
6069
|
}
|
|
6059
|
-
function
|
|
6060
|
-
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)} |`);
|
|
6061
6072
|
}
|
|
6062
|
-
function
|
|
6073
|
+
function Cr(e, t) {
|
|
6063
6074
|
return t === "" ? e : `${e} → ${t}`;
|
|
6064
6075
|
}
|
|
6065
|
-
function
|
|
6076
|
+
function wr(e) {
|
|
6066
6077
|
let [t] = e;
|
|
6067
6078
|
if (t === void 0) throw Error("Expected exactly one entry");
|
|
6068
6079
|
return t;
|
|
6069
6080
|
}
|
|
6070
|
-
function
|
|
6081
|
+
function Tr(e) {
|
|
6071
6082
|
let [t] = e.keys();
|
|
6072
6083
|
if (t === void 0) throw Error("Expected exactly one file");
|
|
6073
6084
|
return t;
|
|
6074
6085
|
}
|
|
6075
|
-
function
|
|
6076
|
-
let t =
|
|
6086
|
+
function Er(e) {
|
|
6087
|
+
let t = Dr(e.dependencies), n = /* @__PURE__ */ new Map();
|
|
6077
6088
|
for (let r of e.resources) {
|
|
6078
6089
|
if (r.kind !== "chunk" || !r.parent) continue;
|
|
6079
|
-
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();
|
|
6080
6091
|
n.set(r.parent, o);
|
|
6081
6092
|
let s = o.get(e) ?? {
|
|
6082
|
-
sizes:
|
|
6093
|
+
sizes: Nr(),
|
|
6083
6094
|
files: /* @__PURE__ */ new Map()
|
|
6084
6095
|
};
|
|
6085
|
-
o.set(e, s),
|
|
6086
|
-
let c = s.files.get(i) ??
|
|
6087
|
-
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);
|
|
6088
6099
|
}
|
|
6089
6100
|
return n;
|
|
6090
6101
|
}
|
|
6091
|
-
function
|
|
6102
|
+
function Dr(e) {
|
|
6092
6103
|
return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
|
|
6093
6104
|
}
|
|
6094
|
-
function
|
|
6105
|
+
function Or(e, t) {
|
|
6095
6106
|
let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
|
|
6096
6107
|
if (n) {
|
|
6097
6108
|
let [t, r] = n;
|
|
@@ -6101,56 +6112,56 @@ function xr(e, t) {
|
|
|
6101
6112
|
};
|
|
6102
6113
|
}
|
|
6103
6114
|
return e === "[unassigned]" ? {
|
|
6104
|
-
group:
|
|
6115
|
+
group: gr,
|
|
6105
6116
|
file: ""
|
|
6106
6117
|
} : e.startsWith("\0") ? {
|
|
6107
6118
|
group: "(runtime)",
|
|
6108
6119
|
file: e.slice(1)
|
|
6109
6120
|
} : {
|
|
6110
6121
|
group: e.startsWith("rust/") || e.includes("vite-plugin-wasm") ? "wasm" : "src",
|
|
6111
|
-
file:
|
|
6122
|
+
file: kr(e)
|
|
6112
6123
|
};
|
|
6113
6124
|
}
|
|
6114
|
-
function
|
|
6125
|
+
function kr(e) {
|
|
6115
6126
|
return e.split("/").at(-1) ?? e;
|
|
6116
6127
|
}
|
|
6117
|
-
function
|
|
6128
|
+
function Ar(e) {
|
|
6118
6129
|
return {
|
|
6119
6130
|
uncompressed: e.uncompressed,
|
|
6120
6131
|
gzip: e.gzip ?? 0
|
|
6121
6132
|
};
|
|
6122
6133
|
}
|
|
6123
|
-
function
|
|
6124
|
-
return `${
|
|
6134
|
+
function jr(e) {
|
|
6135
|
+
return `${Fr(e.uncompressed)} · gzip ${Fr(e.gzip)}`;
|
|
6125
6136
|
}
|
|
6126
|
-
function
|
|
6127
|
-
let t = Math.round(e / 100 *
|
|
6128
|
-
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)}%`;
|
|
6129
6140
|
}
|
|
6130
|
-
function
|
|
6141
|
+
function Nr() {
|
|
6131
6142
|
return {
|
|
6132
6143
|
uncompressed: 0,
|
|
6133
6144
|
gzip: 0
|
|
6134
6145
|
};
|
|
6135
6146
|
}
|
|
6136
|
-
function
|
|
6147
|
+
function Pr(e, t) {
|
|
6137
6148
|
e.uncompressed += t.uncompressed, e.gzip += t.gzip;
|
|
6138
6149
|
}
|
|
6139
|
-
function
|
|
6150
|
+
function Fr(e) {
|
|
6140
6151
|
return e < 1024 ? `${String(e)} B` : `${(e / 1024).toFixed(1)} kB`;
|
|
6141
6152
|
}
|
|
6142
6153
|
//#endregion
|
|
6143
6154
|
//#region src/actions/documentDependencies.ts
|
|
6144
|
-
var
|
|
6145
|
-
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") {
|
|
6146
6157
|
try {
|
|
6147
6158
|
G("Document Dependencies");
|
|
6148
6159
|
let t = await W("package.json");
|
|
6149
6160
|
if (t.name === "@dpuse/dpuse-development" || t.name === "@dpuse/eslint-config-dpuse") {
|
|
6150
|
-
await
|
|
6161
|
+
await Vr(t.name), K("Dependencies documented");
|
|
6151
6162
|
return;
|
|
6152
6163
|
}
|
|
6153
|
-
await
|
|
6164
|
+
await In("1️⃣ Clear downloaded licenses", "licenses/downloads"), q("2️⃣ Identify production licenses"), await new Promise((n, r) => {
|
|
6154
6165
|
let i = {
|
|
6155
6166
|
start: process.cwd(),
|
|
6156
6167
|
production: !0,
|
|
@@ -6165,41 +6176,41 @@ async function Nr(e = "MIT") {
|
|
|
6165
6176
|
c(i, (e) => {
|
|
6166
6177
|
e == null ? n() : r(e);
|
|
6167
6178
|
});
|
|
6168
|
-
}), await
|
|
6179
|
+
}), await zn("3️⃣ Identify transitive dependencies", "npm", [
|
|
6169
6180
|
"ls",
|
|
6170
6181
|
"--all",
|
|
6171
6182
|
"--json",
|
|
6172
6183
|
"--omit=dev"
|
|
6173
|
-
], "licenses/licenseTree.json"), await
|
|
6184
|
+
], "licenses/licenseTree.json"), await Hr("4️⃣ ", e), K("Dependencies documented");
|
|
6174
6185
|
} catch (e) {
|
|
6175
6186
|
console.error("❌ Error documenting dependencies", e), process.exit(1);
|
|
6176
6187
|
}
|
|
6177
6188
|
}
|
|
6178
|
-
async function
|
|
6179
|
-
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);
|
|
6180
6191
|
}
|
|
6181
|
-
async function
|
|
6192
|
+
async function Hr(e, t) {
|
|
6182
6193
|
q(`${e} Insert licenses into 'README.md'`);
|
|
6183
6194
|
let [n, r] = await Promise.all([W("licenses/licenses.json"), W("licenses/licenseTree.json")]), i = /* @__PURE__ */ new Map();
|
|
6184
|
-
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));
|
|
6185
6196
|
await Promise.all(i.values().map(async (e) => {
|
|
6186
|
-
let t = await
|
|
6197
|
+
let t = await Kr(e.name, e.installedVersion);
|
|
6187
6198
|
e.latestVersion = t.latestVersion, e.latestPublishedDate = t.latestPublishedDate, e.publishedDate = t.publishedDate;
|
|
6188
6199
|
}));
|
|
6189
|
-
let a = `${
|
|
6190
|
-
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);
|
|
6191
6202
|
let o = [];
|
|
6192
|
-
r.dependencies != null &&
|
|
6193
|
-
let s = `${
|
|
6194
|
-
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);
|
|
6195
6206
|
}
|
|
6196
|
-
function
|
|
6197
|
-
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.`;
|
|
6198
6209
|
}
|
|
6199
|
-
function
|
|
6210
|
+
function Wr(e) {
|
|
6200
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))}`;
|
|
6201
6212
|
}
|
|
6202
|
-
function
|
|
6213
|
+
function Gr(e, t) {
|
|
6203
6214
|
let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
|
|
6204
6215
|
return {
|
|
6205
6216
|
name: r,
|
|
@@ -6213,7 +6224,7 @@ function Rr(e, t) {
|
|
|
6213
6224
|
...t.licenseFile != null && { licenseFileLink: t.licenseFile }
|
|
6214
6225
|
};
|
|
6215
6226
|
}
|
|
6216
|
-
async function
|
|
6227
|
+
async function Kr(e, t) {
|
|
6217
6228
|
try {
|
|
6218
6229
|
let n = await fetch(`https://registry.npmjs.org/${encodeURIComponent(e)}`);
|
|
6219
6230
|
if (n.ok) {
|
|
@@ -6231,25 +6242,25 @@ async function zr(e, t) {
|
|
|
6231
6242
|
publishedDate: ""
|
|
6232
6243
|
};
|
|
6233
6244
|
}
|
|
6234
|
-
function
|
|
6245
|
+
function qr(e) {
|
|
6235
6246
|
let t = e.licenseFileLink == null || e.licenseFileLink === "" ? "⚠️ No license file" : `[LICENSE](licenses/${e.licenseFileLink})`;
|
|
6236
6247
|
return `|[${e.name}](${e.repository})|${e.installedVersion}|${e.licenseTypes}|${t}|\n`;
|
|
6237
6248
|
}
|
|
6238
|
-
function
|
|
6249
|
+
function Jr(e, t, n, r) {
|
|
6239
6250
|
let i = " ".repeat(r);
|
|
6240
6251
|
for (let [a, o] of Object.entries(e)) {
|
|
6241
|
-
let e = o.version ?? "", s = t.get(`${a}@${e}`), c = s == null ? a : `[${a}](${s.repository})`, l =
|
|
6242
|
-
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);
|
|
6243
6254
|
}
|
|
6244
6255
|
}
|
|
6245
|
-
function
|
|
6256
|
+
function Yr(e) {
|
|
6246
6257
|
if (e == null) return "";
|
|
6247
|
-
let t = e.publishedDate ?
|
|
6258
|
+
let t = e.publishedDate ? Xr(e.publishedDate.split("T", 1)[0]) : "";
|
|
6248
6259
|
if (e.latestVersion === "" || e.latestVersion === e.installedVersion) return t === "" ? "" : ` — ${t}`;
|
|
6249
|
-
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} ❗`;
|
|
6250
6261
|
return t === "" ? ` — → ${r}` : ` — ${t} → ${r}`;
|
|
6251
6262
|
}
|
|
6252
|
-
function
|
|
6263
|
+
function Xr(e) {
|
|
6253
6264
|
if (e == null || e === "") return "n/a";
|
|
6254
6265
|
let t = e.split("T", 1)[0];
|
|
6255
6266
|
if (t == null || t === "") return "n/a";
|
|
@@ -6258,81 +6269,89 @@ function Ur(e) {
|
|
|
6258
6269
|
}
|
|
6259
6270
|
//#endregion
|
|
6260
6271
|
//#region src/actions/documentGovernance.ts
|
|
6261
|
-
var
|
|
6272
|
+
var Zr = "<!-- GOVERNANCE_START -->", Qr = "<!-- GOVERNANCE_END -->", $r = {
|
|
6262
6273
|
"Branch-Protection": 3,
|
|
6263
6274
|
"Code-Review": 0,
|
|
6264
6275
|
Contributors: 0
|
|
6265
|
-
},
|
|
6276
|
+
}, ei = /* @__PURE__ */ new Set(["CII-Best-Practices"]), ti = "coverage/coverage-final.json", ni = "coverage/coverage-summary.json", ri = 80, ii = {
|
|
6266
6277
|
actions: "GitHub Actions",
|
|
6267
6278
|
"javascript-typescript": "JavaScript/TypeScript",
|
|
6268
6279
|
rust: "Rust"
|
|
6269
|
-
},
|
|
6280
|
+
}, ai = {
|
|
6270
6281
|
A: "brightgreen",
|
|
6271
6282
|
B: "green",
|
|
6272
6283
|
C: "yellow",
|
|
6273
6284
|
D: "orange",
|
|
6274
6285
|
F: "red"
|
|
6275
|
-
},
|
|
6276
|
-
async function
|
|
6286
|
+
}, oi = `${jn}/health.json`, si = r(i);
|
|
6287
|
+
async function ci() {
|
|
6277
6288
|
try {
|
|
6278
6289
|
G("Document Governance");
|
|
6279
|
-
let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = await
|
|
6280
|
-
q("
|
|
6281
|
-
let
|
|
6282
|
-
q("
|
|
6283
|
-
let [
|
|
6284
|
-
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");
|
|
6285
6300
|
} catch (e) {
|
|
6286
6301
|
console.error("❌ Error documenting governance", e), process.exit(1);
|
|
6287
6302
|
}
|
|
6288
6303
|
}
|
|
6289
|
-
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) {
|
|
6290
6318
|
if (e.devDependencies?.fallow == null) {
|
|
6291
|
-
q("
|
|
6319
|
+
q("2️⃣ Code health NOT measured, as Fallow is not installed"), q("3️⃣ Code health report NOT required");
|
|
6292
6320
|
return;
|
|
6293
6321
|
}
|
|
6294
|
-
|
|
6322
|
+
await zn("2️⃣ Measure code health", "fallow", [
|
|
6295
6323
|
"health",
|
|
6296
6324
|
"--report-only",
|
|
6297
6325
|
"--format",
|
|
6298
|
-
"json"
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|Maintainability (average)|${a.toFixed(1)}|
|
|
6313
|
-
|Unused files|${o.dead_file_pct.toFixed(1)}%|
|
|
6314
|
-
|Unused exports|${o.dead_export_pct.toFixed(1)}%|
|
|
6315
|
-
|Duplicated code|${o.duplication_pct.toFixed(1)}%|
|
|
6316
|
-
|Functions over the complexity limits|${String(r)} of ${String(i)}|
|
|
6317
|
-
|Unused dependencies|${String(o.unused_dep_count)}|
|
|
6318
|
-
|Circular dependencies|${String(o.circular_dep_count)}|
|
|
6319
|
-
|Hotspots (complex and often changed)|${String(o.hotspot_count)}|
|
|
6320
|
-
|
|
6321
|
-
`;
|
|
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
|
+
});
|
|
6322
6340
|
}
|
|
6323
|
-
async function
|
|
6341
|
+
async function fi(e, t, n) {
|
|
6324
6342
|
let [r, i, a] = await Promise.all([
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6343
|
+
Vn(".github/workflows/ci.yml"),
|
|
6344
|
+
Vn(".github/workflows/codeql.yml"),
|
|
6345
|
+
Vn(".github/dependabot.yml")
|
|
6328
6346
|
]), [o, s, c, l] = await Promise.all([
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
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`)
|
|
6333
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;
|
|
6334
6352
|
return {
|
|
6335
|
-
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],
|
|
6336
6355
|
dependabotAlerts: c !== void 0,
|
|
6337
6356
|
dependabotSecurityUpdates: d("dependabot_security_updates"),
|
|
6338
6357
|
dependabotVersionUpdates: p > m,
|
|
@@ -6347,37 +6366,37 @@ async function ri(e, t, n) {
|
|
|
6347
6366
|
testsInCI: r?.includes("npm test") ?? !1
|
|
6348
6367
|
};
|
|
6349
6368
|
}
|
|
6350
|
-
async function
|
|
6369
|
+
async function pi(e) {
|
|
6351
6370
|
try {
|
|
6352
|
-
let { stdout: t } = await
|
|
6371
|
+
let { stdout: t } = await si("gh", ["api", e]);
|
|
6353
6372
|
return t;
|
|
6354
6373
|
} catch (e) {
|
|
6355
6374
|
if (String(e.stderr).includes("HTTP 404")) return;
|
|
6356
6375
|
throw e;
|
|
6357
6376
|
}
|
|
6358
6377
|
}
|
|
6359
|
-
async function
|
|
6378
|
+
async function mi(e) {
|
|
6360
6379
|
let t = await fetch(`https://www.bestpractices.dev/projects.json?url=${encodeURIComponent(e)}`);
|
|
6361
6380
|
if (!t.ok) throw Error(`OpenSSF Best Practices lookup failed with status ${String(t.status)}.`);
|
|
6362
6381
|
return (await t.json()).find((t) => t.repo_url === e)?.id;
|
|
6363
6382
|
}
|
|
6364
|
-
async function
|
|
6383
|
+
async function hi(e) {
|
|
6365
6384
|
let t = await fetch(`https://api.scorecard.dev/projects/${e}`);
|
|
6366
6385
|
if (t.status !== 404) {
|
|
6367
6386
|
if (!t.ok) throw Error(`OpenSSF Scorecard lookup failed with status ${String(t.status)}.`);
|
|
6368
6387
|
return await t.json();
|
|
6369
6388
|
}
|
|
6370
6389
|
}
|
|
6371
|
-
function
|
|
6372
|
-
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]);
|
|
6373
6392
|
}
|
|
6374
|
-
function
|
|
6393
|
+
function _i(e) {
|
|
6375
6394
|
let t = e.author, n = typeof t == "string" ? t : t?.name;
|
|
6376
6395
|
if (n == null || n === "") throw Error("package.json 'author' field is required to document governance.");
|
|
6377
6396
|
let r = n.indexOf("<"), i = r === -1 ? -1 : n.indexOf(">", r);
|
|
6378
|
-
return
|
|
6397
|
+
return i === -1 ? n.trim() : [n.slice(0, r).trim(), n.slice(i + 1).trim()].filter((e) => e !== "").join(" ");
|
|
6379
6398
|
}
|
|
6380
|
-
function
|
|
6399
|
+
function vi(e) {
|
|
6381
6400
|
let t = (/* @__PURE__ */ new Date()).getFullYear();
|
|
6382
6401
|
if (e == null) return String(t);
|
|
6383
6402
|
let n = new Date(e).getFullYear();
|
|
@@ -6386,98 +6405,112 @@ function li(e) {
|
|
|
6386
6405
|
function Y(e, t = "On") {
|
|
6387
6406
|
return e === void 0 ? "❔ Unknown" : e ? `✅ ${t}` : "❌ Off";
|
|
6388
6407
|
}
|
|
6389
|
-
function
|
|
6390
|
-
|
|
6391
|
-
return `### Checks & Settings
|
|
6392
|
-
|
|
6393
|
-
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}
|
|
6394
6410
|
|
|
6395
6411
|
|Check or setting|Status|What it does|
|
|
6396
6412
|
|:-|:-|:-|
|
|
6397
|
-
${
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
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 = [
|
|
6403
6432
|
[
|
|
6404
|
-
`[
|
|
6405
|
-
Y(
|
|
6406
|
-
|
|
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.`
|
|
6407
6436
|
],
|
|
6408
6437
|
[
|
|
6409
|
-
"
|
|
6410
|
-
Y(
|
|
6411
|
-
"
|
|
6438
|
+
"Secret scanning",
|
|
6439
|
+
Y(i.secretScanning),
|
|
6440
|
+
"Detects credentials, such as API keys and tokens, committed to the repository."
|
|
6412
6441
|
],
|
|
6413
6442
|
[
|
|
6414
|
-
"
|
|
6415
|
-
Y(
|
|
6416
|
-
"
|
|
6417
|
-
]
|
|
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 = [
|
|
6418
6465
|
[
|
|
6419
6466
|
"npm audit",
|
|
6420
|
-
Y(
|
|
6421
|
-
|
|
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.`
|
|
6422
6469
|
],
|
|
6423
6470
|
[
|
|
6424
6471
|
"[Socket.dev](https://socket.dev)",
|
|
6425
|
-
Y(
|
|
6472
|
+
Y(i.socket),
|
|
6426
6473
|
"Flags supply chain risk in dependencies: malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE."
|
|
6427
6474
|
],
|
|
6428
6475
|
[
|
|
6429
6476
|
"Dependabot alerts",
|
|
6430
|
-
Y(
|
|
6477
|
+
Y(i.dependabotAlerts),
|
|
6431
6478
|
"Alerts when a dependency has a known vulnerability, using the GitHub Advisory Database."
|
|
6432
6479
|
],
|
|
6433
6480
|
[
|
|
6434
6481
|
"Dependabot security updates",
|
|
6435
|
-
Y(
|
|
6482
|
+
Y(i.dependabotSecurityUpdates),
|
|
6436
6483
|
"Opens pull requests that update vulnerable dependencies."
|
|
6437
6484
|
],
|
|
6438
6485
|
[
|
|
6439
6486
|
"Dependabot version updates",
|
|
6440
|
-
Y(
|
|
6487
|
+
Y(i.dependabotVersionUpdates),
|
|
6441
6488
|
"Opens pull requests for new dependency versions."
|
|
6442
|
-
],
|
|
6443
|
-
[
|
|
6444
|
-
"Secret scanning",
|
|
6445
|
-
Y(n.secretScanning),
|
|
6446
|
-
"Detects credentials, such as API keys and tokens, committed to the repository."
|
|
6447
|
-
],
|
|
6448
|
-
[
|
|
6449
|
-
"Push protection",
|
|
6450
|
-
Y(n.pushProtection),
|
|
6451
|
-
"Blocks pushes that contain credentials."
|
|
6452
|
-
],
|
|
6453
|
-
[
|
|
6454
|
-
"Private vulnerability reporting",
|
|
6455
|
-
Y(n.privateVulnerabilityReporting),
|
|
6456
|
-
"Lets anyone report a vulnerability privately. See [Reporting Vulnerabilities](#reporting-vulnerabilities)."
|
|
6457
6489
|
]
|
|
6458
|
-
]
|
|
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.
|
|
6459
6492
|
|
|
6460
|
-
`;
|
|
6493
|
+
${yi("Testing", l)}${yi("Code Quality", o)}${yi("Security Analysis", c)}${yi("Dependencies", u)}`;
|
|
6461
6494
|
}
|
|
6462
|
-
function
|
|
6463
|
-
let
|
|
6464
|
-
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
|
|
6465
6498
|
|
|
6466
|
-
${
|
|
6499
|
+
${bi(e, t, i)}### OpenSSF 🚧
|
|
6467
6500
|
|
|
6468
|
-
|
|
6501
|
+
${d}[](https://scorecard.dev/viewer/?uri=${c})
|
|
6469
6502
|
|
|
6470
|
-
|
|
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}
|
|
6471
6504
|
|
|
6472
|
-
|
|
6505
|
+
### Reporting Vulnerabilities
|
|
6473
6506
|
|
|
6474
|
-
|
|
6507
|
+
Please do not open public GitHub issues for security vulnerabilities. ${f}
|
|
6475
6508
|
|
|
6476
6509
|
## Contributing
|
|
6477
6510
|
|
|
6478
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.
|
|
6479
6512
|
|
|
6480
|
-
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.
|
|
6481
6514
|
|
|
6482
6515
|
## License
|
|
6483
6516
|
|
|
@@ -6487,28 +6520,28 @@ This project is licensed under the MIT License, permitting free use, modificatio
|
|
|
6487
6520
|
}
|
|
6488
6521
|
//#endregion
|
|
6489
6522
|
//#region node_modules/@dpuse/dpuse-shared/dist/componentConfig.schema-DT3mO5rS.js
|
|
6490
|
-
var
|
|
6523
|
+
var Si = {
|
|
6491
6524
|
lang: void 0,
|
|
6492
6525
|
message: void 0,
|
|
6493
6526
|
abortEarly: void 0,
|
|
6494
6527
|
abortPipeEarly: void 0
|
|
6495
6528
|
};
|
|
6496
6529
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6497
|
-
function
|
|
6530
|
+
function Ci(e) {
|
|
6498
6531
|
return e ? {
|
|
6499
6532
|
lang: e?.lang ?? void 0,
|
|
6500
6533
|
message: e?.message,
|
|
6501
6534
|
abortEarly: e?.abortEarly ?? void 0,
|
|
6502
6535
|
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
6503
|
-
} :
|
|
6536
|
+
} : Si;
|
|
6504
6537
|
}
|
|
6505
6538
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6506
|
-
function
|
|
6539
|
+
function wi(e) {
|
|
6507
6540
|
let t = typeof e;
|
|
6508
6541
|
return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
|
|
6509
6542
|
}
|
|
6510
6543
|
function X(e, t, n, r, i) {
|
|
6511
|
-
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 = {
|
|
6512
6545
|
kind: e.kind,
|
|
6513
6546
|
type: e.type,
|
|
6514
6547
|
input: a,
|
|
@@ -6525,39 +6558,39 @@ function X(e, t, n, r, i) {
|
|
|
6525
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];
|
|
6526
6559
|
}
|
|
6527
6560
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6528
|
-
function
|
|
6561
|
+
function Ti(e, t) {
|
|
6529
6562
|
return e === t || Number.isNaN(e) && Number.isNaN(t);
|
|
6530
6563
|
}
|
|
6531
6564
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6532
|
-
function
|
|
6565
|
+
function Ei(e, t) {
|
|
6533
6566
|
return Object.prototype.hasOwnProperty.call(e, t) && t !== "__proto__" && t !== "prototype" && t !== "constructor";
|
|
6534
6567
|
}
|
|
6535
6568
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6536
|
-
function
|
|
6569
|
+
function Di(e, t) {
|
|
6537
6570
|
let n = [...new Set(e)];
|
|
6538
6571
|
return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
|
|
6539
6572
|
}
|
|
6540
|
-
function
|
|
6573
|
+
function Oi(e) {
|
|
6541
6574
|
return e["~standard"] = {
|
|
6542
6575
|
version: 1,
|
|
6543
6576
|
vendor: "valibot",
|
|
6544
|
-
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */
|
|
6577
|
+
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */ Ci())
|
|
6545
6578
|
}, e;
|
|
6546
6579
|
}
|
|
6547
6580
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6548
|
-
function
|
|
6581
|
+
function ki(e, t, n) {
|
|
6549
6582
|
return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
|
|
6550
6583
|
}
|
|
6551
6584
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6552
|
-
function
|
|
6585
|
+
function Ai(e, t, n) {
|
|
6553
6586
|
return typeof e.default == "function" ? e.default(t, n) : e.default;
|
|
6554
6587
|
}
|
|
6555
6588
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6556
|
-
function
|
|
6557
|
-
return
|
|
6589
|
+
function ji(e, t) {
|
|
6590
|
+
return Oi({
|
|
6558
6591
|
kind: "schema",
|
|
6559
6592
|
type: "array",
|
|
6560
|
-
reference:
|
|
6593
|
+
reference: ji,
|
|
6561
6594
|
expects: "Array",
|
|
6562
6595
|
async: !1,
|
|
6563
6596
|
item: e,
|
|
@@ -6590,11 +6623,11 @@ function xi(e, t) {
|
|
|
6590
6623
|
});
|
|
6591
6624
|
}
|
|
6592
6625
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6593
|
-
function
|
|
6594
|
-
return
|
|
6626
|
+
function Mi(e) {
|
|
6627
|
+
return Oi({
|
|
6595
6628
|
kind: "schema",
|
|
6596
6629
|
type: "boolean",
|
|
6597
|
-
reference:
|
|
6630
|
+
reference: Mi,
|
|
6598
6631
|
expects: "boolean",
|
|
6599
6632
|
async: !1,
|
|
6600
6633
|
message: e,
|
|
@@ -6604,23 +6637,23 @@ function Si(e) {
|
|
|
6604
6637
|
});
|
|
6605
6638
|
}
|
|
6606
6639
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6607
|
-
function
|
|
6608
|
-
return
|
|
6640
|
+
function Ni(e, t) {
|
|
6641
|
+
return Oi({
|
|
6609
6642
|
kind: "schema",
|
|
6610
6643
|
type: "literal",
|
|
6611
|
-
reference:
|
|
6612
|
-
expects: /* @__PURE__ */
|
|
6644
|
+
reference: Ni,
|
|
6645
|
+
expects: /* @__PURE__ */ wi(e),
|
|
6613
6646
|
async: !1,
|
|
6614
6647
|
literal: e,
|
|
6615
6648
|
message: t,
|
|
6616
6649
|
"~run"(e, t) {
|
|
6617
|
-
return /* @__PURE__ */
|
|
6650
|
+
return /* @__PURE__ */ Ti(e.value, this.literal) ? e.typed = !0 : X(this, "type", e, t), e;
|
|
6618
6651
|
}
|
|
6619
6652
|
});
|
|
6620
6653
|
}
|
|
6621
6654
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6622
6655
|
function Z(e, t) {
|
|
6623
|
-
return
|
|
6656
|
+
return Oi({
|
|
6624
6657
|
kind: "schema",
|
|
6625
6658
|
type: "nullable",
|
|
6626
6659
|
reference: Z,
|
|
@@ -6629,16 +6662,16 @@ function Z(e, t) {
|
|
|
6629
6662
|
wrapped: e,
|
|
6630
6663
|
default: t,
|
|
6631
6664
|
"~run"(e, t) {
|
|
6632
|
-
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);
|
|
6633
6666
|
}
|
|
6634
6667
|
});
|
|
6635
6668
|
}
|
|
6636
6669
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6637
|
-
function
|
|
6638
|
-
return
|
|
6670
|
+
function Pi(e) {
|
|
6671
|
+
return Oi({
|
|
6639
6672
|
kind: "schema",
|
|
6640
6673
|
type: "number",
|
|
6641
|
-
reference:
|
|
6674
|
+
reference: Pi,
|
|
6642
6675
|
expects: "number",
|
|
6643
6676
|
async: !1,
|
|
6644
6677
|
message: e,
|
|
@@ -6648,26 +6681,26 @@ function wi(e) {
|
|
|
6648
6681
|
});
|
|
6649
6682
|
}
|
|
6650
6683
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6651
|
-
function
|
|
6652
|
-
return
|
|
6684
|
+
function Fi(e, t) {
|
|
6685
|
+
return Oi({
|
|
6653
6686
|
kind: "schema",
|
|
6654
6687
|
type: "optional",
|
|
6655
|
-
reference:
|
|
6688
|
+
reference: Fi,
|
|
6656
6689
|
expects: `(${e.expects} | undefined)`,
|
|
6657
6690
|
async: !1,
|
|
6658
6691
|
wrapped: e,
|
|
6659
6692
|
default: t,
|
|
6660
6693
|
"~run"(e, t) {
|
|
6661
|
-
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);
|
|
6662
6695
|
}
|
|
6663
6696
|
});
|
|
6664
6697
|
}
|
|
6665
6698
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6666
|
-
function
|
|
6667
|
-
return
|
|
6699
|
+
function Ii(e, t, n) {
|
|
6700
|
+
return Oi({
|
|
6668
6701
|
kind: "schema",
|
|
6669
6702
|
type: "record",
|
|
6670
|
-
reference:
|
|
6703
|
+
reference: Ii,
|
|
6671
6704
|
expects: "Object",
|
|
6672
6705
|
async: !1,
|
|
6673
6706
|
key: e,
|
|
@@ -6677,7 +6710,7 @@ function Ei(e, t, n) {
|
|
|
6677
6710
|
let n = e.value;
|
|
6678
6711
|
if (n && typeof n == "object") {
|
|
6679
6712
|
e.typed = !0, e.value = {};
|
|
6680
|
-
for (let r in n) if (/* @__PURE__ */
|
|
6713
|
+
for (let r in n) if (/* @__PURE__ */ Ei(n, r)) {
|
|
6681
6714
|
let i = n[r], a = this.key["~run"]({ value: r }, t);
|
|
6682
6715
|
if (a.issues) {
|
|
6683
6716
|
let o = {
|
|
@@ -6717,7 +6750,7 @@ function Ei(e, t, n) {
|
|
|
6717
6750
|
}
|
|
6718
6751
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6719
6752
|
function Q(e, t) {
|
|
6720
|
-
return
|
|
6753
|
+
return Oi({
|
|
6721
6754
|
kind: "schema",
|
|
6722
6755
|
type: "strict_object",
|
|
6723
6756
|
reference: Q,
|
|
@@ -6732,7 +6765,7 @@ function Q(e, t) {
|
|
|
6732
6765
|
for (let r in this.entries) {
|
|
6733
6766
|
let i = this.entries[r];
|
|
6734
6767
|
if (r in n || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
|
|
6735
|
-
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);
|
|
6736
6769
|
if (o.issues) {
|
|
6737
6770
|
let i = {
|
|
6738
6771
|
type: "object",
|
|
@@ -6748,7 +6781,7 @@ function Q(e, t) {
|
|
|
6748
6781
|
}
|
|
6749
6782
|
}
|
|
6750
6783
|
o.typed || (e.typed = !1), e.value[r] = o.value;
|
|
6751
|
-
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */
|
|
6784
|
+
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ ki(i);
|
|
6752
6785
|
else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (X(this, "key", e, t, {
|
|
6753
6786
|
input: void 0,
|
|
6754
6787
|
expected: `"${r}"`,
|
|
@@ -6784,7 +6817,7 @@ function Q(e, t) {
|
|
|
6784
6817
|
}
|
|
6785
6818
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6786
6819
|
function $(e) {
|
|
6787
|
-
return
|
|
6820
|
+
return Oi({
|
|
6788
6821
|
kind: "schema",
|
|
6789
6822
|
type: "string",
|
|
6790
6823
|
reference: $,
|
|
@@ -6797,19 +6830,19 @@ function $(e) {
|
|
|
6797
6830
|
});
|
|
6798
6831
|
}
|
|
6799
6832
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6800
|
-
function
|
|
6833
|
+
function Li(e) {
|
|
6801
6834
|
let t;
|
|
6802
6835
|
if (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);
|
|
6803
6836
|
else t = n.issues;
|
|
6804
6837
|
return t;
|
|
6805
6838
|
}
|
|
6806
6839
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6807
|
-
function
|
|
6808
|
-
return
|
|
6840
|
+
function Ri(e, t) {
|
|
6841
|
+
return Oi({
|
|
6809
6842
|
kind: "schema",
|
|
6810
6843
|
type: "union",
|
|
6811
|
-
reference:
|
|
6812
|
-
expects: /* @__PURE__ */
|
|
6844
|
+
reference: Ri,
|
|
6845
|
+
expects: /* @__PURE__ */ Di(e.map((e) => e.expects), "|"),
|
|
6813
6846
|
async: !1,
|
|
6814
6847
|
options: e,
|
|
6815
6848
|
message: t,
|
|
@@ -6828,29 +6861,29 @@ function Oi(e, t) {
|
|
|
6828
6861
|
if (n) return n;
|
|
6829
6862
|
if (r) {
|
|
6830
6863
|
if (r.length === 1) return r[0];
|
|
6831
|
-
X(this, "type", e, t, { issues: /* @__PURE__ */
|
|
6864
|
+
X(this, "type", e, t, { issues: /* @__PURE__ */ Li(r) }), e.typed = !0;
|
|
6832
6865
|
} else if (i?.length === 1) return i[0];
|
|
6833
|
-
else X(this, "type", e, t, { issues: /* @__PURE__ */
|
|
6866
|
+
else X(this, "type", e, t, { issues: /* @__PURE__ */ Li(i) });
|
|
6834
6867
|
return e;
|
|
6835
6868
|
}
|
|
6836
6869
|
});
|
|
6837
6870
|
}
|
|
6838
|
-
var
|
|
6871
|
+
var zi = /* @__PURE__ */ Q({
|
|
6839
6872
|
en: /* @__PURE__ */ $(),
|
|
6840
6873
|
es: /* @__PURE__ */ $()
|
|
6841
|
-
}),
|
|
6874
|
+
}), Bi = {
|
|
6842
6875
|
id: /* @__PURE__ */ $(),
|
|
6843
6876
|
label: /* @__PURE__ */ Q({
|
|
6844
|
-
en: /* @__PURE__ */
|
|
6845
|
-
es: /* @__PURE__ */
|
|
6877
|
+
en: /* @__PURE__ */ Fi(/* @__PURE__ */ $()),
|
|
6878
|
+
es: /* @__PURE__ */ Fi(/* @__PURE__ */ $())
|
|
6846
6879
|
}),
|
|
6847
6880
|
description: /* @__PURE__ */ Q({
|
|
6848
|
-
en: /* @__PURE__ */
|
|
6849
|
-
es: /* @__PURE__ */
|
|
6881
|
+
en: /* @__PURE__ */ Fi(/* @__PURE__ */ $()),
|
|
6882
|
+
es: /* @__PURE__ */ Fi(/* @__PURE__ */ $())
|
|
6850
6883
|
}),
|
|
6851
6884
|
icon: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6852
6885
|
iconDark: /* @__PURE__ */ Z(/* @__PURE__ */ $())
|
|
6853
|
-
},
|
|
6886
|
+
}, Vi = (e) => /* @__PURE__ */ Ri(e.map((e) => /* @__PURE__ */ Ni(e))), Hi = Vi([
|
|
6854
6887
|
"app",
|
|
6855
6888
|
"connector",
|
|
6856
6889
|
"connectorConnection",
|
|
@@ -6872,33 +6905,33 @@ var ki = /* @__PURE__ */ Q({
|
|
|
6872
6905
|
"presenter",
|
|
6873
6906
|
"presenterPresentation",
|
|
6874
6907
|
"tool"
|
|
6875
|
-
]),
|
|
6908
|
+
]), Ui = Vi([
|
|
6876
6909
|
"danger",
|
|
6877
6910
|
"success",
|
|
6878
6911
|
"warning"
|
|
6879
|
-
]),
|
|
6912
|
+
]), Wi = Vi([
|
|
6880
6913
|
"alpha",
|
|
6881
6914
|
"beta",
|
|
6882
6915
|
"releaseCandidate",
|
|
6883
6916
|
"generalAvailability"
|
|
6884
|
-
]),
|
|
6885
|
-
color:
|
|
6917
|
+
]), Gi = /* @__PURE__ */ Q({
|
|
6918
|
+
color: Ui,
|
|
6886
6919
|
label: /* @__PURE__ */ $()
|
|
6887
|
-
}),
|
|
6888
|
-
...
|
|
6889
|
-
typeId:
|
|
6890
|
-
},
|
|
6891
|
-
...
|
|
6892
|
-
order: /* @__PURE__ */
|
|
6920
|
+
}), Ki = {
|
|
6921
|
+
...Bi,
|
|
6922
|
+
typeId: Hi
|
|
6923
|
+
}, qi = /* @__PURE__ */ Q({
|
|
6924
|
+
...Ki,
|
|
6925
|
+
order: /* @__PURE__ */ Pi(),
|
|
6893
6926
|
path: /* @__PURE__ */ $()
|
|
6894
|
-
}),
|
|
6895
|
-
...
|
|
6896
|
-
firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
6897
|
-
lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
6898
|
-
status: /* @__PURE__ */ Z(
|
|
6899
|
-
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)
|
|
6900
6933
|
};
|
|
6901
|
-
({ ...
|
|
6934
|
+
({ ...Ji }), Vi([
|
|
6902
6935
|
"app",
|
|
6903
6936
|
"engine",
|
|
6904
6937
|
"connector",
|
|
@@ -6908,17 +6941,17 @@ var ki = /* @__PURE__ */ Q({
|
|
|
6908
6941
|
]);
|
|
6909
6942
|
//#endregion
|
|
6910
6943
|
//#region node_modules/@dpuse/dpuse-shared/dist/moduleConfig.schema-aYmFWSrn.js
|
|
6911
|
-
var
|
|
6912
|
-
...
|
|
6944
|
+
var Yi = {
|
|
6945
|
+
...Ji,
|
|
6913
6946
|
vendorAccountURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6914
6947
|
vendorDocumentationURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6915
6948
|
vendorHomeURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6916
6949
|
version: /* @__PURE__ */ $()
|
|
6917
6950
|
};
|
|
6918
|
-
({ ...
|
|
6951
|
+
({ ...Yi });
|
|
6919
6952
|
//#endregion
|
|
6920
6953
|
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModuleConnector.es.js
|
|
6921
|
-
var
|
|
6954
|
+
var Xi = Vi([
|
|
6922
6955
|
"abortOperation",
|
|
6923
6956
|
"auditObjectContent",
|
|
6924
6957
|
"createObject",
|
|
@@ -6934,39 +6967,39 @@ var Bi = ji([
|
|
|
6934
6967
|
"retrieveChunks",
|
|
6935
6968
|
"retrieveRecords",
|
|
6936
6969
|
"upsertRecords"
|
|
6937
|
-
]),
|
|
6970
|
+
]), Zi = Vi([
|
|
6938
6971
|
"application",
|
|
6939
6972
|
"curatedDataset",
|
|
6940
6973
|
"database",
|
|
6941
6974
|
"fileStore"
|
|
6942
|
-
]),
|
|
6975
|
+
]), Qi = /* @__PURE__ */ Q({ label: zi }), $i = Vi([
|
|
6943
6976
|
"bidirectional",
|
|
6944
6977
|
"destination",
|
|
6945
6978
|
"source",
|
|
6946
6979
|
"unknown"
|
|
6947
|
-
]),
|
|
6948
|
-
authMethodId:
|
|
6980
|
+
]), ea = /* @__PURE__ */ Q({ label: zi }), ta = /* @__PURE__ */ Q({
|
|
6981
|
+
authMethodId: Vi([
|
|
6949
6982
|
"apiKey",
|
|
6950
6983
|
"disabled",
|
|
6951
6984
|
"oAuth2",
|
|
6952
6985
|
"none"
|
|
6953
6986
|
]),
|
|
6954
|
-
activeConnectionCount: /* @__PURE__ */
|
|
6955
|
-
canDescribe: /* @__PURE__ */
|
|
6956
|
-
id: /* @__PURE__ */
|
|
6957
|
-
label: /* @__PURE__ */
|
|
6958
|
-
maxConnectionCount: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
6959
|
-
params: /* @__PURE__ */
|
|
6960
|
-
}),
|
|
6961
|
-
...
|
|
6962
|
-
typeId: /* @__PURE__ */
|
|
6963
|
-
actionNames: /* @__PURE__ */
|
|
6964
|
-
category: /* @__PURE__ */ Z(
|
|
6965
|
-
categoryId:
|
|
6966
|
-
implementations: /* @__PURE__ */
|
|
6967
|
-
usage: /* @__PURE__ */ Z(
|
|
6968
|
-
usageId: /* @__PURE__ */ Z(
|
|
6969
|
-
}),
|
|
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 = {
|
|
6970
7003
|
abortOperation: "Abort Operation",
|
|
6971
7004
|
auditObjectContent: "Audit Object Content",
|
|
6972
7005
|
createObject: "Create Object",
|
|
@@ -6982,12 +7015,12 @@ var Bi = ji([
|
|
|
6982
7015
|
retrieveChunks: "Retrieve Chunks",
|
|
6983
7016
|
retrieveRecords: "Retrieve Records",
|
|
6984
7017
|
upsertRecords: "Upsert Records"
|
|
6985
|
-
},
|
|
7018
|
+
}, ia = /* @__PURE__ */ new Set([
|
|
6986
7019
|
"createObject",
|
|
6987
7020
|
"dropObject",
|
|
6988
7021
|
"removeRecords",
|
|
6989
7022
|
"upsertRecords"
|
|
6990
|
-
]),
|
|
7023
|
+
]), aa = /* @__PURE__ */ new Set([
|
|
6991
7024
|
"auditObjectContent",
|
|
6992
7025
|
"findObject",
|
|
6993
7026
|
"getInfo",
|
|
@@ -6998,65 +7031,65 @@ var Bi = ji([
|
|
|
6998
7031
|
"retrieveChunks",
|
|
6999
7032
|
"retrieveRecords"
|
|
7000
7033
|
]);
|
|
7001
|
-
function
|
|
7034
|
+
function oa(e) {
|
|
7002
7035
|
let t = !1, n = !1;
|
|
7003
|
-
for (let r of e)
|
|
7036
|
+
for (let r of e) aa.has(r) && (t = !0), ia.has(r) && (n = !0);
|
|
7004
7037
|
return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "unknown";
|
|
7005
7038
|
}
|
|
7006
|
-
function
|
|
7039
|
+
function sa(e) {
|
|
7007
7040
|
let t = new Set(e), n = "|Action|Supported|\n";
|
|
7008
7041
|
n += "|:----|:-------:|\n";
|
|
7009
|
-
for (let e of Object.keys(
|
|
7042
|
+
for (let e of Object.keys(ra)) n += `| ${ra[e]} | ${t.has(e) ? "✓" : ""} |\n`;
|
|
7010
7043
|
return n;
|
|
7011
7044
|
}
|
|
7012
7045
|
//#endregion
|
|
7013
7046
|
//#region src/actions/documentActions.ts
|
|
7014
|
-
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 = {
|
|
7015
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.",
|
|
7016
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.",
|
|
7017
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.",
|
|
7018
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."
|
|
7019
|
-
},
|
|
7020
|
-
async function
|
|
7052
|
+
}, fa = "The table below lists all connector actions and highlights those supported by this connector.";
|
|
7053
|
+
async function pa() {
|
|
7021
7054
|
try {
|
|
7022
7055
|
G("Document Actions"), q("1️⃣ Insert actions description and table into 'README.md'");
|
|
7023
|
-
let e = (await W("config.json")).actionNames ?? [], t =
|
|
7024
|
-
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");
|
|
7025
7058
|
} catch (e) {
|
|
7026
7059
|
console.error("❌ Error documenting actions", e), process.exit(1);
|
|
7027
7060
|
}
|
|
7028
7061
|
}
|
|
7029
7062
|
//#endregion
|
|
7030
7063
|
//#region src/actions/documentOpening.ts
|
|
7031
|
-
var
|
|
7032
|
-
async function
|
|
7064
|
+
var ma = "<!-- OPENING_START -->", ha = "<!-- OPENING_END -->";
|
|
7065
|
+
async function ga() {
|
|
7033
7066
|
try {
|
|
7034
7067
|
G("Document Opening"), q("1️⃣ Insert opening content into 'README.md'");
|
|
7035
|
-
let e = await W("package.json"), t = await W("config.json"), { owner: n, repo: r } =
|
|
7036
|
-
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");
|
|
7037
7070
|
} catch (e) {
|
|
7038
7071
|
console.error("❌ Error documenting opening", e), process.exit(1);
|
|
7039
7072
|
}
|
|
7040
7073
|
}
|
|
7041
|
-
function
|
|
7074
|
+
function _a(e) {
|
|
7042
7075
|
let t = e.license;
|
|
7043
7076
|
if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
|
|
7044
7077
|
return t;
|
|
7045
7078
|
}
|
|
7046
|
-
function
|
|
7079
|
+
function va(e) {
|
|
7047
7080
|
let t = e.description.en;
|
|
7048
7081
|
if (t == null || t.length === 0) throw Error("config.json 'description.en' field is required to document opening.");
|
|
7049
7082
|
return t;
|
|
7050
7083
|
}
|
|
7051
|
-
function
|
|
7052
|
-
let
|
|
7053
|
-
return `[](${
|
|
7055
|
-
[](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})
|
|
7058
7091
|
|
|
7059
|
-
[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)
|
|
7060
7093
|
|
|
7061
7094
|
## About DPUse
|
|
7062
7095
|
|
|
@@ -7076,12 +7109,12 @@ ${r}`;
|
|
|
7076
7109
|
}
|
|
7077
7110
|
//#endregion
|
|
7078
7111
|
//#region src/actions/documentUsage.ts
|
|
7079
|
-
var
|
|
7112
|
+
var ba = "<!-- USAGE_START -->", xa = "<!-- USAGE_END -->", Sa = /* @__PURE__ */ new Set([
|
|
7080
7113
|
"connector",
|
|
7081
7114
|
"context",
|
|
7082
7115
|
"cookbook",
|
|
7083
7116
|
"presenter"
|
|
7084
|
-
]),
|
|
7117
|
+
]), Ca = [
|
|
7085
7118
|
["build", "Builds the project."],
|
|
7086
7119
|
["build:ts", "Builds the TypeScript source."],
|
|
7087
7120
|
["test", "Runs the tests."],
|
|
@@ -7097,39 +7130,39 @@ var ua = "<!-- USAGE_START -->", da = "<!-- USAGE_END -->", fa = /* @__PURE__ */
|
|
|
7097
7130
|
["documentUsage", "Regenerates the README's Usage section."],
|
|
7098
7131
|
["documentDependencies", "Regenerates the README's dependency licence report."],
|
|
7099
7132
|
["documentBundleSizes", "Regenerates the README's bundle size report."],
|
|
7100
|
-
["documentGovernance", "Regenerates the README's
|
|
7133
|
+
["documentGovernance", "Regenerates the README's Quality & Security, Contributing and License sections."],
|
|
7101
7134
|
["sync", "Bumps the version, then commits and pushes to GitHub."],
|
|
7102
7135
|
["release", "Bumps the version, commits and pushes, and creates a GitHub release."],
|
|
7103
7136
|
["publish", "Registers the released version with DPUse."]
|
|
7104
|
-
],
|
|
7105
|
-
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() {
|
|
7106
7139
|
try {
|
|
7107
7140
|
G("Document Usage"), q("1️⃣ Insert usage content into 'README.md'");
|
|
7108
|
-
let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n =
|
|
7109
|
-
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");
|
|
7110
7143
|
} catch (e) {
|
|
7111
7144
|
console.error("❌ Error documenting usage", e), process.exit(1);
|
|
7112
7145
|
}
|
|
7113
7146
|
}
|
|
7114
|
-
function
|
|
7147
|
+
function Oa(e) {
|
|
7115
7148
|
let t = e.repository, n = typeof t == "string" ? t : t?.url;
|
|
7116
7149
|
if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
|
|
7117
7150
|
return n.replace(/^git\+/, "");
|
|
7118
7151
|
}
|
|
7119
|
-
function
|
|
7152
|
+
function ka(e) {
|
|
7120
7153
|
return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
|
|
7121
7154
|
}
|
|
7122
|
-
function
|
|
7155
|
+
function Aa(e) {
|
|
7123
7156
|
if (e == null) throw Error("package.json version range is required to document usage.");
|
|
7124
7157
|
let t = /\d+(?:\.\d+)*/.exec(e);
|
|
7125
7158
|
if (t == null) throw Error(`Unable to parse version from '${e}'.`);
|
|
7126
7159
|
return t[0];
|
|
7127
7160
|
}
|
|
7128
|
-
function
|
|
7161
|
+
function ja(e, t) {
|
|
7129
7162
|
let { typeId: n } = e;
|
|
7130
|
-
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.
|
|
7131
7164
|
|
|
7132
|
-
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}`;
|
|
7133
7166
|
if (e.publishedTo === "npm") {
|
|
7134
7167
|
if (t == null || t === "") throw Error("package.json 'name' field is required to document usage.");
|
|
7135
7168
|
return `This package is published to the [public npm registry](https://www.npmjs.com/package/${t}). Install it with:
|
|
@@ -7138,18 +7171,18 @@ You may view or clone this repository for your own purposes, such as building a
|
|
|
7138
7171
|
npm install ${t}
|
|
7139
7172
|
\`\`\`
|
|
7140
7173
|
|
|
7141
|
-
${
|
|
7174
|
+
${wa.has(n) ? Ta : ""}To work on the source instead, clone this repository. ${Ea}`;
|
|
7142
7175
|
}
|
|
7143
|
-
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}`;
|
|
7144
7177
|
}
|
|
7145
|
-
function
|
|
7146
|
-
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}|`);
|
|
7147
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")}`;
|
|
7148
7181
|
}
|
|
7149
|
-
function
|
|
7182
|
+
function Na(e) {
|
|
7150
7183
|
return e === "test" ? "npm test" : `npm run ${e}`;
|
|
7151
7184
|
}
|
|
7152
|
-
function
|
|
7185
|
+
function Pa(e, t, n, r, i, a, o) {
|
|
7153
7186
|
return `## Usage
|
|
7154
7187
|
|
|
7155
7188
|
${e}
|
|
@@ -7164,14 +7197,18 @@ _Requires [Node.js](https://nodejs.org/) ${r} or later, [npm](https://www.npmjs.
|
|
|
7164
7197
|
}
|
|
7165
7198
|
//#endregion
|
|
7166
7199
|
//#region src/actions/formatCode.ts
|
|
7167
|
-
async function
|
|
7200
|
+
async function Fa() {
|
|
7168
7201
|
try {
|
|
7169
7202
|
G("Format Code"), await U("1️⃣ Format", "prettier", [
|
|
7170
7203
|
"--write",
|
|
7171
7204
|
"*.json",
|
|
7172
7205
|
"*.md",
|
|
7173
7206
|
"*.ts",
|
|
7174
|
-
...[
|
|
7207
|
+
...[
|
|
7208
|
+
"app",
|
|
7209
|
+
"src",
|
|
7210
|
+
"tests"
|
|
7211
|
+
].filter((t) => e(t)).map((e) => `${e}/**`)
|
|
7175
7212
|
]), K("Code formatted");
|
|
7176
7213
|
} catch (e) {
|
|
7177
7214
|
console.error("❌ Error formatting code", e), process.exit(1);
|
|
@@ -7179,7 +7216,7 @@ async function Ta() {
|
|
|
7179
7216
|
}
|
|
7180
7217
|
//#endregion
|
|
7181
7218
|
//#region src/actions/lintCode.ts
|
|
7182
|
-
async function
|
|
7219
|
+
async function Ia() {
|
|
7183
7220
|
try {
|
|
7184
7221
|
G("Lint Code"), await U("1️⃣ Lint", "eslint", ["."]), K("Code linted");
|
|
7185
7222
|
} catch (e) {
|
|
@@ -7188,7 +7225,7 @@ async function Ea() {
|
|
|
7188
7225
|
}
|
|
7189
7226
|
//#endregion
|
|
7190
7227
|
//#region src/utilities/cloudflare.ts
|
|
7191
|
-
async function
|
|
7228
|
+
async function La() {
|
|
7192
7229
|
let e = await W("config.json"), t = {
|
|
7193
7230
|
body: JSON.stringify(e),
|
|
7194
7231
|
headers: { "Content-Type": "application/json" },
|
|
@@ -7196,11 +7233,11 @@ async function Da() {
|
|
|
7196
7233
|
}, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
|
|
7197
7234
|
if (!n.ok) throw Error(await n.text());
|
|
7198
7235
|
}
|
|
7199
|
-
async function
|
|
7236
|
+
async function Ra(e, t) {
|
|
7200
7237
|
async function n(e, t, r) {
|
|
7201
7238
|
for (let i of r) {
|
|
7202
7239
|
let r = `${e}/${i}`, a = `${t}/${i}`;
|
|
7203
|
-
(await
|
|
7240
|
+
(await qn(r)).isDirectory() ? await n(r, a, await Ln(r)) : (console.info(`⚙️ Uploading '${e}/${i}'...`), await Rn(void 0, "wrangler", [
|
|
7204
7241
|
"r2",
|
|
7205
7242
|
"object",
|
|
7206
7243
|
"put",
|
|
@@ -7211,10 +7248,10 @@ async function Oa(e, t) {
|
|
|
7211
7248
|
]));
|
|
7212
7249
|
}
|
|
7213
7250
|
}
|
|
7214
|
-
let r = await
|
|
7251
|
+
let r = await Ln(`${e}/${t}/`);
|
|
7215
7252
|
await n(`${e}/${t}`, t, r);
|
|
7216
7253
|
}
|
|
7217
|
-
async function
|
|
7254
|
+
async function za(e) {
|
|
7218
7255
|
let t = e.id, n = {
|
|
7219
7256
|
body: JSON.stringify(e),
|
|
7220
7257
|
headers: { "Content-Type": "application/json" },
|
|
@@ -7222,14 +7259,14 @@ async function ka(e) {
|
|
|
7222
7259
|
}, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
|
|
7223
7260
|
if (!r.ok) throw Error(await r.text());
|
|
7224
7261
|
}
|
|
7225
|
-
async function
|
|
7262
|
+
async function Ba(e, t) {
|
|
7226
7263
|
let n = `v${e.version ?? "unknown"}`;
|
|
7227
7264
|
async function r(e, r = "") {
|
|
7228
|
-
let i = await
|
|
7265
|
+
let i = await Ln(e, { withFileTypes: !0 });
|
|
7229
7266
|
for (let a of i) {
|
|
7230
7267
|
if (a.isDirectory() || a.name.endsWith(".map")) continue;
|
|
7231
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;
|
|
7232
|
-
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await
|
|
7269
|
+
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await Rn(void 0, "wrangler", [
|
|
7233
7270
|
"r2",
|
|
7234
7271
|
"object",
|
|
7235
7272
|
"put",
|
|
@@ -7246,24 +7283,24 @@ async function Aa(e, t) {
|
|
|
7246
7283
|
}
|
|
7247
7284
|
//#endregion
|
|
7248
7285
|
//#region node_modules/valibot/dist/index.mjs
|
|
7249
|
-
var
|
|
7286
|
+
var Va = {
|
|
7250
7287
|
lang: void 0,
|
|
7251
7288
|
message: void 0,
|
|
7252
7289
|
abortEarly: void 0,
|
|
7253
7290
|
abortPipeEarly: void 0
|
|
7254
7291
|
};
|
|
7255
7292
|
/* @__NO_SIDE_EFFECTS__ */
|
|
7256
|
-
function
|
|
7293
|
+
function Ha(e) {
|
|
7257
7294
|
return e ? {
|
|
7258
7295
|
lang: e?.lang ?? void 0,
|
|
7259
7296
|
message: e?.message,
|
|
7260
7297
|
abortEarly: e?.abortEarly ?? void 0,
|
|
7261
7298
|
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
7262
|
-
} :
|
|
7299
|
+
} : Va;
|
|
7263
7300
|
}
|
|
7264
7301
|
/* @__NO_SIDE_EFFECTS__ */
|
|
7265
|
-
function
|
|
7266
|
-
let r = e["~run"]({ value: t }, /* @__PURE__ */
|
|
7302
|
+
function Ua(e, t, n) {
|
|
7303
|
+
let r = e["~run"]({ value: t }, /* @__PURE__ */ Ha(n));
|
|
7267
7304
|
return {
|
|
7268
7305
|
typed: r.typed,
|
|
7269
7306
|
success: !r.issues,
|
|
@@ -7273,21 +7310,21 @@ function Na(e, t, n) {
|
|
|
7273
7310
|
}
|
|
7274
7311
|
//#endregion
|
|
7275
7312
|
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModulePresenter.es.js
|
|
7276
|
-
var
|
|
7313
|
+
var Wa = Vi([
|
|
7277
7314
|
"list",
|
|
7278
7315
|
"render",
|
|
7279
7316
|
"setColorMode"
|
|
7280
|
-
]),
|
|
7281
|
-
...
|
|
7282
|
-
typeId: /* @__PURE__ */
|
|
7283
|
-
actionNames: /* @__PURE__ */
|
|
7284
|
-
presentations: /* @__PURE__ */
|
|
7285
|
-
}),
|
|
7317
|
+
]), Ga = /* @__PURE__ */ Q({
|
|
7318
|
+
...Yi,
|
|
7319
|
+
typeId: /* @__PURE__ */ Ni("presenter"),
|
|
7320
|
+
actionNames: /* @__PURE__ */ ji(Wa),
|
|
7321
|
+
presentations: /* @__PURE__ */ ji(qi)
|
|
7322
|
+
}), Ka = [
|
|
7286
7323
|
"1️⃣ ",
|
|
7287
7324
|
"2️⃣ ",
|
|
7288
7325
|
"3️⃣ ",
|
|
7289
7326
|
"4️⃣ "
|
|
7290
|
-
],
|
|
7327
|
+
], qa = [{
|
|
7291
7328
|
id: "unit",
|
|
7292
7329
|
label: "Run unit tests",
|
|
7293
7330
|
command: "vitest",
|
|
@@ -7300,46 +7337,46 @@ var Pa = ji([
|
|
|
7300
7337
|
arguments: ["test", "--pass-with-no-tests"],
|
|
7301
7338
|
configFileName: "playwright.config.ts"
|
|
7302
7339
|
}];
|
|
7303
|
-
async function
|
|
7340
|
+
async function Ja() {
|
|
7304
7341
|
try {
|
|
7305
7342
|
G("Build Project"), await U("1️⃣ Bundle project", "vite", ["build"]), K("Project built");
|
|
7306
7343
|
} catch (e) {
|
|
7307
7344
|
console.error("❌ Error building project", e), process.exit(1);
|
|
7308
7345
|
}
|
|
7309
7346
|
}
|
|
7310
|
-
async function
|
|
7347
|
+
async function Ya() {
|
|
7311
7348
|
try {
|
|
7312
7349
|
G("Publish Project");
|
|
7313
7350
|
let e = await W("package.json"), t = await W("config.json");
|
|
7314
|
-
await
|
|
7351
|
+
await io("1️⃣ ", e, t, Gn(t.id)), K(`Project version '${e.version ?? "unknown"}' published.`);
|
|
7315
7352
|
} catch (e) {
|
|
7316
7353
|
console.error("❌ Error publishing project", e), process.exit(1);
|
|
7317
7354
|
}
|
|
7318
7355
|
}
|
|
7319
|
-
async function
|
|
7356
|
+
async function Xa() {
|
|
7320
7357
|
try {
|
|
7321
7358
|
G("Release Project");
|
|
7322
7359
|
let e = await W("package.json"), t = await W("config.json");
|
|
7323
|
-
await
|
|
7324
|
-
let n =
|
|
7360
|
+
await ro("1️⃣ ", e);
|
|
7361
|
+
let n = Gn(t.id);
|
|
7325
7362
|
switch (n.typeId) {
|
|
7326
7363
|
case "connector":
|
|
7327
|
-
t = await
|
|
7364
|
+
t = await Qa("2️⃣ ", e);
|
|
7328
7365
|
break;
|
|
7329
7366
|
case "presenter":
|
|
7330
|
-
t = await
|
|
7367
|
+
t = await $a("2️⃣ ", e);
|
|
7331
7368
|
break;
|
|
7332
|
-
default: t = await
|
|
7369
|
+
default: t = await Za("2️⃣ ", e);
|
|
7333
7370
|
}
|
|
7334
|
-
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", [
|
|
7335
7372
|
"commit",
|
|
7336
7373
|
"-m",
|
|
7337
7374
|
`v${e.version ?? "unknown"}`
|
|
7338
|
-
]), await
|
|
7375
|
+
]), await Rn("6️⃣ Push changes", "git", [
|
|
7339
7376
|
"push",
|
|
7340
7377
|
"origin",
|
|
7341
7378
|
"main:main"
|
|
7342
|
-
]), await
|
|
7379
|
+
]), await io("7️⃣ ", e, t, n), n.publishedTo === "npm" ? await U("8️⃣ Create GitHub release", "gh", [
|
|
7343
7380
|
"release",
|
|
7344
7381
|
"create",
|
|
7345
7382
|
`v${e.version ?? "unknown"}`,
|
|
@@ -7352,45 +7389,45 @@ async function Ba() {
|
|
|
7352
7389
|
console.error("❌ Error releasing project", e), process.exit(1);
|
|
7353
7390
|
}
|
|
7354
7391
|
}
|
|
7355
|
-
async function
|
|
7392
|
+
async function Za(e, t) {
|
|
7356
7393
|
q(`${e} Build project configuration`);
|
|
7357
7394
|
let n = await W("config.json");
|
|
7358
|
-
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;
|
|
7359
7396
|
}
|
|
7360
|
-
async function
|
|
7397
|
+
async function Qa(e, t) {
|
|
7361
7398
|
q(`${e} Build connector project configuration`);
|
|
7362
|
-
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);
|
|
7363
7400
|
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
7364
|
-
let a =
|
|
7365
|
-
return await
|
|
7401
|
+
let a = Jn(r);
|
|
7402
|
+
return await eo(t, n, a, oa(a));
|
|
7366
7403
|
}
|
|
7367
|
-
async function
|
|
7404
|
+
async function $a(e, t) {
|
|
7368
7405
|
q(`${e} Build presenter project configuration`);
|
|
7369
|
-
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);
|
|
7370
7407
|
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
7371
|
-
return await
|
|
7408
|
+
return await eo(t, n, Jn(r));
|
|
7372
7409
|
}
|
|
7373
|
-
async function
|
|
7374
|
-
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;
|
|
7375
7412
|
}
|
|
7376
|
-
async function
|
|
7413
|
+
async function to() {
|
|
7377
7414
|
try {
|
|
7378
7415
|
G("Synchronise Project with GitHub");
|
|
7379
7416
|
let e = await W("package.json"), t = await W("config.json");
|
|
7380
|
-
switch (await
|
|
7417
|
+
switch (await ro("1️⃣ ", e), Gn(t.id).typeId) {
|
|
7381
7418
|
case "connector":
|
|
7382
|
-
await
|
|
7419
|
+
await Qa("2️⃣ ", e);
|
|
7383
7420
|
break;
|
|
7384
7421
|
case "presenter":
|
|
7385
|
-
await
|
|
7422
|
+
await $a("2️⃣ ", e);
|
|
7386
7423
|
break;
|
|
7387
|
-
default: await
|
|
7424
|
+
default: await Za("2️⃣ ", e);
|
|
7388
7425
|
}
|
|
7389
|
-
await
|
|
7426
|
+
await Rn("3️⃣ Stage changes", "git", ["add", "."]), await Rn("4️⃣ Commit changes", "git", [
|
|
7390
7427
|
"commit",
|
|
7391
7428
|
"-m",
|
|
7392
7429
|
`v${e.version ?? "unknown"}`
|
|
7393
|
-
]), await
|
|
7430
|
+
]), await Rn("5️⃣ Push changes", "git", [
|
|
7394
7431
|
"push",
|
|
7395
7432
|
"origin",
|
|
7396
7433
|
"main:main"
|
|
@@ -7399,14 +7436,14 @@ async function Ga() {
|
|
|
7399
7436
|
console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
|
|
7400
7437
|
}
|
|
7401
7438
|
}
|
|
7402
|
-
async function
|
|
7439
|
+
async function no(e = ["unit"], t = !1) {
|
|
7403
7440
|
try {
|
|
7404
7441
|
G("Test Project");
|
|
7405
7442
|
let n = 0;
|
|
7406
|
-
for (let r of
|
|
7407
|
-
if (!e.includes(r.id) || await
|
|
7443
|
+
for (let r of qa) {
|
|
7444
|
+
if (!e.includes(r.id) || await Vn(r.configFileName) === null) continue;
|
|
7408
7445
|
let i = t && r.id === "unit" ? ["--coverage"] : [];
|
|
7409
|
-
await U(`${
|
|
7446
|
+
await U(`${Ka[n] ?? ""} ${r.label}`, r.command, [...r.arguments, ...i]), n += 1;
|
|
7410
7447
|
}
|
|
7411
7448
|
if (n === 0) {
|
|
7412
7449
|
console.warn("\n⚠️ No tests configured for this project.\n");
|
|
@@ -7417,25 +7454,25 @@ async function Ka(e = ["unit"], t = !1) {
|
|
|
7417
7454
|
console.error("❌ Error testing project", e), process.exit(1);
|
|
7418
7455
|
}
|
|
7419
7456
|
}
|
|
7420
|
-
async function
|
|
7457
|
+
async function ro(e, t, n = "./") {
|
|
7421
7458
|
if (q(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
|
|
7422
7459
|
else {
|
|
7423
7460
|
let e = t.version, n = t.version.split(".");
|
|
7424
7461
|
t.version = `${n[0] ?? "unknown"}.${n[1] ?? "unknown"}.${String(Number(n[2]) + 1)}`, console.info(`Project version bumped from '${e}' to '${t.version}'.`);
|
|
7425
7462
|
}
|
|
7426
|
-
await
|
|
7463
|
+
await Hn(`${n}package.json`, t);
|
|
7427
7464
|
}
|
|
7428
|
-
async function
|
|
7429
|
-
if (r.typeId === "app") q(`${e} Register module`), await
|
|
7430
|
-
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);
|
|
7431
7468
|
else if (r.uploadGroupName === void 0) q(`${e} Registration NOT required`);
|
|
7432
7469
|
else {
|
|
7433
7470
|
q(`${e} Register module`);
|
|
7434
7471
|
let i = n.id.split("-").slice(2).join("-");
|
|
7435
|
-
await
|
|
7472
|
+
await Ba(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await za(n);
|
|
7436
7473
|
}
|
|
7437
7474
|
}
|
|
7438
7475
|
//#endregion
|
|
7439
|
-
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 };
|
|
7440
7477
|
|
|
7441
7478
|
//# sourceMappingURL=dpuse-development.es.js.map
|