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