@dpuse/dpuse-development 0.3.799 → 0.3.801

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.
@@ -1,2 +1,5 @@
1
+ import { PackageJson } from 'type-fest';
1
2
  /** Builds the package using Vite. Output to '/dist' directory. Builds bundle analysis reports. */
2
3
  export declare function buildProject(): Promise<void>;
4
+ /** Bundles the project with Vite, first building its WebAssembly where the project has a 'build:wasm' script. */
5
+ export declare function bundleProject(stepIcon: string, packageJSON: PackageJson): Promise<void>;
@@ -1,5 +1,6 @@
1
1
  import { PackageJson } from 'type-fest';
2
2
  import { ModuleConfig } from '@dpuse/dpuse-shared';
3
3
  import { ModuleTypeConfig } from '../utilities';
4
+ /** Publishes the project to npm, uploads it to DPUse, or both, as its module type requires. Run by the 'publish.yml' workflow. */
4
5
  export declare function publishProject(): Promise<void>;
5
6
  export declare function registerModule(stepIcon: string, packageJSON: PackageJson, configJSON: ModuleConfig, moduleTypeConfig: ModuleTypeConfig): Promise<void>;
@@ -14,6 +14,7 @@ export declare const CONTRIBUTING_LICENSE_END_MARKER = "<!-- CONTRIBUTING_LICENS
14
14
  export declare const CONTRIBUTING_LICENSE_START_MARKER = "<!-- CONTRIBUTING_LICENSE_START -->";
15
15
  export declare const QUALITY_SECURITY_END_MARKER = "<!-- QUALITY_SECURITY_END -->";
16
16
  export declare const QUALITY_SECURITY_START_MARKER = "<!-- QUALITY_SECURITY_START -->";
17
+ export declare const RUST_WORKSPACE_PATH = "rust/Cargo.toml";
17
18
  export declare function clearDirectory(label: string | undefined, directoryPath: string): Promise<void>;
18
19
  export declare function getDirectoryEntries(path: string): Promise<string[]>;
19
20
  export declare function getDirectoryEntries(path: string, options: ObjectEncodingOptions): Promise<Dirent[]>;
@@ -561,7 +561,7 @@ var R = O([
561
561
  typeId: /* @__PURE__ */ v("presenter"),
562
562
  actionNames: /* @__PURE__ */ g(R),
563
563
  presentations: /* @__PURE__ */ g(se)
564
- }), B = "code-health-reports/fallow", he = `${B}/badge.json`, ge = `${B}/index.md`, V = "<!-- CONTRIBUTING_LICENSE_END -->", H = "<!-- CONTRIBUTING_LICENSE_START -->", _e = "<!-- GOVERNANCE_END -->", U = "<!-- GOVERNANCE_START -->", W = "<!-- QUALITY_SECURITY_END -->", G = "<!-- QUALITY_SECURITY_START -->", ve = [
564
+ }), B = "code-health-reports/fallow", he = `${B}/badge.json`, ge = `${B}/index.md`, V = "<!-- CONTRIBUTING_LICENSE_END -->", H = "<!-- CONTRIBUTING_LICENSE_START -->", _e = "<!-- GOVERNANCE_END -->", U = "<!-- GOVERNANCE_START -->", W = "<!-- QUALITY_SECURITY_END -->", G = "<!-- QUALITY_SECURITY_START -->", ve = "rust/Cargo.toml", ye = [
565
565
  {
566
566
  idPrefix: "dpuse-app",
567
567
  typeId: "app",
@@ -646,8 +646,8 @@ var R = O([
646
646
  publishedTo: "github",
647
647
  uploadGroupName: void 0
648
648
  }
649
- ], ye = n(r);
650
- async function be(n, r) {
649
+ ], be = n(r);
650
+ async function xe(n, r) {
651
651
  n !== void 0 && Z(`${n} - clear(${r})`);
652
652
  let i;
653
653
  try {
@@ -668,15 +668,15 @@ async function be(n, r) {
668
668
  }
669
669
  }));
670
670
  }
671
- async function xe(t, n) {
671
+ async function Se(t, n) {
672
672
  return e.readdir(t, n);
673
673
  }
674
- async function Se(t, n, r, i) {
674
+ async function Ce(t, n, r, i) {
675
675
  t !== void 0 && Z(`${t} - exec(${n} ${r.join(" ")})`);
676
- let { stdout: a, stderr: o } = await ye(n, r);
676
+ let { stdout: a, stderr: o } = await be(n, r);
677
677
  i === void 0 ? a.trim() && console.log(a.trim()) : await e.writeFile(i, a.trim(), "utf-8"), o.trim() && console.error(o.trim());
678
678
  }
679
- async function Ce(e, t, n, r = !1, a = !1) {
679
+ async function we(e, t, n, r = !1, a = !1) {
680
680
  return Z(`${e} - spawn(${t} ${n.join(" ")})`), new Promise((e, o) => {
681
681
  i(t, n, {
682
682
  shell: a,
@@ -686,7 +686,7 @@ async function Ce(e, t, n, r = !1, a = !1) {
686
686
  });
687
687
  });
688
688
  }
689
- async function we(n, r, a, o, s = !1) {
689
+ async function Te(n, r, a, o, s = !1) {
690
690
  return Z(`${n} - spawn(${r} ${a.join(" ")}) > ${o}`), new Promise((n, c) => {
691
691
  let l = i(r, a, {
692
692
  shell: !1,
@@ -709,7 +709,7 @@ async function we(n, r, a, o, s = !1) {
709
709
  });
710
710
  });
711
711
  }
712
- async function Te() {
712
+ async function Ee() {
713
713
  let e = await q("./README.md"), t = e.indexOf(U), n = e.indexOf(_e);
714
714
  if (t === -1 || n === -1) return;
715
715
  let r = `${G}\n${W}\n\n${H}\n${V}`;
@@ -732,27 +732,27 @@ async function J(t) {
732
732
  async function Y(n, r) {
733
733
  await e.mkdir(t.dirname(n), { recursive: !0 }), await e.writeFile(n, `${JSON.stringify(r, void 0, 4)}\n`, "utf-8");
734
734
  }
735
- async function Ee(e, t, n) {
736
- await X("README.md", Le(await q("./README.md"), e, t, n));
735
+ async function De(e, t, n) {
736
+ await X("README.md", Re(await q("./README.md"), e, t, n));
737
737
  }
738
738
  async function X(t, n) {
739
739
  await e.writeFile(t, n, "utf-8");
740
740
  }
741
- function De(e) {
741
+ function Oe(e) {
742
742
  console.info("\x1B[36m────────────────────────────────────────────────────────────────────────────────"), console.info(`▶️ ${e}`);
743
743
  }
744
- function Oe(e) {
744
+ function ke(e) {
745
745
  console.info(`✅ ${e}`);
746
746
  }
747
747
  function Z(e) {
748
748
  console.info(e);
749
749
  }
750
- function ke(e) {
751
- let t = ve.find((t) => e.startsWith(t.idPrefix));
750
+ function Ae(e) {
751
+ let t = ye.find((t) => e.startsWith(t.idPrefix));
752
752
  if (!t) throw Error(`Failed to locate module type configuration for identifier '${e}'.`);
753
753
  return t;
754
754
  }
755
- function Ae(e, t) {
755
+ function je(e, t) {
756
756
  let n = e.repository, r = typeof n == "string" ? n : n?.url;
757
757
  if (r == null || r === "") throw Error(`package.json 'repository' field is required to ${t}.`);
758
758
  let i = r.replace(/^git\+/, "").replace(/\.git$/, ""), a = /github\.com[/:]([^/]+)\/([^/]+)$/.exec(i);
@@ -762,17 +762,17 @@ function Ae(e, t) {
762
762
  repo: a[2]
763
763
  };
764
764
  }
765
- async function je(t) {
765
+ async function Me(t) {
766
766
  return await e.stat(t);
767
767
  }
768
- async function Me(e, t, n) {
768
+ async function Ne(e, t, n) {
769
769
  switch (n.typeId) {
770
- case "connector": return await Pe(e, t);
771
- case "presenter": return await Fe(e, t);
772
- default: return await Ie(e, t);
770
+ case "connector": return await Fe(e, t);
771
+ case "presenter": return await Ie(e, t);
772
+ default: return await Le(e, t);
773
773
  }
774
774
  }
775
- async function Ne(e, t, n = "./") {
775
+ async function Pe(e, t, n = "./") {
776
776
  if (Z(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
777
777
  else {
778
778
  let e = t.version, n = t.version.split(".");
@@ -786,20 +786,20 @@ async function Q(e) {
786
786
  };
787
787
  return i(n), r;
788
788
  }
789
- async function Pe(e, t) {
789
+ async function Fe(e, t) {
790
790
  Z(`${e} Build connector project configuration`);
791
791
  let [n, r] = await Promise.all([K("config.json"), q("src/index.ts")]), i = /* @__PURE__ */ s(me, n);
792
792
  if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
793
793
  let a = await Q(r);
794
794
  return await $(t, n, a, I(a));
795
795
  }
796
- async function Fe(e, t) {
796
+ async function Ie(e, t) {
797
797
  Z(`${e} Build presenter project configuration`);
798
798
  let [n, r] = await Promise.all([K("config.json"), q("src/index.ts")]), i = /* @__PURE__ */ s(z, n);
799
799
  if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
800
800
  return await $(t, n, await Q(r));
801
801
  }
802
- async function Ie(e, t) {
802
+ async function Le(e, t) {
803
803
  Z(`${e} Build project configuration`);
804
804
  let n = await K("config.json");
805
805
  return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await J("logo.svg"), n.iconDark ??= await J("logoDark.svg"), await Y("config.json", n), n;
@@ -807,11 +807,11 @@ async function Ie(e, t) {
807
807
  async function $(e, t, n, r) {
808
808
  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") : r && console.info(`ℹ️ Supports '${r}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.actionNames = n, r !== void 0 && (t.usageId = r), await Y("config.json", t), t;
809
809
  }
810
- function Le(e, t, n, r) {
810
+ function Re(e, t, n, r) {
811
811
  let i = e.indexOf(n), a = e.indexOf(r);
812
812
  if (i === -1 || a === -1) throw Error(`Markers ${n}-${r} not found in content.`);
813
813
  let o = t.trim();
814
814
  return `${e.slice(0, Math.max(0, i + n.length))}\n\n${o}\n\n${e.slice(Math.max(0, a))}`;
815
815
  }
816
816
  //#endregion
817
- export { Ce as C, X as D, Ee as E, I as O, Ae as S, Y as T, Z as _, ge as a, q as b, Me as c, Se as d, xe as f, Oe as g, De as h, B as i, L as k, Ne as l, je as m, H as n, W as o, ke as p, he as r, G as s, V as t, be as u, Te as v, we as w, J as x, K as y };
817
+ export { L as A, je as C, De as D, Y as E, X as O, J as S, Te as T, ke as _, ge as a, K as b, ve as c, xe as d, Ce as f, Oe as g, Me as h, B as i, I as k, Ne as l, Ae as m, H as n, W as o, Se as p, he as r, G as s, V as t, Pe as u, Z as v, we as w, q as x, Ee as y };