@platforma-sdk/block-tools 2.19.1 → 2.19.2
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 +6 -6
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +139 -138
- package/dist/cli.mjs.map +1 -1
- package/package.json +2 -2
- package/src/structure/__tests__/facade-end-state.test.ts +2 -0
- package/src/structure/rules/block-package-json.ts +10 -3
- package/src/structure/rules/block.ts +8 -0
package/dist/cli.mjs
CHANGED
|
@@ -1709,8 +1709,8 @@ var ni = {
|
|
|
1709
1709
|
sources: "./src/index.ts",
|
|
1710
1710
|
types: "./dist/index.d.ts",
|
|
1711
1711
|
default: "./dist/index.js"
|
|
1712
|
-
} };
|
|
1713
|
-
function
|
|
1712
|
+
} }, ii = "file:CHANGELOG.md";
|
|
1713
|
+
function ai(e) {
|
|
1714
1714
|
if (Object.keys(e.components).length === 0) throw Error("block.components is empty — no workflow/model/ui module was discovered");
|
|
1715
1715
|
let t = e.meta, n = [
|
|
1716
1716
|
["block.meta.title", t.title],
|
|
@@ -1722,7 +1722,7 @@ function ii(e) {
|
|
|
1722
1722
|
];
|
|
1723
1723
|
for (let [e, t] of n) if (typeof t != "string" || t === "") throw Error(`required block field '${e}' is empty`);
|
|
1724
1724
|
}
|
|
1725
|
-
function
|
|
1725
|
+
function oi(e) {
|
|
1726
1726
|
let t = e.blockVars, n = {
|
|
1727
1727
|
...ni,
|
|
1728
1728
|
...J(e, "model"),
|
|
@@ -1735,6 +1735,7 @@ function ai(e) {
|
|
|
1735
1735
|
title: t.shortName,
|
|
1736
1736
|
description: `${t.shortName} block`,
|
|
1737
1737
|
logo: "file:logos/block-logo.png",
|
|
1738
|
+
changelog: ii,
|
|
1738
1739
|
organization: {
|
|
1739
1740
|
name: t.orgScope,
|
|
1740
1741
|
url: "https://example.com",
|
|
@@ -1742,7 +1743,7 @@ function ai(e) {
|
|
|
1742
1743
|
}
|
|
1743
1744
|
}
|
|
1744
1745
|
};
|
|
1745
|
-
return
|
|
1746
|
+
return ai(r), {
|
|
1746
1747
|
name: `${t.facadeName}.block`,
|
|
1747
1748
|
version: Z,
|
|
1748
1749
|
type: "module",
|
|
@@ -1757,34 +1758,34 @@ function ai(e) {
|
|
|
1757
1758
|
block: r
|
|
1758
1759
|
};
|
|
1759
1760
|
}
|
|
1760
|
-
function
|
|
1761
|
+
function si(e) {
|
|
1761
1762
|
let t = e.blockVars, n = q(e, "kind");
|
|
1762
1763
|
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`);
|
|
1763
1764
|
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
1765
|
let r = ti(t.npmOrg, e.isSdkInternal);
|
|
1765
1766
|
for (let [e, t] of Object.entries(r)) z(e, t);
|
|
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]);
|
|
1767
|
+
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)), L("block.meta.changelog", ii), Lt("version", "facade package.json must carry a 'version' (the facade publishes)"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
1767
1768
|
}
|
|
1768
1769
|
// src/structure/rules/shared/pascal-case.ts
|
|
1769
|
-
function
|
|
1770
|
+
function ci(e) {
|
|
1770
1771
|
let t = e.split(/[^A-Za-z0-9]+/).filter((e) => e.length > 0).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
1771
1772
|
return /^[0-9]/.test(t) ? `_${t}` : t;
|
|
1772
1773
|
}
|
|
1773
1774
|
// src/structure/rules/block.ts
|
|
1774
|
-
function
|
|
1775
|
+
function li() {
|
|
1775
1776
|
x("block", () => {
|
|
1776
1777
|
O("index.js"), O("index.d.ts"), w("src/index.ts", A("block/src/index.tpl.ts", (e) => ({
|
|
1777
1778
|
facadeName: e.blockVars.facadeName,
|
|
1778
|
-
pascalName:
|
|
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) =>
|
|
1780
|
-
|
|
1779
|
+
pascalName: ci(e.blockVars.shortName)
|
|
1780
|
+
}))), 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")), E("CHANGELOG.md", j((e) => `# ${e.blockVars.facadeName}\n`)), T("package.json", j((e) => oi(e)), (e) => {
|
|
1781
|
+
si(e);
|
|
1781
1782
|
});
|
|
1782
1783
|
});
|
|
1783
1784
|
}
|
|
1784
1785
|
// src/structure/rules/shared/colocated-tests.ts
|
|
1785
|
-
var $ = "src/**/*.test.ts",
|
|
1786
|
+
var $ = "src/**/*.test.ts", ui = "src/**/*.test.tengo";
|
|
1786
1787
|
// src/structure/rules/model-package-json.ts
|
|
1787
|
-
function
|
|
1788
|
+
function di(e) {
|
|
1788
1789
|
return {
|
|
1789
1790
|
name: `${e.blockVars.facadeName}.model`,
|
|
1790
1791
|
version: Z,
|
|
@@ -1822,7 +1823,7 @@ function ui(e) {
|
|
|
1822
1823
|
}
|
|
1823
1824
|
};
|
|
1824
1825
|
}
|
|
1825
|
-
function
|
|
1826
|
+
function fi() {
|
|
1826
1827
|
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", {
|
|
1827
1828
|
".": {
|
|
1828
1829
|
types: "./dist/index.d.ts",
|
|
@@ -1842,22 +1843,22 @@ function di() {
|
|
|
1842
1843
|
}, () => H("vitest"))), Cr(), R("tsup"), B("lint"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
1843
1844
|
}
|
|
1844
1845
|
// src/structure/rules/model.ts
|
|
1845
|
-
function
|
|
1846
|
+
function pi() {
|
|
1846
1847
|
x("model", () => {
|
|
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) =>
|
|
1848
|
-
|
|
1848
|
+
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) => di(e)), () => {
|
|
1849
|
+
fi();
|
|
1849
1850
|
});
|
|
1850
1851
|
});
|
|
1851
1852
|
}
|
|
1852
1853
|
// src/structure/rules/kind-package-json.ts
|
|
1853
|
-
var
|
|
1854
|
+
var mi = { ".": {
|
|
1854
1855
|
types: "./dist/index.d.ts",
|
|
1855
1856
|
sources: "./src/index.ts",
|
|
1856
1857
|
import: "./dist/index.js",
|
|
1857
1858
|
require: "./dist/index.cjs",
|
|
1858
1859
|
default: "./dist/index.js"
|
|
1859
1860
|
} };
|
|
1860
|
-
function
|
|
1861
|
+
function hi(e) {
|
|
1861
1862
|
return {
|
|
1862
1863
|
name: `${e.blockVars.facadeName}.kind`,
|
|
1863
1864
|
version: Z,
|
|
@@ -1866,7 +1867,7 @@ function mi(e) {
|
|
|
1866
1867
|
main: "./dist/index.cjs",
|
|
1867
1868
|
module: "./dist/index.js",
|
|
1868
1869
|
types: "./dist/index.d.ts",
|
|
1869
|
-
exports:
|
|
1870
|
+
exports: mi,
|
|
1870
1871
|
scripts: {
|
|
1871
1872
|
fmt: "ts-builder format",
|
|
1872
1873
|
watch: "ts-builder build --target block-kind --watch",
|
|
@@ -1885,8 +1886,8 @@ function mi(e) {
|
|
|
1885
1886
|
}
|
|
1886
1887
|
};
|
|
1887
1888
|
}
|
|
1888
|
-
function
|
|
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",
|
|
1889
|
+
function gi() {
|
|
1890
|
+
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", mi), 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({
|
|
1890
1891
|
"@milaboratories/ts-builder": "sdk:",
|
|
1891
1892
|
"@milaboratories/ts-configs": "sdk:",
|
|
1892
1893
|
"@platforma-sdk/block-tools": "sdk:"
|
|
@@ -1896,15 +1897,15 @@ function hi() {
|
|
|
1896
1897
|
}), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
1897
1898
|
}
|
|
1898
1899
|
// src/structure/rules/kind.ts
|
|
1899
|
-
function
|
|
1900
|
+
function _i() {
|
|
1900
1901
|
x("kind", () => {
|
|
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) =>
|
|
1902
|
-
|
|
1902
|
+
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) => hi(e)), () => {
|
|
1903
|
+
gi();
|
|
1903
1904
|
});
|
|
1904
1905
|
});
|
|
1905
1906
|
}
|
|
1906
1907
|
// src/structure/rules/ui-package-json.ts
|
|
1907
|
-
function
|
|
1908
|
+
function vi(e) {
|
|
1908
1909
|
return {
|
|
1909
1910
|
name: `${e.blockVars.facadeName}.ui`,
|
|
1910
1911
|
version: Z,
|
|
@@ -1932,7 +1933,7 @@ function _i(e) {
|
|
|
1932
1933
|
}
|
|
1933
1934
|
};
|
|
1934
1935
|
}
|
|
1935
|
-
function
|
|
1936
|
+
function yi() {
|
|
1936
1937
|
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({
|
|
1937
1938
|
"@milaboratories/ts-builder": "sdk:",
|
|
1938
1939
|
"@milaboratories/ts-configs": "sdk:"
|
|
@@ -1944,15 +1945,15 @@ function vi() {
|
|
|
1944
1945
|
}, () => H("vitest"))), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
1945
1946
|
}
|
|
1946
1947
|
// src/structure/rules/ui.ts
|
|
1947
|
-
function
|
|
1948
|
+
function bi() {
|
|
1948
1949
|
x("ui", () => {
|
|
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) =>
|
|
1950
|
-
|
|
1950
|
+
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) => vi(e)), () => {
|
|
1951
|
+
yi();
|
|
1951
1952
|
});
|
|
1952
1953
|
});
|
|
1953
1954
|
}
|
|
1954
1955
|
// src/structure/rules/workflow-package-json.ts
|
|
1955
|
-
function
|
|
1956
|
+
function xi(e) {
|
|
1956
1957
|
return {
|
|
1957
1958
|
name: `${e.blockVars.facadeName}.workflow`,
|
|
1958
1959
|
version: Z,
|
|
@@ -1974,11 +1975,11 @@ function bi(e) {
|
|
|
1974
1975
|
}
|
|
1975
1976
|
};
|
|
1976
1977
|
}
|
|
1977
|
-
function
|
|
1978
|
+
function Si() {
|
|
1978
1979
|
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(
|
|
1980
|
+
S(C(ui), () => z("test", "pl-tengo test && vitest run --passWithNoTests"), () => z("test", "vitest run --passWithNoTests")), U({ vitest: "catalog:" });
|
|
1980
1981
|
}, () => {
|
|
1981
|
-
S(C(
|
|
1982
|
+
S(C(ui), () => z("test", "pl-tengo test")), H("vitest");
|
|
1982
1983
|
})), Ht("@platforma-sdk/workflow-tengo", "sdk:"), Gt("software"), U({
|
|
1983
1984
|
"@platforma-sdk/tengo-builder": "sdk:",
|
|
1984
1985
|
"@platforma-sdk/test": "sdk:",
|
|
@@ -1986,19 +1987,19 @@ function xi() {
|
|
|
1986
1987
|
}), Cr(), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
1987
1988
|
}
|
|
1988
1989
|
// src/structure/rules/workflow.ts
|
|
1989
|
-
function
|
|
1990
|
+
function Ci() {
|
|
1990
1991
|
x("workflow", () => {
|
|
1991
1992
|
w("format.el", k("workflow/format.el")), S(({ ctx: e }) => !e.isSdkInternal, () => S(C($), () => {
|
|
1992
1993
|
w("tsconfig.json", k("workflow/tsconfig.json")), E("vitest.config.mts", k("workflow/vitest.config.mts"));
|
|
1993
1994
|
}, () => {
|
|
1994
1995
|
O("tsconfig.json"), O("vitest.config.mts");
|
|
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) =>
|
|
1996
|
-
|
|
1996
|
+
})), 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) => xi(e)), () => {
|
|
1997
|
+
Si();
|
|
1997
1998
|
});
|
|
1998
1999
|
});
|
|
1999
2000
|
}
|
|
2000
2001
|
// src/structure/rules/test-package-json.ts
|
|
2001
|
-
function
|
|
2002
|
+
function wi(e) {
|
|
2002
2003
|
return {
|
|
2003
2004
|
name: `${e.blockVars.facadeName}.test`,
|
|
2004
2005
|
version: Z,
|
|
@@ -2018,7 +2019,7 @@ function Ci(e) {
|
|
|
2018
2019
|
}
|
|
2019
2020
|
};
|
|
2020
2021
|
}
|
|
2021
|
-
function
|
|
2022
|
+
function Ti() {
|
|
2022
2023
|
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({
|
|
2023
2024
|
"@platforma-sdk/test": "sdk:",
|
|
2024
2025
|
"@milaboratories/ts-builder": "sdk:",
|
|
@@ -2027,16 +2028,16 @@ function wi() {
|
|
|
2027
2028
|
}), W({ typescript: "*" }), H("@types/node"), Cr(), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
|
|
2028
2029
|
}
|
|
2029
2030
|
// src/structure/rules/test.ts
|
|
2030
|
-
function
|
|
2031
|
+
function Ei() {
|
|
2031
2032
|
x("test", () => {
|
|
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) =>
|
|
2033
|
-
|
|
2033
|
+
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) => wi(e)), () => {
|
|
2034
|
+
Ti();
|
|
2034
2035
|
});
|
|
2035
2036
|
});
|
|
2036
2037
|
}
|
|
2037
2038
|
// src/structure/rules/software-package-json.ts
|
|
2038
|
-
var
|
|
2039
|
-
function
|
|
2039
|
+
var Di = "block-tools software build", Oi = "shx rm -f *.tgz && block-tools software build && pnpm pack && shx mv platforma-open*.tgz package.tgz";
|
|
2040
|
+
function ki() {
|
|
2040
2041
|
return { entrypoints: { main: { binary: {
|
|
2041
2042
|
artifact: {
|
|
2042
2043
|
type: "python",
|
|
@@ -2051,7 +2052,7 @@ function Oi() {
|
|
|
2051
2052
|
cmd: ["python", "{pkg}/main.py"]
|
|
2052
2053
|
} } } };
|
|
2053
2054
|
}
|
|
2054
|
-
function
|
|
2055
|
+
function Ai(e) {
|
|
2055
2056
|
return {
|
|
2056
2057
|
name: `${e.blockVars.facadeName}.software`,
|
|
2057
2058
|
version: Z,
|
|
@@ -2059,31 +2060,31 @@ function ki(e) {
|
|
|
2059
2060
|
description: "Block Software",
|
|
2060
2061
|
files: ["./dist/**/*"],
|
|
2061
2062
|
scripts: {
|
|
2062
|
-
build:
|
|
2063
|
-
"do-pack":
|
|
2063
|
+
build: Di,
|
|
2064
|
+
"do-pack": Oi,
|
|
2064
2065
|
changeset: "changeset",
|
|
2065
2066
|
"version-packages": "changeset version"
|
|
2066
2067
|
},
|
|
2067
|
-
"block-software":
|
|
2068
|
+
"block-software": ki(),
|
|
2068
2069
|
devDependencies: {
|
|
2069
2070
|
"@platforma-open/milaboratories.runenv-python-3": "catalog:",
|
|
2070
2071
|
"@platforma-sdk/block-tools": "sdk:"
|
|
2071
2072
|
}
|
|
2072
2073
|
};
|
|
2073
2074
|
}
|
|
2074
|
-
function
|
|
2075
|
-
R("private"), Q(), L("type", "module"), L("files", ["./dist/**/*"]), z("build",
|
|
2075
|
+
function ji() {
|
|
2076
|
+
R("private"), Q(), L("type", "module"), L("files", ["./dist/**/*"]), z("build", Di), z("do-pack", Oi), 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]);
|
|
2076
2077
|
}
|
|
2077
2078
|
// src/structure/rules/software.ts
|
|
2078
|
-
var
|
|
2079
|
-
function
|
|
2079
|
+
var Mi = "import sys\n\nprint(\"Hello from Python, \" + sys.argv[1] + \"!\")\n", Ni = "# No dependencies specified for this script\n";
|
|
2080
|
+
function Pi() {
|
|
2080
2081
|
x("software", () => {
|
|
2081
|
-
D("src/main.py", ct(
|
|
2082
|
-
|
|
2082
|
+
D("src/main.py", ct(Mi)), D("src/requirements.txt", ct(Ni)), T("package.json", j((e) => Ai(e)), () => {
|
|
2083
|
+
ji();
|
|
2083
2084
|
});
|
|
2084
2085
|
});
|
|
2085
2086
|
}
|
|
2086
|
-
function
|
|
2087
|
+
function Fi() {
|
|
2087
2088
|
x("model", () => {
|
|
2088
2089
|
O("eslint.config.mjs"), O("vite.config.mts");
|
|
2089
2090
|
}), x("ui", () => {
|
|
@@ -2097,7 +2098,7 @@ function Pi() {
|
|
|
2097
2098
|
});
|
|
2098
2099
|
}
|
|
2099
2100
|
// src/structure/rules/root-catalog-bump.ts
|
|
2100
|
-
function
|
|
2101
|
+
function Ii() {
|
|
2101
2102
|
ot(() => {
|
|
2102
2103
|
x("root", () => {
|
|
2103
2104
|
S(({ ctx: e }) => !e.isSdkInternal, () => {
|
|
@@ -2116,22 +2117,22 @@ function Fi() {
|
|
|
2116
2117
|
});
|
|
2117
2118
|
}
|
|
2118
2119
|
// src/structure/structure-definition.ts
|
|
2119
|
-
var
|
|
2120
|
-
qr(), Yr(),
|
|
2120
|
+
var Li = $e(() => {
|
|
2121
|
+
qr(), Yr(), li(), pi(), _i(), bi(), Ci(), Ei(), Pi(), Fi(), Ii();
|
|
2121
2122
|
});
|
|
2122
2123
|
// src/structure/cli/run-structure.ts
|
|
2123
|
-
async function
|
|
2124
|
+
async function Ri() {
|
|
2124
2125
|
return yr(wr.filter(vr));
|
|
2125
2126
|
}
|
|
2126
|
-
async function
|
|
2127
|
-
let t = h.resolve(e.blockPath), n = e.mode === "check", r = new Ie(t), i = new Le(e.templatesRoot), a = On(
|
|
2127
|
+
async function zi(e) {
|
|
2128
|
+
let t = h.resolve(e.blockPath), n = e.mode === "check", r = new Ie(t), i = new Le(e.templatesRoot), a = On(Li, r, Gn({
|
|
2128
2129
|
fs: r,
|
|
2129
2130
|
isSdkInternal: e.isSdkInternal,
|
|
2130
2131
|
updateDepsOnly: e.updateDepsOnly,
|
|
2131
2132
|
dryRun: n
|
|
2132
2133
|
}), {
|
|
2133
2134
|
templates: i,
|
|
2134
|
-
registryLookup: e.updateDepsOnly ? await
|
|
2135
|
+
registryLookup: e.updateDepsOnly ? await Ri() : void 0,
|
|
2135
2136
|
derivedPinLookup: e.updateDepsOnly ? await xr(Dr) : void 0,
|
|
2136
2137
|
rediscover: () => Gn({
|
|
2137
2138
|
fs: r,
|
|
@@ -2145,19 +2146,19 @@ async function Ri(e) {
|
|
|
2145
2146
|
changes: a.changes
|
|
2146
2147
|
};
|
|
2147
2148
|
}
|
|
2148
|
-
function
|
|
2149
|
+
function Bi(e) {
|
|
2149
2150
|
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]);
|
|
2150
2151
|
return [...new Set(t)];
|
|
2151
2152
|
}
|
|
2152
|
-
function
|
|
2153
|
+
function Vi(e, t) {
|
|
2153
2154
|
if (t.length === 0) return ` ${e}: up to date (0 changes)`;
|
|
2154
2155
|
let n = t.map((e) => ` ${e.action.padEnd(6)} ${e.primitive.padEnd(8)} ${e.path} [${e.scope}]`);
|
|
2155
2156
|
return ` ${e}: ${t.length} change(s)\n${n.join("\n")}`;
|
|
2156
2157
|
}
|
|
2157
2158
|
// src/cmd/structure/refresh.ts
|
|
2158
|
-
async function
|
|
2159
|
+
async function Hi(e) {
|
|
2159
2160
|
for (let t of e.paths) {
|
|
2160
|
-
let n = await
|
|
2161
|
+
let n = await zi({
|
|
2161
2162
|
blockPath: t,
|
|
2162
2163
|
isSdkInternal: e.isSdkInternal,
|
|
2163
2164
|
updateDepsOnly: e.updateDepsOnly,
|
|
@@ -2165,14 +2166,14 @@ async function Vi(e) {
|
|
|
2165
2166
|
templatesRoot: e.templatesRoot,
|
|
2166
2167
|
log: (t) => e.logger.info(t)
|
|
2167
2168
|
});
|
|
2168
|
-
e.logger.info(
|
|
2169
|
+
e.logger.info(Vi(t, n.changes));
|
|
2169
2170
|
}
|
|
2170
2171
|
}
|
|
2171
|
-
function
|
|
2172
|
+
function Ui(e) {
|
|
2172
2173
|
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
2174
|
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 ?
|
|
2175
|
-
await
|
|
2175
|
+
let r = t.length > 0 ? Bi(t) : ["."], i = h.join(e, "src", "structure", "templates");
|
|
2176
|
+
await Hi({
|
|
2176
2177
|
paths: r,
|
|
2177
2178
|
isSdkInternal: !!n.sdkInternal,
|
|
2178
2179
|
updateDepsOnly: !!n.updateDepsOnly,
|
|
@@ -2182,11 +2183,11 @@ function Hi(e) {
|
|
|
2182
2183
|
}), t;
|
|
2183
2184
|
}
|
|
2184
2185
|
// src/cmd/update-deps.ts
|
|
2185
|
-
function
|
|
2186
|
+
function Wi(e) {
|
|
2186
2187
|
let t = new p("update-deps").description("[DEPRECATED] Use `block-tools structure refresh --update-deps-only`. This alias delegates to it.");
|
|
2187
2188
|
return t.action(async () => {
|
|
2188
2189
|
let t = new y();
|
|
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
|
|
2190
|
+
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 Hi({
|
|
2190
2191
|
paths: ["."],
|
|
2191
2192
|
isSdkInternal: !1,
|
|
2192
2193
|
updateDepsOnly: !0,
|
|
@@ -2196,7 +2197,7 @@ function Ui(e) {
|
|
|
2196
2197
|
}), t;
|
|
2197
2198
|
}
|
|
2198
2199
|
// src/cmd/list-overview-snapshots.ts
|
|
2199
|
-
function
|
|
2200
|
+
function Gi() {
|
|
2200
2201
|
let e = new p("list-overview-snapshots").description("List all available global overview snapshots in the registry");
|
|
2201
2202
|
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) => {
|
|
2202
2203
|
let t = new y(), n = te(e.registry), r = await new s(n, t).listGlobalOverviewSnapshots();
|
|
@@ -2209,7 +2210,7 @@ function Wi() {
|
|
|
2209
2210
|
}), e;
|
|
2210
2211
|
}
|
|
2211
2212
|
// src/cmd/restore-overview-from-snapshot.ts
|
|
2212
|
-
function
|
|
2213
|
+
function Ki() {
|
|
2213
2214
|
let e = new p("restore-overview-from-snapshot").description("Restore global overview from a snapshot");
|
|
2214
2215
|
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) => {
|
|
2215
2216
|
let t = new y(), n = te(e.registry), r = new s(n, t), i = await r.listGlobalOverviewSnapshots();
|
|
@@ -2234,7 +2235,7 @@ function Gi() {
|
|
|
2234
2235
|
}), e;
|
|
2235
2236
|
}
|
|
2236
2237
|
// src/registry_v1/flags.ts
|
|
2237
|
-
function
|
|
2238
|
+
function qi(e) {
|
|
2238
2239
|
let t = e.match(/(?<destName>[^/\\]+)=(?<src>.*)/);
|
|
2239
2240
|
if (t) {
|
|
2240
2241
|
let { src: e, destName: n } = t.groups;
|
|
@@ -2248,21 +2249,21 @@ function Ki(e) {
|
|
|
2248
2249
|
destName: h.basename(e)
|
|
2249
2250
|
};
|
|
2250
2251
|
}
|
|
2251
|
-
function
|
|
2252
|
-
return new m(e, t).argParser((e, t) => [...t ?? [],
|
|
2252
|
+
function Ji(e, t) {
|
|
2253
|
+
return new m(e, t).argParser((e, t) => [...t ?? [], qi(e)]).default([]);
|
|
2253
2254
|
}
|
|
2254
2255
|
// src/cmd/upload-package-v1.ts
|
|
2255
|
-
var
|
|
2256
|
+
var Yi = [
|
|
2256
2257
|
"registry",
|
|
2257
2258
|
"organization",
|
|
2258
2259
|
"package",
|
|
2259
2260
|
"version"
|
|
2260
2261
|
];
|
|
2261
|
-
function
|
|
2262
|
+
function Xi() {
|
|
2262
2263
|
let e = new p("upload-package-v1").description("Uploads V1 package and refreshes the registry");
|
|
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(
|
|
2264
|
+
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(Ji("-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
2265
|
let t = new y(), n = ee.parse({});
|
|
2265
|
-
for (let t of
|
|
2266
|
+
for (let t of Yi) e[t] && (n[t] = e[t]);
|
|
2266
2267
|
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" }))));
|
|
2267
2268
|
for (let t of e.file) n.files[t.destName] = t.src;
|
|
2268
2269
|
let r = await f(n);
|
|
@@ -2277,12 +2278,12 @@ function Yi() {
|
|
|
2277
2278
|
}), e;
|
|
2278
2279
|
}
|
|
2279
2280
|
// src/cmd/structure/check.ts
|
|
2280
|
-
function
|
|
2281
|
+
function Zi(e) {
|
|
2281
2282
|
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.");
|
|
2282
2283
|
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) => {
|
|
2283
|
-
let r = new y(), i = t.length > 0 ?
|
|
2284
|
+
let r = new y(), i = t.length > 0 ? Bi(t) : ["."], a = h.join(e, "src", "structure", "templates"), o = !1;
|
|
2284
2285
|
for (let e of i) {
|
|
2285
|
-
let t = await
|
|
2286
|
+
let t = await zi({
|
|
2286
2287
|
blockPath: e,
|
|
2287
2288
|
isSdkInternal: !!n.sdkInternal,
|
|
2288
2289
|
updateDepsOnly: !1,
|
|
@@ -2290,40 +2291,40 @@ function Xi(e) {
|
|
|
2290
2291
|
templatesRoot: a,
|
|
2291
2292
|
log: (e) => r.info(e)
|
|
2292
2293
|
});
|
|
2293
|
-
r.info(
|
|
2294
|
+
r.info(Vi(e, t.changes)), t.changes.length > 0 && (o = !0);
|
|
2294
2295
|
}
|
|
2295
2296
|
if (o) throw Error("Structure check failed: one or more blocks are out of date. Run `structure refresh`.");
|
|
2296
2297
|
}), t;
|
|
2297
2298
|
}
|
|
2298
2299
|
// src/structure/init-block-constructor.ts
|
|
2299
|
-
var
|
|
2300
|
+
var Qi = ["python"], $i = class extends Error {
|
|
2300
2301
|
constructor(e) {
|
|
2301
2302
|
super(`Missing required flag --${e} in --non-interactive mode. Supply every BlockVars flag, or drop --non-interactive to be prompted.`), this.name = "InitFlagError";
|
|
2302
2303
|
}
|
|
2303
2304
|
};
|
|
2304
|
-
async function
|
|
2305
|
+
async function ea(e, t, n, r) {
|
|
2305
2306
|
if (e !== void 0 && e !== "") return e;
|
|
2306
|
-
if (n) throw new
|
|
2307
|
+
if (n) throw new $i(t);
|
|
2307
2308
|
return r();
|
|
2308
2309
|
}
|
|
2309
|
-
async function
|
|
2310
|
-
let t = await
|
|
2310
|
+
async function ta(e) {
|
|
2311
|
+
let t = await ea(e.npmOrg, "npm-org", e.nonInteractive, () => Se({
|
|
2311
2312
|
message: "npm org (e.g. @platforma-open):",
|
|
2312
2313
|
default: "@platforma-open"
|
|
2313
|
-
})), n = await
|
|
2314
|
+
})), n = await ea(e.orgScope, "org-scope", e.nonInteractive, () => Se({ message: "org scope (e.g. my-org):" })), r = await ea(e.shortName, "short-name", e.nonInteractive, () => Se({ message: "block short name (e.g. mixcr-clonotyping):" })), i;
|
|
2314
2315
|
i = e.withSoftware === void 0 ? !e.nonInteractive && await xe({
|
|
2315
2316
|
message: "Include a software module?",
|
|
2316
2317
|
default: !1
|
|
2317
2318
|
}) : e.withSoftware;
|
|
2318
2319
|
let a;
|
|
2319
2320
|
if (i) {
|
|
2320
|
-
if (a = await
|
|
2321
|
+
if (a = await ea(e.platform, "platform", e.nonInteractive, () => Ce({
|
|
2321
2322
|
message: "Software platform:",
|
|
2322
|
-
choices:
|
|
2323
|
+
choices: Qi.map((e) => ({
|
|
2323
2324
|
name: e,
|
|
2324
2325
|
value: e
|
|
2325
2326
|
}))
|
|
2326
|
-
})), !
|
|
2327
|
+
})), !Qi.includes(a)) throw Error(`Unsupported --platform '${a}'. Only ${Qi.join(", ")} ${Qi.length === 1 ? "is" : "are"} supported at v1.`);
|
|
2327
2328
|
} else if (e.platform) throw Error("--platform was given but software is disabled (--no-software).");
|
|
2328
2329
|
return {
|
|
2329
2330
|
facadeName: `${t}/${n}.${r}`,
|
|
@@ -2334,7 +2335,7 @@ async function ea(e) {
|
|
|
2334
2335
|
softwarePlatform: a
|
|
2335
2336
|
};
|
|
2336
2337
|
}
|
|
2337
|
-
async function
|
|
2338
|
+
async function na(e) {
|
|
2338
2339
|
let t = e.vars, n = Ln(t), r = new Ie(e.blockPath), i = new Le(e.templatesRoot), a = Rn({
|
|
2339
2340
|
blockVars: t,
|
|
2340
2341
|
modules: n,
|
|
@@ -2347,7 +2348,7 @@ async function ta(e) {
|
|
|
2347
2348
|
} catch (e) {
|
|
2348
2349
|
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)}`);
|
|
2349
2350
|
}
|
|
2350
|
-
return On(
|
|
2351
|
+
return On(Li, r, a, {
|
|
2351
2352
|
templates: i,
|
|
2352
2353
|
initMode: !0,
|
|
2353
2354
|
registryLookup: s,
|
|
@@ -2355,12 +2356,12 @@ async function ta(e) {
|
|
|
2355
2356
|
}), e.log(`Initialised block '${t.facadeName}'${t.softwarePlatform ? ` (software: ${t.softwarePlatform})` : " (no software)"} at ${e.blockPath}`), t;
|
|
2356
2357
|
}
|
|
2357
2358
|
// src/cmd/structure/init.ts
|
|
2358
|
-
function
|
|
2359
|
+
function ra(e) {
|
|
2359
2360
|
let t = new p("init").description("Scaffold a fresh Platforma block from the canonical structure. Missing flags are prompted unless --non-interactive.");
|
|
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([...
|
|
2361
|
+
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([...Qi])), t.option("--non-interactive", "error on any missing flag instead of prompting"), t.action(async (t, n) => {
|
|
2361
2362
|
let r = new y(), i = n.withSoftware === !0, a = n.software === !1;
|
|
2362
2363
|
if (i && a) throw Error("--with-software and --no-software are mutually exclusive.");
|
|
2363
|
-
let o = i ? !0 : !a && void 0, s = await
|
|
2364
|
+
let o = i ? !0 : !a && void 0, s = await ta({
|
|
2364
2365
|
npmOrg: n.npmOrg,
|
|
2365
2366
|
orgScope: n.orgScope,
|
|
2366
2367
|
shortName: n.shortName,
|
|
@@ -2368,7 +2369,7 @@ function na(e) {
|
|
|
2368
2369
|
platform: n.platform,
|
|
2369
2370
|
nonInteractive: n.nonInteractive
|
|
2370
2371
|
});
|
|
2371
|
-
await
|
|
2372
|
+
await na({
|
|
2372
2373
|
vars: s,
|
|
2373
2374
|
blockPath: t ? h.resolve(t) : h.resolve(process.cwd(), s.shortName),
|
|
2374
2375
|
templatesRoot: h.join(e, "src", "structure", "templates"),
|
|
@@ -2377,13 +2378,13 @@ function na(e) {
|
|
|
2377
2378
|
}), t;
|
|
2378
2379
|
}
|
|
2379
2380
|
// src/cmd/software/knobs.ts
|
|
2380
|
-
var
|
|
2381
|
+
var ia = ["dev", "release"], aa = [
|
|
2381
2382
|
"docker",
|
|
2382
2383
|
"binary",
|
|
2383
2384
|
"all",
|
|
2384
2385
|
"none"
|
|
2385
|
-
],
|
|
2386
|
-
function
|
|
2386
|
+
], oa = ["local", "remote"];
|
|
2387
|
+
function sa(e) {
|
|
2387
2388
|
if (e.usePublished) {
|
|
2388
2389
|
if (e.variant === "docker" || e.variant === "all") throw v.CLIError(`--use-published is binary-only and cannot be combined with --variant ${e.variant}`);
|
|
2389
2390
|
return { kind: "binary-existing" };
|
|
@@ -2396,31 +2397,31 @@ function oa(e) {
|
|
|
2396
2397
|
};
|
|
2397
2398
|
}
|
|
2398
2399
|
// src/cmd/software/ecr-login.ts
|
|
2399
|
-
var
|
|
2400
|
-
function
|
|
2400
|
+
var ca = "public.ecr.aws", la = "us-east-1";
|
|
2401
|
+
function ua(e) {
|
|
2401
2402
|
if (process.env.AWS_ACCESS_KEY_ID || process.env.AWS_PROFILE) return;
|
|
2402
2403
|
let t = process.env.PL_AWS_PROFILE ?? fe.AWS_DEV_PROFILE;
|
|
2403
2404
|
process.env.AWS_PROFILE = t, e?.debug(`Using AWS profile '${t}' for dev push credentials`);
|
|
2404
2405
|
}
|
|
2405
|
-
function
|
|
2406
|
+
function da(e) {
|
|
2406
2407
|
return new URL(`https://${e}`).hostname;
|
|
2407
2408
|
}
|
|
2408
|
-
function
|
|
2409
|
+
function fa() {
|
|
2409
2410
|
return ` aws sso login --profile ${process.env.AWS_PROFILE ?? process.env.PL_AWS_PROFILE ?? fe.AWS_DEV_PROFILE}`;
|
|
2410
2411
|
}
|
|
2411
|
-
async function
|
|
2412
|
-
let n =
|
|
2413
|
-
if (n !==
|
|
2412
|
+
async function pa(e, t) {
|
|
2413
|
+
let n = da(e);
|
|
2414
|
+
if (n !== ca) throw v.CLIError(`automatic docker login is only supported for '${ca}', not '${n}'.\nLog in manually, or drop the ecr:// scheme from the push target to opt out.`);
|
|
2414
2415
|
t?.info(`Logging in to ECR registry '${n}'...`);
|
|
2415
2416
|
let r, i;
|
|
2416
2417
|
try {
|
|
2417
|
-
let e = (await new Te({ region:
|
|
2418
|
+
let e = (await new Te({ region: la }).send(new Ee({}))).authorizationData?.authorizationToken;
|
|
2418
2419
|
if (!e) throw Error("empty authorization token");
|
|
2419
2420
|
let t = Buffer.from(e, "base64").toString("utf8"), n = t.indexOf(":");
|
|
2420
2421
|
if (n < 0) throw Error("malformed authorization token (no ':' separator)");
|
|
2421
2422
|
r = t.slice(0, n), i = t.slice(n + 1);
|
|
2422
2423
|
} catch (e) {
|
|
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` +
|
|
2424
|
+
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` + fa());
|
|
2424
2425
|
}
|
|
2425
2426
|
let a = we("docker", [
|
|
2426
2427
|
"login",
|
|
@@ -2443,9 +2444,9 @@ async function fa(e, t) {
|
|
|
2443
2444
|
if (a.error || a.status !== 0) throw v.CLIError(`'docker login ${n}' failed`);
|
|
2444
2445
|
}
|
|
2445
2446
|
// src/cmd/software/run-build.ts
|
|
2446
|
-
async function
|
|
2447
|
+
async function ma(e) {
|
|
2447
2448
|
let { core: t, scenario: n, options: r = {}, logger: i } = e, a = r.ids;
|
|
2448
|
-
t.buildMode =
|
|
2449
|
+
t.buildMode = ga(n), ha(n) || t.assertDockerCoverage();
|
|
2449
2450
|
let o = () => t.buildSoftwareArchives({
|
|
2450
2451
|
ids: a,
|
|
2451
2452
|
forceBuild: !!r.force,
|
|
@@ -2470,12 +2471,12 @@ async function pa(e) {
|
|
|
2470
2471
|
});
|
|
2471
2472
|
break;
|
|
2472
2473
|
case "target": {
|
|
2473
|
-
let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f =
|
|
2474
|
+
let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f = ya(e, r);
|
|
2474
2475
|
l && t.buildDockerImages({
|
|
2475
2476
|
ids: a,
|
|
2476
2477
|
registry: f.pull,
|
|
2477
2478
|
strictPlatformMatching: _.isCI()
|
|
2478
|
-
}), u && await o(), d && e === "dev" && (l || u) &&
|
|
2479
|
+
}), u && await o(), d && e === "dev" && (l || u) && ua(i), l && d && (f.autoLogin && f.push && await pa(f.push, i), t.publishDockerImages({
|
|
2479
2480
|
ids: a,
|
|
2480
2481
|
pushTo: f.push,
|
|
2481
2482
|
strictPlatformMatching: _.isCI()
|
|
@@ -2490,44 +2491,44 @@ async function pa(e) {
|
|
|
2490
2491
|
t.buildSwJsonFiles({
|
|
2491
2492
|
packageIds: a,
|
|
2492
2493
|
noSoftware: n.kind === "no-software",
|
|
2493
|
-
skipDockerCoverage:
|
|
2494
|
+
skipDockerCoverage: ha(n)
|
|
2494
2495
|
});
|
|
2495
2496
|
}
|
|
2496
|
-
function
|
|
2497
|
+
function ha(e) {
|
|
2497
2498
|
return e.kind === "no-software" || e.kind === "binary-existing";
|
|
2498
2499
|
}
|
|
2499
|
-
function
|
|
2500
|
+
function ga(e) {
|
|
2500
2501
|
return e.kind !== "target" || e.channel === "release" ? "release" : e.variant !== "docker" && e.location === "remote" ? "dev-remote" : "dev-local";
|
|
2501
2502
|
}
|
|
2502
|
-
function
|
|
2503
|
+
function _a(e) {
|
|
2503
2504
|
if (!e.includes("://")) return e;
|
|
2504
2505
|
let t = new URL(e);
|
|
2505
2506
|
return t.host + t.pathname;
|
|
2506
2507
|
}
|
|
2507
|
-
function
|
|
2508
|
+
function va(e) {
|
|
2508
2509
|
return {
|
|
2509
|
-
registry:
|
|
2510
|
+
registry: _a(e),
|
|
2510
2511
|
autoLogin: e.startsWith("ecr://")
|
|
2511
2512
|
};
|
|
2512
2513
|
}
|
|
2513
|
-
function
|
|
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 ?
|
|
2514
|
+
function ya(e, t) {
|
|
2515
|
+
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 ? va(a) : {
|
|
2515
2516
|
registry: void 0,
|
|
2516
2517
|
autoLogin: !1
|
|
2517
2518
|
}, s = t.dockerRegistry ?? i ?? (n ? a : fe.DOCKER_REGISTRY);
|
|
2518
2519
|
return {
|
|
2519
|
-
pull: s ?
|
|
2520
|
+
pull: s ? _a(s) : void 0,
|
|
2520
2521
|
push: o.registry,
|
|
2521
2522
|
autoLogin: o.autoLogin
|
|
2522
2523
|
};
|
|
2523
2524
|
}
|
|
2524
2525
|
// src/cmd/software/env.ts
|
|
2525
|
-
var
|
|
2526
|
+
var ba = "PL_BUILD_CHANNEL", xa = "PL_BUILD_VARIANT", Sa = "PL_BUILD_LOCATION", Ca = "PL_BUILD_USE_PUBLISHED";
|
|
2526
2527
|
_.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;
|
|
2527
2528
|
// src/cmd/software/build.ts
|
|
2528
|
-
function
|
|
2529
|
+
function wa() {
|
|
2529
2530
|
let e = new p("build").description("Build a software module for a target and write its .sw.json descriptor (build + push in one pass)");
|
|
2530
|
-
return e.addOption(new m("--channel <channel>", "registry channel to build for").choices([...
|
|
2531
|
+
return e.addOption(new m("--channel <channel>", "registry channel to build for").choices([...ia]).env(ba)), e.addOption(new m("--variant <variant>", "artifact kind to build (default: all declared)").choices([...aa]).env(xa)), e.addOption(new m("--location <location>", "where the artifact lands (local = no push)").choices([...oa]).env(Sa)), e.addOption(new m("--use-published", "do not build or push; emit a descriptor pointing at the already-published release artifact").env(Ca)), e.addOption(new m("--log-level <level>", "logging level").choices([
|
|
2531
2532
|
"error",
|
|
2532
2533
|
"warn",
|
|
2533
2534
|
"info",
|
|
@@ -2535,7 +2536,7 @@ function Ca() {
|
|
|
2535
2536
|
]).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) => {
|
|
2536
2537
|
let t = v.createLogger(e.logLevel);
|
|
2537
2538
|
try {
|
|
2538
|
-
let n =
|
|
2539
|
+
let n = sa({
|
|
2539
2540
|
channel: e.channel,
|
|
2540
2541
|
variant: e.variant,
|
|
2541
2542
|
location: e.location,
|
|
@@ -2556,7 +2557,7 @@ function Ca() {
|
|
|
2556
2557
|
pushDocker: a,
|
|
2557
2558
|
pushDisabledExplicitly: !!e.dockerNoAutopush,
|
|
2558
2559
|
dockerPackageCount: r.selectedDockerPackages(e.packageId).length
|
|
2559
|
-
}), await
|
|
2560
|
+
}), await ma({
|
|
2560
2561
|
core: r,
|
|
2561
2562
|
scenario: n,
|
|
2562
2563
|
logger: t,
|
|
@@ -2582,20 +2583,20 @@ function Ca() {
|
|
|
2582
2583
|
}), e;
|
|
2583
2584
|
}
|
|
2584
2585
|
// src/cmd/software/index.ts
|
|
2585
|
-
function
|
|
2586
|
+
function Ta() {
|
|
2586
2587
|
let e = new p("software").description("Build and publish a block's software modules");
|
|
2587
|
-
return e.addCommand(
|
|
2588
|
+
return e.addCommand(wa()), e;
|
|
2588
2589
|
}
|
|
2589
2590
|
// src/cli.ts
|
|
2590
|
-
function
|
|
2591
|
+
function Ea(e = process.cwd()) {
|
|
2591
2592
|
let t = new p();
|
|
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(
|
|
2593
|
+
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(Wi(e)), t.addCommand(Gi()), t.addCommand(Ki()), t.addCommand(Xi()), t.addCommand(Ta());
|
|
2593
2594
|
let n = new p("structure").description("Manage block scaffolding against the canonical structure (check / init / refresh)");
|
|
2594
|
-
return n.addCommand(
|
|
2595
|
+
return n.addCommand(Zi(e)), n.addCommand(ra(e)), n.addCommand(Ui(e)), t.addCommand(n), t;
|
|
2595
2596
|
}
|
|
2596
|
-
async function
|
|
2597
|
-
await
|
|
2597
|
+
async function Da(e, t) {
|
|
2598
|
+
await Ea(t).parseAsync(e);
|
|
2598
2599
|
}
|
|
2599
|
-
export {
|
|
2600
|
+
export { Ea as buildProgram, Da as run };
|
|
2600
2601
|
|
|
2601
2602
|
//# sourceMappingURL=cli.mjs.map
|