@platforma-sdk/block-tools 2.17.8 → 2.18.0
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.
- package/dist/cli.js +8 -8
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +426 -420
- package/dist/cli.mjs.map +1 -1
- package/dist/{config-C07cYptA.mjs → config-BusBoNIz.mjs} +495 -586
- package/dist/config-BusBoNIz.mjs.map +1 -0
- package/dist/config-DG4SQFXv.js +2 -0
- package/dist/config-DG4SQFXv.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -15
- package/dist/index.mjs.map +1 -1
- package/dist/io/storage.d.ts +1 -28
- package/dist/structure/rules/root-package-json.d.ts +1 -0
- package/dist/structure/rules/root-pnpm-workspace.d.ts +1 -0
- package/package.json +2 -3
- package/src/cmd/structure/refresh.ts +2 -2
- package/src/io/folder_reader.test.ts +18 -0
- package/src/io/folder_reader.ts +6 -0
- package/src/io/storage.ts +8 -147
- package/src/structure/__tests__/toolchain.test.ts +24 -14
- package/src/structure/rules/root-catalog-bump.ts +17 -0
- package/src/structure/rules/root-package-json.ts +5 -1
- package/src/structure/rules/root-pnpm-workspace.ts +6 -2
- package/src/structure/rules/shared/toolchain.ts +0 -2
- package/dist/config-C07cYptA.mjs.map +0 -1
- package/dist/config-on5N57rI.js +0 -3
- package/dist/config-on5N57rI.js.map +0 -1
- package/src/io/storage.test.ts +0 -96
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as e, J as t, K as n, Lt as r, N as i, Pt as a, Qt as o, T as s, Tt as c, X as l, Z as u, bt as d, n as f, p as ee, v as te, vt as ne, wt as re } from "./config-BusBoNIz.mjs";
|
|
2
2
|
import { Command as p, Option as m } from "commander";
|
|
3
3
|
import h from "node:path";
|
|
4
4
|
import g, { globSync as ie, statSync as ae } from "node:fs";
|
|
@@ -15,8 +15,8 @@ import { ECRPUBLICClient as Te, GetAuthorizationTokenCommand as Ee } from "@aws-
|
|
|
15
15
|
function De() {
|
|
16
16
|
let e = new p("build-meta").description("Extracts meta information from blocks package.json and outputs meta.json with embedded binary and textual information linked from the meta section.");
|
|
17
17
|
return e.option("-i, --modulePath <path>", "input module path", "."), e.requiredOption("-o, --destination <path>", "output meta.json file"), e.action(async (e) => {
|
|
18
|
-
let t = h.resolve(e.modulePath),
|
|
19
|
-
await g.promises.writeFile(h.resolve(e.destination), JSON.stringify(
|
|
18
|
+
let t = h.resolve(e.modulePath), n = await d(t), i = await a(await r(n.meta, t));
|
|
19
|
+
await g.promises.writeFile(h.resolve(e.destination), JSON.stringify(i));
|
|
20
20
|
}), e;
|
|
21
21
|
}
|
|
22
22
|
// src/cmd/build-model.ts
|
|
@@ -31,7 +31,7 @@ async function Oe(e) {
|
|
|
31
31
|
function ke() {
|
|
32
32
|
let e = new p("build-model").description("Extracts and outputs block model JSON from pre-built block model module");
|
|
33
33
|
return e.option("-i, --modulePath <path>", "input module path", "."), e.option("-b, --sourceBundle <path>", "bundled model code to embed into the model for callback-based rendering to work", "./dist/bundle.js"), e.option("-o, --destination <path>", "output model file", "./dist/model.json"), e.action(async (e) => {
|
|
34
|
-
let t = h.resolve(e.modulePath), { model: n, platforma: r } =
|
|
34
|
+
let t = h.resolve(e.modulePath), { model: n, platforma: r } = o(t);
|
|
35
35
|
if (n ||= r, !n) throw Error("\"model\" export not found");
|
|
36
36
|
let { config: i } = n;
|
|
37
37
|
if (!i) throw Error("Malformed \"model\" object, check it is created with \"BlockModel\" and \".done()\" is executed as the call in the chain.");
|
|
@@ -45,21 +45,21 @@ function ke() {
|
|
|
45
45
|
}
|
|
46
46
|
// src/cmd/build-kind-manifest.ts
|
|
47
47
|
function Ae() {
|
|
48
|
-
let
|
|
49
|
-
return
|
|
50
|
-
await
|
|
51
|
-
modulePath:
|
|
52
|
-
srcDir:
|
|
53
|
-
dst:
|
|
48
|
+
let e = new p("build-kind-manifest").description("Writes the block-kind dist manifest (identity + src source-hash) from a pre-built kind bundle");
|
|
49
|
+
return e.option("-i, --modulePath <path>", "kind package dir (contains package.json, src/, dist/)", "."), e.option("-s, --srcDir <path>", "source dir hashed into sourceHash, relative to modulePath", "src"), e.option("-o, --dst <path>", "output dir with the compiled bundle, relative to modulePath", "dist"), e.action(async (e) => {
|
|
50
|
+
await re({
|
|
51
|
+
modulePath: e.modulePath,
|
|
52
|
+
srcDir: e.srcDir,
|
|
53
|
+
dst: e.dst
|
|
54
54
|
});
|
|
55
|
-
}),
|
|
55
|
+
}), e;
|
|
56
56
|
}
|
|
57
57
|
// src/cmd/pack.ts
|
|
58
58
|
function je() {
|
|
59
59
|
let e = new p("pack").description("Builds block pack and outputs a block pack manifest consolidating all references assets into a single folder");
|
|
60
60
|
return e.option("-i, --modulePath <path>", "input module path", "."), e.option("-o, --destinationPath <path>", "output folder", "./block-pack"), e.action(async (e) => {
|
|
61
|
-
let t = await
|
|
62
|
-
await
|
|
61
|
+
let t = await ne(h.resolve(e.modulePath));
|
|
62
|
+
await c(t, h.resolve(e.destinationPath));
|
|
63
63
|
}), e;
|
|
64
64
|
}
|
|
65
65
|
// src/cmd/publish.ts
|
|
@@ -70,18 +70,18 @@ function Me(e, t) {
|
|
|
70
70
|
}
|
|
71
71
|
function Ne() {
|
|
72
72
|
let e = new p("publish").description("Publishes the block package and refreshes the registry (for v2 block-pack schema)");
|
|
73
|
-
return e.addOption(new m("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new m("--registry-serve-url <url>", "CDN serve URL written into block-pack/published.json (npm-consumed blocks)").env("PL_REGISTRY_SERVE_URL").makeOptionMandatory()), e.option("-m, --manifest <path>", "manifest file path", `./block-pack/${
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
let
|
|
77
|
-
|
|
78
|
-
let
|
|
79
|
-
await
|
|
80
|
-
let
|
|
73
|
+
return e.addOption(new m("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new m("--registry-serve-url <url>", "CDN serve URL written into block-pack/published.json (npm-consumed blocks)").env("PL_REGISTRY_SERVE_URL").makeOptionMandatory()), e.option("-m, --manifest <path>", "manifest file path", `./block-pack/${i}`), e.option("-v, --version-override <path>", "override package version"), e.addOption(new m("--refresh", "refresh repository after adding the package").default(!0).env("PL_REGISTRY_REFRESH")), e.option("--no-refresh", "do not refresh repository after adding the package"), e.addOption(new m("--unstable", "do not add the published package to stable channel").default(!1).env("PL_PUBLISH_UNSTABLE")), e.action(async (e) => {
|
|
74
|
+
let n = new y(), r = h.resolve(e.manifest), i = JSON.parse(await g.promises.readFile(r, { encoding: "utf-8" })), a = oe.parse(i);
|
|
75
|
+
a = Me(i, a);
|
|
76
|
+
let o = h.dirname(r), c = h.dirname(o);
|
|
77
|
+
n.info(`Manifest root = ${o}`), n.info(`Facade root = ${c}`), e.versionOverride && (a = le(a, e.versionOverride));
|
|
78
|
+
let d = te(e.registry), f = new s(d, n);
|
|
79
|
+
await u(f, a, c, async (e) => Buffer.from(await g.promises.readFile(h.resolve(o, e)))), e.unstable || (n.info(`Adding package to ${se} channel...`), await f.addPackageToChannel(a.description.id, se));
|
|
80
|
+
let ee = t({
|
|
81
81
|
registryUrl: e.registryServeUrl,
|
|
82
|
-
id:
|
|
82
|
+
id: a.description.id
|
|
83
83
|
});
|
|
84
|
-
await
|
|
84
|
+
await l(o, ee), n.info(`Wrote published coordinates to ${h.resolve(o, "published.json")}`), e.refresh && await f.updateIfNeeded();
|
|
85
85
|
}), e;
|
|
86
86
|
}
|
|
87
87
|
// src/cmd/refresh-registry.ts
|
|
@@ -92,17 +92,17 @@ function Pe() {
|
|
|
92
92
|
"normal",
|
|
93
93
|
"dry-run"
|
|
94
94
|
]).env("PL_REGISTRY_REFRESH_DRY_RUN").default("normal")), e.action(async (e) => {
|
|
95
|
-
let t =
|
|
96
|
-
await new
|
|
95
|
+
let t = te(e.registry);
|
|
96
|
+
await new s(t, new y()).updateIfNeeded(e.mode);
|
|
97
97
|
}), e;
|
|
98
98
|
}
|
|
99
99
|
// src/cmd/mark-stable.ts
|
|
100
100
|
function Fe() {
|
|
101
101
|
let e = new p("mark-stable").description("Mark target block stable");
|
|
102
102
|
return e.option("-i, --modulePath <path>", "input module path", "."), e.addOption(new m("-c, --channel <channel name>", "custom channel").default(se).hideHelp()), e.option("-v, --version-override <path>", "override package version"), e.addOption(new m("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new m("--refresh", "refresh repository after adding the package").default(!0).env("PL_REGISTRY_REFRESH")), e.option("--no-refresh", "do not refresh repository after adding the package"), e.option("--unmark", "reverses meaning of this command, flag can be used to remove \"stable\" flag from the package", !1), e.action(async (e) => {
|
|
103
|
-
let t = await
|
|
103
|
+
let t = await d(h.resolve(e.modulePath));
|
|
104
104
|
e.versionOverride && (t = ce(t, e.versionOverride));
|
|
105
|
-
let n =
|
|
105
|
+
let n = te(e.registry), r = new s(n, new y());
|
|
106
106
|
e.unmark ? await r.removePackageFromChannel(t.id, e.channel) : await r.addPackageToChannel(t.id, e.channel), e.refresh && await r.updateIfNeeded();
|
|
107
107
|
}), e;
|
|
108
108
|
}
|
|
@@ -446,7 +446,7 @@ function j(e) {
|
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
448
|
// src/structure/engine/parsers/json.ts
|
|
449
|
-
var lt = /* @__PURE__ */
|
|
449
|
+
var lt = /* @__PURE__ */ e(n());
|
|
450
450
|
function ut(e) {
|
|
451
451
|
return JSON.parse(e);
|
|
452
452
|
}
|
|
@@ -718,139 +718,139 @@ function H(e) {
|
|
|
718
718
|
function U(e) {
|
|
719
719
|
for (let [t, n] of Object.entries(e)) V(t, n);
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function W(e) {
|
|
722
722
|
for (let [t, n] of Object.entries(e)) Ut(t, n);
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function Wt(e, t, n) {
|
|
725
725
|
let r = Nt(P(e), e);
|
|
726
726
|
for (let i of r.modules) i.scope === t && Vt(e, i.name, "workspace:*", n);
|
|
727
727
|
}
|
|
728
|
+
function Gt(e) {
|
|
729
|
+
Wt("ensureWorkspaceScopeDeps", e, "dependencies");
|
|
730
|
+
}
|
|
728
731
|
function Kt(e) {
|
|
729
|
-
|
|
732
|
+
Wt("ensureWorkspaceScopeDevDeps", e, "devDependencies");
|
|
730
733
|
}
|
|
731
734
|
function qt(e) {
|
|
732
|
-
Gt("ensureWorkspaceScopeDevDeps", e, "devDependencies");
|
|
733
|
-
}
|
|
734
|
-
function Jt(e) {
|
|
735
735
|
let t = P("pruneKeysMatching").obj;
|
|
736
736
|
for (let n of Object.keys(t)) e(n, t[n]) && delete t[n];
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function Jt(e, t) {
|
|
739
739
|
let n = St(e, t);
|
|
740
740
|
for (let t of Object.keys(e)) delete e[t];
|
|
741
741
|
for (let t of Object.keys(n)) e[t] = n[t];
|
|
742
742
|
}
|
|
743
|
-
function
|
|
744
|
-
|
|
743
|
+
function G(e) {
|
|
744
|
+
Jt(P("enforceFieldOrder").obj, e);
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Yt(e, t) {
|
|
747
747
|
let n = Object.keys(e).sort(), r = {};
|
|
748
748
|
for (let t of n) r[t] = e[t];
|
|
749
749
|
for (let t of Object.keys(e)) delete e[t];
|
|
750
|
-
for (let i of n) e[i] = r[i], t && I(e[i]) &&
|
|
750
|
+
for (let i of n) e[i] = r[i], t && I(e[i]) && Yt(e[i], !0);
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function K(e = "", t = {}) {
|
|
753
753
|
let n = t.recursive ?? !1;
|
|
754
754
|
if (e === "" && !n) return;
|
|
755
755
|
let r = P("enforceAlphabeticalOrder").obj;
|
|
756
756
|
if (e === "") {
|
|
757
|
-
|
|
757
|
+
Yt(r, !0);
|
|
758
758
|
return;
|
|
759
759
|
}
|
|
760
760
|
let i = vt(r, e);
|
|
761
|
-
I(i) &&
|
|
761
|
+
I(i) && Yt(i, n);
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function Xt(e, t) {
|
|
764
764
|
let n = P("transformAt").obj;
|
|
765
765
|
bt(n, e, t(vt(n, e)));
|
|
766
766
|
}
|
|
767
|
-
function
|
|
767
|
+
function Zt() {
|
|
768
768
|
let e = F("ensureWorkspaceModulePaths"), t = Nt(e, "ensureWorkspaceModulePaths").modules.filter((e) => e.path !== "").map((e) => e.path).sort(), n = e.doc.toJSON()?.packages;
|
|
769
769
|
Array.isArray(n) && n.length === t.length && n.every((e, n) => e === t[n]) || e.doc.setIn(["packages"], t);
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function Qt(e, t) {
|
|
772
772
|
let n = e.doc.getIn(["catalog", t]);
|
|
773
773
|
return typeof n == "string" ? n : void 0;
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function $t(e, t) {
|
|
776
776
|
let n = F("ensureCatalogVersion");
|
|
777
|
-
|
|
777
|
+
Qt(n, e) === void 0 && n.doc.setIn(["catalog", e], t);
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function en(e) {
|
|
780
780
|
let t = F("ensureCatalogLatest");
|
|
781
781
|
if (!t.getLatestVersion) return;
|
|
782
782
|
let n = t.getLatestVersion(e);
|
|
783
|
-
n !== void 0 &&
|
|
783
|
+
n !== void 0 && Qt(t, e) !== n && t.doc.setIn(["catalog", e], n);
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function tn(e, t) {
|
|
786
786
|
let n = F("pinCatalogToDependencyOf");
|
|
787
787
|
if (!n.getDerivedDependencyPin) return;
|
|
788
788
|
let r = n.getDerivedDependencyPin(e);
|
|
789
|
-
r !== void 0 &&
|
|
789
|
+
r !== void 0 && Qt(n, e) !== r && n.doc.setIn(["catalog", e], r);
|
|
790
790
|
}
|
|
791
|
-
function
|
|
792
|
-
let n = F("ensureCatalogAtLeast"), r =
|
|
791
|
+
function nn(e, t) {
|
|
792
|
+
let n = F("ensureCatalogAtLeast"), r = Qt(n, e), i = (0, lt.minVersion)(t), a = r !== void 0 && (0, lt.validRange)(r) !== null ? (0, lt.minVersion)(r) : null;
|
|
793
793
|
(r === void 0 || i !== null && a !== null && !(0, lt.gte)(a, i)) && n.doc.setIn(["catalog", e], t);
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function rn(e) {
|
|
796
796
|
let t = F("ensureCatalogAbsent");
|
|
797
797
|
t.doc.hasIn(["catalog", e]) && t.doc.deleteIn(["catalog", e]);
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function an(e, t, { keepExisting: n = !1 } = {}) {
|
|
800
800
|
let r = F("ensureWorkspaceMapEntries");
|
|
801
801
|
me(r.doc.get(e)) || r.doc.delete(e);
|
|
802
802
|
let i = Object.entries(t).filter(([t, i]) => n ? !r.doc.hasIn([e, t]) : r.doc.getIn([e, t]) !== i);
|
|
803
803
|
for (let [t, n] of i) r.doc.setIn([e, t], n);
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function on(e, t) {
|
|
806
806
|
let n = F("ensureWorkspaceListItems"), r = n.doc.toJSON()?.[e], i = new Set(Array.isArray(r) ? r : []), a = t.filter((e) => !i.has(e));
|
|
807
807
|
if (a.length !== 0) {
|
|
808
808
|
if (!he(n.doc.get(e))) n.doc.set(e, a);
|
|
809
809
|
else for (let t of a) n.doc.addIn([e], t);
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function sn(e) {
|
|
813
813
|
let t = Mt("ensureGitignoreEntries");
|
|
814
814
|
for (let n of e) Dt(t.lines, n) || t.lines.push(n);
|
|
815
815
|
}
|
|
816
816
|
// src/structure/engine/parsers/yaml.ts
|
|
817
|
-
function
|
|
817
|
+
function cn(e) {
|
|
818
818
|
return _e(e);
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function ln(e) {
|
|
821
821
|
return e.toString();
|
|
822
822
|
}
|
|
823
|
-
var
|
|
824
|
-
function
|
|
823
|
+
var un = ".structure";
|
|
824
|
+
function dn(e) {
|
|
825
825
|
if (!e.exists(".structure")) return { version: 0 };
|
|
826
826
|
try {
|
|
827
|
-
let t = JSON.parse(e.read(
|
|
827
|
+
let t = JSON.parse(e.read(un));
|
|
828
828
|
return { version: typeof t?.version == "number" ? t.version : 0 };
|
|
829
829
|
} catch {
|
|
830
830
|
return { version: 0 };
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
|
-
function
|
|
834
|
-
if (e < t) throw new
|
|
833
|
+
function fn(e, t = 0) {
|
|
834
|
+
if (e < t) throw new pn(e, t);
|
|
835
835
|
}
|
|
836
|
-
var
|
|
836
|
+
var pn = class extends Error {
|
|
837
837
|
version;
|
|
838
838
|
floor;
|
|
839
839
|
constructor(e, t) {
|
|
840
840
|
super(`Block .structure version is ${e}, below floor ${t}. Bootstrap via the legacy-migration skill, then re-run.`), this.version = e, this.floor = t, this.name = "StructureVersionFloorError";
|
|
841
841
|
}
|
|
842
842
|
};
|
|
843
|
-
function
|
|
844
|
-
e.write(
|
|
843
|
+
function mn(e, t) {
|
|
844
|
+
e.write(un, JSON.stringify(t));
|
|
845
845
|
}
|
|
846
846
|
// src/structure/engine/runner.ts
|
|
847
|
-
var
|
|
847
|
+
var hn = class extends Error {
|
|
848
848
|
failing;
|
|
849
849
|
constructor(e) {
|
|
850
850
|
super(`Post-run recheck: rule set not idempotent. Failing item: ${e.primitive} '${e.path}' (scope=${e.scope}, action=${e.action}). Engine bug.`), this.failing = e, this.name = "RecheckError";
|
|
851
851
|
}
|
|
852
852
|
};
|
|
853
|
-
function
|
|
853
|
+
function gn(e, t, n, r) {
|
|
854
854
|
switch (e.kind) {
|
|
855
855
|
case "text": return e.value;
|
|
856
856
|
case "file":
|
|
@@ -869,13 +869,13 @@ function _n(e, t, n, r) {
|
|
|
869
869
|
case "binary": throw Error(`binary('${e.path}') cannot be resolved to a string; it is only valid inside seed()/scaffold(), which copy it verbatim via fs.writeBinary.`);
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function _n(e, t, n, r, i) {
|
|
873
873
|
if (n.kind === "binary") {
|
|
874
874
|
if (!r) throw Error(`binary('${n.path}'): no TemplateProvider configured. Pass opts.templates to engine.run(...).`);
|
|
875
875
|
e.writeBinary(t, r.staticReadBinary(n.path));
|
|
876
|
-
} else e.write(t,
|
|
876
|
+
} else e.write(t, gn(n, t, r, i));
|
|
877
877
|
}
|
|
878
|
-
function
|
|
878
|
+
function vn(e, t, n, r, i, a) {
|
|
879
879
|
let o = e.split("/").pop() ?? e;
|
|
880
880
|
if (e.endsWith(".json")) {
|
|
881
881
|
let i = ut(t);
|
|
@@ -883,12 +883,12 @@ function yn(e, t, n, r, i, a) {
|
|
|
883
883
|
return Pt(i, n, { triggerContext: r }), gt(i, { collapse: o !== "package.json" });
|
|
884
884
|
}
|
|
885
885
|
if (e.endsWith(".yaml") || e.endsWith(".yml")) {
|
|
886
|
-
let e =
|
|
886
|
+
let e = cn(t);
|
|
887
887
|
return Ft(e, n, {
|
|
888
888
|
triggerContext: r,
|
|
889
889
|
getLatestVersion: i,
|
|
890
890
|
getDerivedDependencyPin: a
|
|
891
|
-
}),
|
|
891
|
+
}), ln(e);
|
|
892
892
|
}
|
|
893
893
|
if (o === ".gitignore" || o.endsWith(".gitignore")) {
|
|
894
894
|
let e = Ct(t);
|
|
@@ -896,7 +896,7 @@ function yn(e, t, n, r, i, a) {
|
|
|
896
896
|
}
|
|
897
897
|
throw Error(`managed('${e}'): unsupported file kind. Only .json, .yaml, .yml, .gitignore are dispatched.`);
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function yn(e) {
|
|
900
900
|
let t = e.list(""), n = /* @__PURE__ */ new Set();
|
|
901
901
|
for (let e of t) {
|
|
902
902
|
n.add(e);
|
|
@@ -905,16 +905,16 @@ function bn(e) {
|
|
|
905
905
|
}
|
|
906
906
|
return n;
|
|
907
907
|
}
|
|
908
|
-
function
|
|
908
|
+
function bn(e, t) {
|
|
909
909
|
let n = t === "" ? t : t.endsWith("/") ? t.slice(0, -1) : t;
|
|
910
910
|
return e.has(n);
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function xn(e, t, n) {
|
|
913
913
|
return {
|
|
914
914
|
ctx: t,
|
|
915
915
|
version: t.version,
|
|
916
|
-
pathExists: (t) =>
|
|
917
|
-
pathMissing: (t) => !
|
|
916
|
+
pathExists: (t) => bn(e, t),
|
|
917
|
+
pathMissing: (t) => !bn(e, t),
|
|
918
918
|
filesMatch: (t) => {
|
|
919
919
|
let r = n ? `${n}/${t}` : t;
|
|
920
920
|
for (let t of e) if (qe(r, t)) return !0;
|
|
@@ -922,20 +922,20 @@ function Sn(e, t, n) {
|
|
|
922
922
|
}
|
|
923
923
|
};
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function Sn(e, t) {
|
|
926
926
|
for (let n of e.triggers) if (!n(t)) return !1;
|
|
927
927
|
return !0;
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function Cn(e, t) {
|
|
930
930
|
return t ? "init" : e.updateDepsOnly ? "updateDeps" : "default";
|
|
931
931
|
}
|
|
932
|
-
function
|
|
932
|
+
function wn(e, t) {
|
|
933
933
|
return e.filter((e) => e.modes.includes(t));
|
|
934
934
|
}
|
|
935
|
-
function
|
|
935
|
+
function Tn(e, t, n, r, i, a) {
|
|
936
936
|
let o = e.leaf;
|
|
937
937
|
if (o.kind === "fixed") {
|
|
938
|
-
let i =
|
|
938
|
+
let i = gn(o.content, e.resolvedPath, r, a);
|
|
939
939
|
return t.exists(e.resolvedPath) ? t.read(e.resolvedPath) === i ? void 0 : (n || t.write(e.resolvedPath, i), {
|
|
940
940
|
scope: e.scope,
|
|
941
941
|
path: e.resolvedPath,
|
|
@@ -948,13 +948,13 @@ function En(e, t, n, r, i, a) {
|
|
|
948
948
|
action: "create"
|
|
949
949
|
});
|
|
950
950
|
}
|
|
951
|
-
if (o.kind === "scaffold") return t.exists(e.resolvedPath) ? void 0 : (n ||
|
|
951
|
+
if (o.kind === "scaffold") return t.exists(e.resolvedPath) ? void 0 : (n || _n(t, e.resolvedPath, o.initial, r, a), {
|
|
952
952
|
scope: e.scope,
|
|
953
953
|
path: e.resolvedPath,
|
|
954
954
|
primitive: "scaffold",
|
|
955
955
|
action: "create"
|
|
956
956
|
});
|
|
957
|
-
if (o.kind === "seed") return !i || t.exists(e.resolvedPath) ? void 0 : (n ||
|
|
957
|
+
if (o.kind === "seed") return !i || t.exists(e.resolvedPath) ? void 0 : (n || _n(t, e.resolvedPath, o.initial, r, a), {
|
|
958
958
|
scope: e.scope,
|
|
959
959
|
path: e.resolvedPath,
|
|
960
960
|
primitive: "seed",
|
|
@@ -977,11 +977,11 @@ function En(e, t, n, r, i, a) {
|
|
|
977
977
|
});
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function En(e, t, n, r, i, a, o, s) {
|
|
981
981
|
if (e.leaf.kind !== "managed") return;
|
|
982
982
|
let c = e.leaf, l = e.resolvedPath, u = t.exists(l), d, f = !1;
|
|
983
|
-
u ? d = t.read(l) : (d =
|
|
984
|
-
let ee =
|
|
983
|
+
u ? d = t.read(l) : (d = gn(c.initial, l, i, s), f = !0);
|
|
984
|
+
let ee = vn(l, d, c.body, r, a, o);
|
|
985
985
|
if (f) return n || t.write(l, ee), {
|
|
986
986
|
scope: e.scope,
|
|
987
987
|
path: l,
|
|
@@ -995,39 +995,39 @@ function Dn(e, t, n, r, i, a, o, s) {
|
|
|
995
995
|
action: "update"
|
|
996
996
|
};
|
|
997
997
|
}
|
|
998
|
-
function
|
|
999
|
-
let c =
|
|
998
|
+
function Dn(e, t, n, r, i, a, o, s) {
|
|
999
|
+
let c = wn(e, Cn(n, a)), l = [], u = yn(t);
|
|
1000
1000
|
for (let e of c) {
|
|
1001
|
-
if (e.leaf.kind === "managed" || !
|
|
1002
|
-
let o =
|
|
1001
|
+
if (e.leaf.kind === "managed" || !Sn(e, xn(u, n, e.modulePath))) continue;
|
|
1002
|
+
let o = Tn(e, t, r, i, a, n);
|
|
1003
1003
|
o && l.push(o);
|
|
1004
1004
|
}
|
|
1005
|
-
let d =
|
|
1005
|
+
let d = yn(t);
|
|
1006
1006
|
for (let e of c) {
|
|
1007
1007
|
if (e.leaf.kind !== "managed") continue;
|
|
1008
|
-
let a =
|
|
1009
|
-
if (!
|
|
1010
|
-
let c =
|
|
1008
|
+
let a = xn(d, n, e.modulePath);
|
|
1009
|
+
if (!Sn(e, a)) continue;
|
|
1010
|
+
let c = En(e, t, r, a, i, o, s, n);
|
|
1011
1011
|
c && l.push(c);
|
|
1012
1012
|
}
|
|
1013
1013
|
return l;
|
|
1014
1014
|
}
|
|
1015
|
-
function
|
|
1015
|
+
function On(e, t, n, r = {}) {
|
|
1016
1016
|
return Ze(n, () => {
|
|
1017
|
-
let i = He(e, n), a = !!r.initMode, o =
|
|
1017
|
+
let i = He(e, n), a = !!r.initMode, o = Dn(i, t, n, n.dryRun, r.templates, a, r.registryLookup, r.derivedPinLookup);
|
|
1018
1018
|
if (!n.dryRun && !n.updateDepsOnly && !a) {
|
|
1019
|
-
|
|
1019
|
+
mn(t, { version: 3 });
|
|
1020
1020
|
let i = {
|
|
1021
1021
|
...r.rediscover ? r.rediscover(t) : n,
|
|
1022
1022
|
dryRun: !0
|
|
1023
|
-
}, a =
|
|
1024
|
-
if (a.length > 0) throw new
|
|
1023
|
+
}, a = Dn(He(e, i), t, i, !0, r.templates, !1, r.registryLookup, r.derivedPinLookup).filter((e) => e.path !== un);
|
|
1024
|
+
if (a.length > 0) throw new hn(a[0]);
|
|
1025
1025
|
}
|
|
1026
|
-
return a && !n.dryRun &&
|
|
1026
|
+
return a && !n.dryRun && mn(t, { version: 3 }), { changes: o };
|
|
1027
1027
|
});
|
|
1028
1028
|
}
|
|
1029
1029
|
// src/structure/engine/discovery.ts
|
|
1030
|
-
var
|
|
1030
|
+
var kn = [
|
|
1031
1031
|
"root",
|
|
1032
1032
|
"block",
|
|
1033
1033
|
"model",
|
|
@@ -1036,13 +1036,13 @@ var An = [
|
|
|
1036
1036
|
"test",
|
|
1037
1037
|
"software",
|
|
1038
1038
|
"kind"
|
|
1039
|
-
],
|
|
1039
|
+
], An = class extends Error {
|
|
1040
1040
|
path;
|
|
1041
1041
|
constructor(e, t) {
|
|
1042
1042
|
super(e), this.path = t, this.name = "DiscoveryError";
|
|
1043
1043
|
}
|
|
1044
1044
|
};
|
|
1045
|
-
function
|
|
1045
|
+
function jn(e) {
|
|
1046
1046
|
let t = /* @__PURE__ */ new Set();
|
|
1047
1047
|
for (let n of [
|
|
1048
1048
|
e.dependencies,
|
|
@@ -1052,18 +1052,18 @@ function Mn(e) {
|
|
|
1052
1052
|
]) if (n) for (let e of Object.keys(n)) t.add(e);
|
|
1053
1053
|
return t;
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function Mn(e) {
|
|
1056
1056
|
return e === "" || e === ".";
|
|
1057
1057
|
}
|
|
1058
|
-
function
|
|
1058
|
+
function Nn(e) {
|
|
1059
1059
|
let t = e.pkg["block-scope"];
|
|
1060
1060
|
if (typeof t == "string") {
|
|
1061
|
-
if (!
|
|
1061
|
+
if (!kn.includes(t)) throw new An(`package.json "block-scope" must be one of ${kn.join(", ")}, got '${t}'`, e.path);
|
|
1062
1062
|
return t;
|
|
1063
1063
|
}
|
|
1064
|
-
if (
|
|
1064
|
+
if (Mn(e.path)) return "root";
|
|
1065
1065
|
if (e.pkg.block !== void 0) return "block";
|
|
1066
|
-
let n =
|
|
1066
|
+
let n = jn(e.pkg);
|
|
1067
1067
|
if (n.has("@platforma-sdk/block-kind")) return "kind";
|
|
1068
1068
|
if (e.pkg["block-software"] !== void 0) return "software";
|
|
1069
1069
|
if (n.has("@platforma-sdk/package-builder")) {
|
|
@@ -1074,38 +1074,38 @@ function Pn(e) {
|
|
|
1074
1074
|
if (n.has("@platforma-sdk/model") && e.pkg.main) return "model";
|
|
1075
1075
|
if (n.has("@platforma-sdk/test")) return "test";
|
|
1076
1076
|
}
|
|
1077
|
-
function
|
|
1077
|
+
function Pn(e) {
|
|
1078
1078
|
let t = [];
|
|
1079
1079
|
for (let n of e) {
|
|
1080
|
-
let e =
|
|
1081
|
-
if (!e) throw new
|
|
1080
|
+
let e = Nn(n);
|
|
1081
|
+
if (!e) throw new An(`Unclassified workspace package at '${n.path}'. Add a top-level "block-scope" string to its package.json.`, n.path);
|
|
1082
1082
|
t.push({
|
|
1083
1083
|
scope: e,
|
|
1084
1084
|
name: n.pkg.name ?? n.path,
|
|
1085
|
-
path:
|
|
1085
|
+
path: Mn(n.path) ? "" : n.path
|
|
1086
1086
|
});
|
|
1087
1087
|
}
|
|
1088
1088
|
return t;
|
|
1089
1089
|
}
|
|
1090
1090
|
// src/structure/engine/ctx.ts
|
|
1091
|
-
function
|
|
1091
|
+
function q(e, t) {
|
|
1092
1092
|
return e.modules.filter((e) => e.scope === t);
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1095
|
-
let n =
|
|
1094
|
+
function Fn(e, t) {
|
|
1095
|
+
let n = q(e, t);
|
|
1096
1096
|
if (n.length === 0) throw Error(`findModule: expected one '${t}' module, found none`);
|
|
1097
1097
|
if (n.length > 1) throw Error(`findModule: expected exactly one '${t}' module, found ${n.length}`);
|
|
1098
1098
|
return n[0];
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1101
|
-
return { [
|
|
1100
|
+
function In(e, t) {
|
|
1101
|
+
return { [Fn(e, t).name]: "workspace:*" };
|
|
1102
1102
|
}
|
|
1103
|
-
function
|
|
1103
|
+
function J(e, t) {
|
|
1104
1104
|
let n = {};
|
|
1105
|
-
for (let r of
|
|
1105
|
+
for (let r of q(e, t)) n[r.name] = "workspace:*";
|
|
1106
1106
|
return n;
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function Ln(e) {
|
|
1109
1109
|
let t = e.facadeName, n = [
|
|
1110
1110
|
{
|
|
1111
1111
|
scope: "root",
|
|
@@ -1149,7 +1149,7 @@ function Rn(e) {
|
|
|
1149
1149
|
path: "software"
|
|
1150
1150
|
}), n;
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function Rn(e) {
|
|
1153
1153
|
return {
|
|
1154
1154
|
isSdkInternal: e.isSdkInternal ?? !1,
|
|
1155
1155
|
updateDepsOnly: e.updateDepsOnly ?? !1,
|
|
@@ -1160,41 +1160,41 @@ function zn(e) {
|
|
|
1160
1160
|
};
|
|
1161
1161
|
}
|
|
1162
1162
|
// src/structure/engine/discovery-fs.ts
|
|
1163
|
-
var
|
|
1163
|
+
var Y = class extends Error {
|
|
1164
1164
|
constructor(e) {
|
|
1165
1165
|
super(e), this.name = "StructureCliError";
|
|
1166
1166
|
}
|
|
1167
1167
|
};
|
|
1168
|
-
function
|
|
1168
|
+
function zn(e, t) {
|
|
1169
1169
|
return e === "" ? t : `${e}/${t}`;
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function Bn(e, t) {
|
|
1172
1172
|
try {
|
|
1173
1173
|
return JSON.parse(e.read(t));
|
|
1174
1174
|
} catch {
|
|
1175
1175
|
return;
|
|
1176
1176
|
}
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1179
|
-
if (e.includes("*")) throw new
|
|
1178
|
+
function Vn(e) {
|
|
1179
|
+
if (e.includes("*")) throw new Y(`pnpm-workspace.yaml 'packages:' entry '${e}' contains a glob. The structurer requires literal package paths — replace the glob with one entry per package directory.`);
|
|
1180
1180
|
let t = e.replace(/^\.\//, "").replace(/\/$/, "");
|
|
1181
1181
|
return t === "." ? "" : t;
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
1183
|
+
function Hn(e) {
|
|
1184
1184
|
let t;
|
|
1185
1185
|
try {
|
|
1186
1186
|
t = e.read("pnpm-workspace.yaml");
|
|
1187
1187
|
} catch {
|
|
1188
|
-
throw new
|
|
1188
|
+
throw new Y("No pnpm-workspace.yaml found. This directory is empty or unrecognisable as a block — run 'block-tools structure init' instead, or pass --sdk-internal for an in-monorepo block.");
|
|
1189
1189
|
}
|
|
1190
1190
|
let n = ge(t) ?? {}, r = Array.isArray(n.packages) ? n.packages : [], i = /* @__PURE__ */ new Set([""]);
|
|
1191
1191
|
for (let t of r) {
|
|
1192
|
-
let n =
|
|
1192
|
+
let n = Vn(t);
|
|
1193
1193
|
(n === "" || e.exists(n)) && i.add(n);
|
|
1194
1194
|
}
|
|
1195
1195
|
let a = [];
|
|
1196
1196
|
for (let t of i) {
|
|
1197
|
-
let n =
|
|
1197
|
+
let n = Bn(e, zn(t, "package.json"));
|
|
1198
1198
|
n && a.push({
|
|
1199
1199
|
path: t,
|
|
1200
1200
|
pkg: n
|
|
@@ -1202,7 +1202,7 @@ function Un(e) {
|
|
|
1202
1202
|
}
|
|
1203
1203
|
return a;
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function Un(e) {
|
|
1206
1206
|
let t = [], n = /* @__PURE__ */ new Set([
|
|
1207
1207
|
"node_modules",
|
|
1208
1208
|
".turbo",
|
|
@@ -1214,7 +1214,7 @@ function Wn(e) {
|
|
|
1214
1214
|
let o = e.listDir(i);
|
|
1215
1215
|
for (let s of o) {
|
|
1216
1216
|
if (!s.isDirectory || n.has(s.name)) continue;
|
|
1217
|
-
let o =
|
|
1217
|
+
let o = zn(i, s.name), c = Bn(e, zn(o, "package.json"));
|
|
1218
1218
|
c && t.push({
|
|
1219
1219
|
path: o,
|
|
1220
1220
|
pkg: c
|
|
@@ -1223,11 +1223,11 @@ function Wn(e) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
return r("", 1), t;
|
|
1225
1225
|
}
|
|
1226
|
-
function
|
|
1226
|
+
function Wn(e) {
|
|
1227
1227
|
let t = e.indexOf("/");
|
|
1228
|
-
if (!e.startsWith("@") || t < 0) throw new
|
|
1228
|
+
if (!e.startsWith("@") || t < 0) throw new Y(`Cannot parse block name '${e}': expected '@npm-org/org-scope.short-name'.`);
|
|
1229
1229
|
let n = e.slice(0, t), r = e.slice(t + 1), i = r.indexOf(".");
|
|
1230
|
-
if (i < 0) throw new
|
|
1230
|
+
if (i < 0) throw new Y(`Cannot parse block name '${e}': base name '${r}' has no '.' separating org-scope from short-name.`);
|
|
1231
1231
|
return {
|
|
1232
1232
|
facadeName: e,
|
|
1233
1233
|
baseName: r,
|
|
@@ -1236,19 +1236,19 @@ function Gn(e) {
|
|
|
1236
1236
|
shortName: r.slice(i + 1)
|
|
1237
1237
|
};
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1240
|
-
let { fs: t, isSdkInternal: n } = e, r = n ?
|
|
1241
|
-
if (r.length === 0) throw new
|
|
1242
|
-
let i =
|
|
1243
|
-
|
|
1239
|
+
function Gn(e) {
|
|
1240
|
+
let { fs: t, isSdkInternal: n } = e, r = n ? Un(t) : Hn(t);
|
|
1241
|
+
if (r.length === 0) throw new Y("No workspace packages found. Run 'block-tools structure init' to scaffold a block.");
|
|
1242
|
+
let i = Pn(r), a = dn(t);
|
|
1243
|
+
fn(a.version, 0);
|
|
1244
1244
|
let o = i.find((e) => e.scope === "block") ?? i.find((e) => e.scope === "root");
|
|
1245
|
-
if (!o) throw new
|
|
1246
|
-
let s = o.name.replace(/\.block$/, ""), c =
|
|
1245
|
+
if (!o) throw new Y("Could not find a 'block' (or root-as-block) package to derive BlockVars from.");
|
|
1246
|
+
let s = o.name.replace(/\.block$/, ""), c = Wn(s);
|
|
1247
1247
|
return i.some((e) => e.scope === "kind") || i.push({
|
|
1248
1248
|
scope: "kind",
|
|
1249
1249
|
name: `${s}.kind`,
|
|
1250
1250
|
path: "kind"
|
|
1251
|
-
}),
|
|
1251
|
+
}), Rn({
|
|
1252
1252
|
isSdkInternal: n,
|
|
1253
1253
|
updateDepsOnly: e.updateDepsOnly ?? !1,
|
|
1254
1254
|
modules: i,
|
|
@@ -1258,7 +1258,7 @@ function Kn(e) {
|
|
|
1258
1258
|
});
|
|
1259
1259
|
}
|
|
1260
1260
|
// src/structure/rules/shared/key-order.ts
|
|
1261
|
-
var
|
|
1261
|
+
var X = [
|
|
1262
1262
|
"name",
|
|
1263
1263
|
"version",
|
|
1264
1264
|
"private",
|
|
@@ -1280,44 +1280,42 @@ var Y = [
|
|
|
1280
1280
|
"packageManager",
|
|
1281
1281
|
"block",
|
|
1282
1282
|
"block-software"
|
|
1283
|
-
],
|
|
1284
|
-
function
|
|
1285
|
-
|
|
1283
|
+
], Z = "1.0.0";
|
|
1284
|
+
function Q() {
|
|
1285
|
+
Xt("version", (e) => typeof e == "string" && e.length > 0 ? e : Z);
|
|
1286
1286
|
}
|
|
1287
1287
|
// src/structure/rules/shared/toolchain.ts
|
|
1288
|
-
var
|
|
1288
|
+
var Kn = "24.22.1", qn = {
|
|
1289
1289
|
name: "node",
|
|
1290
|
-
version:
|
|
1290
|
+
version: Kn,
|
|
1291
1291
|
onFail: "download"
|
|
1292
|
-
},
|
|
1292
|
+
}, Jn = "pnpm@12.16.1+sha512.091d1dee7927575661b25dab3c2ae31cafc1c54d6b71ed6a6600cf0c1cb10434a447eae14015f1b23e2e6bedeed79df94a932e2164d2832280dce3fb32f656d1", Yn = "~2.11.10", Xn = [
|
|
1293
1293
|
"@milaboratories/*",
|
|
1294
1294
|
"@platforma-sdk/*",
|
|
1295
1295
|
"@platforma-open/*"
|
|
1296
|
-
],
|
|
1296
|
+
], Zn = { "@milaboratories/pframes-rs-node": !0 }, Qn = {
|
|
1297
1297
|
"@milaboratories/tengo-tester": !1,
|
|
1298
|
-
"cpu-features": !1,
|
|
1299
1298
|
esbuild: !1,
|
|
1300
|
-
protobufjs: !1
|
|
1301
|
-
|
|
1302
|
-
}, er = {
|
|
1299
|
+
protobufjs: !1
|
|
1300
|
+
}, $n = {
|
|
1303
1301
|
"build:dev-local": "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=all PL_BUILD_LOCATION=local turbo run build",
|
|
1304
1302
|
"build:dev-remote": "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=all PL_BUILD_LOCATION=remote turbo run build",
|
|
1305
1303
|
"build:dev-no-software": "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=none turbo run build",
|
|
1306
1304
|
"build:dev-binary-existing": "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_USE_PUBLISHED=true turbo run build",
|
|
1307
1305
|
"build:release": "cross-env PL_BUILD_CHANNEL=release PL_BUILD_VARIANT=all PL_BUILD_LOCATION=remote turbo run build"
|
|
1308
|
-
},
|
|
1306
|
+
}, er = {
|
|
1309
1307
|
test: "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=binary PL_BUILD_LOCATION=local turbo run test --concurrency 1",
|
|
1310
1308
|
"test:dry-run": "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=binary PL_BUILD_LOCATION=local turbo run test --dry-run=json"
|
|
1311
1309
|
};
|
|
1312
|
-
function
|
|
1310
|
+
function tr() {
|
|
1313
1311
|
return {
|
|
1314
|
-
version:
|
|
1312
|
+
version: Z,
|
|
1315
1313
|
private: !0,
|
|
1316
1314
|
scripts: {
|
|
1317
1315
|
fmt: "turbo run fmt",
|
|
1318
1316
|
check: "turbo run check",
|
|
1317
|
+
...$n,
|
|
1319
1318
|
...er,
|
|
1320
|
-
...tr,
|
|
1321
1319
|
"mark-stable": "turbo run mark-stable",
|
|
1322
1320
|
"do-pack": "turbo run do-pack",
|
|
1323
1321
|
watch: "turbo watch build",
|
|
@@ -1340,10 +1338,13 @@ function nr() {
|
|
|
1340
1338
|
}
|
|
1341
1339
|
};
|
|
1342
1340
|
}
|
|
1341
|
+
function nr() {
|
|
1342
|
+
L("packageManager", Jn), L("devEngines.runtime", qn), R("pnpm", (e) => e === null || typeof e == "object" && Object.values(e).every((e) => typeof e == "object" && !!e && Object.keys(e).length === 0)), Rt("pnpm", "pnpm 11+ ignores the \"pnpm\" field in package.json. Move its settings to pnpm-workspace.yaml: overrides as is, onlyBuiltDependencies as allowBuilds true, neverBuiltDependencies as allowBuilds false.");
|
|
1343
|
+
}
|
|
1343
1344
|
function rr() {
|
|
1344
|
-
|
|
1345
|
+
nr(), R("name"), z("fmt", "turbo run fmt"), z("check", "turbo run check");
|
|
1346
|
+
for (let [e, t] of Object.entries($n)) z(e, t);
|
|
1345
1347
|
for (let [e, t] of Object.entries(er)) z(e, t);
|
|
1346
|
-
for (let [e, t] of Object.entries(tr)) z(e, t);
|
|
1347
1348
|
B("build"), B("build:dev"), z("mark-stable", "turbo run mark-stable"), z("do-pack", "turbo run do-pack"), z("watch", "turbo watch build"), z("changeset", "changeset"), z("version-packages", "changeset version"), z("update-sdk", "block-tools structure refresh --update-deps-only"), B("update"), z("upgrade-sdk", "block-tools structure refresh --update-deps-only && pnpm i && block-tools structure refresh && pnpm i && pnpm fmt"), U({
|
|
1348
1349
|
"@changesets/cli": "catalog:",
|
|
1349
1350
|
"@milaboratories/ts-builder": "sdk:",
|
|
@@ -1351,14 +1352,14 @@ function rr() {
|
|
|
1351
1352
|
"cross-env": "catalog:",
|
|
1352
1353
|
shx: "catalog:",
|
|
1353
1354
|
turbo: "catalog:"
|
|
1354
|
-
}),
|
|
1355
|
+
}), W({
|
|
1355
1356
|
oxlint: "*",
|
|
1356
1357
|
oxfmt: "*"
|
|
1357
|
-
}),
|
|
1358
|
+
}), qt((e, t) => {
|
|
1358
1359
|
if (!/^(\/\/|--)/.test(e) || typeof t != "object" || !t) return !1;
|
|
1359
1360
|
let n = t;
|
|
1360
1361
|
return n.pnpm !== void 0 || n.overrides !== void 0;
|
|
1361
|
-
}),
|
|
1362
|
+
}), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
1362
1363
|
}
|
|
1363
1364
|
// src/structure/rules/root-turbo-json.ts
|
|
1364
1365
|
var ir = "https://turbo.build/schema.json", ar = ["tsconfig.json"], or = {
|
|
@@ -1418,7 +1419,7 @@ function sr() {
|
|
|
1418
1419
|
};
|
|
1419
1420
|
}
|
|
1420
1421
|
function cr() {
|
|
1421
|
-
L("$schema", ir), L("globalDependencies", ar), zt("tasks", or), R("tasks.build:dev"),
|
|
1422
|
+
L("$schema", ir), L("globalDependencies", ar), zt("tasks", or), R("tasks.build:dev"), G([
|
|
1422
1423
|
"$schema",
|
|
1423
1424
|
"globalDependencies",
|
|
1424
1425
|
"tasks"
|
|
@@ -1509,7 +1510,7 @@ function Cr() {
|
|
|
1509
1510
|
for (let e of Sr) H(e);
|
|
1510
1511
|
}
|
|
1511
1512
|
// src/structure/rules/root-pnpm-workspace.ts
|
|
1512
|
-
var
|
|
1513
|
+
var wr = [
|
|
1513
1514
|
"@platforma-sdk/model",
|
|
1514
1515
|
"@platforma-sdk/ui-vue",
|
|
1515
1516
|
"@platforma-sdk/workflow-tengo",
|
|
@@ -1521,38 +1522,41 @@ var Q = [
|
|
|
1521
1522
|
"@platforma-sdk/package-builder",
|
|
1522
1523
|
"@milaboratories/ts-builder",
|
|
1523
1524
|
"@milaboratories/ts-configs"
|
|
1524
|
-
],
|
|
1525
|
-
for (let e of
|
|
1526
|
-
var
|
|
1527
|
-
turbo:
|
|
1525
|
+
], Tr = "0.0.0-init-must-fetch";
|
|
1526
|
+
for (let e of wr) if (!vr(e)) throw Error(`SDK_CATALOG_PACKAGES entry '${e}' matches no catalog bump pattern; its placeholder would never be resolved to npm latest on init. Add it to CATALOG_BUMP_PATTERNS or move it to the infra floor.`);
|
|
1527
|
+
var Er = {
|
|
1528
|
+
turbo: Yn,
|
|
1528
1529
|
shx: "~0.4.0",
|
|
1529
1530
|
"cross-env": "~10.1.0",
|
|
1530
1531
|
"@changesets/cli": "~2.29.8",
|
|
1531
1532
|
vitest: "~4.0.18",
|
|
1532
1533
|
typescript: "~5.9.3"
|
|
1533
|
-
},
|
|
1534
|
+
}, Dr = [{
|
|
1534
1535
|
entry: "vue",
|
|
1535
1536
|
of: "@platforma-sdk/ui-vue"
|
|
1536
1537
|
}, {
|
|
1537
1538
|
entry: "@milaboratories/helpers",
|
|
1538
1539
|
of: "@platforma-sdk/model"
|
|
1539
|
-
}],
|
|
1540
|
-
function
|
|
1540
|
+
}], Or = "@platforma-open/milaboratories.runenv-python-3", kr = "1.8.2";
|
|
1541
|
+
function Ar(e) {
|
|
1541
1542
|
let t = e.modules.filter((e) => e.path !== "").map((e) => e.path).sort(), n = {};
|
|
1542
|
-
for (let e of
|
|
1543
|
-
return Object.assign(n,
|
|
1543
|
+
for (let e of wr) n[e] = Tr;
|
|
1544
|
+
return Object.assign(n, Er), e.modules.some((e) => e.scope === "software") && (n[Or] = kr), {
|
|
1544
1545
|
packages: t,
|
|
1545
1546
|
catalog: n
|
|
1546
1547
|
};
|
|
1547
1548
|
}
|
|
1548
|
-
function
|
|
1549
|
-
|
|
1550
|
-
for (let [e, t] of Object.entries(
|
|
1551
|
-
|
|
1552
|
-
|
|
1549
|
+
function jr() {
|
|
1550
|
+
on("minimumReleaseAgeExclude", Xn), an("allowBuilds", Qn, { keepExisting: !0 }), an("allowBuilds", Zn);
|
|
1551
|
+
for (let [e, t] of Object.entries(Er)) $t(e, t);
|
|
1552
|
+
nn("turbo", Yn);
|
|
1553
|
+
}
|
|
1554
|
+
function Mr() {
|
|
1555
|
+
Zt(), jr();
|
|
1556
|
+
for (let e of Sr) rn(e);
|
|
1553
1557
|
}
|
|
1554
1558
|
// src/structure/rules/root-gitignore.ts
|
|
1555
|
-
var
|
|
1559
|
+
var Nr = [
|
|
1556
1560
|
".test_auth.json",
|
|
1557
1561
|
"node_modules/",
|
|
1558
1562
|
"dist/",
|
|
@@ -1567,30 +1571,30 @@ var jr = [
|
|
|
1567
1571
|
".vscode/sftp.json",
|
|
1568
1572
|
"test-dry-run.json"
|
|
1569
1573
|
];
|
|
1570
|
-
function
|
|
1571
|
-
|
|
1574
|
+
function Pr() {
|
|
1575
|
+
sn(Nr);
|
|
1572
1576
|
}
|
|
1573
1577
|
// src/structure/rules/root-changeset-config.ts
|
|
1574
|
-
var
|
|
1575
|
-
function
|
|
1578
|
+
var Fr = "---\n---\n\nInitial release.\n";
|
|
1579
|
+
function Ir(e) {
|
|
1576
1580
|
return {
|
|
1577
1581
|
$schema: "https://unpkg.com/@changesets/config@3.1.1/schema.json",
|
|
1578
|
-
changelog:
|
|
1582
|
+
changelog: Rr,
|
|
1579
1583
|
commit: !1,
|
|
1580
|
-
fixed: [
|
|
1584
|
+
fixed: [Wr(e)],
|
|
1581
1585
|
linked: [],
|
|
1582
|
-
access:
|
|
1583
|
-
baseBranch:
|
|
1584
|
-
updateInternalDependencies:
|
|
1586
|
+
access: zr,
|
|
1587
|
+
baseBranch: Br,
|
|
1588
|
+
updateInternalDependencies: Vr,
|
|
1585
1589
|
ignore: []
|
|
1586
1590
|
};
|
|
1587
1591
|
}
|
|
1588
|
-
function
|
|
1589
|
-
L("changelog",
|
|
1590
|
-
let t =
|
|
1591
|
-
|
|
1592
|
+
function Lr(e) {
|
|
1593
|
+
L("changelog", Rr), L("commit", !1), L("access", zr), L("baseBranch", Br), L("updateInternalDependencies", Vr);
|
|
1594
|
+
let t = Wr(e);
|
|
1595
|
+
Xt("fixed", (e) => Gr(e, t)), G(Hr);
|
|
1592
1596
|
}
|
|
1593
|
-
var
|
|
1597
|
+
var Rr = "@changesets/cli/changelog", zr = "restricted", Br = "main", Vr = "patch", Hr = [
|
|
1594
1598
|
"$schema",
|
|
1595
1599
|
"changelog",
|
|
1596
1600
|
"commit",
|
|
@@ -1600,66 +1604,66 @@ var Ir = "@changesets/cli/changelog", Lr = "restricted", Rr = "main", zr = "patc
|
|
|
1600
1604
|
"baseBranch",
|
|
1601
1605
|
"updateInternalDependencies",
|
|
1602
1606
|
"ignore"
|
|
1603
|
-
],
|
|
1607
|
+
], Ur = [
|
|
1604
1608
|
"block",
|
|
1605
1609
|
"model",
|
|
1606
1610
|
"ui",
|
|
1607
1611
|
"workflow"
|
|
1608
1612
|
];
|
|
1609
|
-
function
|
|
1610
|
-
return
|
|
1613
|
+
function Wr(e) {
|
|
1614
|
+
return Ur.flatMap((t) => q(e, t).map((e) => e.name));
|
|
1611
1615
|
}
|
|
1612
|
-
function
|
|
1613
|
-
let n = new Set(t), r = Array.isArray(e) ? e.filter(
|
|
1616
|
+
function Gr(e, t) {
|
|
1617
|
+
let n = new Set(t), r = Array.isArray(e) ? e.filter(Kr) : [], i = r.findIndex((e) => e.some((e) => n.has(e))), a = [];
|
|
1614
1618
|
return r.forEach((e, r) => {
|
|
1615
1619
|
let o = e.filter((e) => !n.has(e));
|
|
1616
1620
|
r === i ? a.push([...t, ...o]) : o.length > 0 && a.push(o);
|
|
1617
1621
|
}), i === -1 && a.push(t), a;
|
|
1618
1622
|
}
|
|
1619
|
-
function
|
|
1623
|
+
function Kr(e) {
|
|
1620
1624
|
return Array.isArray(e) && e.every((e) => typeof e == "string");
|
|
1621
1625
|
}
|
|
1622
1626
|
// src/structure/rules/root.ts
|
|
1623
|
-
function
|
|
1627
|
+
function qr() {
|
|
1624
1628
|
x("root", () => {
|
|
1625
1629
|
S(({ ctx: e }) => !e.isSdkInternal, () => {
|
|
1626
1630
|
T("turbo.json", j(() => sr()), () => {
|
|
1627
1631
|
cr();
|
|
1628
|
-
}), w(".vscode/settings.json", k("root/.vscode/settings.json")), T("package.json", j(() =>
|
|
1632
|
+
}), w(".vscode/settings.json", k("root/.vscode/settings.json")), T("package.json", j(() => tr()), () => {
|
|
1629
1633
|
rr();
|
|
1630
|
-
}), T("pnpm-workspace.yaml", j((e) =>
|
|
1631
|
-
Ar();
|
|
1632
|
-
}), T(".gitignore", k("root/gitignore"), () => {
|
|
1634
|
+
}), T("pnpm-workspace.yaml", j((e) => Ar(e)), () => {
|
|
1633
1635
|
Mr();
|
|
1634
|
-
}), T(".
|
|
1635
|
-
|
|
1636
|
-
}),
|
|
1636
|
+
}), T(".gitignore", k("root/gitignore"), () => {
|
|
1637
|
+
Pr();
|
|
1638
|
+
}), T(".changeset/config.json", j((e) => Ir(e)), (e) => {
|
|
1639
|
+
Lr(e);
|
|
1640
|
+
}), D(".changeset/scaffold.md", ct(Fr));
|
|
1637
1641
|
});
|
|
1638
1642
|
});
|
|
1639
1643
|
}
|
|
1640
1644
|
// src/structure/rules/root-ci.ts
|
|
1641
|
-
function
|
|
1645
|
+
function Jr(e) {
|
|
1642
1646
|
return e.split(/[-_]+/).filter((e) => e.length > 0).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
1643
1647
|
}
|
|
1644
|
-
function
|
|
1648
|
+
function Yr() {
|
|
1645
1649
|
x("root", () => {
|
|
1646
1650
|
S(({ ctx: e }) => !e.isSdkInternal, () => {
|
|
1647
1651
|
w(".github/workflows/build.yaml", A("workflows/build.tpl.yaml", (e) => {
|
|
1648
1652
|
let t = e.blockVars.shortName;
|
|
1649
1653
|
return {
|
|
1650
|
-
appName: `Block: ${
|
|
1654
|
+
appName: `Block: ${Jr(t)}`,
|
|
1651
1655
|
appNameSlug: `block-${t}`,
|
|
1652
|
-
nodeVersion:
|
|
1656
|
+
nodeVersion: Kn
|
|
1653
1657
|
};
|
|
1654
1658
|
})), w(".github/workflows/mark-stable.yaml", A("workflows/mark-stable.tpl.yaml", (e) => ({
|
|
1655
|
-
appName: `Block: ${
|
|
1656
|
-
nodeVersion:
|
|
1659
|
+
appName: `Block: ${Jr(e.blockVars.shortName)} - Mark Stable`,
|
|
1660
|
+
nodeVersion: Kn
|
|
1657
1661
|
})));
|
|
1658
1662
|
});
|
|
1659
1663
|
});
|
|
1660
1664
|
}
|
|
1661
1665
|
// src/structure/rules/block-package-json.ts
|
|
1662
|
-
var
|
|
1666
|
+
var Xr = {
|
|
1663
1667
|
"@platforma-open": {
|
|
1664
1668
|
s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1",
|
|
1665
1669
|
serveUrl: "https://blocks.pl-open.science"
|
|
@@ -1668,45 +1672,45 @@ var Jr = {
|
|
|
1668
1672
|
s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1",
|
|
1669
1673
|
serveUrl: "https://block.registry.platforma.bio/releases"
|
|
1670
1674
|
}
|
|
1671
|
-
},
|
|
1675
|
+
}, Zr = {
|
|
1672
1676
|
s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1",
|
|
1673
1677
|
serveUrl: "https://blocks.pl-open.science"
|
|
1674
|
-
},
|
|
1678
|
+
}, Qr = {
|
|
1675
1679
|
s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/aux/dev/?region=eu-central-1",
|
|
1676
1680
|
serveUrl: "https://aux-blocks.pl-open.science"
|
|
1677
1681
|
};
|
|
1678
|
-
function
|
|
1679
|
-
let n = t ?
|
|
1682
|
+
function $r(e, t) {
|
|
1683
|
+
let n = t ? Qr : Xr[e] ?? Zr;
|
|
1680
1684
|
return `block-tools publish -r ${n.s3} --registry-serve-url ${n.serveUrl}`;
|
|
1681
1685
|
}
|
|
1682
|
-
function
|
|
1686
|
+
function ei(e) {
|
|
1683
1687
|
let t = {};
|
|
1684
|
-
for (let n of
|
|
1685
|
-
for (let n of
|
|
1686
|
-
for (let n of
|
|
1688
|
+
for (let n of q(e, "workflow")) t.workflow = `${n.name}/dist/tengo/tpl/main.plj.gz`;
|
|
1689
|
+
for (let n of q(e, "model")) t.model = `${n.name}/dist/model.json`;
|
|
1690
|
+
for (let n of q(e, "ui")) t.ui = `${n.name}/dist`;
|
|
1687
1691
|
return t;
|
|
1688
1692
|
}
|
|
1689
|
-
function
|
|
1693
|
+
function ti(e, t) {
|
|
1690
1694
|
return {
|
|
1691
1695
|
build: "ts-builder build --target block-facade && block-tools pack",
|
|
1692
1696
|
check: "ts-builder type-check --target block-facade",
|
|
1693
|
-
prepublishOnly:
|
|
1697
|
+
prepublishOnly: $r(e, t),
|
|
1694
1698
|
"do-pack": "shx rm -f package.tgz && pnpm pack && shx mv *.tgz package.tgz"
|
|
1695
1699
|
};
|
|
1696
1700
|
}
|
|
1697
|
-
var
|
|
1701
|
+
var ni = {
|
|
1698
1702
|
"@milaboratories/ts-builder": "sdk:",
|
|
1699
1703
|
"@milaboratories/ts-configs": "sdk:",
|
|
1700
1704
|
"@platforma-sdk/block-tools": "sdk:",
|
|
1701
1705
|
"@platforma-sdk/model": "sdk:",
|
|
1702
1706
|
shx: "catalog:",
|
|
1703
1707
|
typescript: "catalog:"
|
|
1704
|
-
},
|
|
1708
|
+
}, ri = { ".": {
|
|
1705
1709
|
sources: "./src/index.ts",
|
|
1706
1710
|
types: "./dist/index.d.ts",
|
|
1707
1711
|
default: "./dist/index.js"
|
|
1708
1712
|
} };
|
|
1709
|
-
function
|
|
1713
|
+
function ii(e) {
|
|
1710
1714
|
if (Object.keys(e.components).length === 0) throw Error("block.components is empty — no workflow/model/ui module was discovered");
|
|
1711
1715
|
let t = e.meta, n = [
|
|
1712
1716
|
["block.meta.title", t.title],
|
|
@@ -1718,15 +1722,15 @@ function ni(e) {
|
|
|
1718
1722
|
];
|
|
1719
1723
|
for (let [e, t] of n) if (typeof t != "string" || t === "") throw Error(`required block field '${e}' is empty`);
|
|
1720
1724
|
}
|
|
1721
|
-
function
|
|
1725
|
+
function ai(e) {
|
|
1722
1726
|
let t = e.blockVars, n = {
|
|
1723
|
-
...
|
|
1724
|
-
...
|
|
1725
|
-
...
|
|
1726
|
-
...
|
|
1727
|
-
...
|
|
1727
|
+
...ni,
|
|
1728
|
+
...J(e, "model"),
|
|
1729
|
+
...J(e, "ui"),
|
|
1730
|
+
...J(e, "workflow"),
|
|
1731
|
+
...J(e, "kind")
|
|
1728
1732
|
}, r = {
|
|
1729
|
-
components:
|
|
1733
|
+
components: ei(e),
|
|
1730
1734
|
meta: {
|
|
1731
1735
|
title: t.shortName,
|
|
1732
1736
|
description: `${t.shortName} block`,
|
|
@@ -1738,52 +1742,52 @@ function ri(e) {
|
|
|
1738
1742
|
}
|
|
1739
1743
|
}
|
|
1740
1744
|
};
|
|
1741
|
-
return
|
|
1745
|
+
return ii(r), {
|
|
1742
1746
|
name: `${t.facadeName}.block`,
|
|
1743
|
-
version:
|
|
1747
|
+
version: Z,
|
|
1744
1748
|
type: "module",
|
|
1745
1749
|
files: ["dist", "block-pack"],
|
|
1746
1750
|
main: "./dist/index.js",
|
|
1747
1751
|
module: "./dist/index.js",
|
|
1748
1752
|
types: "./dist/index.d.ts",
|
|
1749
|
-
exports:
|
|
1750
|
-
scripts:
|
|
1753
|
+
exports: ri,
|
|
1754
|
+
scripts: ti(t.npmOrg, e.isSdkInternal),
|
|
1751
1755
|
dependencies: {},
|
|
1752
1756
|
devDependencies: n,
|
|
1753
1757
|
block: r
|
|
1754
1758
|
};
|
|
1755
1759
|
}
|
|
1756
|
-
function
|
|
1757
|
-
let t = e.blockVars, n =
|
|
1760
|
+
function oi(e) {
|
|
1761
|
+
let t = e.blockVars, n = q(e, "kind");
|
|
1758
1762
|
if (n.length !== 1) throw Error(n.length === 0 ? `block '${t.facadeName}' declares no kind — every block must have a sibling kind/ package` : `block '${t.facadeName}' declares ${n.length} kinds; exactly one is required`);
|
|
1759
|
-
L("type", "module"), L("files", ["dist", "block-pack"]), L("main", "./dist/index.js"), L("module", "./dist/index.js"), L("types", "./dist/index.d.ts"), L("exports",
|
|
1760
|
-
let r =
|
|
1763
|
+
L("type", "module"), L("files", ["dist", "block-pack"]), L("main", "./dist/index.js"), L("module", "./dist/index.js"), L("types", "./dist/index.d.ts"), L("exports", ri);
|
|
1764
|
+
let r = ti(t.npmOrg, e.isSdkInternal);
|
|
1761
1765
|
for (let [e, t] of Object.entries(r)) z(e, t);
|
|
1762
|
-
|
|
1766
|
+
Kt("model"), Kt("ui"), Kt("workflow"), Kt("kind"), V("@milaboratories/ts-builder", "sdk:"), V("@milaboratories/ts-configs", "sdk:"), V("@platforma-sdk/block-tools", "sdk:"), V("@platforma-sdk/model", "sdk:"), V("shx", "catalog:"), V("typescript", "catalog:"), L("block.components", ei(e)), Lt("version", "facade package.json must carry a 'version' (the facade publishes)"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
1763
1767
|
}
|
|
1764
1768
|
// src/structure/rules/shared/pascal-case.ts
|
|
1765
|
-
function
|
|
1769
|
+
function si(e) {
|
|
1766
1770
|
let t = e.split(/[^A-Za-z0-9]+/).filter((e) => e.length > 0).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
1767
1771
|
return /^[0-9]/.test(t) ? `_${t}` : t;
|
|
1768
1772
|
}
|
|
1769
1773
|
// src/structure/rules/block.ts
|
|
1770
|
-
function
|
|
1774
|
+
function ci() {
|
|
1771
1775
|
x("block", () => {
|
|
1772
1776
|
O("index.js"), O("index.d.ts"), w("src/index.ts", A("block/src/index.tpl.ts", (e) => ({
|
|
1773
1777
|
facadeName: e.blockVars.facadeName,
|
|
1774
|
-
pascalName:
|
|
1775
|
-
}))), w("src/AGENTS.ts", k("block/src/AGENTS.ts")), E("src/block-extra.ts", k("block/src/block-extra.ts")), E("src/agents-extra.ts", k("block/src/agents-extra.ts")), w("tsconfig.json", k("block/tsconfig.json")), D("logos/block-logo.png", st("block/logos/block-logo.png")), D("logos/organization-logo.png", st("block/logos/organization-logo.png")), T("package.json", j((e) =>
|
|
1776
|
-
|
|
1778
|
+
pascalName: si(e.blockVars.shortName)
|
|
1779
|
+
}))), w("src/AGENTS.ts", k("block/src/AGENTS.ts")), E("src/block-extra.ts", k("block/src/block-extra.ts")), E("src/agents-extra.ts", k("block/src/agents-extra.ts")), w("tsconfig.json", k("block/tsconfig.json")), D("logos/block-logo.png", st("block/logos/block-logo.png")), D("logos/organization-logo.png", st("block/logos/organization-logo.png")), T("package.json", j((e) => ai(e)), (e) => {
|
|
1780
|
+
oi(e);
|
|
1777
1781
|
});
|
|
1778
1782
|
});
|
|
1779
1783
|
}
|
|
1780
1784
|
// src/structure/rules/shared/colocated-tests.ts
|
|
1781
|
-
var $ = "src/**/*.test.ts",
|
|
1785
|
+
var $ = "src/**/*.test.ts", li = "src/**/*.test.tengo";
|
|
1782
1786
|
// src/structure/rules/model-package-json.ts
|
|
1783
|
-
function
|
|
1787
|
+
function ui(e) {
|
|
1784
1788
|
return {
|
|
1785
1789
|
name: `${e.blockVars.facadeName}.model`,
|
|
1786
|
-
version:
|
|
1790
|
+
version: Z,
|
|
1787
1791
|
private: !0,
|
|
1788
1792
|
type: "module",
|
|
1789
1793
|
main: "dist/index.cjs",
|
|
@@ -1805,7 +1809,7 @@ function ci(e) {
|
|
|
1805
1809
|
},
|
|
1806
1810
|
dependencies: {
|
|
1807
1811
|
"@platforma-sdk/model": "sdk:",
|
|
1808
|
-
...
|
|
1812
|
+
...J(e, "kind")
|
|
1809
1813
|
},
|
|
1810
1814
|
devDependencies: {
|
|
1811
1815
|
"@milaboratories/ts-builder": "sdk:",
|
|
@@ -1818,51 +1822,51 @@ function ci(e) {
|
|
|
1818
1822
|
}
|
|
1819
1823
|
};
|
|
1820
1824
|
}
|
|
1821
|
-
function
|
|
1822
|
-
|
|
1825
|
+
function di() {
|
|
1826
|
+
Q(), L("private", !0), L("type", "module"), L("main", "dist/index.cjs"), L("module", "dist/index.js"), L("types", "dist/index.d.ts"), L("exports", {
|
|
1823
1827
|
".": {
|
|
1824
1828
|
types: "./dist/index.d.ts",
|
|
1825
1829
|
sources: "./src/index.ts",
|
|
1826
1830
|
import: "./dist/index.js"
|
|
1827
1831
|
},
|
|
1828
1832
|
"./dist/*": "./dist/*"
|
|
1829
|
-
}), z("fmt", "ts-builder format"), z("watch", "ts-builder build --target block-model --watch"), z("build", "ts-builder build --target block-model && block-tools build-model"), z("check", "ts-builder check --target block-model"), Ht("@platforma-sdk/model", "sdk:"),
|
|
1833
|
+
}), z("fmt", "ts-builder format"), z("watch", "ts-builder build --target block-model --watch"), z("build", "ts-builder build --target block-model && block-tools build-model"), z("check", "ts-builder check --target block-model"), Ht("@platforma-sdk/model", "sdk:"), Gt("kind"), U({
|
|
1830
1834
|
"@milaboratories/ts-builder": "sdk:",
|
|
1831
1835
|
"@milaboratories/ts-configs": "sdk:",
|
|
1832
1836
|
"@platforma-sdk/block-tools": "sdk:"
|
|
1833
|
-
}),
|
|
1837
|
+
}), W({
|
|
1834
1838
|
"@types/node": "*",
|
|
1835
1839
|
typescript: "*"
|
|
1836
1840
|
}), S(({ ctx: e }) => !e.isSdkInternal, () => S(C($), () => {
|
|
1837
1841
|
z("test", "vitest run --passWithNoTests"), V("vitest", "catalog:"), V("@types/node", "*");
|
|
1838
|
-
}, () => H("vitest"))), Cr(), R("tsup"), B("lint"),
|
|
1842
|
+
}, () => H("vitest"))), Cr(), R("tsup"), B("lint"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
1839
1843
|
}
|
|
1840
1844
|
// src/structure/rules/model.ts
|
|
1841
|
-
function
|
|
1845
|
+
function fi() {
|
|
1842
1846
|
x("model", () => {
|
|
1843
|
-
S(C($), () => w("tsconfig.json", k("model/tsconfig.node.json")), () => w("tsconfig.json", k("model/tsconfig.json"))), w(".oxlintrc.json", k("model/.oxlintrc.json")), w(".oxfmtrc.json", k("model/.oxfmtrc.json")), D("src/index.ts", A("model/src/index.tpl.ts", (e) => ({ kindPkg: `${e.blockVars.facadeName}.kind` }))), T("package.json", j((e) =>
|
|
1844
|
-
|
|
1847
|
+
S(C($), () => w("tsconfig.json", k("model/tsconfig.node.json")), () => w("tsconfig.json", k("model/tsconfig.json"))), w(".oxlintrc.json", k("model/.oxlintrc.json")), w(".oxfmtrc.json", k("model/.oxfmtrc.json")), D("src/index.ts", A("model/src/index.tpl.ts", (e) => ({ kindPkg: `${e.blockVars.facadeName}.kind` }))), T("package.json", j((e) => ui(e)), () => {
|
|
1848
|
+
di();
|
|
1845
1849
|
});
|
|
1846
1850
|
});
|
|
1847
1851
|
}
|
|
1848
1852
|
// src/structure/rules/kind-package-json.ts
|
|
1849
|
-
var
|
|
1853
|
+
var pi = { ".": {
|
|
1850
1854
|
types: "./dist/index.d.ts",
|
|
1851
1855
|
sources: "./src/index.ts",
|
|
1852
1856
|
import: "./dist/index.js",
|
|
1853
1857
|
require: "./dist/index.cjs",
|
|
1854
1858
|
default: "./dist/index.js"
|
|
1855
1859
|
} };
|
|
1856
|
-
function
|
|
1860
|
+
function mi(e) {
|
|
1857
1861
|
return {
|
|
1858
1862
|
name: `${e.blockVars.facadeName}.kind`,
|
|
1859
|
-
version:
|
|
1863
|
+
version: Z,
|
|
1860
1864
|
private: !0,
|
|
1861
1865
|
type: "module",
|
|
1862
1866
|
main: "./dist/index.cjs",
|
|
1863
1867
|
module: "./dist/index.js",
|
|
1864
1868
|
types: "./dist/index.d.ts",
|
|
1865
|
-
exports:
|
|
1869
|
+
exports: pi,
|
|
1866
1870
|
scripts: {
|
|
1867
1871
|
fmt: "ts-builder format",
|
|
1868
1872
|
watch: "ts-builder build --target block-kind --watch",
|
|
@@ -1881,29 +1885,29 @@ function fi(e) {
|
|
|
1881
1885
|
}
|
|
1882
1886
|
};
|
|
1883
1887
|
}
|
|
1884
|
-
function
|
|
1885
|
-
|
|
1888
|
+
function hi() {
|
|
1889
|
+
Q(), L("private", !0), L("type", "module"), L("main", "./dist/index.cjs"), L("module", "./dist/index.js"), L("types", "./dist/index.d.ts"), L("exports", pi), z("fmt", "ts-builder format"), z("watch", "ts-builder build --target block-kind --watch"), z("build", "ts-builder build --target block-kind && block-tools build-kind-manifest"), z("check", "ts-builder check --target block-kind"), B("lint"), Ht("@platforma-sdk/block-kind", "sdk:"), U({
|
|
1886
1890
|
"@milaboratories/ts-builder": "sdk:",
|
|
1887
1891
|
"@milaboratories/ts-configs": "sdk:",
|
|
1888
1892
|
"@platforma-sdk/block-tools": "sdk:"
|
|
1889
|
-
}),
|
|
1893
|
+
}), W({
|
|
1890
1894
|
"@types/node": "*",
|
|
1891
1895
|
typescript: "*"
|
|
1892
|
-
}),
|
|
1896
|
+
}), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
1893
1897
|
}
|
|
1894
1898
|
// src/structure/rules/kind.ts
|
|
1895
|
-
function
|
|
1899
|
+
function gi() {
|
|
1896
1900
|
x("kind", () => {
|
|
1897
|
-
w("tsconfig.json", k("kind/tsconfig.json")), w(".oxlintrc.json", k("kind/.oxlintrc.json")), w(".oxfmtrc.json", k("kind/.oxfmtrc.json")), E("src/index.ts", k("kind/src/index.ts")), T("package.json", j((e) =>
|
|
1898
|
-
|
|
1901
|
+
w("tsconfig.json", k("kind/tsconfig.json")), w(".oxlintrc.json", k("kind/.oxlintrc.json")), w(".oxfmtrc.json", k("kind/.oxfmtrc.json")), E("src/index.ts", k("kind/src/index.ts")), T("package.json", j((e) => mi(e)), () => {
|
|
1902
|
+
hi();
|
|
1899
1903
|
});
|
|
1900
1904
|
});
|
|
1901
1905
|
}
|
|
1902
1906
|
// src/structure/rules/ui-package-json.ts
|
|
1903
|
-
function
|
|
1907
|
+
function _i(e) {
|
|
1904
1908
|
return {
|
|
1905
1909
|
name: `${e.blockVars.facadeName}.ui`,
|
|
1906
|
-
version:
|
|
1910
|
+
version: Z,
|
|
1907
1911
|
private: !0,
|
|
1908
1912
|
type: "module",
|
|
1909
1913
|
scripts: {
|
|
@@ -1916,7 +1920,7 @@ function hi(e) {
|
|
|
1916
1920
|
dependencies: {
|
|
1917
1921
|
"@platforma-sdk/ui-vue": "sdk:",
|
|
1918
1922
|
vue: "catalog:",
|
|
1919
|
-
...
|
|
1923
|
+
...In(e, "model")
|
|
1920
1924
|
},
|
|
1921
1925
|
devDependencies: {
|
|
1922
1926
|
"@milaboratories/ts-builder": "sdk:",
|
|
@@ -1928,30 +1932,30 @@ function hi(e) {
|
|
|
1928
1932
|
}
|
|
1929
1933
|
};
|
|
1930
1934
|
}
|
|
1931
|
-
function
|
|
1932
|
-
|
|
1935
|
+
function vi() {
|
|
1936
|
+
Q(), L("private", !0), L("type", "module"), z("fmt", "ts-builder format"), z("dev", "ts-builder serve --target block-ui"), z("watch", "ts-builder build --target block-ui --watch"), z("build", "ts-builder build --target block-ui"), z("check", "ts-builder check --target block-ui"), Ht("@platforma-sdk/ui-vue", "sdk:"), Ht("vue", "catalog:"), Gt("model"), U({
|
|
1933
1937
|
"@milaboratories/ts-builder": "sdk:",
|
|
1934
1938
|
"@milaboratories/ts-configs": "sdk:"
|
|
1935
|
-
}), Cr(), B("preview"), B("lint"),
|
|
1939
|
+
}), Cr(), B("preview"), B("lint"), W({
|
|
1936
1940
|
"@types/node": "*",
|
|
1937
1941
|
typescript: "*"
|
|
1938
1942
|
}), S(({ ctx: e }) => !e.isSdkInternal, () => S(C($), () => {
|
|
1939
1943
|
z("test", "vitest run --passWithNoTests"), V("vitest", "catalog:"), V("@types/node", "*");
|
|
1940
|
-
}, () => H("vitest"))),
|
|
1944
|
+
}, () => H("vitest"))), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
1941
1945
|
}
|
|
1942
1946
|
// src/structure/rules/ui.ts
|
|
1943
|
-
function
|
|
1947
|
+
function yi() {
|
|
1944
1948
|
x("ui", () => {
|
|
1945
|
-
S(C($), () => w("tsconfig.json", k("ui/tsconfig.node.json")), () => w("tsconfig.json", k("ui/tsconfig.json"))), w(".oxlintrc.json", k("ui/.oxlintrc.json")), w(".oxfmtrc.json", k("ui/.oxfmtrc.json")), E("index.html", k("ui/index.html")), D("src/main.ts", k("ui/src/main.ts")), D("src/app.ts", A("ui/src/app.tpl.ts", (e) => ({ modelPkg: `${e.blockVars.facadeName}.model` }))), D("src/MainPage.vue", A("ui/src/MainPage.tpl.vue", (e) => ({ shortName: e.blockVars.shortName }))), T("package.json", j((e) =>
|
|
1946
|
-
|
|
1949
|
+
S(C($), () => w("tsconfig.json", k("ui/tsconfig.node.json")), () => w("tsconfig.json", k("ui/tsconfig.json"))), w(".oxlintrc.json", k("ui/.oxlintrc.json")), w(".oxfmtrc.json", k("ui/.oxfmtrc.json")), E("index.html", k("ui/index.html")), D("src/main.ts", k("ui/src/main.ts")), D("src/app.ts", A("ui/src/app.tpl.ts", (e) => ({ modelPkg: `${e.blockVars.facadeName}.model` }))), D("src/MainPage.vue", A("ui/src/MainPage.tpl.vue", (e) => ({ shortName: e.blockVars.shortName }))), T("package.json", j((e) => _i(e)), () => {
|
|
1950
|
+
vi();
|
|
1947
1951
|
});
|
|
1948
1952
|
});
|
|
1949
1953
|
}
|
|
1950
1954
|
// src/structure/rules/workflow-package-json.ts
|
|
1951
|
-
function
|
|
1955
|
+
function bi(e) {
|
|
1952
1956
|
return {
|
|
1953
1957
|
name: `${e.blockVars.facadeName}.workflow`,
|
|
1954
|
-
version:
|
|
1958
|
+
version: Z,
|
|
1955
1959
|
private: !0,
|
|
1956
1960
|
type: "module",
|
|
1957
1961
|
scripts: {
|
|
@@ -1961,7 +1965,7 @@ function vi(e) {
|
|
|
1961
1965
|
},
|
|
1962
1966
|
dependencies: {
|
|
1963
1967
|
"@platforma-sdk/workflow-tengo": "sdk:",
|
|
1964
|
-
...
|
|
1968
|
+
...J(e, "software")
|
|
1965
1969
|
},
|
|
1966
1970
|
devDependencies: {
|
|
1967
1971
|
"@platforma-sdk/tengo-builder": "sdk:",
|
|
@@ -1970,34 +1974,34 @@ function vi(e) {
|
|
|
1970
1974
|
}
|
|
1971
1975
|
};
|
|
1972
1976
|
}
|
|
1973
|
-
function
|
|
1974
|
-
|
|
1975
|
-
S(C(
|
|
1977
|
+
function xi() {
|
|
1978
|
+
Q(), L("private", !0), L("type", "module"), z("build", "shx rm -rf dist && pl-tengo build"), z("check", "pl-tengo imports && pl-tengo check"), z("format", "/usr/bin/env emacs --script ./format.el || echo 'No emacs.'"), S(({ ctx: e }) => !e.isSdkInternal, () => S(C($), () => {
|
|
1979
|
+
S(C(li), () => z("test", "pl-tengo test && vitest run --passWithNoTests"), () => z("test", "vitest run --passWithNoTests")), U({ vitest: "catalog:" });
|
|
1976
1980
|
}, () => {
|
|
1977
|
-
S(C(
|
|
1978
|
-
})), Ht("@platforma-sdk/workflow-tengo", "sdk:"),
|
|
1981
|
+
S(C(li), () => z("test", "pl-tengo test")), H("vitest");
|
|
1982
|
+
})), Ht("@platforma-sdk/workflow-tengo", "sdk:"), Gt("software"), U({
|
|
1979
1983
|
"@platforma-sdk/tengo-builder": "sdk:",
|
|
1980
1984
|
"@platforma-sdk/test": "sdk:",
|
|
1981
1985
|
shx: "catalog:"
|
|
1982
|
-
}), Cr(),
|
|
1986
|
+
}), Cr(), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
1983
1987
|
}
|
|
1984
1988
|
// src/structure/rules/workflow.ts
|
|
1985
|
-
function
|
|
1989
|
+
function Si() {
|
|
1986
1990
|
x("workflow", () => {
|
|
1987
1991
|
w("format.el", k("workflow/format.el")), S(({ ctx: e }) => !e.isSdkInternal, () => S(C($), () => {
|
|
1988
1992
|
w("tsconfig.json", k("workflow/tsconfig.json")), E("vitest.config.mts", k("workflow/vitest.config.mts"));
|
|
1989
1993
|
}, () => {
|
|
1990
1994
|
O("tsconfig.json"), O("vitest.config.mts");
|
|
1991
|
-
})), O("index.js"), O("index.d.ts"), D("src/main.tpl.tengo", A("workflow/src/main.tpl.tengo", (e) => ({ shortName: e.blockVars.shortName }))), T("package.json", j((e) =>
|
|
1992
|
-
|
|
1995
|
+
})), O("index.js"), O("index.d.ts"), D("src/main.tpl.tengo", A("workflow/src/main.tpl.tengo", (e) => ({ shortName: e.blockVars.shortName }))), T("package.json", j((e) => bi(e)), () => {
|
|
1996
|
+
xi();
|
|
1993
1997
|
});
|
|
1994
1998
|
});
|
|
1995
1999
|
}
|
|
1996
2000
|
// src/structure/rules/test-package-json.ts
|
|
1997
|
-
function
|
|
2001
|
+
function Ci(e) {
|
|
1998
2002
|
return {
|
|
1999
2003
|
name: `${e.blockVars.facadeName}.test`,
|
|
2000
|
-
version:
|
|
2004
|
+
version: Z,
|
|
2001
2005
|
private: !0,
|
|
2002
2006
|
type: "module",
|
|
2003
2007
|
scripts: {
|
|
@@ -2014,25 +2018,25 @@ function xi(e) {
|
|
|
2014
2018
|
}
|
|
2015
2019
|
};
|
|
2016
2020
|
}
|
|
2017
|
-
function
|
|
2018
|
-
|
|
2021
|
+
function wi() {
|
|
2022
|
+
Q(), L("private", !0), L("type", "module"), z("fmt", "ts-builder format"), z("check", "ts-builder check --target block-test"), z("test", "vitest run --passWithNoTests"), B("lint"), U({
|
|
2019
2023
|
"@platforma-sdk/test": "sdk:",
|
|
2020
2024
|
"@milaboratories/ts-builder": "sdk:",
|
|
2021
2025
|
"@milaboratories/ts-configs": "sdk:",
|
|
2022
2026
|
vitest: "catalog:"
|
|
2023
|
-
}),
|
|
2027
|
+
}), W({ typescript: "*" }), H("@types/node"), Cr(), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
2024
2028
|
}
|
|
2025
2029
|
// src/structure/rules/test.ts
|
|
2026
|
-
function
|
|
2030
|
+
function Ti() {
|
|
2027
2031
|
x("test", () => {
|
|
2028
|
-
w("tsconfig.json", k("test/tsconfig.json")), w(".oxlintrc.json", k("test/.oxlintrc.json")), w(".oxfmtrc.json", k("test/.oxfmtrc.json")), E("vitest.config.mts", k("test/vitest.config.mts")), D("src/demo.test.ts", ct("import { expect, test } from \"vitest\";\n\ntest(\"scaffolded block sanity check\", () => {\n expect(true).toBe(true);\n});\n")), T("package.json", j((e) =>
|
|
2029
|
-
|
|
2032
|
+
w("tsconfig.json", k("test/tsconfig.json")), w(".oxlintrc.json", k("test/.oxlintrc.json")), w(".oxfmtrc.json", k("test/.oxfmtrc.json")), E("vitest.config.mts", k("test/vitest.config.mts")), D("src/demo.test.ts", ct("import { expect, test } from \"vitest\";\n\ntest(\"scaffolded block sanity check\", () => {\n expect(true).toBe(true);\n});\n")), T("package.json", j((e) => Ci(e)), () => {
|
|
2033
|
+
wi();
|
|
2030
2034
|
});
|
|
2031
2035
|
});
|
|
2032
2036
|
}
|
|
2033
2037
|
// src/structure/rules/software-package-json.ts
|
|
2034
|
-
var
|
|
2035
|
-
function
|
|
2038
|
+
var Ei = "block-tools software build", Di = "shx rm -f *.tgz && block-tools software build && pnpm pack && shx mv platforma-open*.tgz package.tgz";
|
|
2039
|
+
function Oi() {
|
|
2036
2040
|
return { entrypoints: { main: { binary: {
|
|
2037
2041
|
artifact: {
|
|
2038
2042
|
type: "python",
|
|
@@ -2047,39 +2051,39 @@ function Ei() {
|
|
|
2047
2051
|
cmd: ["python", "{pkg}/main.py"]
|
|
2048
2052
|
} } } };
|
|
2049
2053
|
}
|
|
2050
|
-
function
|
|
2054
|
+
function ki(e) {
|
|
2051
2055
|
return {
|
|
2052
2056
|
name: `${e.blockVars.facadeName}.software`,
|
|
2053
|
-
version:
|
|
2057
|
+
version: Z,
|
|
2054
2058
|
type: "module",
|
|
2055
2059
|
description: "Block Software",
|
|
2056
2060
|
files: ["./dist/**/*"],
|
|
2057
2061
|
scripts: {
|
|
2058
|
-
build:
|
|
2059
|
-
"do-pack":
|
|
2062
|
+
build: Ei,
|
|
2063
|
+
"do-pack": Di,
|
|
2060
2064
|
changeset: "changeset",
|
|
2061
2065
|
"version-packages": "changeset version"
|
|
2062
2066
|
},
|
|
2063
|
-
"block-software":
|
|
2067
|
+
"block-software": Oi(),
|
|
2064
2068
|
devDependencies: {
|
|
2065
2069
|
"@platforma-open/milaboratories.runenv-python-3": "catalog:",
|
|
2066
2070
|
"@platforma-sdk/block-tools": "sdk:"
|
|
2067
2071
|
}
|
|
2068
2072
|
};
|
|
2069
2073
|
}
|
|
2070
|
-
function
|
|
2071
|
-
R("private"),
|
|
2074
|
+
function Ai() {
|
|
2075
|
+
R("private"), Q(), L("type", "module"), L("files", ["./dist/**/*"]), z("build", Ei), z("do-pack", Di), B("prepublishOnly"), z("changeset", "changeset"), z("version-packages", "changeset version"), V("@platforma-open/milaboratories.runenv-python-3", "catalog:"), V("@platforma-sdk/block-tools", "sdk:"), H("@platforma-sdk/package-builder"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
2072
2076
|
}
|
|
2073
2077
|
// src/structure/rules/software.ts
|
|
2074
|
-
var
|
|
2075
|
-
function
|
|
2078
|
+
var ji = "import sys\n\nprint(\"Hello from Python, \" + sys.argv[1] + \"!\")\n", Mi = "# No dependencies specified for this script\n";
|
|
2079
|
+
function Ni() {
|
|
2076
2080
|
x("software", () => {
|
|
2077
|
-
D("src/main.py", ct(
|
|
2078
|
-
|
|
2081
|
+
D("src/main.py", ct(ji)), D("src/requirements.txt", ct(Mi)), T("package.json", j((e) => ki(e)), () => {
|
|
2082
|
+
Ai();
|
|
2079
2083
|
});
|
|
2080
2084
|
});
|
|
2081
2085
|
}
|
|
2082
|
-
function
|
|
2086
|
+
function Pi() {
|
|
2083
2087
|
x("model", () => {
|
|
2084
2088
|
O("eslint.config.mjs"), O("vite.config.mts");
|
|
2085
2089
|
}), x("ui", () => {
|
|
@@ -2087,47 +2091,49 @@ function Mi() {
|
|
|
2087
2091
|
}), x("test", () => {
|
|
2088
2092
|
O("eslint.config.mjs");
|
|
2089
2093
|
}), x("root", () => {
|
|
2090
|
-
O(".prettierrc"), T("package.json", j(() =>
|
|
2094
|
+
O(".prettierrc"), T("package.json", j(() => tr()), () => {
|
|
2091
2095
|
B("pretty"), H("@platforma-sdk/blocks-deps-updater");
|
|
2092
2096
|
});
|
|
2093
2097
|
});
|
|
2094
2098
|
}
|
|
2095
2099
|
// src/structure/rules/root-catalog-bump.ts
|
|
2096
|
-
function
|
|
2100
|
+
function Fi() {
|
|
2097
2101
|
ot(() => {
|
|
2098
2102
|
x("root", () => {
|
|
2099
2103
|
S(({ ctx: e }) => !e.isSdkInternal, () => {
|
|
2100
|
-
T("
|
|
2101
|
-
|
|
2102
|
-
|
|
2104
|
+
T("package.json", j(() => tr()), () => {
|
|
2105
|
+
nr(), G([...X]);
|
|
2106
|
+
}), T("pnpm-workspace.yaml", j((e) => Ar(e)), (e) => {
|
|
2107
|
+
for (let e of wr) en(e);
|
|
2108
|
+
for (let e of Dr) tn(e.entry, {
|
|
2103
2109
|
of: e.of,
|
|
2104
2110
|
ofVersion: e.ofVersion
|
|
2105
2111
|
});
|
|
2106
|
-
e.modules.some((e) => e.scope === "software") &&
|
|
2112
|
+
e.modules.some((e) => e.scope === "software") && $t(Or, kr), jr();
|
|
2107
2113
|
});
|
|
2108
2114
|
});
|
|
2109
2115
|
});
|
|
2110
2116
|
});
|
|
2111
2117
|
}
|
|
2112
2118
|
// src/structure/structure-definition.ts
|
|
2113
|
-
var
|
|
2114
|
-
|
|
2119
|
+
var Ii = $e(() => {
|
|
2120
|
+
qr(), Yr(), ci(), fi(), gi(), yi(), Si(), Ti(), Ni(), Pi(), Fi();
|
|
2115
2121
|
});
|
|
2116
2122
|
// src/structure/cli/run-structure.ts
|
|
2117
|
-
async function
|
|
2118
|
-
return yr(
|
|
2123
|
+
async function Li() {
|
|
2124
|
+
return yr(wr.filter(vr));
|
|
2119
2125
|
}
|
|
2120
|
-
async function
|
|
2121
|
-
let t = h.resolve(e.blockPath), n = e.mode === "check", r = new Ie(t), i = new Le(e.templatesRoot), a =
|
|
2126
|
+
async function Ri(e) {
|
|
2127
|
+
let t = h.resolve(e.blockPath), n = e.mode === "check", r = new Ie(t), i = new Le(e.templatesRoot), a = On(Ii, r, Gn({
|
|
2122
2128
|
fs: r,
|
|
2123
2129
|
isSdkInternal: e.isSdkInternal,
|
|
2124
2130
|
updateDepsOnly: e.updateDepsOnly,
|
|
2125
2131
|
dryRun: n
|
|
2126
2132
|
}), {
|
|
2127
2133
|
templates: i,
|
|
2128
|
-
registryLookup: e.updateDepsOnly ? await
|
|
2129
|
-
derivedPinLookup: e.updateDepsOnly ? await xr(
|
|
2130
|
-
rediscover: () =>
|
|
2134
|
+
registryLookup: e.updateDepsOnly ? await Li() : void 0,
|
|
2135
|
+
derivedPinLookup: e.updateDepsOnly ? await xr(Dr) : void 0,
|
|
2136
|
+
rediscover: () => Gn({
|
|
2131
2137
|
fs: r,
|
|
2132
2138
|
isSdkInternal: e.isSdkInternal,
|
|
2133
2139
|
updateDepsOnly: !1,
|
|
@@ -2139,19 +2145,19 @@ async function Ii(e) {
|
|
|
2139
2145
|
changes: a.changes
|
|
2140
2146
|
};
|
|
2141
2147
|
}
|
|
2142
|
-
function
|
|
2148
|
+
function zi(e) {
|
|
2143
2149
|
let t = e.flatMap((e) => /[*?[]/.test(e) ? ie(e).filter((e) => ae(e, { throwIfNoEntry: !1 })?.isDirectory() === !0).map((e) => e.split(h.sep).join("/")).sort() : [e]);
|
|
2144
2150
|
return [...new Set(t)];
|
|
2145
2151
|
}
|
|
2146
|
-
function
|
|
2152
|
+
function Bi(e, t) {
|
|
2147
2153
|
if (t.length === 0) return ` ${e}: up to date (0 changes)`;
|
|
2148
2154
|
let n = t.map((e) => ` ${e.action.padEnd(6)} ${e.primitive.padEnd(8)} ${e.path} [${e.scope}]`);
|
|
2149
2155
|
return ` ${e}: ${t.length} change(s)\n${n.join("\n")}`;
|
|
2150
2156
|
}
|
|
2151
2157
|
// src/cmd/structure/refresh.ts
|
|
2152
|
-
async function
|
|
2158
|
+
async function Vi(e) {
|
|
2153
2159
|
for (let t of e.paths) {
|
|
2154
|
-
let n = await
|
|
2160
|
+
let n = await Ri({
|
|
2155
2161
|
blockPath: t,
|
|
2156
2162
|
isSdkInternal: e.isSdkInternal,
|
|
2157
2163
|
updateDepsOnly: e.updateDepsOnly,
|
|
@@ -2159,14 +2165,14 @@ async function zi(e) {
|
|
|
2159
2165
|
templatesRoot: e.templatesRoot,
|
|
2160
2166
|
log: (t) => e.logger.info(t)
|
|
2161
2167
|
});
|
|
2162
|
-
e.logger.info(
|
|
2168
|
+
e.logger.info(Bi(t, n.changes));
|
|
2163
2169
|
}
|
|
2164
2170
|
}
|
|
2165
|
-
function
|
|
2166
|
-
let t = new p("refresh").description("Bring block(s) up to date with the canonical structure. Applies rules, writes files, bumps .structure version. Default mode is offline; --update-deps-only
|
|
2167
|
-
return t.argument("[paths...]", "block path(s); defaults to the current directory"), t.option("--sdk-internal", "block(s) live inside the SDK monorepo; skip root-scope rules"), t.option("--update-deps-only", "
|
|
2168
|
-
let r = t.length > 0 ?
|
|
2169
|
-
await
|
|
2171
|
+
function Hi(e) {
|
|
2172
|
+
let t = new p("refresh").description("Bring block(s) up to date with the canonical structure. Applies rules, writes files, bumps .structure version. Default mode is offline; --update-deps-only updates the catalog versions and the pnpm and Node toolchain (network).");
|
|
2173
|
+
return t.argument("[paths...]", "block path(s); defaults to the current directory"), t.option("--sdk-internal", "block(s) live inside the SDK monorepo; skip root-scope rules"), t.option("--update-deps-only", "update ONLY the catalog versions and the pnpm and Node toolchain (npm network). Follow with `pnpm install` then a plain refresh."), t.action(async (t, n) => {
|
|
2174
|
+
let r = t.length > 0 ? zi(t) : ["."], i = h.join(e, "src", "structure", "templates");
|
|
2175
|
+
await Vi({
|
|
2170
2176
|
paths: r,
|
|
2171
2177
|
isSdkInternal: !!n.sdkInternal,
|
|
2172
2178
|
updateDepsOnly: !!n.updateDepsOnly,
|
|
@@ -2176,11 +2182,11 @@ function Bi(e) {
|
|
|
2176
2182
|
}), t;
|
|
2177
2183
|
}
|
|
2178
2184
|
// src/cmd/update-deps.ts
|
|
2179
|
-
function
|
|
2185
|
+
function Ui(e) {
|
|
2180
2186
|
let t = new p("update-deps").description("[DEPRECATED] Use `block-tools structure refresh --update-deps-only`. This alias delegates to it.");
|
|
2181
2187
|
return t.action(async () => {
|
|
2182
2188
|
let t = new y();
|
|
2183
|
-
t.warn("`block-tools update-deps` is deprecated and will be removed in a future release. Use `block-tools structure refresh --update-deps-only` instead. Delegating now."), await
|
|
2189
|
+
t.warn("`block-tools update-deps` is deprecated and will be removed in a future release. Use `block-tools structure refresh --update-deps-only` instead. Delegating now."), await Vi({
|
|
2184
2190
|
paths: ["."],
|
|
2185
2191
|
isSdkInternal: !1,
|
|
2186
2192
|
updateDepsOnly: !0,
|
|
@@ -2190,10 +2196,10 @@ function Vi(e) {
|
|
|
2190
2196
|
}), t;
|
|
2191
2197
|
}
|
|
2192
2198
|
// src/cmd/list-overview-snapshots.ts
|
|
2193
|
-
function
|
|
2199
|
+
function Wi() {
|
|
2194
2200
|
let e = new p("list-overview-snapshots").description("List all available global overview snapshots in the registry");
|
|
2195
2201
|
return e.addOption(new m("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.option("--json", "output in JSON format", !1), e.action(async (e) => {
|
|
2196
|
-
let t = new y(), n =
|
|
2202
|
+
let t = new y(), n = te(e.registry), r = await new s(n, t).listGlobalOverviewSnapshots();
|
|
2197
2203
|
if (e.json) t.info(JSON.stringify(r, null, 2));
|
|
2198
2204
|
else if (r.length === 0) t.info("No snapshots found.");
|
|
2199
2205
|
else {
|
|
@@ -2203,10 +2209,10 @@ function Hi() {
|
|
|
2203
2209
|
}), e;
|
|
2204
2210
|
}
|
|
2205
2211
|
// src/cmd/restore-overview-from-snapshot.ts
|
|
2206
|
-
function
|
|
2212
|
+
function Gi() {
|
|
2207
2213
|
let e = new p("restore-overview-from-snapshot").description("Restore global overview from a snapshot");
|
|
2208
2214
|
return e.addOption(new m("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.requiredOption("-s, --snapshot <timestamp>", "snapshot timestamp ID to restore from"), e.option("--skip-confirmation", "skip confirmation prompt (use with caution)", !1), e.action(async (e) => {
|
|
2209
|
-
let t = new y(), n =
|
|
2215
|
+
let t = new y(), n = te(e.registry), r = new s(n, t), i = await r.listGlobalOverviewSnapshots();
|
|
2210
2216
|
if (!i.find((t) => t.timestamp === e.snapshot)) throw Error(`Snapshot '${e.snapshot}' not found. Available snapshots:\n${i.map((e) => ` - ${e.timestamp}`).join("\n") || " (none)"}`);
|
|
2211
2217
|
if (!e.skipConfirmation) {
|
|
2212
2218
|
let n = (await import("node:readline")).createInterface({
|
|
@@ -2228,7 +2234,7 @@ function Ui() {
|
|
|
2228
2234
|
}), e;
|
|
2229
2235
|
}
|
|
2230
2236
|
// src/registry_v1/flags.ts
|
|
2231
|
-
function
|
|
2237
|
+
function Ki(e) {
|
|
2232
2238
|
let t = e.match(/(?<destName>[^/\\]+)=(?<src>.*)/);
|
|
2233
2239
|
if (t) {
|
|
2234
2240
|
let { src: e, destName: n } = t.groups;
|
|
@@ -2242,24 +2248,24 @@ function Wi(e) {
|
|
|
2242
2248
|
destName: h.basename(e)
|
|
2243
2249
|
};
|
|
2244
2250
|
}
|
|
2245
|
-
function
|
|
2246
|
-
return new m(e, t).argParser((e, t) => [...t ?? [],
|
|
2251
|
+
function qi(e, t) {
|
|
2252
|
+
return new m(e, t).argParser((e, t) => [...t ?? [], Ki(e)]).default([]);
|
|
2247
2253
|
}
|
|
2248
2254
|
// src/cmd/upload-package-v1.ts
|
|
2249
|
-
var
|
|
2255
|
+
var Ji = [
|
|
2250
2256
|
"registry",
|
|
2251
2257
|
"organization",
|
|
2252
2258
|
"package",
|
|
2253
2259
|
"version"
|
|
2254
2260
|
];
|
|
2255
|
-
function
|
|
2261
|
+
function Yi() {
|
|
2256
2262
|
let e = new p("upload-package-v1").description("Uploads V1 package and refreshes the registry");
|
|
2257
|
-
return e.addOption(new m("-r, --registry <address|alias>", "full address of the registry or alias from .pl.reg").env("PL_REGISTRY")), e.addOption(new m("-o, --organization <organization>", "target organisation").env("PL_PACKAGE_ORGANIZATION")), e.addOption(new m("-p, --package <package>", "target package").env("PL_PACKAGE_NAME")), e.addOption(new m("-v, --version <version>", "target version").env("PL_PACKAGE_VERSION")), e.option("-m, --meta <path>", "json file containing meta information to associate with tha package"), e.addOption(
|
|
2258
|
-
let t = new y(), n =
|
|
2259
|
-
for (let t of
|
|
2263
|
+
return e.addOption(new m("-r, --registry <address|alias>", "full address of the registry or alias from .pl.reg").env("PL_REGISTRY")), e.addOption(new m("-o, --organization <organization>", "target organisation").env("PL_PACKAGE_ORGANIZATION")), e.addOption(new m("-p, --package <package>", "target package").env("PL_PACKAGE_NAME")), e.addOption(new m("-v, --version <version>", "target version").env("PL_PACKAGE_VERSION")), e.option("-m, --meta <path>", "json file containing meta information to associate with tha package"), e.addOption(qi("-f, --file <file>", "package files")), e.addOption(new m("--refresh", "refresh repository after adding the package").default(!0).env("PL_REGISTRY_REFRESH")), e.option("--no-refresh", "do not refresh repository after adding the package"), e.action(async (e) => {
|
|
2264
|
+
let t = new y(), n = ee.parse({});
|
|
2265
|
+
for (let t of Ji) e[t] && (n[t] = e[t]);
|
|
2260
2266
|
e.meta && (e.meta.endsWith(".json") ? n.meta = JSON.parse(await g.promises.readFile(e.meta, { encoding: "utf-8" })) : e.meta.endsWith(".yaml") && (n.meta = pe.parse(await g.promises.readFile(e.meta, { encoding: "utf-8" }))));
|
|
2261
2267
|
for (let t of e.file) n.files[t.destName] = t.src;
|
|
2262
|
-
let r = await
|
|
2268
|
+
let r = await f(n);
|
|
2263
2269
|
t.info(pe.stringify(r.conf));
|
|
2264
2270
|
let i = r.createRegistry(t), a = r.fullPackageName, o = i.constructNewPackage(a);
|
|
2265
2271
|
for (let [e, n] of Object.entries(r.conf.files)) {
|
|
@@ -2271,12 +2277,12 @@ function qi() {
|
|
|
2271
2277
|
}), e;
|
|
2272
2278
|
}
|
|
2273
2279
|
// src/cmd/structure/check.ts
|
|
2274
|
-
function
|
|
2280
|
+
function Xi(e) {
|
|
2275
2281
|
let t = new p("check").description("Check block(s) against the canonical structure (read-only). Exits non-zero if any diff would land — used as the CI gate.");
|
|
2276
2282
|
return t.argument("[paths...]", "block path(s); defaults to the current directory"), t.option("--sdk-internal", "block(s) live inside the SDK monorepo; skip root-scope rules"), t.action(async (t, n) => {
|
|
2277
|
-
let r = new y(), i = t.length > 0 ?
|
|
2283
|
+
let r = new y(), i = t.length > 0 ? zi(t) : ["."], a = h.join(e, "src", "structure", "templates"), o = !1;
|
|
2278
2284
|
for (let e of i) {
|
|
2279
|
-
let t = await
|
|
2285
|
+
let t = await Ri({
|
|
2280
2286
|
blockPath: e,
|
|
2281
2287
|
isSdkInternal: !!n.sdkInternal,
|
|
2282
2288
|
updateDepsOnly: !1,
|
|
@@ -2284,40 +2290,40 @@ function Ji(e) {
|
|
|
2284
2290
|
templatesRoot: a,
|
|
2285
2291
|
log: (e) => r.info(e)
|
|
2286
2292
|
});
|
|
2287
|
-
r.info(
|
|
2293
|
+
r.info(Bi(e, t.changes)), t.changes.length > 0 && (o = !0);
|
|
2288
2294
|
}
|
|
2289
2295
|
if (o) throw Error("Structure check failed: one or more blocks are out of date. Run `structure refresh`.");
|
|
2290
2296
|
}), t;
|
|
2291
2297
|
}
|
|
2292
2298
|
// src/structure/init-block-constructor.ts
|
|
2293
|
-
var
|
|
2299
|
+
var Zi = ["python"], Qi = class extends Error {
|
|
2294
2300
|
constructor(e) {
|
|
2295
2301
|
super(`Missing required flag --${e} in --non-interactive mode. Supply every BlockVars flag, or drop --non-interactive to be prompted.`), this.name = "InitFlagError";
|
|
2296
2302
|
}
|
|
2297
2303
|
};
|
|
2298
|
-
async function
|
|
2304
|
+
async function $i(e, t, n, r) {
|
|
2299
2305
|
if (e !== void 0 && e !== "") return e;
|
|
2300
|
-
if (n) throw new
|
|
2306
|
+
if (n) throw new Qi(t);
|
|
2301
2307
|
return r();
|
|
2302
2308
|
}
|
|
2303
|
-
async function
|
|
2304
|
-
let t = await
|
|
2309
|
+
async function ea(e) {
|
|
2310
|
+
let t = await $i(e.npmOrg, "npm-org", e.nonInteractive, () => Se({
|
|
2305
2311
|
message: "npm org (e.g. @platforma-open):",
|
|
2306
2312
|
default: "@platforma-open"
|
|
2307
|
-
})), n = await
|
|
2313
|
+
})), n = await $i(e.orgScope, "org-scope", e.nonInteractive, () => Se({ message: "org scope (e.g. my-org):" })), r = await $i(e.shortName, "short-name", e.nonInteractive, () => Se({ message: "block short name (e.g. mixcr-clonotyping):" })), i;
|
|
2308
2314
|
i = e.withSoftware === void 0 ? !e.nonInteractive && await xe({
|
|
2309
2315
|
message: "Include a software module?",
|
|
2310
2316
|
default: !1
|
|
2311
2317
|
}) : e.withSoftware;
|
|
2312
2318
|
let a;
|
|
2313
2319
|
if (i) {
|
|
2314
|
-
if (a = await
|
|
2320
|
+
if (a = await $i(e.platform, "platform", e.nonInteractive, () => Ce({
|
|
2315
2321
|
message: "Software platform:",
|
|
2316
|
-
choices:
|
|
2322
|
+
choices: Zi.map((e) => ({
|
|
2317
2323
|
name: e,
|
|
2318
2324
|
value: e
|
|
2319
2325
|
}))
|
|
2320
|
-
})), !
|
|
2326
|
+
})), !Zi.includes(a)) throw Error(`Unsupported --platform '${a}'. Only ${Zi.join(", ")} ${Zi.length === 1 ? "is" : "are"} supported at v1.`);
|
|
2321
2327
|
} else if (e.platform) throw Error("--platform was given but software is disabled (--no-software).");
|
|
2322
2328
|
return {
|
|
2323
2329
|
facadeName: `${t}/${n}.${r}`,
|
|
@@ -2328,20 +2334,20 @@ async function Qi(e) {
|
|
|
2328
2334
|
softwarePlatform: a
|
|
2329
2335
|
};
|
|
2330
2336
|
}
|
|
2331
|
-
async function
|
|
2332
|
-
let t = e.vars, n =
|
|
2337
|
+
async function ta(e) {
|
|
2338
|
+
let t = e.vars, n = Ln(t), r = new Ie(e.blockPath), i = new Le(e.templatesRoot), a = Rn({
|
|
2333
2339
|
blockVars: t,
|
|
2334
2340
|
modules: n,
|
|
2335
2341
|
isSdkInternal: !1,
|
|
2336
2342
|
version: 3,
|
|
2337
2343
|
dryRun: !1
|
|
2338
|
-
}), o =
|
|
2344
|
+
}), o = wr.filter(vr), s, c;
|
|
2339
2345
|
try {
|
|
2340
|
-
s = await yr(o), c = await xr(
|
|
2346
|
+
s = await yr(o), c = await xr(Dr);
|
|
2341
2347
|
} catch (e) {
|
|
2342
2348
|
throw Error(`init requires network access to resolve SDK catalog versions from npm, but the registry lookup failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
2343
2349
|
}
|
|
2344
|
-
return
|
|
2350
|
+
return On(Ii, r, a, {
|
|
2345
2351
|
templates: i,
|
|
2346
2352
|
initMode: !0,
|
|
2347
2353
|
registryLookup: s,
|
|
@@ -2349,12 +2355,12 @@ async function $i(e) {
|
|
|
2349
2355
|
}), e.log(`Initialised block '${t.facadeName}'${t.softwarePlatform ? ` (software: ${t.softwarePlatform})` : " (no software)"} at ${e.blockPath}`), t;
|
|
2350
2356
|
}
|
|
2351
2357
|
// src/cmd/structure/init.ts
|
|
2352
|
-
function
|
|
2358
|
+
function na(e) {
|
|
2353
2359
|
let t = new p("init").description("Scaffold a fresh Platforma block from the canonical structure. Missing flags are prompted unless --non-interactive.");
|
|
2354
|
-
return t.argument("[path]", "target directory (default: <short-name> under the current directory)"), t.option("--npm-org <org>", "npm org, e.g. @platforma-open"), t.option("--org-scope <scope>", "org scope, e.g. my-org"), t.option("--short-name <name>", "block short name, e.g. mixcr-clonotyping"), t.option("--with-software", "include a software module"), t.option("--no-software", "omit the software module"), t.addOption(new m("--platform <platform>", "software platform (single-valued)").choices([...
|
|
2360
|
+
return t.argument("[path]", "target directory (default: <short-name> under the current directory)"), t.option("--npm-org <org>", "npm org, e.g. @platforma-open"), t.option("--org-scope <scope>", "org scope, e.g. my-org"), t.option("--short-name <name>", "block short name, e.g. mixcr-clonotyping"), t.option("--with-software", "include a software module"), t.option("--no-software", "omit the software module"), t.addOption(new m("--platform <platform>", "software platform (single-valued)").choices([...Zi])), t.option("--non-interactive", "error on any missing flag instead of prompting"), t.action(async (t, n) => {
|
|
2355
2361
|
let r = new y(), i = n.withSoftware === !0, a = n.software === !1;
|
|
2356
2362
|
if (i && a) throw Error("--with-software and --no-software are mutually exclusive.");
|
|
2357
|
-
let o = i ? !0 : !a && void 0, s = await
|
|
2363
|
+
let o = i ? !0 : !a && void 0, s = await ea({
|
|
2358
2364
|
npmOrg: n.npmOrg,
|
|
2359
2365
|
orgScope: n.orgScope,
|
|
2360
2366
|
shortName: n.shortName,
|
|
@@ -2362,7 +2368,7 @@ function ea(e) {
|
|
|
2362
2368
|
platform: n.platform,
|
|
2363
2369
|
nonInteractive: n.nonInteractive
|
|
2364
2370
|
});
|
|
2365
|
-
await
|
|
2371
|
+
await ta({
|
|
2366
2372
|
vars: s,
|
|
2367
2373
|
blockPath: t ? h.resolve(t) : h.resolve(process.cwd(), s.shortName),
|
|
2368
2374
|
templatesRoot: h.join(e, "src", "structure", "templates"),
|
|
@@ -2371,13 +2377,13 @@ function ea(e) {
|
|
|
2371
2377
|
}), t;
|
|
2372
2378
|
}
|
|
2373
2379
|
// src/cmd/software/knobs.ts
|
|
2374
|
-
var
|
|
2380
|
+
var ra = ["dev", "release"], ia = [
|
|
2375
2381
|
"docker",
|
|
2376
2382
|
"binary",
|
|
2377
2383
|
"all",
|
|
2378
2384
|
"none"
|
|
2379
|
-
],
|
|
2380
|
-
function
|
|
2385
|
+
], aa = ["local", "remote"];
|
|
2386
|
+
function oa(e) {
|
|
2381
2387
|
if (e.usePublished) {
|
|
2382
2388
|
if (e.variant === "docker" || e.variant === "all") throw v.CLIError(`--use-published is binary-only and cannot be combined with --variant ${e.variant}`);
|
|
2383
2389
|
return { kind: "binary-existing" };
|
|
@@ -2390,31 +2396,31 @@ function ia(e) {
|
|
|
2390
2396
|
};
|
|
2391
2397
|
}
|
|
2392
2398
|
// src/cmd/software/ecr-login.ts
|
|
2393
|
-
var
|
|
2394
|
-
function
|
|
2399
|
+
var sa = "public.ecr.aws", ca = "us-east-1";
|
|
2400
|
+
function la(e) {
|
|
2395
2401
|
if (process.env.AWS_ACCESS_KEY_ID || process.env.AWS_PROFILE) return;
|
|
2396
2402
|
let t = process.env.PL_AWS_PROFILE ?? fe.AWS_DEV_PROFILE;
|
|
2397
2403
|
process.env.AWS_PROFILE = t, e?.debug(`Using AWS profile '${t}' for dev push credentials`);
|
|
2398
2404
|
}
|
|
2399
|
-
function
|
|
2405
|
+
function ua(e) {
|
|
2400
2406
|
return new URL(`https://${e}`).hostname;
|
|
2401
2407
|
}
|
|
2402
|
-
function
|
|
2408
|
+
function da() {
|
|
2403
2409
|
return ` aws sso login --profile ${process.env.AWS_PROFILE ?? process.env.PL_AWS_PROFILE ?? fe.AWS_DEV_PROFILE}`;
|
|
2404
2410
|
}
|
|
2405
|
-
async function
|
|
2406
|
-
let n =
|
|
2407
|
-
if (n !==
|
|
2411
|
+
async function fa(e, t) {
|
|
2412
|
+
let n = ua(e);
|
|
2413
|
+
if (n !== sa) throw v.CLIError(`automatic docker login is only supported for '${sa}', not '${n}'.\nLog in manually, or drop the ecr:// scheme from the push target to opt out.`);
|
|
2408
2414
|
t?.info(`Logging in to ECR registry '${n}'...`);
|
|
2409
2415
|
let r, i;
|
|
2410
2416
|
try {
|
|
2411
|
-
let e = (await new Te({ region:
|
|
2417
|
+
let e = (await new Te({ region: ca }).send(new Ee({}))).authorizationData?.authorizationToken;
|
|
2412
2418
|
if (!e) throw Error("empty authorization token");
|
|
2413
2419
|
let t = Buffer.from(e, "base64").toString("utf8"), n = t.indexOf(":");
|
|
2414
2420
|
if (n < 0) throw Error("malformed authorization token (no ':' separator)");
|
|
2415
2421
|
r = t.slice(0, n), i = t.slice(n + 1);
|
|
2416
2422
|
} catch (e) {
|
|
2417
|
-
throw v.CLIError(`failed to obtain an ECR login token for '${n}': ${e instanceof Error ? e.message : String(e)}\nYour AWS/SSO session is likely expired or absent — log in and retry:\n` +
|
|
2423
|
+
throw v.CLIError(`failed to obtain an ECR login token for '${n}': ${e instanceof Error ? e.message : String(e)}\nYour AWS/SSO session is likely expired or absent — log in and retry:\n` + da());
|
|
2418
2424
|
}
|
|
2419
2425
|
let a = we("docker", [
|
|
2420
2426
|
"login",
|
|
@@ -2437,9 +2443,9 @@ async function ua(e, t) {
|
|
|
2437
2443
|
if (a.error || a.status !== 0) throw v.CLIError(`'docker login ${n}' failed`);
|
|
2438
2444
|
}
|
|
2439
2445
|
// src/cmd/software/run-build.ts
|
|
2440
|
-
async function
|
|
2446
|
+
async function pa(e) {
|
|
2441
2447
|
let { core: t, scenario: n, options: r = {}, logger: i } = e, a = r.ids;
|
|
2442
|
-
t.buildMode =
|
|
2448
|
+
t.buildMode = ha(n), ma(n) || t.assertDockerCoverage();
|
|
2443
2449
|
let o = () => t.buildSoftwareArchives({
|
|
2444
2450
|
ids: a,
|
|
2445
2451
|
forceBuild: !!r.force,
|
|
@@ -2464,12 +2470,12 @@ async function da(e) {
|
|
|
2464
2470
|
});
|
|
2465
2471
|
break;
|
|
2466
2472
|
case "target": {
|
|
2467
|
-
let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f =
|
|
2473
|
+
let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f = va(e, r);
|
|
2468
2474
|
l && t.buildDockerImages({
|
|
2469
2475
|
ids: a,
|
|
2470
2476
|
registry: f.pull,
|
|
2471
2477
|
strictPlatformMatching: _.isCI()
|
|
2472
|
-
}), u && await o(), d && e === "dev" && (l || u) &&
|
|
2478
|
+
}), u && await o(), d && e === "dev" && (l || u) && la(i), l && d && (f.autoLogin && f.push && await fa(f.push, i), t.publishDockerImages({
|
|
2473
2479
|
ids: a,
|
|
2474
2480
|
pushTo: f.push,
|
|
2475
2481
|
strictPlatformMatching: _.isCI()
|
|
@@ -2484,44 +2490,44 @@ async function da(e) {
|
|
|
2484
2490
|
t.buildSwJsonFiles({
|
|
2485
2491
|
packageIds: a,
|
|
2486
2492
|
noSoftware: n.kind === "no-software",
|
|
2487
|
-
skipDockerCoverage:
|
|
2493
|
+
skipDockerCoverage: ma(n)
|
|
2488
2494
|
});
|
|
2489
2495
|
}
|
|
2490
|
-
function
|
|
2496
|
+
function ma(e) {
|
|
2491
2497
|
return e.kind === "no-software" || e.kind === "binary-existing";
|
|
2492
2498
|
}
|
|
2493
|
-
function
|
|
2499
|
+
function ha(e) {
|
|
2494
2500
|
return e.kind !== "target" || e.channel === "release" ? "release" : e.variant !== "docker" && e.location === "remote" ? "dev-remote" : "dev-local";
|
|
2495
2501
|
}
|
|
2496
|
-
function
|
|
2502
|
+
function ga(e) {
|
|
2497
2503
|
if (!e.includes("://")) return e;
|
|
2498
2504
|
let t = new URL(e);
|
|
2499
2505
|
return t.host + t.pathname;
|
|
2500
2506
|
}
|
|
2501
|
-
function
|
|
2507
|
+
function _a(e) {
|
|
2502
2508
|
return {
|
|
2503
|
-
registry:
|
|
2509
|
+
registry: ga(e),
|
|
2504
2510
|
autoLogin: e.startsWith("ecr://")
|
|
2505
2511
|
};
|
|
2506
2512
|
}
|
|
2507
|
-
function
|
|
2508
|
-
let n = e === "dev", r = process.env[n ? _.PL_DEV_DOCKER_PUSH_URL : _.PL_RELEASE_DOCKER_PUSH_URL], i = process.env[n ? _.PL_DEV_DOCKER_PULL_URL : _.PL_RELEASE_DOCKER_PULL_URL], a = t.dockerPushTo ?? r ?? (n ? fe.DEV_DOCKER_PUSH_TARGET : void 0), o = a ?
|
|
2513
|
+
function va(e, t) {
|
|
2514
|
+
let n = e === "dev", r = process.env[n ? _.PL_DEV_DOCKER_PUSH_URL : _.PL_RELEASE_DOCKER_PUSH_URL], i = process.env[n ? _.PL_DEV_DOCKER_PULL_URL : _.PL_RELEASE_DOCKER_PULL_URL], a = t.dockerPushTo ?? r ?? (n ? fe.DEV_DOCKER_PUSH_TARGET : void 0), o = a ? _a(a) : {
|
|
2509
2515
|
registry: void 0,
|
|
2510
2516
|
autoLogin: !1
|
|
2511
2517
|
}, s = t.dockerRegistry ?? i ?? (n ? a : fe.DOCKER_REGISTRY);
|
|
2512
2518
|
return {
|
|
2513
|
-
pull: s ?
|
|
2519
|
+
pull: s ? ga(s) : void 0,
|
|
2514
2520
|
push: o.registry,
|
|
2515
2521
|
autoLogin: o.autoLogin
|
|
2516
2522
|
};
|
|
2517
2523
|
}
|
|
2518
2524
|
// src/cmd/software/env.ts
|
|
2519
|
-
var
|
|
2525
|
+
var ya = "PL_BUILD_CHANNEL", ba = "PL_BUILD_VARIANT", xa = "PL_BUILD_LOCATION", Sa = "PL_BUILD_USE_PUBLISHED";
|
|
2520
2526
|
_.PL_DOCKER_REGISTRY_PUSH_TO, _.PL_DEV_DOCKER_PUSH_URL, _.PL_DEV_DOCKER_PULL_URL, _.PL_DEV_BINARY_UPLOAD_URL, _.PL_RELEASE_DOCKER_PUSH_URL, _.PL_RELEASE_DOCKER_PULL_URL, _.PL_RELEASE_BINARY_UPLOAD_URL;
|
|
2521
2527
|
// src/cmd/software/build.ts
|
|
2522
|
-
function
|
|
2528
|
+
function Ca() {
|
|
2523
2529
|
let e = new p("build").description("Build a software module for a target and write its .sw.json descriptor (build + push in one pass)");
|
|
2524
|
-
return e.addOption(new m("--channel <channel>", "registry channel to build for").choices([...
|
|
2530
|
+
return e.addOption(new m("--channel <channel>", "registry channel to build for").choices([...ra]).env(ya)), e.addOption(new m("--variant <variant>", "artifact kind to build (default: all declared)").choices([...ia]).env(ba)), e.addOption(new m("--location <location>", "where the artifact lands (local = no push)").choices([...aa]).env(xa)), e.addOption(new m("--use-published", "do not build or push; emit a descriptor pointing at the already-published release artifact").env(Sa)), e.addOption(new m("--log-level <level>", "logging level").choices([
|
|
2525
2531
|
"error",
|
|
2526
2532
|
"warn",
|
|
2527
2533
|
"info",
|
|
@@ -2529,7 +2535,7 @@ function xa() {
|
|
|
2529
2535
|
]).default("info")), e.addOption(new m("--package-root <path>", "path to directory with package.json file")), e.addOption(new m("--force", "force action, ignoring automatic safety checks").default(!1)), e.addOption(new m("--version <value>", "override package version (ignore package.json)")), e.addOption(new m("--platform <os-arch>", "{os}-{arch} pair; no effect on cross-platform packages").choices([...v.AllPlatforms]).env(_.PL_PKG_OS)), e.addOption(new m("--all-platforms", "build for all supported platforms").default(!1)), e.addOption(new m("--full-dir-hash", "hash file contents (not metadata) for the dev content hash").env(_.PL_PKG_FULL_HASH).default(!1)), e.addOption(new m("--package-id <id...>", "act only on selected packages")), e.addOption(new m("--content-root <path>", "override software content root").env(_.PL_PKG_CONTENT_ROOT)), e.addOption(new m("--storage-url <url>", "override binary upload registry URL").env(_.PL_PKG_STORAGE_URL)), e.addOption(new m("--docker-registry <registry>", "docker pull registry embedded in the descriptor").env(_.PL_DOCKER_REGISTRY)), e.addOption(new m("--docker-push-to <registry>", "alternative registry for docker push").env(_.PL_DOCKER_REGISTRY_PUSH_TO)), e.addOption(new m("--docker-build", "build docker images").env(_.PL_DOCKER_BUILD).default(!1)), e.addOption(new m("--docker-no-build", "do not build docker images").env(_.PL_DOCKER_NO_BUILD).default(!1)), e.addOption(new m("--docker-autopush", "push docker images after build").env(_.PL_DOCKER_AUTOPUSH).default(!1)), e.addOption(new m("--docker-no-autopush", "do not push docker images").env(_.PL_DOCKER_NO_AUTOPUSH).default(!1)), e.addOption(new m("--conda-build", "build conda environment before packing").env(_.PL_CONDA_BUILD).default(!1)), e.addOption(new m("--conda-no-build", "do not build conda environment").env(_.PL_CONDA_NO_BUILD).default(!1)), e.action(async (e) => {
|
|
2530
2536
|
let t = v.createLogger(e.logLevel);
|
|
2531
2537
|
try {
|
|
2532
|
-
let n =
|
|
2538
|
+
let n = oa({
|
|
2533
2539
|
channel: e.channel,
|
|
2534
2540
|
variant: e.variant,
|
|
2535
2541
|
location: e.location,
|
|
@@ -2550,7 +2556,7 @@ function xa() {
|
|
|
2550
2556
|
pushDocker: a,
|
|
2551
2557
|
pushDisabledExplicitly: !!e.dockerNoAutopush,
|
|
2552
2558
|
dockerPackageCount: r.selectedDockerPackages(e.packageId).length
|
|
2553
|
-
}), await
|
|
2559
|
+
}), await pa({
|
|
2554
2560
|
core: r,
|
|
2555
2561
|
scenario: n,
|
|
2556
2562
|
logger: t,
|
|
@@ -2576,20 +2582,20 @@ function xa() {
|
|
|
2576
2582
|
}), e;
|
|
2577
2583
|
}
|
|
2578
2584
|
// src/cmd/software/index.ts
|
|
2579
|
-
function
|
|
2585
|
+
function wa() {
|
|
2580
2586
|
let e = new p("software").description("Build and publish a block's software modules");
|
|
2581
|
-
return e.addCommand(
|
|
2587
|
+
return e.addCommand(Ca()), e;
|
|
2582
2588
|
}
|
|
2583
2589
|
// src/cli.ts
|
|
2584
|
-
function
|
|
2590
|
+
function Ta(e = process.cwd()) {
|
|
2585
2591
|
let t = new p();
|
|
2586
|
-
t.name("block-tools").description("Utility to manipulate Platforma Blocks and Block Registry"), t.addCommand(De()), t.addCommand(ke()), t.addCommand(Ae()), t.addCommand(je()), t.addCommand(Ne()), t.addCommand(Pe()), t.addCommand(Fe()), t.addCommand(
|
|
2592
|
+
t.name("block-tools").description("Utility to manipulate Platforma Blocks and Block Registry"), t.addCommand(De()), t.addCommand(ke()), t.addCommand(Ae()), t.addCommand(je()), t.addCommand(Ne()), t.addCommand(Pe()), t.addCommand(Fe()), t.addCommand(Ui(e)), t.addCommand(Wi()), t.addCommand(Gi()), t.addCommand(Yi()), t.addCommand(wa());
|
|
2587
2593
|
let n = new p("structure").description("Manage block scaffolding against the canonical structure (check / init / refresh)");
|
|
2588
|
-
return n.addCommand(
|
|
2594
|
+
return n.addCommand(Xi(e)), n.addCommand(na(e)), n.addCommand(Hi(e)), t.addCommand(n), t;
|
|
2589
2595
|
}
|
|
2590
|
-
async function
|
|
2591
|
-
await
|
|
2596
|
+
async function Ea(e, t) {
|
|
2597
|
+
await Ta(t).parseAsync(e);
|
|
2592
2598
|
}
|
|
2593
|
-
export {
|
|
2599
|
+
export { Ta as buildProgram, Ea as run };
|
|
2594
2600
|
|
|
2595
2601
|
//# sourceMappingURL=cli.mjs.map
|