@platforma-sdk/block-tools 2.12.12 → 2.13.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 +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +339 -334
- package/dist/cli.mjs.map +1 -1
- package/package.json +7 -7
- package/src/cmd/software/build.ts +17 -1
package/dist/cli.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import ie, { parse as ae, parseDocument as oe, stringify as se } from "yaml";
|
|
|
8
8
|
import { setTimeout as ce } from "node:timers/promises";
|
|
9
9
|
import * as le from "node:os";
|
|
10
10
|
import { confirm as ue, input as de, select as fe } from "@inquirer/prompts";
|
|
11
|
-
import {
|
|
11
|
+
import { assertDockerPushIntent as pe, createBuilder as me, defaults as v, envs as y, util as b } from "@platforma-sdk/package-builder-lib";
|
|
12
12
|
import { spawnSync as he } from "node:child_process";
|
|
13
13
|
import { ECRPUBLICClient as ge, GetAuthorizationTokenCommand as _e } from "@aws-sdk/client-ecr-public";
|
|
14
14
|
//#region src/cmd/build-meta.ts
|
|
@@ -262,12 +262,12 @@ function Le(e, t) {
|
|
|
262
262
|
}
|
|
263
263
|
//#endregion
|
|
264
264
|
//#region src/structure/engine/builders.ts
|
|
265
|
-
var
|
|
265
|
+
var x, Re;
|
|
266
266
|
function ze(e) {
|
|
267
|
-
if (!
|
|
268
|
-
return
|
|
267
|
+
if (!x) throw Error(`${e}() called outside defineStructure(). Builders must run inside the lambda passed to defineStructure(...).`);
|
|
268
|
+
return x;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function S(e, t) {
|
|
271
271
|
let n = ze(e);
|
|
272
272
|
n.stack[n.stack.length - 1].push(t);
|
|
273
273
|
}
|
|
@@ -284,19 +284,19 @@ function Ve() {
|
|
|
284
284
|
return Re;
|
|
285
285
|
}
|
|
286
286
|
function He(e) {
|
|
287
|
-
if (
|
|
287
|
+
if (x) throw Error("defineStructure() cannot be called from inside another defineStructure().");
|
|
288
288
|
let t = [], n = {
|
|
289
289
|
root: t,
|
|
290
290
|
stack: [t],
|
|
291
291
|
inScope: !1
|
|
292
292
|
};
|
|
293
|
-
|
|
293
|
+
x = n;
|
|
294
294
|
try {
|
|
295
295
|
if (e(), n.stack.length !== 1) throw Error(`defineStructure: builder body left ${n.stack.length - 1} unclosed group frame(s)`);
|
|
296
296
|
let r = { children: t };
|
|
297
297
|
return Ue(r), r;
|
|
298
298
|
} finally {
|
|
299
|
-
|
|
299
|
+
x = void 0;
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
function Ue(e) {
|
|
@@ -322,7 +322,7 @@ function Ue(e) {
|
|
|
322
322
|
throw Error(`defineStructure validation: path '${t}' under scope '${e}' is declared as both seed and ${n}. Seeds are block-author territory (written once at init, untouched thereafter); engine-managed primitives (fixed/managed/scaffold) rewrite on every refresh. The two contracts cannot coexist on the same path.`);
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function C(e, t) {
|
|
326
326
|
let n = ze("scope");
|
|
327
327
|
if (n.inScope) throw Error("scope() cannot nest. Already inside a scope.");
|
|
328
328
|
let r = {
|
|
@@ -341,18 +341,18 @@ var We;
|
|
|
341
341
|
function Ge(e) {
|
|
342
342
|
We = e;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function w(e, t, n) {
|
|
345
345
|
Ke(e, t), n && Ke((t) => !e(t), n);
|
|
346
346
|
}
|
|
347
347
|
function Ke(e, t) {
|
|
348
|
-
if (
|
|
348
|
+
if (x) {
|
|
349
349
|
qe(e, t);
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
352
|
if (!(We?.(e, t) ?? !1)) throw Error("when() called outside defineStructure() and outside any managed(...) body. Place this call inside one of the two.");
|
|
353
353
|
}
|
|
354
354
|
function qe(e, t) {
|
|
355
|
-
let n =
|
|
355
|
+
let n = x, r = {
|
|
356
356
|
kind: "when",
|
|
357
357
|
trigger: e,
|
|
358
358
|
children: []
|
|
@@ -364,7 +364,7 @@ function qe(e, t) {
|
|
|
364
364
|
n.stack.pop();
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function T(e) {
|
|
368
368
|
return (t) => t.filesMatch(e);
|
|
369
369
|
}
|
|
370
370
|
function Je(e, t, n) {
|
|
@@ -383,42 +383,42 @@ function Je(e, t, n) {
|
|
|
383
383
|
function Ye(e) {
|
|
384
384
|
Je("onInitOrUpdate", ["init", "updateDeps"], e);
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
|
|
386
|
+
function E(e, t) {
|
|
387
|
+
S("fixed", {
|
|
388
388
|
kind: "fixed",
|
|
389
389
|
path: e,
|
|
390
390
|
content: t
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
|
-
function
|
|
394
|
-
|
|
393
|
+
function D(e, t, n) {
|
|
394
|
+
S("managed", {
|
|
395
395
|
kind: "managed",
|
|
396
396
|
path: e,
|
|
397
397
|
initial: t,
|
|
398
398
|
body: n
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
|
|
401
|
+
function O(e, t) {
|
|
402
|
+
S("scaffold", {
|
|
403
403
|
kind: "scaffold",
|
|
404
404
|
path: e,
|
|
405
405
|
initial: t
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
|
|
408
|
+
function k(e, t) {
|
|
409
|
+
S("seed", {
|
|
410
410
|
kind: "seed",
|
|
411
411
|
path: e,
|
|
412
412
|
initial: t
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
|
|
415
|
+
function A(e) {
|
|
416
|
+
S("remove", {
|
|
417
417
|
kind: "remove",
|
|
418
418
|
path: e
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
|
-
function
|
|
421
|
+
function j(e) {
|
|
422
422
|
return {
|
|
423
423
|
kind: "file",
|
|
424
424
|
path: e
|
|
@@ -436,14 +436,14 @@ function Ze(e) {
|
|
|
436
436
|
value: e
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function M(e, t) {
|
|
440
440
|
return {
|
|
441
441
|
kind: "tpl",
|
|
442
442
|
path: e,
|
|
443
443
|
vars: t
|
|
444
444
|
};
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function N(e) {
|
|
447
447
|
return {
|
|
448
448
|
kind: "generate",
|
|
449
449
|
fn: e
|
|
@@ -460,7 +460,7 @@ function tt(e) {
|
|
|
460
460
|
}
|
|
461
461
|
function nt(e) {
|
|
462
462
|
if (Array.isArray(e)) return tt(e);
|
|
463
|
-
if (
|
|
463
|
+
if (P(e)) {
|
|
464
464
|
let t = Object.entries(e);
|
|
465
465
|
return t.length === 0 ? "{}" : "{ " + t.map(([e, t]) => `${JSON.stringify(e)}: ${nt(t)}`).join(", ") + " }";
|
|
466
466
|
}
|
|
@@ -474,7 +474,7 @@ function rt(e, t, n, r) {
|
|
|
474
474
|
let s = e.length - 1;
|
|
475
475
|
return "[\n" + e.map((e, t) => a + rt(e, i, i, t === s ? 0 : 1)).join(",\n") + "\n" + " ".repeat(t) + "]";
|
|
476
476
|
}
|
|
477
|
-
if (
|
|
477
|
+
if (P(e)) {
|
|
478
478
|
let n = Object.entries(e);
|
|
479
479
|
if (n.length === 0) return "{}";
|
|
480
480
|
let r = n.length - 1;
|
|
@@ -491,13 +491,13 @@ function it(e, t) {
|
|
|
491
491
|
function at(e) {
|
|
492
492
|
return e === "" || e === void 0 ? [] : e.split(".");
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function P(e) {
|
|
495
495
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
496
496
|
}
|
|
497
497
|
function ot(e, t) {
|
|
498
498
|
let n = at(t), r = e;
|
|
499
499
|
for (let e of n) {
|
|
500
|
-
if (!
|
|
500
|
+
if (!P(r)) return;
|
|
501
501
|
r = r[e];
|
|
502
502
|
}
|
|
503
503
|
return r;
|
|
@@ -507,10 +507,10 @@ function st(e, t) {
|
|
|
507
507
|
if (n.length === 0) return !0;
|
|
508
508
|
let r = e;
|
|
509
509
|
for (let e = 0; e < n.length - 1; e++) {
|
|
510
|
-
if (!
|
|
510
|
+
if (!P(r)) return !1;
|
|
511
511
|
r = r[n[e]];
|
|
512
512
|
}
|
|
513
|
-
return
|
|
513
|
+
return P(r) ? n[n.length - 1] in r : !1;
|
|
514
514
|
}
|
|
515
515
|
function ct(e, t, n) {
|
|
516
516
|
let r = at(t);
|
|
@@ -521,7 +521,7 @@ function ct(e, t, n) {
|
|
|
521
521
|
if (n === void 0) {
|
|
522
522
|
let e = {};
|
|
523
523
|
i[t] = e, i = e;
|
|
524
|
-
} else if (
|
|
524
|
+
} else if (P(n)) i = n;
|
|
525
525
|
else throw Error(`setAtPath: cannot descend into non-object at '${r.slice(0, e + 1).join(".")}'`);
|
|
526
526
|
}
|
|
527
527
|
i[r[r.length - 1]] = n;
|
|
@@ -531,10 +531,10 @@ function lt(e, t) {
|
|
|
531
531
|
if (n.length === 0) throw Error("deleteAtPath: jsonPath must be non-empty");
|
|
532
532
|
let r = e;
|
|
533
533
|
for (let e = 0; e < n.length - 1; e++) {
|
|
534
|
-
if (!
|
|
534
|
+
if (!P(r)) return;
|
|
535
535
|
r = r[n[e]];
|
|
536
536
|
}
|
|
537
|
-
|
|
537
|
+
P(r) && delete r[n[n.length - 1]];
|
|
538
538
|
}
|
|
539
539
|
function ut(e, t) {
|
|
540
540
|
let n = new Set(t), r = Object.keys(e), i = /* @__PURE__ */ new Map();
|
|
@@ -581,22 +581,22 @@ var _t = [
|
|
|
581
581
|
"optionalDependencies"
|
|
582
582
|
];
|
|
583
583
|
function vt(e, t) {
|
|
584
|
-
if (
|
|
584
|
+
if (R(e)) for (let n of _t) {
|
|
585
585
|
let r = e[n];
|
|
586
|
-
if (
|
|
586
|
+
if (R(r)) for (let e of Object.keys(r)) r[e] === "sdk:" && (r[e] = t ? "workspace:*" : "catalog:");
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
var
|
|
589
|
+
var F;
|
|
590
590
|
function yt(e) {
|
|
591
|
-
if (!
|
|
592
|
-
return
|
|
591
|
+
if (!F) throw Error(`${e}() only valid inside a managed(...) body. Move this call inside managed(path, initial, () => {...}).`);
|
|
592
|
+
return F;
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function I(e) {
|
|
595
595
|
let t = yt(e);
|
|
596
596
|
if (t.kind !== "json") throw Error(`${e}() requires a JSON-managed body; got '${t.kind}'.`);
|
|
597
597
|
return t;
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function L(e) {
|
|
600
600
|
let t = yt(e);
|
|
601
601
|
if (t.kind !== "yaml") throw Error(`${e}() requires a YAML-managed body; got '${t.kind}'.`);
|
|
602
602
|
return t;
|
|
@@ -611,12 +611,12 @@ function xt(e, t) {
|
|
|
611
611
|
if (!n) throw Error(`${t}() needs a RunContext but none is active. Pass { ctx } via the with-managed-* helper or run inside engine.run(...).`);
|
|
612
612
|
return n;
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function R(e) {
|
|
615
615
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
616
616
|
}
|
|
617
617
|
function St(e, t, n = {}) {
|
|
618
|
-
if (
|
|
619
|
-
|
|
618
|
+
if (F) throw Error("Nested managed(...) body — engine bug.");
|
|
619
|
+
F = {
|
|
620
620
|
kind: "json",
|
|
621
621
|
obj: e,
|
|
622
622
|
ctx: n.ctx,
|
|
@@ -625,12 +625,12 @@ function St(e, t, n = {}) {
|
|
|
625
625
|
try {
|
|
626
626
|
return t(n.ctx ?? n.triggerContext?.ctx), e;
|
|
627
627
|
} finally {
|
|
628
|
-
|
|
628
|
+
F = void 0;
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
function Ct(e, t, n = {}) {
|
|
632
|
-
if (
|
|
633
|
-
|
|
632
|
+
if (F) throw Error("Nested managed(...) body — engine bug.");
|
|
633
|
+
F = {
|
|
634
634
|
kind: "yaml",
|
|
635
635
|
doc: e,
|
|
636
636
|
ctx: n.ctx,
|
|
@@ -641,12 +641,12 @@ function Ct(e, t, n = {}) {
|
|
|
641
641
|
try {
|
|
642
642
|
return t(n.ctx ?? n.triggerContext?.ctx), e;
|
|
643
643
|
} finally {
|
|
644
|
-
|
|
644
|
+
F = void 0;
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
function wt(e, t, n = {}) {
|
|
648
|
-
if (
|
|
649
|
-
|
|
648
|
+
if (F) throw Error("Nested managed(...) body — engine bug.");
|
|
649
|
+
F = {
|
|
650
650
|
kind: "lines",
|
|
651
651
|
lines: e,
|
|
652
652
|
ctx: n.ctx,
|
|
@@ -655,36 +655,36 @@ function wt(e, t, n = {}) {
|
|
|
655
655
|
try {
|
|
656
656
|
return t(n.ctx ?? n.triggerContext?.ctx), e;
|
|
657
657
|
} finally {
|
|
658
|
-
|
|
658
|
+
F = void 0;
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
661
|
Ge((e, t) => {
|
|
662
|
-
if (!
|
|
663
|
-
let n =
|
|
662
|
+
if (!F) return !1;
|
|
663
|
+
let n = F.triggerContext;
|
|
664
664
|
if (!n) throw Error("when() inside a managed(...) body requires a triggerContext. The runner supplies it via the `triggerContext` opt to with-managed-*; ensure your test/test helper passes one.");
|
|
665
665
|
return e(n) && t(), !0;
|
|
666
666
|
});
|
|
667
|
-
function R(e, t) {
|
|
668
|
-
ct(F("ensureField").obj, e, t);
|
|
669
|
-
}
|
|
670
667
|
function z(e, t) {
|
|
671
|
-
|
|
668
|
+
ct(I("ensureField").obj, e, t);
|
|
669
|
+
}
|
|
670
|
+
function B(e, t) {
|
|
671
|
+
let n = I("removeField").obj;
|
|
672
672
|
st(n, e) && (t && !t(ot(n, e)) || lt(n, e));
|
|
673
673
|
}
|
|
674
674
|
function Tt(e, t) {
|
|
675
|
-
let n =
|
|
675
|
+
let n = I("requireField").obj;
|
|
676
676
|
if (!st(n, e)) throw Error(t ?? `requireField: missing field '${e}'`);
|
|
677
677
|
}
|
|
678
678
|
function Et(e, t) {
|
|
679
|
-
let n =
|
|
679
|
+
let n = I("ensureFieldEntries").obj, r = st(n, e) ? ot(n, e) : void 0, i = R(r) ? r : {};
|
|
680
680
|
for (let [e, n] of Object.entries(t)) i[e] = n;
|
|
681
|
-
|
|
681
|
+
R(r) || ct(n, e, i);
|
|
682
682
|
}
|
|
683
|
-
function
|
|
684
|
-
|
|
683
|
+
function V(e, t) {
|
|
684
|
+
z(`scripts.${e}`, t);
|
|
685
685
|
}
|
|
686
|
-
function
|
|
687
|
-
|
|
686
|
+
function H(e) {
|
|
687
|
+
B(`scripts.${e}`);
|
|
688
688
|
}
|
|
689
689
|
var Dt = [
|
|
690
690
|
"dependencies",
|
|
@@ -693,39 +693,39 @@ var Dt = [
|
|
|
693
693
|
"optionalDependencies"
|
|
694
694
|
];
|
|
695
695
|
function Ot(e, t, n, r) {
|
|
696
|
-
let i =
|
|
696
|
+
let i = I(e), a = i.obj, o = n === "sdk:" ? gt(n, xt(i, e).isSdkInternal) : n;
|
|
697
697
|
for (let e of Dt) {
|
|
698
698
|
if (e === r) continue;
|
|
699
699
|
let n = a[e];
|
|
700
|
-
|
|
700
|
+
R(n) && t in n && delete n[t];
|
|
701
701
|
}
|
|
702
|
-
let s = a[r], c =
|
|
703
|
-
c[t] = o,
|
|
702
|
+
let s = a[r], c = R(s) ? s : {};
|
|
703
|
+
c[t] = o, R(s) || (a[r] = c);
|
|
704
704
|
}
|
|
705
705
|
function kt(e, t) {
|
|
706
706
|
Ot("ensureDep", e, t, "dependencies");
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function U(e, t) {
|
|
709
709
|
Ot("ensureDevDep", e, t, "devDependencies");
|
|
710
710
|
}
|
|
711
711
|
function At(e, t) {
|
|
712
712
|
Ot("ensurePeerDep", e, t, "peerDependencies");
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
let t =
|
|
714
|
+
function W(e) {
|
|
715
|
+
let t = I("removeDep").obj;
|
|
716
716
|
for (let n of Dt) {
|
|
717
717
|
let r = t[n];
|
|
718
|
-
|
|
718
|
+
R(r) && e in r && delete r[e];
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
function
|
|
722
|
-
for (let [t, n] of Object.entries(e))
|
|
721
|
+
function G(e) {
|
|
722
|
+
for (let [t, n] of Object.entries(e)) U(t, n);
|
|
723
723
|
}
|
|
724
724
|
function jt(e) {
|
|
725
725
|
for (let [t, n] of Object.entries(e)) At(t, n);
|
|
726
726
|
}
|
|
727
727
|
function Mt(e, t, n) {
|
|
728
|
-
let r = xt(
|
|
728
|
+
let r = xt(I(e), e);
|
|
729
729
|
for (let i of r.modules) i.scope === t && Ot(e, i.name, "workspace:*", n);
|
|
730
730
|
}
|
|
731
731
|
function Nt(e) {
|
|
@@ -735,7 +735,7 @@ function Pt(e) {
|
|
|
735
735
|
Mt("ensureWorkspaceScopeDevDeps", e, "devDependencies");
|
|
736
736
|
}
|
|
737
737
|
function Ft(e) {
|
|
738
|
-
let t =
|
|
738
|
+
let t = I("pruneKeysMatching").obj;
|
|
739
739
|
for (let n of Object.keys(t)) e(n, t[n]) && delete t[n];
|
|
740
740
|
}
|
|
741
741
|
function It(e, t) {
|
|
@@ -743,28 +743,28 @@ function It(e, t) {
|
|
|
743
743
|
for (let t of Object.keys(e)) delete e[t];
|
|
744
744
|
for (let t of Object.keys(n)) e[t] = n[t];
|
|
745
745
|
}
|
|
746
|
-
function
|
|
747
|
-
It(
|
|
746
|
+
function K(e) {
|
|
747
|
+
It(I("enforceFieldOrder").obj, e);
|
|
748
748
|
}
|
|
749
749
|
function Lt(e, t) {
|
|
750
750
|
let n = Object.keys(e).sort(), r = {};
|
|
751
751
|
for (let t of n) r[t] = e[t];
|
|
752
752
|
for (let t of Object.keys(e)) delete e[t];
|
|
753
|
-
for (let i of n) e[i] = r[i], t &&
|
|
753
|
+
for (let i of n) e[i] = r[i], t && R(e[i]) && Lt(e[i], !0);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function q(e = "", t = {}) {
|
|
756
756
|
let n = t.recursive ?? !1;
|
|
757
757
|
if (e === "" && !n) return;
|
|
758
|
-
let r =
|
|
758
|
+
let r = I("enforceAlphabeticalOrder").obj;
|
|
759
759
|
if (e === "") {
|
|
760
760
|
Lt(r, !0);
|
|
761
761
|
return;
|
|
762
762
|
}
|
|
763
763
|
let i = ot(r, e);
|
|
764
|
-
|
|
764
|
+
R(i) && Lt(i, n);
|
|
765
765
|
}
|
|
766
766
|
function Rt() {
|
|
767
|
-
let e =
|
|
767
|
+
let e = L("ensureWorkspaceModulePaths"), t = xt(e, "ensureWorkspaceModulePaths").modules.filter((e) => e.path !== "").map((e) => e.path).sort(), n = e.doc.toJSON()?.packages;
|
|
768
768
|
Array.isArray(n) && n.length === t.length && n.every((e, n) => e === t[n]) || e.doc.setIn(["packages"], t);
|
|
769
769
|
}
|
|
770
770
|
function zt(e, t) {
|
|
@@ -772,23 +772,23 @@ function zt(e, t) {
|
|
|
772
772
|
return typeof n == "string" ? n : void 0;
|
|
773
773
|
}
|
|
774
774
|
function Bt(e, t) {
|
|
775
|
-
let n =
|
|
775
|
+
let n = L("ensureCatalogVersion");
|
|
776
776
|
zt(n, e) === void 0 && n.doc.setIn(["catalog", e], t);
|
|
777
777
|
}
|
|
778
778
|
function Vt(e) {
|
|
779
|
-
let t =
|
|
779
|
+
let t = L("ensureCatalogLatest");
|
|
780
780
|
if (!t.getLatestVersion) return;
|
|
781
781
|
let n = t.getLatestVersion(e);
|
|
782
782
|
n !== void 0 && zt(t, e) !== n && t.doc.setIn(["catalog", e], n);
|
|
783
783
|
}
|
|
784
784
|
function Ht(e, t) {
|
|
785
|
-
let n =
|
|
785
|
+
let n = L("pinCatalogToDependencyOf");
|
|
786
786
|
if (!n.getDerivedDependencyPin) return;
|
|
787
787
|
let r = n.getDerivedDependencyPin(e);
|
|
788
788
|
r !== void 0 && zt(n, e) !== r && n.doc.setIn(["catalog", e], r);
|
|
789
789
|
}
|
|
790
790
|
function Ut(e) {
|
|
791
|
-
let t =
|
|
791
|
+
let t = L("ensureCatalogAbsent");
|
|
792
792
|
t.doc.hasIn(["catalog", e]) && t.doc.deleteIn(["catalog", e]);
|
|
793
793
|
}
|
|
794
794
|
function Wt(e) {
|
|
@@ -1070,11 +1070,11 @@ function vn(e) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
//#endregion
|
|
1072
1072
|
//#region src/structure/engine/ctx.ts
|
|
1073
|
-
function
|
|
1073
|
+
function J(e, t) {
|
|
1074
1074
|
return e.modules.filter((e) => e.scope === t);
|
|
1075
1075
|
}
|
|
1076
1076
|
function yn(e, t) {
|
|
1077
|
-
let n =
|
|
1077
|
+
let n = J(e, t);
|
|
1078
1078
|
if (n.length === 0) throw Error(`findModule: expected one '${t}' module, found none`);
|
|
1079
1079
|
if (n.length > 1) throw Error(`findModule: expected exactly one '${t}' module, found ${n.length}`);
|
|
1080
1080
|
return n[0];
|
|
@@ -1084,7 +1084,7 @@ function bn(e, t) {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
function xn(e, t) {
|
|
1086
1086
|
let n = {};
|
|
1087
|
-
for (let r of
|
|
1087
|
+
for (let r of J(e, t)) n[r.name] = "workspace:*";
|
|
1088
1088
|
return n;
|
|
1089
1089
|
}
|
|
1090
1090
|
function Sn(e) {
|
|
@@ -1138,7 +1138,7 @@ function Cn(e) {
|
|
|
1138
1138
|
}
|
|
1139
1139
|
//#endregion
|
|
1140
1140
|
//#region src/structure/engine/discovery-fs.ts
|
|
1141
|
-
var
|
|
1141
|
+
var Y = class extends Error {
|
|
1142
1142
|
constructor(e) {
|
|
1143
1143
|
super(e), this.name = "StructureCliError";
|
|
1144
1144
|
}
|
|
@@ -1154,7 +1154,7 @@ function Tn(e, t) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
1156
|
function En(e) {
|
|
1157
|
-
if (e.includes("*")) throw new
|
|
1157
|
+
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.`);
|
|
1158
1158
|
let t = e.replace(/^\.\//, "").replace(/\/$/, "");
|
|
1159
1159
|
return t === "." ? "" : t;
|
|
1160
1160
|
}
|
|
@@ -1163,7 +1163,7 @@ function Dn(e) {
|
|
|
1163
1163
|
try {
|
|
1164
1164
|
t = e.read("pnpm-workspace.yaml");
|
|
1165
1165
|
} catch {
|
|
1166
|
-
throw new
|
|
1166
|
+
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.");
|
|
1167
1167
|
}
|
|
1168
1168
|
let n = ae(t) ?? {}, r = Array.isArray(n.packages) ? n.packages : [], i = new Set([""]);
|
|
1169
1169
|
for (let t of r) {
|
|
@@ -1203,9 +1203,9 @@ function On(e) {
|
|
|
1203
1203
|
}
|
|
1204
1204
|
function kn(e) {
|
|
1205
1205
|
let t = e.indexOf("/");
|
|
1206
|
-
if (!e.startsWith("@") || t < 0) throw new
|
|
1206
|
+
if (!e.startsWith("@") || t < 0) throw new Y(`Cannot parse block name '${e}': expected '@npm-org/org-scope.short-name'.`);
|
|
1207
1207
|
let n = e.slice(0, t), r = e.slice(t + 1), i = r.indexOf(".");
|
|
1208
|
-
if (i < 0) throw new
|
|
1208
|
+
if (i < 0) throw new Y(`Cannot parse block name '${e}': base name '${r}' has no '.' separating org-scope from short-name.`);
|
|
1209
1209
|
return {
|
|
1210
1210
|
facadeName: e,
|
|
1211
1211
|
baseName: r,
|
|
@@ -1216,11 +1216,11 @@ function kn(e) {
|
|
|
1216
1216
|
}
|
|
1217
1217
|
function An(e) {
|
|
1218
1218
|
let { fs: t, isSdkInternal: n } = e, r = n ? On(t) : Dn(t);
|
|
1219
|
-
if (r.length === 0) throw new
|
|
1219
|
+
if (r.length === 0) throw new Y("No workspace packages found. Run 'block-tools structure init' to scaffold a block.");
|
|
1220
1220
|
let i = vn(r), a = Jt(t);
|
|
1221
1221
|
Yt(a.version, 0);
|
|
1222
1222
|
let o = i.find((e) => e.scope === "block") ?? i.find((e) => e.scope === "root");
|
|
1223
|
-
if (!o) throw new
|
|
1223
|
+
if (!o) throw new Y("Could not find a 'block' (or root-as-block) package to derive BlockVars from.");
|
|
1224
1224
|
let s = kn(o.name.replace(/\.block$/, ""));
|
|
1225
1225
|
return Cn({
|
|
1226
1226
|
isSdkInternal: n,
|
|
@@ -1233,7 +1233,7 @@ function An(e) {
|
|
|
1233
1233
|
}
|
|
1234
1234
|
//#endregion
|
|
1235
1235
|
//#region src/structure/rules/shared/key-order.ts
|
|
1236
|
-
var
|
|
1236
|
+
var X = [
|
|
1237
1237
|
"name",
|
|
1238
1238
|
"version",
|
|
1239
1239
|
"private",
|
|
@@ -1296,10 +1296,10 @@ function Nn() {
|
|
|
1296
1296
|
};
|
|
1297
1297
|
}
|
|
1298
1298
|
function Pn() {
|
|
1299
|
-
|
|
1300
|
-
for (let [e, t] of Object.entries(jn))
|
|
1301
|
-
for (let [e, t] of Object.entries(Mn))
|
|
1302
|
-
|
|
1299
|
+
z("packageManager", "pnpm@9.12.0"), B("name"), V("fmt", "turbo run fmt"), V("check", "turbo run check");
|
|
1300
|
+
for (let [e, t] of Object.entries(jn)) V(e, t);
|
|
1301
|
+
for (let [e, t] of Object.entries(Mn)) V(e, t);
|
|
1302
|
+
H("build"), H("build:dev"), V("mark-stable", "turbo run mark-stable"), V("do-pack", "turbo run do-pack"), V("watch", "turbo watch build"), V("changeset", "changeset"), V("version-packages", "changeset version"), V("update-sdk", "block-tools structure refresh --update-deps-only"), H("update"), V("upgrade-sdk", "block-tools structure refresh --update-deps-only && pnpm i && block-tools structure refresh && pnpm i && pnpm fmt"), G({
|
|
1303
1303
|
"@changesets/cli": "catalog:",
|
|
1304
1304
|
"@milaboratories/ts-builder": "sdk:",
|
|
1305
1305
|
"@platforma-sdk/block-tools": "sdk:",
|
|
@@ -1312,7 +1312,7 @@ function Pn() {
|
|
|
1312
1312
|
if (!/^(\/\/|--)/.test(e) || typeof t != "object" || !t) return !1;
|
|
1313
1313
|
let n = t;
|
|
1314
1314
|
return n.pnpm !== void 0 || n.overrides !== void 0;
|
|
1315
|
-
}),
|
|
1315
|
+
}), q("dependencies"), q("devDependencies"), q("peerDependencies"), q("optionalDependencies"), K([...X]);
|
|
1316
1316
|
}
|
|
1317
1317
|
//#endregion
|
|
1318
1318
|
//#region src/structure/rules/root-turbo-json.ts
|
|
@@ -1373,7 +1373,7 @@ function Rn() {
|
|
|
1373
1373
|
};
|
|
1374
1374
|
}
|
|
1375
1375
|
function zn() {
|
|
1376
|
-
|
|
1376
|
+
z("$schema", Fn), z("globalDependencies", In), Et("tasks", Ln), B("tasks.build:dev"), K([
|
|
1377
1377
|
"$schema",
|
|
1378
1378
|
"globalDependencies",
|
|
1379
1379
|
"tasks"
|
|
@@ -1460,8 +1460,8 @@ var $n = [
|
|
|
1460
1460
|
"vite-plugin-dts",
|
|
1461
1461
|
"@platforma-sdk/eslint-config"
|
|
1462
1462
|
];
|
|
1463
|
-
function
|
|
1464
|
-
for (let e of $n)
|
|
1463
|
+
function er() {
|
|
1464
|
+
for (let e of $n) W(e);
|
|
1465
1465
|
}
|
|
1466
1466
|
//#endregion
|
|
1467
1467
|
//#region src/structure/rules/root-pnpm-workspace.ts
|
|
@@ -1475,35 +1475,35 @@ var Z = [
|
|
|
1475
1475
|
"@platforma-sdk/package-builder",
|
|
1476
1476
|
"@milaboratories/ts-builder",
|
|
1477
1477
|
"@milaboratories/ts-configs"
|
|
1478
|
-
],
|
|
1478
|
+
], tr = "0.0.0-init-must-fetch";
|
|
1479
1479
|
for (let e of Z) if (!Yn(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.`);
|
|
1480
|
-
var
|
|
1480
|
+
var nr = {
|
|
1481
1481
|
turbo: "~2.8.11",
|
|
1482
1482
|
shx: "~0.4.0",
|
|
1483
1483
|
"@changesets/cli": "~2.29.8",
|
|
1484
1484
|
vitest: "~4.0.18"
|
|
1485
|
-
},
|
|
1485
|
+
}, rr = [{
|
|
1486
1486
|
entry: "vue",
|
|
1487
1487
|
of: "@platforma-sdk/ui-vue"
|
|
1488
1488
|
}, {
|
|
1489
1489
|
entry: "@milaboratories/helpers",
|
|
1490
1490
|
of: "@platforma-sdk/model"
|
|
1491
|
-
}],
|
|
1492
|
-
function
|
|
1491
|
+
}], ir = "@platforma-open/milaboratories.runenv-python-3", ar = "1.8.2";
|
|
1492
|
+
function or(e) {
|
|
1493
1493
|
let t = e.modules.filter((e) => e.path !== "").map((e) => e.path).sort(), n = {};
|
|
1494
|
-
for (let e of Z) n[e] =
|
|
1495
|
-
return Object.assign(n,
|
|
1494
|
+
for (let e of Z) n[e] = tr;
|
|
1495
|
+
return Object.assign(n, nr), e.modules.some((e) => e.scope === "software") && (n[ir] = ar), {
|
|
1496
1496
|
packages: t,
|
|
1497
1497
|
catalog: n
|
|
1498
1498
|
};
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function sr() {
|
|
1501
1501
|
Rt();
|
|
1502
1502
|
for (let e of $n) Ut(e);
|
|
1503
1503
|
}
|
|
1504
1504
|
//#endregion
|
|
1505
1505
|
//#region src/structure/rules/root-gitignore.ts
|
|
1506
|
-
var
|
|
1506
|
+
var cr = [
|
|
1507
1507
|
".test_auth.json",
|
|
1508
1508
|
"node_modules/",
|
|
1509
1509
|
"dist/",
|
|
@@ -1518,47 +1518,47 @@ var sr = [
|
|
|
1518
1518
|
".vscode/sftp.json",
|
|
1519
1519
|
"test-dry-run.json"
|
|
1520
1520
|
];
|
|
1521
|
-
function
|
|
1522
|
-
Wt(
|
|
1521
|
+
function lr() {
|
|
1522
|
+
Wt(cr);
|
|
1523
1523
|
}
|
|
1524
1524
|
//#endregion
|
|
1525
1525
|
//#region src/structure/rules/root.ts
|
|
1526
|
-
function
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1526
|
+
function ur() {
|
|
1527
|
+
C("root", () => {
|
|
1528
|
+
w(({ ctx: e }) => !e.isSdkInternal, () => {
|
|
1529
|
+
D("turbo.json", N(() => Rn()), () => {
|
|
1530
1530
|
zn();
|
|
1531
|
-
}),
|
|
1531
|
+
}), E(".vscode/settings.json", j("root/.vscode/settings.json")), D("package.json", N(() => Nn()), () => {
|
|
1532
1532
|
Pn();
|
|
1533
|
-
}),
|
|
1534
|
-
|
|
1535
|
-
}),
|
|
1536
|
-
|
|
1533
|
+
}), D("pnpm-workspace.yaml", N((e) => or(e)), () => {
|
|
1534
|
+
sr();
|
|
1535
|
+
}), D(".gitignore", j("root/.gitignore"), () => {
|
|
1536
|
+
lr();
|
|
1537
1537
|
});
|
|
1538
1538
|
});
|
|
1539
1539
|
});
|
|
1540
1540
|
}
|
|
1541
1541
|
//#endregion
|
|
1542
1542
|
//#region src/structure/rules/root-ci.ts
|
|
1543
|
-
function
|
|
1543
|
+
function dr(e) {
|
|
1544
1544
|
return e.split(/[-_]+/).filter((e) => e.length > 0).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
1545
1545
|
}
|
|
1546
|
-
function
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1546
|
+
function fr() {
|
|
1547
|
+
C("root", () => {
|
|
1548
|
+
w(({ ctx: e }) => !e.isSdkInternal, () => {
|
|
1549
|
+
E(".github/workflows/build.yaml", M("workflows/build.tpl.yaml", (e) => {
|
|
1550
1550
|
let t = e.blockVars.shortName;
|
|
1551
1551
|
return {
|
|
1552
|
-
appName: `Block: ${
|
|
1552
|
+
appName: `Block: ${dr(t)}`,
|
|
1553
1553
|
appNameSlug: `block-${t}`
|
|
1554
1554
|
};
|
|
1555
|
-
})),
|
|
1555
|
+
})), E(".github/workflows/mark-stable.yaml", M("workflows/mark-stable.tpl.yaml", (e) => ({ appName: `Block: ${dr(e.blockVars.shortName)} - Mark Stable` })));
|
|
1556
1556
|
});
|
|
1557
1557
|
});
|
|
1558
1558
|
}
|
|
1559
1559
|
//#endregion
|
|
1560
1560
|
//#region src/structure/rules/block-package-json.ts
|
|
1561
|
-
var
|
|
1561
|
+
var pr = {
|
|
1562
1562
|
"@platforma-open": {
|
|
1563
1563
|
s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1",
|
|
1564
1564
|
serveUrl: "https://blocks.pl-open.science"
|
|
@@ -1567,45 +1567,45 @@ var fr = {
|
|
|
1567
1567
|
s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1",
|
|
1568
1568
|
serveUrl: "https://block.registry.platforma.bio/releases"
|
|
1569
1569
|
}
|
|
1570
|
-
},
|
|
1570
|
+
}, mr = {
|
|
1571
1571
|
s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1",
|
|
1572
1572
|
serveUrl: "https://blocks.pl-open.science"
|
|
1573
|
-
},
|
|
1573
|
+
}, hr = {
|
|
1574
1574
|
s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/aux/dev/?region=eu-central-1",
|
|
1575
1575
|
serveUrl: "https://aux-blocks.pl-open.science"
|
|
1576
1576
|
};
|
|
1577
|
-
function
|
|
1578
|
-
let n = t ?
|
|
1577
|
+
function gr(e, t) {
|
|
1578
|
+
let n = t ? hr : pr[e] ?? mr;
|
|
1579
1579
|
return `block-tools publish -r ${n.s3} --registry-serve-url ${n.serveUrl}`;
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1581
|
+
function _r(e) {
|
|
1582
1582
|
let t = {};
|
|
1583
|
-
for (let n of
|
|
1584
|
-
for (let n of
|
|
1585
|
-
for (let n of
|
|
1583
|
+
for (let n of J(e, "workflow")) t.workflow = `${n.name}/dist/tengo/tpl/main.plj.gz`;
|
|
1584
|
+
for (let n of J(e, "model")) t.model = `${n.name}/dist/model.json`;
|
|
1585
|
+
for (let n of J(e, "ui")) t.ui = `${n.name}/dist`;
|
|
1586
1586
|
return t;
|
|
1587
1587
|
}
|
|
1588
|
-
function
|
|
1588
|
+
function vr(e, t) {
|
|
1589
1589
|
return {
|
|
1590
1590
|
build: "ts-builder build --target block-facade && block-tools pack",
|
|
1591
1591
|
check: "ts-builder type-check --target block-facade",
|
|
1592
|
-
prepublishOnly:
|
|
1592
|
+
prepublishOnly: gr(e, t),
|
|
1593
1593
|
"do-pack": "shx rm -f package.tgz && pnpm pack && shx mv *.tgz package.tgz"
|
|
1594
1594
|
};
|
|
1595
1595
|
}
|
|
1596
|
-
var
|
|
1596
|
+
var yr = {
|
|
1597
1597
|
"@milaboratories/ts-builder": "sdk:",
|
|
1598
1598
|
"@milaboratories/ts-configs": "sdk:",
|
|
1599
1599
|
"@platforma-sdk/block-tools": "sdk:",
|
|
1600
1600
|
"@platforma-sdk/model": "sdk:",
|
|
1601
1601
|
shx: "catalog:",
|
|
1602
1602
|
typescript: "catalog:"
|
|
1603
|
-
},
|
|
1603
|
+
}, br = { ".": {
|
|
1604
1604
|
sources: "./src/index.ts",
|
|
1605
1605
|
types: "./dist/index.d.ts",
|
|
1606
1606
|
default: "./dist/index.js"
|
|
1607
1607
|
} };
|
|
1608
|
-
function
|
|
1608
|
+
function xr(e) {
|
|
1609
1609
|
if (Object.keys(e.components).length === 0) throw Error("block.components is empty — no workflow/model/ui module was discovered");
|
|
1610
1610
|
let t = e.meta, n = [
|
|
1611
1611
|
["block.meta.title", t.title],
|
|
@@ -1617,14 +1617,14 @@ function br(e) {
|
|
|
1617
1617
|
];
|
|
1618
1618
|
for (let [e, t] of n) if (typeof t != "string" || t === "") throw Error(`required block field '${e}' is empty`);
|
|
1619
1619
|
}
|
|
1620
|
-
function
|
|
1620
|
+
function Sr(e) {
|
|
1621
1621
|
let t = e.blockVars, n = {
|
|
1622
|
-
...
|
|
1622
|
+
...yr,
|
|
1623
1623
|
...xn(e, "model"),
|
|
1624
1624
|
...xn(e, "ui"),
|
|
1625
1625
|
...xn(e, "workflow")
|
|
1626
1626
|
}, r = {
|
|
1627
|
-
components:
|
|
1627
|
+
components: _r(e),
|
|
1628
1628
|
meta: {
|
|
1629
1629
|
title: t.shortName,
|
|
1630
1630
|
description: `${t.shortName} block`,
|
|
@@ -1636,7 +1636,7 @@ function xr(e) {
|
|
|
1636
1636
|
}
|
|
1637
1637
|
}
|
|
1638
1638
|
};
|
|
1639
|
-
return
|
|
1639
|
+
return xr(r), {
|
|
1640
1640
|
name: `${t.facadeName}.block`,
|
|
1641
1641
|
version: "1.0.0",
|
|
1642
1642
|
type: "module",
|
|
@@ -1644,35 +1644,35 @@ function xr(e) {
|
|
|
1644
1644
|
main: "./dist/index.js",
|
|
1645
1645
|
module: "./dist/index.js",
|
|
1646
1646
|
types: "./dist/index.d.ts",
|
|
1647
|
-
exports:
|
|
1648
|
-
scripts:
|
|
1647
|
+
exports: br,
|
|
1648
|
+
scripts: vr(t.npmOrg, e.isSdkInternal),
|
|
1649
1649
|
dependencies: {},
|
|
1650
1650
|
devDependencies: n,
|
|
1651
1651
|
block: r
|
|
1652
1652
|
};
|
|
1653
1653
|
}
|
|
1654
|
-
function
|
|
1654
|
+
function Cr(e) {
|
|
1655
1655
|
let t = e.blockVars;
|
|
1656
|
-
|
|
1657
|
-
let n =
|
|
1658
|
-
for (let [e, t] of Object.entries(n))
|
|
1659
|
-
|
|
1656
|
+
z("type", "module"), z("files", ["dist", "block-pack"]), z("main", "./dist/index.js"), z("module", "./dist/index.js"), z("types", "./dist/index.d.ts"), z("exports", br);
|
|
1657
|
+
let n = vr(t.npmOrg, e.isSdkInternal);
|
|
1658
|
+
for (let [e, t] of Object.entries(n)) V(e, t);
|
|
1659
|
+
H("mark-stable"), Pt("model"), Pt("ui"), Pt("workflow"), U("@milaboratories/ts-builder", "sdk:"), U("@milaboratories/ts-configs", "sdk:"), U("@platforma-sdk/block-tools", "sdk:"), U("@platforma-sdk/model", "sdk:"), U("shx", "catalog:"), U("typescript", "catalog:"), z("block.components", _r(e)), Tt("version", "facade package.json must carry a 'version' (the facade publishes)"), q("dependencies"), q("devDependencies"), q("peerDependencies"), q("optionalDependencies"), K([...X]);
|
|
1660
1660
|
}
|
|
1661
1661
|
//#endregion
|
|
1662
1662
|
//#region src/structure/rules/shared/pascal-case.ts
|
|
1663
|
-
function
|
|
1663
|
+
function wr(e) {
|
|
1664
1664
|
let t = e.split(/[^A-Za-z0-9]+/).filter((e) => e.length > 0).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
1665
1665
|
return /^[0-9]/.test(t) ? `_${t}` : t;
|
|
1666
1666
|
}
|
|
1667
1667
|
//#endregion
|
|
1668
1668
|
//#region src/structure/rules/block.ts
|
|
1669
|
-
function
|
|
1670
|
-
|
|
1671
|
-
|
|
1669
|
+
function Tr() {
|
|
1670
|
+
C("block", () => {
|
|
1671
|
+
A("index.js"), A("index.d.ts"), E("src/index.ts", M("block/src/index.tpl.ts", (e) => ({
|
|
1672
1672
|
facadeName: e.blockVars.facadeName,
|
|
1673
|
-
pascalName:
|
|
1674
|
-
}))),
|
|
1675
|
-
|
|
1673
|
+
pascalName: wr(e.blockVars.shortName)
|
|
1674
|
+
}))), E("src/AGENTS.ts", j("block/src/AGENTS.ts")), O("src/block-extra.ts", j("block/src/block-extra.ts")), O("src/agents-extra.ts", j("block/src/agents-extra.ts")), E("tsconfig.json", j("block/tsconfig.json")), k("logos/block-logo.png", Xe("block/logos/block-logo.png")), k("logos/organization-logo.png", Xe("block/logos/organization-logo.png")), D("package.json", N((e) => Sr(e)), (e) => {
|
|
1675
|
+
Cr(e);
|
|
1676
1676
|
});
|
|
1677
1677
|
});
|
|
1678
1678
|
}
|
|
@@ -1681,7 +1681,7 @@ function wr() {
|
|
|
1681
1681
|
var Q = "src/**/*.test.ts";
|
|
1682
1682
|
//#endregion
|
|
1683
1683
|
//#region src/structure/rules/model-package-json.ts
|
|
1684
|
-
function
|
|
1684
|
+
function Er(e) {
|
|
1685
1685
|
return {
|
|
1686
1686
|
name: `${e.blockVars.facadeName}.model`,
|
|
1687
1687
|
private: !0,
|
|
@@ -1715,37 +1715,37 @@ function Tr(e) {
|
|
|
1715
1715
|
}
|
|
1716
1716
|
};
|
|
1717
1717
|
}
|
|
1718
|
-
function
|
|
1719
|
-
|
|
1718
|
+
function Dr() {
|
|
1719
|
+
z("private", !0), z("type", "module"), z("main", "dist/index.cjs"), z("module", "dist/index.js"), z("types", "dist/index.d.ts"), z("exports", {
|
|
1720
1720
|
".": {
|
|
1721
1721
|
types: "./dist/index.d.ts",
|
|
1722
1722
|
sources: "./src/index.ts",
|
|
1723
1723
|
import: "./dist/index.js"
|
|
1724
1724
|
},
|
|
1725
1725
|
"./dist/*": "./dist/*"
|
|
1726
|
-
}),
|
|
1726
|
+
}), V("fmt", "ts-builder format"), V("watch", "ts-builder build --target block-model --watch"), V("build", "ts-builder build --target block-model && block-tools build-model"), V("check", "ts-builder check --target block-model"), kt("@platforma-sdk/model", "sdk:"), G({
|
|
1727
1727
|
"@milaboratories/ts-builder": "sdk:",
|
|
1728
1728
|
"@milaboratories/ts-configs": "sdk:",
|
|
1729
1729
|
"@platforma-sdk/block-tools": "sdk:"
|
|
1730
1730
|
}), jt({
|
|
1731
1731
|
"@types/node": "*",
|
|
1732
1732
|
typescript: "*"
|
|
1733
|
-
}),
|
|
1734
|
-
|
|
1735
|
-
}, () =>
|
|
1733
|
+
}), w(({ ctx: e }) => !e.isSdkInternal, () => w(T(Q), () => {
|
|
1734
|
+
V("test", "vitest run --passWithNoTests"), U("vitest", "catalog:"), U("@types/node", "*");
|
|
1735
|
+
}, () => W("vitest"))), er(), B("tsup"), H("lint"), q("dependencies"), q("devDependencies"), q("peerDependencies"), q("optionalDependencies"), K([...X]);
|
|
1736
1736
|
}
|
|
1737
1737
|
//#endregion
|
|
1738
1738
|
//#region src/structure/rules/model.ts
|
|
1739
|
-
function
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1739
|
+
function Or() {
|
|
1740
|
+
C("model", () => {
|
|
1741
|
+
w(T(Q), () => E("tsconfig.json", j("model/tsconfig.node.json")), () => E("tsconfig.json", j("model/tsconfig.json"))), E(".oxlintrc.json", j("model/.oxlintrc.json")), E(".oxfmtrc.json", j("model/.oxfmtrc.json")), k("src/index.ts", j("model/src/index.ts")), D("package.json", N((e) => Er(e)), () => {
|
|
1742
|
+
Dr();
|
|
1743
1743
|
});
|
|
1744
1744
|
});
|
|
1745
1745
|
}
|
|
1746
1746
|
//#endregion
|
|
1747
1747
|
//#region src/structure/rules/ui-package-json.ts
|
|
1748
|
-
function
|
|
1748
|
+
function kr(e) {
|
|
1749
1749
|
return {
|
|
1750
1750
|
name: `${e.blockVars.facadeName}.ui`,
|
|
1751
1751
|
private: !0,
|
|
@@ -1772,29 +1772,29 @@ function Or(e) {
|
|
|
1772
1772
|
}
|
|
1773
1773
|
};
|
|
1774
1774
|
}
|
|
1775
|
-
function
|
|
1776
|
-
|
|
1775
|
+
function Ar() {
|
|
1776
|
+
z("private", !0), z("type", "module"), V("fmt", "ts-builder format"), V("dev", "ts-builder serve --target block-ui"), V("watch", "ts-builder build --target block-ui --watch"), V("build", "ts-builder build --target block-ui"), V("check", "ts-builder check --target block-ui"), kt("@platforma-sdk/ui-vue", "sdk:"), kt("vue", "catalog:"), Nt("model"), G({
|
|
1777
1777
|
"@milaboratories/ts-builder": "sdk:",
|
|
1778
1778
|
"@milaboratories/ts-configs": "sdk:"
|
|
1779
|
-
}),
|
|
1779
|
+
}), er(), H("preview"), H("lint"), jt({
|
|
1780
1780
|
"@types/node": "*",
|
|
1781
1781
|
typescript: "*"
|
|
1782
|
-
}),
|
|
1783
|
-
|
|
1784
|
-
}, () =>
|
|
1782
|
+
}), w(({ ctx: e }) => !e.isSdkInternal, () => w(T(Q), () => {
|
|
1783
|
+
V("test", "vitest run --passWithNoTests"), U("vitest", "catalog:"), U("@types/node", "*");
|
|
1784
|
+
}, () => W("vitest"))), q("dependencies"), q("devDependencies"), q("peerDependencies"), q("optionalDependencies"), K([...X]);
|
|
1785
1785
|
}
|
|
1786
1786
|
//#endregion
|
|
1787
1787
|
//#region src/structure/rules/ui.ts
|
|
1788
|
-
function
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1788
|
+
function jr() {
|
|
1789
|
+
C("ui", () => {
|
|
1790
|
+
w(T(Q), () => E("tsconfig.json", j("ui/tsconfig.node.json")), () => E("tsconfig.json", j("ui/tsconfig.json"))), E(".oxlintrc.json", j("ui/.oxlintrc.json")), E(".oxfmtrc.json", j("ui/.oxfmtrc.json")), O("index.html", j("ui/index.html")), k("src/main.ts", j("ui/src/main.ts")), k("src/app.ts", M("ui/src/app.tpl.ts", (e) => ({ modelPkg: `${e.blockVars.facadeName}.model` }))), k("src/MainPage.vue", M("ui/src/MainPage.tpl.vue", (e) => ({ shortName: e.blockVars.shortName }))), D("package.json", N((e) => kr(e)), () => {
|
|
1791
|
+
Ar();
|
|
1792
1792
|
});
|
|
1793
1793
|
});
|
|
1794
1794
|
}
|
|
1795
1795
|
//#endregion
|
|
1796
1796
|
//#region src/structure/rules/workflow-package-json.ts
|
|
1797
|
-
function
|
|
1797
|
+
function Mr(e) {
|
|
1798
1798
|
return {
|
|
1799
1799
|
name: `${e.blockVars.facadeName}.workflow`,
|
|
1800
1800
|
private: !0,
|
|
@@ -1815,31 +1815,31 @@ function jr(e) {
|
|
|
1815
1815
|
}
|
|
1816
1816
|
};
|
|
1817
1817
|
}
|
|
1818
|
-
function
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
}, () =>
|
|
1818
|
+
function Nr() {
|
|
1819
|
+
z("private", !0), z("type", "module"), V("build", "shx rm -rf dist && pl-tengo build"), V("check", "pl-tengo check"), V("format", "/usr/bin/env emacs --script ./format.el || echo 'No emacs.'"), w(({ ctx: e }) => !e.isSdkInternal, () => w(T(Q), () => {
|
|
1820
|
+
V("test", "vitest run --passWithNoTests"), G({ vitest: "catalog:" });
|
|
1821
|
+
}, () => W("vitest"))), kt("@platforma-sdk/workflow-tengo", "sdk:"), Nt("software"), G({
|
|
1822
1822
|
"@platforma-sdk/tengo-builder": "sdk:",
|
|
1823
1823
|
"@platforma-sdk/test": "sdk:",
|
|
1824
1824
|
shx: "catalog:"
|
|
1825
|
-
}),
|
|
1825
|
+
}), er(), q("dependencies"), q("devDependencies"), q("peerDependencies"), q("optionalDependencies"), K([...X]);
|
|
1826
1826
|
}
|
|
1827
1827
|
//#endregion
|
|
1828
1828
|
//#region src/structure/rules/workflow.ts
|
|
1829
|
-
function
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1829
|
+
function Pr() {
|
|
1830
|
+
C("workflow", () => {
|
|
1831
|
+
E("format.el", j("workflow/format.el")), w(({ ctx: e }) => !e.isSdkInternal, () => w(T(Q), () => {
|
|
1832
|
+
E("tsconfig.json", j("workflow/tsconfig.json")), O("vitest.config.mts", j("workflow/vitest.config.mts"));
|
|
1833
1833
|
}, () => {
|
|
1834
|
-
|
|
1835
|
-
})),
|
|
1836
|
-
|
|
1834
|
+
A("tsconfig.json"), A("vitest.config.mts");
|
|
1835
|
+
})), A("index.js"), A("index.d.ts"), k("src/main.tpl.tengo", M("workflow/src/main.tpl.tengo", (e) => ({ shortName: e.blockVars.shortName }))), D("package.json", N((e) => Mr(e)), () => {
|
|
1836
|
+
Nr();
|
|
1837
1837
|
});
|
|
1838
1838
|
});
|
|
1839
1839
|
}
|
|
1840
1840
|
//#endregion
|
|
1841
1841
|
//#region src/structure/rules/test-package-json.ts
|
|
1842
|
-
function
|
|
1842
|
+
function Fr(e) {
|
|
1843
1843
|
return {
|
|
1844
1844
|
name: `${e.blockVars.facadeName}.test`,
|
|
1845
1845
|
private: !0,
|
|
@@ -1858,27 +1858,27 @@ function Pr(e) {
|
|
|
1858
1858
|
}
|
|
1859
1859
|
};
|
|
1860
1860
|
}
|
|
1861
|
-
function
|
|
1862
|
-
|
|
1861
|
+
function Ir() {
|
|
1862
|
+
z("private", !0), z("type", "module"), V("fmt", "ts-builder format"), V("check", "ts-builder check --target block-test"), V("test", "vitest run --passWithNoTests"), H("lint"), G({
|
|
1863
1863
|
"@platforma-sdk/test": "sdk:",
|
|
1864
1864
|
"@milaboratories/ts-builder": "sdk:",
|
|
1865
1865
|
"@milaboratories/ts-configs": "sdk:",
|
|
1866
1866
|
vitest: "catalog:"
|
|
1867
|
-
}), jt({ typescript: "*" }),
|
|
1867
|
+
}), jt({ typescript: "*" }), W("@types/node"), er(), q("dependencies"), q("devDependencies"), q("peerDependencies"), q("optionalDependencies"), K([...X]);
|
|
1868
1868
|
}
|
|
1869
1869
|
//#endregion
|
|
1870
1870
|
//#region src/structure/rules/test.ts
|
|
1871
|
-
function
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1871
|
+
function Lr() {
|
|
1872
|
+
C("test", () => {
|
|
1873
|
+
E("tsconfig.json", j("test/tsconfig.json")), E(".oxlintrc.json", j("test/.oxlintrc.json")), E(".oxfmtrc.json", j("test/.oxfmtrc.json")), O("vitest.config.mts", j("test/vitest.config.mts")), k("src/demo.test.ts", Ze("import { expect, test } from \"vitest\";\n\ntest(\"scaffolded block sanity check\", () => {\n expect(true).toBe(true);\n});\n")), D("package.json", N((e) => Fr(e)), () => {
|
|
1874
|
+
Ir();
|
|
1875
1875
|
});
|
|
1876
1876
|
});
|
|
1877
1877
|
}
|
|
1878
1878
|
//#endregion
|
|
1879
1879
|
//#region src/structure/rules/software-package-json.ts
|
|
1880
|
-
var
|
|
1881
|
-
function
|
|
1880
|
+
var Rr = "block-tools software build", zr = "shx rm -f *.tgz && block-tools software build && pnpm pack && shx mv platforma-open*.tgz package.tgz";
|
|
1881
|
+
function Br() {
|
|
1882
1882
|
return { entrypoints: { main: { binary: {
|
|
1883
1883
|
artifact: {
|
|
1884
1884
|
type: "python",
|
|
@@ -1893,65 +1893,65 @@ function zr() {
|
|
|
1893
1893
|
cmd: ["python", "{pkg}/main.py"]
|
|
1894
1894
|
} } } };
|
|
1895
1895
|
}
|
|
1896
|
-
function
|
|
1896
|
+
function Vr(e) {
|
|
1897
1897
|
return {
|
|
1898
1898
|
name: `${e.blockVars.facadeName}.software`,
|
|
1899
1899
|
type: "module",
|
|
1900
1900
|
description: "Block Software",
|
|
1901
1901
|
files: ["./dist/**/*"],
|
|
1902
1902
|
scripts: {
|
|
1903
|
-
build:
|
|
1904
|
-
"do-pack":
|
|
1903
|
+
build: Rr,
|
|
1904
|
+
"do-pack": zr,
|
|
1905
1905
|
changeset: "changeset",
|
|
1906
1906
|
"version-packages": "changeset version"
|
|
1907
1907
|
},
|
|
1908
|
-
"block-software":
|
|
1908
|
+
"block-software": Br(),
|
|
1909
1909
|
devDependencies: {
|
|
1910
1910
|
"@platforma-open/milaboratories.runenv-python-3": "catalog:",
|
|
1911
1911
|
"@platforma-sdk/block-tools": "sdk:"
|
|
1912
1912
|
}
|
|
1913
1913
|
};
|
|
1914
1914
|
}
|
|
1915
|
-
function
|
|
1916
|
-
|
|
1915
|
+
function Hr() {
|
|
1916
|
+
B("private"), z("type", "module"), z("files", ["./dist/**/*"]), V("build", Rr), V("do-pack", zr), H("prepublishOnly"), V("changeset", "changeset"), V("version-packages", "changeset version"), U("@platforma-open/milaboratories.runenv-python-3", "catalog:"), U("@platforma-sdk/block-tools", "sdk:"), W("@platforma-sdk/package-builder"), q("dependencies"), q("devDependencies"), q("peerDependencies"), q("optionalDependencies"), K([...X]);
|
|
1917
1917
|
}
|
|
1918
1918
|
//#endregion
|
|
1919
1919
|
//#region src/structure/rules/software.ts
|
|
1920
|
-
var
|
|
1921
|
-
function
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1920
|
+
var Ur = "import sys\n\nprint(\"Hello from Python, \" + sys.argv[1] + \"!\")\n", Wr = "# No dependencies specified for this script\n";
|
|
1921
|
+
function Gr() {
|
|
1922
|
+
C("software", () => {
|
|
1923
|
+
k("src/main.py", Ze(Ur)), k("src/requirements.txt", Ze(Wr)), D("package.json", N((e) => Vr(e)), () => {
|
|
1924
|
+
Hr();
|
|
1925
1925
|
});
|
|
1926
1926
|
});
|
|
1927
1927
|
}
|
|
1928
|
-
function
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
}),
|
|
1932
|
-
|
|
1933
|
-
}),
|
|
1934
|
-
|
|
1935
|
-
}),
|
|
1936
|
-
|
|
1937
|
-
|
|
1928
|
+
function Kr() {
|
|
1929
|
+
C("model", () => {
|
|
1930
|
+
A("eslint.config.mjs"), A("vite.config.mts");
|
|
1931
|
+
}), C("ui", () => {
|
|
1932
|
+
A("eslint.config.mjs"), A("vite.config.ts"), A("tsconfig.app.json"), A("tsconfig.node.json");
|
|
1933
|
+
}), C("test", () => {
|
|
1934
|
+
A("eslint.config.mjs");
|
|
1935
|
+
}), C("root", () => {
|
|
1936
|
+
A(".prettierrc"), D("package.json", N(() => Nn()), () => {
|
|
1937
|
+
H("pretty"), W("@platforma-sdk/blocks-deps-updater");
|
|
1938
1938
|
});
|
|
1939
1939
|
});
|
|
1940
1940
|
}
|
|
1941
1941
|
//#endregion
|
|
1942
1942
|
//#region src/structure/rules/root-catalog-bump.ts
|
|
1943
|
-
function
|
|
1943
|
+
function qr() {
|
|
1944
1944
|
Ye(() => {
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1945
|
+
C("root", () => {
|
|
1946
|
+
w(({ ctx: e }) => !e.isSdkInternal, () => {
|
|
1947
|
+
D("pnpm-workspace.yaml", N((e) => or(e)), (e) => {
|
|
1948
1948
|
for (let e of Z) Vt(e);
|
|
1949
|
-
for (let e of
|
|
1949
|
+
for (let e of rr) Ht(e.entry, {
|
|
1950
1950
|
of: e.of,
|
|
1951
1951
|
ofVersion: e.ofVersion
|
|
1952
1952
|
});
|
|
1953
|
-
for (let [e, t] of Object.entries(
|
|
1954
|
-
e.modules.some((e) => e.scope === "software") && Bt(
|
|
1953
|
+
for (let [e, t] of Object.entries(nr)) Bt(e, t);
|
|
1954
|
+
e.modules.some((e) => e.scope === "software") && Bt(ir, ar);
|
|
1955
1955
|
});
|
|
1956
1956
|
});
|
|
1957
1957
|
});
|
|
@@ -1959,24 +1959,24 @@ function Kr() {
|
|
|
1959
1959
|
}
|
|
1960
1960
|
//#endregion
|
|
1961
1961
|
//#region src/structure/structure-definition.ts
|
|
1962
|
-
var
|
|
1963
|
-
|
|
1962
|
+
var Jr = He(() => {
|
|
1963
|
+
ur(), fr(), Tr(), Or(), jr(), Pr(), Lr(), Gr(), Kr(), qr();
|
|
1964
1964
|
});
|
|
1965
1965
|
//#endregion
|
|
1966
1966
|
//#region src/structure/cli/run-structure.ts
|
|
1967
|
-
async function
|
|
1967
|
+
async function Yr() {
|
|
1968
1968
|
return Xn(Z.filter(Yn));
|
|
1969
1969
|
}
|
|
1970
|
-
async function
|
|
1971
|
-
let t = h.resolve(e.blockPath), n = e.mode === "check", r = new Ee(t), i = new De(e.templatesRoot), a = fn(
|
|
1970
|
+
async function Xr(e) {
|
|
1971
|
+
let t = h.resolve(e.blockPath), n = e.mode === "check", r = new Ee(t), i = new De(e.templatesRoot), a = fn(Jr, r, An({
|
|
1972
1972
|
fs: r,
|
|
1973
1973
|
isSdkInternal: e.isSdkInternal,
|
|
1974
1974
|
updateDepsOnly: e.updateDepsOnly,
|
|
1975
1975
|
dryRun: n
|
|
1976
1976
|
}), {
|
|
1977
1977
|
templates: i,
|
|
1978
|
-
registryLookup: e.updateDepsOnly ? await
|
|
1979
|
-
derivedPinLookup: e.updateDepsOnly ? await Qn(
|
|
1978
|
+
registryLookup: e.updateDepsOnly ? await Yr() : void 0,
|
|
1979
|
+
derivedPinLookup: e.updateDepsOnly ? await Qn(rr) : void 0,
|
|
1980
1980
|
rediscover: () => An({
|
|
1981
1981
|
fs: r,
|
|
1982
1982
|
isSdkInternal: e.isSdkInternal,
|
|
@@ -1989,16 +1989,16 @@ async function Yr(e) {
|
|
|
1989
1989
|
changes: a.changes
|
|
1990
1990
|
};
|
|
1991
1991
|
}
|
|
1992
|
-
function
|
|
1992
|
+
function Zr(e, t) {
|
|
1993
1993
|
if (t.length === 0) return ` ${e}: up to date (0 changes)`;
|
|
1994
1994
|
let n = t.map((e) => ` ${e.action.padEnd(6)} ${e.primitive.padEnd(8)} ${e.path} [${e.scope}]`);
|
|
1995
1995
|
return ` ${e}: ${t.length} change(s)\n${n.join("\n")}`;
|
|
1996
1996
|
}
|
|
1997
1997
|
//#endregion
|
|
1998
1998
|
//#region src/cmd/structure/refresh.ts
|
|
1999
|
-
async function
|
|
1999
|
+
async function Qr(e) {
|
|
2000
2000
|
for (let t of e.paths) {
|
|
2001
|
-
let n = await
|
|
2001
|
+
let n = await Xr({
|
|
2002
2002
|
blockPath: t,
|
|
2003
2003
|
isSdkInternal: e.isSdkInternal,
|
|
2004
2004
|
updateDepsOnly: e.updateDepsOnly,
|
|
@@ -2006,14 +2006,14 @@ async function Zr(e) {
|
|
|
2006
2006
|
templatesRoot: e.templatesRoot,
|
|
2007
2007
|
log: (t) => e.logger.info(t)
|
|
2008
2008
|
});
|
|
2009
|
-
e.logger.info(
|
|
2009
|
+
e.logger.info(Zr(t, n.changes));
|
|
2010
2010
|
}
|
|
2011
2011
|
}
|
|
2012
|
-
function
|
|
2012
|
+
function $r(e) {
|
|
2013
2013
|
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 fires only catalog-bump rules (network).");
|
|
2014
2014
|
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", "fire ONLY catalog-bump rules (npm network). Follow with `pnpm install` then a plain refresh."), t.action(async (t, n) => {
|
|
2015
2015
|
let r = t.length > 0 ? t : ["."], i = h.join(e, "src", "structure", "templates");
|
|
2016
|
-
await
|
|
2016
|
+
await Qr({
|
|
2017
2017
|
paths: r,
|
|
2018
2018
|
isSdkInternal: !!n.sdkInternal,
|
|
2019
2019
|
updateDepsOnly: !!n.updateDepsOnly,
|
|
@@ -2024,11 +2024,11 @@ function Qr(e) {
|
|
|
2024
2024
|
}
|
|
2025
2025
|
//#endregion
|
|
2026
2026
|
//#region src/cmd/update-deps.ts
|
|
2027
|
-
function
|
|
2027
|
+
function ei(e) {
|
|
2028
2028
|
let t = new p("update-deps").description("[DEPRECATED] Use `block-tools structure refresh --update-deps-only`. This alias delegates to it.");
|
|
2029
2029
|
return t.action(async () => {
|
|
2030
2030
|
let t = new _();
|
|
2031
|
-
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
|
|
2031
|
+
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 Qr({
|
|
2032
2032
|
paths: ["."],
|
|
2033
2033
|
isSdkInternal: !1,
|
|
2034
2034
|
updateDepsOnly: !0,
|
|
@@ -2039,7 +2039,7 @@ function $r(e) {
|
|
|
2039
2039
|
}
|
|
2040
2040
|
//#endregion
|
|
2041
2041
|
//#region src/cmd/list-overview-snapshots.ts
|
|
2042
|
-
function
|
|
2042
|
+
function ti() {
|
|
2043
2043
|
let e = new p("list-overview-snapshots").description("List all available global overview snapshots in the registry");
|
|
2044
2044
|
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) => {
|
|
2045
2045
|
let t = new _(), n = await new s(o(e.registry), t).listGlobalOverviewSnapshots();
|
|
@@ -2053,7 +2053,7 @@ function ei() {
|
|
|
2053
2053
|
}
|
|
2054
2054
|
//#endregion
|
|
2055
2055
|
//#region src/cmd/restore-overview-from-snapshot.ts
|
|
2056
|
-
function
|
|
2056
|
+
function ni() {
|
|
2057
2057
|
let e = new p("restore-overview-from-snapshot").description("Restore global overview from a snapshot");
|
|
2058
2058
|
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) => {
|
|
2059
2059
|
let t = new _(), n = new s(o(e.registry), t), r = await n.listGlobalOverviewSnapshots();
|
|
@@ -2079,7 +2079,7 @@ function ti() {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
//#endregion
|
|
2081
2081
|
//#region src/registry_v1/flags.ts
|
|
2082
|
-
function
|
|
2082
|
+
function ri(e) {
|
|
2083
2083
|
let t = e.match(/(?<destName>[^/\\]+)=(?<src>.*)/);
|
|
2084
2084
|
if (t) {
|
|
2085
2085
|
let { src: e, destName: n } = t.groups;
|
|
@@ -2092,22 +2092,22 @@ function ni(e) {
|
|
|
2092
2092
|
destName: h.basename(e)
|
|
2093
2093
|
};
|
|
2094
2094
|
}
|
|
2095
|
-
function
|
|
2096
|
-
return new m(e, t).argParser((e, t) => [...t ?? [],
|
|
2095
|
+
function ii(e, t) {
|
|
2096
|
+
return new m(e, t).argParser((e, t) => [...t ?? [], ri(e)]).default([]);
|
|
2097
2097
|
}
|
|
2098
2098
|
//#endregion
|
|
2099
2099
|
//#region src/cmd/upload-package-v1.ts
|
|
2100
|
-
var
|
|
2100
|
+
var ai = [
|
|
2101
2101
|
"registry",
|
|
2102
2102
|
"organization",
|
|
2103
2103
|
"package",
|
|
2104
2104
|
"version"
|
|
2105
2105
|
];
|
|
2106
|
-
function
|
|
2106
|
+
function oi() {
|
|
2107
2107
|
let e = new p("upload-package-v1").description("Uploads V1 package and refreshes the registry");
|
|
2108
|
-
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(
|
|
2108
|
+
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(ii("-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) => {
|
|
2109
2109
|
let t = new _(), n = l.parse({});
|
|
2110
|
-
for (let t of
|
|
2110
|
+
for (let t of ai) e[t] && (n[t] = e[t]);
|
|
2111
2111
|
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 = ie.parse(await g.promises.readFile(e.meta, { encoding: "utf-8" }))));
|
|
2112
2112
|
for (let t of e.file) n.files[t.destName] = t.src;
|
|
2113
2113
|
let r = await c(n);
|
|
@@ -2123,12 +2123,12 @@ function ai() {
|
|
|
2123
2123
|
}
|
|
2124
2124
|
//#endregion
|
|
2125
2125
|
//#region src/cmd/structure/check.ts
|
|
2126
|
-
function
|
|
2126
|
+
function si(e) {
|
|
2127
2127
|
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.");
|
|
2128
2128
|
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) => {
|
|
2129
2129
|
let r = new _(), i = t.length > 0 ? t : ["."], a = h.join(e, "src", "structure", "templates"), o = !1;
|
|
2130
2130
|
for (let e of i) {
|
|
2131
|
-
let t = await
|
|
2131
|
+
let t = await Xr({
|
|
2132
2132
|
blockPath: e,
|
|
2133
2133
|
isSdkInternal: !!n.sdkInternal,
|
|
2134
2134
|
updateDepsOnly: !1,
|
|
@@ -2136,35 +2136,35 @@ function oi(e) {
|
|
|
2136
2136
|
templatesRoot: a,
|
|
2137
2137
|
log: (e) => r.info(e)
|
|
2138
2138
|
});
|
|
2139
|
-
r.info(
|
|
2139
|
+
r.info(Zr(e, t.changes)), t.changes.length > 0 && (o = !0);
|
|
2140
2140
|
}
|
|
2141
2141
|
if (o) throw Error("Structure check failed: one or more blocks are out of date. Run `structure refresh`.");
|
|
2142
2142
|
}), t;
|
|
2143
2143
|
}
|
|
2144
2144
|
//#endregion
|
|
2145
2145
|
//#region src/structure/init-block-constructor.ts
|
|
2146
|
-
var $ = ["python"],
|
|
2146
|
+
var $ = ["python"], ci = class extends Error {
|
|
2147
2147
|
constructor(e) {
|
|
2148
2148
|
super(`Missing required flag --${e} in --non-interactive mode. Supply every BlockVars flag, or drop --non-interactive to be prompted.`), this.name = "InitFlagError";
|
|
2149
2149
|
}
|
|
2150
2150
|
};
|
|
2151
|
-
async function
|
|
2151
|
+
async function li(e, t, n, r) {
|
|
2152
2152
|
if (e !== void 0 && e !== "") return e;
|
|
2153
|
-
if (n) throw new
|
|
2153
|
+
if (n) throw new ci(t);
|
|
2154
2154
|
return r();
|
|
2155
2155
|
}
|
|
2156
|
-
async function
|
|
2157
|
-
let t = await
|
|
2156
|
+
async function ui(e) {
|
|
2157
|
+
let t = await li(e.npmOrg, "npm-org", e.nonInteractive, () => de({
|
|
2158
2158
|
message: "npm org (e.g. @platforma-open):",
|
|
2159
2159
|
default: "@platforma-open"
|
|
2160
|
-
})), n = await
|
|
2160
|
+
})), n = await li(e.orgScope, "org-scope", e.nonInteractive, () => de({ message: "org scope (e.g. my-org):" })), r = await li(e.shortName, "short-name", e.nonInteractive, () => de({ message: "block short name (e.g. mixcr-clonotyping):" })), i;
|
|
2161
2161
|
i = e.withSoftware === void 0 ? e.nonInteractive ? !1 : await ue({
|
|
2162
2162
|
message: "Include a software module?",
|
|
2163
2163
|
default: !1
|
|
2164
2164
|
}) : e.withSoftware;
|
|
2165
2165
|
let a;
|
|
2166
2166
|
if (i) {
|
|
2167
|
-
if (a = await
|
|
2167
|
+
if (a = await li(e.platform, "platform", e.nonInteractive, () => fe({
|
|
2168
2168
|
message: "Software platform:",
|
|
2169
2169
|
choices: $.map((e) => ({
|
|
2170
2170
|
name: e,
|
|
@@ -2181,7 +2181,7 @@ async function li(e) {
|
|
|
2181
2181
|
softwarePlatform: a
|
|
2182
2182
|
};
|
|
2183
2183
|
}
|
|
2184
|
-
async function
|
|
2184
|
+
async function di(e) {
|
|
2185
2185
|
let t = e.vars, n = Sn(t), r = new Ee(e.blockPath), i = new De(e.templatesRoot), a = Cn({
|
|
2186
2186
|
blockVars: t,
|
|
2187
2187
|
modules: n,
|
|
@@ -2190,11 +2190,11 @@ async function ui(e) {
|
|
|
2190
2190
|
dryRun: !1
|
|
2191
2191
|
}), o = Z.filter(Yn), s, c;
|
|
2192
2192
|
try {
|
|
2193
|
-
s = await Xn(o), c = await Qn(
|
|
2193
|
+
s = await Xn(o), c = await Qn(rr);
|
|
2194
2194
|
} catch (e) {
|
|
2195
2195
|
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)}`);
|
|
2196
2196
|
}
|
|
2197
|
-
return fn(
|
|
2197
|
+
return fn(Jr, r, a, {
|
|
2198
2198
|
templates: i,
|
|
2199
2199
|
initMode: !0,
|
|
2200
2200
|
registryLookup: s,
|
|
@@ -2203,12 +2203,12 @@ async function ui(e) {
|
|
|
2203
2203
|
}
|
|
2204
2204
|
//#endregion
|
|
2205
2205
|
//#region src/cmd/structure/init.ts
|
|
2206
|
-
function
|
|
2206
|
+
function fi(e) {
|
|
2207
2207
|
let t = new p("init").description("Scaffold a fresh Platforma block from the canonical structure. Missing flags are prompted unless --non-interactive.");
|
|
2208
2208
|
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([...$])), t.option("--non-interactive", "error on any missing flag instead of prompting"), t.action(async (t, n) => {
|
|
2209
2209
|
let r = new _(), i = n.withSoftware === !0, a = n.software === !1;
|
|
2210
2210
|
if (i && a) throw Error("--with-software and --no-software are mutually exclusive.");
|
|
2211
|
-
let o = i ? !0 : a ? !1 : void 0, s = await
|
|
2211
|
+
let o = i ? !0 : a ? !1 : void 0, s = await ui({
|
|
2212
2212
|
npmOrg: n.npmOrg,
|
|
2213
2213
|
orgScope: n.orgScope,
|
|
2214
2214
|
shortName: n.shortName,
|
|
@@ -2216,7 +2216,7 @@ function di(e) {
|
|
|
2216
2216
|
platform: n.platform,
|
|
2217
2217
|
nonInteractive: n.nonInteractive
|
|
2218
2218
|
});
|
|
2219
|
-
await
|
|
2219
|
+
await di({
|
|
2220
2220
|
vars: s,
|
|
2221
2221
|
blockPath: t ? h.resolve(t) : h.resolve(process.cwd(), s.shortName),
|
|
2222
2222
|
templatesRoot: h.join(e, "src", "structure", "templates"),
|
|
@@ -2226,15 +2226,15 @@ function di(e) {
|
|
|
2226
2226
|
}
|
|
2227
2227
|
//#endregion
|
|
2228
2228
|
//#region src/cmd/software/knobs.ts
|
|
2229
|
-
var
|
|
2229
|
+
var pi = ["dev", "release"], mi = [
|
|
2230
2230
|
"docker",
|
|
2231
2231
|
"binary",
|
|
2232
2232
|
"all",
|
|
2233
2233
|
"none"
|
|
2234
|
-
],
|
|
2235
|
-
function
|
|
2234
|
+
], hi = ["local", "remote"];
|
|
2235
|
+
function gi(e) {
|
|
2236
2236
|
if (e.usePublished) {
|
|
2237
|
-
if (e.variant === "docker" || e.variant === "all") throw
|
|
2237
|
+
if (e.variant === "docker" || e.variant === "all") throw b.CLIError(`--use-published is binary-only and cannot be combined with --variant ${e.variant}`);
|
|
2238
2238
|
return { kind: "binary-existing" };
|
|
2239
2239
|
}
|
|
2240
2240
|
return e.variant === "none" ? { kind: "no-software" } : e.location === void 0 ? { kind: "bare" } : {
|
|
@@ -2246,31 +2246,31 @@ function hi(e) {
|
|
|
2246
2246
|
}
|
|
2247
2247
|
//#endregion
|
|
2248
2248
|
//#region src/cmd/software/ecr-login.ts
|
|
2249
|
-
var
|
|
2250
|
-
function
|
|
2249
|
+
var _i = "public.ecr.aws", vi = "us-east-1";
|
|
2250
|
+
function yi(e) {
|
|
2251
2251
|
if (process.env.AWS_ACCESS_KEY_ID || process.env.AWS_PROFILE) return;
|
|
2252
|
-
let t = process.env.PL_AWS_PROFILE ??
|
|
2252
|
+
let t = process.env.PL_AWS_PROFILE ?? v.AWS_DEV_PROFILE;
|
|
2253
2253
|
process.env.AWS_PROFILE = t, e?.debug(`Using AWS profile '${t}' for dev push credentials`);
|
|
2254
2254
|
}
|
|
2255
|
-
function
|
|
2255
|
+
function bi(e) {
|
|
2256
2256
|
return new URL(`https://${e}`).hostname;
|
|
2257
2257
|
}
|
|
2258
|
-
function
|
|
2259
|
-
return ` aws sso login --profile ${process.env.AWS_PROFILE ?? process.env.PL_AWS_PROFILE ??
|
|
2258
|
+
function xi() {
|
|
2259
|
+
return ` aws sso login --profile ${process.env.AWS_PROFILE ?? process.env.PL_AWS_PROFILE ?? v.AWS_DEV_PROFILE}`;
|
|
2260
2260
|
}
|
|
2261
|
-
async function
|
|
2262
|
-
let n =
|
|
2263
|
-
if (n !==
|
|
2261
|
+
async function Si(e, t) {
|
|
2262
|
+
let n = bi(e);
|
|
2263
|
+
if (n !== _i) throw b.CLIError(`automatic docker login is only supported for '${_i}', not '${n}'.\nLog in manually, or drop the ecr:// scheme from the push target to opt out.`);
|
|
2264
2264
|
t?.info(`Logging in to ECR registry '${n}'...`);
|
|
2265
2265
|
let r, i;
|
|
2266
2266
|
try {
|
|
2267
|
-
let e = (await new ge({ region:
|
|
2267
|
+
let e = (await new ge({ region: vi }).send(new _e({}))).authorizationData?.authorizationToken;
|
|
2268
2268
|
if (!e) throw Error("empty authorization token");
|
|
2269
2269
|
let t = Buffer.from(e, "base64").toString("utf8"), n = t.indexOf(":");
|
|
2270
2270
|
if (n < 0) throw Error("malformed authorization token (no ':' separator)");
|
|
2271
2271
|
r = t.slice(0, n), i = t.slice(n + 1);
|
|
2272
2272
|
} catch (e) {
|
|
2273
|
-
throw
|
|
2273
|
+
throw b.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` + xi());
|
|
2274
2274
|
}
|
|
2275
2275
|
let a = he("docker", [
|
|
2276
2276
|
"login",
|
|
@@ -2290,13 +2290,13 @@ async function xi(e, t) {
|
|
|
2290
2290
|
HOME: process.env.HOME || le.homedir()
|
|
2291
2291
|
}
|
|
2292
2292
|
});
|
|
2293
|
-
if (a.error || a.status !== 0) throw
|
|
2293
|
+
if (a.error || a.status !== 0) throw b.CLIError(`'docker login ${n}' failed`);
|
|
2294
2294
|
}
|
|
2295
2295
|
//#endregion
|
|
2296
2296
|
//#region src/cmd/software/run-build.ts
|
|
2297
|
-
async function
|
|
2297
|
+
async function Ci(e) {
|
|
2298
2298
|
let { core: t, scenario: n, options: r = {}, logger: i } = e, a = r.ids;
|
|
2299
|
-
t.buildMode =
|
|
2299
|
+
t.buildMode = wi(n);
|
|
2300
2300
|
let o = () => t.buildSoftwareArchives({
|
|
2301
2301
|
ids: a,
|
|
2302
2302
|
forceBuild: !!r.force,
|
|
@@ -2313,94 +2313,99 @@ async function Si(e) {
|
|
|
2313
2313
|
r.buildDocker && t.buildDockerImages({
|
|
2314
2314
|
ids: a,
|
|
2315
2315
|
registry: r.dockerRegistry,
|
|
2316
|
-
strictPlatformMatching:
|
|
2316
|
+
strictPlatformMatching: y.isCI()
|
|
2317
2317
|
}), await o(), r.pushDocker && t.publishDockerImages({
|
|
2318
2318
|
ids: a,
|
|
2319
2319
|
pushTo: r.dockerPushTo,
|
|
2320
|
-
strictPlatformMatching:
|
|
2320
|
+
strictPlatformMatching: y.isCI()
|
|
2321
2321
|
});
|
|
2322
2322
|
break;
|
|
2323
2323
|
case "target": {
|
|
2324
|
-
let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f =
|
|
2324
|
+
let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f = Di(e, r);
|
|
2325
2325
|
l && t.buildDockerImages({
|
|
2326
2326
|
ids: a,
|
|
2327
2327
|
registry: f.pull,
|
|
2328
|
-
strictPlatformMatching:
|
|
2329
|
-
}), u && await o(), d && e === "dev" && (l || u) &&
|
|
2328
|
+
strictPlatformMatching: y.isCI()
|
|
2329
|
+
}), u && await o(), d && e === "dev" && (l || u) && yi(i), l && d && (f.autoLogin && f.push && await Si(f.push, i), t.publishDockerImages({
|
|
2330
2330
|
ids: a,
|
|
2331
2331
|
pushTo: f.push,
|
|
2332
|
-
strictPlatformMatching:
|
|
2332
|
+
strictPlatformMatching: y.isCI()
|
|
2333
2333
|
})), u && d && await t.publishPackages({
|
|
2334
2334
|
ids: a,
|
|
2335
2335
|
storageURL: r.storageUrl
|
|
2336
2336
|
});
|
|
2337
2337
|
break;
|
|
2338
2338
|
}
|
|
2339
|
-
default:
|
|
2339
|
+
default: b.assertNever(n);
|
|
2340
2340
|
}
|
|
2341
2341
|
t.buildSwJsonFiles({
|
|
2342
2342
|
packageIds: a,
|
|
2343
2343
|
noSoftware: n.kind === "no-software"
|
|
2344
2344
|
});
|
|
2345
2345
|
}
|
|
2346
|
-
function
|
|
2346
|
+
function wi(e) {
|
|
2347
2347
|
return e.kind !== "target" || e.channel === "release" ? "release" : e.variant !== "docker" && e.location === "remote" ? "dev-remote" : "dev-local";
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2349
|
+
function Ti(e) {
|
|
2350
2350
|
if (!e.includes("://")) return e;
|
|
2351
2351
|
let t = new URL(e);
|
|
2352
2352
|
return t.host + t.pathname;
|
|
2353
2353
|
}
|
|
2354
|
-
function
|
|
2354
|
+
function Ei(e) {
|
|
2355
2355
|
return {
|
|
2356
|
-
registry:
|
|
2356
|
+
registry: Ti(e),
|
|
2357
2357
|
autoLogin: e.startsWith("ecr://")
|
|
2358
2358
|
};
|
|
2359
2359
|
}
|
|
2360
|
-
function
|
|
2361
|
-
let n = e === "dev", r = process.env[n ?
|
|
2360
|
+
function Di(e, t) {
|
|
2361
|
+
let n = e === "dev", r = process.env[n ? y.PL_DEV_DOCKER_PUSH_URL : y.PL_RELEASE_DOCKER_PUSH_URL], i = process.env[n ? y.PL_DEV_DOCKER_PULL_URL : y.PL_RELEASE_DOCKER_PULL_URL], a = t.dockerPushTo ?? r ?? (n ? v.DEV_DOCKER_PUSH_TARGET : void 0), o = a ? Ei(a) : {
|
|
2362
2362
|
registry: void 0,
|
|
2363
2363
|
autoLogin: !1
|
|
2364
|
-
}, s = t.dockerRegistry ?? i ?? (n ? a :
|
|
2364
|
+
}, s = t.dockerRegistry ?? i ?? (n ? a : v.DOCKER_REGISTRY);
|
|
2365
2365
|
return {
|
|
2366
|
-
pull: s ?
|
|
2366
|
+
pull: s ? Ti(s) : void 0,
|
|
2367
2367
|
push: o.registry,
|
|
2368
2368
|
autoLogin: o.autoLogin
|
|
2369
2369
|
};
|
|
2370
2370
|
}
|
|
2371
2371
|
//#endregion
|
|
2372
2372
|
//#region src/cmd/software/env.ts
|
|
2373
|
-
var
|
|
2374
|
-
|
|
2373
|
+
var Oi = "PL_BUILD_CHANNEL", ki = "PL_BUILD_VARIANT", Ai = "PL_BUILD_LOCATION", ji = "PL_BUILD_USE_PUBLISHED";
|
|
2374
|
+
y.PL_DOCKER_REGISTRY_PUSH_TO, y.PL_DEV_DOCKER_PUSH_URL, y.PL_DEV_DOCKER_PULL_URL, y.PL_DEV_BINARY_UPLOAD_URL, y.PL_RELEASE_DOCKER_PUSH_URL, y.PL_RELEASE_DOCKER_PULL_URL, y.PL_RELEASE_BINARY_UPLOAD_URL;
|
|
2375
2375
|
//#endregion
|
|
2376
2376
|
//#region src/cmd/software/build.ts
|
|
2377
|
-
function
|
|
2377
|
+
function Mi() {
|
|
2378
2378
|
let e = new p("build").description("Build a software module for a target and write its .sw.json descriptor (build + push in one pass)");
|
|
2379
|
-
return e.addOption(new m("--channel <channel>", "registry channel to build for").choices([...
|
|
2379
|
+
return e.addOption(new m("--channel <channel>", "registry channel to build for").choices([...pi]).env(Oi)), e.addOption(new m("--variant <variant>", "artifact kind to build (default: all declared)").choices([...mi]).env(ki)), e.addOption(new m("--location <location>", "where the artifact lands (local = no push)").choices([...hi]).env(Ai)), e.addOption(new m("--use-published", "do not build or push; emit a descriptor pointing at the already-published release artifact").env(ji)), e.addOption(new m("--log-level <level>", "logging level").choices([
|
|
2380
2380
|
"error",
|
|
2381
2381
|
"warn",
|
|
2382
2382
|
"info",
|
|
2383
2383
|
"debug"
|
|
2384
|
-
]).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([...
|
|
2385
|
-
let t =
|
|
2384
|
+
]).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([...b.AllPlatforms]).env(y.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(y.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(y.PL_PKG_CONTENT_ROOT)), e.addOption(new m("--storage-url <url>", "override binary upload registry URL").env(y.PL_PKG_STORAGE_URL)), e.addOption(new m("--docker-registry <registry>", "docker pull registry embedded in the descriptor").env(y.PL_DOCKER_REGISTRY)), e.addOption(new m("--docker-push-to <registry>", "alternative registry for docker push").env(y.PL_DOCKER_REGISTRY_PUSH_TO)), e.addOption(new m("--docker-build", "build docker images").env(y.PL_DOCKER_BUILD).default(!1)), e.addOption(new m("--docker-no-build", "do not build docker images").env(y.PL_DOCKER_NO_BUILD).default(!1)), e.addOption(new m("--docker-autopush", "push docker images after build").env(y.PL_DOCKER_AUTOPUSH).default(!1)), e.addOption(new m("--docker-no-autopush", "do not push docker images").env(y.PL_DOCKER_NO_AUTOPUSH).default(!1)), e.addOption(new m("--conda-build", "build conda environment before packing").env(y.PL_CONDA_BUILD).default(!1)), e.addOption(new m("--conda-no-build", "do not build conda environment").env(y.PL_CONDA_NO_BUILD).default(!1)), e.action(async (e) => {
|
|
2385
|
+
let t = b.createLogger(e.logLevel);
|
|
2386
2386
|
try {
|
|
2387
|
-
let n =
|
|
2387
|
+
let n = gi({
|
|
2388
2388
|
channel: e.channel,
|
|
2389
2389
|
variant: e.variant,
|
|
2390
2390
|
location: e.location,
|
|
2391
2391
|
usePublished: !!e.usePublished
|
|
2392
|
-
}), r =
|
|
2392
|
+
}), r = me(t, { packageRoot: e.packageRoot });
|
|
2393
2393
|
r.version = e.version, r.targetPlatform = e.platform, r.allPlatforms = !!e.allPlatforms, r.fullDirHash = !!e.fullDirHash;
|
|
2394
|
-
let i =
|
|
2395
|
-
default:
|
|
2394
|
+
let i = b.shouldDoAction({
|
|
2395
|
+
default: y.isCI(),
|
|
2396
2396
|
enable: e.dockerBuild,
|
|
2397
2397
|
disable: e.dockerNoBuild
|
|
2398
|
-
}), a = i &&
|
|
2399
|
-
default:
|
|
2398
|
+
}), a = i && b.shouldDoAction({
|
|
2399
|
+
default: y.isCI() && !r.isPrivate,
|
|
2400
2400
|
enable: e.dockerAutopush,
|
|
2401
2401
|
disable: e.dockerNoAutopush
|
|
2402
2402
|
});
|
|
2403
|
-
|
|
2403
|
+
n.kind === "bare" && pe({
|
|
2404
|
+
buildDocker: i,
|
|
2405
|
+
pushDocker: a,
|
|
2406
|
+
pushDisabledExplicitly: !!e.dockerNoAutopush,
|
|
2407
|
+
dockerPackageCount: r.selectedDockerPackages(e.packageId).length
|
|
2408
|
+
}), await Ci({
|
|
2404
2409
|
core: r,
|
|
2405
2410
|
scenario: n,
|
|
2406
2411
|
logger: t,
|
|
@@ -2413,7 +2418,7 @@ function ji() {
|
|
|
2413
2418
|
dockerPushTo: e.dockerPushTo,
|
|
2414
2419
|
buildDocker: i,
|
|
2415
2420
|
pushDocker: a,
|
|
2416
|
-
condaBuild:
|
|
2421
|
+
condaBuild: b.shouldDoAction({
|
|
2417
2422
|
default: !0,
|
|
2418
2423
|
enable: e.condaBuild,
|
|
2419
2424
|
disable: e.condaNoBuild
|
|
@@ -2427,22 +2432,22 @@ function ji() {
|
|
|
2427
2432
|
}
|
|
2428
2433
|
//#endregion
|
|
2429
2434
|
//#region src/cmd/software/index.ts
|
|
2430
|
-
function
|
|
2435
|
+
function Ni() {
|
|
2431
2436
|
let e = new p("software").description("Build and publish a block's software modules");
|
|
2432
|
-
return e.addCommand(
|
|
2437
|
+
return e.addCommand(Mi()), e;
|
|
2433
2438
|
}
|
|
2434
2439
|
//#endregion
|
|
2435
2440
|
//#region src/cli.ts
|
|
2436
|
-
function
|
|
2441
|
+
function Pi(e = process.cwd()) {
|
|
2437
2442
|
let t = new p();
|
|
2438
|
-
t.name("block-tools").description("Utility to manipulate Platforma Blocks and Block Registry"), t.addCommand(ve()), t.addCommand(be()), t.addCommand(xe()), t.addCommand(Ce()), t.addCommand(we()), t.addCommand(Te()), t.addCommand(
|
|
2443
|
+
t.name("block-tools").description("Utility to manipulate Platforma Blocks and Block Registry"), t.addCommand(ve()), t.addCommand(be()), t.addCommand(xe()), t.addCommand(Ce()), t.addCommand(we()), t.addCommand(Te()), t.addCommand(ei(e)), t.addCommand(ti()), t.addCommand(ni()), t.addCommand(oi()), t.addCommand(Ni());
|
|
2439
2444
|
let n = new p("structure").description("Manage block scaffolding against the canonical structure (check / init / refresh)");
|
|
2440
|
-
return n.addCommand(
|
|
2445
|
+
return n.addCommand(si(e)), n.addCommand(fi(e)), n.addCommand($r(e)), t.addCommand(n), t;
|
|
2441
2446
|
}
|
|
2442
|
-
async function
|
|
2443
|
-
await
|
|
2447
|
+
async function Fi(e, t) {
|
|
2448
|
+
await Pi(t).parseAsync(e);
|
|
2444
2449
|
}
|
|
2445
2450
|
//#endregion
|
|
2446
|
-
export {
|
|
2451
|
+
export { Pi as buildProgram, Fi as run };
|
|
2447
2452
|
|
|
2448
2453
|
//# sourceMappingURL=cli.mjs.map
|