@dpuse/dpuse-development 0.3.519 → 0.3.521
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.
|
@@ -6697,7 +6697,7 @@ async function oi() {
|
|
|
6697
6697
|
//#endregion
|
|
6698
6698
|
//#region src/operations/documentDependencies.ts
|
|
6699
6699
|
var si = "<!-- DEPENDENCY_LICENSES_START -->", ci = "<!-- DEPENDENCY_LICENSES_END -->";
|
|
6700
|
-
async function li(e = ""
|
|
6700
|
+
async function li(e = "MIT") {
|
|
6701
6701
|
try {
|
|
6702
6702
|
Ar("Document Dependencies"), await Sr("licenses/downloads"), await wr("1️⃣ Identify production licenses", "license-checker-rseidelsohn", [
|
|
6703
6703
|
"--production",
|
|
@@ -6715,45 +6715,56 @@ 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️⃣4️⃣"), 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 n = await Q("licenses/licenses.json");
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6725
|
+
let [t, n] = await Promise.all([Q("licenses/licenses.json"), Q("licenses/licenseTree.json")]), r = /* @__PURE__ */ new Map();
|
|
6726
|
+
for (let [e, n] of Object.entries(t)) r.set(e, di(e, n));
|
|
6727
|
+
await Promise.all(r.values().map(async (e) => {
|
|
6728
|
+
e.publishedDate = await fi(e.name, e.installedVersion);
|
|
6729
|
+
}));
|
|
6730
|
+
let i = [];
|
|
6731
|
+
n.dependencies != null && pi(n.dependencies, r, i, "");
|
|
6732
|
+
let a = `|Name|License|Version|Published|Document|\n|:-|:-|:-:|:-|:-|\n${i.join("")}`;
|
|
6733
|
+
await kr("README.md", Ir(await Er("./README.md"), a, si, ci));
|
|
6734
|
+
}
|
|
6735
|
+
function di(e, t) {
|
|
6736
|
+
let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
|
|
6737
|
+
return {
|
|
6738
|
+
name: r,
|
|
6739
|
+
licenseTypes: t.licenses,
|
|
6740
|
+
installedVersion: i,
|
|
6741
|
+
author: t.publisher ?? "",
|
|
6742
|
+
publishedDate: "",
|
|
6743
|
+
...t.licenseFile != null && { licenseFileLink: t.licenseFile }
|
|
6744
|
+
};
|
|
6745
|
+
}
|
|
6746
|
+
async function fi(e, t) {
|
|
6747
|
+
try {
|
|
6748
|
+
let n = await fetch(`https://registry.npmjs.org/${e.replace("/", "%2F")}`);
|
|
6749
|
+
if (n.ok) {
|
|
6750
|
+
let e = await n.json();
|
|
6751
|
+
return new Map(Object.entries(e.time ?? {})).get(t) ?? "";
|
|
6746
6752
|
}
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6753
|
+
} catch {}
|
|
6754
|
+
return "";
|
|
6755
|
+
}
|
|
6756
|
+
function pi(e, t, n, r) {
|
|
6757
|
+
let i = Object.keys(e).at(-1);
|
|
6758
|
+
for (let [a, o] of Object.entries(e)) {
|
|
6759
|
+
let e = a === i, s = o.version ?? "", c = e ? "└── " : "├── ", l = e ? " " : "│ ";
|
|
6760
|
+
n.push(mi(`${r}${c}${a}`, s, t.get(`${a}@${s}`))), o.dependencies != null && pi(o.dependencies, t, n, `${r}${l}`);
|
|
6752
6761
|
}
|
|
6753
|
-
let a = Ir(await Er("./README.md"), i, si, ci);
|
|
6754
|
-
await kr("README.md", a), console.info("OWASP audit badge(s) inserted into 'README.md'"), await kr("README.md", a);
|
|
6755
6762
|
}
|
|
6756
|
-
function
|
|
6763
|
+
function mi(e, t, n) {
|
|
6764
|
+
let r = n?.licenseTypes ?? "n/a", i = n?.publishedDate ? hi(n.publishedDate.split("T", 1)[0]) : "n/a", a;
|
|
6765
|
+
return a = n?.licenseFileLink == null || n.licenseFileLink === "" ? "⚠️ No license file" : `[${n.licenseFileLink.slice(Math.max(0, n.licenseFileLink.lastIndexOf("/") + 1))}](${n.licenseFileLink})`, `|${e}|${r}|${t}|${i}|${a}|\n`;
|
|
6766
|
+
}
|
|
6767
|
+
function hi(e) {
|
|
6757
6768
|
if (e == null || e === "") return "n/a";
|
|
6758
6769
|
let t = e.split("T", 1)[0];
|
|
6759
6770
|
if (t == null || t === "") return "n/a";
|
|
@@ -6762,7 +6773,7 @@ function di(e) {
|
|
|
6762
6773
|
}
|
|
6763
6774
|
//#endregion
|
|
6764
6775
|
//#region src/operations/formatCode.ts
|
|
6765
|
-
async function
|
|
6776
|
+
async function gi() {
|
|
6766
6777
|
try {
|
|
6767
6778
|
Ar("Format Code"), await Z("1️⃣ Format", "prettier", [
|
|
6768
6779
|
"--write",
|
|
@@ -6777,7 +6788,7 @@ async function fi() {
|
|
|
6777
6788
|
}
|
|
6778
6789
|
//#endregion
|
|
6779
6790
|
//#region src/operations/lintCode.ts
|
|
6780
|
-
async function
|
|
6791
|
+
async function _i() {
|
|
6781
6792
|
try {
|
|
6782
6793
|
Ar("Lint Code"), await Z("1️⃣ Lint", "eslint", ["."]), jr("Code linted.");
|
|
6783
6794
|
} catch (e) {
|
|
@@ -6786,7 +6797,7 @@ async function pi() {
|
|
|
6786
6797
|
}
|
|
6787
6798
|
//#endregion
|
|
6788
6799
|
//#region src/operations/updateDPUseDependencies.ts
|
|
6789
|
-
var
|
|
6800
|
+
var vi = [
|
|
6790
6801
|
"1️⃣",
|
|
6791
6802
|
"2️⃣",
|
|
6792
6803
|
"3️⃣",
|
|
@@ -6797,23 +6808,23 @@ var mi = [
|
|
|
6797
6808
|
"8️⃣",
|
|
6798
6809
|
"9️⃣"
|
|
6799
6810
|
];
|
|
6800
|
-
async function
|
|
6811
|
+
async function yi(e = []) {
|
|
6801
6812
|
try {
|
|
6802
6813
|
Ar("Update '@dpuse/dpuse' Dependencies");
|
|
6803
6814
|
for (let [t, n] of e.entries()) {
|
|
6804
|
-
let e =
|
|
6805
|
-
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
|
|
6815
|
+
let e = vi.at(t) ?? "🔢";
|
|
6816
|
+
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 bi(Mr((await Q("config.json")).id)));
|
|
6806
6817
|
}
|
|
6807
6818
|
jr("'@dpuse/dpuse' dependencies updated.");
|
|
6808
6819
|
} catch (e) {
|
|
6809
6820
|
console.error("❌ Error updating '@dpuse/dpuse' dependencies.", e), process.exit(1);
|
|
6810
6821
|
}
|
|
6811
6822
|
}
|
|
6812
|
-
async function
|
|
6823
|
+
async function bi(e) {
|
|
6813
6824
|
let t = n.dirname(o(import.meta.url));
|
|
6814
|
-
await
|
|
6825
|
+
await xi(t, "../", ".editorconfig"), await xi(t, "../", ".gitattributes"), await xi(t, "../", e.isPublished ? ".gitignore_published" : ".gitignore_unpublished", ".gitignore2"), await xi(t, "../", ".markdownlint.json"), await xi(t, "../", "LICENSE"), await xi(t, "../", "tsconfig.json", "tsconfig2.json"), e.typeId === "eslint" || (await xi(t, "../", "eslint.config.ts", "eslint.config2.ts"), await xi(t, "../", "vite.config.ts", "vite.config2.ts"), await xi(t, "../", "vitest.config.ts", "vitest.config2.ts"));
|
|
6815
6826
|
}
|
|
6816
|
-
async function
|
|
6827
|
+
async function xi(e, t, r, i) {
|
|
6817
6828
|
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;
|
|
6818
6829
|
try {
|
|
6819
6830
|
c = await Er(o);
|
|
@@ -6827,6 +6838,6 @@ async function _i(e, t, r, i) {
|
|
|
6827
6838
|
await kr(s, a), console.info(`ℹ️ File '${i ?? r}' synchronised.`);
|
|
6828
6839
|
}
|
|
6829
6840
|
//#endregion
|
|
6830
|
-
export { ri as auditDependencies, Ur as buildProject, oi as checkDependencies, li as documentDependencies,
|
|
6841
|
+
export { ri as auditDependencies, Ur as buildProject, oi as checkDependencies, li as documentDependencies, gi as formatCode, _i as lintCode, Wr as releaseProject, Zr as syncProjectWithGitHub, Qr as testProject, yi as updateDPUseDependencies, Rr as uploadDirectoryToR2 };
|
|
6831
6842
|
|
|
6832
6843
|
//# sourceMappingURL=dpuse-development.es.js.map
|