@dpuse/dpuse-development 0.3.515 → 0.3.517
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.
|
@@ -6696,9 +6696,10 @@ async function oi() {
|
|
|
6696
6696
|
}
|
|
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 = "", t = !0) {
|
|
6700
6701
|
try {
|
|
6701
|
-
Ar("Document Dependencies"), await Sr("licenses/downloads"), await wr("1️⃣ Identify licenses", "license-checker-rseidelsohn", [
|
|
6702
|
+
Ar("Document Dependencies"), await Sr("licenses/downloads"), await wr("1️⃣ Identify production licenses", "license-checker-rseidelsohn", [
|
|
6702
6703
|
"--production",
|
|
6703
6704
|
"--json",
|
|
6704
6705
|
"--files",
|
|
@@ -6709,19 +6710,47 @@ async function si(e = "", t = !0) {
|
|
|
6709
6710
|
`"${e}"`,
|
|
6710
6711
|
"--out",
|
|
6711
6712
|
"licenses/licenses.json"
|
|
6712
|
-
]), await Tr("
|
|
6713
|
+
]), await Tr("2️⃣ Identify transitive dependencies", "npm", [
|
|
6713
6714
|
"ls",
|
|
6714
6715
|
"--all",
|
|
6715
6716
|
"--json",
|
|
6716
6717
|
"--omit=dev"
|
|
6717
|
-
], "licenses/licenseTree.json"), jr("Dependencies documented.");
|
|
6718
|
+
], "licenses/licenseTree.json"), await ui("3️⃣", t), jr("Dependencies documented.");
|
|
6718
6719
|
} catch (e) {
|
|
6719
6720
|
console.error("❌ Error documenting dependencies.", e), process.exit(1);
|
|
6720
6721
|
}
|
|
6721
6722
|
}
|
|
6723
|
+
async function ui(e, t) {
|
|
6724
|
+
$(`${e} Insert licenses into 'README.md'`);
|
|
6725
|
+
let n = await Q("licenses/licenses.json"), r = t ? await Q("licenses/licenseTree.json") : [], i = [...(() => {
|
|
6726
|
+
let e = /* @__PURE__ */ new Map();
|
|
6727
|
+
for (let t of n) e.set(t.name, { ...t });
|
|
6728
|
+
for (let t of r) {
|
|
6729
|
+
let n = e.get(t.name);
|
|
6730
|
+
n && e.set(t.name, {
|
|
6731
|
+
...n,
|
|
6732
|
+
dependencyCount: t.requires?.length ?? 0
|
|
6733
|
+
});
|
|
6734
|
+
}
|
|
6735
|
+
return e.values();
|
|
6736
|
+
})()], a = "|Name|Type|Installed|Latest|Latest Released|Deps|Document|\n|:-|:-|:-:|:-:|:-|-:|:-|\n";
|
|
6737
|
+
for (let e of i) {
|
|
6738
|
+
let t = e.installedVersion === e.remoteVersion ? e.installedVersion : `${e.installedVersion} ⚠️`, n = e.latestRemoteModified ? di(e.latestRemoteModified.split("T", 1)[0]) : "n/a", r = e.dependencyCount != null && e.dependencyCount >= 0 ? e.dependencyCount : "n/a", i;
|
|
6739
|
+
i = e.licenseFileLink == null || e.licenseFileLink == "" ? "⚠️ No license file" : `[${e.licenseFileLink.slice(Math.max(0, e.licenseFileLink.lastIndexOf("/") + 1))}](${e.licenseFileLink})`, a += `|${e.name}|${e.licenseType}|${t}|${e.remoteVersion}|${n}|${String(r)}|${i}|\n`;
|
|
6740
|
+
}
|
|
6741
|
+
let o = Ir(await Er("./README.md"), a, si, ci);
|
|
6742
|
+
await kr("README.md", o), console.info("OWASP audit badge(s) inserted into 'README.md'"), await kr("README.md", o);
|
|
6743
|
+
}
|
|
6744
|
+
function di(e) {
|
|
6745
|
+
if (e == null || e === "") return "n/a";
|
|
6746
|
+
let t = e.split("T", 1)[0];
|
|
6747
|
+
if (t == null || t === "") return "n/a";
|
|
6748
|
+
let n = new Date(t), r = /* @__PURE__ */ new Date(), i = (r.getFullYear() - n.getFullYear()) * 12 + (r.getMonth() - n.getMonth());
|
|
6749
|
+
return r.getDate() < n.getDate() && --i, i === 0 ? `this month: ${t}` : i === 1 ? `1 month ago: ${t}` : i <= 6 ? `${String(i)} months ago: ${t}` : i <= 12 ? `${String(i)} months ago: ${t} ⚠️` : `${String(i)} months ago: ${t}❗`;
|
|
6750
|
+
}
|
|
6722
6751
|
//#endregion
|
|
6723
6752
|
//#region src/operations/formatCode.ts
|
|
6724
|
-
async function
|
|
6753
|
+
async function fi() {
|
|
6725
6754
|
try {
|
|
6726
6755
|
Ar("Format Code"), await Z("1️⃣ Format", "prettier", [
|
|
6727
6756
|
"--write",
|
|
@@ -6736,7 +6765,7 @@ async function ci() {
|
|
|
6736
6765
|
}
|
|
6737
6766
|
//#endregion
|
|
6738
6767
|
//#region src/operations/lintCode.ts
|
|
6739
|
-
async function
|
|
6768
|
+
async function pi() {
|
|
6740
6769
|
try {
|
|
6741
6770
|
Ar("Lint Code"), await Z("1️⃣ Lint", "eslint", ["."]), jr("Code linted.");
|
|
6742
6771
|
} catch (e) {
|
|
@@ -6745,7 +6774,7 @@ async function li() {
|
|
|
6745
6774
|
}
|
|
6746
6775
|
//#endregion
|
|
6747
6776
|
//#region src/operations/updateDPUseDependencies.ts
|
|
6748
|
-
var
|
|
6777
|
+
var mi = [
|
|
6749
6778
|
"1️⃣",
|
|
6750
6779
|
"2️⃣",
|
|
6751
6780
|
"3️⃣",
|
|
@@ -6756,23 +6785,23 @@ var ui = [
|
|
|
6756
6785
|
"8️⃣",
|
|
6757
6786
|
"9️⃣"
|
|
6758
6787
|
];
|
|
6759
|
-
async function
|
|
6788
|
+
async function hi(e = []) {
|
|
6760
6789
|
try {
|
|
6761
6790
|
Ar("Update '@dpuse/dpuse' Dependencies");
|
|
6762
6791
|
for (let [t, n] of e.entries()) {
|
|
6763
|
-
let e =
|
|
6764
|
-
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
|
|
6792
|
+
let e = mi.at(t) ?? "🔢";
|
|
6793
|
+
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 gi(Mr((await Q("config.json")).id)));
|
|
6765
6794
|
}
|
|
6766
6795
|
jr("'@dpuse/dpuse' dependencies updated.");
|
|
6767
6796
|
} catch (e) {
|
|
6768
6797
|
console.error("❌ Error updating '@dpuse/dpuse' dependencies.", e), process.exit(1);
|
|
6769
6798
|
}
|
|
6770
6799
|
}
|
|
6771
|
-
async function
|
|
6800
|
+
async function gi(e) {
|
|
6772
6801
|
let t = n.dirname(o(import.meta.url));
|
|
6773
|
-
await
|
|
6802
|
+
await _i(t, "../", ".editorconfig"), await _i(t, "../", ".gitattributes"), await _i(t, "../", e.isPublished ? ".gitignore_published" : ".gitignore_unpublished", ".gitignore2"), await _i(t, "../", ".markdownlint.json"), await _i(t, "../", "LICENSE"), await _i(t, "../", "tsconfig.json", "tsconfig2.json"), e.typeId === "eslint" || (await _i(t, "../", "eslint.config.ts", "eslint.config2.ts"), await _i(t, "../", "vite.config.ts", "vite.config2.ts"), await _i(t, "../", "vitest.config.ts", "vitest.config2.ts"));
|
|
6774
6803
|
}
|
|
6775
|
-
async function
|
|
6804
|
+
async function _i(e, t, r, i) {
|
|
6776
6805
|
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;
|
|
6777
6806
|
try {
|
|
6778
6807
|
c = await Er(o);
|
|
@@ -6786,6 +6815,6 @@ async function pi(e, t, r, i) {
|
|
|
6786
6815
|
await kr(s, a), console.info(`ℹ️ File '${i ?? r}' synchronised.`);
|
|
6787
6816
|
}
|
|
6788
6817
|
//#endregion
|
|
6789
|
-
export { ri as auditDependencies, Ur as buildProject, oi as checkDependencies,
|
|
6818
|
+
export { ri as auditDependencies, Ur as buildProject, oi as checkDependencies, li as documentDependencies, fi as formatCode, pi as lintCode, Wr as releaseProject, Zr as syncProjectWithGitHub, Qr as testProject, hi as updateDPUseDependencies, Rr as uploadDirectoryToR2 };
|
|
6790
6819
|
|
|
6791
6820
|
//# sourceMappingURL=dpuse-development.es.js.map
|