@dpuse/dpuse-development 0.3.546 → 0.3.548

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.
@@ -5806,7 +5806,7 @@ function G(e) {
5806
5806
  console.info(`\n${t}`), console.info(`▶️ ${e}`), console.info(`${t}`);
5807
5807
  }
5808
5808
  function K(e) {
5809
- console.info(`\n✅ ${e}\n`);
5809
+ console.info(`\n✅ ${e}\n`);
5810
5810
  }
5811
5811
  function q(e) {
5812
5812
  console.info(`\n${e}\n`);
@@ -5860,24 +5860,20 @@ function Un(e, t, n, r) {
5860
5860
  //#region src/actions/auditDependencies.ts
5861
5861
  async function Wn() {
5862
5862
  try {
5863
- G("Audit Dependencies"), await Nn("1️⃣ Check using 'npm audit'", "npm", ["audit"]), K("Dependencies audited.");
5863
+ G("Audit Dependencies"), await Nn("1️⃣ Check using 'npm audit'", "npm", ["audit"]), K("Dependencies audited.");
5864
5864
  } catch (e) {
5865
- console.error("❌ Error auditing dependencies.", e), process.exit(1);
5865
+ console.error("❌ Error auditing dependencies.", e), process.exit(1);
5866
5866
  }
5867
5867
  }
5868
5868
  //#endregion
5869
5869
  //#region src/actions/checkConfigFiles.ts
5870
- async function Gn(e = []) {
5870
+ async function Gn() {
5871
5871
  try {
5872
- G("Update '@dpuse/dpuse' Dependencies");
5873
- for (let t of e) {
5874
- if (t === "development") continue;
5875
- let e = zn((await W("config.json")).id), r = n.dirname(o(import.meta.url));
5876
- await Kn(r, "../", ".editorconfig"), await Kn(r, "../", ".gitattributes"), await Kn(r, "../", e.isPublished ? ".gitignore_published" : ".gitignore_unpublished"), await Kn(r, "../", ".markdownlint.json"), await Kn(r, "../", "LICENSE");
5877
- }
5878
- K("'@dpuse/dpuse' dependencies updated.");
5872
+ G("Check configuration files.");
5873
+ let e = zn((await W("config.json")).id), t = n.dirname(o(import.meta.url));
5874
+ await Kn(t, "../", ".editorconfig"), await Kn(t, "../", ".gitattributes"), await Kn(t, "../", e.isPublished ? ".gitignore_published" : ".gitignore_unpublished"), await Kn(t, "../", ".markdownlint.json"), await Kn(t, "../", "LICENSE"), K("Configuration files checked..");
5879
5875
  } catch (e) {
5880
- console.error("❌ Error updating '@dpuse/dpuse' dependencies.", e), process.exit(1);
5876
+ console.error("❌ Error checking configuration files.", e), process.exit(1);
5881
5877
  }
5882
5878
  }
5883
5879
  async function Kn(e, t, r) {
@@ -5888,22 +5884,22 @@ async function Kn(e, t, r) {
5888
5884
  if (e.code !== "ENOENT") throw e;
5889
5885
  }
5890
5886
  if (o === i) {
5891
- console.info(`ℹ️ File '${r.split("_", 1)[0] ?? r}' is already up to date.`);
5887
+ console.info(`ℹ️ File '${r.split("_", 1)[0] ?? r}' is the same`);
5892
5888
  return;
5893
5889
  }
5894
- console.info(`⚠️ File '${r.split("_", 1)[0] ?? r}' is not the same.`);
5890
+ console.info(`⚠️ File '${r.split("_", 1)[0] ?? r}' is NOT the same.`);
5895
5891
  }
5896
5892
  //#endregion
5897
5893
  //#region src/actions/checkDependencies.ts
5898
5894
  async function qn() {
5899
5895
  try {
5900
- G("Check Dependencies"), await Nn("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), await Nn("2️⃣ Check using 'npm-check-updates'", "npm-check-updates", [
5896
+ G("Check Dependencies"), await Nn("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), await Nn("2️⃣ Check using 'npm-check-updates'", "npm-check-updates", [
5901
5897
  "-i",
5902
5898
  "--dep",
5903
5899
  "dev,prod,peer,optional"
5904
5900
  ]), K("Dependencies checked.");
5905
5901
  } catch (e) {
5906
- console.error("❌ Error checking dependencies.", e), process.exit(1);
5902
+ console.error("❌ Error checking dependencies.", e), process.exit(1);
5907
5903
  }
5908
5904
  }
5909
5905
  //#endregion
@@ -5911,9 +5907,9 @@ async function qn() {
5911
5907
  var Jn = "<!-- DEPENDENCY_LICENSES_START -->", Yn = "<!-- DEPENDENCY_LICENSES_END -->", Xn = "<!-- DEPENDENCY_TREE_START -->", Zn = "<!-- DEPENDENCY_TREE_END -->";
5912
5908
  async function Qn(e = "MIT") {
5913
5909
  try {
5914
- G("Document Dependencies"), await An("1️⃣ Clear downloaded licenses", "licenses/downloads");
5910
+ G("Document Dependencies"), await An("1️⃣ Clear downloaded licenses", "licenses/downloads");
5915
5911
  let t = await W("package.json"), n = `${t.name ?? ""}@${t.version ?? ""}`;
5916
- await Mn("2️⃣ Identify production licenses", "license-checker-rseidelsohn", [
5912
+ await Mn("2️⃣ Identify production licenses", "license-checker-rseidelsohn", [
5917
5913
  "--production",
5918
5914
  "--json",
5919
5915
  "--files",
@@ -5926,14 +5922,14 @@ async function Qn(e = "MIT") {
5926
5922
  `"${n}"`,
5927
5923
  "--out",
5928
5924
  "licenses/licenses.json"
5929
- ]), await Pn("3️⃣ Identify transitive dependencies", "npm", [
5925
+ ]), await Pn("3️⃣ Identify transitive dependencies", "npm", [
5930
5926
  "ls",
5931
5927
  "--all",
5932
5928
  "--json",
5933
5929
  "--omit=dev"
5934
- ], "licenses/licenseTree.json"), await $n("4️⃣"), K("Dependencies documented.");
5930
+ ], "licenses/licenseTree.json"), await $n("4️⃣ "), K("Dependencies documented.");
5935
5931
  } catch (e) {
5936
- console.error("❌ Error documenting dependencies.", e), process.exit(1);
5932
+ console.error("❌ Error documenting dependencies.", e), process.exit(1);
5937
5933
  }
5938
5934
  }
5939
5935
  async function $n(e) {
@@ -5982,7 +5978,7 @@ async function tr(e, t) {
5982
5978
  };
5983
5979
  }
5984
5980
  function nr(e) {
5985
- let t = e.licenseFileLink == null || e.licenseFileLink === "" ? "⚠️ No license file" : `[LICENSE](licenses/${e.licenseFileLink})`;
5981
+ let t = e.licenseFileLink == null || e.licenseFileLink === "" ? "⚠️ No license file" : `[LICENSE](licenses/${e.licenseFileLink})`;
5986
5982
  return `|[${e.name}](${e.repository})|${e.installedVersion}|${e.licenseTypes}|${t}|\n`;
5987
5983
  }
5988
5984
  function rr(e, t, n, r) {
@@ -6004,7 +6000,7 @@ function ar(e) {
6004
6000
  let t = e.split("T", 1)[0];
6005
6001
  if (t == null || t === "") return "n/a";
6006
6002
  let n = new Date(t), r = /* @__PURE__ */ new Date(), i = (r.getFullYear() - n.getFullYear()) * 12 + (r.getMonth() - n.getMonth());
6007
- 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} ⚠️`;
6003
+ 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} ⚠️ `;
6008
6004
  }
6009
6005
  //#endregion
6010
6006
  //#region node_modules/@dpuse/dpuse-shared/dist/componentConfig.schema-DTtYL9IP.js
@@ -6546,18 +6542,18 @@ function Wr(e) {
6546
6542
  var Gr = "<!-- CONNECTOR_OPERATIONS_START -->", Kr = "<!-- CONNECTOR_OPERATIONS_END -->";
6547
6543
  async function qr() {
6548
6544
  try {
6549
- G("Document Operations"), q("1️⃣ Insert operations table into 'README.md'");
6545
+ G("Document Operations"), q("1️⃣ Insert operations table into 'README.md'");
6550
6546
  let e = Wr((await W("config.json")).operations ?? []);
6551
6547
  await Rn("README.md", Un(await Fn("./README.md"), e, Gr, Kr)), K("Operations documented.");
6552
6548
  } catch (e) {
6553
- console.error("❌ Error documenting operations.", e), process.exit(1);
6549
+ console.error("❌ Error documenting operations.", e), process.exit(1);
6554
6550
  }
6555
6551
  }
6556
6552
  //#endregion
6557
6553
  //#region src/actions/formatCode.ts
6558
6554
  async function Jr() {
6559
6555
  try {
6560
- G("Format Code"), await Nn("1️⃣ Format", "prettier", [
6556
+ G("Format Code"), await Nn("1️⃣ Format", "prettier", [
6561
6557
  "--write",
6562
6558
  "*.json",
6563
6559
  "*.md",
@@ -6565,16 +6561,16 @@ async function Jr() {
6565
6561
  ...["app", "src"].filter((t) => e(t)).map((e) => `${e}/**`)
6566
6562
  ]), K("Code formatted.");
6567
6563
  } catch (e) {
6568
- console.error("❌ Error formatting code.", e), process.exit(1);
6564
+ console.error("❌ Error formatting code.", e), process.exit(1);
6569
6565
  }
6570
6566
  }
6571
6567
  //#endregion
6572
6568
  //#region src/actions/lintCode.ts
6573
6569
  async function Yr() {
6574
6570
  try {
6575
- G("Lint Code"), await Nn("1️⃣ Lint", "eslint", ["."]), K("Code linted.");
6571
+ G("Lint Code"), await Nn("1️⃣ Lint", "eslint", ["."]), K("Code linted.");
6576
6572
  } catch (e) {
6577
- console.error("❌ Error linting code.", e), process.exit(1);
6573
+ console.error("❌ Error linting code.", e), process.exit(1);
6578
6574
  }
6579
6575
  }
6580
6576
  //#endregion
@@ -6682,49 +6678,49 @@ var ii = /* @__PURE__ */ Q({
6682
6678
  ]);
6683
6679
  async function di() {
6684
6680
  try {
6685
- G("Build Project"), await Nn("1️⃣ Bundle project", "vite", ["build"]), K("Project built.");
6681
+ G("Build Project"), await Nn("1️⃣ Bundle project", "vite", ["build"]), K("Project built.");
6686
6682
  } catch (e) {
6687
- console.error("❌ Error building project.", e), process.exit(1);
6683
+ console.error("❌ Error building project.", e), process.exit(1);
6688
6684
  }
6689
6685
  }
6690
6686
  async function fi() {
6691
6687
  try {
6692
6688
  G("Release Project");
6693
6689
  let e = await W("package.json"), t = await W("config.json");
6694
- await xi("1️⃣", e);
6690
+ await xi("1️⃣ ", e);
6695
6691
  let n = zn(t.id);
6696
6692
  switch (n.typeId) {
6697
6693
  case "connector":
6698
- t = await mi("2️⃣", e);
6694
+ t = await mi("2️⃣ ", e);
6699
6695
  break;
6700
6696
  case "context":
6701
- t = await hi("2️⃣", e);
6697
+ t = await hi("2️⃣ ", e);
6702
6698
  break;
6703
6699
  case "presenter":
6704
- t = await gi("2️⃣", e);
6700
+ t = await gi("2️⃣ ", e);
6705
6701
  break;
6706
- default: t = await pi("2️⃣", e);
6702
+ default: t = await pi("2️⃣ ", e);
6707
6703
  }
6708
- if (await Nn("3️⃣ Bundle project", "vite", ["build"]), await Mn("4️⃣ Stage changes", "git", ["add", "."]), await Mn("5️⃣ Commit changes", "git", [
6704
+ if (await Nn("3️⃣ Bundle project", "vite", ["build"]), await Mn("4️⃣ Stage changes", "git", ["add", "."]), await Mn("5️⃣ Commit changes", "git", [
6709
6705
  "commit",
6710
6706
  "-m",
6711
6707
  `"v${e.version ?? "unknown"}"`
6712
- ]), await Mn("6️⃣ Push changes", "git", [
6708
+ ]), await Mn("6️⃣ Push changes", "git", [
6713
6709
  "push",
6714
6710
  "origin",
6715
6711
  "main:main"
6716
- ]), n.typeId === "app") q("7️⃣ Register module"), await Xr();
6717
- else if (n.typeId === "engine") q("7️⃣ Register module"), await $r(e, `dpuse-engine-eu/${n.uploadGroupName ?? "unknown"}`), await Qr(t);
6718
- else if (n.uploadGroupName === void 0) q("7️⃣ Registration NOT required.");
6712
+ ]), n.typeId === "app") q("7️⃣ Register module"), await Xr();
6713
+ else if (n.typeId === "engine") q("7️⃣ Register module"), await $r(e, `dpuse-engine-eu/${n.uploadGroupName ?? "unknown"}`), await Qr(t);
6714
+ else if (n.uploadGroupName === void 0) q("7️⃣ Registration NOT required.");
6719
6715
  else {
6720
- q("7️⃣ Register module");
6716
+ q("7️⃣ Register module");
6721
6717
  let r = t.id.split("-").slice(2).join("-");
6722
6718
  await $r(e, `dpuse-engine-eu/${n.uploadGroupName}/${r}`), await Qr(t);
6723
6719
  }
6724
6720
  if (n.isPublished) {
6725
6721
  let e = ".npmrc";
6726
6722
  try {
6727
- await Rn(e, `registry=https://registry.npmjs.org/\n//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN ?? ""}`), await Nn("8️⃣ Publish to npm", "npm", [
6723
+ await Rn(e, `registry=https://registry.npmjs.org/\n//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN ?? ""}`), await Nn("8️⃣ Publish to npm", "npm", [
6728
6724
  "publish",
6729
6725
  "--access",
6730
6726
  "public"
@@ -6732,10 +6728,10 @@ async function fi() {
6732
6728
  } finally {
6733
6729
  await In(e);
6734
6730
  }
6735
- } else q(`8️⃣ Publishing NOT required for package with type identifier of '${n.typeId}'.`);
6731
+ } else q(`8️⃣ Publishing NOT required for package with type identifier of '${n.typeId}'.`);
6736
6732
  K(`Project version '${e.version ?? "unknown"}' released.`);
6737
6733
  } catch (e) {
6738
- console.error("❌ Error releasing project.", e), process.exit(1);
6734
+ console.error("❌ Error releasing project.", e), process.exit(1);
6739
6735
  }
6740
6736
  }
6741
6737
  async function pi(e, t) {
@@ -6746,20 +6742,20 @@ async function pi(e, t) {
6746
6742
  async function mi(e, t) {
6747
6743
  q(`${e} Build connector project configuration`);
6748
6744
  let [n, r] = await Promise.all([W("config.json"), Fn("src/index.ts")]), i = /* @__PURE__ */ ri(Hr, n);
6749
- if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid.");
6745
+ if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid.");
6750
6746
  let a = Vn(r);
6751
6747
  return await vi(t, n, a, _i(a));
6752
6748
  }
6753
6749
  async function hi(e, t) {
6754
6750
  q(`${e} Build context project configuration`);
6755
6751
  let [n, r] = await Promise.all([W("config.json"), Fn("src/index.ts")]), i = /* @__PURE__ */ ri(oi, n);
6756
- if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid.");
6752
+ if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid.");
6757
6753
  return await vi(t, n, Vn(r));
6758
6754
  }
6759
6755
  async function gi(e, t) {
6760
6756
  q(`${e} Build presenter project configuration`);
6761
6757
  let [n, r] = await Promise.all([W("config.json"), Fn("src/index.ts")]), i = /* @__PURE__ */ ri(ci, n);
6762
- if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid.");
6758
+ if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid.");
6763
6759
  return await vi(t, n, Vn(r));
6764
6760
  }
6765
6761
  function _i(e) {
@@ -6768,46 +6764,46 @@ function _i(e) {
6768
6764
  return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "unknown";
6769
6765
  }
6770
6766
  async function vi(e, t, n, r) {
6771
- 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.") : console.info(`ℹ️ Supports '${r ?? "unknown"}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.operations = n, t.usageId = r ?? "unknown", await Ln("config.json", t), t;
6767
+ 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.") : console.info(`ℹ️ Supports '${r ?? "unknown"}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.operations = n, t.usageId = r ?? "unknown", await Ln("config.json", t), t;
6772
6768
  }
6773
6769
  async function yi() {
6774
6770
  try {
6775
6771
  G("Synchronise Project with GitHub");
6776
6772
  let e = await W("package.json"), t = await W("config.json");
6777
- switch (await xi("1️⃣", e), zn(t.id).typeId) {
6773
+ switch (await xi("1️⃣ ", e), zn(t.id).typeId) {
6778
6774
  case "connector":
6779
- await mi("2️⃣", e);
6775
+ await mi("2️⃣ ", e);
6780
6776
  break;
6781
6777
  case "context":
6782
- await hi("2️⃣", e);
6778
+ await hi("2️⃣ ", e);
6783
6779
  break;
6784
6780
  case "presenter":
6785
- await gi("2️⃣", e);
6781
+ await gi("2️⃣ ", e);
6786
6782
  break;
6787
- default: await pi("2️⃣", e);
6783
+ default: await pi("2️⃣ ", e);
6788
6784
  }
6789
- await Mn("3️⃣ Stage changes", "git", ["add", "."]), await Mn("4️⃣ Commit changes", "git", [
6785
+ await Mn("3️⃣ Stage changes", "git", ["add", "."]), await Mn("4️⃣ Commit changes", "git", [
6790
6786
  "commit",
6791
6787
  "-m",
6792
6788
  `"v${e.version ?? "unknown"}"`
6793
- ]), await Mn("5️⃣ Push changes", "git", [
6789
+ ]), await Mn("5️⃣ Push changes", "git", [
6794
6790
  "push",
6795
6791
  "origin",
6796
6792
  "main:main"
6797
6793
  ]), K(`Project version '${e.version ?? "unknown"}' synchronised with GitHub.`);
6798
6794
  } catch (e) {
6799
- console.error("❌ Error synchronising project with GitHub.", e), process.exit(1);
6795
+ console.error("❌ Error synchronising project with GitHub.", e), process.exit(1);
6800
6796
  }
6801
6797
  }
6802
6798
  function bi() {
6803
6799
  try {
6804
- G("Test Project"), console.error("\n❌ No tests implemented.\n");
6800
+ G("Test Project"), console.error("\n❌ No tests implemented.\n");
6805
6801
  } catch (e) {
6806
- console.error("❌ Error testing project.", e), process.exit(1);
6802
+ console.error("❌ Error testing project.", e), process.exit(1);
6807
6803
  }
6808
6804
  }
6809
6805
  async function xi(e, t, n = "./") {
6810
- if (q(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
6806
+ if (q(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
6811
6807
  else {
6812
6808
  let e = t.version, n = t.version.split(".");
6813
6809
  t.version = `${n[0] ?? "unknown"}.${n[1] ?? "unknown"}.${String(Number(n[2]) + 1)}`, console.info(`Project version bumped from '${e}' to '${t.version}'.`);