@dpuse/dpuse-development 0.3.750 → 0.3.751
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 +44 -0
- package/.github/workflows/publish.yml +66 -0
- package/.github/workflows/scorecard.yml +44 -0
- package/README.md +48 -74
- package/SECURITY.md +22 -0
- package/dist/dpuse-development.es.js +309 -298
- package/dist/dpuse-development.es.js.map +1 -1
- package/package.json +9 -6
- package/vite.config.default.ts +5 -4
- package/vite.config.tool.ts +5 -4
- package/vite.config.wasm.ts +5 -4
|
@@ -5903,19 +5903,20 @@ async function Jn() {
|
|
|
5903
5903
|
}
|
|
5904
5904
|
//#endregion
|
|
5905
5905
|
//#region src/actions/checkConfigFiles.ts
|
|
5906
|
-
|
|
5906
|
+
var Yn = "@dpuse/dpuse-development/prettierrc", Xn = "dpuse-development";
|
|
5907
|
+
async function Zn() {
|
|
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 = Hn(e.id), a = n.dirname(o(import.meta.url));
|
|
5911
|
+
await J(a, ".editorconfig"), await Qn(i, a), await J(a, ".gitignore", [".gitignore_default"]), await J(a, ".markdownlint.json"), await J(a, ".ncurc.json"), await $n(i, a), await J(a, "LICENSE"), await tr(i, a), await nr(i, a), await rr(i, a), await ar(i, a), er(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 ir(i, a), await J(a, "SECURITY.md", [], (t) => t.replaceAll(Xn, () => 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 Qn(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 $n(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 er(e, t) {
|
|
5928
|
+
["app", "development"].includes(e.typeId) ? console.info("ℹ️ File '.prettierrc.json' is UNIQUE to this project") : t.prettier === Yn ? console.info(`ℹ️ Prettier configuration is '${Yn}'`) : console.info(`⚠️ Prettier configuration is NOT '${Yn}'`);
|
|
5929
|
+
}
|
|
5930
|
+
async function tr(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 nr(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 rr(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 ir(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 ar(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 Ln(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 Ln(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 or() {
|
|
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 sr();
|
|
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 sr() {
|
|
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 cr = "<!-- BUNDLE_START -->", lr = "<!-- BUNDLE_END -->", ur = " ", dr = 20, fr = "The Bundle Analysis Report is generated automatically on each release 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._", pr = "(bundler output, whitespace & JSON)", mr = `${pr} = 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 hr(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 Bn(`## Bundle Analysis\n\n${
|
|
6038
|
+
q("2️⃣ Insert table into 'README.md'"), await Bn(`## Bundle Analysis\n\n${fr}\n\n${gr(t, e?.moduleLevel ?? !1)}\n\n${mr}`, cr, lr), 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 gr(e, t) {
|
|
6044
|
+
let n = Cr(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, Dr(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 ? _r(e, o, xr(i), r, t) : vr(e, o, i, r, t);
|
|
6036
6047
|
a.push(...s);
|
|
6037
6048
|
}
|
|
6038
6049
|
return a.join("\n");
|
|
6039
6050
|
}
|
|
6040
|
-
function
|
|
6051
|
+
function _r(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} → ${br(a, Sr(s))} | ${Or(t)} · ${kr(c)} |`];
|
|
6054
|
+
let l = [`| ${e} → ${a} | ${Or(t)} · ${kr(c)} |`];
|
|
6055
|
+
return i || l.push(...yr(s, ur, r)), l;
|
|
6045
6056
|
}
|
|
6046
|
-
function
|
|
6047
|
-
let a = [`| ${e} | ${
|
|
6057
|
+
function vr(e, t, n, r, i) {
|
|
6058
|
+
let a = [`| ${e} | ${Or(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 = Sr(o);
|
|
6063
|
+
a.push(`| ${ur}${br(e, t)} | ${kr(n)} |`);
|
|
6053
6064
|
continue;
|
|
6054
6065
|
}
|
|
6055
|
-
a.push(`| ${
|
|
6066
|
+
a.push(`| ${ur}${e} | ${kr(n)} |`), i || a.push(...yr(o, `${ur}${ur}`, 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 yr(e, t, n) {
|
|
6071
|
+
return [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed).map(([e, r]) => `| ${t}${e} | ${kr(n > 0 ? r.uncompressed / n * 100 : 0)} |`);
|
|
6061
6072
|
}
|
|
6062
|
-
function
|
|
6073
|
+
function br(e, t) {
|
|
6063
6074
|
return t === "" ? e : `${e} → ${t}`;
|
|
6064
6075
|
}
|
|
6065
|
-
function
|
|
6076
|
+
function xr(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 Sr(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 Cr(e) {
|
|
6087
|
+
let t = wr(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 } = Tr(r.name, t), a = Dr(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: Ar(),
|
|
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), jr(s.sizes, a);
|
|
6097
|
+
let c = s.files.get(i) ?? Ar();
|
|
6098
|
+
s.files.set(i, c), jr(c, a);
|
|
6088
6099
|
}
|
|
6089
6100
|
return n;
|
|
6090
6101
|
}
|
|
6091
|
-
function
|
|
6102
|
+
function wr(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 Tr(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,53 +6112,53 @@ function xr(e, t) {
|
|
|
6101
6112
|
};
|
|
6102
6113
|
}
|
|
6103
6114
|
return e === "[unassigned]" ? {
|
|
6104
|
-
group:
|
|
6115
|
+
group: pr,
|
|
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: Er(e)
|
|
6112
6123
|
};
|
|
6113
6124
|
}
|
|
6114
|
-
function
|
|
6125
|
+
function Er(e) {
|
|
6115
6126
|
return e.split("/").at(-1) ?? e;
|
|
6116
6127
|
}
|
|
6117
|
-
function
|
|
6128
|
+
function Dr(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 Or(e) {
|
|
6135
|
+
return `${Mr(e.uncompressed)} · gzip ${Mr(e.gzip)}`;
|
|
6125
6136
|
}
|
|
6126
|
-
function
|
|
6127
|
-
let t = Math.round(e / 100 *
|
|
6128
|
-
return `\`${"█".repeat(t)}${"░".repeat(
|
|
6137
|
+
function kr(e) {
|
|
6138
|
+
let t = Math.round(e / 100 * dr);
|
|
6139
|
+
return `\`${"█".repeat(t)}${"░".repeat(dr - t)}\` ${e.toFixed(1)}%`;
|
|
6129
6140
|
}
|
|
6130
|
-
function
|
|
6141
|
+
function Ar() {
|
|
6131
6142
|
return {
|
|
6132
6143
|
uncompressed: 0,
|
|
6133
6144
|
gzip: 0
|
|
6134
6145
|
};
|
|
6135
6146
|
}
|
|
6136
|
-
function
|
|
6147
|
+
function jr(e, t) {
|
|
6137
6148
|
e.uncompressed += t.uncompressed, e.gzip += t.gzip;
|
|
6138
6149
|
}
|
|
6139
|
-
function
|
|
6150
|
+
function Mr(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 Nr = "<!-- DEPENDENCY_LICENSES_START -->", Pr = "<!-- DEPENDENCY_LICENSES_END -->", Fr = "## Dependency Licenses", Ir = "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 Lr(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 Rr(t.name), K("Dependencies documented");
|
|
6151
6162
|
return;
|
|
6152
6163
|
}
|
|
6153
6164
|
await Nn("1️⃣ Clear downloaded licenses", "licenses/downloads"), q("2️⃣ Identify production licenses"), await new Promise((n, r) => {
|
|
@@ -6170,36 +6181,36 @@ async function Nr(e = "MIT") {
|
|
|
6170
6181
|
"--all",
|
|
6171
6182
|
"--json",
|
|
6172
6183
|
"--omit=dev"
|
|
6173
|
-
], "licenses/licenseTree.json"), await
|
|
6184
|
+
], "licenses/licenseTree.json"), await zr("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 Bn(`${
|
|
6189
|
+
async function Rr(e) {
|
|
6190
|
+
q(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`), await Bn(`${Fr}\n\n${`> [!WARNING]\n> Dependency licenses are not documented here: ${e} is a development-only tool and is never part of a production release.`}`, Nr, Pr);
|
|
6180
6191
|
}
|
|
6181
|
-
async function
|
|
6192
|
+
async function zr(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, Hr(e, t));
|
|
6185
6196
|
await Promise.all(i.values().map(async (e) => {
|
|
6186
|
-
let t = await
|
|
6197
|
+
let t = await Ur(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 = `${Br(t)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
|
|
6201
|
+
for (let e of i.values()) a += Wr(e);
|
|
6191
6202
|
let o = [];
|
|
6192
|
-
r.dependencies != null &&
|
|
6193
|
-
let s = `${
|
|
6194
|
-
await Bn(`${
|
|
6203
|
+
r.dependencies != null && Gr(r.dependencies, i, o, 0);
|
|
6204
|
+
let s = `${Ir}\n\n${o.join("\n")}`;
|
|
6205
|
+
await Bn(`${Fr}\n\n${a.trimEnd()}\n\n### Dependency Tree\n\n${s}`, Nr, Pr);
|
|
6195
6206
|
}
|
|
6196
|
-
function
|
|
6197
|
-
return `License data is collected automatically on each release 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 ${
|
|
6207
|
+
function Br(e) {
|
|
6208
|
+
return `License data is collected automatically on each release 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 ${Vr(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 Vr(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 Hr(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 Ur(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 Wr(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 Gr(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 = Kr(s);
|
|
6253
|
+
n.push(`${i}- **${c}** ${e}${l}`), o.dependencies != null && Gr(o.dependencies, t, n, r + 1);
|
|
6243
6254
|
}
|
|
6244
6255
|
}
|
|
6245
|
-
function
|
|
6256
|
+
function Kr(e) {
|
|
6246
6257
|
if (e == null) return "";
|
|
6247
|
-
let t = e.publishedDate ?
|
|
6258
|
+
let t = e.publishedDate ? qr(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 ? qr(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 qr(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,35 +6269,35 @@ function Ur(e) {
|
|
|
6258
6269
|
}
|
|
6259
6270
|
//#endregion
|
|
6260
6271
|
//#region src/actions/documentGovernance.ts
|
|
6261
|
-
var
|
|
6272
|
+
var Jr = "<!-- GOVERNANCE_START -->", Yr = "<!-- GOVERNANCE_END -->", Xr = {
|
|
6262
6273
|
"Branch-Protection": 3,
|
|
6263
6274
|
"Code-Review": 0,
|
|
6264
6275
|
Contributors: 0
|
|
6265
|
-
},
|
|
6276
|
+
}, Zr = /* @__PURE__ */ new Set(["CII-Best-Practices"]), Qr = {
|
|
6266
6277
|
actions: "GitHub Actions",
|
|
6267
6278
|
"javascript-typescript": "JavaScript/TypeScript",
|
|
6268
6279
|
rust: "Rust"
|
|
6269
|
-
},
|
|
6280
|
+
}, $r = "code-health-reports/fallow", ei = {
|
|
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
|
+
}, ti = `${$r}/health.json`, ni = `${$r}/index.md`, ri = r(i);
|
|
6287
|
+
async function ii() {
|
|
6277
6288
|
try {
|
|
6278
6289
|
G("Document Governance");
|
|
6279
|
-
let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = await
|
|
6290
|
+
let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = await ai(e), { owner: r, repo: i } = Un(e, "document governance");
|
|
6280
6291
|
q("3️⃣ Read security checks and settings");
|
|
6281
|
-
let a = await
|
|
6292
|
+
let a = await si(r, i, e);
|
|
6282
6293
|
q("4️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
|
|
6283
|
-
let [o, s] = await Promise.all([
|
|
6284
|
-
q("5️⃣ Insert governance content into 'README.md'"), await Bn(
|
|
6294
|
+
let [o, s] = await Promise.all([li(`https://github.com/${r}/${i}`), ui(`github.com/${r}/${i}`)]);
|
|
6295
|
+
q("5️⃣ Insert governance content into 'README.md'"), await Bn(hi(r, i, fi(e), pi(t.firstCreatedAt), n, o, a, s), Jr, Yr), K("Governance documented");
|
|
6285
6296
|
} catch (e) {
|
|
6286
6297
|
console.error("❌ Error documenting governance", e), process.exit(1);
|
|
6287
6298
|
}
|
|
6288
6299
|
}
|
|
6289
|
-
async function
|
|
6300
|
+
async function ai(e) {
|
|
6290
6301
|
if (e.devDependencies?.fallow == null) {
|
|
6291
6302
|
q("1️⃣ Code health NOT measured, as Fallow is not installed"), q("2️⃣ Code health report NOT required");
|
|
6292
6303
|
return;
|
|
@@ -6296,15 +6307,15 @@ async function ti(e) {
|
|
|
6296
6307
|
"--report-only",
|
|
6297
6308
|
"--format",
|
|
6298
6309
|
"json"
|
|
6299
|
-
],
|
|
6310
|
+
], ti), await In("2️⃣ Write code health report", "fallow", ["--format", "markdown"], ni, !0), await W(ti);
|
|
6300
6311
|
}
|
|
6301
|
-
function
|
|
6312
|
+
function oi(e) {
|
|
6302
6313
|
let { score: t, grade: n } = e.health_score, { functions_above_threshold: r, functions_analyzed: i, average_maintainability: a } = e.summary, o = e.vital_signs;
|
|
6303
6314
|
return `### Code Health
|
|
6304
6315
|
|
|
6305
|
-
[)})`).replaceAll("-", "--").replaceAll("(", "%28").replaceAll(")", "%29")}-${
|
|
6316
|
+
[)})`).replaceAll("-", "--").replaceAll("(", "%28").replaceAll(")", "%29")}-${ei[n] ?? "lightgrey"}`})](./${ni})
|
|
6306
6317
|
|
|
6307
|
-
[Fallow](https://github.com/fallow-rs/fallow) analyses the TypeScript source on each release for unused code, duplication, complexity, and dependency hygiene. See the [full Fallow report](./${
|
|
6318
|
+
[Fallow](https://github.com/fallow-rs/fallow) analyses the TypeScript source on each release for unused code, duplication, complexity, and dependency hygiene. See the [full Fallow report](./${ni}) for every finding.
|
|
6308
6319
|
|
|
6309
6320
|
|Measure|Value|
|
|
6310
6321
|
|:-|-:|
|
|
@@ -6320,19 +6331,19 @@ function ni(e) {
|
|
|
6320
6331
|
|
|
6321
6332
|
`;
|
|
6322
6333
|
}
|
|
6323
|
-
async function
|
|
6334
|
+
async function si(e, t, n) {
|
|
6324
6335
|
let [r, i, a] = await Promise.all([
|
|
6325
6336
|
Rn(".github/workflows/ci.yml"),
|
|
6326
6337
|
Rn(".github/workflows/codeql.yml"),
|
|
6327
6338
|
Rn(".github/dependabot.yml")
|
|
6328
6339
|
]), [o, s, c, l] = await Promise.all([
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6340
|
+
ci(`repos/${e}/${t}`),
|
|
6341
|
+
ci(`repos/${e}/${t}/private-vulnerability-reporting`),
|
|
6342
|
+
ci(`repos/${e}/${t}/vulnerability-alerts`),
|
|
6343
|
+
ci(`repos/${e}/${t}/commits/main/check-runs?per_page=100`)
|
|
6333
6344
|
]), 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
6345
|
return {
|
|
6335
|
-
codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) =>
|
|
6346
|
+
codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) => Qr[e] ?? e).toArray(),
|
|
6336
6347
|
dependabotAlerts: c !== void 0,
|
|
6337
6348
|
dependabotSecurityUpdates: d("dependabot_security_updates"),
|
|
6338
6349
|
dependabotVersionUpdates: p > m,
|
|
@@ -6347,37 +6358,37 @@ async function ri(e, t, n) {
|
|
|
6347
6358
|
testsInCI: r?.includes("npm test") ?? !1
|
|
6348
6359
|
};
|
|
6349
6360
|
}
|
|
6350
|
-
async function
|
|
6361
|
+
async function ci(e) {
|
|
6351
6362
|
try {
|
|
6352
|
-
let { stdout: t } = await
|
|
6363
|
+
let { stdout: t } = await ri("gh", ["api", e]);
|
|
6353
6364
|
return t;
|
|
6354
6365
|
} catch (e) {
|
|
6355
6366
|
if (String(e.stderr).includes("HTTP 404")) return;
|
|
6356
6367
|
throw e;
|
|
6357
6368
|
}
|
|
6358
6369
|
}
|
|
6359
|
-
async function
|
|
6370
|
+
async function li(e) {
|
|
6360
6371
|
let t = await fetch(`https://www.bestpractices.dev/projects.json?url=${encodeURIComponent(e)}`);
|
|
6361
6372
|
if (!t.ok) throw Error(`OpenSSF Best Practices lookup failed with status ${String(t.status)}.`);
|
|
6362
6373
|
return (await t.json()).find((t) => t.repo_url === e)?.id;
|
|
6363
6374
|
}
|
|
6364
|
-
async function
|
|
6375
|
+
async function ui(e) {
|
|
6365
6376
|
let t = await fetch(`https://api.scorecard.dev/projects/${e}`);
|
|
6366
6377
|
if (t.status !== 404) {
|
|
6367
6378
|
if (!t.ok) throw Error(`OpenSSF Scorecard lookup failed with status ${String(t.status)}.`);
|
|
6368
6379
|
return await t.json();
|
|
6369
6380
|
}
|
|
6370
6381
|
}
|
|
6371
|
-
function
|
|
6372
|
-
return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 ||
|
|
6382
|
+
function di(e) {
|
|
6383
|
+
return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Zr.has(e) || Xr[e] !== void 0 && t >= Xr[e]);
|
|
6373
6384
|
}
|
|
6374
|
-
function
|
|
6385
|
+
function fi(e) {
|
|
6375
6386
|
let t = e.author, n = typeof t == "string" ? t : t?.name;
|
|
6376
6387
|
if (n == null || n === "") throw Error("package.json 'author' field is required to document governance.");
|
|
6377
6388
|
let r = n.indexOf("<"), i = r === -1 ? -1 : n.indexOf(">", r);
|
|
6378
6389
|
return (i === -1 ? n : n.slice(0, r).trimEnd() + n.slice(i + 1).trimStart()).trim();
|
|
6379
6390
|
}
|
|
6380
|
-
function
|
|
6391
|
+
function pi(e) {
|
|
6381
6392
|
let t = (/* @__PURE__ */ new Date()).getFullYear();
|
|
6382
6393
|
if (e == null) return String(t);
|
|
6383
6394
|
let n = new Date(e).getFullYear();
|
|
@@ -6386,7 +6397,7 @@ function li(e) {
|
|
|
6386
6397
|
function Y(e, t = "On") {
|
|
6387
6398
|
return e === void 0 ? "❔ Unknown" : e ? `✅ ${t}` : "❌ Off";
|
|
6388
6399
|
}
|
|
6389
|
-
function
|
|
6400
|
+
function mi(e, t, n) {
|
|
6390
6401
|
let r = `https://github.com/${e}/${t}`, i = Y(n.codeQLLanguages.length > 0, n.codeQLLanguages.join(", "));
|
|
6391
6402
|
return `### Checks & Settings
|
|
6392
6403
|
|
|
@@ -6459,11 +6470,11 @@ ${[
|
|
|
6459
6470
|
|
|
6460
6471
|
`;
|
|
6461
6472
|
}
|
|
6462
|
-
function
|
|
6463
|
-
let c = `https://github.com/${e}/${t}`, l = `github.com/${e}/${t}`, u = `https://www.bestpractices.dev/projects/${String(a)}`, d = s !== void 0 &&
|
|
6473
|
+
function hi(e, t, n, r, i, a, o, s) {
|
|
6474
|
+
let c = `https://github.com/${e}/${t}`, l = `github.com/${e}/${t}`, u = `https://www.bestpractices.dev/projects/${String(a)}`, d = s !== void 0 && di(s) ? "\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." : "", f = a === void 0 ? "" : `[](${u})\n`, p = o.privateVulnerabilityReporting === !0 ? `Use [GitHub private vulnerability reporting](${c}/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.";
|
|
6464
6475
|
return `## Security & Quality
|
|
6465
6476
|
|
|
6466
|
-
${
|
|
6477
|
+
${mi(e, t, o)}${i === void 0 ? "" : oi(i)}### Reporting Vulnerabilities
|
|
6467
6478
|
|
|
6468
6479
|
Please do not open public GitHub issues for security vulnerabilities. ${p}
|
|
6469
6480
|
|
|
@@ -6487,28 +6498,28 @@ This project is licensed under the MIT License, permitting free use, modificatio
|
|
|
6487
6498
|
}
|
|
6488
6499
|
//#endregion
|
|
6489
6500
|
//#region node_modules/@dpuse/dpuse-shared/dist/componentConfig.schema-DT3mO5rS.js
|
|
6490
|
-
var
|
|
6501
|
+
var gi = {
|
|
6491
6502
|
lang: void 0,
|
|
6492
6503
|
message: void 0,
|
|
6493
6504
|
abortEarly: void 0,
|
|
6494
6505
|
abortPipeEarly: void 0
|
|
6495
6506
|
};
|
|
6496
6507
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6497
|
-
function
|
|
6508
|
+
function _i(e) {
|
|
6498
6509
|
return e ? {
|
|
6499
6510
|
lang: e?.lang ?? void 0,
|
|
6500
6511
|
message: e?.message,
|
|
6501
6512
|
abortEarly: e?.abortEarly ?? void 0,
|
|
6502
6513
|
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
6503
|
-
} :
|
|
6514
|
+
} : gi;
|
|
6504
6515
|
}
|
|
6505
6516
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6506
|
-
function
|
|
6517
|
+
function vi(e) {
|
|
6507
6518
|
let t = typeof e;
|
|
6508
6519
|
return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
|
|
6509
6520
|
}
|
|
6510
6521
|
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__ */
|
|
6522
|
+
let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */ vi(a), c = {
|
|
6512
6523
|
kind: e.kind,
|
|
6513
6524
|
type: e.type,
|
|
6514
6525
|
input: a,
|
|
@@ -6525,39 +6536,39 @@ function X(e, t, n, r, i) {
|
|
|
6525
6536
|
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
6537
|
}
|
|
6527
6538
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6528
|
-
function
|
|
6539
|
+
function yi(e, t) {
|
|
6529
6540
|
return e === t || Number.isNaN(e) && Number.isNaN(t);
|
|
6530
6541
|
}
|
|
6531
6542
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6532
|
-
function
|
|
6543
|
+
function bi(e, t) {
|
|
6533
6544
|
return Object.prototype.hasOwnProperty.call(e, t) && t !== "__proto__" && t !== "prototype" && t !== "constructor";
|
|
6534
6545
|
}
|
|
6535
6546
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6536
|
-
function
|
|
6547
|
+
function xi(e, t) {
|
|
6537
6548
|
let n = [...new Set(e)];
|
|
6538
6549
|
return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
|
|
6539
6550
|
}
|
|
6540
|
-
function
|
|
6551
|
+
function Si(e) {
|
|
6541
6552
|
return e["~standard"] = {
|
|
6542
6553
|
version: 1,
|
|
6543
6554
|
vendor: "valibot",
|
|
6544
|
-
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */
|
|
6555
|
+
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */ _i())
|
|
6545
6556
|
}, e;
|
|
6546
6557
|
}
|
|
6547
6558
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6548
|
-
function
|
|
6559
|
+
function Ci(e, t, n) {
|
|
6549
6560
|
return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
|
|
6550
6561
|
}
|
|
6551
6562
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6552
|
-
function
|
|
6563
|
+
function wi(e, t, n) {
|
|
6553
6564
|
return typeof e.default == "function" ? e.default(t, n) : e.default;
|
|
6554
6565
|
}
|
|
6555
6566
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6556
|
-
function
|
|
6557
|
-
return
|
|
6567
|
+
function Ti(e, t) {
|
|
6568
|
+
return Si({
|
|
6558
6569
|
kind: "schema",
|
|
6559
6570
|
type: "array",
|
|
6560
|
-
reference:
|
|
6571
|
+
reference: Ti,
|
|
6561
6572
|
expects: "Array",
|
|
6562
6573
|
async: !1,
|
|
6563
6574
|
item: e,
|
|
@@ -6590,11 +6601,11 @@ function xi(e, t) {
|
|
|
6590
6601
|
});
|
|
6591
6602
|
}
|
|
6592
6603
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6593
|
-
function
|
|
6594
|
-
return
|
|
6604
|
+
function Ei(e) {
|
|
6605
|
+
return Si({
|
|
6595
6606
|
kind: "schema",
|
|
6596
6607
|
type: "boolean",
|
|
6597
|
-
reference:
|
|
6608
|
+
reference: Ei,
|
|
6598
6609
|
expects: "boolean",
|
|
6599
6610
|
async: !1,
|
|
6600
6611
|
message: e,
|
|
@@ -6604,23 +6615,23 @@ function Si(e) {
|
|
|
6604
6615
|
});
|
|
6605
6616
|
}
|
|
6606
6617
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6607
|
-
function
|
|
6608
|
-
return
|
|
6618
|
+
function Di(e, t) {
|
|
6619
|
+
return Si({
|
|
6609
6620
|
kind: "schema",
|
|
6610
6621
|
type: "literal",
|
|
6611
|
-
reference:
|
|
6612
|
-
expects: /* @__PURE__ */
|
|
6622
|
+
reference: Di,
|
|
6623
|
+
expects: /* @__PURE__ */ vi(e),
|
|
6613
6624
|
async: !1,
|
|
6614
6625
|
literal: e,
|
|
6615
6626
|
message: t,
|
|
6616
6627
|
"~run"(e, t) {
|
|
6617
|
-
return /* @__PURE__ */
|
|
6628
|
+
return /* @__PURE__ */ yi(e.value, this.literal) ? e.typed = !0 : X(this, "type", e, t), e;
|
|
6618
6629
|
}
|
|
6619
6630
|
});
|
|
6620
6631
|
}
|
|
6621
6632
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6622
6633
|
function Z(e, t) {
|
|
6623
|
-
return
|
|
6634
|
+
return Si({
|
|
6624
6635
|
kind: "schema",
|
|
6625
6636
|
type: "nullable",
|
|
6626
6637
|
reference: Z,
|
|
@@ -6629,16 +6640,16 @@ function Z(e, t) {
|
|
|
6629
6640
|
wrapped: e,
|
|
6630
6641
|
default: t,
|
|
6631
6642
|
"~run"(e, t) {
|
|
6632
|
-
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
6643
|
+
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ wi(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
6633
6644
|
}
|
|
6634
6645
|
});
|
|
6635
6646
|
}
|
|
6636
6647
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6637
|
-
function
|
|
6638
|
-
return
|
|
6648
|
+
function Oi(e) {
|
|
6649
|
+
return Si({
|
|
6639
6650
|
kind: "schema",
|
|
6640
6651
|
type: "number",
|
|
6641
|
-
reference:
|
|
6652
|
+
reference: Oi,
|
|
6642
6653
|
expects: "number",
|
|
6643
6654
|
async: !1,
|
|
6644
6655
|
message: e,
|
|
@@ -6648,26 +6659,26 @@ function wi(e) {
|
|
|
6648
6659
|
});
|
|
6649
6660
|
}
|
|
6650
6661
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6651
|
-
function
|
|
6652
|
-
return
|
|
6662
|
+
function ki(e, t) {
|
|
6663
|
+
return Si({
|
|
6653
6664
|
kind: "schema",
|
|
6654
6665
|
type: "optional",
|
|
6655
|
-
reference:
|
|
6666
|
+
reference: ki,
|
|
6656
6667
|
expects: `(${e.expects} | undefined)`,
|
|
6657
6668
|
async: !1,
|
|
6658
6669
|
wrapped: e,
|
|
6659
6670
|
default: t,
|
|
6660
6671
|
"~run"(e, t) {
|
|
6661
|
-
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
6672
|
+
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ wi(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
6662
6673
|
}
|
|
6663
6674
|
});
|
|
6664
6675
|
}
|
|
6665
6676
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6666
|
-
function
|
|
6667
|
-
return
|
|
6677
|
+
function Ai(e, t, n) {
|
|
6678
|
+
return Si({
|
|
6668
6679
|
kind: "schema",
|
|
6669
6680
|
type: "record",
|
|
6670
|
-
reference:
|
|
6681
|
+
reference: Ai,
|
|
6671
6682
|
expects: "Object",
|
|
6672
6683
|
async: !1,
|
|
6673
6684
|
key: e,
|
|
@@ -6677,7 +6688,7 @@ function Ei(e, t, n) {
|
|
|
6677
6688
|
let n = e.value;
|
|
6678
6689
|
if (n && typeof n == "object") {
|
|
6679
6690
|
e.typed = !0, e.value = {};
|
|
6680
|
-
for (let r in n) if (/* @__PURE__ */
|
|
6691
|
+
for (let r in n) if (/* @__PURE__ */ bi(n, r)) {
|
|
6681
6692
|
let i = n[r], a = this.key["~run"]({ value: r }, t);
|
|
6682
6693
|
if (a.issues) {
|
|
6683
6694
|
let o = {
|
|
@@ -6717,7 +6728,7 @@ function Ei(e, t, n) {
|
|
|
6717
6728
|
}
|
|
6718
6729
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6719
6730
|
function Q(e, t) {
|
|
6720
|
-
return
|
|
6731
|
+
return Si({
|
|
6721
6732
|
kind: "schema",
|
|
6722
6733
|
type: "strict_object",
|
|
6723
6734
|
reference: Q,
|
|
@@ -6732,7 +6743,7 @@ function Q(e, t) {
|
|
|
6732
6743
|
for (let r in this.entries) {
|
|
6733
6744
|
let i = this.entries[r];
|
|
6734
6745
|
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__ */
|
|
6746
|
+
let a = r in n ? n[r] : /* @__PURE__ */ wi(i), o = i["~run"]({ value: a }, t);
|
|
6736
6747
|
if (o.issues) {
|
|
6737
6748
|
let i = {
|
|
6738
6749
|
type: "object",
|
|
@@ -6748,7 +6759,7 @@ function Q(e, t) {
|
|
|
6748
6759
|
}
|
|
6749
6760
|
}
|
|
6750
6761
|
o.typed || (e.typed = !1), e.value[r] = o.value;
|
|
6751
|
-
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */
|
|
6762
|
+
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ Ci(i);
|
|
6752
6763
|
else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (X(this, "key", e, t, {
|
|
6753
6764
|
input: void 0,
|
|
6754
6765
|
expected: `"${r}"`,
|
|
@@ -6784,7 +6795,7 @@ function Q(e, t) {
|
|
|
6784
6795
|
}
|
|
6785
6796
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6786
6797
|
function $(e) {
|
|
6787
|
-
return
|
|
6798
|
+
return Si({
|
|
6788
6799
|
kind: "schema",
|
|
6789
6800
|
type: "string",
|
|
6790
6801
|
reference: $,
|
|
@@ -6797,19 +6808,19 @@ function $(e) {
|
|
|
6797
6808
|
});
|
|
6798
6809
|
}
|
|
6799
6810
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6800
|
-
function
|
|
6811
|
+
function ji(e) {
|
|
6801
6812
|
let t;
|
|
6802
6813
|
if (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);
|
|
6803
6814
|
else t = n.issues;
|
|
6804
6815
|
return t;
|
|
6805
6816
|
}
|
|
6806
6817
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6807
|
-
function
|
|
6808
|
-
return
|
|
6818
|
+
function Mi(e, t) {
|
|
6819
|
+
return Si({
|
|
6809
6820
|
kind: "schema",
|
|
6810
6821
|
type: "union",
|
|
6811
|
-
reference:
|
|
6812
|
-
expects: /* @__PURE__ */
|
|
6822
|
+
reference: Mi,
|
|
6823
|
+
expects: /* @__PURE__ */ xi(e.map((e) => e.expects), "|"),
|
|
6813
6824
|
async: !1,
|
|
6814
6825
|
options: e,
|
|
6815
6826
|
message: t,
|
|
@@ -6828,29 +6839,29 @@ function Oi(e, t) {
|
|
|
6828
6839
|
if (n) return n;
|
|
6829
6840
|
if (r) {
|
|
6830
6841
|
if (r.length === 1) return r[0];
|
|
6831
|
-
X(this, "type", e, t, { issues: /* @__PURE__ */
|
|
6842
|
+
X(this, "type", e, t, { issues: /* @__PURE__ */ ji(r) }), e.typed = !0;
|
|
6832
6843
|
} else if (i?.length === 1) return i[0];
|
|
6833
|
-
else X(this, "type", e, t, { issues: /* @__PURE__ */
|
|
6844
|
+
else X(this, "type", e, t, { issues: /* @__PURE__ */ ji(i) });
|
|
6834
6845
|
return e;
|
|
6835
6846
|
}
|
|
6836
6847
|
});
|
|
6837
6848
|
}
|
|
6838
|
-
var
|
|
6849
|
+
var Ni = /* @__PURE__ */ Q({
|
|
6839
6850
|
en: /* @__PURE__ */ $(),
|
|
6840
6851
|
es: /* @__PURE__ */ $()
|
|
6841
|
-
}),
|
|
6852
|
+
}), Pi = {
|
|
6842
6853
|
id: /* @__PURE__ */ $(),
|
|
6843
6854
|
label: /* @__PURE__ */ Q({
|
|
6844
|
-
en: /* @__PURE__ */
|
|
6845
|
-
es: /* @__PURE__ */
|
|
6855
|
+
en: /* @__PURE__ */ ki(/* @__PURE__ */ $()),
|
|
6856
|
+
es: /* @__PURE__ */ ki(/* @__PURE__ */ $())
|
|
6846
6857
|
}),
|
|
6847
6858
|
description: /* @__PURE__ */ Q({
|
|
6848
|
-
en: /* @__PURE__ */
|
|
6849
|
-
es: /* @__PURE__ */
|
|
6859
|
+
en: /* @__PURE__ */ ki(/* @__PURE__ */ $()),
|
|
6860
|
+
es: /* @__PURE__ */ ki(/* @__PURE__ */ $())
|
|
6850
6861
|
}),
|
|
6851
6862
|
icon: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6852
6863
|
iconDark: /* @__PURE__ */ Z(/* @__PURE__ */ $())
|
|
6853
|
-
},
|
|
6864
|
+
}, Fi = (e) => /* @__PURE__ */ Mi(e.map((e) => /* @__PURE__ */ Di(e))), Ii = Fi([
|
|
6854
6865
|
"app",
|
|
6855
6866
|
"connector",
|
|
6856
6867
|
"connectorConnection",
|
|
@@ -6872,33 +6883,33 @@ var ki = /* @__PURE__ */ Q({
|
|
|
6872
6883
|
"presenter",
|
|
6873
6884
|
"presenterPresentation",
|
|
6874
6885
|
"tool"
|
|
6875
|
-
]),
|
|
6886
|
+
]), Li = Fi([
|
|
6876
6887
|
"danger",
|
|
6877
6888
|
"success",
|
|
6878
6889
|
"warning"
|
|
6879
|
-
]),
|
|
6890
|
+
]), Ri = Fi([
|
|
6880
6891
|
"alpha",
|
|
6881
6892
|
"beta",
|
|
6882
6893
|
"releaseCandidate",
|
|
6883
6894
|
"generalAvailability"
|
|
6884
|
-
]),
|
|
6885
|
-
color:
|
|
6895
|
+
]), zi = /* @__PURE__ */ Q({
|
|
6896
|
+
color: Li,
|
|
6886
6897
|
label: /* @__PURE__ */ $()
|
|
6887
|
-
}),
|
|
6888
|
-
...
|
|
6889
|
-
typeId:
|
|
6890
|
-
},
|
|
6891
|
-
...
|
|
6892
|
-
order: /* @__PURE__ */
|
|
6898
|
+
}), Bi = {
|
|
6899
|
+
...Pi,
|
|
6900
|
+
typeId: Ii
|
|
6901
|
+
}, Vi = /* @__PURE__ */ Q({
|
|
6902
|
+
...Bi,
|
|
6903
|
+
order: /* @__PURE__ */ Oi(),
|
|
6893
6904
|
path: /* @__PURE__ */ $()
|
|
6894
|
-
}),
|
|
6895
|
-
...
|
|
6896
|
-
firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
6897
|
-
lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
6898
|
-
status: /* @__PURE__ */ Z(
|
|
6899
|
-
statusId: /* @__PURE__ */ Z(
|
|
6905
|
+
}), Hi = {
|
|
6906
|
+
...Bi,
|
|
6907
|
+
firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ Oi()),
|
|
6908
|
+
lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ Oi()),
|
|
6909
|
+
status: /* @__PURE__ */ Z(zi),
|
|
6910
|
+
statusId: /* @__PURE__ */ Z(Ri)
|
|
6900
6911
|
};
|
|
6901
|
-
({ ...
|
|
6912
|
+
({ ...Hi }), Fi([
|
|
6902
6913
|
"app",
|
|
6903
6914
|
"engine",
|
|
6904
6915
|
"connector",
|
|
@@ -6908,17 +6919,17 @@ var ki = /* @__PURE__ */ Q({
|
|
|
6908
6919
|
]);
|
|
6909
6920
|
//#endregion
|
|
6910
6921
|
//#region node_modules/@dpuse/dpuse-shared/dist/moduleConfig.schema-aYmFWSrn.js
|
|
6911
|
-
var
|
|
6912
|
-
...
|
|
6922
|
+
var Ui = {
|
|
6923
|
+
...Hi,
|
|
6913
6924
|
vendorAccountURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6914
6925
|
vendorDocumentationURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6915
6926
|
vendorHomeURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6916
6927
|
version: /* @__PURE__ */ $()
|
|
6917
6928
|
};
|
|
6918
|
-
({ ...
|
|
6929
|
+
({ ...Ui });
|
|
6919
6930
|
//#endregion
|
|
6920
6931
|
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModuleConnector.es.js
|
|
6921
|
-
var
|
|
6932
|
+
var Wi = Fi([
|
|
6922
6933
|
"abortOperation",
|
|
6923
6934
|
"auditObjectContent",
|
|
6924
6935
|
"createObject",
|
|
@@ -6934,39 +6945,39 @@ var Bi = ji([
|
|
|
6934
6945
|
"retrieveChunks",
|
|
6935
6946
|
"retrieveRecords",
|
|
6936
6947
|
"upsertRecords"
|
|
6937
|
-
]),
|
|
6948
|
+
]), Gi = Fi([
|
|
6938
6949
|
"application",
|
|
6939
6950
|
"curatedDataset",
|
|
6940
6951
|
"database",
|
|
6941
6952
|
"fileStore"
|
|
6942
|
-
]),
|
|
6953
|
+
]), Ki = /* @__PURE__ */ Q({ label: Ni }), qi = Fi([
|
|
6943
6954
|
"bidirectional",
|
|
6944
6955
|
"destination",
|
|
6945
6956
|
"source",
|
|
6946
6957
|
"unknown"
|
|
6947
|
-
]),
|
|
6948
|
-
authMethodId:
|
|
6958
|
+
]), Ji = /* @__PURE__ */ Q({ label: Ni }), Yi = /* @__PURE__ */ Q({
|
|
6959
|
+
authMethodId: Fi([
|
|
6949
6960
|
"apiKey",
|
|
6950
6961
|
"disabled",
|
|
6951
6962
|
"oAuth2",
|
|
6952
6963
|
"none"
|
|
6953
6964
|
]),
|
|
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
|
-
}),
|
|
6965
|
+
activeConnectionCount: /* @__PURE__ */ ki(/* @__PURE__ */ Oi()),
|
|
6966
|
+
canDescribe: /* @__PURE__ */ ki(/* @__PURE__ */ Ei()),
|
|
6967
|
+
id: /* @__PURE__ */ ki(/* @__PURE__ */ $()),
|
|
6968
|
+
label: /* @__PURE__ */ ki(Ni),
|
|
6969
|
+
maxConnectionCount: /* @__PURE__ */ Z(/* @__PURE__ */ Oi()),
|
|
6970
|
+
params: /* @__PURE__ */ ki(/* @__PURE__ */ Ti(/* @__PURE__ */ Ai(/* @__PURE__ */ $(), /* @__PURE__ */ $())))
|
|
6971
|
+
}), Xi = /* @__PURE__ */ Q({
|
|
6972
|
+
...Ui,
|
|
6973
|
+
typeId: /* @__PURE__ */ Di("connector"),
|
|
6974
|
+
actionNames: /* @__PURE__ */ Ti(Wi),
|
|
6975
|
+
category: /* @__PURE__ */ Z(Ki),
|
|
6976
|
+
categoryId: Gi,
|
|
6977
|
+
implementations: /* @__PURE__ */ Ai(/* @__PURE__ */ $(), Yi),
|
|
6978
|
+
usage: /* @__PURE__ */ Z(Ji),
|
|
6979
|
+
usageId: /* @__PURE__ */ Z(qi)
|
|
6980
|
+
}), Zi = {
|
|
6970
6981
|
abortOperation: "Abort Operation",
|
|
6971
6982
|
auditObjectContent: "Audit Object Content",
|
|
6972
6983
|
createObject: "Create Object",
|
|
@@ -6982,12 +6993,12 @@ var Bi = ji([
|
|
|
6982
6993
|
retrieveChunks: "Retrieve Chunks",
|
|
6983
6994
|
retrieveRecords: "Retrieve Records",
|
|
6984
6995
|
upsertRecords: "Upsert Records"
|
|
6985
|
-
},
|
|
6996
|
+
}, Qi = /* @__PURE__ */ new Set([
|
|
6986
6997
|
"createObject",
|
|
6987
6998
|
"dropObject",
|
|
6988
6999
|
"removeRecords",
|
|
6989
7000
|
"upsertRecords"
|
|
6990
|
-
]),
|
|
7001
|
+
]), $i = /* @__PURE__ */ new Set([
|
|
6991
7002
|
"auditObjectContent",
|
|
6992
7003
|
"findObject",
|
|
6993
7004
|
"getInfo",
|
|
@@ -6998,57 +7009,57 @@ var Bi = ji([
|
|
|
6998
7009
|
"retrieveChunks",
|
|
6999
7010
|
"retrieveRecords"
|
|
7000
7011
|
]);
|
|
7001
|
-
function
|
|
7012
|
+
function ea(e) {
|
|
7002
7013
|
let t = !1, n = !1;
|
|
7003
|
-
for (let r of e)
|
|
7014
|
+
for (let r of e) $i.has(r) && (t = !0), Qi.has(r) && (n = !0);
|
|
7004
7015
|
return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "unknown";
|
|
7005
7016
|
}
|
|
7006
|
-
function
|
|
7017
|
+
function ta(e) {
|
|
7007
7018
|
let t = new Set(e), n = "|Action|Supported|\n";
|
|
7008
7019
|
n += "|:----|:-------:|\n";
|
|
7009
|
-
for (let e of Object.keys(
|
|
7020
|
+
for (let e of Object.keys(Zi)) n += `| ${Zi[e]} | ${t.has(e) ? "✓" : ""} |\n`;
|
|
7010
7021
|
return n;
|
|
7011
7022
|
}
|
|
7012
7023
|
//#endregion
|
|
7013
7024
|
//#region src/actions/documentActions.ts
|
|
7014
|
-
var
|
|
7025
|
+
var na = "<!-- CONNECTOR_ACTIONS_START -->", ra = "<!-- CONNECTOR_ACTIONS_END -->", ia = "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.", aa = {
|
|
7015
7026
|
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
7027
|
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
7028
|
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
7029
|
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
|
|
7030
|
+
}, oa = "The table below lists all connector actions and highlights those supported by this connector.";
|
|
7031
|
+
async function sa() {
|
|
7021
7032
|
try {
|
|
7022
7033
|
G("Document Actions"), q("1️⃣ Insert actions description and table into 'README.md'");
|
|
7023
|
-
let e = (await W("config.json")).actionNames ?? [], t =
|
|
7024
|
-
await Bn(`${
|
|
7034
|
+
let e = (await W("config.json")).actionNames ?? [], t = ea(e), n = ta(e);
|
|
7035
|
+
await Bn(`${ia}\n\n${aa[t]} ${oa}\n\n${n}`, na, ra), K("Actions documented");
|
|
7025
7036
|
} catch (e) {
|
|
7026
7037
|
console.error("❌ Error documenting actions", e), process.exit(1);
|
|
7027
7038
|
}
|
|
7028
7039
|
}
|
|
7029
7040
|
//#endregion
|
|
7030
7041
|
//#region src/actions/documentOpening.ts
|
|
7031
|
-
var
|
|
7032
|
-
async function
|
|
7042
|
+
var ca = "<!-- OPENING_START -->", la = "<!-- OPENING_END -->";
|
|
7043
|
+
async function ua() {
|
|
7033
7044
|
try {
|
|
7034
7045
|
G("Document Opening"), q("1️⃣ Insert opening content into 'README.md'");
|
|
7035
7046
|
let e = await W("package.json"), t = await W("config.json"), { owner: n, repo: r } = Un(e, "document opening");
|
|
7036
|
-
await Bn(
|
|
7047
|
+
await Bn(pa(n, r, da(e), fa(t)), ca, la), K("Opening documented");
|
|
7037
7048
|
} catch (e) {
|
|
7038
7049
|
console.error("❌ Error documenting opening", e), process.exit(1);
|
|
7039
7050
|
}
|
|
7040
7051
|
}
|
|
7041
|
-
function
|
|
7052
|
+
function da(e) {
|
|
7042
7053
|
let t = e.license;
|
|
7043
7054
|
if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
|
|
7044
7055
|
return t;
|
|
7045
7056
|
}
|
|
7046
|
-
function
|
|
7057
|
+
function fa(e) {
|
|
7047
7058
|
let t = e.description.en;
|
|
7048
7059
|
if (t == null || t.length === 0) throw Error("config.json 'description.en' field is required to document opening.");
|
|
7049
7060
|
return t;
|
|
7050
7061
|
}
|
|
7051
|
-
function
|
|
7062
|
+
function pa(e, t, n, r) {
|
|
7052
7063
|
let i = `https://github.com/${e}/${t}`;
|
|
7053
7064
|
return `[}-blue.svg)](./LICENSE)
|
|
7054
7065
|
[](${i}/releases/latest)
|
|
@@ -7076,12 +7087,12 @@ ${r}`;
|
|
|
7076
7087
|
}
|
|
7077
7088
|
//#endregion
|
|
7078
7089
|
//#region src/actions/documentUsage.ts
|
|
7079
|
-
var
|
|
7090
|
+
var ma = "<!-- USAGE_START -->", ha = "<!-- USAGE_END -->", ga = /* @__PURE__ */ new Set([
|
|
7080
7091
|
"connector",
|
|
7081
7092
|
"context",
|
|
7082
7093
|
"cookbook",
|
|
7083
7094
|
"presenter"
|
|
7084
|
-
]),
|
|
7095
|
+
]), _a = [
|
|
7085
7096
|
["build", "Builds the project."],
|
|
7086
7097
|
["build:ts", "Builds the TypeScript source."],
|
|
7087
7098
|
["test", "Runs the tests."],
|
|
@@ -7101,35 +7112,35 @@ var ua = "<!-- USAGE_START -->", da = "<!-- USAGE_END -->", fa = /* @__PURE__ */
|
|
|
7101
7112
|
["sync", "Bumps the version, then commits and pushes to GitHub."],
|
|
7102
7113
|
["release", "Bumps the version, commits and pushes, and creates a GitHub release."],
|
|
7103
7114
|
["publish", "Registers the released version with DPUse."]
|
|
7104
|
-
],
|
|
7105
|
-
async function
|
|
7115
|
+
], va = /* @__PURE__ */ new Set(["development", "eslint"]), ya = "> [!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", ba = "Cloned or forked code is unsupported and isn't guaranteed to remain compatible with the DPUse Engine as it evolves.";
|
|
7116
|
+
async function xa() {
|
|
7106
7117
|
try {
|
|
7107
7118
|
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 Bn(
|
|
7119
|
+
let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = Sa(e), r = Ca(n), i = wa(e.engines?.node), a = wa(e.engines?.npm), o = wa(e.devDependencies?.typescript);
|
|
7120
|
+
await Bn(Oa(Ta(Hn(t.id), e.name), n, r, i, a, o, Ea(e)), ma, ha), K("Usage documented");
|
|
7110
7121
|
} catch (e) {
|
|
7111
7122
|
console.error("❌ Error documenting usage", e), process.exit(1);
|
|
7112
7123
|
}
|
|
7113
7124
|
}
|
|
7114
|
-
function
|
|
7125
|
+
function Sa(e) {
|
|
7115
7126
|
let t = e.repository, n = typeof t == "string" ? t : t?.url;
|
|
7116
7127
|
if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
|
|
7117
7128
|
return n.replace(/^git\+/, "");
|
|
7118
7129
|
}
|
|
7119
|
-
function
|
|
7130
|
+
function Ca(e) {
|
|
7120
7131
|
return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
|
|
7121
7132
|
}
|
|
7122
|
-
function
|
|
7133
|
+
function wa(e) {
|
|
7123
7134
|
if (e == null) throw Error("package.json version range is required to document usage.");
|
|
7124
7135
|
let t = /\d+(?:\.\d+)*/.exec(e);
|
|
7125
7136
|
if (t == null) throw Error(`Unable to parse version from '${e}'.`);
|
|
7126
7137
|
return t[0];
|
|
7127
7138
|
}
|
|
7128
|
-
function
|
|
7139
|
+
function Ta(e, t) {
|
|
7129
7140
|
let { typeId: n } = e;
|
|
7130
|
-
if (
|
|
7141
|
+
if (ga.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
7142
|
|
|
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. ${
|
|
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. ${ba}`;
|
|
7133
7144
|
if (e.publishedTo === "npm") {
|
|
7134
7145
|
if (t == null || t === "") throw Error("package.json 'name' field is required to document usage.");
|
|
7135
7146
|
return `This package is published to the [public npm registry](https://www.npmjs.com/package/${t}). Install it with:
|
|
@@ -7138,18 +7149,18 @@ You may view or clone this repository for your own purposes, such as building a
|
|
|
7138
7149
|
npm install ${t}
|
|
7139
7150
|
\`\`\`
|
|
7140
7151
|
|
|
7141
|
-
${
|
|
7152
|
+
${va.has(n) ? ya : ""}To work on the source instead, clone this repository. ${ba}`;
|
|
7142
7153
|
}
|
|
7143
|
-
return `You may view or clone this repository for your own purposes. ${
|
|
7154
|
+
return `You may view or clone this repository for your own purposes. ${ba}`;
|
|
7144
7155
|
}
|
|
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 =
|
|
7156
|
+
function Ea(e) {
|
|
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 = _a.filter(([e]) => i(e)).map(([e, t]) => `|\`${Da(e)}\`|${t}|`);
|
|
7147
7158
|
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
7159
|
}
|
|
7149
|
-
function
|
|
7160
|
+
function Da(e) {
|
|
7150
7161
|
return e === "test" ? "npm test" : `npm run ${e}`;
|
|
7151
7162
|
}
|
|
7152
|
-
function
|
|
7163
|
+
function Oa(e, t, n, r, i, a, o) {
|
|
7153
7164
|
return `## Usage
|
|
7154
7165
|
|
|
7155
7166
|
${e}
|
|
@@ -7164,7 +7175,7 @@ _Requires [Node.js](https://nodejs.org/) ${r} or later, [npm](https://www.npmjs.
|
|
|
7164
7175
|
}
|
|
7165
7176
|
//#endregion
|
|
7166
7177
|
//#region src/actions/formatCode.ts
|
|
7167
|
-
async function
|
|
7178
|
+
async function ka() {
|
|
7168
7179
|
try {
|
|
7169
7180
|
G("Format Code"), await U("1️⃣ Format", "prettier", [
|
|
7170
7181
|
"--write",
|
|
@@ -7179,7 +7190,7 @@ async function Ta() {
|
|
|
7179
7190
|
}
|
|
7180
7191
|
//#endregion
|
|
7181
7192
|
//#region src/actions/lintCode.ts
|
|
7182
|
-
async function
|
|
7193
|
+
async function Aa() {
|
|
7183
7194
|
try {
|
|
7184
7195
|
G("Lint Code"), await U("1️⃣ Lint", "eslint", ["."]), K("Code linted");
|
|
7185
7196
|
} catch (e) {
|
|
@@ -7188,7 +7199,7 @@ async function Ea() {
|
|
|
7188
7199
|
}
|
|
7189
7200
|
//#endregion
|
|
7190
7201
|
//#region src/utilities/cloudflare.ts
|
|
7191
|
-
async function
|
|
7202
|
+
async function ja() {
|
|
7192
7203
|
let e = await W("config.json"), t = {
|
|
7193
7204
|
body: JSON.stringify(e),
|
|
7194
7205
|
headers: { "Content-Type": "application/json" },
|
|
@@ -7196,7 +7207,7 @@ async function Da() {
|
|
|
7196
7207
|
}, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
|
|
7197
7208
|
if (!n.ok) throw Error(await n.text());
|
|
7198
7209
|
}
|
|
7199
|
-
async function
|
|
7210
|
+
async function Ma(e, t) {
|
|
7200
7211
|
async function n(e, t, r) {
|
|
7201
7212
|
for (let i of r) {
|
|
7202
7213
|
let r = `${e}/${i}`, a = `${t}/${i}`;
|
|
@@ -7214,7 +7225,7 @@ async function Oa(e, t) {
|
|
|
7214
7225
|
let r = await Pn(`${e}/${t}/`);
|
|
7215
7226
|
await n(`${e}/${t}`, t, r);
|
|
7216
7227
|
}
|
|
7217
|
-
async function
|
|
7228
|
+
async function Na(e) {
|
|
7218
7229
|
let t = e.id, n = {
|
|
7219
7230
|
body: JSON.stringify(e),
|
|
7220
7231
|
headers: { "Content-Type": "application/json" },
|
|
@@ -7222,7 +7233,7 @@ async function ka(e) {
|
|
|
7222
7233
|
}, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
|
|
7223
7234
|
if (!r.ok) throw Error(await r.text());
|
|
7224
7235
|
}
|
|
7225
|
-
async function
|
|
7236
|
+
async function Pa(e, t) {
|
|
7226
7237
|
let n = `v${e.version ?? "unknown"}`;
|
|
7227
7238
|
async function r(e, r = "") {
|
|
7228
7239
|
let i = await Pn(e, { withFileTypes: !0 });
|
|
@@ -7246,24 +7257,24 @@ async function Aa(e, t) {
|
|
|
7246
7257
|
}
|
|
7247
7258
|
//#endregion
|
|
7248
7259
|
//#region node_modules/valibot/dist/index.mjs
|
|
7249
|
-
var
|
|
7260
|
+
var Fa = {
|
|
7250
7261
|
lang: void 0,
|
|
7251
7262
|
message: void 0,
|
|
7252
7263
|
abortEarly: void 0,
|
|
7253
7264
|
abortPipeEarly: void 0
|
|
7254
7265
|
};
|
|
7255
7266
|
/* @__NO_SIDE_EFFECTS__ */
|
|
7256
|
-
function
|
|
7267
|
+
function Ia(e) {
|
|
7257
7268
|
return e ? {
|
|
7258
7269
|
lang: e?.lang ?? void 0,
|
|
7259
7270
|
message: e?.message,
|
|
7260
7271
|
abortEarly: e?.abortEarly ?? void 0,
|
|
7261
7272
|
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
7262
|
-
} :
|
|
7273
|
+
} : Fa;
|
|
7263
7274
|
}
|
|
7264
7275
|
/* @__NO_SIDE_EFFECTS__ */
|
|
7265
|
-
function
|
|
7266
|
-
let r = e["~run"]({ value: t }, /* @__PURE__ */
|
|
7276
|
+
function La(e, t, n) {
|
|
7277
|
+
let r = e["~run"]({ value: t }, /* @__PURE__ */ Ia(n));
|
|
7267
7278
|
return {
|
|
7268
7279
|
typed: r.typed,
|
|
7269
7280
|
success: !r.issues,
|
|
@@ -7273,21 +7284,21 @@ function Na(e, t, n) {
|
|
|
7273
7284
|
}
|
|
7274
7285
|
//#endregion
|
|
7275
7286
|
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModulePresenter.es.js
|
|
7276
|
-
var
|
|
7287
|
+
var Ra = Fi([
|
|
7277
7288
|
"list",
|
|
7278
7289
|
"render",
|
|
7279
7290
|
"setColorMode"
|
|
7280
|
-
]),
|
|
7281
|
-
...
|
|
7282
|
-
typeId: /* @__PURE__ */
|
|
7283
|
-
actionNames: /* @__PURE__ */
|
|
7284
|
-
presentations: /* @__PURE__ */
|
|
7285
|
-
}),
|
|
7291
|
+
]), za = /* @__PURE__ */ Q({
|
|
7292
|
+
...Ui,
|
|
7293
|
+
typeId: /* @__PURE__ */ Di("presenter"),
|
|
7294
|
+
actionNames: /* @__PURE__ */ Ti(Ra),
|
|
7295
|
+
presentations: /* @__PURE__ */ Ti(Vi)
|
|
7296
|
+
}), Ba = [
|
|
7286
7297
|
"1️⃣ ",
|
|
7287
7298
|
"2️⃣ ",
|
|
7288
7299
|
"3️⃣ ",
|
|
7289
7300
|
"4️⃣ "
|
|
7290
|
-
],
|
|
7301
|
+
], Va = [{
|
|
7291
7302
|
id: "unit",
|
|
7292
7303
|
label: "Run unit tests",
|
|
7293
7304
|
command: "vitest",
|
|
@@ -7300,36 +7311,36 @@ var Pa = ji([
|
|
|
7300
7311
|
arguments: ["test", "--pass-with-no-tests"],
|
|
7301
7312
|
configFileName: "playwright.config.ts"
|
|
7302
7313
|
}];
|
|
7303
|
-
async function
|
|
7314
|
+
async function Ha() {
|
|
7304
7315
|
try {
|
|
7305
7316
|
G("Build Project"), await U("1️⃣ Bundle project", "vite", ["build"]), K("Project built");
|
|
7306
7317
|
} catch (e) {
|
|
7307
7318
|
console.error("❌ Error building project", e), process.exit(1);
|
|
7308
7319
|
}
|
|
7309
7320
|
}
|
|
7310
|
-
async function
|
|
7321
|
+
async function Ua() {
|
|
7311
7322
|
try {
|
|
7312
7323
|
G("Publish Project");
|
|
7313
7324
|
let e = await W("package.json"), t = await W("config.json");
|
|
7314
|
-
await
|
|
7325
|
+
await Qa("1️⃣ ", e, t, Hn(t.id)), K(`Project version '${e.version ?? "unknown"}' published.`);
|
|
7315
7326
|
} catch (e) {
|
|
7316
7327
|
console.error("❌ Error publishing project", e), process.exit(1);
|
|
7317
7328
|
}
|
|
7318
7329
|
}
|
|
7319
|
-
async function
|
|
7330
|
+
async function Wa() {
|
|
7320
7331
|
try {
|
|
7321
7332
|
G("Release Project");
|
|
7322
7333
|
let e = await W("package.json"), t = await W("config.json");
|
|
7323
|
-
await
|
|
7334
|
+
await Za("1️⃣ ", e);
|
|
7324
7335
|
let n = Hn(t.id);
|
|
7325
7336
|
switch (n.typeId) {
|
|
7326
7337
|
case "connector":
|
|
7327
|
-
t = await
|
|
7338
|
+
t = await Ka("2️⃣ ", e);
|
|
7328
7339
|
break;
|
|
7329
7340
|
case "presenter":
|
|
7330
|
-
t = await
|
|
7341
|
+
t = await qa("2️⃣ ", e);
|
|
7331
7342
|
break;
|
|
7332
|
-
default: t = await
|
|
7343
|
+
default: t = await Ga("2️⃣ ", e);
|
|
7333
7344
|
}
|
|
7334
7345
|
await U("3️⃣ Bundle project", "vite", ["build"]), await Fn("4️⃣ Stage changes", "git", ["add", "."]), await Fn("5️⃣ Commit changes", "git", [
|
|
7335
7346
|
"commit",
|
|
@@ -7339,7 +7350,7 @@ async function Ba() {
|
|
|
7339
7350
|
"push",
|
|
7340
7351
|
"origin",
|
|
7341
7352
|
"main:main"
|
|
7342
|
-
]), await
|
|
7353
|
+
]), await Qa("7️⃣ ", e, t, n), n.publishedTo === "npm" ? await U("8️⃣ Create GitHub release", "gh", [
|
|
7343
7354
|
"release",
|
|
7344
7355
|
"create",
|
|
7345
7356
|
`v${e.version ?? "unknown"}`,
|
|
@@ -7352,39 +7363,39 @@ async function Ba() {
|
|
|
7352
7363
|
console.error("❌ Error releasing project", e), process.exit(1);
|
|
7353
7364
|
}
|
|
7354
7365
|
}
|
|
7355
|
-
async function
|
|
7366
|
+
async function Ga(e, t) {
|
|
7356
7367
|
q(`${e} Build project configuration`);
|
|
7357
7368
|
let n = await W("config.json");
|
|
7358
7369
|
return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await Rn("logo.svg"), n.iconDark ??= await Rn("logoDark.svg"), await zn("config.json", n), n;
|
|
7359
7370
|
}
|
|
7360
|
-
async function
|
|
7371
|
+
async function Ka(e, t) {
|
|
7361
7372
|
q(`${e} Build connector project configuration`);
|
|
7362
|
-
let [n, r] = await Promise.all([W("config.json"), Ln("src/index.ts")]), i = /* @__PURE__ */
|
|
7373
|
+
let [n, r] = await Promise.all([W("config.json"), Ln("src/index.ts")]), i = /* @__PURE__ */ La(Xi, n);
|
|
7363
7374
|
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
7364
7375
|
let a = Gn(r);
|
|
7365
|
-
return await
|
|
7376
|
+
return await Ja(t, n, a, ea(a));
|
|
7366
7377
|
}
|
|
7367
|
-
async function
|
|
7378
|
+
async function qa(e, t) {
|
|
7368
7379
|
q(`${e} Build presenter project configuration`);
|
|
7369
|
-
let [n, r] = await Promise.all([W("config.json"), Ln("src/index.ts")]), i = /* @__PURE__ */
|
|
7380
|
+
let [n, r] = await Promise.all([W("config.json"), Ln("src/index.ts")]), i = /* @__PURE__ */ La(za, n);
|
|
7370
7381
|
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
7371
|
-
return await
|
|
7382
|
+
return await Ja(t, n, Gn(r));
|
|
7372
7383
|
}
|
|
7373
|
-
async function
|
|
7384
|
+
async function Ja(e, t, n, r) {
|
|
7374
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 zn("config.json", t), t;
|
|
7375
7386
|
}
|
|
7376
|
-
async function
|
|
7387
|
+
async function Ya() {
|
|
7377
7388
|
try {
|
|
7378
7389
|
G("Synchronise Project with GitHub");
|
|
7379
7390
|
let e = await W("package.json"), t = await W("config.json");
|
|
7380
|
-
switch (await
|
|
7391
|
+
switch (await Za("1️⃣ ", e), Hn(t.id).typeId) {
|
|
7381
7392
|
case "connector":
|
|
7382
|
-
await
|
|
7393
|
+
await Ka("2️⃣ ", e);
|
|
7383
7394
|
break;
|
|
7384
7395
|
case "presenter":
|
|
7385
|
-
await
|
|
7396
|
+
await qa("2️⃣ ", e);
|
|
7386
7397
|
break;
|
|
7387
|
-
default: await
|
|
7398
|
+
default: await Ga("2️⃣ ", e);
|
|
7388
7399
|
}
|
|
7389
7400
|
await Fn("3️⃣ Stage changes", "git", ["add", "."]), await Fn("4️⃣ Commit changes", "git", [
|
|
7390
7401
|
"commit",
|
|
@@ -7399,14 +7410,14 @@ async function Ga() {
|
|
|
7399
7410
|
console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
|
|
7400
7411
|
}
|
|
7401
7412
|
}
|
|
7402
|
-
async function
|
|
7413
|
+
async function Xa(e = ["unit"], t = !1) {
|
|
7403
7414
|
try {
|
|
7404
7415
|
G("Test Project");
|
|
7405
7416
|
let n = 0;
|
|
7406
|
-
for (let r of
|
|
7417
|
+
for (let r of Va) {
|
|
7407
7418
|
if (!e.includes(r.id) || await Rn(r.configFileName) === null) continue;
|
|
7408
7419
|
let i = t && r.id === "unit" ? ["--coverage"] : [];
|
|
7409
|
-
await U(`${
|
|
7420
|
+
await U(`${Ba[n] ?? ""} ${r.label}`, r.command, [...r.arguments, ...i]), n += 1;
|
|
7410
7421
|
}
|
|
7411
7422
|
if (n === 0) {
|
|
7412
7423
|
console.warn("\n⚠️ No tests configured for this project.\n");
|
|
@@ -7417,7 +7428,7 @@ async function Ka(e = ["unit"], t = !1) {
|
|
|
7417
7428
|
console.error("❌ Error testing project", e), process.exit(1);
|
|
7418
7429
|
}
|
|
7419
7430
|
}
|
|
7420
|
-
async function
|
|
7431
|
+
async function Za(e, t, n = "./") {
|
|
7421
7432
|
if (q(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
|
|
7422
7433
|
else {
|
|
7423
7434
|
let e = t.version, n = t.version.split(".");
|
|
@@ -7425,17 +7436,17 @@ async function qa(e, t, n = "./") {
|
|
|
7425
7436
|
}
|
|
7426
7437
|
await zn(`${n}package.json`, t);
|
|
7427
7438
|
}
|
|
7428
|
-
async function
|
|
7429
|
-
if (r.typeId === "app") q(`${e} Register module`), await
|
|
7430
|
-
else if (r.typeId === "engine") q(`${e} Register module`), await
|
|
7439
|
+
async function Qa(e, t, n, r) {
|
|
7440
|
+
if (r.typeId === "app") q(`${e} Register module`), await ja();
|
|
7441
|
+
else if (r.typeId === "engine") q(`${e} Register module`), await Pa(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await Na(n);
|
|
7431
7442
|
else if (r.uploadGroupName === void 0) q(`${e} Registration NOT required`);
|
|
7432
7443
|
else {
|
|
7433
7444
|
q(`${e} Register module`);
|
|
7434
7445
|
let i = n.id.split("-").slice(2).join("-");
|
|
7435
|
-
await
|
|
7446
|
+
await Pa(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await Na(n);
|
|
7436
7447
|
}
|
|
7437
7448
|
}
|
|
7438
7449
|
//#endregion
|
|
7439
|
-
export { Jn as auditDependencies,
|
|
7450
|
+
export { Jn as auditDependencies, Ha as buildProject, Zn as checkConfigFiles, or as checkDependencies, sa as documentActions, hr as documentBundleSizes, Lr as documentDependencies, ii as documentGovernance, ua as documentOpening, xa as documentUsage, ka as formatCode, Aa as lintCode, Ua as publishProject, Wa as releaseProject, Ya as syncProjectWithGitHub, Xa as testProject, Ma as uploadDirectoryToR2 };
|
|
7440
7451
|
|
|
7441
7452
|
//# sourceMappingURL=dpuse-development.es.js.map
|