@dpuse/dpuse-development 0.3.518 → 0.3.520
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.
|
@@ -6715,28 +6715,59 @@ async function li(e = "", t = !0) {
|
|
|
6715
6715
|
"--all",
|
|
6716
6716
|
"--json",
|
|
6717
6717
|
"--omit=dev"
|
|
6718
|
-
], "licenses/licenseTree.json"), await ui("3️⃣"
|
|
6718
|
+
], "licenses/licenseTree.json"), await ui("3️⃣"), jr("Dependencies documented.");
|
|
6719
6719
|
} catch (e) {
|
|
6720
6720
|
console.error("❌ Error documenting dependencies.", e), process.exit(1);
|
|
6721
6721
|
}
|
|
6722
6722
|
}
|
|
6723
|
-
async function ui(e
|
|
6723
|
+
async function ui(e) {
|
|
6724
6724
|
$(`${e} Insert licenses into 'README.md'`);
|
|
6725
|
-
let
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6725
|
+
let t = await Q("licenses/licenses.json"), n = /* @__PURE__ */ new Map();
|
|
6726
|
+
for (let [e, r] of Object.entries(t)) {
|
|
6727
|
+
let [t, i] = di(e, r);
|
|
6728
|
+
n.set(t, i);
|
|
6729
|
+
}
|
|
6730
|
+
await Promise.all(n.values().map(async (e) => {
|
|
6731
|
+
e.latestRemoteModified = await fi(e.name, e.installedVersion);
|
|
6732
|
+
}));
|
|
6733
|
+
let r = "|Name|Type|Installed|Latest|Latest Released|Deps|Document|\n|:-|:-|:-:|:-:|:-|-:|:-|\n";
|
|
6734
|
+
for (let e of n.values()) r += pi(e);
|
|
6735
|
+
let i = Ir(await Er("./README.md"), r, si, ci);
|
|
6736
|
+
await kr("README.md", i), console.info("OWASP audit badge(s) inserted into 'README.md'"), await kr("README.md", i);
|
|
6737
|
+
}
|
|
6738
|
+
function di(e, t) {
|
|
6739
|
+
let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
|
|
6740
|
+
return [r, {
|
|
6741
|
+
department: "",
|
|
6742
|
+
relatedTo: "",
|
|
6743
|
+
name: r,
|
|
6744
|
+
licensePeriod: "",
|
|
6745
|
+
material: "",
|
|
6746
|
+
licenseType: t.licenses,
|
|
6747
|
+
link: t.repository ?? "",
|
|
6748
|
+
remoteVersion: i,
|
|
6749
|
+
installedVersion: i,
|
|
6750
|
+
definedVersion: i,
|
|
6751
|
+
author: t.publisher ?? "",
|
|
6752
|
+
latestRemoteModified: "",
|
|
6753
|
+
...t.licenseFile != null && { licenseFileLink: t.licenseFile }
|
|
6754
|
+
}];
|
|
6755
|
+
}
|
|
6756
|
+
async function fi(e, t) {
|
|
6757
|
+
try {
|
|
6758
|
+
let n = await fetch(`https://registry.npmjs.org/${e.replace("/", "%2F")}`);
|
|
6759
|
+
if (n.ok) {
|
|
6760
|
+
let e = await n.json();
|
|
6761
|
+
return new Map(Object.entries(e.time ?? {})).get(t) ?? "";
|
|
6762
|
+
}
|
|
6763
|
+
} catch {}
|
|
6764
|
+
return "";
|
|
6765
|
+
}
|
|
6766
|
+
function pi(e) {
|
|
6767
|
+
let t = e.installedVersion === e.remoteVersion ? e.installedVersion : `${e.installedVersion} ⚠️`, n = e.latestRemoteModified ? mi(e.latestRemoteModified.split("T", 1)[0]) : "n/a", r = e.dependencyCount != null && e.dependencyCount >= 0 ? e.dependencyCount : "n/a", i;
|
|
6768
|
+
return i = e.licenseFileLink == null || e.licenseFileLink == "" ? "⚠️ No license file" : `[${e.licenseFileLink.slice(Math.max(0, e.licenseFileLink.lastIndexOf("/") + 1))}](${e.licenseFileLink})`, `|${e.name}|${e.licenseType}|${t}|${e.remoteVersion}|${n}|${String(r)}|${i}|\n`;
|
|
6769
|
+
}
|
|
6770
|
+
function mi(e) {
|
|
6740
6771
|
if (e == null || e === "") return "n/a";
|
|
6741
6772
|
let t = e.split("T", 1)[0];
|
|
6742
6773
|
if (t == null || t === "") return "n/a";
|
|
@@ -6745,7 +6776,7 @@ function di(e) {
|
|
|
6745
6776
|
}
|
|
6746
6777
|
//#endregion
|
|
6747
6778
|
//#region src/operations/formatCode.ts
|
|
6748
|
-
async function
|
|
6779
|
+
async function hi() {
|
|
6749
6780
|
try {
|
|
6750
6781
|
Ar("Format Code"), await Z("1️⃣ Format", "prettier", [
|
|
6751
6782
|
"--write",
|
|
@@ -6760,7 +6791,7 @@ async function fi() {
|
|
|
6760
6791
|
}
|
|
6761
6792
|
//#endregion
|
|
6762
6793
|
//#region src/operations/lintCode.ts
|
|
6763
|
-
async function
|
|
6794
|
+
async function gi() {
|
|
6764
6795
|
try {
|
|
6765
6796
|
Ar("Lint Code"), await Z("1️⃣ Lint", "eslint", ["."]), jr("Code linted.");
|
|
6766
6797
|
} catch (e) {
|
|
@@ -6769,7 +6800,7 @@ async function pi() {
|
|
|
6769
6800
|
}
|
|
6770
6801
|
//#endregion
|
|
6771
6802
|
//#region src/operations/updateDPUseDependencies.ts
|
|
6772
|
-
var
|
|
6803
|
+
var _i = [
|
|
6773
6804
|
"1️⃣",
|
|
6774
6805
|
"2️⃣",
|
|
6775
6806
|
"3️⃣",
|
|
@@ -6780,23 +6811,23 @@ var mi = [
|
|
|
6780
6811
|
"8️⃣",
|
|
6781
6812
|
"9️⃣"
|
|
6782
6813
|
];
|
|
6783
|
-
async function
|
|
6814
|
+
async function vi(e = []) {
|
|
6784
6815
|
try {
|
|
6785
6816
|
Ar("Update '@dpuse/dpuse' Dependencies");
|
|
6786
6817
|
for (let [t, n] of e.entries()) {
|
|
6787
|
-
let e =
|
|
6788
|
-
n === "eslint" ? await Z(`${e} Update '${n}'`, "npm", ["install", "@dpuse/eslint-config-dpuse@latest"]) : (await Z(`${e} Update '${n}'`, "npm", ["install", `@dpuse/dpuse-${n}@latest`]), n === "development" && await
|
|
6818
|
+
let e = _i.at(t) ?? "🔢";
|
|
6819
|
+
n === "eslint" ? await Z(`${e} Update '${n}'`, "npm", ["install", "@dpuse/eslint-config-dpuse@latest"]) : (await Z(`${e} Update '${n}'`, "npm", ["install", `@dpuse/dpuse-${n}@latest`]), n === "development" && await yi(Mr((await Q("config.json")).id)));
|
|
6789
6820
|
}
|
|
6790
6821
|
jr("'@dpuse/dpuse' dependencies updated.");
|
|
6791
6822
|
} catch (e) {
|
|
6792
6823
|
console.error("❌ Error updating '@dpuse/dpuse' dependencies.", e), process.exit(1);
|
|
6793
6824
|
}
|
|
6794
6825
|
}
|
|
6795
|
-
async function
|
|
6826
|
+
async function yi(e) {
|
|
6796
6827
|
let t = n.dirname(o(import.meta.url));
|
|
6797
|
-
await
|
|
6828
|
+
await bi(t, "../", ".editorconfig"), await bi(t, "../", ".gitattributes"), await bi(t, "../", e.isPublished ? ".gitignore_published" : ".gitignore_unpublished", ".gitignore2"), await bi(t, "../", ".markdownlint.json"), await bi(t, "../", "LICENSE"), await bi(t, "../", "tsconfig.json", "tsconfig2.json"), e.typeId === "eslint" || (await bi(t, "../", "eslint.config.ts", "eslint.config2.ts"), await bi(t, "../", "vite.config.ts", "vite.config2.ts"), await bi(t, "../", "vitest.config.ts", "vitest.config2.ts"));
|
|
6798
6829
|
}
|
|
6799
|
-
async function
|
|
6830
|
+
async function bi(e, t, r, i) {
|
|
6800
6831
|
let a = await Er(n.resolve(e, `${t}${r}`)), o = n.resolve(process.cwd(), r.split("_", 1)[0] ?? r), s = n.resolve(process.cwd(), i ?? r), c;
|
|
6801
6832
|
try {
|
|
6802
6833
|
c = await Er(o);
|
|
@@ -6810,6 +6841,6 @@ async function _i(e, t, r, i) {
|
|
|
6810
6841
|
await kr(s, a), console.info(`ℹ️ File '${i ?? r}' synchronised.`);
|
|
6811
6842
|
}
|
|
6812
6843
|
//#endregion
|
|
6813
|
-
export { ri as auditDependencies, Ur as buildProject, oi as checkDependencies, li as documentDependencies,
|
|
6844
|
+
export { ri as auditDependencies, Ur as buildProject, oi as checkDependencies, li as documentDependencies, hi as formatCode, gi as lintCode, Wr as releaseProject, Zr as syncProjectWithGitHub, Qr as testProject, vi as updateDPUseDependencies, Rr as uploadDirectoryToR2 };
|
|
6814
6845
|
|
|
6815
6846
|
//# sourceMappingURL=dpuse-development.es.js.map
|