@dpuse/dpuse-development 0.3.766 → 0.3.780
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -62
- package/dist/dpuse-development.es.js +1617 -1611
- package/dist/dpuse-development.es.js.map +1 -1
- package/dist/types/src/actions/auditDependencies.d.ts +1 -0
- package/dist/types/src/actions/buildProject.d.ts +2 -0
- package/dist/types/src/actions/checkDependencies.d.ts +2 -0
- package/dist/types/src/actions/checkProject.d.ts +2 -0
- package/dist/types/src/actions/documentApiReference.d.ts +1 -1
- package/dist/types/src/actions/documentBundleSizes.d.ts +1 -0
- package/dist/types/src/actions/documentContributingLicense.d.ts +2 -0
- package/dist/types/src/actions/documentDependencies.d.ts +3 -0
- package/dist/types/src/actions/documentProject.d.ts +6 -0
- package/dist/types/src/actions/documentQualitySecurity.d.ts +2 -0
- package/dist/types/src/actions/formatCode.d.ts +1 -0
- package/dist/types/src/actions/lintCode.d.ts +1 -0
- package/dist/types/src/actions/publishProject.d.ts +5 -0
- package/dist/types/src/actions/releaseProject.d.ts +3 -0
- package/dist/types/src/actions/syncProjectWithGitHub.d.ts +2 -0
- package/dist/types/src/actions/testProject.d.ts +3 -0
- package/dist/types/src/index.d.ts +7 -10
- package/dist/types/src/utilities/index.d.ts +8 -0
- package/package.json +6 -13
- package/dist/types/src/actions/documentGovernance.d.ts +0 -1
- package/dist/types/src/actions/manageProject.d.ts +0 -8
|
@@ -5655,861 +5655,1039 @@ function jn(e) {
|
|
|
5655
5655
|
};
|
|
5656
5656
|
}
|
|
5657
5657
|
//#endregion
|
|
5658
|
-
//#region
|
|
5659
|
-
var Mn =
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
idPrefix: "dpuse-connector",
|
|
5674
|
-
typeId: "connector",
|
|
5675
|
-
publishedTo: "dpuse",
|
|
5676
|
-
uploadGroupName: "connectors"
|
|
5677
|
-
},
|
|
5678
|
-
{
|
|
5679
|
-
idPrefix: "dpuse-context",
|
|
5680
|
-
typeId: "context",
|
|
5681
|
-
publishedTo: "dpuse",
|
|
5682
|
-
uploadGroupName: "contexts"
|
|
5683
|
-
},
|
|
5684
|
-
{
|
|
5685
|
-
idPrefix: "dpuse-development",
|
|
5686
|
-
typeId: "development",
|
|
5687
|
-
publishedTo: "npm",
|
|
5688
|
-
uploadGroupName: void 0
|
|
5689
|
-
},
|
|
5690
|
-
{
|
|
5691
|
-
idPrefix: "dpuse-engine",
|
|
5692
|
-
typeId: "engine",
|
|
5693
|
-
publishedTo: "dpuse",
|
|
5694
|
-
uploadGroupName: "engine"
|
|
5695
|
-
},
|
|
5696
|
-
{
|
|
5697
|
-
idPrefix: "dpuse-kb",
|
|
5698
|
-
typeId: "kb",
|
|
5699
|
-
publishedTo: "kb",
|
|
5700
|
-
uploadGroupName: void 0
|
|
5701
|
-
},
|
|
5702
|
-
{
|
|
5703
|
-
idPrefix: "dpuse-presenter",
|
|
5704
|
-
typeId: "presenter",
|
|
5705
|
-
publishedTo: "dpuse",
|
|
5706
|
-
uploadGroupName: "presenters"
|
|
5707
|
-
},
|
|
5708
|
-
{
|
|
5709
|
-
idPrefix: "dpuse-cookbook",
|
|
5710
|
-
typeId: "cookbook",
|
|
5711
|
-
publishedTo: "dpuse",
|
|
5712
|
-
uploadGroupName: "cookbooks"
|
|
5713
|
-
},
|
|
5714
|
-
{
|
|
5715
|
-
idPrefix: "dpuse-resources",
|
|
5716
|
-
typeId: "resources",
|
|
5717
|
-
publishedTo: "sampleData",
|
|
5718
|
-
uploadGroupName: void 0
|
|
5719
|
-
},
|
|
5720
|
-
{
|
|
5721
|
-
idPrefix: "dpuse-shared",
|
|
5722
|
-
typeId: "shared",
|
|
5723
|
-
publishedTo: "npm",
|
|
5724
|
-
uploadGroupName: void 0
|
|
5725
|
-
},
|
|
5726
|
-
{
|
|
5727
|
-
idPrefix: "dpuse-tool",
|
|
5728
|
-
typeId: "tool",
|
|
5729
|
-
publishedTo: "npm",
|
|
5730
|
-
uploadGroupName: "tools"
|
|
5731
|
-
},
|
|
5732
|
-
{
|
|
5733
|
-
idPrefix: "eslint-config-dpuse",
|
|
5734
|
-
typeId: "eslint",
|
|
5735
|
-
publishedTo: "npm",
|
|
5736
|
-
uploadGroupName: void 0
|
|
5737
|
-
},
|
|
5738
|
-
{
|
|
5739
|
-
idPrefix: "github",
|
|
5740
|
-
typeId: "github",
|
|
5741
|
-
publishedTo: "github",
|
|
5742
|
-
uploadGroupName: void 0
|
|
5743
|
-
}
|
|
5744
|
-
], In = r(i);
|
|
5745
|
-
async function Ln(e, r) {
|
|
5746
|
-
e !== void 0 && q(`${e} - clear(${r})`);
|
|
5747
|
-
let i;
|
|
5748
|
-
try {
|
|
5749
|
-
i = await t.readdir(r, { withFileTypes: !0 });
|
|
5750
|
-
} catch (e) {
|
|
5751
|
-
if (e.code === "ENOENT") return;
|
|
5752
|
-
throw e;
|
|
5753
|
-
}
|
|
5754
|
-
await Promise.all(i.map(async (e) => {
|
|
5755
|
-
let i = n.join(r, e.name);
|
|
5756
|
-
try {
|
|
5757
|
-
await t.rm(i, {
|
|
5758
|
-
recursive: !0,
|
|
5759
|
-
force: !0
|
|
5760
|
-
});
|
|
5761
|
-
} catch (e) {
|
|
5762
|
-
if (e.code !== "ENOENT") throw e;
|
|
5763
|
-
}
|
|
5764
|
-
}));
|
|
5658
|
+
//#region node_modules/valibot/dist/index.mjs
|
|
5659
|
+
var Mn = {
|
|
5660
|
+
lang: void 0,
|
|
5661
|
+
message: void 0,
|
|
5662
|
+
abortEarly: void 0,
|
|
5663
|
+
abortPipeEarly: void 0
|
|
5664
|
+
};
|
|
5665
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5666
|
+
function Nn(e) {
|
|
5667
|
+
return e ? {
|
|
5668
|
+
lang: e?.lang ?? void 0,
|
|
5669
|
+
message: e?.message,
|
|
5670
|
+
abortEarly: e?.abortEarly ?? void 0,
|
|
5671
|
+
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
5672
|
+
} : Mn;
|
|
5765
5673
|
}
|
|
5766
|
-
|
|
5767
|
-
|
|
5674
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5675
|
+
function Pn(e, t, n) {
|
|
5676
|
+
let r = e["~run"]({ value: t }, /* @__PURE__ */ Nn(n));
|
|
5677
|
+
return {
|
|
5678
|
+
typed: r.typed,
|
|
5679
|
+
success: !r.issues,
|
|
5680
|
+
output: r.value,
|
|
5681
|
+
issues: r.issues
|
|
5682
|
+
};
|
|
5768
5683
|
}
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5684
|
+
//#endregion
|
|
5685
|
+
//#region node_modules/@dpuse/dpuse-shared/dist/componentConfig.schema-DT3mO5rS.js
|
|
5686
|
+
var Fn = {
|
|
5687
|
+
lang: void 0,
|
|
5688
|
+
message: void 0,
|
|
5689
|
+
abortEarly: void 0,
|
|
5690
|
+
abortPipeEarly: void 0
|
|
5691
|
+
};
|
|
5692
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5693
|
+
function In(e) {
|
|
5694
|
+
return e ? {
|
|
5695
|
+
lang: e?.lang ?? void 0,
|
|
5696
|
+
message: e?.message,
|
|
5697
|
+
abortEarly: e?.abortEarly ?? void 0,
|
|
5698
|
+
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
5699
|
+
} : Fn;
|
|
5773
5700
|
}
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
stdio: "inherit"
|
|
5779
|
-
}).on("close", (n) => {
|
|
5780
|
-
n === 0 || r ? e() : o(/* @__PURE__ */ Error(`${t} exited with code ${String(n ?? "unknown")}`));
|
|
5781
|
-
});
|
|
5782
|
-
});
|
|
5701
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5702
|
+
function Ln(e) {
|
|
5703
|
+
let t = typeof e;
|
|
5704
|
+
return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
|
|
5783
5705
|
}
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
} catch (e) {
|
|
5801
|
-
c(e instanceof Error ? e : Error(String(e)));
|
|
5802
|
-
}
|
|
5803
|
-
})() : c(/* @__PURE__ */ Error(`${r} exited with code ${String(i ?? "unknown")}`));
|
|
5804
|
-
});
|
|
5805
|
-
});
|
|
5706
|
+
function U(e, t, n, r, i) {
|
|
5707
|
+
let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */ Ln(a), c = {
|
|
5708
|
+
kind: e.kind,
|
|
5709
|
+
type: e.type,
|
|
5710
|
+
input: a,
|
|
5711
|
+
expected: o,
|
|
5712
|
+
received: s,
|
|
5713
|
+
message: `Invalid ${t}: ${o ? `Expected ${o} but r` : "R"}eceived ${s}`,
|
|
5714
|
+
requirement: e.requirement,
|
|
5715
|
+
path: i?.path,
|
|
5716
|
+
issues: i?.issues,
|
|
5717
|
+
lang: r.lang,
|
|
5718
|
+
abortEarly: r.abortEarly,
|
|
5719
|
+
abortPipeEarly: r.abortPipeEarly
|
|
5720
|
+
}, l = e.kind === "schema", u = i?.message ?? e.message ?? (e.reference, c.lang, void 0) ?? (l ? (c.lang, void 0) : null) ?? r.message ?? (c.lang, void 0);
|
|
5721
|
+
u !== void 0 && (c.message = typeof u == "function" ? u(c) : u), l && (n.typed = !1), n.issues ? n.issues.push(c) : n.issues = [c];
|
|
5806
5722
|
}
|
|
5807
|
-
|
|
5808
|
-
|
|
5723
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5724
|
+
function Rn(e, t) {
|
|
5725
|
+
return e === t || Number.isNaN(e) && Number.isNaN(t);
|
|
5809
5726
|
}
|
|
5810
|
-
|
|
5811
|
-
|
|
5727
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5728
|
+
function zn(e, t) {
|
|
5729
|
+
return Object.prototype.hasOwnProperty.call(e, t) && t !== "__proto__" && t !== "prototype" && t !== "constructor";
|
|
5812
5730
|
}
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
if (e.code === "ENOENT") return null;
|
|
5818
|
-
throw e;
|
|
5819
|
-
}
|
|
5731
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5732
|
+
function Bn(e, t) {
|
|
5733
|
+
let n = [...new Set(e)];
|
|
5734
|
+
return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
|
|
5820
5735
|
}
|
|
5821
|
-
|
|
5822
|
-
|
|
5736
|
+
function Vn(e) {
|
|
5737
|
+
return e["~standard"] = {
|
|
5738
|
+
version: 1,
|
|
5739
|
+
vendor: "valibot",
|
|
5740
|
+
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */ In())
|
|
5741
|
+
}, e;
|
|
5823
5742
|
}
|
|
5824
|
-
|
|
5825
|
-
|
|
5743
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5744
|
+
function Hn(e, t, n) {
|
|
5745
|
+
return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
|
|
5826
5746
|
}
|
|
5827
|
-
|
|
5828
|
-
|
|
5747
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5748
|
+
function Un(e, t, n) {
|
|
5749
|
+
return typeof e.default == "function" ? e.default(t, n) : e.default;
|
|
5829
5750
|
}
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5751
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5752
|
+
function Wn(e, t) {
|
|
5753
|
+
return Vn({
|
|
5754
|
+
kind: "schema",
|
|
5755
|
+
type: "array",
|
|
5756
|
+
reference: Wn,
|
|
5757
|
+
expects: "Array",
|
|
5758
|
+
async: !1,
|
|
5759
|
+
item: e,
|
|
5760
|
+
message: t,
|
|
5761
|
+
"~run"(e, t) {
|
|
5762
|
+
let n = e.value;
|
|
5763
|
+
if (Array.isArray(n)) {
|
|
5764
|
+
e.typed = !0, e.value = [];
|
|
5765
|
+
for (let r = 0; r < n.length; r++) {
|
|
5766
|
+
let i = n[r], a = this.item["~run"]({ value: i }, t);
|
|
5767
|
+
if (a.issues) {
|
|
5768
|
+
let o = {
|
|
5769
|
+
type: "array",
|
|
5770
|
+
origin: "value",
|
|
5771
|
+
input: n,
|
|
5772
|
+
key: r,
|
|
5773
|
+
value: i
|
|
5774
|
+
};
|
|
5775
|
+
for (let t of a.issues) t.path ? t.path.unshift(o) : t.path = [o], e.issues?.push(t);
|
|
5776
|
+
if (e.issues ||= a.issues, t.abortEarly) {
|
|
5777
|
+
e.typed = !1;
|
|
5778
|
+
break;
|
|
5779
|
+
}
|
|
5780
|
+
}
|
|
5781
|
+
a.typed || (e.typed = !1), e.value.push(a.value);
|
|
5782
|
+
}
|
|
5783
|
+
} else U(this, "type", e, t);
|
|
5784
|
+
return e;
|
|
5785
|
+
}
|
|
5786
|
+
});
|
|
5833
5787
|
}
|
|
5834
|
-
|
|
5835
|
-
|
|
5788
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5789
|
+
function Gn(e) {
|
|
5790
|
+
return Vn({
|
|
5791
|
+
kind: "schema",
|
|
5792
|
+
type: "boolean",
|
|
5793
|
+
reference: Gn,
|
|
5794
|
+
expects: "boolean",
|
|
5795
|
+
async: !1,
|
|
5796
|
+
message: e,
|
|
5797
|
+
"~run"(e, t) {
|
|
5798
|
+
return typeof e.value == "boolean" ? e.typed = !0 : U(this, "type", e, t), e;
|
|
5799
|
+
}
|
|
5800
|
+
});
|
|
5836
5801
|
}
|
|
5837
|
-
|
|
5838
|
-
|
|
5802
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5803
|
+
function Kn(e, t) {
|
|
5804
|
+
return Vn({
|
|
5805
|
+
kind: "schema",
|
|
5806
|
+
type: "literal",
|
|
5807
|
+
reference: Kn,
|
|
5808
|
+
expects: /* @__PURE__ */ Ln(e),
|
|
5809
|
+
async: !1,
|
|
5810
|
+
literal: e,
|
|
5811
|
+
message: t,
|
|
5812
|
+
"~run"(e, t) {
|
|
5813
|
+
return /* @__PURE__ */ Rn(e.value, this.literal) ? e.typed = !0 : U(this, "type", e, t), e;
|
|
5814
|
+
}
|
|
5815
|
+
});
|
|
5839
5816
|
}
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
repo: a[2]
|
|
5853
|
-
};
|
|
5854
|
-
}
|
|
5855
|
-
async function Jn(e) {
|
|
5856
|
-
return await t.stat(e);
|
|
5857
|
-
}
|
|
5858
|
-
function Yn(e) {
|
|
5859
|
-
let t = k.extend(jn()).parse(e, {
|
|
5860
|
-
ecmaVersion: "latest",
|
|
5861
|
-
sourceType: "module",
|
|
5862
|
-
locations: !0
|
|
5863
|
-
}), n = [];
|
|
5864
|
-
return Xn(t, (e) => {
|
|
5865
|
-
if (e.type !== "MethodDefinition") return;
|
|
5866
|
-
let t = e, r = t.key;
|
|
5867
|
-
if (r.type !== "Identifier") return;
|
|
5868
|
-
let i = r.name;
|
|
5869
|
-
i && i !== "constructor" && t.accessibility !== "private" && n.push(i);
|
|
5870
|
-
}), n;
|
|
5871
|
-
}
|
|
5872
|
-
function Xn(e, t) {
|
|
5873
|
-
t(e);
|
|
5874
|
-
for (let [n, r] of Object.entries(e)) {
|
|
5875
|
-
if ([
|
|
5876
|
-
"loc",
|
|
5877
|
-
"range",
|
|
5878
|
-
"start",
|
|
5879
|
-
"end",
|
|
5880
|
-
"comments"
|
|
5881
|
-
].includes(n)) continue;
|
|
5882
|
-
let e = r;
|
|
5883
|
-
if (Array.isArray(e)) for (let n of e) {
|
|
5884
|
-
let e = n;
|
|
5885
|
-
e && typeof e.type == "string" && Xn(e, t);
|
|
5817
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5818
|
+
function W(e, t) {
|
|
5819
|
+
return Vn({
|
|
5820
|
+
kind: "schema",
|
|
5821
|
+
type: "nullable",
|
|
5822
|
+
reference: W,
|
|
5823
|
+
expects: `(${e.expects} | null)`,
|
|
5824
|
+
async: !1,
|
|
5825
|
+
wrapped: e,
|
|
5826
|
+
default: t,
|
|
5827
|
+
"~run"(e, t) {
|
|
5828
|
+
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ Un(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
5886
5829
|
}
|
|
5887
|
-
|
|
5888
|
-
}
|
|
5889
|
-
}
|
|
5890
|
-
function Zn(e, t, n, r) {
|
|
5891
|
-
let i = e.indexOf(n), a = e.indexOf(r);
|
|
5892
|
-
if (i === -1 || a === -1) throw Error(`Markers ${n}-${r} not found in content.`);
|
|
5893
|
-
let o = t.trim();
|
|
5894
|
-
return `${e.slice(0, Math.max(0, i + n.length))}\n\n${o}\n\n${e.slice(Math.max(0, a))}`;
|
|
5895
|
-
}
|
|
5896
|
-
//#endregion
|
|
5897
|
-
//#region src/actions/auditDependencies.ts
|
|
5898
|
-
async function Qn() {
|
|
5899
|
-
try {
|
|
5900
|
-
G("Audit Dependencies"), await U("1️⃣ Check using 'npm audit'", "npm", ["audit"]), K("Dependencies audited");
|
|
5901
|
-
} catch (e) {
|
|
5902
|
-
console.error("❌ Error auditing dependencies", e), process.exit(1);
|
|
5903
|
-
}
|
|
5830
|
+
});
|
|
5904
5831
|
}
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5832
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5833
|
+
function qn(e) {
|
|
5834
|
+
return Vn({
|
|
5835
|
+
kind: "schema",
|
|
5836
|
+
type: "number",
|
|
5837
|
+
reference: qn,
|
|
5838
|
+
expects: "number",
|
|
5839
|
+
async: !1,
|
|
5840
|
+
message: e,
|
|
5841
|
+
"~run"(e, t) {
|
|
5842
|
+
return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 : U(this, "type", e, t), e;
|
|
5843
|
+
}
|
|
5844
|
+
});
|
|
5916
5845
|
}
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
"
|
|
5921
|
-
"
|
|
5922
|
-
|
|
5923
|
-
|
|
5846
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5847
|
+
function Jn(e, t) {
|
|
5848
|
+
return Vn({
|
|
5849
|
+
kind: "schema",
|
|
5850
|
+
type: "optional",
|
|
5851
|
+
reference: Jn,
|
|
5852
|
+
expects: `(${e.expects} | undefined)`,
|
|
5853
|
+
async: !1,
|
|
5854
|
+
wrapped: e,
|
|
5855
|
+
default: t,
|
|
5856
|
+
"~run"(e, t) {
|
|
5857
|
+
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ Un(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
5858
|
+
}
|
|
5859
|
+
});
|
|
5924
5860
|
}
|
|
5925
|
-
|
|
5926
|
-
|
|
5861
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5862
|
+
function Yn(e, t, n) {
|
|
5863
|
+
return Vn({
|
|
5864
|
+
kind: "schema",
|
|
5865
|
+
type: "record",
|
|
5866
|
+
reference: Yn,
|
|
5867
|
+
expects: "Object",
|
|
5868
|
+
async: !1,
|
|
5869
|
+
key: e,
|
|
5870
|
+
value: t,
|
|
5871
|
+
message: n,
|
|
5872
|
+
"~run"(e, t) {
|
|
5873
|
+
let n = e.value;
|
|
5874
|
+
if (n && typeof n == "object") {
|
|
5875
|
+
e.typed = !0, e.value = {};
|
|
5876
|
+
for (let r in n) if (/* @__PURE__ */ zn(n, r)) {
|
|
5877
|
+
let i = n[r], a = this.key["~run"]({ value: r }, t);
|
|
5878
|
+
if (a.issues) {
|
|
5879
|
+
let o = {
|
|
5880
|
+
type: "object",
|
|
5881
|
+
origin: "key",
|
|
5882
|
+
input: n,
|
|
5883
|
+
key: r,
|
|
5884
|
+
value: i
|
|
5885
|
+
};
|
|
5886
|
+
for (let t of a.issues) t.path = [o], e.issues?.push(t);
|
|
5887
|
+
if (e.issues ||= a.issues, t.abortEarly) {
|
|
5888
|
+
e.typed = !1;
|
|
5889
|
+
break;
|
|
5890
|
+
}
|
|
5891
|
+
}
|
|
5892
|
+
let o = this.value["~run"]({ value: i }, t);
|
|
5893
|
+
if (o.issues) {
|
|
5894
|
+
let a = {
|
|
5895
|
+
type: "object",
|
|
5896
|
+
origin: "value",
|
|
5897
|
+
input: n,
|
|
5898
|
+
key: r,
|
|
5899
|
+
value: i
|
|
5900
|
+
};
|
|
5901
|
+
for (let t of o.issues) t.path ? t.path.unshift(a) : t.path = [a], e.issues?.push(t);
|
|
5902
|
+
if (e.issues ||= o.issues, t.abortEarly) {
|
|
5903
|
+
e.typed = !1;
|
|
5904
|
+
break;
|
|
5905
|
+
}
|
|
5906
|
+
}
|
|
5907
|
+
(!a.typed || !o.typed) && (e.typed = !1), a.typed && (e.value[a.value] = o.value);
|
|
5908
|
+
}
|
|
5909
|
+
} else U(this, "type", e, t);
|
|
5910
|
+
return e;
|
|
5911
|
+
}
|
|
5912
|
+
});
|
|
5927
5913
|
}
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
"
|
|
5932
|
-
"
|
|
5933
|
-
|
|
5934
|
-
"
|
|
5935
|
-
|
|
5914
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5915
|
+
function G(e, t) {
|
|
5916
|
+
return Vn({
|
|
5917
|
+
kind: "schema",
|
|
5918
|
+
type: "strict_object",
|
|
5919
|
+
reference: G,
|
|
5920
|
+
expects: "Object",
|
|
5921
|
+
async: !1,
|
|
5922
|
+
entries: e,
|
|
5923
|
+
message: t,
|
|
5924
|
+
"~run"(e, t) {
|
|
5925
|
+
let n = e.value;
|
|
5926
|
+
if (n && typeof n == "object") {
|
|
5927
|
+
e.typed = !0, e.value = {};
|
|
5928
|
+
for (let r in this.entries) {
|
|
5929
|
+
let i = this.entries[r];
|
|
5930
|
+
if (r in n || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
|
|
5931
|
+
let a = r in n ? n[r] : /* @__PURE__ */ Un(i), o = i["~run"]({ value: a }, t);
|
|
5932
|
+
if (o.issues) {
|
|
5933
|
+
let i = {
|
|
5934
|
+
type: "object",
|
|
5935
|
+
origin: "value",
|
|
5936
|
+
input: n,
|
|
5937
|
+
key: r,
|
|
5938
|
+
value: a
|
|
5939
|
+
};
|
|
5940
|
+
for (let t of o.issues) t.path ? t.path.unshift(i) : t.path = [i], e.issues?.push(t);
|
|
5941
|
+
if (e.issues ||= o.issues, t.abortEarly) {
|
|
5942
|
+
e.typed = !1;
|
|
5943
|
+
break;
|
|
5944
|
+
}
|
|
5945
|
+
}
|
|
5946
|
+
o.typed || (e.typed = !1), e.value[r] = o.value;
|
|
5947
|
+
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ Hn(i);
|
|
5948
|
+
else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (U(this, "key", e, t, {
|
|
5949
|
+
input: void 0,
|
|
5950
|
+
expected: `"${r}"`,
|
|
5951
|
+
path: [{
|
|
5952
|
+
type: "object",
|
|
5953
|
+
origin: "key",
|
|
5954
|
+
input: n,
|
|
5955
|
+
key: r,
|
|
5956
|
+
value: n[r]
|
|
5957
|
+
}]
|
|
5958
|
+
}), t.abortEarly)) break;
|
|
5959
|
+
}
|
|
5960
|
+
if (!e.issues || !t.abortEarly) {
|
|
5961
|
+
for (let r in n) if (!Object.prototype.hasOwnProperty.call(this.entries, r)) {
|
|
5962
|
+
U(this, "key", e, t, {
|
|
5963
|
+
input: r,
|
|
5964
|
+
expected: "never",
|
|
5965
|
+
path: [{
|
|
5966
|
+
type: "object",
|
|
5967
|
+
origin: "key",
|
|
5968
|
+
input: n,
|
|
5969
|
+
key: r,
|
|
5970
|
+
value: n[r]
|
|
5971
|
+
}]
|
|
5972
|
+
});
|
|
5973
|
+
break;
|
|
5974
|
+
}
|
|
5975
|
+
}
|
|
5976
|
+
} else U(this, "type", e, t);
|
|
5977
|
+
return e;
|
|
5978
|
+
}
|
|
5979
|
+
});
|
|
5936
5980
|
}
|
|
5937
|
-
|
|
5938
|
-
|
|
5981
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5982
|
+
function K(e) {
|
|
5983
|
+
return Vn({
|
|
5984
|
+
kind: "schema",
|
|
5985
|
+
type: "string",
|
|
5986
|
+
reference: K,
|
|
5987
|
+
expects: "string",
|
|
5988
|
+
async: !1,
|
|
5989
|
+
message: e,
|
|
5990
|
+
"~run"(e, t) {
|
|
5991
|
+
return typeof e.value == "string" ? e.typed = !0 : U(this, "type", e, t), e;
|
|
5992
|
+
}
|
|
5993
|
+
});
|
|
5939
5994
|
}
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
else if ([
|
|
5947
|
-
"app",
|
|
5948
|
-
"api",
|
|
5949
|
-
"development",
|
|
5950
|
-
"engine",
|
|
5951
|
-
"shared"
|
|
5952
|
-
].includes(e.typeId)) console.info("⚠️ File 'vite.config.ts' is UNIQUE to this project");
|
|
5953
|
-
else {
|
|
5954
|
-
let n;
|
|
5955
|
-
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);
|
|
5956
|
-
}
|
|
5995
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
5996
|
+
function Xn(e) {
|
|
5997
|
+
let t;
|
|
5998
|
+
if (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);
|
|
5999
|
+
else t = n.issues;
|
|
6000
|
+
return t;
|
|
5957
6001
|
}
|
|
5958
|
-
|
|
5959
|
-
|
|
6002
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
6003
|
+
function Zn(e, t) {
|
|
6004
|
+
return Vn({
|
|
6005
|
+
kind: "schema",
|
|
6006
|
+
type: "union",
|
|
6007
|
+
reference: Zn,
|
|
6008
|
+
expects: /* @__PURE__ */ Bn(e.map((e) => e.expects), "|"),
|
|
6009
|
+
async: !1,
|
|
6010
|
+
options: e,
|
|
6011
|
+
message: t,
|
|
6012
|
+
"~run"(e, t) {
|
|
6013
|
+
let n, r, i;
|
|
6014
|
+
for (let a of this.options) {
|
|
6015
|
+
let o = a["~run"]({ value: e.value }, t);
|
|
6016
|
+
if (o.typed) {
|
|
6017
|
+
if (o.issues) r ? r.push(o) : r = [o];
|
|
6018
|
+
else {
|
|
6019
|
+
n = o;
|
|
6020
|
+
break;
|
|
6021
|
+
}
|
|
6022
|
+
} else i ? i.push(o) : i = [o];
|
|
6023
|
+
}
|
|
6024
|
+
if (n) return n;
|
|
6025
|
+
if (r) {
|
|
6026
|
+
if (r.length === 1) return r[0];
|
|
6027
|
+
U(this, "type", e, t, { issues: /* @__PURE__ */ Xn(r) }), e.typed = !0;
|
|
6028
|
+
} else if (i?.length === 1) return i[0];
|
|
6029
|
+
else U(this, "type", e, t, { issues: /* @__PURE__ */ Xn(i) });
|
|
6030
|
+
return e;
|
|
6031
|
+
}
|
|
6032
|
+
});
|
|
5960
6033
|
}
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
6034
|
+
var Qn = /* @__PURE__ */ G({
|
|
6035
|
+
en: /* @__PURE__ */ K(),
|
|
6036
|
+
es: /* @__PURE__ */ K()
|
|
6037
|
+
}), $n = {
|
|
6038
|
+
id: /* @__PURE__ */ K(),
|
|
6039
|
+
label: /* @__PURE__ */ G({
|
|
6040
|
+
en: /* @__PURE__ */ Jn(/* @__PURE__ */ K()),
|
|
6041
|
+
es: /* @__PURE__ */ Jn(/* @__PURE__ */ K())
|
|
6042
|
+
}),
|
|
6043
|
+
description: /* @__PURE__ */ G({
|
|
6044
|
+
en: /* @__PURE__ */ Jn(/* @__PURE__ */ K()),
|
|
6045
|
+
es: /* @__PURE__ */ Jn(/* @__PURE__ */ K())
|
|
6046
|
+
}),
|
|
6047
|
+
icon: /* @__PURE__ */ W(/* @__PURE__ */ K()),
|
|
6048
|
+
iconDark: /* @__PURE__ */ W(/* @__PURE__ */ K())
|
|
6049
|
+
}, er = (e) => /* @__PURE__ */ Zn(e.map((e) => /* @__PURE__ */ Kn(e))), tr = er([
|
|
6050
|
+
"app",
|
|
6051
|
+
"connector",
|
|
6052
|
+
"connectorConnection",
|
|
6053
|
+
"context",
|
|
6054
|
+
"contextArea",
|
|
6055
|
+
"contextModel",
|
|
6056
|
+
"contextModelDimension",
|
|
6057
|
+
"contextModelDimensionHierarchy",
|
|
6058
|
+
"contextModelEntity",
|
|
6059
|
+
"contextModelEntityDataItem",
|
|
6060
|
+
"contextModelEntityEvent",
|
|
6061
|
+
"contextModelEntityPrimaryMeasure",
|
|
6062
|
+
"contextModelSecondaryMeasure",
|
|
6063
|
+
"cookbook",
|
|
6064
|
+
"cookbookRecipe",
|
|
6065
|
+
"dataView",
|
|
6066
|
+
"engine",
|
|
6067
|
+
"eventQuery",
|
|
6068
|
+
"presenter",
|
|
6069
|
+
"presenterPresentation",
|
|
6070
|
+
"tool"
|
|
6071
|
+
]), nr = er([
|
|
6072
|
+
"danger",
|
|
6073
|
+
"success",
|
|
6074
|
+
"warning"
|
|
6075
|
+
]), rr = er([
|
|
6076
|
+
"alpha",
|
|
6077
|
+
"beta",
|
|
6078
|
+
"releaseCandidate",
|
|
6079
|
+
"generalAvailability"
|
|
6080
|
+
]), ir = /* @__PURE__ */ G({
|
|
6081
|
+
color: nr,
|
|
6082
|
+
label: /* @__PURE__ */ K()
|
|
6083
|
+
}), ar = {
|
|
6084
|
+
...$n,
|
|
6085
|
+
typeId: tr
|
|
6086
|
+
}, or = /* @__PURE__ */ G({
|
|
6087
|
+
...ar,
|
|
6088
|
+
order: /* @__PURE__ */ qn(),
|
|
6089
|
+
path: /* @__PURE__ */ K()
|
|
6090
|
+
}), sr = {
|
|
6091
|
+
...ar,
|
|
6092
|
+
firstCreatedAt: /* @__PURE__ */ W(/* @__PURE__ */ qn()),
|
|
6093
|
+
lastUpdatedAt: /* @__PURE__ */ W(/* @__PURE__ */ qn()),
|
|
6094
|
+
status: /* @__PURE__ */ W(ir),
|
|
6095
|
+
statusId: /* @__PURE__ */ W(rr)
|
|
6096
|
+
};
|
|
6097
|
+
({ ...sr }), er([
|
|
6098
|
+
"app",
|
|
6099
|
+
"engine",
|
|
6100
|
+
"connector",
|
|
6101
|
+
"cookbook",
|
|
6102
|
+
"presenter",
|
|
6103
|
+
"tool"
|
|
6104
|
+
]);
|
|
6105
|
+
//#endregion
|
|
6106
|
+
//#region node_modules/@dpuse/dpuse-shared/dist/moduleConfig.schema-aYmFWSrn.js
|
|
6107
|
+
var cr = {
|
|
6108
|
+
...sr,
|
|
6109
|
+
vendorAccountURL: /* @__PURE__ */ W(/* @__PURE__ */ K()),
|
|
6110
|
+
vendorDocumentationURL: /* @__PURE__ */ W(/* @__PURE__ */ K()),
|
|
6111
|
+
vendorHomeURL: /* @__PURE__ */ W(/* @__PURE__ */ K()),
|
|
6112
|
+
version: /* @__PURE__ */ K()
|
|
6113
|
+
};
|
|
6114
|
+
({ ...cr });
|
|
6115
|
+
//#endregion
|
|
6116
|
+
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModuleConnector.es.js
|
|
6117
|
+
var lr = er([
|
|
6118
|
+
"abortOperation",
|
|
6119
|
+
"auditObjectContent",
|
|
6120
|
+
"createObject",
|
|
6121
|
+
"describeConnection",
|
|
6122
|
+
"dropObject",
|
|
6123
|
+
"findObject",
|
|
6124
|
+
"getInfo",
|
|
6125
|
+
"getReadableStream",
|
|
6126
|
+
"getRecord",
|
|
6127
|
+
"listNodes",
|
|
6128
|
+
"previewObject",
|
|
6129
|
+
"removeRecords",
|
|
6130
|
+
"retrieveChunks",
|
|
6131
|
+
"retrieveRecords",
|
|
6132
|
+
"upsertRecords"
|
|
6133
|
+
]), ur = er([
|
|
6134
|
+
"application",
|
|
6135
|
+
"curatedDataset",
|
|
6136
|
+
"database",
|
|
6137
|
+
"fileStore"
|
|
6138
|
+
]), dr = /* @__PURE__ */ G({ label: Qn }), fr = er([
|
|
6139
|
+
"bidirectional",
|
|
6140
|
+
"destination",
|
|
6141
|
+
"source",
|
|
6142
|
+
"unknown"
|
|
6143
|
+
]), pr = /* @__PURE__ */ G({ label: Qn }), mr = /* @__PURE__ */ G({
|
|
6144
|
+
authMethodId: er([
|
|
6145
|
+
"apiKey",
|
|
6146
|
+
"disabled",
|
|
6147
|
+
"oAuth2",
|
|
6148
|
+
"none"
|
|
6149
|
+
]),
|
|
6150
|
+
activeConnectionCount: /* @__PURE__ */ Jn(/* @__PURE__ */ qn()),
|
|
6151
|
+
canDescribe: /* @__PURE__ */ Jn(/* @__PURE__ */ Gn()),
|
|
6152
|
+
id: /* @__PURE__ */ Jn(/* @__PURE__ */ K()),
|
|
6153
|
+
label: /* @__PURE__ */ Jn(Qn),
|
|
6154
|
+
maxConnectionCount: /* @__PURE__ */ W(/* @__PURE__ */ qn()),
|
|
6155
|
+
params: /* @__PURE__ */ Jn(/* @__PURE__ */ Wn(/* @__PURE__ */ Yn(/* @__PURE__ */ K(), /* @__PURE__ */ K())))
|
|
6156
|
+
}), hr = /* @__PURE__ */ G({
|
|
6157
|
+
...cr,
|
|
6158
|
+
typeId: /* @__PURE__ */ Kn("connector"),
|
|
6159
|
+
actionNames: /* @__PURE__ */ Wn(lr),
|
|
6160
|
+
category: /* @__PURE__ */ W(dr),
|
|
6161
|
+
categoryId: ur,
|
|
6162
|
+
implementations: /* @__PURE__ */ Yn(/* @__PURE__ */ K(), mr),
|
|
6163
|
+
usage: /* @__PURE__ */ W(pr),
|
|
6164
|
+
usageId: /* @__PURE__ */ W(fr)
|
|
6165
|
+
}), gr = {
|
|
6166
|
+
abortOperation: "Abort Operation",
|
|
6167
|
+
auditObjectContent: "Audit Object Content",
|
|
6168
|
+
createObject: "Create Object",
|
|
6169
|
+
describeConnection: "Describe Connection",
|
|
6170
|
+
dropObject: "Drop Object",
|
|
6171
|
+
findObject: "Find Object",
|
|
6172
|
+
getInfo: "Get Info",
|
|
6173
|
+
getReadableStream: "Get Readable Stream",
|
|
6174
|
+
getRecord: "Get Record",
|
|
6175
|
+
listNodes: "List Nodes",
|
|
6176
|
+
previewObject: "Preview Object",
|
|
6177
|
+
removeRecords: "Remove Records",
|
|
6178
|
+
retrieveChunks: "Retrieve Chunks",
|
|
6179
|
+
retrieveRecords: "Retrieve Records",
|
|
6180
|
+
upsertRecords: "Upsert Records"
|
|
6181
|
+
}, _r = /* @__PURE__ */ new Set([
|
|
6182
|
+
"createObject",
|
|
6183
|
+
"dropObject",
|
|
6184
|
+
"removeRecords",
|
|
6185
|
+
"upsertRecords"
|
|
6186
|
+
]), vr = /* @__PURE__ */ new Set([
|
|
6187
|
+
"auditObjectContent",
|
|
6188
|
+
"findObject",
|
|
6189
|
+
"getInfo",
|
|
6190
|
+
"getReadableStream",
|
|
6191
|
+
"getRecord",
|
|
6192
|
+
"listNodes",
|
|
6193
|
+
"previewObject",
|
|
6194
|
+
"retrieveChunks",
|
|
6195
|
+
"retrieveRecords"
|
|
6196
|
+
]);
|
|
6197
|
+
function yr(e) {
|
|
6198
|
+
let t = !1, n = !1;
|
|
6199
|
+
for (let r of e) vr.has(r) && (t = !0), _r.has(r) && (n = !0);
|
|
6200
|
+
return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "unknown";
|
|
5969
6201
|
}
|
|
5970
|
-
|
|
5971
|
-
let
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
if (e.code !== "ENOENT") throw e;
|
|
5976
|
-
}
|
|
5977
|
-
if (s === void 0) {
|
|
5978
|
-
console.info(`❌ File '${t}' is MISSING`);
|
|
5979
|
-
return;
|
|
5980
|
-
}
|
|
5981
|
-
for (let r of o) {
|
|
5982
|
-
let a = i(await Vn(n.resolve(e, `../${r}`)));
|
|
5983
|
-
if (s === a) {
|
|
5984
|
-
console.info(`ℹ️ File '${t}' is the same as '${r}'`);
|
|
5985
|
-
return;
|
|
5986
|
-
}
|
|
5987
|
-
}
|
|
5988
|
-
console.info(`❌ File '${t}' is NOT the same`);
|
|
6202
|
+
function br(e) {
|
|
6203
|
+
let t = new Set(e), n = "|Action|Supported|\n";
|
|
6204
|
+
n += "|:----|:-------:|\n";
|
|
6205
|
+
for (let e of Object.keys(gr)) n += `| ${gr[e]} | ${t.has(e) ? "✓" : ""} |\n`;
|
|
6206
|
+
return n;
|
|
5989
6207
|
}
|
|
5990
6208
|
//#endregion
|
|
5991
|
-
//#region
|
|
5992
|
-
|
|
6209
|
+
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModulePresenter.es.js
|
|
6210
|
+
var xr = er([
|
|
6211
|
+
"list",
|
|
6212
|
+
"render",
|
|
6213
|
+
"setColorMode"
|
|
6214
|
+
]), Sr = /* @__PURE__ */ G({
|
|
6215
|
+
...cr,
|
|
6216
|
+
typeId: /* @__PURE__ */ Kn("presenter"),
|
|
6217
|
+
actionNames: /* @__PURE__ */ Wn(xr),
|
|
6218
|
+
presentations: /* @__PURE__ */ Wn(or)
|
|
6219
|
+
}), Cr = "code-health-reports/fallow", wr = `${Cr}/badge.json`, Tr = `${Cr}/index.md`, Er = "<!-- CONTRIBUTING_LICENSE_END -->", Dr = "<!-- CONTRIBUTING_LICENSE_START -->", Or = "<!-- GOVERNANCE_END -->", kr = "<!-- GOVERNANCE_START -->", Ar = "<!-- QUALITY_SECURITY_END -->", jr = "<!-- QUALITY_SECURITY_START -->", Mr = [
|
|
6220
|
+
{
|
|
6221
|
+
idPrefix: "dpuse-app",
|
|
6222
|
+
typeId: "app",
|
|
6223
|
+
publishedTo: "app",
|
|
6224
|
+
uploadGroupName: void 0
|
|
6225
|
+
},
|
|
6226
|
+
{
|
|
6227
|
+
idPrefix: "dpuse-api",
|
|
6228
|
+
typeId: "api",
|
|
6229
|
+
publishedTo: "api",
|
|
6230
|
+
uploadGroupName: void 0
|
|
6231
|
+
},
|
|
6232
|
+
{
|
|
6233
|
+
idPrefix: "dpuse-connector",
|
|
6234
|
+
typeId: "connector",
|
|
6235
|
+
publishedTo: "dpuse",
|
|
6236
|
+
uploadGroupName: "connectors"
|
|
6237
|
+
},
|
|
6238
|
+
{
|
|
6239
|
+
idPrefix: "dpuse-context",
|
|
6240
|
+
typeId: "context",
|
|
6241
|
+
publishedTo: "dpuse",
|
|
6242
|
+
uploadGroupName: "contexts"
|
|
6243
|
+
},
|
|
6244
|
+
{
|
|
6245
|
+
idPrefix: "dpuse-development",
|
|
6246
|
+
typeId: "development",
|
|
6247
|
+
publishedTo: "npm",
|
|
6248
|
+
uploadGroupName: void 0
|
|
6249
|
+
},
|
|
6250
|
+
{
|
|
6251
|
+
idPrefix: "dpuse-engine",
|
|
6252
|
+
typeId: "engine",
|
|
6253
|
+
publishedTo: "dpuse",
|
|
6254
|
+
uploadGroupName: "engine"
|
|
6255
|
+
},
|
|
6256
|
+
{
|
|
6257
|
+
idPrefix: "dpuse-kb",
|
|
6258
|
+
typeId: "kb",
|
|
6259
|
+
publishedTo: "kb",
|
|
6260
|
+
uploadGroupName: void 0
|
|
6261
|
+
},
|
|
6262
|
+
{
|
|
6263
|
+
idPrefix: "dpuse-presenter",
|
|
6264
|
+
typeId: "presenter",
|
|
6265
|
+
publishedTo: "dpuse",
|
|
6266
|
+
uploadGroupName: "presenters"
|
|
6267
|
+
},
|
|
6268
|
+
{
|
|
6269
|
+
idPrefix: "dpuse-cookbook",
|
|
6270
|
+
typeId: "cookbook",
|
|
6271
|
+
publishedTo: "dpuse",
|
|
6272
|
+
uploadGroupName: "cookbooks"
|
|
6273
|
+
},
|
|
6274
|
+
{
|
|
6275
|
+
idPrefix: "dpuse-resources",
|
|
6276
|
+
typeId: "resources",
|
|
6277
|
+
publishedTo: "sampleData",
|
|
6278
|
+
uploadGroupName: void 0
|
|
6279
|
+
},
|
|
6280
|
+
{
|
|
6281
|
+
idPrefix: "dpuse-shared",
|
|
6282
|
+
typeId: "shared",
|
|
6283
|
+
publishedTo: "npm",
|
|
6284
|
+
uploadGroupName: void 0
|
|
6285
|
+
},
|
|
6286
|
+
{
|
|
6287
|
+
idPrefix: "dpuse-tool",
|
|
6288
|
+
typeId: "tool",
|
|
6289
|
+
publishedTo: "npm",
|
|
6290
|
+
uploadGroupName: "tools"
|
|
6291
|
+
},
|
|
6292
|
+
{
|
|
6293
|
+
idPrefix: "eslint-config-dpuse",
|
|
6294
|
+
typeId: "eslint",
|
|
6295
|
+
publishedTo: "npm",
|
|
6296
|
+
uploadGroupName: void 0
|
|
6297
|
+
},
|
|
6298
|
+
{
|
|
6299
|
+
idPrefix: "github",
|
|
6300
|
+
typeId: "github",
|
|
6301
|
+
publishedTo: "github",
|
|
6302
|
+
uploadGroupName: void 0
|
|
6303
|
+
}
|
|
6304
|
+
], Nr = r(i);
|
|
6305
|
+
async function Pr(e, r) {
|
|
6306
|
+
e !== void 0 && Z(`${e} - clear(${r})`);
|
|
6307
|
+
let i;
|
|
5993
6308
|
try {
|
|
5994
|
-
|
|
5995
|
-
|
|
6309
|
+
i = await t.readdir(r, { withFileTypes: !0 });
|
|
6310
|
+
} catch (e) {
|
|
6311
|
+
if (e.code === "ENOENT") return;
|
|
6312
|
+
throw e;
|
|
6313
|
+
}
|
|
6314
|
+
await Promise.all(i.map(async (e) => {
|
|
6315
|
+
let i = n.join(r, e.name);
|
|
5996
6316
|
try {
|
|
5997
|
-
|
|
6317
|
+
await t.rm(i, {
|
|
6318
|
+
recursive: !0,
|
|
6319
|
+
force: !0
|
|
6320
|
+
});
|
|
5998
6321
|
} catch (e) {
|
|
5999
6322
|
if (e.code !== "ENOENT") throw e;
|
|
6000
6323
|
}
|
|
6001
|
-
|
|
6002
|
-
interactive: !0,
|
|
6003
|
-
upgrade: !0,
|
|
6004
|
-
dep: "dev,prod,peer,optional",
|
|
6005
|
-
install: "never",
|
|
6006
|
-
...e
|
|
6007
|
-
}), await U("3️⃣ Install updated dependencies", "npm", [
|
|
6008
|
-
"install",
|
|
6009
|
-
"--prefer-online",
|
|
6010
|
-
"--no-strict-allow-scripts"
|
|
6011
|
-
]);
|
|
6012
|
-
let t = await ur();
|
|
6013
|
-
t.length > 0 ? await U("4️⃣ Move install-script pins to installed versions", "npm", [
|
|
6014
|
-
"install-scripts",
|
|
6015
|
-
"approve",
|
|
6016
|
-
...t
|
|
6017
|
-
]) : q("4️⃣ No pinned install-script approvals to move"), process.platform === "darwin" ? await U("5️⃣ Remove unused install-script entries", "npm", ["install-scripts", "prune"]) : q("5️⃣ Skipped removing unused install-script entries (macOS only)"), t.length > 0 && await U("6️⃣ Run install scripts skipped in step 3", "npm", [
|
|
6018
|
-
"rebuild",
|
|
6019
|
-
...t,
|
|
6020
|
-
"--no-strict-allow-scripts"
|
|
6021
|
-
]), await U("7️⃣ Confirm every install script is reviewed", "npm", ["install", "--strict-allow-scripts"]), K("Dependencies checked");
|
|
6022
|
-
} catch (e) {
|
|
6023
|
-
console.error("❌ Error checking dependencies", e), process.exit(1);
|
|
6024
|
-
}
|
|
6324
|
+
}));
|
|
6025
6325
|
}
|
|
6026
|
-
async function
|
|
6027
|
-
|
|
6028
|
-
return [...new Set(t)];
|
|
6326
|
+
async function Fr(e, n) {
|
|
6327
|
+
return t.readdir(e, n);
|
|
6029
6328
|
}
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
try {
|
|
6035
|
-
G("Document Bundle Sizes"), q("1️⃣ Read bundle analysis report");
|
|
6036
|
-
let t = await W("./bundle-analysis-reports/sonda/index.json");
|
|
6037
|
-
q("2️⃣ Insert table into 'README.md'"), await Wn(`## Bundle Analysis\n\n${hr}\n\n${yr(t, e?.moduleLevel ?? !1)}\n\n${_r}`, dr, fr), K("Bundle sizes documented");
|
|
6038
|
-
} catch (e) {
|
|
6039
|
-
console.error("❌ Error documenting bundle sizes", e), process.exit(1);
|
|
6040
|
-
}
|
|
6041
|
-
}
|
|
6042
|
-
function yr(e, t) {
|
|
6043
|
-
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|", "|:------ |:-----------|"];
|
|
6044
|
-
for (let [e, o] of i) {
|
|
6045
|
-
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);
|
|
6046
|
-
a.push(...s);
|
|
6047
|
-
}
|
|
6048
|
-
return a.join("\n");
|
|
6049
|
-
}
|
|
6050
|
-
function br(e, t, n, r, i) {
|
|
6051
|
-
let [a, { sizes: o, files: s }] = n, c = r > 0 ? o.uncompressed / r * 100 : 0;
|
|
6052
|
-
if (s.size === 1) return [`| ${e} → ${Cr(a, Tr(s))} | ${jr(t)} · ${Mr(c)} |`];
|
|
6053
|
-
let l = [`| ${e} → ${a} | ${jr(t)} · ${Mr(c)} |`];
|
|
6054
|
-
return i || l.push(...Sr(s, pr, r)), l;
|
|
6329
|
+
async function Ir(e, n, r, i) {
|
|
6330
|
+
e !== void 0 && Z(`${e} - exec(${n} ${r.join(" ")})`);
|
|
6331
|
+
let { stdout: a, stderr: o } = await Nr(n, r);
|
|
6332
|
+
i === void 0 ? a.trim() && console.log(a.trim()) : await t.writeFile(i, a.trim(), "utf-8"), o.trim() && console.error(o.trim());
|
|
6055
6333
|
}
|
|
6056
|
-
function
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
a.push(`| ${pr}${e} | ${Mr(n)} |`), i || a.push(...Sr(o, `${pr}${pr}`, r));
|
|
6066
|
-
}
|
|
6067
|
-
return a;
|
|
6334
|
+
async function q(e, t, n, r = !1, i = !1) {
|
|
6335
|
+
return Z(`${e} - spawn(${t} ${n.join(" ")})`), new Promise((e, o) => {
|
|
6336
|
+
a(t, n, {
|
|
6337
|
+
shell: i,
|
|
6338
|
+
stdio: "inherit"
|
|
6339
|
+
}).on("close", (n) => {
|
|
6340
|
+
n === 0 || r ? e() : o(/* @__PURE__ */ Error(`${t} exited with code ${String(n ?? "unknown")}`));
|
|
6341
|
+
});
|
|
6342
|
+
});
|
|
6068
6343
|
}
|
|
6069
|
-
function
|
|
6070
|
-
return
|
|
6344
|
+
async function Lr(e, r, i, o, s = !1) {
|
|
6345
|
+
return Z(`${e} - spawn(${r} ${i.join(" ")}) > ${o}`), new Promise((e, c) => {
|
|
6346
|
+
let l = a(r, i, {
|
|
6347
|
+
shell: !1,
|
|
6348
|
+
stdio: [
|
|
6349
|
+
"inherit",
|
|
6350
|
+
"pipe",
|
|
6351
|
+
"inherit"
|
|
6352
|
+
]
|
|
6353
|
+
}), u = "";
|
|
6354
|
+
l.stdout.on("data", (e) => {
|
|
6355
|
+
u += String(e);
|
|
6356
|
+
}), l.on("close", (i) => {
|
|
6357
|
+
i === 0 || s ? (async () => {
|
|
6358
|
+
try {
|
|
6359
|
+
await t.mkdir(n.dirname(o), { recursive: !0 }), await t.writeFile(o, u, "utf-8"), e();
|
|
6360
|
+
} catch (e) {
|
|
6361
|
+
c(e instanceof Error ? e : Error(String(e)));
|
|
6362
|
+
}
|
|
6363
|
+
})() : c(/* @__PURE__ */ Error(`${r} exited with code ${String(i ?? "unknown")}`));
|
|
6364
|
+
});
|
|
6365
|
+
});
|
|
6071
6366
|
}
|
|
6072
|
-
function
|
|
6073
|
-
|
|
6367
|
+
async function Rr() {
|
|
6368
|
+
let e = await zr("./README.md"), t = e.indexOf(kr), n = e.indexOf(Or);
|
|
6369
|
+
if (t === -1 || n === -1) return;
|
|
6370
|
+
let r = `${jr}\n${Ar}\n\n${Dr}\n${Er}`;
|
|
6371
|
+
await Ur("README.md", `${e.slice(0, t)}${r}${e.slice(n + 23)}`);
|
|
6074
6372
|
}
|
|
6075
|
-
function
|
|
6076
|
-
|
|
6077
|
-
if (t === void 0) throw Error("Expected exactly one entry");
|
|
6078
|
-
return t;
|
|
6373
|
+
async function J(e) {
|
|
6374
|
+
return JSON.parse(await t.readFile(e, "utf-8"));
|
|
6079
6375
|
}
|
|
6080
|
-
function
|
|
6081
|
-
|
|
6082
|
-
if (t === void 0) throw Error("Expected exactly one file");
|
|
6083
|
-
return t;
|
|
6376
|
+
async function zr(e) {
|
|
6377
|
+
return await t.readFile(e, "utf-8");
|
|
6084
6378
|
}
|
|
6085
|
-
function
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
let s = o.get(e) ?? {
|
|
6092
|
-
sizes: Nr(),
|
|
6093
|
-
files: /* @__PURE__ */ new Map()
|
|
6094
|
-
};
|
|
6095
|
-
o.set(e, s), Pr(s.sizes, a);
|
|
6096
|
-
let c = s.files.get(i) ?? Nr();
|
|
6097
|
-
s.files.set(i, c), Pr(c, a);
|
|
6379
|
+
async function Br(e) {
|
|
6380
|
+
try {
|
|
6381
|
+
return await t.readFile(e, "utf-8");
|
|
6382
|
+
} catch (e) {
|
|
6383
|
+
if (e.code === "ENOENT") return null;
|
|
6384
|
+
throw e;
|
|
6098
6385
|
}
|
|
6099
|
-
return n;
|
|
6100
6386
|
}
|
|
6101
|
-
function
|
|
6102
|
-
|
|
6387
|
+
async function Vr(e, n) {
|
|
6388
|
+
await t.writeFile(e, JSON.stringify(n, void 0, 4), "utf-8");
|
|
6103
6389
|
}
|
|
6104
|
-
function
|
|
6105
|
-
|
|
6106
|
-
if (n) {
|
|
6107
|
-
let [t, r] = n;
|
|
6108
|
-
return {
|
|
6109
|
-
group: r,
|
|
6110
|
-
file: e.slice(t.length + 1)
|
|
6111
|
-
};
|
|
6112
|
-
}
|
|
6113
|
-
return e === "[unassigned]" ? {
|
|
6114
|
-
group: gr,
|
|
6115
|
-
file: ""
|
|
6116
|
-
} : e.startsWith("\0") ? {
|
|
6117
|
-
group: "(runtime)",
|
|
6118
|
-
file: e.slice(1)
|
|
6119
|
-
} : {
|
|
6120
|
-
group: e.startsWith("rust/") || e.includes("vite-plugin-wasm") ? "wasm" : "src",
|
|
6121
|
-
file: kr(e)
|
|
6122
|
-
};
|
|
6390
|
+
async function Hr(e, t, n) {
|
|
6391
|
+
await Ur("README.md", ei(await zr("./README.md"), e, t, n));
|
|
6123
6392
|
}
|
|
6124
|
-
function
|
|
6125
|
-
|
|
6393
|
+
async function Ur(e, n) {
|
|
6394
|
+
await t.writeFile(e, n, "utf-8");
|
|
6126
6395
|
}
|
|
6127
|
-
function
|
|
6128
|
-
|
|
6129
|
-
uncompressed: e.uncompressed,
|
|
6130
|
-
gzip: e.gzip ?? 0
|
|
6131
|
-
};
|
|
6396
|
+
function Y(e) {
|
|
6397
|
+
console.info("\x1B[36m────────────────────────────────────────────────────────────────────────────────"), console.info(`▶️ ${e}[0m`);
|
|
6132
6398
|
}
|
|
6133
|
-
function
|
|
6134
|
-
|
|
6399
|
+
function X(e) {
|
|
6400
|
+
console.info(`✅ ${e}`);
|
|
6135
6401
|
}
|
|
6136
|
-
function
|
|
6137
|
-
|
|
6138
|
-
return `\`${"█".repeat(t)}${"░".repeat(mr - t)}\` ${e.toFixed(1)}%`;
|
|
6402
|
+
function Z(e) {
|
|
6403
|
+
console.info(e);
|
|
6139
6404
|
}
|
|
6140
|
-
function
|
|
6405
|
+
function Wr(e) {
|
|
6406
|
+
let t = Mr.find((t) => e.startsWith(t.idPrefix));
|
|
6407
|
+
if (!t) throw Error(`Failed to locate module type configuration for identifier '${e}'.`);
|
|
6408
|
+
return t;
|
|
6409
|
+
}
|
|
6410
|
+
function Gr(e, t) {
|
|
6411
|
+
let n = e.repository, r = typeof n == "string" ? n : n?.url;
|
|
6412
|
+
if (r == null || r === "") throw Error(`package.json 'repository' field is required to ${t}.`);
|
|
6413
|
+
let i = r.replace(/^git\+/, "").replace(/\.git$/, ""), a = /github\.com[/:]([^/]+)\/([^/]+)$/.exec(i);
|
|
6414
|
+
if (a?.[1] == null || a[2] == null) throw Error(`Unable to parse GitHub owner/repo from '${r}'.`);
|
|
6141
6415
|
return {
|
|
6142
|
-
|
|
6143
|
-
|
|
6416
|
+
owner: a[1],
|
|
6417
|
+
repo: a[2]
|
|
6144
6418
|
};
|
|
6145
6419
|
}
|
|
6146
|
-
function
|
|
6147
|
-
|
|
6148
|
-
}
|
|
6149
|
-
function Fr(e) {
|
|
6150
|
-
return e < 1024 ? `${String(e)} B` : `${(e / 1024).toFixed(1)} kB`;
|
|
6420
|
+
async function Kr(e) {
|
|
6421
|
+
return await t.stat(e);
|
|
6151
6422
|
}
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
G("Document Dependencies");
|
|
6158
|
-
let t = await W("package.json");
|
|
6159
|
-
if (t.name === "@dpuse/dpuse-development" || t.name === "@dpuse/eslint-config-dpuse") {
|
|
6160
|
-
await Vr(t.name), K("Dependencies documented");
|
|
6161
|
-
return;
|
|
6162
|
-
}
|
|
6163
|
-
await Ln("1️⃣ Clear downloaded licenses", "licenses/downloads"), q("2️⃣ Identify production licenses"), await new Promise((n, r) => {
|
|
6164
|
-
let i = {
|
|
6165
|
-
start: process.cwd(),
|
|
6166
|
-
production: !0,
|
|
6167
|
-
json: !0,
|
|
6168
|
-
files: "licenses/downloads",
|
|
6169
|
-
relativeModulePath: !0,
|
|
6170
|
-
relativeLicensePath: !0,
|
|
6171
|
-
onlyAllow: e,
|
|
6172
|
-
excludePackages: t.name ?? "",
|
|
6173
|
-
out: "licenses/licenses.json"
|
|
6174
|
-
};
|
|
6175
|
-
c(i, (e) => {
|
|
6176
|
-
e == null ? n() : r(e);
|
|
6177
|
-
});
|
|
6178
|
-
}), await Bn("3️⃣ Identify transitive dependencies", "npm", [
|
|
6179
|
-
"ls",
|
|
6180
|
-
"--all",
|
|
6181
|
-
"--json",
|
|
6182
|
-
"--omit=dev"
|
|
6183
|
-
], "licenses/licenseTree.json"), await Hr("4️⃣ ", e), K("Dependencies documented");
|
|
6184
|
-
} catch (e) {
|
|
6185
|
-
console.error("❌ Error documenting dependencies", e), process.exit(1);
|
|
6423
|
+
async function qr(e, t, n) {
|
|
6424
|
+
switch (n.typeId) {
|
|
6425
|
+
case "connector": return await Xr(e, t);
|
|
6426
|
+
case "presenter": return await Zr(e, t);
|
|
6427
|
+
default: return await Qr(e, t);
|
|
6186
6428
|
}
|
|
6187
6429
|
}
|
|
6188
|
-
async function
|
|
6189
|
-
|
|
6430
|
+
async function Jr(e, t, n = "./") {
|
|
6431
|
+
if (Z(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
|
|
6432
|
+
else {
|
|
6433
|
+
let e = t.version, n = t.version.split(".");
|
|
6434
|
+
t.version = `${n[0] ?? "unknown"}.${n[1] ?? "unknown"}.${String(Number(n[2]) + 1)}`, console.info(`Project version bumped from '${e}' to '${t.version}'.`);
|
|
6435
|
+
}
|
|
6436
|
+
await Vr(`${n}package.json`, t);
|
|
6190
6437
|
}
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
await Wn(`${Rr}\n\n${a.trimEnd()}\n\n### Dependency Tree\n\n${s}`, Ir, Lr);
|
|
6438
|
+
function Yr(e) {
|
|
6439
|
+
let t = k.extend(jn()).parse(e, {
|
|
6440
|
+
ecmaVersion: "latest",
|
|
6441
|
+
sourceType: "module",
|
|
6442
|
+
locations: !0
|
|
6443
|
+
}), n = [];
|
|
6444
|
+
return ti(t, (e) => {
|
|
6445
|
+
if (e.type !== "MethodDefinition") return;
|
|
6446
|
+
let t = e, r = t.key;
|
|
6447
|
+
if (r.type !== "Identifier") return;
|
|
6448
|
+
let i = r.name;
|
|
6449
|
+
i && i !== "constructor" && t.accessibility !== "private" && n.push(i);
|
|
6450
|
+
}), n;
|
|
6205
6451
|
}
|
|
6206
|
-
function
|
|
6207
|
-
|
|
6452
|
+
async function Xr(e, t) {
|
|
6453
|
+
Z(`${e} Build connector project configuration`);
|
|
6454
|
+
let [n, r] = await Promise.all([J("config.json"), zr("src/index.ts")]), i = /* @__PURE__ */ Pn(hr, n);
|
|
6455
|
+
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
6456
|
+
let a = Yr(r);
|
|
6457
|
+
return await $r(t, n, a, yr(a));
|
|
6208
6458
|
}
|
|
6209
|
-
function
|
|
6210
|
-
|
|
6459
|
+
async function Zr(e, t) {
|
|
6460
|
+
Z(`${e} Build presenter project configuration`);
|
|
6461
|
+
let [n, r] = await Promise.all([J("config.json"), zr("src/index.ts")]), i = /* @__PURE__ */ Pn(Sr, n);
|
|
6462
|
+
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
6463
|
+
return await $r(t, n, Yr(r));
|
|
6211
6464
|
}
|
|
6212
|
-
function
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
repository: t.repository ?? `https://www.npmjs.com/package/${r}`,
|
|
6217
|
-
licenseTypes: t.licenses,
|
|
6218
|
-
installedVersion: i,
|
|
6219
|
-
author: t.publisher ?? "",
|
|
6220
|
-
latestVersion: "",
|
|
6221
|
-
latestPublishedDate: "",
|
|
6222
|
-
publishedDate: "",
|
|
6223
|
-
...t.licenseFile != null && { licenseFileLink: t.licenseFile }
|
|
6224
|
-
};
|
|
6465
|
+
async function Qr(e, t) {
|
|
6466
|
+
Z(`${e} Build project configuration`);
|
|
6467
|
+
let n = await J("config.json");
|
|
6468
|
+
return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await Br("logo.svg"), n.iconDark ??= await Br("logoDark.svg"), await Vr("config.json", n), n;
|
|
6225
6469
|
}
|
|
6226
|
-
async function
|
|
6227
|
-
|
|
6228
|
-
let n = await fetch(`https://registry.npmjs.org/${encodeURIComponent(e)}`);
|
|
6229
|
-
if (n.ok) {
|
|
6230
|
-
let e = await n.json(), r = new Map(Object.entries(e["dist-tags"] ?? {})), i = new Map(Object.entries(e.time ?? {})), a = r.get("latest") ?? "", o = i.get(t) ?? "";
|
|
6231
|
-
return {
|
|
6232
|
-
latestVersion: a,
|
|
6233
|
-
latestPublishedDate: a === t ? "" : i.get(a) ?? "",
|
|
6234
|
-
publishedDate: o
|
|
6235
|
-
};
|
|
6236
|
-
}
|
|
6237
|
-
} catch {}
|
|
6238
|
-
return {
|
|
6239
|
-
latestVersion: "",
|
|
6240
|
-
latestPublishedDate: "",
|
|
6241
|
-
publishedDate: ""
|
|
6242
|
-
};
|
|
6470
|
+
async function $r(e, t, n, r) {
|
|
6471
|
+
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 Vr("config.json", t), t;
|
|
6243
6472
|
}
|
|
6244
|
-
function
|
|
6245
|
-
let
|
|
6246
|
-
|
|
6473
|
+
function ei(e, t, n, r) {
|
|
6474
|
+
let i = e.indexOf(n), a = e.indexOf(r);
|
|
6475
|
+
if (i === -1 || a === -1) throw Error(`Markers ${n}-${r} not found in content.`);
|
|
6476
|
+
let o = t.trim();
|
|
6477
|
+
return `${e.slice(0, Math.max(0, i + n.length))}\n\n${o}\n\n${e.slice(Math.max(0, a))}`;
|
|
6247
6478
|
}
|
|
6248
|
-
function
|
|
6249
|
-
|
|
6250
|
-
for (let [
|
|
6251
|
-
|
|
6252
|
-
|
|
6479
|
+
function ti(e, t) {
|
|
6480
|
+
t(e);
|
|
6481
|
+
for (let [n, r] of Object.entries(e)) {
|
|
6482
|
+
if ([
|
|
6483
|
+
"loc",
|
|
6484
|
+
"range",
|
|
6485
|
+
"start",
|
|
6486
|
+
"end",
|
|
6487
|
+
"comments"
|
|
6488
|
+
].includes(n)) continue;
|
|
6489
|
+
let e = r;
|
|
6490
|
+
if (Array.isArray(e)) for (let n of e) {
|
|
6491
|
+
let e = n;
|
|
6492
|
+
e && typeof e.type == "string" && ti(e, t);
|
|
6493
|
+
}
|
|
6494
|
+
else e && typeof e == "object" && typeof e.type == "string" && ti(e, t);
|
|
6253
6495
|
}
|
|
6254
6496
|
}
|
|
6255
|
-
function Yr(e) {
|
|
6256
|
-
if (e == null) return "";
|
|
6257
|
-
let t = e.publishedDate ? Xr(e.publishedDate.split("T", 1)[0]) : "";
|
|
6258
|
-
if (e.latestVersion === "" || e.latestVersion === e.installedVersion) return t === "" ? "" : ` — ${t}`;
|
|
6259
|
-
let n = e.latestPublishedDate ? Xr(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `**latest**: ${e.latestVersion} ❗` : `**latest**: ${e.latestVersion} — ${n} ❗`;
|
|
6260
|
-
return t === "" ? ` — → ${r}` : ` — ${t} → ${r}`;
|
|
6261
|
-
}
|
|
6262
|
-
function Xr(e) {
|
|
6263
|
-
if (e == null || e === "") return "n/a";
|
|
6264
|
-
let t = e.split("T", 1)[0];
|
|
6265
|
-
if (t == null || t === "") return "n/a";
|
|
6266
|
-
let n = new Date(t), r = /* @__PURE__ */ new Date(), i = (r.getFullYear() - n.getFullYear()) * 12 + (r.getMonth() - n.getMonth());
|
|
6267
|
-
return r.getDate() < n.getDate() && --i, i === 0 ? `this month: ${t}` : i === 1 ? `**1 month** ago: ${t}` : i <= 6 ? `**${String(i)} months** ago: ${t}` : `**${String(i)} months** ago: ${t} ⚠️`;
|
|
6268
|
-
}
|
|
6269
6497
|
//#endregion
|
|
6270
|
-
//#region src/actions/
|
|
6271
|
-
|
|
6272
|
-
"Branch-Protection": 3,
|
|
6273
|
-
"Code-Review": 0,
|
|
6274
|
-
Contributors: 0
|
|
6275
|
-
}, ei = /* @__PURE__ */ new Set(["CII-Best-Practices"]), ti = "coverage/coverage-final.json", ni = "coverage/coverage-summary.json", ri = 80, ii = {
|
|
6276
|
-
actions: "GitHub Actions",
|
|
6277
|
-
"javascript-typescript": "JavaScript/TypeScript",
|
|
6278
|
-
rust: "Rust"
|
|
6279
|
-
}, ai = {
|
|
6280
|
-
A: "brightgreen",
|
|
6281
|
-
B: "green",
|
|
6282
|
-
C: "yellow",
|
|
6283
|
-
D: "orange",
|
|
6284
|
-
F: "red"
|
|
6285
|
-
}, oi = `${Mn}/health.json`, si = r(i);
|
|
6286
|
-
async function ci() {
|
|
6498
|
+
//#region src/actions/auditDependencies.ts
|
|
6499
|
+
async function ni() {
|
|
6287
6500
|
try {
|
|
6288
|
-
|
|
6289
|
-
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 } = qn(e, "document governance");
|
|
6290
|
-
q("4️⃣ Read security checks and settings");
|
|
6291
|
-
let o = await fi(i, a, e);
|
|
6292
|
-
q("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
|
|
6293
|
-
let [s, c] = await Promise.all([mi(`https://github.com/${i}/${a}`), hi(`github.com/${i}/${a}`)]);
|
|
6294
|
-
q("6️⃣ Insert governance content into 'README.md'"), await Wn(xi(i, a, _i(e), vi(t.firstCreatedAt), {
|
|
6295
|
-
coveragePercent: n,
|
|
6296
|
-
fallowHealth: r,
|
|
6297
|
-
securitySettings: o
|
|
6298
|
-
}, s, c), Zr, Qr), K("Governance documented");
|
|
6501
|
+
Y("Audit Dependencies"), await q("1️⃣ Check using 'npm audit'", "npm", ["audit"]), X("Dependencies audited");
|
|
6299
6502
|
} catch (e) {
|
|
6300
|
-
console.error("❌ Error
|
|
6503
|
+
console.error("❌ Error auditing dependencies", e), process.exit(1);
|
|
6301
6504
|
}
|
|
6302
6505
|
}
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6506
|
+
//#endregion
|
|
6507
|
+
//#region src/actions/buildProject.ts
|
|
6508
|
+
async function ri() {
|
|
6509
|
+
try {
|
|
6510
|
+
Y("Build Project"), await q("1️⃣ Bundle project", "vite", ["build"]), X("Project built");
|
|
6511
|
+
} catch (e) {
|
|
6512
|
+
console.error("❌ Error building project", e), process.exit(1);
|
|
6307
6513
|
}
|
|
6308
|
-
await U("1️⃣ Measure test coverage", "vitest", [
|
|
6309
|
-
"run",
|
|
6310
|
-
"--passWithNoTests",
|
|
6311
|
-
"--coverage"
|
|
6312
|
-
]);
|
|
6313
|
-
let t = await Hn(ni);
|
|
6314
|
-
return t === null ? void 0 : JSON.parse(t).total.lines.pct;
|
|
6315
6514
|
}
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6515
|
+
//#endregion
|
|
6516
|
+
//#region src/actions/checkConfigFiles.ts
|
|
6517
|
+
var ii = "@dpuse/dpuse-development/prettierrc", ai = "dpuse-development";
|
|
6518
|
+
async function oi() {
|
|
6519
|
+
try {
|
|
6520
|
+
Y("Check configuration files"), Z("1️⃣ Check individual files");
|
|
6521
|
+
let e = await J("config.json"), t = await J("package.json"), r = t.private === !0, i = Wr(e.id), a = n.dirname(o(import.meta.url));
|
|
6522
|
+
await Q(a, ".editorconfig"), await Q(a, ".gitattributes"), await Q(a, ".gitignore", [".gitignore_default"]), await Q(a, ".markdownlint.json"), await Q(a, ".ncurc.json"), await si(i, a), await Q(a, "LICENSE"), await li(i, a), await ui(i, a), await di(i, a), await pi(i, a), ci(i, t), await Q(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 fi(i, a), await Q(a, "SECURITY.md", [], (t) => t.replaceAll(ai, () => e.id))), X("Configuration files checked");
|
|
6523
|
+
} catch (e) {
|
|
6524
|
+
console.error("❌ Error checking configuration files", e), process.exit(1);
|
|
6320
6525
|
}
|
|
6321
|
-
await Bn("2️⃣ Measure code health", "fallow", [
|
|
6322
|
-
"health",
|
|
6323
|
-
"--report-only",
|
|
6324
|
-
"--format",
|
|
6325
|
-
"json",
|
|
6326
|
-
...t
|
|
6327
|
-
], oi), await Bn("3️⃣ Write code health report", "fallow", ["--format", "markdown"], Pn, !0);
|
|
6328
|
-
let n = await W(oi);
|
|
6329
|
-
return await di(n), n;
|
|
6330
6526
|
}
|
|
6331
|
-
async function
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
});
|
|
6527
|
+
async function si(e, t) {
|
|
6528
|
+
["github", "kb"].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is NOT required by this project") : [
|
|
6529
|
+
"app",
|
|
6530
|
+
"api",
|
|
6531
|
+
"development",
|
|
6532
|
+
"eslint"
|
|
6533
|
+
].includes(e.typeId) ? console.info("⚠️ File 'eslint.config.js' is UNIQUE to this project") : await Q(t, "eslint.config.js", ["eslint.config.default.js"]);
|
|
6339
6534
|
}
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
]
|
|
6351
|
-
return {
|
|
6352
|
-
codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) => ii[e] ?? e).toArray(),
|
|
6353
|
-
codeQLQueries: /queries: ([\w-]+)/.exec(i ?? "")?.[1],
|
|
6354
|
-
dependabotAlerts: c !== void 0,
|
|
6355
|
-
dependabotSecurityUpdates: d("dependabot_security_updates"),
|
|
6356
|
-
dependabotVersionUpdates: p > m,
|
|
6357
|
-
npmAuditInCI: /npm (?:run )?audit/.test(r ?? ""),
|
|
6358
|
-
npmAuditLevel: /npm audit --audit-level=(\w+)/.exec(r ?? "")?.[1],
|
|
6359
|
-
privateVulnerabilityReporting: s === void 0 ? void 0 : JSON.parse(s).enabled,
|
|
6360
|
-
propertyTests: n.devDependencies?.["fast-check"] != null,
|
|
6361
|
-
pushProtection: d("secret_scanning_push_protection"),
|
|
6362
|
-
secretScanning: d("secret_scanning"),
|
|
6363
|
-
socket: f.has("socket-security"),
|
|
6364
|
-
sonarCloud: f.has("sonarqubecloud"),
|
|
6365
|
-
testsInCI: r?.includes("npm test") ?? !1
|
|
6366
|
-
};
|
|
6535
|
+
function ci(e, t) {
|
|
6536
|
+
e.typeId === "development" ? console.info("ℹ️ File '.prettierrc.json' is the template") : e.typeId === "app" ? console.info("⚠️ File '.prettierrc.json' is UNIQUE to this project") : t.prettier === ii ? console.info(`ℹ️ Prettier configuration is '${ii}'`) : console.info(`❌ Prettier configuration is NOT '${ii}'`);
|
|
6537
|
+
}
|
|
6538
|
+
async function li(e, t) {
|
|
6539
|
+
["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.json' is NOT required by this project") : [
|
|
6540
|
+
"connector",
|
|
6541
|
+
"development",
|
|
6542
|
+
"engine",
|
|
6543
|
+
"shared",
|
|
6544
|
+
"tool"
|
|
6545
|
+
].includes(e.typeId) ? await Q(t, "tsconfig.json") : console.info("⚠️ File 'tsconfig.json' is UNIQUE to this project");
|
|
6367
6546
|
}
|
|
6368
|
-
async function
|
|
6547
|
+
async function ui(e, t) {
|
|
6548
|
+
["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.scripts.json' is NOT required by this project") : await Q(t, "tsconfig.scripts.json");
|
|
6549
|
+
}
|
|
6550
|
+
async function di(e, t) {
|
|
6551
|
+
if ([
|
|
6552
|
+
"eslint",
|
|
6553
|
+
"github",
|
|
6554
|
+
"kb"
|
|
6555
|
+
].includes(e.typeId)) console.info("ℹ️ File 'vite.config.ts' is NOT required by this project");
|
|
6556
|
+
else if ([
|
|
6557
|
+
"app",
|
|
6558
|
+
"api",
|
|
6559
|
+
"development",
|
|
6560
|
+
"engine",
|
|
6561
|
+
"shared"
|
|
6562
|
+
].includes(e.typeId)) console.info("⚠️ File 'vite.config.ts' is UNIQUE to this project");
|
|
6563
|
+
else {
|
|
6564
|
+
let n;
|
|
6565
|
+
n = e.typeId === "connector" ? ["vite.config.default.ts", "vite.config.wasm.ts"] : e.typeId === "tool" ? ["vite.config.tool.ts"] : ["vite.config.default.ts"], await Q(t, "vite.config.ts", n);
|
|
6566
|
+
}
|
|
6567
|
+
}
|
|
6568
|
+
async function fi(e, t) {
|
|
6569
|
+
await Q(t, ".github/workflows/ci.yml"), await Q(t, ".github/workflows/codeql.yml"), await Q(t, ".github/workflows/publish.yml", [e.publishedTo === "npm" ? ".github/workflows/publish.yml" : ".github/publish.cloudflare.yml"]), await Q(t, ".github/workflows/scorecard.yml");
|
|
6570
|
+
}
|
|
6571
|
+
async function pi(e, t) {
|
|
6572
|
+
[
|
|
6573
|
+
"app",
|
|
6574
|
+
"api",
|
|
6575
|
+
"eslint",
|
|
6576
|
+
"github",
|
|
6577
|
+
"kb"
|
|
6578
|
+
].includes(e.typeId) ? console.info("ℹ️ File 'vitest.config.ts' is NOT required by this project") : await Q(t, "vitest.config.ts");
|
|
6579
|
+
}
|
|
6580
|
+
async function Q(e, t, r = [], i = (e) => e) {
|
|
6581
|
+
let a = n.resolve(process.cwd(), t), o = r.length > 0 ? r : [t], s;
|
|
6369
6582
|
try {
|
|
6370
|
-
|
|
6371
|
-
return t;
|
|
6583
|
+
s = await zr(a);
|
|
6372
6584
|
} catch (e) {
|
|
6373
|
-
if (
|
|
6374
|
-
|
|
6585
|
+
if (e.code !== "ENOENT") throw e;
|
|
6586
|
+
}
|
|
6587
|
+
if (s === void 0) {
|
|
6588
|
+
console.info(`❌ File '${t}' is MISSING`);
|
|
6589
|
+
return;
|
|
6590
|
+
}
|
|
6591
|
+
for (let r of o) {
|
|
6592
|
+
let a = i(await zr(n.resolve(e, `../${r}`)));
|
|
6593
|
+
if (s === a) {
|
|
6594
|
+
console.info(`ℹ️ File '${t}' is the same as '${r}'`);
|
|
6595
|
+
return;
|
|
6596
|
+
}
|
|
6375
6597
|
}
|
|
6598
|
+
console.info(`❌ File '${t}' is NOT the same`);
|
|
6376
6599
|
}
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6600
|
+
//#endregion
|
|
6601
|
+
//#region src/actions/checkDependencies.ts
|
|
6602
|
+
async function mi() {
|
|
6603
|
+
try {
|
|
6604
|
+
Y("Check Dependencies"), await q("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), Z("2️⃣ Check using 'npm-check-updates'");
|
|
6605
|
+
let e = {};
|
|
6606
|
+
try {
|
|
6607
|
+
e = await J(n.resolve(process.cwd(), ".ncurc.json"));
|
|
6608
|
+
} catch (e) {
|
|
6609
|
+
if (e.code !== "ENOENT") throw e;
|
|
6610
|
+
}
|
|
6611
|
+
await s({
|
|
6612
|
+
interactive: !0,
|
|
6613
|
+
upgrade: !0,
|
|
6614
|
+
dep: "dev,prod,peer,optional",
|
|
6615
|
+
install: "never",
|
|
6616
|
+
...e
|
|
6617
|
+
}), await q("3️⃣ Install updated dependencies", "npm", [
|
|
6618
|
+
"install",
|
|
6619
|
+
"--prefer-online",
|
|
6620
|
+
"--no-strict-allow-scripts"
|
|
6621
|
+
]);
|
|
6622
|
+
let t = await hi();
|
|
6623
|
+
t.length > 0 ? await q("4️⃣ Move install-script pins to installed versions", "npm", [
|
|
6624
|
+
"install-scripts",
|
|
6625
|
+
"approve",
|
|
6626
|
+
...t
|
|
6627
|
+
]) : Z("4️⃣ No pinned install-script approvals to move"), process.platform === "darwin" ? await q("5️⃣ Remove unused install-script entries", "npm", ["install-scripts", "prune"]) : Z("5️⃣ Skipped removing unused install-script entries (macOS only)"), t.length > 0 && await q("6️⃣ Run install scripts skipped in step 3", "npm", [
|
|
6628
|
+
"rebuild",
|
|
6629
|
+
...t,
|
|
6630
|
+
"--no-strict-allow-scripts"
|
|
6631
|
+
]), await q("7️⃣ Confirm every install script is reviewed", "npm", ["install", "--strict-allow-scripts"]), X("Dependencies checked");
|
|
6632
|
+
} catch (e) {
|
|
6633
|
+
console.error("❌ Error checking dependencies", e), process.exit(1);
|
|
6634
|
+
}
|
|
6381
6635
|
}
|
|
6382
|
-
async function hi(
|
|
6383
|
-
let
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6636
|
+
async function hi() {
|
|
6637
|
+
let { allowScripts: e = {} } = await J(n.resolve(process.cwd(), "package.json")), t = Object.entries(e).filter(([e, t]) => t && e.lastIndexOf("@") > 0).map(([e]) => e.slice(0, e.lastIndexOf("@")));
|
|
6638
|
+
return [...new Set(t)];
|
|
6639
|
+
}
|
|
6640
|
+
//#endregion
|
|
6641
|
+
//#region src/actions/checkProject.ts
|
|
6642
|
+
async function gi() {
|
|
6643
|
+
await oi(), await mi();
|
|
6644
|
+
}
|
|
6645
|
+
//#endregion
|
|
6646
|
+
//#region src/actions/documentActions.ts
|
|
6647
|
+
var _i = "<!-- CONNECTOR_ACTIONS_START -->", vi = "<!-- CONNECTOR_ACTIONS_END -->", yi = "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.", bi = {
|
|
6648
|
+
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.",
|
|
6649
|
+
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.",
|
|
6650
|
+
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.",
|
|
6651
|
+
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."
|
|
6652
|
+
}, xi = "The table below lists all connector actions and highlights those supported by this connector.";
|
|
6653
|
+
async function Si() {
|
|
6654
|
+
try {
|
|
6655
|
+
Y("Document Actions"), Z("1️⃣ Insert actions description and table into 'README.md'");
|
|
6656
|
+
let e = (await J("config.json")).actionNames ?? [], t = yr(e), n = br(e);
|
|
6657
|
+
await Hr(`${yi}\n\n${bi[t]} ${xi}\n\n${n}`, _i, vi), X("Actions documented");
|
|
6658
|
+
} catch (e) {
|
|
6659
|
+
console.error("❌ Error documenting actions", e), process.exit(1);
|
|
6387
6660
|
}
|
|
6388
6661
|
}
|
|
6389
|
-
|
|
6390
|
-
|
|
6662
|
+
//#endregion
|
|
6663
|
+
//#region src/actions/documentContributingLicense.ts
|
|
6664
|
+
async function Ci() {
|
|
6665
|
+
try {
|
|
6666
|
+
Y("Document Contributing & License");
|
|
6667
|
+
let [e, t] = await Promise.all([J("package.json"), J("config.json")]), { owner: n, repo: r } = Gr(e, "document contributing and license"), i = wi(e), a = Ti(t.firstCreatedAt);
|
|
6668
|
+
Z("1️⃣ Insert contributing and license content into 'README.md'"), await Rr(), await Hr(Ei(n, r, i, a), Dr, Er), X("Contributing & license documented");
|
|
6669
|
+
} catch (e) {
|
|
6670
|
+
console.error("❌ Error documenting contributing and license", e), process.exit(1);
|
|
6671
|
+
}
|
|
6391
6672
|
}
|
|
6392
|
-
function
|
|
6673
|
+
function wi(e) {
|
|
6393
6674
|
let t = e.author, n = typeof t == "string" ? t : t?.name;
|
|
6394
|
-
if (n == null || n === "") throw Error("package.json 'author' field is required to document
|
|
6675
|
+
if (n == null || n === "") throw Error("package.json 'author' field is required to document contributing and license.");
|
|
6395
6676
|
let r = n.indexOf("<"), i = r === -1 ? -1 : n.indexOf(">", r);
|
|
6396
6677
|
return i === -1 ? n.trim() : [n.slice(0, r).trim(), n.slice(i + 1).trim()].filter((e) => e !== "").join(" ");
|
|
6397
6678
|
}
|
|
6398
|
-
function
|
|
6679
|
+
function Ti(e) {
|
|
6399
6680
|
let t = (/* @__PURE__ */ new Date()).getFullYear();
|
|
6400
6681
|
if (e == null) return String(t);
|
|
6401
6682
|
let n = new Date(e).getFullYear();
|
|
6402
6683
|
return n === t ? String(t) : `${String(n)}-present`;
|
|
6403
6684
|
}
|
|
6404
|
-
function
|
|
6405
|
-
return
|
|
6406
|
-
}
|
|
6407
|
-
function yi(e, t) {
|
|
6408
|
-
return t.length === 0 ? "" : `### ${e}
|
|
6409
|
-
|
|
6410
|
-
|Check or setting|Status|What it does|
|
|
6411
|
-
|:-|:-|:-|
|
|
6412
|
-
${t.map((e) => `|${e.join("|")}|`).join("\n")}
|
|
6413
|
-
|
|
6414
|
-
`;
|
|
6415
|
-
}
|
|
6416
|
-
function bi(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
|
|
6417
|
-
let a = `https://github.com/${e}/${t}`, o = [[
|
|
6418
|
-
`[SonarCloud](https://sonarcloud.io/summary/new_code?id=${e}_${t})`,
|
|
6419
|
-
Y(i.sonarCloud),
|
|
6420
|
-
"Code quality and security analysis on every push: bugs, code smells and vulnerabilities."
|
|
6421
|
-
]];
|
|
6422
|
-
if (r !== void 0) {
|
|
6423
|
-
let { score: e, grade: t } = r.health_score;
|
|
6424
|
-
o.unshift([
|
|
6425
|
-
`[Fallow](./${Pn})`,
|
|
6426
|
-
`✅ ${t} (${String(Math.round(e))})`,
|
|
6427
|
-
"Unused code, duplication, complexity and dependency hygiene."
|
|
6428
|
-
]);
|
|
6429
|
-
}
|
|
6430
|
-
let s = i.codeQLQueries === "security-extended" ? "using the extended security queries" : "using the default queries", c = [
|
|
6431
|
-
[
|
|
6432
|
-
`[CodeQL](${a}/security/code-scanning)`,
|
|
6433
|
-
Y(i.codeQLLanguages.length > 0, i.codeQLLanguages.join(", ")),
|
|
6434
|
-
`Static analysis for security vulnerabilities, ${s}, on every push and pull request to \`main\` and weekly.`
|
|
6435
|
-
],
|
|
6436
|
-
[
|
|
6437
|
-
"Secret scanning",
|
|
6438
|
-
Y(i.secretScanning),
|
|
6439
|
-
"Detects credentials, such as API keys and tokens, committed to the repository."
|
|
6440
|
-
],
|
|
6441
|
-
[
|
|
6442
|
-
"Push protection",
|
|
6443
|
-
Y(i.pushProtection),
|
|
6444
|
-
"Blocks pushes that contain credentials."
|
|
6445
|
-
]
|
|
6446
|
-
], l = [[
|
|
6447
|
-
"Unit tests",
|
|
6448
|
-
Y(i.testsInCI),
|
|
6449
|
-
"Run in CI on every push to `main`."
|
|
6450
|
-
], [
|
|
6451
|
-
"Property-based tests",
|
|
6452
|
-
Y(i.propertyTests, "fast-check"),
|
|
6453
|
-
"Fuzz testing: many random inputs per test to find edge cases, run with the unit tests."
|
|
6454
|
-
]];
|
|
6455
|
-
if (n !== void 0) {
|
|
6456
|
-
let e = n >= ri ? "✅" : "⚠️";
|
|
6457
|
-
l.push([
|
|
6458
|
-
"Test coverage",
|
|
6459
|
-
`${e} ${n.toFixed(1)}% of lines`,
|
|
6460
|
-
`Share of source lines the unit tests run. The target is ${String(ri)}%.`
|
|
6461
|
-
]);
|
|
6462
|
-
}
|
|
6463
|
-
let u = [
|
|
6464
|
-
[
|
|
6465
|
-
"npm audit",
|
|
6466
|
-
Y(i.npmAuditInCI),
|
|
6467
|
-
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.`
|
|
6468
|
-
],
|
|
6469
|
-
[
|
|
6470
|
-
"[Socket.dev](https://socket.dev)",
|
|
6471
|
-
Y(i.socket),
|
|
6472
|
-
"Flags supply chain risk in dependencies: malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE."
|
|
6473
|
-
],
|
|
6474
|
-
[
|
|
6475
|
-
"Dependabot alerts",
|
|
6476
|
-
Y(i.dependabotAlerts),
|
|
6477
|
-
"Alerts when a dependency has a known vulnerability, using the GitHub Advisory Database."
|
|
6478
|
-
],
|
|
6479
|
-
[
|
|
6480
|
-
"Dependabot security updates",
|
|
6481
|
-
Y(i.dependabotSecurityUpdates),
|
|
6482
|
-
"Opens pull requests that update vulnerable dependencies."
|
|
6483
|
-
],
|
|
6484
|
-
[
|
|
6485
|
-
"Dependabot version updates",
|
|
6486
|
-
Y(i.dependabotVersionUpdates),
|
|
6487
|
-
"Opens pull requests for new dependency versions."
|
|
6488
|
-
]
|
|
6489
|
-
];
|
|
6490
|
-
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.
|
|
6491
|
-
|
|
6492
|
-
${yi("Testing", l)}${yi("Code Quality", o)}${yi("Security Analysis", c)}${yi("Dependencies", u)}`;
|
|
6493
|
-
}
|
|
6494
|
-
function xi(e, t, n, r, i, a, o) {
|
|
6495
|
-
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.";
|
|
6496
|
-
return `## Quality & Security
|
|
6497
|
-
|
|
6498
|
-
${bi(e, t, i)}### OpenSSF 🚧
|
|
6499
|
-
|
|
6500
|
-
${d}[](https://scorecard.dev/viewer/?uri=${c})
|
|
6501
|
-
|
|
6502
|
-
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}
|
|
6503
|
-
|
|
6504
|
-
### Reporting Vulnerabilities
|
|
6505
|
-
|
|
6506
|
-
Please do not open public GitHub issues for security vulnerabilities. ${f}
|
|
6507
|
-
|
|
6508
|
-
## Contributing
|
|
6685
|
+
function Ei(e, t, n, r) {
|
|
6686
|
+
return `## Contributing
|
|
6509
6687
|
|
|
6510
6688
|
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.
|
|
6511
6689
|
|
|
6512
|
-
For security vulnerabilities, see [Reporting Vulnerabilities](#reporting-vulnerabilities). For bugs, inconsistencies, or other feedback, [open a GitHub issue](${
|
|
6690
|
+
For security vulnerabilities, see [Reporting Vulnerabilities](#reporting-vulnerabilities). For bugs, inconsistencies, or other feedback, [open a GitHub issue](${`https://github.com/${e}/${t}`}/issues) — feedback is read, but responses and fixes are at the maintainer's discretion.
|
|
6513
6691
|
|
|
6514
6692
|
## License
|
|
6515
6693
|
|
|
@@ -6518,574 +6696,484 @@ This project is licensed under the MIT License, permitting free use, modificatio
|
|
|
6518
6696
|
[MIT](./LICENSE) © ${r} ${n}`;
|
|
6519
6697
|
}
|
|
6520
6698
|
//#endregion
|
|
6521
|
-
//#region
|
|
6522
|
-
var
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6699
|
+
//#region src/actions/documentDependencies.ts
|
|
6700
|
+
var Di = "<!-- DEPENDENCY_LICENSES_START -->", Oi = "<!-- DEPENDENCY_LICENSES_END -->", ki = "## Dependency Licenses", Ai = "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.";
|
|
6701
|
+
async function ji(e = "MIT") {
|
|
6702
|
+
try {
|
|
6703
|
+
Y("Document Dependencies");
|
|
6704
|
+
let t = await J("package.json");
|
|
6705
|
+
if (t.name === "@dpuse/dpuse-development" || t.name === "@dpuse/eslint-config-dpuse") {
|
|
6706
|
+
await Mi(t.name), X("Dependencies documented");
|
|
6707
|
+
return;
|
|
6708
|
+
}
|
|
6709
|
+
await Pr("1️⃣ Clear downloaded licenses", "licenses/downloads"), Z("2️⃣ Identify production licenses"), await new Promise((n, r) => {
|
|
6710
|
+
let i = {
|
|
6711
|
+
start: process.cwd(),
|
|
6712
|
+
production: !0,
|
|
6713
|
+
json: !0,
|
|
6714
|
+
files: "licenses/downloads",
|
|
6715
|
+
relativeModulePath: !0,
|
|
6716
|
+
relativeLicensePath: !0,
|
|
6717
|
+
onlyAllow: e,
|
|
6718
|
+
excludePackages: t.name ?? "",
|
|
6719
|
+
out: "licenses/licenses.json"
|
|
6720
|
+
};
|
|
6721
|
+
c(i, (e) => {
|
|
6722
|
+
e == null ? n() : r(e);
|
|
6723
|
+
});
|
|
6724
|
+
}), await Lr("3️⃣ Identify transitive dependencies", "npm", [
|
|
6725
|
+
"ls",
|
|
6726
|
+
"--all",
|
|
6727
|
+
"--json",
|
|
6728
|
+
"--omit=dev"
|
|
6729
|
+
], "licenses/licenseTree.json"), await Ni("4️⃣ ", e), X("Dependencies documented");
|
|
6730
|
+
} catch (e) {
|
|
6731
|
+
console.error("❌ Error documenting dependencies", e), process.exit(1);
|
|
6732
|
+
}
|
|
6536
6733
|
}
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
let t = typeof e;
|
|
6540
|
-
return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
|
|
6734
|
+
async function Mi(e) {
|
|
6735
|
+
Z(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`), await Hr(`${ki}\n\n${`> [!WARNING]\n> Dependency licenses are not documented here: ${e} is a development-only tool and is never part of a production release.`}`, Di, Oi);
|
|
6541
6736
|
}
|
|
6542
|
-
function
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
}, l = e.kind === "schema", u = i?.message ?? e.message ?? (e.reference, c.lang, void 0) ?? (l ? (c.lang, void 0) : null) ?? r.message ?? (c.lang, void 0);
|
|
6557
|
-
u !== void 0 && (c.message = typeof u == "function" ? u(c) : u), l && (n.typed = !1), n.issues ? n.issues.push(c) : n.issues = [c];
|
|
6737
|
+
async function Ni(e, t) {
|
|
6738
|
+
Z(`${e} Insert licenses into 'README.md'`);
|
|
6739
|
+
let [n, r] = await Promise.all([J("licenses/licenses.json"), J("licenses/licenseTree.json")]), i = /* @__PURE__ */ new Map();
|
|
6740
|
+
for (let [e, t] of Object.entries(n)) i.set(e, Ii(e, t));
|
|
6741
|
+
await Promise.all(i.values().map(async (e) => {
|
|
6742
|
+
let t = await Li(e.name, e.installedVersion);
|
|
6743
|
+
e.latestVersion = t.latestVersion, e.latestPublishedDate = t.latestPublishedDate, e.publishedDate = t.publishedDate;
|
|
6744
|
+
}));
|
|
6745
|
+
let a = `${Pi(t)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
|
|
6746
|
+
for (let e of i.values()) a += Ri(e);
|
|
6747
|
+
let o = [];
|
|
6748
|
+
r.dependencies != null && zi(r.dependencies, i, o, 0);
|
|
6749
|
+
let s = `${Ai}\n\n${o.join("\n")}`;
|
|
6750
|
+
await Hr(`${ki}\n\n${a.trimEnd()}\n\n### Dependency Tree\n\n${s}`, Di, Oi);
|
|
6558
6751
|
}
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
return e === t || Number.isNaN(e) && Number.isNaN(t);
|
|
6752
|
+
function Pi(e) {
|
|
6753
|
+
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 ${Fi(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.`;
|
|
6562
6754
|
}
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
return Object.prototype.hasOwnProperty.call(e, t) && t !== "__proto__" && t !== "prototype" && t !== "constructor";
|
|
6755
|
+
function Fi(e) {
|
|
6756
|
+
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))}`;
|
|
6566
6757
|
}
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6758
|
+
function Ii(e, t) {
|
|
6759
|
+
let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
|
|
6760
|
+
return {
|
|
6761
|
+
name: r,
|
|
6762
|
+
repository: t.repository ?? `https://www.npmjs.com/package/${r}`,
|
|
6763
|
+
licenseTypes: t.licenses,
|
|
6764
|
+
installedVersion: i,
|
|
6765
|
+
author: t.publisher ?? "",
|
|
6766
|
+
latestVersion: "",
|
|
6767
|
+
latestPublishedDate: "",
|
|
6768
|
+
publishedDate: "",
|
|
6769
|
+
...t.licenseFile != null && { licenseFileLink: t.licenseFile }
|
|
6770
|
+
};
|
|
6571
6771
|
}
|
|
6572
|
-
function
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6772
|
+
async function Li(e, t) {
|
|
6773
|
+
try {
|
|
6774
|
+
let n = await fetch(`https://registry.npmjs.org/${encodeURIComponent(e)}`);
|
|
6775
|
+
if (n.ok) {
|
|
6776
|
+
let e = await n.json(), r = new Map(Object.entries(e["dist-tags"] ?? {})), i = new Map(Object.entries(e.time ?? {})), a = r.get("latest") ?? "", o = i.get(t) ?? "";
|
|
6777
|
+
return {
|
|
6778
|
+
latestVersion: a,
|
|
6779
|
+
latestPublishedDate: a === t ? "" : i.get(a) ?? "",
|
|
6780
|
+
publishedDate: o
|
|
6781
|
+
};
|
|
6782
|
+
}
|
|
6783
|
+
} catch {}
|
|
6784
|
+
return {
|
|
6785
|
+
latestVersion: "",
|
|
6786
|
+
latestPublishedDate: "",
|
|
6787
|
+
publishedDate: ""
|
|
6788
|
+
};
|
|
6578
6789
|
}
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
return
|
|
6790
|
+
function Ri(e) {
|
|
6791
|
+
let t = e.licenseFileLink == null || e.licenseFileLink === "" ? "⚠️ No license file" : `[LICENSE](licenses/${e.licenseFileLink})`;
|
|
6792
|
+
return `|[${e.name}](${e.repository})|${e.installedVersion}|${e.licenseTypes}|${t}|\n`;
|
|
6582
6793
|
}
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6794
|
+
function zi(e, t, n, r) {
|
|
6795
|
+
let i = " ".repeat(r);
|
|
6796
|
+
for (let [a, o] of Object.entries(e)) {
|
|
6797
|
+
let e = o.version ?? "", s = t.get(`${a}@${e}`), c = s == null ? a : `[${a}](${s.repository})`, l = Bi(s);
|
|
6798
|
+
n.push(`${i}- **${c}** ${e}${l}`), o.dependencies != null && zi(o.dependencies, t, n, r + 1);
|
|
6799
|
+
}
|
|
6586
6800
|
}
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
expects: "Array",
|
|
6594
|
-
async: !1,
|
|
6595
|
-
item: e,
|
|
6596
|
-
message: t,
|
|
6597
|
-
"~run"(e, t) {
|
|
6598
|
-
let n = e.value;
|
|
6599
|
-
if (Array.isArray(n)) {
|
|
6600
|
-
e.typed = !0, e.value = [];
|
|
6601
|
-
for (let r = 0; r < n.length; r++) {
|
|
6602
|
-
let i = n[r], a = this.item["~run"]({ value: i }, t);
|
|
6603
|
-
if (a.issues) {
|
|
6604
|
-
let o = {
|
|
6605
|
-
type: "array",
|
|
6606
|
-
origin: "value",
|
|
6607
|
-
input: n,
|
|
6608
|
-
key: r,
|
|
6609
|
-
value: i
|
|
6610
|
-
};
|
|
6611
|
-
for (let t of a.issues) t.path ? t.path.unshift(o) : t.path = [o], e.issues?.push(t);
|
|
6612
|
-
if (e.issues ||= a.issues, t.abortEarly) {
|
|
6613
|
-
e.typed = !1;
|
|
6614
|
-
break;
|
|
6615
|
-
}
|
|
6616
|
-
}
|
|
6617
|
-
a.typed || (e.typed = !1), e.value.push(a.value);
|
|
6618
|
-
}
|
|
6619
|
-
} else X(this, "type", e, t);
|
|
6620
|
-
return e;
|
|
6621
|
-
}
|
|
6622
|
-
});
|
|
6801
|
+
function Bi(e) {
|
|
6802
|
+
if (e == null) return "";
|
|
6803
|
+
let t = e.publishedDate ? Vi(e.publishedDate.split("T", 1)[0]) : "";
|
|
6804
|
+
if (e.latestVersion === "" || e.latestVersion === e.installedVersion) return t === "" ? "" : ` — ${t}`;
|
|
6805
|
+
let n = e.latestPublishedDate ? Vi(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `**latest**: ${e.latestVersion} ❗` : `**latest**: ${e.latestVersion} — ${n} ❗`;
|
|
6806
|
+
return t === "" ? ` — → ${r}` : ` — ${t} → ${r}`;
|
|
6623
6807
|
}
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
expects: "boolean",
|
|
6631
|
-
async: !1,
|
|
6632
|
-
message: e,
|
|
6633
|
-
"~run"(e, t) {
|
|
6634
|
-
return typeof e.value == "boolean" ? e.typed = !0 : X(this, "type", e, t), e;
|
|
6635
|
-
}
|
|
6636
|
-
});
|
|
6808
|
+
function Vi(e) {
|
|
6809
|
+
if (e == null || e === "") return "n/a";
|
|
6810
|
+
let t = e.split("T", 1)[0];
|
|
6811
|
+
if (t == null || t === "") return "n/a";
|
|
6812
|
+
let n = new Date(t), r = /* @__PURE__ */ new Date(), i = (r.getFullYear() - n.getFullYear()) * 12 + (r.getMonth() - n.getMonth());
|
|
6813
|
+
return r.getDate() < n.getDate() && --i, i === 0 ? `this month: ${t}` : i === 1 ? `**1 month** ago: ${t}` : i <= 6 ? `**${String(i)} months** ago: ${t}` : `**${String(i)} months** ago: ${t} ⚠️`;
|
|
6637
6814
|
}
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
return /* @__PURE__ */ Ti(e.value, this.literal) ? e.typed = !0 : X(this, "type", e, t), e;
|
|
6650
|
-
}
|
|
6651
|
-
});
|
|
6815
|
+
//#endregion
|
|
6816
|
+
//#region src/actions/documentOpening.ts
|
|
6817
|
+
var Hi = "<!-- OPENING_START -->", Ui = "<!-- OPENING_END -->";
|
|
6818
|
+
async function Wi() {
|
|
6819
|
+
try {
|
|
6820
|
+
Y("Document Opening"), Z("1️⃣ Insert opening content into 'README.md'");
|
|
6821
|
+
let e = await J("package.json"), t = await J("config.json"), { owner: n, repo: r } = Gr(e, "document opening"), i = Gi(e), a = Ki(t);
|
|
6822
|
+
await Hr(qi(n, r, i, e.description, a, e.devDependencies?.fallow != null), Hi, Ui), X("Opening documented");
|
|
6823
|
+
} catch (e) {
|
|
6824
|
+
console.error("❌ Error documenting opening", e), process.exit(1);
|
|
6825
|
+
}
|
|
6652
6826
|
}
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
type: "nullable",
|
|
6658
|
-
reference: Z,
|
|
6659
|
-
expects: `(${e.expects} | null)`,
|
|
6660
|
-
async: !1,
|
|
6661
|
-
wrapped: e,
|
|
6662
|
-
default: t,
|
|
6663
|
-
"~run"(e, t) {
|
|
6664
|
-
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);
|
|
6665
|
-
}
|
|
6666
|
-
});
|
|
6827
|
+
function Gi(e) {
|
|
6828
|
+
let t = e.license;
|
|
6829
|
+
if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
|
|
6830
|
+
return t;
|
|
6667
6831
|
}
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
return
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6832
|
+
function Ki(e) {
|
|
6833
|
+
let t = e.description.en, n = (Array.isArray(t) ? t : [t]).filter((e) => typeof e == "string" && e !== "");
|
|
6834
|
+
return n.length === 0 ? void 0 : n.join("\n\n");
|
|
6835
|
+
}
|
|
6836
|
+
function qi(e, t, n, r, i, a) {
|
|
6837
|
+
let o = `https://github.com/${e}/${t}`, s = n.replaceAll("-", "--"), c = encodeURIComponent(`https://raw.githubusercontent.com/${e}/${t}/main/${wr}`), l = r == null || r === "" ? "" : `\n\n${r}`, u = i === void 0 ? "" : `\n\n## Introduction\n\n${i}`;
|
|
6838
|
+
return `[](./LICENSE)
|
|
6839
|
+
[](${o}/releases/latest)
|
|
6840
|
+
[](${o}/actions/workflows/ci.yml)
|
|
6841
|
+
[](${o}/actions/workflows/codeql.yml)
|
|
6842
|
+
${a ? `[](./${Tr})\n` : ""}[](https://sonarcloud.io/summary/new_code?id=${e}_${t})
|
|
6843
|
+
|
|
6844
|
+
[DPUse](https://www.dpuse.app) · [Report a Vulnerability](${o}/security/advisories/new) · [Open an Issue](${o}/issues)${l}
|
|
6845
|
+
|
|
6846
|
+
## About DPUse
|
|
6847
|
+
|
|
6848
|
+
DPUse (Data Positioning & Use) is an in-browser application that positions your data for use through three core activities: sourcing, contextualising, and publishing.
|
|
6849
|
+
|
|
6850
|
+
**Sourcing** uses a library of [Connectors](https://www.dpuse.app/connectors) to establish [Connections](https://www.dpuse.app) to applications, databases, file stores, and curated datasets; these connections are subsequently used to configure structured [Data Views](https://www.dpuse.app) from the underlying sources.
|
|
6851
|
+
|
|
6852
|
+
**Contextualising** extracts chronological events from those [Data Views](https://www.dpuse.app) and maps them into comprehensive [Context Models](https://www.dpuse.app). This gives the DPUse Engine the structural framework needed to generate deterministic transactions, facts, or observations.
|
|
6853
|
+
|
|
6854
|
+
**Publishing** uses a library of [Presenters](https://www.dpuse.app) to render standard [Presentations](https://www.dpuse.app) immediately using the contextualised data; additionally, [Cookbooks](https://www.dpuse.app) of [Recipes](https://www.dpuse.app) let you build Data Apps using your preferred tools.
|
|
6855
|
+
|
|
6856
|
+
In addition, DPUse provides [Tools](https://www.dpuse.app) used by the application, and you can use them to construct connectors and presenters.${u}`;
|
|
6681
6857
|
}
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6858
|
+
//#endregion
|
|
6859
|
+
//#region src/actions/documentQualitySecurity.ts
|
|
6860
|
+
var Ji = {
|
|
6861
|
+
"Branch-Protection": 3,
|
|
6862
|
+
"Code-Review": 0,
|
|
6863
|
+
Contributors: 0
|
|
6864
|
+
}, Yi = /* @__PURE__ */ new Set(["CII-Best-Practices"]), Xi = "coverage/coverage-final.json", Zi = "coverage/coverage-summary.json", Qi = 80, $i = {
|
|
6865
|
+
actions: "GitHub Actions",
|
|
6866
|
+
"javascript-typescript": "JavaScript/TypeScript",
|
|
6867
|
+
rust: "Rust"
|
|
6868
|
+
}, ea = {
|
|
6869
|
+
A: "brightgreen",
|
|
6870
|
+
B: "green",
|
|
6871
|
+
C: "yellow",
|
|
6872
|
+
D: "orange",
|
|
6873
|
+
F: "red"
|
|
6874
|
+
}, ta = `${Cr}/health.json`, na = r(i);
|
|
6875
|
+
async function ra() {
|
|
6876
|
+
try {
|
|
6877
|
+
Y("Document Quality & Security");
|
|
6878
|
+
let e = await J("package.json"), t = await ia(e), n = await aa(e, t === void 0 ? [] : ["--coverage", Xi]), { owner: r, repo: i } = Gr(e, "document quality and security");
|
|
6879
|
+
Z("4️⃣ Read security checks and settings");
|
|
6880
|
+
let a = await sa(r, i, e);
|
|
6881
|
+
Z("5️⃣ Look up OpenSSF Best Practices badge and Scorecard results");
|
|
6882
|
+
let [o, s] = await Promise.all([la(`https://github.com/${r}/${i}`), ua(`github.com/${r}/${i}`)]);
|
|
6883
|
+
Z("6️⃣ Insert quality and security content into 'README.md'");
|
|
6884
|
+
let c = ma(r, i, {
|
|
6885
|
+
coveragePercent: t,
|
|
6886
|
+
fallowHealth: n,
|
|
6887
|
+
securitySettings: a
|
|
6888
|
+
}, o, s);
|
|
6889
|
+
await Rr(), await Hr(c, jr, Ar), X("Quality & security documented");
|
|
6890
|
+
} catch (e) {
|
|
6891
|
+
console.error("❌ Error documenting quality and security", e), process.exit(1);
|
|
6892
|
+
}
|
|
6696
6893
|
}
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
origin: "value",
|
|
6733
|
-
input: n,
|
|
6734
|
-
key: r,
|
|
6735
|
-
value: i
|
|
6736
|
-
};
|
|
6737
|
-
for (let t of o.issues) t.path ? t.path.unshift(a) : t.path = [a], e.issues?.push(t);
|
|
6738
|
-
if (e.issues ||= o.issues, t.abortEarly) {
|
|
6739
|
-
e.typed = !1;
|
|
6740
|
-
break;
|
|
6741
|
-
}
|
|
6742
|
-
}
|
|
6743
|
-
(!a.typed || !o.typed) && (e.typed = !1), a.typed && (e.value[a.value] = o.value);
|
|
6744
|
-
}
|
|
6745
|
-
} else X(this, "type", e, t);
|
|
6746
|
-
return e;
|
|
6747
|
-
}
|
|
6894
|
+
async function ia(e) {
|
|
6895
|
+
if (e.devDependencies?.["@vitest/coverage-v8"] == null) {
|
|
6896
|
+
Z("1️⃣ Test coverage NOT measured, as '@vitest/coverage-v8' is not installed");
|
|
6897
|
+
return;
|
|
6898
|
+
}
|
|
6899
|
+
await q("1️⃣ Measure test coverage", "vitest", [
|
|
6900
|
+
"run",
|
|
6901
|
+
"--passWithNoTests",
|
|
6902
|
+
"--coverage"
|
|
6903
|
+
]);
|
|
6904
|
+
let t = await Br(Zi);
|
|
6905
|
+
return t === null ? void 0 : JSON.parse(t).total.lines.pct;
|
|
6906
|
+
}
|
|
6907
|
+
async function aa(e, t) {
|
|
6908
|
+
if (e.devDependencies?.fallow == null) {
|
|
6909
|
+
Z("2️⃣ Code health NOT measured, as Fallow is not installed"), Z("3️⃣ Code health report NOT required");
|
|
6910
|
+
return;
|
|
6911
|
+
}
|
|
6912
|
+
await Lr("2️⃣ Measure code health", "fallow", [
|
|
6913
|
+
"health",
|
|
6914
|
+
"--report-only",
|
|
6915
|
+
"--format",
|
|
6916
|
+
"json",
|
|
6917
|
+
...t
|
|
6918
|
+
], ta), await Lr("3️⃣ Write code health report", "fallow", ["--format", "markdown"], Tr, !0);
|
|
6919
|
+
let n = await J(ta);
|
|
6920
|
+
return await oa(n), n;
|
|
6921
|
+
}
|
|
6922
|
+
async function oa(e) {
|
|
6923
|
+
let { score: t, grade: n } = e.health_score;
|
|
6924
|
+
await Vr(wr, {
|
|
6925
|
+
schemaVersion: 1,
|
|
6926
|
+
label: "fallow",
|
|
6927
|
+
message: `${n} (${String(Math.round(t))})`,
|
|
6928
|
+
color: ea[n] ?? "lightgrey"
|
|
6748
6929
|
});
|
|
6749
6930
|
}
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
if (e.issues ||= o.issues, t.abortEarly) {
|
|
6778
|
-
e.typed = !1;
|
|
6779
|
-
break;
|
|
6780
|
-
}
|
|
6781
|
-
}
|
|
6782
|
-
o.typed || (e.typed = !1), e.value[r] = o.value;
|
|
6783
|
-
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ ki(i);
|
|
6784
|
-
else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (X(this, "key", e, t, {
|
|
6785
|
-
input: void 0,
|
|
6786
|
-
expected: `"${r}"`,
|
|
6787
|
-
path: [{
|
|
6788
|
-
type: "object",
|
|
6789
|
-
origin: "key",
|
|
6790
|
-
input: n,
|
|
6791
|
-
key: r,
|
|
6792
|
-
value: n[r]
|
|
6793
|
-
}]
|
|
6794
|
-
}), t.abortEarly)) break;
|
|
6795
|
-
}
|
|
6796
|
-
if (!e.issues || !t.abortEarly) {
|
|
6797
|
-
for (let r in n) if (!Object.prototype.hasOwnProperty.call(this.entries, r)) {
|
|
6798
|
-
X(this, "key", e, t, {
|
|
6799
|
-
input: r,
|
|
6800
|
-
expected: "never",
|
|
6801
|
-
path: [{
|
|
6802
|
-
type: "object",
|
|
6803
|
-
origin: "key",
|
|
6804
|
-
input: n,
|
|
6805
|
-
key: r,
|
|
6806
|
-
value: n[r]
|
|
6807
|
-
}]
|
|
6808
|
-
});
|
|
6809
|
-
break;
|
|
6810
|
-
}
|
|
6811
|
-
}
|
|
6812
|
-
} else X(this, "type", e, t);
|
|
6813
|
-
return e;
|
|
6814
|
-
}
|
|
6815
|
-
});
|
|
6931
|
+
async function sa(e, t, n) {
|
|
6932
|
+
let [r, i, a] = await Promise.all([
|
|
6933
|
+
Br(".github/workflows/ci.yml"),
|
|
6934
|
+
Br(".github/workflows/codeql.yml"),
|
|
6935
|
+
Br(".github/dependabot.yml")
|
|
6936
|
+
]), [o, s, c, l] = await Promise.all([
|
|
6937
|
+
ca(`repos/${e}/${t}`),
|
|
6938
|
+
ca(`repos/${e}/${t}/private-vulnerability-reporting`),
|
|
6939
|
+
ca(`repos/${e}/${t}/vulnerability-alerts`),
|
|
6940
|
+
ca(`repos/${e}/${t}/commits/main/check-runs?per_page=100`)
|
|
6941
|
+
]), 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;
|
|
6942
|
+
return {
|
|
6943
|
+
codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) => $i[e] ?? e).toArray(),
|
|
6944
|
+
codeQLQueries: /queries: ([\w-]+)/.exec(i ?? "")?.[1],
|
|
6945
|
+
dependabotAlerts: c !== void 0,
|
|
6946
|
+
dependabotSecurityUpdates: d("dependabot_security_updates"),
|
|
6947
|
+
dependabotVersionUpdates: p > m,
|
|
6948
|
+
npmAuditInCI: /npm (?:run )?audit/.test(r ?? ""),
|
|
6949
|
+
npmAuditLevel: /npm audit --audit-level=(\w+)/.exec(r ?? "")?.[1],
|
|
6950
|
+
privateVulnerabilityReporting: s === void 0 ? void 0 : JSON.parse(s).enabled,
|
|
6951
|
+
propertyTests: n.devDependencies?.["fast-check"] != null,
|
|
6952
|
+
pushProtection: d("secret_scanning_push_protection"),
|
|
6953
|
+
secretScanning: d("secret_scanning"),
|
|
6954
|
+
socket: f.has("socket-security"),
|
|
6955
|
+
sonarCloud: f.has("sonarqubecloud"),
|
|
6956
|
+
testsInCI: r?.includes("npm test") ?? !1
|
|
6957
|
+
};
|
|
6816
6958
|
}
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
message: e,
|
|
6826
|
-
"~run"(e, t) {
|
|
6827
|
-
return typeof e.value == "string" ? e.typed = !0 : X(this, "type", e, t), e;
|
|
6828
|
-
}
|
|
6829
|
-
});
|
|
6959
|
+
async function ca(e) {
|
|
6960
|
+
try {
|
|
6961
|
+
let { stdout: t } = await na("gh", ["api", e]);
|
|
6962
|
+
return t;
|
|
6963
|
+
} catch (e) {
|
|
6964
|
+
if (String(e.stderr).includes("HTTP 404")) return;
|
|
6965
|
+
throw e;
|
|
6966
|
+
}
|
|
6830
6967
|
}
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
else t = n.issues;
|
|
6836
|
-
return t;
|
|
6968
|
+
async function la(e) {
|
|
6969
|
+
let t = await fetch(`https://www.bestpractices.dev/projects.json?url=${encodeURIComponent(e)}`);
|
|
6970
|
+
if (!t.ok) throw Error(`OpenSSF Best Practices lookup failed with status ${String(t.status)}.`);
|
|
6971
|
+
return (await t.json()).find((t) => t.repo_url === e)?.id;
|
|
6837
6972
|
}
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
expects: /* @__PURE__ */ Di(e.map((e) => e.expects), "|"),
|
|
6845
|
-
async: !1,
|
|
6846
|
-
options: e,
|
|
6847
|
-
message: t,
|
|
6848
|
-
"~run"(e, t) {
|
|
6849
|
-
let n, r, i;
|
|
6850
|
-
for (let a of this.options) {
|
|
6851
|
-
let o = a["~run"]({ value: e.value }, t);
|
|
6852
|
-
if (o.typed) {
|
|
6853
|
-
if (o.issues) r ? r.push(o) : r = [o];
|
|
6854
|
-
else {
|
|
6855
|
-
n = o;
|
|
6856
|
-
break;
|
|
6857
|
-
}
|
|
6858
|
-
} else i ? i.push(o) : i = [o];
|
|
6859
|
-
}
|
|
6860
|
-
if (n) return n;
|
|
6861
|
-
if (r) {
|
|
6862
|
-
if (r.length === 1) return r[0];
|
|
6863
|
-
X(this, "type", e, t, { issues: /* @__PURE__ */ Li(r) }), e.typed = !0;
|
|
6864
|
-
} else if (i?.length === 1) return i[0];
|
|
6865
|
-
else X(this, "type", e, t, { issues: /* @__PURE__ */ Li(i) });
|
|
6866
|
-
return e;
|
|
6867
|
-
}
|
|
6868
|
-
});
|
|
6973
|
+
async function ua(e) {
|
|
6974
|
+
let t = await fetch(`https://api.scorecard.dev/projects/${e}`);
|
|
6975
|
+
if (t.status !== 404) {
|
|
6976
|
+
if (!t.ok) throw Error(`OpenSSF Scorecard lookup failed with status ${String(t.status)}.`);
|
|
6977
|
+
return await t.json();
|
|
6978
|
+
}
|
|
6869
6979
|
}
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
es: /* @__PURE__ */ $()
|
|
6873
|
-
}), Bi = {
|
|
6874
|
-
id: /* @__PURE__ */ $(),
|
|
6875
|
-
label: /* @__PURE__ */ Q({
|
|
6876
|
-
en: /* @__PURE__ */ Fi(/* @__PURE__ */ $()),
|
|
6877
|
-
es: /* @__PURE__ */ Fi(/* @__PURE__ */ $())
|
|
6878
|
-
}),
|
|
6879
|
-
description: /* @__PURE__ */ Q({
|
|
6880
|
-
en: /* @__PURE__ */ Fi(/* @__PURE__ */ $()),
|
|
6881
|
-
es: /* @__PURE__ */ Fi(/* @__PURE__ */ $())
|
|
6882
|
-
}),
|
|
6883
|
-
icon: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6884
|
-
iconDark: /* @__PURE__ */ Z(/* @__PURE__ */ $())
|
|
6885
|
-
}, Vi = (e) => /* @__PURE__ */ Ri(e.map((e) => /* @__PURE__ */ Ni(e))), Hi = Vi([
|
|
6886
|
-
"app",
|
|
6887
|
-
"connector",
|
|
6888
|
-
"connectorConnection",
|
|
6889
|
-
"context",
|
|
6890
|
-
"contextArea",
|
|
6891
|
-
"contextModel",
|
|
6892
|
-
"contextModelDimension",
|
|
6893
|
-
"contextModelDimensionHierarchy",
|
|
6894
|
-
"contextModelEntity",
|
|
6895
|
-
"contextModelEntityDataItem",
|
|
6896
|
-
"contextModelEntityEvent",
|
|
6897
|
-
"contextModelEntityPrimaryMeasure",
|
|
6898
|
-
"contextModelSecondaryMeasure",
|
|
6899
|
-
"cookbook",
|
|
6900
|
-
"cookbookRecipe",
|
|
6901
|
-
"dataView",
|
|
6902
|
-
"engine",
|
|
6903
|
-
"eventQuery",
|
|
6904
|
-
"presenter",
|
|
6905
|
-
"presenterPresentation",
|
|
6906
|
-
"tool"
|
|
6907
|
-
]), Ui = Vi([
|
|
6908
|
-
"danger",
|
|
6909
|
-
"success",
|
|
6910
|
-
"warning"
|
|
6911
|
-
]), Wi = Vi([
|
|
6912
|
-
"alpha",
|
|
6913
|
-
"beta",
|
|
6914
|
-
"releaseCandidate",
|
|
6915
|
-
"generalAvailability"
|
|
6916
|
-
]), Gi = /* @__PURE__ */ Q({
|
|
6917
|
-
color: Ui,
|
|
6918
|
-
label: /* @__PURE__ */ $()
|
|
6919
|
-
}), Ki = {
|
|
6920
|
-
...Bi,
|
|
6921
|
-
typeId: Hi
|
|
6922
|
-
}, qi = /* @__PURE__ */ Q({
|
|
6923
|
-
...Ki,
|
|
6924
|
-
order: /* @__PURE__ */ Pi(),
|
|
6925
|
-
path: /* @__PURE__ */ $()
|
|
6926
|
-
}), Ji = {
|
|
6927
|
-
...Ki,
|
|
6928
|
-
firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ Pi()),
|
|
6929
|
-
lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ Pi()),
|
|
6930
|
-
status: /* @__PURE__ */ Z(Gi),
|
|
6931
|
-
statusId: /* @__PURE__ */ Z(Wi)
|
|
6932
|
-
};
|
|
6933
|
-
({ ...Ji }), Vi([
|
|
6934
|
-
"app",
|
|
6935
|
-
"engine",
|
|
6936
|
-
"connector",
|
|
6937
|
-
"cookbook",
|
|
6938
|
-
"presenter",
|
|
6939
|
-
"tool"
|
|
6940
|
-
]);
|
|
6941
|
-
//#endregion
|
|
6942
|
-
//#region node_modules/@dpuse/dpuse-shared/dist/moduleConfig.schema-aYmFWSrn.js
|
|
6943
|
-
var Yi = {
|
|
6944
|
-
...Ji,
|
|
6945
|
-
vendorAccountURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6946
|
-
vendorDocumentationURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6947
|
-
vendorHomeURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6948
|
-
version: /* @__PURE__ */ $()
|
|
6949
|
-
};
|
|
6950
|
-
({ ...Yi });
|
|
6951
|
-
//#endregion
|
|
6952
|
-
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModuleConnector.es.js
|
|
6953
|
-
var Xi = Vi([
|
|
6954
|
-
"abortOperation",
|
|
6955
|
-
"auditObjectContent",
|
|
6956
|
-
"createObject",
|
|
6957
|
-
"describeConnection",
|
|
6958
|
-
"dropObject",
|
|
6959
|
-
"findObject",
|
|
6960
|
-
"getInfo",
|
|
6961
|
-
"getReadableStream",
|
|
6962
|
-
"getRecord",
|
|
6963
|
-
"listNodes",
|
|
6964
|
-
"previewObject",
|
|
6965
|
-
"removeRecords",
|
|
6966
|
-
"retrieveChunks",
|
|
6967
|
-
"retrieveRecords",
|
|
6968
|
-
"upsertRecords"
|
|
6969
|
-
]), Zi = Vi([
|
|
6970
|
-
"application",
|
|
6971
|
-
"curatedDataset",
|
|
6972
|
-
"database",
|
|
6973
|
-
"fileStore"
|
|
6974
|
-
]), Qi = /* @__PURE__ */ Q({ label: zi }), $i = Vi([
|
|
6975
|
-
"bidirectional",
|
|
6976
|
-
"destination",
|
|
6977
|
-
"source",
|
|
6978
|
-
"unknown"
|
|
6979
|
-
]), ea = /* @__PURE__ */ Q({ label: zi }), ta = /* @__PURE__ */ Q({
|
|
6980
|
-
authMethodId: Vi([
|
|
6981
|
-
"apiKey",
|
|
6982
|
-
"disabled",
|
|
6983
|
-
"oAuth2",
|
|
6984
|
-
"none"
|
|
6985
|
-
]),
|
|
6986
|
-
activeConnectionCount: /* @__PURE__ */ Fi(/* @__PURE__ */ Pi()),
|
|
6987
|
-
canDescribe: /* @__PURE__ */ Fi(/* @__PURE__ */ Mi()),
|
|
6988
|
-
id: /* @__PURE__ */ Fi(/* @__PURE__ */ $()),
|
|
6989
|
-
label: /* @__PURE__ */ Fi(zi),
|
|
6990
|
-
maxConnectionCount: /* @__PURE__ */ Z(/* @__PURE__ */ Pi()),
|
|
6991
|
-
params: /* @__PURE__ */ Fi(/* @__PURE__ */ ji(/* @__PURE__ */ Ii(/* @__PURE__ */ $(), /* @__PURE__ */ $())))
|
|
6992
|
-
}), na = /* @__PURE__ */ Q({
|
|
6993
|
-
...Yi,
|
|
6994
|
-
typeId: /* @__PURE__ */ Ni("connector"),
|
|
6995
|
-
actionNames: /* @__PURE__ */ ji(Xi),
|
|
6996
|
-
category: /* @__PURE__ */ Z(Qi),
|
|
6997
|
-
categoryId: Zi,
|
|
6998
|
-
implementations: /* @__PURE__ */ Ii(/* @__PURE__ */ $(), ta),
|
|
6999
|
-
usage: /* @__PURE__ */ Z(ea),
|
|
7000
|
-
usageId: /* @__PURE__ */ Z($i)
|
|
7001
|
-
}), ra = {
|
|
7002
|
-
abortOperation: "Abort Operation",
|
|
7003
|
-
auditObjectContent: "Audit Object Content",
|
|
7004
|
-
createObject: "Create Object",
|
|
7005
|
-
describeConnection: "Describe Connection",
|
|
7006
|
-
dropObject: "Drop Object",
|
|
7007
|
-
findObject: "Find Object",
|
|
7008
|
-
getInfo: "Get Info",
|
|
7009
|
-
getReadableStream: "Get Readable Stream",
|
|
7010
|
-
getRecord: "Get Record",
|
|
7011
|
-
listNodes: "List Nodes",
|
|
7012
|
-
previewObject: "Preview Object",
|
|
7013
|
-
removeRecords: "Remove Records",
|
|
7014
|
-
retrieveChunks: "Retrieve Chunks",
|
|
7015
|
-
retrieveRecords: "Retrieve Records",
|
|
7016
|
-
upsertRecords: "Upsert Records"
|
|
7017
|
-
}, ia = /* @__PURE__ */ new Set([
|
|
7018
|
-
"createObject",
|
|
7019
|
-
"dropObject",
|
|
7020
|
-
"removeRecords",
|
|
7021
|
-
"upsertRecords"
|
|
7022
|
-
]), aa = /* @__PURE__ */ new Set([
|
|
7023
|
-
"auditObjectContent",
|
|
7024
|
-
"findObject",
|
|
7025
|
-
"getInfo",
|
|
7026
|
-
"getReadableStream",
|
|
7027
|
-
"getRecord",
|
|
7028
|
-
"listNodes",
|
|
7029
|
-
"previewObject",
|
|
7030
|
-
"retrieveChunks",
|
|
7031
|
-
"retrieveRecords"
|
|
7032
|
-
]);
|
|
7033
|
-
function oa(e) {
|
|
7034
|
-
let t = !1, n = !1;
|
|
7035
|
-
for (let r of e) aa.has(r) && (t = !0), ia.has(r) && (n = !0);
|
|
7036
|
-
return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "unknown";
|
|
6980
|
+
function da(e) {
|
|
6981
|
+
return e.checks.every(({ name: e, score: t }) => t === -1 || t === 10 || Yi.has(e) || Ji[e] !== void 0 && t >= Ji[e]);
|
|
7037
6982
|
}
|
|
7038
|
-
function
|
|
7039
|
-
|
|
7040
|
-
n += "|:----|:-------:|\n";
|
|
7041
|
-
for (let e of Object.keys(ra)) n += `| ${ra[e]} | ${t.has(e) ? "✓" : ""} |\n`;
|
|
7042
|
-
return n;
|
|
6983
|
+
function $(e, t = "On") {
|
|
6984
|
+
return e === void 0 ? "❔ Unknown" : e ? `✅ ${t}` : "❌ Off";
|
|
7043
6985
|
}
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
6986
|
+
function fa(e, t) {
|
|
6987
|
+
return t.length === 0 ? "" : `### ${e}
|
|
6988
|
+
|
|
6989
|
+
|Check or setting|Status|What it does|
|
|
6990
|
+
|:-|:-|:-|
|
|
6991
|
+
${t.map((e) => `|${e.join("|")}|`).join("\n")}
|
|
6992
|
+
|
|
6993
|
+
`;
|
|
6994
|
+
}
|
|
6995
|
+
function pa(e, t, { coveragePercent: n, fallowHealth: r, securitySettings: i }) {
|
|
6996
|
+
let a = `https://github.com/${e}/${t}`, o = [[
|
|
6997
|
+
`[SonarCloud](https://sonarcloud.io/summary/new_code?id=${e}_${t})`,
|
|
6998
|
+
$(i.sonarCloud),
|
|
6999
|
+
"Code quality and security analysis on every push: bugs, code smells and vulnerabilities."
|
|
7000
|
+
]];
|
|
7001
|
+
if (r !== void 0) {
|
|
7002
|
+
let { score: e, grade: t } = r.health_score;
|
|
7003
|
+
o.unshift([
|
|
7004
|
+
`[Fallow](./${Tr})`,
|
|
7005
|
+
`✅ ${t} (${String(Math.round(e))})`,
|
|
7006
|
+
"Unused code, duplication, complexity and dependency hygiene."
|
|
7007
|
+
]);
|
|
7008
|
+
}
|
|
7009
|
+
let s = i.codeQLQueries === "security-extended" ? "using the extended security queries" : "using the default queries", c = [
|
|
7010
|
+
[
|
|
7011
|
+
`[CodeQL](${a}/security/code-scanning)`,
|
|
7012
|
+
$(i.codeQLLanguages.length > 0, i.codeQLLanguages.join(", ")),
|
|
7013
|
+
`Static analysis for security vulnerabilities, ${s}, on every push and pull request to \`main\` and weekly.`
|
|
7014
|
+
],
|
|
7015
|
+
[
|
|
7016
|
+
"Secret scanning",
|
|
7017
|
+
$(i.secretScanning),
|
|
7018
|
+
"Detects credentials, such as API keys and tokens, committed to the repository."
|
|
7019
|
+
],
|
|
7020
|
+
[
|
|
7021
|
+
"Push protection",
|
|
7022
|
+
$(i.pushProtection),
|
|
7023
|
+
"Blocks pushes that contain credentials."
|
|
7024
|
+
]
|
|
7025
|
+
], l = [[
|
|
7026
|
+
"Unit tests",
|
|
7027
|
+
$(i.testsInCI),
|
|
7028
|
+
"Run in CI on every push to `main`."
|
|
7029
|
+
], [
|
|
7030
|
+
"Property-based tests",
|
|
7031
|
+
$(i.propertyTests, "fast-check"),
|
|
7032
|
+
"Fuzz testing: many random inputs per test to find edge cases, run with the unit tests."
|
|
7033
|
+
]];
|
|
7034
|
+
if (n !== void 0) {
|
|
7035
|
+
let e = n >= Qi ? "✅" : "⚠️";
|
|
7036
|
+
l.push([
|
|
7037
|
+
"Test coverage",
|
|
7038
|
+
`${e} ${n.toFixed(1)}% of lines`,
|
|
7039
|
+
`Share of source lines the unit tests run. The target is ${String(Qi)}%.`
|
|
7040
|
+
]);
|
|
7041
|
+
}
|
|
7042
|
+
let u = [
|
|
7043
|
+
[
|
|
7044
|
+
"npm audit",
|
|
7045
|
+
$(i.npmAuditInCI),
|
|
7046
|
+
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.`
|
|
7047
|
+
],
|
|
7048
|
+
[
|
|
7049
|
+
"[Socket.dev](https://socket.dev)",
|
|
7050
|
+
$(i.socket),
|
|
7051
|
+
"Flags supply chain risk in dependencies: malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE."
|
|
7052
|
+
],
|
|
7053
|
+
[
|
|
7054
|
+
"Dependabot alerts",
|
|
7055
|
+
$(i.dependabotAlerts),
|
|
7056
|
+
"Alerts when a dependency has a known vulnerability, using the GitHub Advisory Database."
|
|
7057
|
+
],
|
|
7058
|
+
[
|
|
7059
|
+
"Dependabot security updates",
|
|
7060
|
+
$(i.dependabotSecurityUpdates),
|
|
7061
|
+
"Opens pull requests that update vulnerable dependencies."
|
|
7062
|
+
],
|
|
7063
|
+
[
|
|
7064
|
+
"Dependabot version updates",
|
|
7065
|
+
$(i.dependabotVersionUpdates),
|
|
7066
|
+
"Opens pull requests for new dependency versions."
|
|
7067
|
+
]
|
|
7068
|
+
];
|
|
7069
|
+
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.
|
|
7070
|
+
|
|
7071
|
+
${fa("Testing", l)}${fa("Code Quality", o)}${fa("Security Analysis", c)}${fa("Dependencies", u)}`;
|
|
7072
|
+
}
|
|
7073
|
+
function ma(e, t, n, r, i) {
|
|
7074
|
+
let a = `https://github.com/${e}/${t}`, o = `github.com/${e}/${t}`, s = `https://www.bestpractices.dev/projects/${String(r)}`, c = i !== void 0 && da(i) ? "\n\n> [!NOTE]\n> Apart from the Best Practices badge above, the remaining Scorecard gaps need multi-person review or a pull-request workflow, which this solo-maintained project doesn't use." : "", l = r === void 0 ? "" : `[](${s})\n`, u = n.securitySettings.privateVulnerabilityReporting === !0 ? `Use [GitHub private vulnerability reporting](${a}/security/advisories/new) instead. See [SECURITY.md](./SECURITY.md) for the full disclosure policy, contact details, and expected response times.` : "See [SECURITY.md](./SECURITY.md) for how to report one privately, the full disclosure policy, and expected response times.";
|
|
7075
|
+
return `## Quality & Security
|
|
7076
|
+
|
|
7077
|
+
${pa(e, t, n)}### OpenSSF 🚧
|
|
7078
|
+
|
|
7079
|
+
${l}[](https://scorecard.dev/viewer/?uri=${o})
|
|
7080
|
+
|
|
7081
|
+
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.${c}
|
|
7082
|
+
|
|
7083
|
+
### Reporting Vulnerabilities
|
|
7084
|
+
|
|
7085
|
+
Please do not open public GitHub issues for security vulnerabilities. ${u}`;
|
|
7086
|
+
}
|
|
7087
|
+
//#endregion
|
|
7088
|
+
//#region src/actions/documentUsage.ts
|
|
7089
|
+
var ha = "<!-- USAGE_START -->", ga = "<!-- USAGE_END -->", _a = /* @__PURE__ */ new Set([
|
|
7090
|
+
"connector",
|
|
7091
|
+
"cookbook",
|
|
7092
|
+
"presenter"
|
|
7093
|
+
]), va = /* @__PURE__ */ new Set(["development", "eslint"]), ya = "> [!WARNING]\n> This project is not designed for general use. It is custom built for the DPUse CI/CD process. You are welcome to clone and customise it for your own purposes, but you will need to adapt it to your own project structure and tooling.", ba = "This repository manages itself using the actions it implements.", xa = "This repository is managed using the common set of actions provided by [@dpuse/dpuse-development](https://github.com/dpuse/dpuse-development).";
|
|
7094
|
+
async function Sa() {
|
|
7053
7095
|
try {
|
|
7054
|
-
|
|
7055
|
-
let e =
|
|
7056
|
-
await
|
|
7096
|
+
Y("Document Usage"), Z("1️⃣ Insert usage content into 'README.md'");
|
|
7097
|
+
let [e, t] = await Promise.all([J("package.json"), J("config.json")]), n = Ca(e), r = wa(n), i = Ta(e.engines?.node), a = Ta(e.engines?.npm), o = Ta(e.devDependencies?.typescript);
|
|
7098
|
+
await Hr(Da(Ea(Wr(t.id), e.name), n, r, i, a, o, e.name === "@dpuse/dpuse-development" ? ba : xa), ha, ga), X("Usage documented");
|
|
7057
7099
|
} catch (e) {
|
|
7058
|
-
console.error("❌ Error documenting
|
|
7100
|
+
console.error("❌ Error documenting usage", e), process.exit(1);
|
|
7101
|
+
}
|
|
7102
|
+
}
|
|
7103
|
+
function Ca(e) {
|
|
7104
|
+
let t = e.repository, n = typeof t == "string" ? t : t?.url;
|
|
7105
|
+
if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
|
|
7106
|
+
return n.replace(/^git\+/, "");
|
|
7107
|
+
}
|
|
7108
|
+
function wa(e) {
|
|
7109
|
+
return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
|
|
7110
|
+
}
|
|
7111
|
+
function Ta(e) {
|
|
7112
|
+
if (e == null) throw Error("package.json version range is required to document usage.");
|
|
7113
|
+
let t = /\d+(?:\.\d+)*/.exec(e);
|
|
7114
|
+
if (t == null) throw Error(`Unable to parse version from '${e}'.`);
|
|
7115
|
+
return t[0];
|
|
7116
|
+
}
|
|
7117
|
+
function Ea(e, t) {
|
|
7118
|
+
let { typeId: n } = e;
|
|
7119
|
+
if (_a.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.
|
|
7120
|
+
|
|
7121
|
+
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.`;
|
|
7122
|
+
if (e.publishedTo === "npm") {
|
|
7123
|
+
if (t == null || t === "") throw Error("package.json 'name' field is required to document usage.");
|
|
7124
|
+
return `This [package](https://www.npmjs.com/package/${t}) is available on [npm](https://www.npmjs.com/). Install it with:
|
|
7125
|
+
|
|
7126
|
+
\`\`\`bash
|
|
7127
|
+
npm install ${t}
|
|
7128
|
+
\`\`\`
|
|
7129
|
+
|
|
7130
|
+
${va.has(n) ? `${ya}\n\n` : ""}To work on the source instead, clone this repository.`;
|
|
7059
7131
|
}
|
|
7132
|
+
return "You may view or clone this repository for your own purposes.";
|
|
7133
|
+
}
|
|
7134
|
+
function Da(e, t, n, r, i, a, o) {
|
|
7135
|
+
return `## Usage
|
|
7136
|
+
|
|
7137
|
+
${e}
|
|
7138
|
+
|
|
7139
|
+
\`\`\`bash
|
|
7140
|
+
git clone ${t}
|
|
7141
|
+
cd ${n}
|
|
7142
|
+
npm install
|
|
7143
|
+
\`\`\`
|
|
7144
|
+
|
|
7145
|
+
_Requires [Node.js](https://nodejs.org/) ${r} or later, [npm](https://www.npmjs.com/) ${i} or later, and [TypeScript](https://www.typescriptlang.org/) ${a} or later._
|
|
7146
|
+
|
|
7147
|
+
${o}`;
|
|
7060
7148
|
}
|
|
7061
7149
|
//#endregion
|
|
7062
7150
|
//#region src/actions/documentApiReference.ts
|
|
7063
|
-
var
|
|
7151
|
+
var Oa = "API_REFERENCE.md", ka = [
|
|
7064
7152
|
"Functions",
|
|
7065
7153
|
"Classes",
|
|
7066
7154
|
"Constants",
|
|
7067
7155
|
"Schemas",
|
|
7068
7156
|
"Types"
|
|
7069
|
-
],
|
|
7070
|
-
async function
|
|
7157
|
+
], Aa = "Every export, grouped by import path. This file is updated each time `npm run document` is run, and with each release.";
|
|
7158
|
+
async function ja() {
|
|
7071
7159
|
try {
|
|
7072
|
-
|
|
7160
|
+
Y("Document API Reference"), await Ma("1️⃣ "), X("API reference documented");
|
|
7073
7161
|
} catch (e) {
|
|
7074
7162
|
console.error("❌ Error documenting API reference", e), process.exit(1);
|
|
7075
7163
|
}
|
|
7076
7164
|
}
|
|
7077
|
-
async function
|
|
7078
|
-
|
|
7079
|
-
let t =
|
|
7165
|
+
async function Ma(e) {
|
|
7166
|
+
Z(`${e} Write '${Oa}'`);
|
|
7167
|
+
let t = Na(await J("package.json"));
|
|
7080
7168
|
if (t.length === 0) throw Error("package.json 'exports' must name at least one import path with types to document the API reference.");
|
|
7081
|
-
let n = l.createProgram(t.map(({ sourcePath: e }) => e),
|
|
7082
|
-
await
|
|
7169
|
+
let n = l.createProgram(t.map(({ sourcePath: e }) => e), Pa()), r = n.getTypeChecker(), i = Va(n, r);
|
|
7170
|
+
await Ur(Oa, `# API Reference\n\n${Aa}\n\n${t.map(({ importPath: e, sourcePath: t }) => {
|
|
7083
7171
|
let a = n.getSourceFile(t);
|
|
7084
7172
|
if (a === void 0) throw Error(`Unable to read '${t}', the source of '${e}'.`);
|
|
7085
|
-
return
|
|
7173
|
+
return $a(e, Fa(r, a, i));
|
|
7086
7174
|
}).join("\n\n")}\n`);
|
|
7087
7175
|
}
|
|
7088
|
-
function
|
|
7176
|
+
function Na(e) {
|
|
7089
7177
|
let t = e.name ?? "", n = e.exports;
|
|
7090
7178
|
return (typeof n == "object" && n && !Array.isArray(n) ? Object.entries(n) : []).flatMap(([e, n]) => {
|
|
7091
7179
|
let r = typeof n == "object" && n && !Array.isArray(n) ? n.types : void 0;
|
|
@@ -7095,7 +7183,7 @@ function ya(e) {
|
|
|
7095
7183
|
}] : [];
|
|
7096
7184
|
});
|
|
7097
7185
|
}
|
|
7098
|
-
function
|
|
7186
|
+
function Pa() {
|
|
7099
7187
|
let e = l.findConfigFile(process.cwd(), (e) => l.sys.fileExists(e));
|
|
7100
7188
|
if (e === void 0) return {
|
|
7101
7189
|
module: l.ModuleKind.ESNext,
|
|
@@ -7105,22 +7193,22 @@ function ba() {
|
|
|
7105
7193
|
let { config: t } = l.readConfigFile(e, (e) => l.sys.readFile(e));
|
|
7106
7194
|
return l.parseJsonConfigFileContent(t, l.sys, process.cwd()).options;
|
|
7107
7195
|
}
|
|
7108
|
-
function
|
|
7109
|
-
let r = new Map(
|
|
7196
|
+
function Fa(e, t, n) {
|
|
7197
|
+
let r = new Map(ka.map((e) => [e, []])), i = e.getSymbolAtLocation(t), a = i === void 0 ? [] : e.getExportsOfModule(i);
|
|
7110
7198
|
for (let t of a) {
|
|
7111
|
-
let i =
|
|
7199
|
+
let i = Ja(e, t), a = Ia(e, Ya(t, i), i, n);
|
|
7112
7200
|
a !== void 0 && r.get(a.kind)?.push({
|
|
7113
7201
|
...a,
|
|
7114
|
-
description:
|
|
7202
|
+
description: La(e, i)
|
|
7115
7203
|
});
|
|
7116
7204
|
}
|
|
7117
7205
|
for (let e of r.values()) e.sort((e, t) => e.name.localeCompare(t.name));
|
|
7118
7206
|
return r;
|
|
7119
7207
|
}
|
|
7120
|
-
function
|
|
7208
|
+
function Ia(e, t, n, r) {
|
|
7121
7209
|
let [i] = (n.flags & (l.SymbolFlags.Function | l.SymbolFlags.Variable)) === 0 ? [] : e.getSignaturesOfType(e.getTypeOfSymbol(n), l.SignatureKind.Call), a = t.endsWith("Schema");
|
|
7122
7210
|
return i !== void 0 && !a ? {
|
|
7123
|
-
detail: `(${i.parameters.map((t) =>
|
|
7211
|
+
detail: `(${i.parameters.map((t) => Xa(e, t)).join(", ")})`,
|
|
7124
7212
|
kind: "Functions",
|
|
7125
7213
|
name: t,
|
|
7126
7214
|
origin: ""
|
|
@@ -7133,9 +7221,9 @@ function Sa(e, t, n, r) {
|
|
|
7133
7221
|
detail: "",
|
|
7134
7222
|
kind: "Types",
|
|
7135
7223
|
name: t,
|
|
7136
|
-
origin:
|
|
7224
|
+
origin: za(e, n, r)
|
|
7137
7225
|
} : {
|
|
7138
|
-
detail: `: ${
|
|
7226
|
+
detail: `: ${Ra(e, n)}`,
|
|
7139
7227
|
kind: "Constants",
|
|
7140
7228
|
name: t,
|
|
7141
7229
|
origin: ""
|
|
@@ -7143,37 +7231,37 @@ function Sa(e, t, n, r) {
|
|
|
7143
7231
|
detail: "",
|
|
7144
7232
|
kind: "Classes",
|
|
7145
7233
|
name: t,
|
|
7146
|
-
origin:
|
|
7234
|
+
origin: za(e, n, r)
|
|
7147
7235
|
};
|
|
7148
7236
|
}
|
|
7149
|
-
function
|
|
7237
|
+
function La(e, t) {
|
|
7150
7238
|
let n = l.displayPartsToString(t.getDocumentationComment(e)).replaceAll(/\s+/g, " ").trim();
|
|
7151
7239
|
return n === "" ? void 0 : n;
|
|
7152
7240
|
}
|
|
7153
|
-
function
|
|
7241
|
+
function Ra(e, t) {
|
|
7154
7242
|
let n = t.valueDeclaration, r = n !== void 0 && l.isVariableDeclaration(n) ? n : void 0, i = r?.initializer, a = i !== void 0 && l.isAsExpression(i) && !l.isConstTypeReference(i.type), o = r?.type ?? (a ? i.type : void 0);
|
|
7155
|
-
return o === void 0 ? e.typeToString(e.getBaseTypeOfLiteralType(e.getTypeOfSymbol(t)), n) :
|
|
7243
|
+
return o === void 0 ? e.typeToString(e.getBaseTypeOfLiteralType(e.getTypeOfSymbol(t)), n) : Qa(o);
|
|
7156
7244
|
}
|
|
7157
|
-
function
|
|
7158
|
-
let r = (t.declarations ?? []).flatMap((e) => l.isClassDeclaration(e) || l.isInterfaceDeclaration(e) ? [...e.heritageClauses ?? []] : []).map((e) => `${e.token === l.SyntaxKind.ExtendsKeyword ? "extends" : "implements"} ${e.types.map((e) =>
|
|
7245
|
+
function za(e, t, n) {
|
|
7246
|
+
let r = (t.declarations ?? []).flatMap((e) => l.isClassDeclaration(e) || l.isInterfaceDeclaration(e) ? [...e.heritageClauses ?? []] : []).map((e) => `${e.token === l.SyntaxKind.ExtendsKeyword ? "extends" : "implements"} ${e.types.map((e) => to(Qa(e))).join(", ")}`), i = t.declarations?.find((e) => l.isTypeAliasDeclaration(e)), a = i === void 0 ? void 0 : Ua(i);
|
|
7159
7247
|
if (i !== void 0 && a !== void 0) {
|
|
7160
|
-
r.push(`inferred from ${
|
|
7161
|
-
let t =
|
|
7162
|
-
o.length > 0 && r.push(`extends ${o.map((e) =>
|
|
7248
|
+
r.push(`inferred from ${to(a.getText())}`);
|
|
7249
|
+
let t = Wa(e, i), o = t === void 0 ? [] : Ba(e, t, i.name.text, n);
|
|
7250
|
+
o.length > 0 && r.push(`extends ${o.map((e) => to(e)).join(", ")}`);
|
|
7163
7251
|
}
|
|
7164
7252
|
return r.length === 0 ? "" : ` (${r.join(", ")})`;
|
|
7165
7253
|
}
|
|
7166
|
-
function
|
|
7254
|
+
function Ba(e, t, n, r) {
|
|
7167
7255
|
return t.properties.flatMap((t) => {
|
|
7168
|
-
let i = l.isSpreadAssignment(t) ?
|
|
7256
|
+
let i = l.isSpreadAssignment(t) ? Ka(e, t.expression) : void 0;
|
|
7169
7257
|
if (i === void 0) return [];
|
|
7170
7258
|
let a = r.get(i);
|
|
7171
|
-
return a === n ?
|
|
7259
|
+
return a === n ? Ba(e, i, n, r) : a === void 0 ? [] : [a];
|
|
7172
7260
|
});
|
|
7173
7261
|
}
|
|
7174
|
-
function
|
|
7262
|
+
function Va(e, t) {
|
|
7175
7263
|
let n = /* @__PURE__ */ new Map(), r = e.getSourceFiles().filter((t) => !t.isDeclarationFile && !e.isSourceFileFromExternalLibrary(t)).flatMap((e) => e.statements.filter((e) => l.isTypeAliasDeclaration(e)));
|
|
7176
|
-
for (let e of r) for (let { addedFieldCount: r, group: i } of
|
|
7264
|
+
for (let e of r) for (let { addedFieldCount: r, group: i } of Ha(t, e)) n.set(i, [...n.get(i) ?? [], {
|
|
7177
7265
|
addedFieldCount: r,
|
|
7178
7266
|
typeName: e.name.text
|
|
7179
7267
|
}]);
|
|
@@ -7184,14 +7272,14 @@ function Da(e, t) {
|
|
|
7184
7272
|
}
|
|
7185
7273
|
return i;
|
|
7186
7274
|
}
|
|
7187
|
-
function
|
|
7188
|
-
let n =
|
|
7275
|
+
function Ha(e, t) {
|
|
7276
|
+
let n = Wa(e, t);
|
|
7189
7277
|
if (n === void 0) return [];
|
|
7190
7278
|
let r = l.isVariableDeclaration(n.parent) ? [{
|
|
7191
7279
|
addedFieldCount: 0,
|
|
7192
7280
|
group: n
|
|
7193
7281
|
}] : [], i = n.properties.flatMap((t) => {
|
|
7194
|
-
let r = l.isSpreadAssignment(t) ?
|
|
7282
|
+
let r = l.isSpreadAssignment(t) ? Ka(e, t.expression) : void 0;
|
|
7195
7283
|
return r === void 0 ? [] : [{
|
|
7196
7284
|
addedFieldCount: n.properties.length - 1,
|
|
7197
7285
|
group: r
|
|
@@ -7199,201 +7287,203 @@ function Oa(e, t) {
|
|
|
7199
7287
|
});
|
|
7200
7288
|
return [...r, ...i];
|
|
7201
7289
|
}
|
|
7202
|
-
function
|
|
7203
|
-
let [t] =
|
|
7290
|
+
function Ua(e) {
|
|
7291
|
+
let [t] = Ga(e.type, "InferOutput") ? e.type.typeArguments ?? [] : [];
|
|
7204
7292
|
if (t === void 0) return;
|
|
7205
7293
|
if (l.isTypeQueryNode(t)) return t.exprName;
|
|
7206
|
-
let [n] =
|
|
7294
|
+
let [n] = Ga(t, "ReturnType") ? t.typeArguments ?? [] : [], [r] = n !== void 0 && l.isTypeQueryNode(n) ? n.typeArguments ?? [] : [];
|
|
7207
7295
|
return r !== void 0 && l.isTypeQueryNode(r) ? r.exprName : void 0;
|
|
7208
7296
|
}
|
|
7209
|
-
function
|
|
7210
|
-
let n =
|
|
7297
|
+
function Wa(e, t) {
|
|
7298
|
+
let n = Ua(t), r = n === void 0 ? void 0 : qa(e, n);
|
|
7211
7299
|
if (r === void 0) return;
|
|
7212
7300
|
if (l.isObjectLiteralExpression(r)) return r;
|
|
7213
7301
|
let [i] = l.isCallExpression(r) ? r.arguments : [];
|
|
7214
|
-
return i === void 0 ? void 0 :
|
|
7302
|
+
return i === void 0 ? void 0 : Ka(e, i);
|
|
7215
7303
|
}
|
|
7216
|
-
function
|
|
7304
|
+
function Ga(e, t) {
|
|
7217
7305
|
return l.isTypeReferenceNode(e) ? (l.isQualifiedName(e.typeName) ? e.typeName.right : e.typeName).text === t : !1;
|
|
7218
7306
|
}
|
|
7219
|
-
function
|
|
7307
|
+
function Ka(e, t) {
|
|
7220
7308
|
if (l.isObjectLiteralExpression(t)) return t;
|
|
7221
|
-
let n =
|
|
7309
|
+
let n = qa(e, t);
|
|
7222
7310
|
return n !== void 0 && l.isObjectLiteralExpression(n) ? n : void 0;
|
|
7223
7311
|
}
|
|
7224
|
-
function
|
|
7225
|
-
let n = e.getSymbolAtLocation(t), r = n === void 0 ? void 0 :
|
|
7312
|
+
function qa(e, t) {
|
|
7313
|
+
let n = e.getSymbolAtLocation(t), r = n === void 0 ? void 0 : Ja(e, n).valueDeclaration;
|
|
7226
7314
|
return r !== void 0 && l.isVariableDeclaration(r) ? r.initializer : void 0;
|
|
7227
7315
|
}
|
|
7228
|
-
function
|
|
7316
|
+
function Ja(e, t) {
|
|
7229
7317
|
return (t.flags & l.SymbolFlags.Alias) === 0 ? t : e.getAliasedSymbol(t);
|
|
7230
7318
|
}
|
|
7231
|
-
function
|
|
7319
|
+
function Ya(e, t) {
|
|
7232
7320
|
if (e.name !== "default") return e.name;
|
|
7233
7321
|
let n = t.declarations?.map((e) => l.getNameOfDeclaration(e)?.getText()).find((e) => e !== void 0);
|
|
7234
7322
|
return n === void 0 || n === "default" ? "default" : `default (${n})`;
|
|
7235
7323
|
}
|
|
7236
|
-
function
|
|
7237
|
-
let n = t.valueDeclaration, r = n !== void 0 && l.isParameter(n) ? n : void 0, i = r?.questionToken !== void 0 || r?.initializer !== void 0, a = r?.type === void 0 ? e.typeToString(e.getTypeOfSymbol(t), n) :
|
|
7238
|
-
return `${t.name}${i ? "?" : ""}: ${a}`;
|
|
7324
|
+
function Xa(e, t) {
|
|
7325
|
+
let n = t.valueDeclaration, r = n !== void 0 && l.isParameter(n) ? n : void 0, i = r?.questionToken !== void 0 || r?.initializer !== void 0, a = r?.type === void 0 ? e.typeToString(e.getTypeOfSymbol(t), n) : Qa(r.type);
|
|
7326
|
+
return `${r === void 0 ? t.name : Za(r.name)}${i ? "?" : ""}: ${a}`;
|
|
7239
7327
|
}
|
|
7240
|
-
function
|
|
7328
|
+
function Za(e) {
|
|
7329
|
+
if (l.isIdentifier(e)) return e.text;
|
|
7330
|
+
let t = e.elements.flatMap((e) => l.isBindingElement(e) ? [(e.dotDotDotToken === void 0 ? "" : "...") + Za(e.name)] : []);
|
|
7331
|
+
return l.isObjectBindingPattern(e) ? `{ ${t.join(", ")} }` : `[${t.join(", ")}]`;
|
|
7332
|
+
}
|
|
7333
|
+
function Qa(e) {
|
|
7241
7334
|
return e.getText().replaceAll(/\s+/g, " ");
|
|
7242
7335
|
}
|
|
7243
|
-
function
|
|
7244
|
-
let n =
|
|
7245
|
-
let n = t.get(e) ?? [], r = n.map((e) =>
|
|
7336
|
+
function $a(e, t) {
|
|
7337
|
+
let n = ka.flatMap((e) => {
|
|
7338
|
+
let n = t.get(e) ?? [], r = n.map((e) => eo(e));
|
|
7246
7339
|
return n.length === 0 ? [] : [`### ${e}\n\n${r.join("\n")}`];
|
|
7247
7340
|
});
|
|
7248
7341
|
return [`## ${e}`, ...n].join("\n\n");
|
|
7249
7342
|
}
|
|
7250
|
-
function
|
|
7251
|
-
let i = t === "" ? "" :
|
|
7343
|
+
function eo({ description: e, detail: t, name: n, origin: r }) {
|
|
7344
|
+
let i = t === "" ? "" : to(t), a = `- **${to(n)}**${i}${r}`;
|
|
7252
7345
|
return e === void 0 ? a : `${a}\n > ${e}`;
|
|
7253
7346
|
}
|
|
7254
|
-
function
|
|
7347
|
+
function to(e) {
|
|
7255
7348
|
return `\`${e}\``;
|
|
7256
7349
|
}
|
|
7257
7350
|
//#endregion
|
|
7258
|
-
//#region src/actions/
|
|
7259
|
-
var
|
|
7260
|
-
async function
|
|
7351
|
+
//#region src/actions/documentBundleSizes.ts
|
|
7352
|
+
var no = "bundle-analysis-reports/sonda/index.json", ro = "<!-- BUNDLE_START -->", io = "<!-- BUNDLE_END -->", ao = " ", oo = 20, so = "This report is updated with each release, from the bundle the release builds, using [Sonda](https://sonda.dev/), which analyses final source maps to reveal the actual effects of tree-shaking and minification rather than relying on pre-build estimates.\n\n_Note: Sonda's Vite reports currently exclude CSS files, since Vite does not generate source maps for CSS._", co = "(bundler output, whitespace & JSON)", lo = `${co} = 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.`;
|
|
7353
|
+
async function uo(e) {
|
|
7261
7354
|
try {
|
|
7262
|
-
|
|
7263
|
-
let
|
|
7264
|
-
|
|
7355
|
+
Y("Document Bundle Sizes"), Z("1️⃣ Read bundle analysis report");
|
|
7356
|
+
let t = await J(no);
|
|
7357
|
+
Z("2️⃣ Insert table into 'README.md'"), await Hr(`## Bundle Analysis\n\n${so}\n\n${fo(t, e?.moduleLevel ?? !1)}\n\n${lo}`, ro, io), X("Bundle sizes documented");
|
|
7265
7358
|
} catch (e) {
|
|
7266
|
-
console.error("❌ Error documenting
|
|
7359
|
+
console.error("❌ Error documenting bundle sizes", e), process.exit(1);
|
|
7267
7360
|
}
|
|
7268
7361
|
}
|
|
7269
|
-
function
|
|
7270
|
-
let t = e.
|
|
7271
|
-
|
|
7362
|
+
function fo(e, t) {
|
|
7363
|
+
let n = yo(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, Co(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), a = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
|
|
7364
|
+
for (let [e, o] of i) {
|
|
7365
|
+
let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted((e, t) => t[1].sizes.uncompressed - e[1].sizes.uncompressed), s = i.length === 1 ? po(e, o, _o(i), r, t) : mo(e, o, i, r, t);
|
|
7366
|
+
a.push(...s);
|
|
7367
|
+
}
|
|
7368
|
+
return a.join("\n");
|
|
7369
|
+
}
|
|
7370
|
+
function po(e, t, n, r, i) {
|
|
7371
|
+
let [a, { sizes: o, files: s }] = n, c = r > 0 ? o.uncompressed / r * 100 : 0;
|
|
7372
|
+
if (s.size === 1) return [`| ${e} → ${go(a, vo(s))} | ${wo(t)} · ${To(c)} |`];
|
|
7373
|
+
let l = [`| ${e} → ${a} | ${wo(t)} · ${To(c)} |`];
|
|
7374
|
+
return i || l.push(...ho(s, ao, r)), l;
|
|
7375
|
+
}
|
|
7376
|
+
function mo(e, t, n, r, i) {
|
|
7377
|
+
let a = [`| ${e} | ${wo(t)} |`];
|
|
7378
|
+
for (let [e, { sizes: t, files: o }] of n) {
|
|
7379
|
+
let n = r > 0 ? t.uncompressed / r * 100 : 0;
|
|
7380
|
+
if (o.size === 1) {
|
|
7381
|
+
let t = vo(o);
|
|
7382
|
+
a.push(`| ${ao}${go(e, t)} | ${To(n)} |`);
|
|
7383
|
+
continue;
|
|
7384
|
+
}
|
|
7385
|
+
a.push(`| ${ao}${e} | ${To(n)} |`), i || a.push(...ho(o, `${ao}${ao}`, r));
|
|
7386
|
+
}
|
|
7387
|
+
return a;
|
|
7388
|
+
}
|
|
7389
|
+
function ho(e, t, n) {
|
|
7390
|
+
return [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed).map(([e, r]) => `| ${t}${e} | ${To(n > 0 ? r.uncompressed / n * 100 : 0)} |`);
|
|
7391
|
+
}
|
|
7392
|
+
function go(e, t) {
|
|
7393
|
+
return t === "" ? e : `${e} → ${t}`;
|
|
7394
|
+
}
|
|
7395
|
+
function _o(e) {
|
|
7396
|
+
let [t] = e;
|
|
7397
|
+
if (t === void 0) throw Error("Expected exactly one entry");
|
|
7272
7398
|
return t;
|
|
7273
7399
|
}
|
|
7274
|
-
function
|
|
7275
|
-
let t = e.
|
|
7276
|
-
if (t
|
|
7400
|
+
function vo(e) {
|
|
7401
|
+
let [t] = e.keys();
|
|
7402
|
+
if (t === void 0) throw Error("Expected exactly one file");
|
|
7277
7403
|
return t;
|
|
7278
7404
|
}
|
|
7279
|
-
function
|
|
7280
|
-
let
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
**Contextualising** extracts chronological events from those [Data Views](https://www.dpuse.app) and maps them into comprehensive [Context Models](https://www.dpuse.app). This gives the DPUse Engine the structural framework needed to generate deterministic transactions, facts, or observations.
|
|
7296
|
-
|
|
7297
|
-
**Publishing** uses a library of [Presenters](https://www.dpuse.app) to render standard [Presentations](https://www.dpuse.app) immediately using the contextualised data; additionally, [Cookbooks](https://www.dpuse.app) of [Recipes](https://www.dpuse.app) let you build Data Apps using your preferred tools.
|
|
7298
|
-
|
|
7299
|
-
In addition, DPUse provides [Tools](https://www.dpuse.app) used by the application, and you can use them to construct connectors and presenters.
|
|
7300
|
-
|
|
7301
|
-
## Introduction
|
|
7302
|
-
|
|
7303
|
-
${r}`;
|
|
7405
|
+
function yo(e) {
|
|
7406
|
+
let t = bo(e.dependencies), n = /* @__PURE__ */ new Map();
|
|
7407
|
+
for (let r of e.resources) {
|
|
7408
|
+
if (r.kind !== "chunk" || !r.parent) continue;
|
|
7409
|
+
let { group: e, file: i } = xo(r.name, t), a = Co(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
|
|
7410
|
+
n.set(r.parent, o);
|
|
7411
|
+
let s = o.get(e) ?? {
|
|
7412
|
+
sizes: Eo(),
|
|
7413
|
+
files: /* @__PURE__ */ new Map()
|
|
7414
|
+
};
|
|
7415
|
+
o.set(e, s), Do(s.sizes, a);
|
|
7416
|
+
let c = s.files.get(i) ?? Eo();
|
|
7417
|
+
s.files.set(i, c), Do(c, a);
|
|
7418
|
+
}
|
|
7419
|
+
return n;
|
|
7304
7420
|
}
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
["test:coverage", "Runs the unit tests and measures coverage."],
|
|
7317
|
-
["lint", "Checks the code with ESLint."],
|
|
7318
|
-
["format", "Formats the code with Prettier."],
|
|
7319
|
-
["audit", "Checks dependencies for known vulnerabilities with npm audit."],
|
|
7320
|
-
["check", "Checks configuration files against the DPUse templates and lists outdated dependencies."],
|
|
7321
|
-
["document", "Regenerates the README's generated sections."],
|
|
7322
|
-
["documentOpening", "Regenerates the README's opening section."],
|
|
7323
|
-
["documentActions", "Regenerates the README's connector actions table."],
|
|
7324
|
-
["documentUsage", "Regenerates the README's Usage section."],
|
|
7325
|
-
["documentDependencies", "Regenerates the README's dependency licence report."],
|
|
7326
|
-
["documentBundleSizes", "Regenerates the README's bundle size report."],
|
|
7327
|
-
["documentGovernance", "Regenerates the README's Quality & Security, Contributing and License sections."],
|
|
7328
|
-
["sync", "Bumps the version, then commits and pushes to GitHub."],
|
|
7329
|
-
["release", "Bumps the version, commits and pushes, and creates a GitHub release."],
|
|
7330
|
-
["publish", "Registers the released version with DPUse."]
|
|
7331
|
-
], Za = /* @__PURE__ */ new Set(["development", "eslint"]), Qa = "> [!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", $a = "Cloned or forked code is unsupported and isn't guaranteed to remain compatible with the DPUse Engine as it evolves.";
|
|
7332
|
-
async function eo() {
|
|
7333
|
-
try {
|
|
7334
|
-
G("Document Usage"), q("1️⃣ Insert usage content into 'README.md'");
|
|
7335
|
-
let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = to(e), r = no(n), i = ro(e.engines?.node), a = ro(e.engines?.npm), o = ro(e.devDependencies?.typescript);
|
|
7336
|
-
await Wn(so(io(Kn(t.id), e.name), n, r, i, a, o, ao(e)), qa, Ja), K("Usage documented");
|
|
7337
|
-
} catch (e) {
|
|
7338
|
-
console.error("❌ Error documenting usage", e), process.exit(1);
|
|
7421
|
+
function bo(e) {
|
|
7422
|
+
return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
|
|
7423
|
+
}
|
|
7424
|
+
function xo(e, t) {
|
|
7425
|
+
let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
|
|
7426
|
+
if (n) {
|
|
7427
|
+
let [t, r] = n;
|
|
7428
|
+
return {
|
|
7429
|
+
group: r,
|
|
7430
|
+
file: e.slice(t.length + 1)
|
|
7431
|
+
};
|
|
7339
7432
|
}
|
|
7433
|
+
return e === "[unassigned]" ? {
|
|
7434
|
+
group: co,
|
|
7435
|
+
file: ""
|
|
7436
|
+
} : e.startsWith("\0") ? {
|
|
7437
|
+
group: "(runtime)",
|
|
7438
|
+
file: e.slice(1)
|
|
7439
|
+
} : {
|
|
7440
|
+
group: e.startsWith("rust/") || e.includes("vite-plugin-wasm") ? "wasm" : "src",
|
|
7441
|
+
file: So(e)
|
|
7442
|
+
};
|
|
7340
7443
|
}
|
|
7341
|
-
function
|
|
7342
|
-
|
|
7343
|
-
if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
|
|
7344
|
-
return n.replace(/^git\+/, "");
|
|
7444
|
+
function So(e) {
|
|
7445
|
+
return e.split("/").at(-1) ?? e;
|
|
7345
7446
|
}
|
|
7346
|
-
function
|
|
7347
|
-
return
|
|
7447
|
+
function Co(e) {
|
|
7448
|
+
return {
|
|
7449
|
+
uncompressed: e.uncompressed,
|
|
7450
|
+
gzip: e.gzip ?? 0
|
|
7451
|
+
};
|
|
7348
7452
|
}
|
|
7349
|
-
function
|
|
7350
|
-
|
|
7351
|
-
let t = /\d+(?:\.\d+)*/.exec(e);
|
|
7352
|
-
if (t == null) throw Error(`Unable to parse version from '${e}'.`);
|
|
7353
|
-
return t[0];
|
|
7453
|
+
function wo(e) {
|
|
7454
|
+
return `${Oo(e.uncompressed)} · gzip ${Oo(e.gzip)}`;
|
|
7354
7455
|
}
|
|
7355
|
-
function
|
|
7356
|
-
let
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
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. ${$a}`;
|
|
7360
|
-
if (e.publishedTo === "npm") {
|
|
7361
|
-
if (t == null || t === "") throw Error("package.json 'name' field is required to document usage.");
|
|
7362
|
-
return `This package is published to the [public npm registry](https://www.npmjs.com/package/${t}). Install it with:
|
|
7363
|
-
|
|
7364
|
-
\`\`\`bash
|
|
7365
|
-
npm install ${t}
|
|
7366
|
-
\`\`\`
|
|
7367
|
-
|
|
7368
|
-
${Za.has(n) ? Qa : ""}To work on the source instead, clone this repository. ${$a}`;
|
|
7369
|
-
}
|
|
7370
|
-
return `You may view or clone this repository for your own purposes. ${$a}`;
|
|
7456
|
+
function To(e) {
|
|
7457
|
+
let t = Math.round(e / 100 * oo);
|
|
7458
|
+
return `\`${"█".repeat(t)}${"░".repeat(oo - t)}\` ${e.toFixed(1)}%`;
|
|
7371
7459
|
}
|
|
7372
|
-
function
|
|
7373
|
-
|
|
7374
|
-
|
|
7460
|
+
function Eo() {
|
|
7461
|
+
return {
|
|
7462
|
+
uncompressed: 0,
|
|
7463
|
+
gzip: 0
|
|
7464
|
+
};
|
|
7375
7465
|
}
|
|
7376
|
-
function
|
|
7377
|
-
|
|
7466
|
+
function Do(e, t) {
|
|
7467
|
+
e.uncompressed += t.uncompressed, e.gzip += t.gzip;
|
|
7378
7468
|
}
|
|
7379
|
-
function
|
|
7380
|
-
return
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7469
|
+
function Oo(e) {
|
|
7470
|
+
return e < 1024 ? `${String(e)} B` : `${(e / 1024).toFixed(1)} kB`;
|
|
7471
|
+
}
|
|
7472
|
+
//#endregion
|
|
7473
|
+
//#region src/actions/documentProject.ts
|
|
7474
|
+
async function ko({ allowedLicenses: e = "MIT", moduleLevel: t = !1 } = {}) {
|
|
7475
|
+
try {
|
|
7476
|
+
let n = Wr((await J("config.json")).id).typeId === "connector";
|
|
7477
|
+
await Wi(), n && await Si(), await Sa(), await ji(e), await Br("bundle-analysis-reports/sonda/index.json") === null ? Z(`ℹ️ Bundle sizes NOT documented, as there is no '${no}' yet. Build the project first.`) : await uo({ moduleLevel: t }), await ra(), await Ci(), await Br("API_REFERENCE.md") === null ? Z(`ℹ️ '${Oa}' NOT required by this project`) : await ja();
|
|
7478
|
+
} catch (e) {
|
|
7479
|
+
console.error("❌ Error documenting project", e), process.exit(1);
|
|
7480
|
+
}
|
|
7391
7481
|
}
|
|
7392
7482
|
//#endregion
|
|
7393
7483
|
//#region src/actions/formatCode.ts
|
|
7394
|
-
async function
|
|
7484
|
+
async function Ao() {
|
|
7395
7485
|
try {
|
|
7396
|
-
|
|
7486
|
+
Y("Format Code"), await q("1️⃣ Format", "prettier", [
|
|
7397
7487
|
"--write",
|
|
7398
7488
|
"*.json",
|
|
7399
7489
|
"*.md",
|
|
@@ -7403,35 +7493,35 @@ async function co() {
|
|
|
7403
7493
|
"src",
|
|
7404
7494
|
"tests"
|
|
7405
7495
|
].filter((t) => e(t)).map((e) => `${e}/**`)
|
|
7406
|
-
]),
|
|
7496
|
+
]), X("Code formatted");
|
|
7407
7497
|
} catch (e) {
|
|
7408
7498
|
console.error("❌ Error formatting code", e), process.exit(1);
|
|
7409
7499
|
}
|
|
7410
7500
|
}
|
|
7411
7501
|
//#endregion
|
|
7412
7502
|
//#region src/actions/lintCode.ts
|
|
7413
|
-
async function
|
|
7503
|
+
async function jo() {
|
|
7414
7504
|
try {
|
|
7415
|
-
|
|
7505
|
+
Y("Lint Code"), await q("1️⃣ Lint", "eslint", ["."]), X("Code linted");
|
|
7416
7506
|
} catch (e) {
|
|
7417
7507
|
console.error("❌ Error linting code", e), process.exit(1);
|
|
7418
7508
|
}
|
|
7419
7509
|
}
|
|
7420
7510
|
//#endregion
|
|
7421
7511
|
//#region src/utilities/cloudflare.ts
|
|
7422
|
-
async function
|
|
7423
|
-
let e = await
|
|
7512
|
+
async function Mo() {
|
|
7513
|
+
let e = await J("config.json"), t = {
|
|
7424
7514
|
body: JSON.stringify(e),
|
|
7425
7515
|
headers: { "Content-Type": "application/json" },
|
|
7426
7516
|
method: "PUT"
|
|
7427
7517
|
}, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
|
|
7428
7518
|
if (!n.ok) throw Error(await n.text());
|
|
7429
7519
|
}
|
|
7430
|
-
async function
|
|
7520
|
+
async function No(e, t) {
|
|
7431
7521
|
async function n(e, t, r) {
|
|
7432
7522
|
for (let i of r) {
|
|
7433
7523
|
let r = `${e}/${i}`, a = `${t}/${i}`;
|
|
7434
|
-
(await
|
|
7524
|
+
(await Kr(r)).isDirectory() ? await n(r, a, await Fr(r)) : (console.info(`⚙️ Uploading '${e}/${i}'...`), await Ir(void 0, "wrangler", [
|
|
7435
7525
|
"r2",
|
|
7436
7526
|
"object",
|
|
7437
7527
|
"put",
|
|
@@ -7442,10 +7532,10 @@ async function fo(e, t) {
|
|
|
7442
7532
|
]));
|
|
7443
7533
|
}
|
|
7444
7534
|
}
|
|
7445
|
-
let r = await
|
|
7535
|
+
let r = await Fr(`${e}/${t}/`);
|
|
7446
7536
|
await n(`${e}/${t}`, t, r);
|
|
7447
7537
|
}
|
|
7448
|
-
async function
|
|
7538
|
+
async function Po(e) {
|
|
7449
7539
|
let t = e.id, n = {
|
|
7450
7540
|
body: JSON.stringify(e),
|
|
7451
7541
|
headers: { "Content-Type": "application/json" },
|
|
@@ -7453,14 +7543,14 @@ async function po(e) {
|
|
|
7453
7543
|
}, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
|
|
7454
7544
|
if (!r.ok) throw Error(await r.text());
|
|
7455
7545
|
}
|
|
7456
|
-
async function
|
|
7546
|
+
async function Fo(e, t) {
|
|
7457
7547
|
let n = `v${e.version ?? "unknown"}`;
|
|
7458
7548
|
async function r(e, r = "") {
|
|
7459
|
-
let i = await
|
|
7549
|
+
let i = await Fr(e, { withFileTypes: !0 });
|
|
7460
7550
|
for (let a of i) {
|
|
7461
7551
|
if (a.isDirectory() || a.name.endsWith(".map")) continue;
|
|
7462
7552
|
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;
|
|
7463
|
-
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await
|
|
7553
|
+
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await Ir(void 0, "wrangler", [
|
|
7464
7554
|
"r2",
|
|
7465
7555
|
"object",
|
|
7466
7556
|
"put",
|
|
@@ -7476,195 +7566,111 @@ async function mo(e, t) {
|
|
|
7476
7566
|
await r("dist");
|
|
7477
7567
|
}
|
|
7478
7568
|
//#endregion
|
|
7479
|
-
//#region
|
|
7480
|
-
|
|
7481
|
-
lang: void 0,
|
|
7482
|
-
message: void 0,
|
|
7483
|
-
abortEarly: void 0,
|
|
7484
|
-
abortPipeEarly: void 0
|
|
7485
|
-
};
|
|
7486
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
7487
|
-
function go(e) {
|
|
7488
|
-
return e ? {
|
|
7489
|
-
lang: e?.lang ?? void 0,
|
|
7490
|
-
message: e?.message,
|
|
7491
|
-
abortEarly: e?.abortEarly ?? void 0,
|
|
7492
|
-
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
7493
|
-
} : ho;
|
|
7494
|
-
}
|
|
7495
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
7496
|
-
function _o(e, t, n) {
|
|
7497
|
-
let r = e["~run"]({ value: t }, /* @__PURE__ */ go(n));
|
|
7498
|
-
return {
|
|
7499
|
-
typed: r.typed,
|
|
7500
|
-
success: !r.issues,
|
|
7501
|
-
output: r.value,
|
|
7502
|
-
issues: r.issues
|
|
7503
|
-
};
|
|
7504
|
-
}
|
|
7505
|
-
//#endregion
|
|
7506
|
-
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModulePresenter.es.js
|
|
7507
|
-
var vo = Vi([
|
|
7508
|
-
"list",
|
|
7509
|
-
"render",
|
|
7510
|
-
"setColorMode"
|
|
7511
|
-
]), yo = /* @__PURE__ */ Q({
|
|
7512
|
-
...Yi,
|
|
7513
|
-
typeId: /* @__PURE__ */ Ni("presenter"),
|
|
7514
|
-
actionNames: /* @__PURE__ */ ji(vo),
|
|
7515
|
-
presentations: /* @__PURE__ */ ji(qi)
|
|
7516
|
-
}), bo = [
|
|
7517
|
-
"1️⃣ ",
|
|
7518
|
-
"2️⃣ ",
|
|
7519
|
-
"3️⃣ ",
|
|
7520
|
-
"4️⃣ "
|
|
7521
|
-
], xo = [{
|
|
7522
|
-
id: "unit",
|
|
7523
|
-
label: "Run unit tests",
|
|
7524
|
-
command: "vitest",
|
|
7525
|
-
arguments: ["run", "--passWithNoTests"],
|
|
7526
|
-
configFileName: "vitest.config.ts"
|
|
7527
|
-
}, {
|
|
7528
|
-
id: "e2e",
|
|
7529
|
-
label: "Run end-to-end tests",
|
|
7530
|
-
command: "playwright",
|
|
7531
|
-
arguments: ["test", "--pass-with-no-tests"],
|
|
7532
|
-
configFileName: "playwright.config.ts"
|
|
7533
|
-
}];
|
|
7534
|
-
async function So() {
|
|
7569
|
+
//#region src/actions/publishProject.ts
|
|
7570
|
+
async function Io() {
|
|
7535
7571
|
try {
|
|
7536
|
-
|
|
7572
|
+
Y("Publish Project");
|
|
7573
|
+
let e = await J("package.json"), t = await J("config.json");
|
|
7574
|
+
await Lo("1️⃣ ", e, t, Wr(t.id)), X(`Project version '${e.version ?? "unknown"}' published.`);
|
|
7537
7575
|
} catch (e) {
|
|
7538
|
-
console.error("❌ Error
|
|
7576
|
+
console.error("❌ Error publishing project", e), process.exit(1);
|
|
7539
7577
|
}
|
|
7540
7578
|
}
|
|
7541
|
-
async function
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
|
|
7579
|
+
async function Lo(e, t, n, r) {
|
|
7580
|
+
if (r.typeId === "app") Z(`${e} Register module`), await Mo();
|
|
7581
|
+
else if (r.typeId === "engine") Z(`${e} Register module`), await Fo(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await Po(n);
|
|
7582
|
+
else if (r.uploadGroupName === void 0) Z(`${e} Registration NOT required`);
|
|
7583
|
+
else {
|
|
7584
|
+
Z(`${e} Register module`);
|
|
7585
|
+
let i = n.id.split("-").slice(2).join("-");
|
|
7586
|
+
await Fo(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await Po(n);
|
|
7548
7587
|
}
|
|
7549
7588
|
}
|
|
7550
|
-
|
|
7589
|
+
//#endregion
|
|
7590
|
+
//#region src/actions/releaseProject.ts
|
|
7591
|
+
async function Ro(e = {}) {
|
|
7551
7592
|
try {
|
|
7552
|
-
|
|
7553
|
-
let
|
|
7554
|
-
await
|
|
7555
|
-
let
|
|
7556
|
-
|
|
7557
|
-
case "connector":
|
|
7558
|
-
t = await Eo("2️⃣ ", e);
|
|
7559
|
-
break;
|
|
7560
|
-
case "presenter":
|
|
7561
|
-
t = await Do("2️⃣ ", e);
|
|
7562
|
-
break;
|
|
7563
|
-
default: t = await To("2️⃣ ", e);
|
|
7564
|
-
}
|
|
7565
|
-
await U("3️⃣ Bundle project", "vite", ["build"]), await zn("4️⃣ Stage changes", "git", ["add", "."]), await zn("5️⃣ Commit changes", "git", [
|
|
7593
|
+
Y("Release Project");
|
|
7594
|
+
let t = await J("package.json"), n = Wr((await J("config.json")).id);
|
|
7595
|
+
await Jr("1️⃣ ", t);
|
|
7596
|
+
let r = await qr("2️⃣ ", t, n);
|
|
7597
|
+
await q("3️⃣ Bundle project", "vite", ["build"]), Z("4️⃣ Regenerate README"), await ko(e), await Ir("5️⃣ Stage changes", "git", ["add", "."]), await Ir("6️⃣ Commit changes", "git", [
|
|
7566
7598
|
"commit",
|
|
7567
7599
|
"-m",
|
|
7568
|
-
`v${
|
|
7569
|
-
]), await
|
|
7600
|
+
`v${t.version ?? "unknown"}`
|
|
7601
|
+
]), await Ir("7️⃣ Push changes", "git", [
|
|
7570
7602
|
"push",
|
|
7571
7603
|
"origin",
|
|
7572
7604
|
"main:main"
|
|
7573
|
-
]), await
|
|
7605
|
+
]), await Lo("8️⃣ ", t, r, n), n.publishedTo === "npm" ? await q("9️⃣ Create GitHub release", "gh", [
|
|
7574
7606
|
"release",
|
|
7575
7607
|
"create",
|
|
7576
|
-
`v${
|
|
7608
|
+
`v${t.version ?? "unknown"}`,
|
|
7577
7609
|
"--target",
|
|
7578
7610
|
"main",
|
|
7579
7611
|
"--generate-notes",
|
|
7580
7612
|
"--latest"
|
|
7581
|
-
]) :
|
|
7613
|
+
]) : Z(`9️⃣ Publishing NOT required for package with type identifier of '${n.typeId}'.`), X(`Project version '${t.version ?? "unknown"}' released.`);
|
|
7582
7614
|
} catch (e) {
|
|
7583
7615
|
console.error("❌ Error releasing project", e), process.exit(1);
|
|
7584
7616
|
}
|
|
7585
7617
|
}
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await Hn("logo.svg"), n.iconDark ??= await Hn("logoDark.svg"), await Un("config.json", n), n;
|
|
7590
|
-
}
|
|
7591
|
-
async function Eo(e, t) {
|
|
7592
|
-
q(`${e} Build connector project configuration`);
|
|
7593
|
-
let [n, r] = await Promise.all([W("config.json"), Vn("src/index.ts")]), i = /* @__PURE__ */ _o(na, n);
|
|
7594
|
-
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
7595
|
-
let a = Yn(r);
|
|
7596
|
-
return await Oo(t, n, a, oa(a));
|
|
7597
|
-
}
|
|
7598
|
-
async function Do(e, t) {
|
|
7599
|
-
q(`${e} Build presenter project configuration`);
|
|
7600
|
-
let [n, r] = await Promise.all([W("config.json"), Vn("src/index.ts")]), i = /* @__PURE__ */ _o(yo, n);
|
|
7601
|
-
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
7602
|
-
return await Oo(t, n, Yn(r));
|
|
7603
|
-
}
|
|
7604
|
-
async function Oo(e, t, n, r) {
|
|
7605
|
-
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 Un("config.json", t), t;
|
|
7606
|
-
}
|
|
7607
|
-
async function ko() {
|
|
7618
|
+
//#endregion
|
|
7619
|
+
//#region src/actions/syncProjectWithGitHub.ts
|
|
7620
|
+
async function zo() {
|
|
7608
7621
|
try {
|
|
7609
|
-
|
|
7610
|
-
let e = await
|
|
7611
|
-
|
|
7612
|
-
case "connector":
|
|
7613
|
-
await Eo("2️⃣ ", e);
|
|
7614
|
-
break;
|
|
7615
|
-
case "presenter":
|
|
7616
|
-
await Do("2️⃣ ", e);
|
|
7617
|
-
break;
|
|
7618
|
-
default: await To("2️⃣ ", e);
|
|
7619
|
-
}
|
|
7620
|
-
await zn("3️⃣ Stage changes", "git", ["add", "."]), await zn("4️⃣ Commit changes", "git", [
|
|
7622
|
+
Y("Synchronise Project with GitHub");
|
|
7623
|
+
let e = await J("package.json"), t = Wr((await J("config.json")).id);
|
|
7624
|
+
await Jr("1️⃣ ", e), await qr("2️⃣ ", e, t), await Ir("3️⃣ Stage changes", "git", ["add", "."]), await Ir("4️⃣ Commit changes", "git", [
|
|
7621
7625
|
"commit",
|
|
7622
7626
|
"-m",
|
|
7623
7627
|
`v${e.version ?? "unknown"}`
|
|
7624
|
-
]), await
|
|
7628
|
+
]), await Ir("5️⃣ Push changes", "git", [
|
|
7625
7629
|
"push",
|
|
7626
7630
|
"origin",
|
|
7627
7631
|
"main:main"
|
|
7628
|
-
]),
|
|
7632
|
+
]), X(`Project version '${e.version ?? "unknown"}' synchronised with GitHub.`);
|
|
7629
7633
|
} catch (e) {
|
|
7630
7634
|
console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
|
|
7631
7635
|
}
|
|
7632
7636
|
}
|
|
7633
|
-
|
|
7637
|
+
//#endregion
|
|
7638
|
+
//#region src/actions/testProject.ts
|
|
7639
|
+
var Bo = [
|
|
7640
|
+
"1️⃣ ",
|
|
7641
|
+
"2️⃣ ",
|
|
7642
|
+
"3️⃣ ",
|
|
7643
|
+
"4️⃣ "
|
|
7644
|
+
], Vo = [{
|
|
7645
|
+
id: "unit",
|
|
7646
|
+
label: "Run unit tests",
|
|
7647
|
+
command: "vitest",
|
|
7648
|
+
arguments: ["run", "--passWithNoTests"],
|
|
7649
|
+
configFileName: "vitest.config.ts"
|
|
7650
|
+
}, {
|
|
7651
|
+
id: "e2e",
|
|
7652
|
+
label: "Run end-to-end tests",
|
|
7653
|
+
command: "playwright",
|
|
7654
|
+
arguments: ["test", "--pass-with-no-tests"],
|
|
7655
|
+
configFileName: "playwright.config.ts"
|
|
7656
|
+
}];
|
|
7657
|
+
async function Ho(e = ["unit"], t = !1) {
|
|
7634
7658
|
try {
|
|
7635
|
-
|
|
7659
|
+
Y("Test Project");
|
|
7636
7660
|
let n = 0;
|
|
7637
|
-
for (let r of
|
|
7638
|
-
if (!e.includes(r.id) || await
|
|
7661
|
+
for (let r of Vo) {
|
|
7662
|
+
if (!e.includes(r.id) || await Br(r.configFileName) === null) continue;
|
|
7639
7663
|
let i = t && r.id === "unit" ? ["--coverage"] : [];
|
|
7640
|
-
await
|
|
7664
|
+
await q(`${Bo[n] ?? ""} ${r.label}`, r.command, [...r.arguments, ...i]), n += 1;
|
|
7641
7665
|
}
|
|
7642
7666
|
if (n === 0) {
|
|
7643
7667
|
console.warn("\n⚠️ No tests configured for this project.\n");
|
|
7644
7668
|
return;
|
|
7645
7669
|
}
|
|
7646
|
-
|
|
7670
|
+
X("Project tested");
|
|
7647
7671
|
} catch (e) {
|
|
7648
7672
|
console.error("❌ Error testing project", e), process.exit(1);
|
|
7649
7673
|
}
|
|
7650
7674
|
}
|
|
7651
|
-
async function jo(e, t, n = "./") {
|
|
7652
|
-
if (q(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
|
|
7653
|
-
else {
|
|
7654
|
-
let e = t.version, n = t.version.split(".");
|
|
7655
|
-
t.version = `${n[0] ?? "unknown"}.${n[1] ?? "unknown"}.${String(Number(n[2]) + 1)}`, console.info(`Project version bumped from '${e}' to '${t.version}'.`);
|
|
7656
|
-
}
|
|
7657
|
-
await Un(`${n}package.json`, t);
|
|
7658
|
-
}
|
|
7659
|
-
async function Mo(e, t, n, r) {
|
|
7660
|
-
if (r.typeId === "app") q(`${e} Register module`), await uo();
|
|
7661
|
-
else if (r.typeId === "engine") q(`${e} Register module`), await mo(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await po(n);
|
|
7662
|
-
else if (r.uploadGroupName === void 0) q(`${e} Registration NOT required`);
|
|
7663
|
-
else {
|
|
7664
|
-
q(`${e} Register module`);
|
|
7665
|
-
let i = n.id.split("-").slice(2).join("-");
|
|
7666
|
-
await mo(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await po(n);
|
|
7667
|
-
}
|
|
7668
|
-
}
|
|
7669
7675
|
//#endregion
|
|
7670
|
-
export {
|
|
7676
|
+
export { ni as auditDependencies, ri as buildProject, gi as checkProject, ko as documentProject, Ao as formatCode, jo as lintCode, Io as publishProject, Ro as releaseProject, zo as syncProjectWithGitHub, Ho as testProject, No as uploadDirectoryToR2 };
|