@platforma-sdk/block-tools 2.16.10 → 2.16.12
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 +13 -13
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +460 -458
- package/dist/cli.mjs.map +1 -1
- package/dist/structure/rules/shared/colocated-tests.d.ts +2 -0
- package/package.json +5 -5
- package/src/structure/__tests__/colocated-test-wiring.test.ts +59 -0
- package/src/structure/rules/shared/colocated-tests.ts +3 -0
- package/src/structure/rules/workflow-package-json.ts +21 -13
package/dist/cli.mjs
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { Ct as e, Ft as t, J as n, K as r, M as i, Mt as a, St as o, Xt as s, Y as c, _ as l, gt as u, n as d, p as f, vt as
|
|
2
|
-
import { Command as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { BlockPackManifest as
|
|
6
|
-
import { assertDockerPushIntent as
|
|
7
|
-
import { ConsoleLoggerAdapter as
|
|
8
|
-
import
|
|
9
|
-
import { setTimeout as
|
|
10
|
-
import * as
|
|
11
|
-
import { confirm as
|
|
12
|
-
import { spawnSync as
|
|
13
|
-
import { ECRPUBLICClient as
|
|
1
|
+
import { Ct as e, Ft as t, J as n, K as r, M as i, Mt as a, St as o, Xt as s, Y as c, _ as l, gt as u, n as d, p as f, vt as p, w as ee } from "./config-Dx45aFJ_.mjs";
|
|
2
|
+
import { Command as m, Option as h } from "commander";
|
|
3
|
+
import g from "node:path";
|
|
4
|
+
import _ from "node:fs";
|
|
5
|
+
import { BlockPackManifest as te, StableChannel as ne, overrideDescriptionVersion as re, overrideManifestVersion as ie } from "@milaboratories/pl-model-middle-layer";
|
|
6
|
+
import { assertDockerPushIntent as ae, createBuilder as oe, defaults as se, envs as v, util as y } from "@platforma-sdk/package-builder-lib";
|
|
7
|
+
import { ConsoleLoggerAdapter as b } from "@milaboratories/ts-helpers";
|
|
8
|
+
import ce, { parse as le, parseDocument as ue, stringify as de } from "yaml";
|
|
9
|
+
import { setTimeout as fe } from "node:timers/promises";
|
|
10
|
+
import * as pe from "node:os";
|
|
11
|
+
import { confirm as me, input as he, select as ge } from "@inquirer/prompts";
|
|
12
|
+
import { spawnSync as _e } from "node:child_process";
|
|
13
|
+
import { ECRPUBLICClient as ve, GetAuthorizationTokenCommand as ye } from "@aws-sdk/client-ecr-public";
|
|
14
14
|
//#region src/cmd/build-meta.ts
|
|
15
|
-
function
|
|
16
|
-
let e = new
|
|
15
|
+
function be() {
|
|
16
|
+
let e = new m("build-meta").description("Extracts meta information from blocks package.json and outputs meta.json with embedded binary and textual information linked from the meta section.");
|
|
17
17
|
return e.option("-i, --modulePath <path>", "input module path", "."), e.requiredOption("-o, --destination <path>", "output meta.json file"), e.action(async (e) => {
|
|
18
|
-
let n =
|
|
19
|
-
await
|
|
18
|
+
let n = g.resolve(e.modulePath), r = await a(await t((await p(n)).meta, n));
|
|
19
|
+
await _.promises.writeFile(g.resolve(e.destination), JSON.stringify(r));
|
|
20
20
|
}), e;
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/cmd/build-model.ts
|
|
24
|
-
async function
|
|
24
|
+
async function xe(e) {
|
|
25
25
|
try {
|
|
26
|
-
return await
|
|
26
|
+
return await _.promises.readFile(e, "utf8");
|
|
27
27
|
} catch (e) {
|
|
28
28
|
if (e instanceof Error && "code" in e && e.code === "ENOENT") return;
|
|
29
29
|
throw e;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
let e = new
|
|
32
|
+
function Se() {
|
|
33
|
+
let e = new m("build-model").description("Extracts and outputs block model JSON from pre-built block model module");
|
|
34
34
|
return e.option("-i, --modulePath <path>", "input module path", "."), e.option("-b, --sourceBundle <path>", "bundled model code to embed into the model for callback-based rendering to work", "./dist/bundle.js"), e.option("-o, --destination <path>", "output model file", "./dist/model.json"), e.action(async (e) => {
|
|
35
|
-
let { model: t, platforma: n } = s(
|
|
35
|
+
let { model: t, platforma: n } = s(g.resolve(e.modulePath));
|
|
36
36
|
if (t ||= n, !t) throw Error("\"model\" export not found");
|
|
37
37
|
let { config: r } = t;
|
|
38
38
|
if (!r) throw Error("Malformed \"model\" object, check it is created with \"BlockModel\" and \".done()\" is executed as the call in the chain.");
|
|
39
39
|
if (!("outputs" in r) || !("sections" in r)) throw Error("\"config\" has unexpected structure");
|
|
40
|
-
let i = await
|
|
40
|
+
let i = await xe(e.sourceBundle);
|
|
41
41
|
i !== void 0 && (r.code = {
|
|
42
42
|
type: "plain",
|
|
43
43
|
content: i
|
|
44
|
-
}), await
|
|
44
|
+
}), await _.promises.writeFile(g.resolve(e.destination), JSON.stringify(r));
|
|
45
45
|
}), e;
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region src/cmd/build-kind-manifest.ts
|
|
49
|
-
function
|
|
50
|
-
let e = new
|
|
49
|
+
function Ce() {
|
|
50
|
+
let e = new m("build-kind-manifest").description("Writes the block-kind dist manifest (identity + src source-hash) from a pre-built kind bundle");
|
|
51
51
|
return e.option("-i, --modulePath <path>", "kind package dir (contains package.json, src/, dist/)", "."), e.option("-s, --srcDir <path>", "source dir hashed into sourceHash, relative to modulePath", "src"), e.option("-o, --dst <path>", "output dir with the compiled bundle, relative to modulePath", "dist"), e.action(async (e) => {
|
|
52
52
|
await o({
|
|
53
53
|
modulePath: e.modulePath,
|
|
@@ -58,79 +58,79 @@ function we() {
|
|
|
58
58
|
}
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/cmd/pack.ts
|
|
61
|
-
function
|
|
62
|
-
let t = new
|
|
61
|
+
function we() {
|
|
62
|
+
let t = new m("pack").description("Builds block pack and outputs a block pack manifest consolidating all references assets into a single folder");
|
|
63
63
|
return t.option("-i, --modulePath <path>", "input module path", "."), t.option("-o, --destinationPath <path>", "output folder", "./block-pack"), t.action(async (t) => {
|
|
64
|
-
await e(await u(
|
|
64
|
+
await e(await u(g.resolve(t.modulePath)), g.resolve(t.destinationPath));
|
|
65
65
|
}), t;
|
|
66
66
|
}
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region src/cmd/publish.ts
|
|
69
|
-
function
|
|
69
|
+
function Te(e, t) {
|
|
70
70
|
let n = { ...e };
|
|
71
|
-
for (let e in t) t[e] && typeof t[e] == "object" && !Array.isArray(t[e]) && n[e] && typeof n[e] == "object" && !Array.isArray(n[e]) ? n[e] =
|
|
71
|
+
for (let e in t) t[e] && typeof t[e] == "object" && !Array.isArray(t[e]) && n[e] && typeof n[e] == "object" && !Array.isArray(n[e]) ? n[e] = Te(n[e], t[e]) : n[e] = t[e];
|
|
72
72
|
return n;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
let e = new
|
|
76
|
-
return e.addOption(new
|
|
77
|
-
let t = new
|
|
78
|
-
o =
|
|
79
|
-
let s =
|
|
80
|
-
t.info(`Manifest root = ${s}`), t.info(`Facade root = ${u}`), e.versionOverride && (o =
|
|
81
|
-
let d = new
|
|
82
|
-
await c(d, o, u, async (e) => Buffer.from(await
|
|
74
|
+
function Ee() {
|
|
75
|
+
let e = new m("publish").description("Publishes the block package and refreshes the registry (for v2 block-pack schema)");
|
|
76
|
+
return e.addOption(new h("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new h("--registry-serve-url <url>", "CDN serve URL written into block-pack/published.json (npm-consumed blocks)").env("PL_REGISTRY_SERVE_URL").makeOptionMandatory()), e.option("-m, --manifest <path>", "manifest file path", `./block-pack/${i}`), e.option("-v, --version-override <path>", "override package version"), e.addOption(new h("--refresh", "refresh repository after adding the package").default(!0).env("PL_REGISTRY_REFRESH")), e.option("--no-refresh", "do not refresh repository after adding the package"), e.addOption(new h("--unstable", "do not add the published package to stable channel").default(!1).env("PL_PUBLISH_UNSTABLE")), e.action(async (e) => {
|
|
77
|
+
let t = new b(), i = g.resolve(e.manifest), a = JSON.parse(await _.promises.readFile(i, { encoding: "utf-8" })), o = te.parse(a);
|
|
78
|
+
o = Te(a, o);
|
|
79
|
+
let s = g.dirname(i), u = g.dirname(s);
|
|
80
|
+
t.info(`Manifest root = ${s}`), t.info(`Facade root = ${u}`), e.versionOverride && (o = ie(o, e.versionOverride));
|
|
81
|
+
let d = new ee(l(e.registry), t);
|
|
82
|
+
await c(d, o, u, async (e) => Buffer.from(await _.promises.readFile(g.resolve(s, e)))), e.unstable || (t.info(`Adding package to ${ne} channel...`), await d.addPackageToChannel(o.description.id, ne)), await n(s, r({
|
|
83
83
|
registryUrl: e.registryServeUrl,
|
|
84
84
|
id: o.description.id
|
|
85
|
-
})), t.info(`Wrote published coordinates to ${
|
|
85
|
+
})), t.info(`Wrote published coordinates to ${g.resolve(s, "published.json")}`), e.refresh && await d.updateIfNeeded();
|
|
86
86
|
}), e;
|
|
87
87
|
}
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region src/cmd/refresh-registry.ts
|
|
90
|
-
function
|
|
91
|
-
let e = new
|
|
92
|
-
return e.addOption(new
|
|
90
|
+
function De() {
|
|
91
|
+
let e = new m("refresh-registry").description("Refresh overview files based on published but not proecessed artefacts");
|
|
92
|
+
return e.addOption(new h("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new h("-m, --mode <mode>", "refresh mode (allowed valiues: \"force\", \"normal\", \"dry-run\")").choices([
|
|
93
93
|
"force",
|
|
94
94
|
"normal",
|
|
95
95
|
"dry-run"
|
|
96
96
|
]).env("PL_REGISTRY_REFRESH_DRY_RUN").default("normal")), e.action(async (e) => {
|
|
97
|
-
await new
|
|
97
|
+
await new ee(l(e.registry), new b()).updateIfNeeded(e.mode);
|
|
98
98
|
}), e;
|
|
99
99
|
}
|
|
100
100
|
//#endregion
|
|
101
101
|
//#region src/cmd/mark-stable.ts
|
|
102
|
-
function
|
|
103
|
-
let e = new
|
|
104
|
-
return e.option("-i, --modulePath <path>", "input module path", "."), e.addOption(new
|
|
105
|
-
let t = await
|
|
106
|
-
e.versionOverride && (t =
|
|
107
|
-
let n = new
|
|
102
|
+
function Oe() {
|
|
103
|
+
let e = new m("mark-stable").description("Mark target block stable");
|
|
104
|
+
return e.option("-i, --modulePath <path>", "input module path", "."), e.addOption(new h("-c, --channel <channel name>", "custom channel").default(ne).hideHelp()), e.option("-v, --version-override <path>", "override package version"), e.addOption(new h("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new h("--refresh", "refresh repository after adding the package").default(!0).env("PL_REGISTRY_REFRESH")), e.option("--no-refresh", "do not refresh repository after adding the package"), e.option("--unmark", "reverses meaning of this command, flag can be used to remove \"stable\" flag from the package", !1), e.action(async (e) => {
|
|
105
|
+
let t = await p(g.resolve(e.modulePath));
|
|
106
|
+
e.versionOverride && (t = re(t, e.versionOverride));
|
|
107
|
+
let n = new ee(l(e.registry), new b());
|
|
108
108
|
e.unmark ? await n.removePackageFromChannel(t.id, e.channel) : await n.addPackageToChannel(t.id, e.channel), e.refresh && await n.updateIfNeeded();
|
|
109
109
|
}), e;
|
|
110
110
|
}
|
|
111
111
|
//#endregion
|
|
112
112
|
//#region src/structure/engine/fs/node.ts
|
|
113
|
-
var
|
|
113
|
+
var ke = class {
|
|
114
114
|
constructor(e) {
|
|
115
115
|
this.root = e;
|
|
116
116
|
}
|
|
117
117
|
abs(e) {
|
|
118
|
-
return
|
|
118
|
+
return g.resolve(this.root, e);
|
|
119
119
|
}
|
|
120
120
|
read(e) {
|
|
121
|
-
return
|
|
121
|
+
return _.readFileSync(this.abs(e), "utf-8");
|
|
122
122
|
}
|
|
123
123
|
write(e, t) {
|
|
124
124
|
let n = this.abs(e);
|
|
125
|
-
|
|
125
|
+
_.mkdirSync(g.dirname(n), { recursive: !0 }), _.writeFileSync(n, t, "utf-8");
|
|
126
126
|
}
|
|
127
127
|
writeBinary(e, t) {
|
|
128
128
|
let n = this.abs(e);
|
|
129
|
-
|
|
129
|
+
_.mkdirSync(g.dirname(n), { recursive: !0 }), _.writeFileSync(n, t);
|
|
130
130
|
}
|
|
131
131
|
exists(e) {
|
|
132
132
|
try {
|
|
133
|
-
return
|
|
133
|
+
return _.statSync(this.abs(e)), !0;
|
|
134
134
|
} catch {
|
|
135
135
|
return !1;
|
|
136
136
|
}
|
|
@@ -138,15 +138,15 @@ var Ae = class {
|
|
|
138
138
|
list(e) {
|
|
139
139
|
let t = this.abs(e);
|
|
140
140
|
try {
|
|
141
|
-
if (!
|
|
141
|
+
if (!_.statSync(t).isDirectory()) return [];
|
|
142
142
|
} catch {
|
|
143
143
|
return [];
|
|
144
144
|
}
|
|
145
145
|
let n = [];
|
|
146
146
|
function r(e, t) {
|
|
147
|
-
let i =
|
|
147
|
+
let i = _.readdirSync(t, { withFileTypes: !0 });
|
|
148
148
|
for (let a of i) {
|
|
149
|
-
let i = e ? `${e}/${a.name}` : a.name, o =
|
|
149
|
+
let i = e ? `${e}/${a.name}` : a.name, o = g.join(t, a.name);
|
|
150
150
|
a.isDirectory() ? r(i, o) : a.isFile() && n.push(i);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -155,7 +155,7 @@ var Ae = class {
|
|
|
155
155
|
listDir(e) {
|
|
156
156
|
let t = this.abs(e), n;
|
|
157
157
|
try {
|
|
158
|
-
n =
|
|
158
|
+
n = _.readdirSync(t, { withFileTypes: !0 });
|
|
159
159
|
} catch {
|
|
160
160
|
return [];
|
|
161
161
|
}
|
|
@@ -166,48 +166,48 @@ var Ae = class {
|
|
|
166
166
|
}
|
|
167
167
|
move(e, t) {
|
|
168
168
|
let n = this.abs(e), r = this.abs(t);
|
|
169
|
-
|
|
169
|
+
_.mkdirSync(g.dirname(r), { recursive: !0 }), _.renameSync(n, r);
|
|
170
170
|
}
|
|
171
171
|
delete(e) {
|
|
172
|
-
|
|
172
|
+
_.rmSync(this.abs(e), {
|
|
173
173
|
recursive: !0,
|
|
174
174
|
force: !0
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
-
},
|
|
177
|
+
}, Ae = class {
|
|
178
178
|
constructor(e) {
|
|
179
179
|
this.root = e;
|
|
180
180
|
}
|
|
181
181
|
staticRead(e) {
|
|
182
|
-
return
|
|
182
|
+
return _.readFileSync(g.resolve(this.root, "static", e), "utf-8");
|
|
183
183
|
}
|
|
184
184
|
staticReadBinary(e) {
|
|
185
|
-
return
|
|
185
|
+
return _.readFileSync(g.resolve(this.root, "static", e));
|
|
186
186
|
}
|
|
187
187
|
textRead(e) {
|
|
188
|
-
return
|
|
188
|
+
return _.readFileSync(g.resolve(this.root, "text", e), "utf-8");
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
|
-
function
|
|
191
|
+
function je(e, t) {
|
|
192
192
|
return e.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (e, n) => t[n] ?? `\${${n}}`);
|
|
193
193
|
}
|
|
194
194
|
//#endregion
|
|
195
195
|
//#region src/structure/engine/flatten.ts
|
|
196
|
-
var
|
|
197
|
-
function
|
|
196
|
+
var Me = ["default", "init"];
|
|
197
|
+
function Ne(e, t) {
|
|
198
198
|
if (!e) return t;
|
|
199
199
|
if (!t) return e;
|
|
200
200
|
let n = e.endsWith("/") ? e.slice(0, -1) : e, r = t.startsWith("/") ? t.slice(1) : t;
|
|
201
201
|
return r ? `${n}/${r}` : n;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function Pe(e, t) {
|
|
204
204
|
return e.filter((e) => e.scope === t).slice().sort((e, t) => e.path.localeCompare(t.path));
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function Fe(e, t) {
|
|
207
207
|
let n = [];
|
|
208
208
|
function r(e, i, a, o, s) {
|
|
209
209
|
if (e.kind === "scope") {
|
|
210
|
-
let n =
|
|
210
|
+
let n = Pe(t.modules, e.scope);
|
|
211
211
|
for (let t of n) for (let n of e.children) r(n, e.scope, t.path, o, s);
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
@@ -220,14 +220,14 @@ function Ie(e, t) {
|
|
|
220
220
|
for (let t of e.children) r(t, i, a, o, e.modes);
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
|
-
if (i === void 0 || a === void 0) throw Error(`flatten: leaf '${
|
|
223
|
+
if (i === void 0 || a === void 0) throw Error(`flatten: leaf '${Le(e)}' is not inside a scope() frame`);
|
|
224
224
|
if (e.kind === "rename") {
|
|
225
225
|
n.push({
|
|
226
226
|
leaf: e,
|
|
227
227
|
scope: i,
|
|
228
228
|
modulePath: a,
|
|
229
|
-
resolvedPath:
|
|
230
|
-
resolvedTo:
|
|
229
|
+
resolvedPath: Ne(a, e.from),
|
|
230
|
+
resolvedTo: Ne(a, e.to),
|
|
231
231
|
triggers: o,
|
|
232
232
|
modes: s
|
|
233
233
|
});
|
|
@@ -237,15 +237,15 @@ function Ie(e, t) {
|
|
|
237
237
|
leaf: e,
|
|
238
238
|
scope: i,
|
|
239
239
|
modulePath: a,
|
|
240
|
-
resolvedPath:
|
|
240
|
+
resolvedPath: Ne(a, Ie(e)),
|
|
241
241
|
triggers: o,
|
|
242
242
|
modes: s
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
for (let t of e.children) r(t, void 0, void 0, [],
|
|
245
|
+
for (let t of e.children) r(t, void 0, void 0, [], Me);
|
|
246
246
|
return n;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function Ie(e) {
|
|
249
249
|
switch (e.kind) {
|
|
250
250
|
case "fixed":
|
|
251
251
|
case "managed":
|
|
@@ -255,63 +255,63 @@ function Le(e) {
|
|
|
255
255
|
case "rename": return e.from;
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function Le(e) {
|
|
259
259
|
return e.kind === "rename" ? `rename ${e.from} -> ${e.to}` : `${e.kind} ${e.path}`;
|
|
260
260
|
}
|
|
261
261
|
//#endregion
|
|
262
262
|
//#region src/structure/engine/glob.ts
|
|
263
|
-
var
|
|
264
|
-
function
|
|
263
|
+
var Re = /[.+^${}()|[\]\\]/g;
|
|
264
|
+
function ze(e) {
|
|
265
265
|
let t = "";
|
|
266
266
|
for (let n = 0; n < e.length; n++) {
|
|
267
267
|
let r = e[n];
|
|
268
|
-
r === "*" ? e[n + 1] === "*" ? (n++, e[n + 1] === "/" ? (n++, t += "(?:.*/)?") : t += ".*") : t += "[^/]*" : r === "?" ? t += "[^/]" : t += r.replace(
|
|
268
|
+
r === "*" ? e[n + 1] === "*" ? (n++, e[n + 1] === "/" ? (n++, t += "(?:.*/)?") : t += ".*") : t += "[^/]*" : r === "?" ? t += "[^/]" : t += r.replace(Re, "\\$&");
|
|
269
269
|
}
|
|
270
270
|
return RegExp(`^${t}$`);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
return
|
|
272
|
+
function Be(e, t) {
|
|
273
|
+
return ze(e).test(t);
|
|
274
274
|
}
|
|
275
275
|
//#endregion
|
|
276
276
|
//#region src/structure/engine/builders.ts
|
|
277
|
-
var
|
|
278
|
-
function
|
|
279
|
-
if (!
|
|
280
|
-
return
|
|
277
|
+
var x, Ve;
|
|
278
|
+
function He(e) {
|
|
279
|
+
if (!x) throw Error(`${e}() called outside defineStructure(). Builders must run inside the lambda passed to defineStructure(...).`);
|
|
280
|
+
return x;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
let n =
|
|
282
|
+
function S(e, t) {
|
|
283
|
+
let n = He(e);
|
|
284
284
|
n.stack[n.stack.length - 1].push(t);
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
let n =
|
|
288
|
-
|
|
286
|
+
function Ue(e, t) {
|
|
287
|
+
let n = Ve;
|
|
288
|
+
Ve = e;
|
|
289
289
|
try {
|
|
290
290
|
return t();
|
|
291
291
|
} finally {
|
|
292
|
-
|
|
292
|
+
Ve = n;
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
return
|
|
295
|
+
function We() {
|
|
296
|
+
return Ve;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
299
|
-
if (
|
|
298
|
+
function Ge(e) {
|
|
299
|
+
if (x) throw Error("defineStructure() cannot be called from inside another defineStructure().");
|
|
300
300
|
let t = [], n = {
|
|
301
301
|
root: t,
|
|
302
302
|
stack: [t],
|
|
303
303
|
inScope: !1
|
|
304
304
|
};
|
|
305
|
-
|
|
305
|
+
x = n;
|
|
306
306
|
try {
|
|
307
307
|
if (e(), n.stack.length !== 1) throw Error(`defineStructure: builder body left ${n.stack.length - 1} unclosed group frame(s)`);
|
|
308
308
|
let r = { children: t };
|
|
309
|
-
return
|
|
309
|
+
return Ke(r), r;
|
|
310
310
|
} finally {
|
|
311
|
-
|
|
311
|
+
x = void 0;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function Ke(e) {
|
|
315
315
|
let t = /* @__PURE__ */ new Map();
|
|
316
316
|
function n(e, r) {
|
|
317
317
|
if (e.kind === "scope") {
|
|
@@ -334,8 +334,8 @@ function qe(e) {
|
|
|
334
334
|
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.`);
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
let n =
|
|
337
|
+
function C(e, t) {
|
|
338
|
+
let n = He("scope");
|
|
339
339
|
if (n.inScope) throw Error("scope() cannot nest. Already inside a scope.");
|
|
340
340
|
let r = {
|
|
341
341
|
kind: "scope",
|
|
@@ -349,22 +349,22 @@ function S(e, t) {
|
|
|
349
349
|
n.stack.pop(), n.inScope = !1;
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
var
|
|
353
|
-
function
|
|
354
|
-
|
|
352
|
+
var qe;
|
|
353
|
+
function Je(e) {
|
|
354
|
+
qe = e;
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
|
|
356
|
+
function w(e, t, n) {
|
|
357
|
+
Ye(e, t), n && Ye((t) => !e(t), n);
|
|
358
358
|
}
|
|
359
|
-
function
|
|
360
|
-
if (
|
|
361
|
-
|
|
359
|
+
function Ye(e, t) {
|
|
360
|
+
if (x) {
|
|
361
|
+
Xe(e, t);
|
|
362
362
|
return;
|
|
363
363
|
}
|
|
364
|
-
if (!(
|
|
364
|
+
if (!(qe?.(e, t) ?? !1)) throw Error("when() called outside defineStructure() and outside any managed(...) body. Place this call inside one of the two.");
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
let n =
|
|
366
|
+
function Xe(e, t) {
|
|
367
|
+
let n = x, r = {
|
|
368
368
|
kind: "when",
|
|
369
369
|
trigger: e,
|
|
370
370
|
children: []
|
|
@@ -376,11 +376,11 @@ function Ze(e, t) {
|
|
|
376
376
|
n.stack.pop();
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function T(e) {
|
|
380
380
|
return (t) => t.filesMatch(e);
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
let r =
|
|
382
|
+
function Ze(e, t, n) {
|
|
383
|
+
let r = He(e), i = {
|
|
384
384
|
kind: "mode",
|
|
385
385
|
modes: t,
|
|
386
386
|
children: []
|
|
@@ -392,70 +392,70 @@ function Qe(e, t, n) {
|
|
|
392
392
|
r.stack.pop();
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
|
|
395
|
+
function Qe(e) {
|
|
396
|
+
Ze("onInitOrUpdate", ["init", "updateDeps"], e);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
|
|
398
|
+
function E(e, t) {
|
|
399
|
+
S("fixed", {
|
|
400
400
|
kind: "fixed",
|
|
401
401
|
path: e,
|
|
402
402
|
content: t
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
|
|
405
|
+
function D(e, t, n) {
|
|
406
|
+
S("managed", {
|
|
407
407
|
kind: "managed",
|
|
408
408
|
path: e,
|
|
409
409
|
initial: t,
|
|
410
410
|
body: n
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
|
-
function
|
|
414
|
-
|
|
413
|
+
function O(e, t) {
|
|
414
|
+
S("scaffold", {
|
|
415
415
|
kind: "scaffold",
|
|
416
416
|
path: e,
|
|
417
417
|
initial: t
|
|
418
418
|
});
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
|
|
420
|
+
function k(e, t) {
|
|
421
|
+
S("seed", {
|
|
422
422
|
kind: "seed",
|
|
423
423
|
path: e,
|
|
424
424
|
initial: t
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
|
|
427
|
+
function A(e) {
|
|
428
|
+
S("remove", {
|
|
429
429
|
kind: "remove",
|
|
430
430
|
path: e
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function j(e) {
|
|
434
434
|
return {
|
|
435
435
|
kind: "file",
|
|
436
436
|
path: e
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function $e(e) {
|
|
440
440
|
return {
|
|
441
441
|
kind: "binary",
|
|
442
442
|
path: e
|
|
443
443
|
};
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function et(e) {
|
|
446
446
|
return {
|
|
447
447
|
kind: "text",
|
|
448
448
|
value: e
|
|
449
449
|
};
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function M(e, t) {
|
|
452
452
|
return {
|
|
453
453
|
kind: "tpl",
|
|
454
454
|
path: e,
|
|
455
455
|
vars: t
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function N(e) {
|
|
459
459
|
return {
|
|
460
460
|
kind: "generate",
|
|
461
461
|
fn: e
|
|
@@ -463,69 +463,69 @@ function M(e) {
|
|
|
463
463
|
}
|
|
464
464
|
//#endregion
|
|
465
465
|
//#region src/structure/engine/parsers/json.ts
|
|
466
|
-
function
|
|
466
|
+
function tt(e) {
|
|
467
467
|
return JSON.parse(e);
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
function
|
|
471
|
-
return e.length === 0 ? "[]" : "[" + e.map(
|
|
469
|
+
var nt = 100, rt = 2;
|
|
470
|
+
function it(e) {
|
|
471
|
+
return e.length === 0 ? "[]" : "[" + e.map(at).join(", ") + "]";
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
if (Array.isArray(e)) return
|
|
475
|
-
if (
|
|
473
|
+
function at(e) {
|
|
474
|
+
if (Array.isArray(e)) return it(e);
|
|
475
|
+
if (P(e)) {
|
|
476
476
|
let t = Object.entries(e);
|
|
477
|
-
return t.length === 0 ? "{}" : "{ " + t.map(([e, t]) => `${JSON.stringify(e)}: ${
|
|
477
|
+
return t.length === 0 ? "{}" : "{ " + t.map(([e, t]) => `${JSON.stringify(e)}: ${at(t)}`).join(", ") + " }";
|
|
478
478
|
}
|
|
479
479
|
return JSON.stringify(e);
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
let i = t +
|
|
481
|
+
function ot(e, t, n, r) {
|
|
482
|
+
let i = t + rt, a = " ".repeat(i);
|
|
483
483
|
if (Array.isArray(e)) {
|
|
484
|
-
let o =
|
|
485
|
-
if (n + o.length + r <=
|
|
484
|
+
let o = it(e);
|
|
485
|
+
if (n + o.length + r <= nt) return o;
|
|
486
486
|
let s = e.length - 1;
|
|
487
|
-
return "[\n" + e.map((e, t) => a +
|
|
487
|
+
return "[\n" + e.map((e, t) => a + ot(e, i, i, t === s ? 0 : 1)).join(",\n") + "\n" + " ".repeat(t) + "]";
|
|
488
488
|
}
|
|
489
|
-
if (
|
|
489
|
+
if (P(e)) {
|
|
490
490
|
let n = Object.entries(e);
|
|
491
491
|
if (n.length === 0) return "{}";
|
|
492
492
|
let r = n.length - 1;
|
|
493
493
|
return "{\n" + n.map(([e, t], n) => {
|
|
494
494
|
let o = `${a}${JSON.stringify(e)}: `;
|
|
495
|
-
return o +
|
|
495
|
+
return o + ot(t, i, o.length, n === r ? 0 : 1);
|
|
496
496
|
}).join(",\n") + "\n" + " ".repeat(t) + "}";
|
|
497
497
|
}
|
|
498
498
|
return JSON.stringify(e);
|
|
499
499
|
}
|
|
500
|
-
function
|
|
501
|
-
return t?.collapse ?
|
|
500
|
+
function st(e, t) {
|
|
501
|
+
return t?.collapse ? ot(JSON.parse(JSON.stringify(e ?? null)), 0, 0, 0) + "\n" : JSON.stringify(e, null, 2) + "\n";
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function ct(e) {
|
|
504
504
|
return e === "" || e === void 0 ? [] : e.split(".");
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function P(e) {
|
|
507
507
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
let n =
|
|
509
|
+
function lt(e, t) {
|
|
510
|
+
let n = ct(t), r = e;
|
|
511
511
|
for (let e of n) {
|
|
512
|
-
if (!
|
|
512
|
+
if (!P(r)) return;
|
|
513
513
|
r = r[e];
|
|
514
514
|
}
|
|
515
515
|
return r;
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
let n =
|
|
517
|
+
function ut(e, t) {
|
|
518
|
+
let n = ct(t);
|
|
519
519
|
if (n.length === 0) return !0;
|
|
520
520
|
let r = e;
|
|
521
521
|
for (let e = 0; e < n.length - 1; e++) {
|
|
522
|
-
if (!
|
|
522
|
+
if (!P(r)) return !1;
|
|
523
523
|
r = r[n[e]];
|
|
524
524
|
}
|
|
525
|
-
return
|
|
525
|
+
return P(r) ? n[n.length - 1] in r : !1;
|
|
526
526
|
}
|
|
527
|
-
function
|
|
528
|
-
let r =
|
|
527
|
+
function dt(e, t, n) {
|
|
528
|
+
let r = ct(t);
|
|
529
529
|
if (r.length === 0) throw Error("setAtPath: jsonPath must be non-empty");
|
|
530
530
|
let i = e;
|
|
531
531
|
for (let e = 0; e < r.length - 1; e++) {
|
|
@@ -533,22 +533,22 @@ function ft(e, t, n) {
|
|
|
533
533
|
if (n === void 0) {
|
|
534
534
|
let e = {};
|
|
535
535
|
i[t] = e, i = e;
|
|
536
|
-
} else if (
|
|
536
|
+
} else if (P(n)) i = n;
|
|
537
537
|
else throw Error(`setAtPath: cannot descend into non-object at '${r.slice(0, e + 1).join(".")}'`);
|
|
538
538
|
}
|
|
539
539
|
i[r[r.length - 1]] = n;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
let n =
|
|
541
|
+
function ft(e, t) {
|
|
542
|
+
let n = ct(t);
|
|
543
543
|
if (n.length === 0) throw Error("deleteAtPath: jsonPath must be non-empty");
|
|
544
544
|
let r = e;
|
|
545
545
|
for (let e = 0; e < n.length - 1; e++) {
|
|
546
|
-
if (!
|
|
546
|
+
if (!P(r)) return;
|
|
547
547
|
r = r[n[e]];
|
|
548
548
|
}
|
|
549
|
-
|
|
549
|
+
P(r) && delete r[n[n.length - 1]];
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function pt(e, t) {
|
|
552
552
|
let n = new Set(t), r = Object.keys(e), i = /* @__PURE__ */ new Map();
|
|
553
553
|
i.set("", []);
|
|
554
554
|
let a = "";
|
|
@@ -563,63 +563,63 @@ function mt(e, t) {
|
|
|
563
563
|
}
|
|
564
564
|
//#endregion
|
|
565
565
|
//#region src/structure/engine/parsers/lines.ts
|
|
566
|
-
function
|
|
566
|
+
function mt(e) {
|
|
567
567
|
let t = e.split("\n");
|
|
568
568
|
return t.length > 0 && t[t.length - 1] === "" && t.pop(), t;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function ht(e) {
|
|
571
571
|
return e.join("\n") + "\n";
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function gt(e) {
|
|
574
574
|
return e.replace(/(^|\s)#.*$/, "$1").trim();
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
let n =
|
|
576
|
+
function _t(e, t) {
|
|
577
|
+
let n = gt(e);
|
|
578
578
|
return n === "" ? !1 : n === t.trim();
|
|
579
579
|
}
|
|
580
|
-
function
|
|
581
|
-
for (let n of e) if (
|
|
580
|
+
function vt(e, t) {
|
|
581
|
+
for (let n of e) if (_t(n, t)) return !0;
|
|
582
582
|
return !1;
|
|
583
583
|
}
|
|
584
584
|
//#endregion
|
|
585
585
|
//#region src/structure/engine/content-rules.ts
|
|
586
|
-
function
|
|
586
|
+
function yt(e, t) {
|
|
587
587
|
return e === "sdk:" ? t ? "workspace:*" : "catalog:" : e;
|
|
588
588
|
}
|
|
589
|
-
var
|
|
589
|
+
var bt = [
|
|
590
590
|
"dependencies",
|
|
591
591
|
"devDependencies",
|
|
592
592
|
"peerDependencies",
|
|
593
593
|
"optionalDependencies"
|
|
594
594
|
];
|
|
595
|
-
function
|
|
596
|
-
if (L(e)) for (let n of
|
|
595
|
+
function xt(e, t) {
|
|
596
|
+
if (L(e)) for (let n of bt) {
|
|
597
597
|
let r = e[n];
|
|
598
598
|
if (L(r)) for (let e of Object.keys(r)) r[e] === "sdk:" && (r[e] = t ? "workspace:*" : "catalog:");
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
|
-
var
|
|
602
|
-
function
|
|
603
|
-
if (!
|
|
604
|
-
return
|
|
601
|
+
var F;
|
|
602
|
+
function St(e) {
|
|
603
|
+
if (!F) throw Error(`${e}() only valid inside a managed(...) body. Move this call inside managed(path, initial, () => {...}).`);
|
|
604
|
+
return F;
|
|
605
605
|
}
|
|
606
|
-
function
|
|
607
|
-
let t =
|
|
606
|
+
function I(e) {
|
|
607
|
+
let t = St(e);
|
|
608
608
|
if (t.kind !== "json") throw Error(`${e}() requires a JSON-managed body; got '${t.kind}'.`);
|
|
609
609
|
return t;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
612
|
-
let t =
|
|
611
|
+
function Ct(e) {
|
|
612
|
+
let t = St(e);
|
|
613
613
|
if (t.kind !== "yaml") throw Error(`${e}() requires a YAML-managed body; got '${t.kind}'.`);
|
|
614
614
|
return t;
|
|
615
615
|
}
|
|
616
616
|
function wt(e) {
|
|
617
|
-
let t =
|
|
617
|
+
let t = St(e);
|
|
618
618
|
if (t.kind !== "lines") throw Error(`${e}() requires a lines-managed body; got '${t.kind}'.`);
|
|
619
619
|
return t;
|
|
620
620
|
}
|
|
621
621
|
function Tt(e, t) {
|
|
622
|
-
let n = e.ctx ??
|
|
622
|
+
let n = e.ctx ?? We();
|
|
623
623
|
if (!n) throw Error(`${t}() needs a RunContext but none is active. Pass { ctx } via the with-managed-* helper or run inside engine.run(...).`);
|
|
624
624
|
return n;
|
|
625
625
|
}
|
|
@@ -627,8 +627,8 @@ function L(e) {
|
|
|
627
627
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
628
628
|
}
|
|
629
629
|
function Et(e, t, n = {}) {
|
|
630
|
-
if (
|
|
631
|
-
|
|
630
|
+
if (F) throw Error("Nested managed(...) body — engine bug.");
|
|
631
|
+
F = {
|
|
632
632
|
kind: "json",
|
|
633
633
|
obj: e,
|
|
634
634
|
ctx: n.ctx,
|
|
@@ -637,12 +637,12 @@ function Et(e, t, n = {}) {
|
|
|
637
637
|
try {
|
|
638
638
|
return t(n.ctx ?? n.triggerContext?.ctx), e;
|
|
639
639
|
} finally {
|
|
640
|
-
|
|
640
|
+
F = void 0;
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
643
|
function Dt(e, t, n = {}) {
|
|
644
|
-
if (
|
|
645
|
-
|
|
644
|
+
if (F) throw Error("Nested managed(...) body — engine bug.");
|
|
645
|
+
F = {
|
|
646
646
|
kind: "yaml",
|
|
647
647
|
doc: e,
|
|
648
648
|
ctx: n.ctx,
|
|
@@ -653,12 +653,12 @@ function Dt(e, t, n = {}) {
|
|
|
653
653
|
try {
|
|
654
654
|
return t(n.ctx ?? n.triggerContext?.ctx), e;
|
|
655
655
|
} finally {
|
|
656
|
-
|
|
656
|
+
F = void 0;
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
659
|
function Ot(e, t, n = {}) {
|
|
660
|
-
if (
|
|
661
|
-
|
|
660
|
+
if (F) throw Error("Nested managed(...) body — engine bug.");
|
|
661
|
+
F = {
|
|
662
662
|
kind: "lines",
|
|
663
663
|
lines: e,
|
|
664
664
|
ctx: n.ctx,
|
|
@@ -667,30 +667,30 @@ function Ot(e, t, n = {}) {
|
|
|
667
667
|
try {
|
|
668
668
|
return t(n.ctx ?? n.triggerContext?.ctx), e;
|
|
669
669
|
} finally {
|
|
670
|
-
|
|
670
|
+
F = void 0;
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
|
-
|
|
674
|
-
if (!
|
|
675
|
-
let n =
|
|
673
|
+
Je((e, t) => {
|
|
674
|
+
if (!F) return !1;
|
|
675
|
+
let n = F.triggerContext;
|
|
676
676
|
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.");
|
|
677
677
|
return e(n) && t(), !0;
|
|
678
678
|
});
|
|
679
679
|
function R(e, t) {
|
|
680
|
-
|
|
680
|
+
dt(I("ensureField").obj, e, t);
|
|
681
681
|
}
|
|
682
682
|
function kt(e, t) {
|
|
683
|
-
let n =
|
|
684
|
-
|
|
683
|
+
let n = I("removeField").obj;
|
|
684
|
+
ut(n, e) && (t && !t(lt(n, e)) || ft(n, e));
|
|
685
685
|
}
|
|
686
686
|
function At(e, t) {
|
|
687
|
-
let n =
|
|
688
|
-
if (!
|
|
687
|
+
let n = I("requireField").obj;
|
|
688
|
+
if (!ut(n, e)) throw Error(t ?? `requireField: missing field '${e}'`);
|
|
689
689
|
}
|
|
690
690
|
function jt(e, t) {
|
|
691
|
-
let n =
|
|
691
|
+
let n = I("ensureFieldEntries").obj, r = ut(n, e) ? lt(n, e) : void 0, i = L(r) ? r : {};
|
|
692
692
|
for (let [e, n] of Object.entries(t)) i[e] = n;
|
|
693
|
-
L(r) ||
|
|
693
|
+
L(r) || dt(n, e, i);
|
|
694
694
|
}
|
|
695
695
|
function z(e, t) {
|
|
696
696
|
R(`scripts.${e}`, t);
|
|
@@ -705,7 +705,7 @@ var Mt = [
|
|
|
705
705
|
"optionalDependencies"
|
|
706
706
|
];
|
|
707
707
|
function Nt(e, t, n, r) {
|
|
708
|
-
let i =
|
|
708
|
+
let i = I(e), a = i.obj, o = n === "sdk:" ? yt(n, Tt(i, e).isSdkInternal) : n;
|
|
709
709
|
for (let e of Mt) {
|
|
710
710
|
if (e === r) continue;
|
|
711
711
|
let n = a[e];
|
|
@@ -724,7 +724,7 @@ function Ft(e, t) {
|
|
|
724
724
|
Nt("ensurePeerDep", e, t, "peerDependencies");
|
|
725
725
|
}
|
|
726
726
|
function H(e) {
|
|
727
|
-
let t =
|
|
727
|
+
let t = I("removeDep").obj;
|
|
728
728
|
for (let n of Mt) {
|
|
729
729
|
let r = t[n];
|
|
730
730
|
L(r) && e in r && delete r[e];
|
|
@@ -737,7 +737,7 @@ function It(e) {
|
|
|
737
737
|
for (let [t, n] of Object.entries(e)) Ft(t, n);
|
|
738
738
|
}
|
|
739
739
|
function Lt(e, t, n) {
|
|
740
|
-
let r = Tt(
|
|
740
|
+
let r = Tt(I(e), e);
|
|
741
741
|
for (let i of r.modules) i.scope === t && Nt(e, i.name, "workspace:*", n);
|
|
742
742
|
}
|
|
743
743
|
function Rt(e) {
|
|
@@ -747,16 +747,16 @@ function zt(e) {
|
|
|
747
747
|
Lt("ensureWorkspaceScopeDevDeps", e, "devDependencies");
|
|
748
748
|
}
|
|
749
749
|
function Bt(e) {
|
|
750
|
-
let t =
|
|
750
|
+
let t = I("pruneKeysMatching").obj;
|
|
751
751
|
for (let n of Object.keys(t)) e(n, t[n]) && delete t[n];
|
|
752
752
|
}
|
|
753
753
|
function Vt(e, t) {
|
|
754
|
-
let n =
|
|
754
|
+
let n = pt(e, t);
|
|
755
755
|
for (let t of Object.keys(e)) delete e[t];
|
|
756
756
|
for (let t of Object.keys(n)) e[t] = n[t];
|
|
757
757
|
}
|
|
758
758
|
function W(e) {
|
|
759
|
-
Vt(
|
|
759
|
+
Vt(I("enforceFieldOrder").obj, e);
|
|
760
760
|
}
|
|
761
761
|
function Ht(e, t) {
|
|
762
762
|
let n = Object.keys(e).sort(), r = {};
|
|
@@ -767,20 +767,20 @@ function Ht(e, t) {
|
|
|
767
767
|
function G(e = "", t = {}) {
|
|
768
768
|
let n = t.recursive ?? !1;
|
|
769
769
|
if (e === "" && !n) return;
|
|
770
|
-
let r =
|
|
770
|
+
let r = I("enforceAlphabeticalOrder").obj;
|
|
771
771
|
if (e === "") {
|
|
772
772
|
Ht(r, !0);
|
|
773
773
|
return;
|
|
774
774
|
}
|
|
775
|
-
let i =
|
|
775
|
+
let i = lt(r, e);
|
|
776
776
|
L(i) && Ht(i, n);
|
|
777
777
|
}
|
|
778
778
|
function Ut(e, t) {
|
|
779
|
-
let n =
|
|
780
|
-
|
|
779
|
+
let n = I("transformAt").obj;
|
|
780
|
+
dt(n, e, t(lt(n, e)));
|
|
781
781
|
}
|
|
782
782
|
function Wt() {
|
|
783
|
-
let e =
|
|
783
|
+
let e = Ct("ensureWorkspaceModulePaths"), t = Tt(e, "ensureWorkspaceModulePaths").modules.filter((e) => e.path !== "").map((e) => e.path).sort(), n = e.doc.toJSON()?.packages;
|
|
784
784
|
Array.isArray(n) && n.length === t.length && n.every((e, n) => e === t[n]) || e.doc.setIn(["packages"], t);
|
|
785
785
|
}
|
|
786
786
|
function Gt(e, t) {
|
|
@@ -788,33 +788,33 @@ function Gt(e, t) {
|
|
|
788
788
|
return typeof n == "string" ? n : void 0;
|
|
789
789
|
}
|
|
790
790
|
function Kt(e, t) {
|
|
791
|
-
let n =
|
|
791
|
+
let n = Ct("ensureCatalogVersion");
|
|
792
792
|
Gt(n, e) === void 0 && n.doc.setIn(["catalog", e], t);
|
|
793
793
|
}
|
|
794
794
|
function qt(e) {
|
|
795
|
-
let t =
|
|
795
|
+
let t = Ct("ensureCatalogLatest");
|
|
796
796
|
if (!t.getLatestVersion) return;
|
|
797
797
|
let n = t.getLatestVersion(e);
|
|
798
798
|
n !== void 0 && Gt(t, e) !== n && t.doc.setIn(["catalog", e], n);
|
|
799
799
|
}
|
|
800
800
|
function Jt(e, t) {
|
|
801
|
-
let n =
|
|
801
|
+
let n = Ct("pinCatalogToDependencyOf");
|
|
802
802
|
if (!n.getDerivedDependencyPin) return;
|
|
803
803
|
let r = n.getDerivedDependencyPin(e);
|
|
804
804
|
r !== void 0 && Gt(n, e) !== r && n.doc.setIn(["catalog", e], r);
|
|
805
805
|
}
|
|
806
806
|
function Yt(e) {
|
|
807
|
-
let t =
|
|
807
|
+
let t = Ct("ensureCatalogAbsent");
|
|
808
808
|
t.doc.hasIn(["catalog", e]) && t.doc.deleteIn(["catalog", e]);
|
|
809
809
|
}
|
|
810
810
|
function Xt(e) {
|
|
811
811
|
let t = wt("ensureGitignoreEntries");
|
|
812
|
-
for (let n of e)
|
|
812
|
+
for (let n of e) vt(t.lines, n) || t.lines.push(n);
|
|
813
813
|
}
|
|
814
814
|
//#endregion
|
|
815
815
|
//#region src/structure/engine/parsers/yaml.ts
|
|
816
816
|
function Zt(e) {
|
|
817
|
-
return
|
|
817
|
+
return ue(e);
|
|
818
818
|
}
|
|
819
819
|
function Qt(e) {
|
|
820
820
|
return e.toString();
|
|
@@ -855,11 +855,11 @@ function on(e, t, n, r) {
|
|
|
855
855
|
return n.staticRead(e.path);
|
|
856
856
|
case "tpl":
|
|
857
857
|
if (!n) throw Error(`tpl('${e.path}'): no TemplateProvider configured. Pass opts.templates to engine.run(...).`);
|
|
858
|
-
return
|
|
858
|
+
return je(n.textRead(e.path), typeof e.vars == "function" ? e.vars(r) : e.vars);
|
|
859
859
|
case "generate": {
|
|
860
860
|
let n = e.fn(r);
|
|
861
|
-
if (t.endsWith(".json")) return
|
|
862
|
-
if (t.endsWith(".yaml") || t.endsWith(".yml")) return
|
|
861
|
+
if (t.endsWith(".json")) return xt(n, r.isSdkInternal), st(n, { collapse: !t.endsWith("package.json") });
|
|
862
|
+
if (t.endsWith(".yaml") || t.endsWith(".yml")) return de(n);
|
|
863
863
|
if (typeof n != "string") throw Error(`generate() for '${t}' must return a string for non-JSON/YAML files; got ${typeof n}`);
|
|
864
864
|
return n;
|
|
865
865
|
}
|
|
@@ -877,9 +877,9 @@ function sn(e, t, n, r, i) {
|
|
|
877
877
|
function cn(e, t, n, r, i, a) {
|
|
878
878
|
let o = e.split("/").pop() ?? e;
|
|
879
879
|
if (e.endsWith(".json")) {
|
|
880
|
-
let i =
|
|
880
|
+
let i = tt(t);
|
|
881
881
|
if (typeof i != "object" || !i || Array.isArray(i)) throw Error(`managed: parsed value at '${e}' is not a JSON object`);
|
|
882
|
-
return Et(i, n, { triggerContext: r }),
|
|
882
|
+
return Et(i, n, { triggerContext: r }), st(i, { collapse: o !== "package.json" });
|
|
883
883
|
}
|
|
884
884
|
if (e.endsWith(".yaml") || e.endsWith(".yml")) {
|
|
885
885
|
let e = Zt(t);
|
|
@@ -890,8 +890,8 @@ function cn(e, t, n, r, i, a) {
|
|
|
890
890
|
}), Qt(e);
|
|
891
891
|
}
|
|
892
892
|
if (o === ".gitignore" || o.endsWith(".gitignore")) {
|
|
893
|
-
let e =
|
|
894
|
-
return Ot(e, n, { triggerContext: r }),
|
|
893
|
+
let e = mt(t);
|
|
894
|
+
return Ot(e, n, { triggerContext: r }), ht(e);
|
|
895
895
|
}
|
|
896
896
|
throw Error(`managed('${e}'): unsupported file kind. Only .json, .yaml, .yml, .gitignore are dispatched.`);
|
|
897
897
|
}
|
|
@@ -916,7 +916,7 @@ function dn(e, t, n) {
|
|
|
916
916
|
pathMissing: (t) => !un(e, t),
|
|
917
917
|
filesMatch: (t) => {
|
|
918
918
|
let r = n ? `${n}/${t}` : t;
|
|
919
|
-
for (let t of e) if (
|
|
919
|
+
for (let t of e) if (Be(r, t)) return !0;
|
|
920
920
|
return !1;
|
|
921
921
|
}
|
|
922
922
|
};
|
|
@@ -980,14 +980,14 @@ function gn(e, t, n, r, i, a, o, s) {
|
|
|
980
980
|
if (e.leaf.kind !== "managed") return;
|
|
981
981
|
let c = e.leaf, l = e.resolvedPath, u = t.exists(l), d, f = !1;
|
|
982
982
|
u ? d = t.read(l) : (d = on(c.initial, l, i, s), f = !0);
|
|
983
|
-
let
|
|
984
|
-
if (f) return n || t.write(l,
|
|
983
|
+
let p = cn(l, d, c.body, r, a, o);
|
|
984
|
+
if (f) return n || t.write(l, p), {
|
|
985
985
|
scope: e.scope,
|
|
986
986
|
path: l,
|
|
987
987
|
primitive: "managed",
|
|
988
988
|
action: "create"
|
|
989
989
|
};
|
|
990
|
-
if (
|
|
990
|
+
if (p !== d) return n || t.write(l, p), {
|
|
991
991
|
scope: e.scope,
|
|
992
992
|
path: l,
|
|
993
993
|
primitive: "managed",
|
|
@@ -1012,14 +1012,14 @@ function _n(e, t, n, r, i, a, o, s) {
|
|
|
1012
1012
|
return l;
|
|
1013
1013
|
}
|
|
1014
1014
|
function vn(e, t, n, r = {}) {
|
|
1015
|
-
return
|
|
1016
|
-
let i =
|
|
1015
|
+
return Ue(n, () => {
|
|
1016
|
+
let i = Fe(e, n), a = !!r.initMode, o = _n(i, t, n, n.dryRun, r.templates, a, r.registryLookup, r.derivedPinLookup);
|
|
1017
1017
|
if (!n.dryRun && !n.updateDepsOnly && !a) {
|
|
1018
1018
|
rn(t, { version: 3 });
|
|
1019
1019
|
let i = {
|
|
1020
1020
|
...r.rediscover ? r.rediscover(t) : n,
|
|
1021
1021
|
dryRun: !0
|
|
1022
|
-
}, a = _n(
|
|
1022
|
+
}, a = _n(Fe(e, i), t, i, !0, r.templates, !1, r.registryLookup, r.derivedPinLookup).filter((e) => e.path !== $t);
|
|
1023
1023
|
if (a.length > 0) throw new an(a[0]);
|
|
1024
1024
|
}
|
|
1025
1025
|
return a && !n.dryRun && rn(t, { version: 3 }), { changes: o };
|
|
@@ -1188,7 +1188,7 @@ function Mn(e) {
|
|
|
1188
1188
|
} catch {
|
|
1189
1189
|
throw new J("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.");
|
|
1190
1190
|
}
|
|
1191
|
-
let n =
|
|
1191
|
+
let n = le(t) ?? {}, r = Array.isArray(n.packages) ? n.packages : [], i = new Set([""]);
|
|
1192
1192
|
for (let t of r) {
|
|
1193
1193
|
let n = jn(t);
|
|
1194
1194
|
(n === "" || e.exists(n)) && i.add(n);
|
|
@@ -1429,17 +1429,17 @@ async function Yn(e) {
|
|
|
1429
1429
|
n = await fetch(e, { signal: AbortSignal.timeout(qn) });
|
|
1430
1430
|
} catch (e) {
|
|
1431
1431
|
if (t > Gn) throw e;
|
|
1432
|
-
await
|
|
1432
|
+
await fe(Kn * 2 ** (t - 1) * (.8 + .4 * Math.random()));
|
|
1433
1433
|
continue;
|
|
1434
1434
|
}
|
|
1435
1435
|
if (n.ok) return n;
|
|
1436
1436
|
if (!(n.status === 429 || n.status >= 500) || t > Gn) throw Error(`registry returned HTTP ${n.status}`);
|
|
1437
1437
|
let r = Jn(n.headers.get("retry-after"));
|
|
1438
1438
|
if (r != null) {
|
|
1439
|
-
await
|
|
1439
|
+
await fe(r);
|
|
1440
1440
|
continue;
|
|
1441
1441
|
}
|
|
1442
|
-
await
|
|
1442
|
+
await fe(Kn * 2 ** (t - 1) * (.8 + .4 * Math.random()));
|
|
1443
1443
|
}
|
|
1444
1444
|
}
|
|
1445
1445
|
function Xn() {
|
|
@@ -1589,19 +1589,19 @@ function Cr() {
|
|
|
1589
1589
|
//#endregion
|
|
1590
1590
|
//#region src/structure/rules/root.ts
|
|
1591
1591
|
function wr() {
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1592
|
+
C("root", () => {
|
|
1593
|
+
w(({ ctx: e }) => !e.isSdkInternal, () => {
|
|
1594
|
+
D("turbo.json", N(() => Un()), () => {
|
|
1595
1595
|
Wn();
|
|
1596
|
-
}),
|
|
1596
|
+
}), E(".vscode/settings.json", j("root/.vscode/settings.json")), D("package.json", N(() => Rn()), () => {
|
|
1597
1597
|
zn();
|
|
1598
|
-
}),
|
|
1598
|
+
}), D("pnpm-workspace.yaml", N((e) => fr(e)), () => {
|
|
1599
1599
|
pr();
|
|
1600
|
-
}),
|
|
1600
|
+
}), D(".gitignore", j("root/.gitignore"), () => {
|
|
1601
1601
|
hr();
|
|
1602
|
-
}),
|
|
1602
|
+
}), D(".changeset/config.json", N(() => Sr()), () => {
|
|
1603
1603
|
Cr();
|
|
1604
|
-
}),
|
|
1604
|
+
}), k(".changeset/scaffold.md", et(gr));
|
|
1605
1605
|
});
|
|
1606
1606
|
});
|
|
1607
1607
|
}
|
|
@@ -1611,15 +1611,15 @@ function Tr(e) {
|
|
|
1611
1611
|
return e.split(/[-_]+/).filter((e) => e.length > 0).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
1612
1612
|
}
|
|
1613
1613
|
function Er() {
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1614
|
+
C("root", () => {
|
|
1615
|
+
w(({ ctx: e }) => !e.isSdkInternal, () => {
|
|
1616
|
+
E(".github/workflows/build.yaml", M("workflows/build.tpl.yaml", (e) => {
|
|
1617
1617
|
let t = e.blockVars.shortName;
|
|
1618
1618
|
return {
|
|
1619
1619
|
appName: `Block: ${Tr(t)}`,
|
|
1620
1620
|
appNameSlug: `block-${t}`
|
|
1621
1621
|
};
|
|
1622
|
-
})),
|
|
1622
|
+
})), E(".github/workflows/mark-stable.yaml", M("workflows/mark-stable.tpl.yaml", (e) => ({ appName: `Block: ${Tr(e.blockVars.shortName)} - Mark Stable` })));
|
|
1623
1623
|
});
|
|
1624
1624
|
});
|
|
1625
1625
|
}
|
|
@@ -1736,21 +1736,21 @@ function Rr(e) {
|
|
|
1736
1736
|
//#endregion
|
|
1737
1737
|
//#region src/structure/rules/block.ts
|
|
1738
1738
|
function zr() {
|
|
1739
|
-
|
|
1740
|
-
|
|
1739
|
+
C("block", () => {
|
|
1740
|
+
A("index.js"), A("index.d.ts"), E("src/index.ts", M("block/src/index.tpl.ts", (e) => ({
|
|
1741
1741
|
facadeName: e.blockVars.facadeName,
|
|
1742
1742
|
pascalName: Rr(e.blockVars.shortName)
|
|
1743
|
-
}))),
|
|
1743
|
+
}))), 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", $e("block/logos/block-logo.png")), k("logos/organization-logo.png", $e("block/logos/organization-logo.png")), D("package.json", N((e) => Ir(e)), (e) => {
|
|
1744
1744
|
Lr(e);
|
|
1745
1745
|
});
|
|
1746
1746
|
});
|
|
1747
1747
|
}
|
|
1748
1748
|
//#endregion
|
|
1749
1749
|
//#region src/structure/rules/shared/colocated-tests.ts
|
|
1750
|
-
var Q = "src/**/*.test.ts";
|
|
1750
|
+
var Q = "src/**/*.test.ts", Br = "src/**/*.test.tengo";
|
|
1751
1751
|
//#endregion
|
|
1752
1752
|
//#region src/structure/rules/model-package-json.ts
|
|
1753
|
-
function
|
|
1753
|
+
function Vr(e) {
|
|
1754
1754
|
return {
|
|
1755
1755
|
name: `${e.blockVars.facadeName}.model`,
|
|
1756
1756
|
version: X,
|
|
@@ -1788,7 +1788,7 @@ function Br(e) {
|
|
|
1788
1788
|
}
|
|
1789
1789
|
};
|
|
1790
1790
|
}
|
|
1791
|
-
function
|
|
1791
|
+
function Hr() {
|
|
1792
1792
|
Z(), R("private", !0), R("type", "module"), R("main", "dist/index.cjs"), R("module", "dist/index.js"), R("types", "dist/index.d.ts"), R("exports", {
|
|
1793
1793
|
".": {
|
|
1794
1794
|
types: "./dist/index.d.ts",
|
|
@@ -1803,29 +1803,29 @@ function Vr() {
|
|
|
1803
1803
|
}), It({
|
|
1804
1804
|
"@types/node": "*",
|
|
1805
1805
|
typescript: "*"
|
|
1806
|
-
}),
|
|
1806
|
+
}), w(({ ctx: e }) => !e.isSdkInternal, () => w(T(Q), () => {
|
|
1807
1807
|
z("test", "vitest run --passWithNoTests"), V("vitest", "catalog:"), V("@types/node", "*");
|
|
1808
1808
|
}, () => H("vitest"))), ar(), kt("tsup"), B("lint"), G("dependencies"), G("devDependencies"), G("peerDependencies"), G("optionalDependencies"), W([...Y]);
|
|
1809
1809
|
}
|
|
1810
1810
|
//#endregion
|
|
1811
1811
|
//#region src/structure/rules/model.ts
|
|
1812
|
-
function
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1812
|
+
function Ur() {
|
|
1813
|
+
C("model", () => {
|
|
1814
|
+
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", M("model/src/index.tpl.ts", (e) => ({ kindPkg: `${e.blockVars.facadeName}.kind` }))), D("package.json", N((e) => Vr(e)), () => {
|
|
1815
|
+
Hr();
|
|
1816
1816
|
});
|
|
1817
1817
|
});
|
|
1818
1818
|
}
|
|
1819
1819
|
//#endregion
|
|
1820
1820
|
//#region src/structure/rules/kind-package-json.ts
|
|
1821
|
-
var
|
|
1821
|
+
var Wr = { ".": {
|
|
1822
1822
|
types: "./dist/index.d.ts",
|
|
1823
1823
|
sources: "./src/index.ts",
|
|
1824
1824
|
import: "./dist/index.js",
|
|
1825
1825
|
require: "./dist/index.cjs",
|
|
1826
1826
|
default: "./dist/index.js"
|
|
1827
1827
|
} };
|
|
1828
|
-
function
|
|
1828
|
+
function Gr(e) {
|
|
1829
1829
|
return {
|
|
1830
1830
|
name: `${e.blockVars.facadeName}.kind`,
|
|
1831
1831
|
version: X,
|
|
@@ -1834,7 +1834,7 @@ function Wr(e) {
|
|
|
1834
1834
|
main: "./dist/index.cjs",
|
|
1835
1835
|
module: "./dist/index.js",
|
|
1836
1836
|
types: "./dist/index.d.ts",
|
|
1837
|
-
exports:
|
|
1837
|
+
exports: Wr,
|
|
1838
1838
|
scripts: {
|
|
1839
1839
|
fmt: "ts-builder format",
|
|
1840
1840
|
watch: "ts-builder build --target block-kind --watch",
|
|
@@ -1853,8 +1853,8 @@ function Wr(e) {
|
|
|
1853
1853
|
}
|
|
1854
1854
|
};
|
|
1855
1855
|
}
|
|
1856
|
-
function
|
|
1857
|
-
Z(), R("private", !0), R("type", "module"), R("main", "./dist/index.cjs"), R("module", "./dist/index.js"), R("types", "./dist/index.d.ts"), R("exports",
|
|
1856
|
+
function Kr() {
|
|
1857
|
+
Z(), R("private", !0), R("type", "module"), R("main", "./dist/index.cjs"), R("module", "./dist/index.js"), R("types", "./dist/index.d.ts"), R("exports", Wr), 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"), Pt("@platforma-sdk/block-kind", "sdk:"), U({
|
|
1858
1858
|
"@milaboratories/ts-builder": "sdk:",
|
|
1859
1859
|
"@milaboratories/ts-configs": "sdk:",
|
|
1860
1860
|
"@platforma-sdk/block-tools": "sdk:"
|
|
@@ -1865,16 +1865,16 @@ function Gr() {
|
|
|
1865
1865
|
}
|
|
1866
1866
|
//#endregion
|
|
1867
1867
|
//#region src/structure/rules/kind.ts
|
|
1868
|
-
function
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1868
|
+
function qr() {
|
|
1869
|
+
C("kind", () => {
|
|
1870
|
+
E("tsconfig.json", j("kind/tsconfig.json")), E(".oxlintrc.json", j("kind/.oxlintrc.json")), E(".oxfmtrc.json", j("kind/.oxfmtrc.json")), O("src/index.ts", j("kind/src/index.ts")), D("package.json", N((e) => Gr(e)), () => {
|
|
1871
|
+
Kr();
|
|
1872
1872
|
});
|
|
1873
1873
|
});
|
|
1874
1874
|
}
|
|
1875
1875
|
//#endregion
|
|
1876
1876
|
//#region src/structure/rules/ui-package-json.ts
|
|
1877
|
-
function
|
|
1877
|
+
function Jr(e) {
|
|
1878
1878
|
return {
|
|
1879
1879
|
name: `${e.blockVars.facadeName}.ui`,
|
|
1880
1880
|
version: X,
|
|
@@ -1902,29 +1902,29 @@ function qr(e) {
|
|
|
1902
1902
|
}
|
|
1903
1903
|
};
|
|
1904
1904
|
}
|
|
1905
|
-
function
|
|
1905
|
+
function Yr() {
|
|
1906
1906
|
Z(), R("private", !0), R("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"), Pt("@platforma-sdk/ui-vue", "sdk:"), Pt("vue", "catalog:"), Rt("model"), U({
|
|
1907
1907
|
"@milaboratories/ts-builder": "sdk:",
|
|
1908
1908
|
"@milaboratories/ts-configs": "sdk:"
|
|
1909
1909
|
}), ar(), B("preview"), B("lint"), It({
|
|
1910
1910
|
"@types/node": "*",
|
|
1911
1911
|
typescript: "*"
|
|
1912
|
-
}),
|
|
1912
|
+
}), w(({ ctx: e }) => !e.isSdkInternal, () => w(T(Q), () => {
|
|
1913
1913
|
z("test", "vitest run --passWithNoTests"), V("vitest", "catalog:"), V("@types/node", "*");
|
|
1914
1914
|
}, () => H("vitest"))), G("dependencies"), G("devDependencies"), G("peerDependencies"), G("optionalDependencies"), W([...Y]);
|
|
1915
1915
|
}
|
|
1916
1916
|
//#endregion
|
|
1917
1917
|
//#region src/structure/rules/ui.ts
|
|
1918
|
-
function
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1918
|
+
function Xr() {
|
|
1919
|
+
C("ui", () => {
|
|
1920
|
+
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) => Jr(e)), () => {
|
|
1921
|
+
Yr();
|
|
1922
1922
|
});
|
|
1923
1923
|
});
|
|
1924
1924
|
}
|
|
1925
1925
|
//#endregion
|
|
1926
1926
|
//#region src/structure/rules/workflow-package-json.ts
|
|
1927
|
-
function
|
|
1927
|
+
function Zr(e) {
|
|
1928
1928
|
return {
|
|
1929
1929
|
name: `${e.blockVars.facadeName}.workflow`,
|
|
1930
1930
|
version: X,
|
|
@@ -1946,10 +1946,12 @@ function Xr(e) {
|
|
|
1946
1946
|
}
|
|
1947
1947
|
};
|
|
1948
1948
|
}
|
|
1949
|
-
function
|
|
1950
|
-
Z(), R("private", !0), R("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.'"),
|
|
1951
|
-
z("test", "vitest run --passWithNoTests"), U({ vitest: "catalog:" });
|
|
1952
|
-
}, () =>
|
|
1949
|
+
function Qr() {
|
|
1950
|
+
Z(), R("private", !0), R("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.'"), w(({ ctx: e }) => !e.isSdkInternal, () => w(T(Q), () => {
|
|
1951
|
+
w(T(Br), () => z("test", "pl-tengo test && vitest run --passWithNoTests"), () => z("test", "vitest run --passWithNoTests")), U({ vitest: "catalog:" });
|
|
1952
|
+
}, () => {
|
|
1953
|
+
w(T(Br), () => z("test", "pl-tengo test")), H("vitest");
|
|
1954
|
+
})), Pt("@platforma-sdk/workflow-tengo", "sdk:"), Rt("software"), U({
|
|
1953
1955
|
"@platforma-sdk/tengo-builder": "sdk:",
|
|
1954
1956
|
"@platforma-sdk/test": "sdk:",
|
|
1955
1957
|
shx: "catalog:"
|
|
@@ -1957,20 +1959,20 @@ function Zr() {
|
|
|
1957
1959
|
}
|
|
1958
1960
|
//#endregion
|
|
1959
1961
|
//#region src/structure/rules/workflow.ts
|
|
1960
|
-
function
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1962
|
+
function $r() {
|
|
1963
|
+
C("workflow", () => {
|
|
1964
|
+
E("format.el", j("workflow/format.el")), w(({ ctx: e }) => !e.isSdkInternal, () => w(T(Q), () => {
|
|
1965
|
+
E("tsconfig.json", j("workflow/tsconfig.json")), O("vitest.config.mts", j("workflow/vitest.config.mts"));
|
|
1964
1966
|
}, () => {
|
|
1965
|
-
|
|
1966
|
-
})),
|
|
1967
|
-
|
|
1967
|
+
A("tsconfig.json"), A("vitest.config.mts");
|
|
1968
|
+
})), 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) => Zr(e)), () => {
|
|
1969
|
+
Qr();
|
|
1968
1970
|
});
|
|
1969
1971
|
});
|
|
1970
1972
|
}
|
|
1971
1973
|
//#endregion
|
|
1972
1974
|
//#region src/structure/rules/test-package-json.ts
|
|
1973
|
-
function
|
|
1975
|
+
function ei(e) {
|
|
1974
1976
|
return {
|
|
1975
1977
|
name: `${e.blockVars.facadeName}.test`,
|
|
1976
1978
|
version: X,
|
|
@@ -1990,7 +1992,7 @@ function $r(e) {
|
|
|
1990
1992
|
}
|
|
1991
1993
|
};
|
|
1992
1994
|
}
|
|
1993
|
-
function
|
|
1995
|
+
function ti() {
|
|
1994
1996
|
Z(), R("private", !0), R("type", "module"), z("fmt", "ts-builder format"), z("check", "ts-builder check --target block-test"), z("test", "vitest run --passWithNoTests"), B("lint"), U({
|
|
1995
1997
|
"@platforma-sdk/test": "sdk:",
|
|
1996
1998
|
"@milaboratories/ts-builder": "sdk:",
|
|
@@ -2000,17 +2002,17 @@ function ei() {
|
|
|
2000
2002
|
}
|
|
2001
2003
|
//#endregion
|
|
2002
2004
|
//#region src/structure/rules/test.ts
|
|
2003
|
-
function
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2005
|
+
function ni() {
|
|
2006
|
+
C("test", () => {
|
|
2007
|
+
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", et("import { expect, test } from \"vitest\";\n\ntest(\"scaffolded block sanity check\", () => {\n expect(true).toBe(true);\n});\n")), D("package.json", N((e) => ei(e)), () => {
|
|
2008
|
+
ti();
|
|
2007
2009
|
});
|
|
2008
2010
|
});
|
|
2009
2011
|
}
|
|
2010
2012
|
//#endregion
|
|
2011
2013
|
//#region src/structure/rules/software-package-json.ts
|
|
2012
|
-
var
|
|
2013
|
-
function
|
|
2014
|
+
var ri = "block-tools software build", ii = "shx rm -f *.tgz && block-tools software build && pnpm pack && shx mv platforma-open*.tgz package.tgz";
|
|
2015
|
+
function ai() {
|
|
2014
2016
|
return { entrypoints: { main: { binary: {
|
|
2015
2017
|
artifact: {
|
|
2016
2018
|
type: "python",
|
|
@@ -2025,7 +2027,7 @@ function ii() {
|
|
|
2025
2027
|
cmd: ["python", "{pkg}/main.py"]
|
|
2026
2028
|
} } } };
|
|
2027
2029
|
}
|
|
2028
|
-
function
|
|
2030
|
+
function oi(e) {
|
|
2029
2031
|
return {
|
|
2030
2032
|
name: `${e.blockVars.facadeName}.software`,
|
|
2031
2033
|
version: X,
|
|
@@ -2033,51 +2035,51 @@ function ai(e) {
|
|
|
2033
2035
|
description: "Block Software",
|
|
2034
2036
|
files: ["./dist/**/*"],
|
|
2035
2037
|
scripts: {
|
|
2036
|
-
build:
|
|
2037
|
-
"do-pack":
|
|
2038
|
+
build: ri,
|
|
2039
|
+
"do-pack": ii,
|
|
2038
2040
|
changeset: "changeset",
|
|
2039
2041
|
"version-packages": "changeset version"
|
|
2040
2042
|
},
|
|
2041
|
-
"block-software":
|
|
2043
|
+
"block-software": ai(),
|
|
2042
2044
|
devDependencies: {
|
|
2043
2045
|
"@platforma-open/milaboratories.runenv-python-3": "catalog:",
|
|
2044
2046
|
"@platforma-sdk/block-tools": "sdk:"
|
|
2045
2047
|
}
|
|
2046
2048
|
};
|
|
2047
2049
|
}
|
|
2048
|
-
function
|
|
2049
|
-
kt("private"), Z(), R("type", "module"), R("files", ["./dist/**/*"]), z("build",
|
|
2050
|
+
function si() {
|
|
2051
|
+
kt("private"), Z(), R("type", "module"), R("files", ["./dist/**/*"]), z("build", ri), z("do-pack", ii), 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"), G("dependencies"), G("devDependencies"), G("peerDependencies"), G("optionalDependencies"), W([...Y]);
|
|
2050
2052
|
}
|
|
2051
2053
|
//#endregion
|
|
2052
2054
|
//#region src/structure/rules/software.ts
|
|
2053
|
-
var
|
|
2054
|
-
function
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2055
|
+
var ci = "import sys\n\nprint(\"Hello from Python, \" + sys.argv[1] + \"!\")\n", li = "# No dependencies specified for this script\n";
|
|
2056
|
+
function ui() {
|
|
2057
|
+
C("software", () => {
|
|
2058
|
+
k("src/main.py", et(ci)), k("src/requirements.txt", et(li)), D("package.json", N((e) => oi(e)), () => {
|
|
2059
|
+
si();
|
|
2058
2060
|
});
|
|
2059
2061
|
});
|
|
2060
2062
|
}
|
|
2061
|
-
function
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
}),
|
|
2065
|
-
|
|
2066
|
-
}),
|
|
2067
|
-
|
|
2068
|
-
}),
|
|
2069
|
-
|
|
2063
|
+
function di() {
|
|
2064
|
+
C("model", () => {
|
|
2065
|
+
A("eslint.config.mjs"), A("vite.config.mts");
|
|
2066
|
+
}), C("ui", () => {
|
|
2067
|
+
A("eslint.config.mjs"), A("vite.config.ts"), A("tsconfig.app.json"), A("tsconfig.node.json");
|
|
2068
|
+
}), C("test", () => {
|
|
2069
|
+
A("eslint.config.mjs");
|
|
2070
|
+
}), C("root", () => {
|
|
2071
|
+
A(".prettierrc"), D("package.json", N(() => Rn()), () => {
|
|
2070
2072
|
B("pretty"), H("@platforma-sdk/blocks-deps-updater");
|
|
2071
2073
|
});
|
|
2072
2074
|
});
|
|
2073
2075
|
}
|
|
2074
2076
|
//#endregion
|
|
2075
2077
|
//#region src/structure/rules/root-catalog-bump.ts
|
|
2076
|
-
function
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2078
|
+
function fi() {
|
|
2079
|
+
Qe(() => {
|
|
2080
|
+
C("root", () => {
|
|
2081
|
+
w(({ ctx: e }) => !e.isSdkInternal, () => {
|
|
2082
|
+
D("pnpm-workspace.yaml", N((e) => fr(e)), (e) => {
|
|
2081
2083
|
for (let e of or) qt(e);
|
|
2082
2084
|
for (let e of lr) Jt(e.entry, {
|
|
2083
2085
|
of: e.of,
|
|
@@ -2092,23 +2094,23 @@ function di() {
|
|
|
2092
2094
|
}
|
|
2093
2095
|
//#endregion
|
|
2094
2096
|
//#region src/structure/structure-definition.ts
|
|
2095
|
-
var
|
|
2096
|
-
wr(), Er(), zr(),
|
|
2097
|
+
var pi = Ge(() => {
|
|
2098
|
+
wr(), Er(), zr(), Ur(), qr(), Xr(), $r(), ni(), ui(), di(), fi();
|
|
2097
2099
|
});
|
|
2098
2100
|
//#endregion
|
|
2099
2101
|
//#region src/structure/cli/run-structure.ts
|
|
2100
|
-
async function
|
|
2102
|
+
async function mi() {
|
|
2101
2103
|
return tr(or.filter(er));
|
|
2102
2104
|
}
|
|
2103
|
-
async function
|
|
2104
|
-
let t =
|
|
2105
|
+
async function hi(e) {
|
|
2106
|
+
let t = g.resolve(e.blockPath), n = e.mode === "check", r = new ke(t), i = new Ae(e.templatesRoot), a = vn(pi, r, Fn({
|
|
2105
2107
|
fs: r,
|
|
2106
2108
|
isSdkInternal: e.isSdkInternal,
|
|
2107
2109
|
updateDepsOnly: e.updateDepsOnly,
|
|
2108
2110
|
dryRun: n
|
|
2109
2111
|
}), {
|
|
2110
2112
|
templates: i,
|
|
2111
|
-
registryLookup: e.updateDepsOnly ? await
|
|
2113
|
+
registryLookup: e.updateDepsOnly ? await mi() : void 0,
|
|
2112
2114
|
derivedPinLookup: e.updateDepsOnly ? await rr(lr) : void 0,
|
|
2113
2115
|
rediscover: () => Fn({
|
|
2114
2116
|
fs: r,
|
|
@@ -2122,16 +2124,16 @@ async function mi(e) {
|
|
|
2122
2124
|
changes: a.changes
|
|
2123
2125
|
};
|
|
2124
2126
|
}
|
|
2125
|
-
function
|
|
2127
|
+
function gi(e, t) {
|
|
2126
2128
|
if (t.length === 0) return ` ${e}: up to date (0 changes)`;
|
|
2127
2129
|
let n = t.map((e) => ` ${e.action.padEnd(6)} ${e.primitive.padEnd(8)} ${e.path} [${e.scope}]`);
|
|
2128
2130
|
return ` ${e}: ${t.length} change(s)\n${n.join("\n")}`;
|
|
2129
2131
|
}
|
|
2130
2132
|
//#endregion
|
|
2131
2133
|
//#region src/cmd/structure/refresh.ts
|
|
2132
|
-
async function
|
|
2134
|
+
async function _i(e) {
|
|
2133
2135
|
for (let t of e.paths) {
|
|
2134
|
-
let n = await
|
|
2136
|
+
let n = await hi({
|
|
2135
2137
|
blockPath: t,
|
|
2136
2138
|
isSdkInternal: e.isSdkInternal,
|
|
2137
2139
|
updateDepsOnly: e.updateDepsOnly,
|
|
@@ -2139,43 +2141,43 @@ async function gi(e) {
|
|
|
2139
2141
|
templatesRoot: e.templatesRoot,
|
|
2140
2142
|
log: (t) => e.logger.info(t)
|
|
2141
2143
|
});
|
|
2142
|
-
e.logger.info(
|
|
2144
|
+
e.logger.info(gi(t, n.changes));
|
|
2143
2145
|
}
|
|
2144
2146
|
}
|
|
2145
|
-
function
|
|
2146
|
-
let t = new
|
|
2147
|
+
function vi(e) {
|
|
2148
|
+
let t = new m("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).");
|
|
2147
2149
|
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) => {
|
|
2148
|
-
let r = t.length > 0 ? t : ["."], i =
|
|
2149
|
-
await
|
|
2150
|
+
let r = t.length > 0 ? t : ["."], i = g.join(e, "src", "structure", "templates");
|
|
2151
|
+
await _i({
|
|
2150
2152
|
paths: r,
|
|
2151
2153
|
isSdkInternal: !!n.sdkInternal,
|
|
2152
2154
|
updateDepsOnly: !!n.updateDepsOnly,
|
|
2153
2155
|
templatesRoot: i,
|
|
2154
|
-
logger: new
|
|
2156
|
+
logger: new b()
|
|
2155
2157
|
});
|
|
2156
2158
|
}), t;
|
|
2157
2159
|
}
|
|
2158
2160
|
//#endregion
|
|
2159
2161
|
//#region src/cmd/update-deps.ts
|
|
2160
|
-
function
|
|
2161
|
-
let t = new
|
|
2162
|
+
function yi(e) {
|
|
2163
|
+
let t = new m("update-deps").description("[DEPRECATED] Use `block-tools structure refresh --update-deps-only`. This alias delegates to it.");
|
|
2162
2164
|
return t.action(async () => {
|
|
2163
|
-
let t = new
|
|
2164
|
-
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
|
|
2165
|
+
let t = new b();
|
|
2166
|
+
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 _i({
|
|
2165
2167
|
paths: ["."],
|
|
2166
2168
|
isSdkInternal: !1,
|
|
2167
2169
|
updateDepsOnly: !0,
|
|
2168
|
-
templatesRoot:
|
|
2170
|
+
templatesRoot: g.join(e, "src", "structure", "templates"),
|
|
2169
2171
|
logger: t
|
|
2170
2172
|
});
|
|
2171
2173
|
}), t;
|
|
2172
2174
|
}
|
|
2173
2175
|
//#endregion
|
|
2174
2176
|
//#region src/cmd/list-overview-snapshots.ts
|
|
2175
|
-
function
|
|
2176
|
-
let e = new
|
|
2177
|
-
return e.addOption(new
|
|
2178
|
-
let t = new
|
|
2177
|
+
function bi() {
|
|
2178
|
+
let e = new m("list-overview-snapshots").description("List all available global overview snapshots in the registry");
|
|
2179
|
+
return e.addOption(new h("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.option("--json", "output in JSON format", !1), e.action(async (e) => {
|
|
2180
|
+
let t = new b(), n = await new ee(l(e.registry), t).listGlobalOverviewSnapshots();
|
|
2179
2181
|
if (e.json) t.info(JSON.stringify(n, null, 2));
|
|
2180
2182
|
else if (n.length === 0) t.info("No snapshots found.");
|
|
2181
2183
|
else {
|
|
@@ -2186,10 +2188,10 @@ function yi() {
|
|
|
2186
2188
|
}
|
|
2187
2189
|
//#endregion
|
|
2188
2190
|
//#region src/cmd/restore-overview-from-snapshot.ts
|
|
2189
|
-
function
|
|
2190
|
-
let e = new
|
|
2191
|
-
return e.addOption(new
|
|
2192
|
-
let t = new
|
|
2191
|
+
function xi() {
|
|
2192
|
+
let e = new m("restore-overview-from-snapshot").description("Restore global overview from a snapshot");
|
|
2193
|
+
return e.addOption(new h("-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) => {
|
|
2194
|
+
let t = new b(), n = new ee(l(e.registry), t), r = await n.listGlobalOverviewSnapshots();
|
|
2193
2195
|
if (!r.find((t) => t.timestamp === e.snapshot)) throw Error(`Snapshot '${e.snapshot}' not found. Available snapshots:\n${r.map((e) => ` - ${e.timestamp}`).join("\n") || " (none)"}`);
|
|
2194
2196
|
if (!e.skipConfirmation) {
|
|
2195
2197
|
let n = (await import("node:readline")).createInterface({
|
|
@@ -2212,7 +2214,7 @@ function bi() {
|
|
|
2212
2214
|
}
|
|
2213
2215
|
//#endregion
|
|
2214
2216
|
//#region src/registry_v1/flags.ts
|
|
2215
|
-
function
|
|
2217
|
+
function Si(e) {
|
|
2216
2218
|
let t = e.match(/(?<destName>[^/\\]+)=(?<src>.*)/);
|
|
2217
2219
|
if (t) {
|
|
2218
2220
|
let { src: e, destName: n } = t.groups;
|
|
@@ -2222,33 +2224,33 @@ function xi(e) {
|
|
|
2222
2224
|
};
|
|
2223
2225
|
} else return {
|
|
2224
2226
|
src: e,
|
|
2225
|
-
destName:
|
|
2227
|
+
destName: g.basename(e)
|
|
2226
2228
|
};
|
|
2227
2229
|
}
|
|
2228
|
-
function
|
|
2229
|
-
return new
|
|
2230
|
+
function Ci(e, t) {
|
|
2231
|
+
return new h(e, t).argParser((e, t) => [...t ?? [], Si(e)]).default([]);
|
|
2230
2232
|
}
|
|
2231
2233
|
//#endregion
|
|
2232
2234
|
//#region src/cmd/upload-package-v1.ts
|
|
2233
|
-
var
|
|
2235
|
+
var wi = [
|
|
2234
2236
|
"registry",
|
|
2235
2237
|
"organization",
|
|
2236
2238
|
"package",
|
|
2237
2239
|
"version"
|
|
2238
2240
|
];
|
|
2239
|
-
function
|
|
2240
|
-
let e = new
|
|
2241
|
-
return e.addOption(new
|
|
2242
|
-
let t = new
|
|
2243
|
-
for (let t of
|
|
2244
|
-
e.meta && (e.meta.endsWith(".json") ? n.meta = JSON.parse(await
|
|
2241
|
+
function Ti() {
|
|
2242
|
+
let e = new m("upload-package-v1").description("Uploads V1 package and refreshes the registry");
|
|
2243
|
+
return e.addOption(new h("-r, --registry <address|alias>", "full address of the registry or alias from .pl.reg").env("PL_REGISTRY")), e.addOption(new h("-o, --organization <organization>", "target organisation").env("PL_PACKAGE_ORGANIZATION")), e.addOption(new h("-p, --package <package>", "target package").env("PL_PACKAGE_NAME")), e.addOption(new h("-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(Ci("-f, --file <file>", "package files")), e.addOption(new h("--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) => {
|
|
2244
|
+
let t = new b(), n = f.parse({});
|
|
2245
|
+
for (let t of wi) e[t] && (n[t] = e[t]);
|
|
2246
|
+
e.meta && (e.meta.endsWith(".json") ? n.meta = JSON.parse(await _.promises.readFile(e.meta, { encoding: "utf-8" })) : e.meta.endsWith(".yaml") && (n.meta = ce.parse(await _.promises.readFile(e.meta, { encoding: "utf-8" }))));
|
|
2245
2247
|
for (let t of e.file) n.files[t.destName] = t.src;
|
|
2246
2248
|
let r = await d(n);
|
|
2247
|
-
t.info(
|
|
2249
|
+
t.info(ce.stringify(r.conf));
|
|
2248
2250
|
let i = r.createRegistry(t), a = r.fullPackageName, o = i.constructNewPackage(a);
|
|
2249
2251
|
for (let [e, n] of Object.entries(r.conf.files)) {
|
|
2250
2252
|
t.info(`Uploading ${n} -> ${e} ...`);
|
|
2251
|
-
let r = await
|
|
2253
|
+
let r = await _.promises.readFile(n);
|
|
2252
2254
|
await o.addFile(e, r);
|
|
2253
2255
|
}
|
|
2254
2256
|
t.info("Uploading meta information..."), await o.writeMeta(r.conf.meta), await o.finish(), e.refresh && await i.updateIfNeeded();
|
|
@@ -2256,12 +2258,12 @@ function wi() {
|
|
|
2256
2258
|
}
|
|
2257
2259
|
//#endregion
|
|
2258
2260
|
//#region src/cmd/structure/check.ts
|
|
2259
|
-
function
|
|
2260
|
-
let t = new
|
|
2261
|
+
function Ei(e) {
|
|
2262
|
+
let t = new m("check").description("Check block(s) against the canonical structure (read-only). Exits non-zero if any diff would land — used as the CI gate.");
|
|
2261
2263
|
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) => {
|
|
2262
|
-
let r = new
|
|
2264
|
+
let r = new b(), i = t.length > 0 ? t : ["."], a = g.join(e, "src", "structure", "templates"), o = !1;
|
|
2263
2265
|
for (let e of i) {
|
|
2264
|
-
let t = await
|
|
2266
|
+
let t = await hi({
|
|
2265
2267
|
blockPath: e,
|
|
2266
2268
|
isSdkInternal: !!n.sdkInternal,
|
|
2267
2269
|
updateDepsOnly: !1,
|
|
@@ -2269,35 +2271,35 @@ function Ti(e) {
|
|
|
2269
2271
|
templatesRoot: a,
|
|
2270
2272
|
log: (e) => r.info(e)
|
|
2271
2273
|
});
|
|
2272
|
-
r.info(
|
|
2274
|
+
r.info(gi(e, t.changes)), t.changes.length > 0 && (o = !0);
|
|
2273
2275
|
}
|
|
2274
2276
|
if (o) throw Error("Structure check failed: one or more blocks are out of date. Run `structure refresh`.");
|
|
2275
2277
|
}), t;
|
|
2276
2278
|
}
|
|
2277
2279
|
//#endregion
|
|
2278
2280
|
//#region src/structure/init-block-constructor.ts
|
|
2279
|
-
var $ = ["python"],
|
|
2281
|
+
var $ = ["python"], Di = class extends Error {
|
|
2280
2282
|
constructor(e) {
|
|
2281
2283
|
super(`Missing required flag --${e} in --non-interactive mode. Supply every BlockVars flag, or drop --non-interactive to be prompted.`), this.name = "InitFlagError";
|
|
2282
2284
|
}
|
|
2283
2285
|
};
|
|
2284
|
-
async function
|
|
2286
|
+
async function Oi(e, t, n, r) {
|
|
2285
2287
|
if (e !== void 0 && e !== "") return e;
|
|
2286
|
-
if (n) throw new
|
|
2288
|
+
if (n) throw new Di(t);
|
|
2287
2289
|
return r();
|
|
2288
2290
|
}
|
|
2289
|
-
async function
|
|
2290
|
-
let t = await
|
|
2291
|
+
async function ki(e) {
|
|
2292
|
+
let t = await Oi(e.npmOrg, "npm-org", e.nonInteractive, () => he({
|
|
2291
2293
|
message: "npm org (e.g. @platforma-open):",
|
|
2292
2294
|
default: "@platforma-open"
|
|
2293
|
-
})), n = await
|
|
2294
|
-
i = e.withSoftware === void 0 ? e.nonInteractive ? !1 : await
|
|
2295
|
+
})), n = await Oi(e.orgScope, "org-scope", e.nonInteractive, () => he({ message: "org scope (e.g. my-org):" })), r = await Oi(e.shortName, "short-name", e.nonInteractive, () => he({ message: "block short name (e.g. mixcr-clonotyping):" })), i;
|
|
2296
|
+
i = e.withSoftware === void 0 ? e.nonInteractive ? !1 : await me({
|
|
2295
2297
|
message: "Include a software module?",
|
|
2296
2298
|
default: !1
|
|
2297
2299
|
}) : e.withSoftware;
|
|
2298
2300
|
let a;
|
|
2299
2301
|
if (i) {
|
|
2300
|
-
if (a = await
|
|
2302
|
+
if (a = await Oi(e.platform, "platform", e.nonInteractive, () => ge({
|
|
2301
2303
|
message: "Software platform:",
|
|
2302
2304
|
choices: $.map((e) => ({
|
|
2303
2305
|
name: e,
|
|
@@ -2314,8 +2316,8 @@ async function Oi(e) {
|
|
|
2314
2316
|
softwarePlatform: a
|
|
2315
2317
|
};
|
|
2316
2318
|
}
|
|
2317
|
-
async function
|
|
2318
|
-
let t = e.vars, n = Dn(t), r = new
|
|
2319
|
+
async function Ai(e) {
|
|
2320
|
+
let t = e.vars, n = Dn(t), r = new ke(e.blockPath), i = new Ae(e.templatesRoot), a = On({
|
|
2319
2321
|
blockVars: t,
|
|
2320
2322
|
modules: n,
|
|
2321
2323
|
isSdkInternal: !1,
|
|
@@ -2327,7 +2329,7 @@ async function ki(e) {
|
|
|
2327
2329
|
} catch (e) {
|
|
2328
2330
|
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)}`);
|
|
2329
2331
|
}
|
|
2330
|
-
return vn(
|
|
2332
|
+
return vn(pi, r, a, {
|
|
2331
2333
|
templates: i,
|
|
2332
2334
|
initMode: !0,
|
|
2333
2335
|
registryLookup: s,
|
|
@@ -2336,12 +2338,12 @@ async function ki(e) {
|
|
|
2336
2338
|
}
|
|
2337
2339
|
//#endregion
|
|
2338
2340
|
//#region src/cmd/structure/init.ts
|
|
2339
|
-
function
|
|
2340
|
-
let t = new
|
|
2341
|
-
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
|
|
2342
|
-
let r = new
|
|
2341
|
+
function ji(e) {
|
|
2342
|
+
let t = new m("init").description("Scaffold a fresh Platforma block from the canonical structure. Missing flags are prompted unless --non-interactive.");
|
|
2343
|
+
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 h("--platform <platform>", "software platform (single-valued)").choices([...$])), t.option("--non-interactive", "error on any missing flag instead of prompting"), t.action(async (t, n) => {
|
|
2344
|
+
let r = new b(), i = n.withSoftware === !0, a = n.software === !1;
|
|
2343
2345
|
if (i && a) throw Error("--with-software and --no-software are mutually exclusive.");
|
|
2344
|
-
let o = i ? !0 : a ? !1 : void 0, s = await
|
|
2346
|
+
let o = i ? !0 : a ? !1 : void 0, s = await ki({
|
|
2345
2347
|
npmOrg: n.npmOrg,
|
|
2346
2348
|
orgScope: n.orgScope,
|
|
2347
2349
|
shortName: n.shortName,
|
|
@@ -2349,25 +2351,25 @@ function Ai(e) {
|
|
|
2349
2351
|
platform: n.platform,
|
|
2350
2352
|
nonInteractive: n.nonInteractive
|
|
2351
2353
|
});
|
|
2352
|
-
await
|
|
2354
|
+
await Ai({
|
|
2353
2355
|
vars: s,
|
|
2354
|
-
blockPath: t ?
|
|
2355
|
-
templatesRoot:
|
|
2356
|
+
blockPath: t ? g.resolve(t) : g.resolve(process.cwd(), s.shortName),
|
|
2357
|
+
templatesRoot: g.join(e, "src", "structure", "templates"),
|
|
2356
2358
|
log: (e) => r.info(e)
|
|
2357
2359
|
});
|
|
2358
2360
|
}), t;
|
|
2359
2361
|
}
|
|
2360
2362
|
//#endregion
|
|
2361
2363
|
//#region src/cmd/software/knobs.ts
|
|
2362
|
-
var
|
|
2364
|
+
var Mi = ["dev", "release"], Ni = [
|
|
2363
2365
|
"docker",
|
|
2364
2366
|
"binary",
|
|
2365
2367
|
"all",
|
|
2366
2368
|
"none"
|
|
2367
|
-
],
|
|
2368
|
-
function
|
|
2369
|
+
], Pi = ["local", "remote"];
|
|
2370
|
+
function Fi(e) {
|
|
2369
2371
|
if (e.usePublished) {
|
|
2370
|
-
if (e.variant === "docker" || e.variant === "all") throw
|
|
2372
|
+
if (e.variant === "docker" || e.variant === "all") throw y.CLIError(`--use-published is binary-only and cannot be combined with --variant ${e.variant}`);
|
|
2371
2373
|
return { kind: "binary-existing" };
|
|
2372
2374
|
}
|
|
2373
2375
|
return e.variant === "none" ? { kind: "no-software" } : e.location === void 0 ? { kind: "bare" } : {
|
|
@@ -2379,33 +2381,33 @@ function Pi(e) {
|
|
|
2379
2381
|
}
|
|
2380
2382
|
//#endregion
|
|
2381
2383
|
//#region src/cmd/software/ecr-login.ts
|
|
2382
|
-
var
|
|
2383
|
-
function
|
|
2384
|
+
var Ii = "public.ecr.aws", Li = "us-east-1";
|
|
2385
|
+
function Ri(e) {
|
|
2384
2386
|
if (process.env.AWS_ACCESS_KEY_ID || process.env.AWS_PROFILE) return;
|
|
2385
|
-
let t = process.env.PL_AWS_PROFILE ??
|
|
2387
|
+
let t = process.env.PL_AWS_PROFILE ?? se.AWS_DEV_PROFILE;
|
|
2386
2388
|
process.env.AWS_PROFILE = t, e?.debug(`Using AWS profile '${t}' for dev push credentials`);
|
|
2387
2389
|
}
|
|
2388
|
-
function
|
|
2390
|
+
function zi(e) {
|
|
2389
2391
|
return new URL(`https://${e}`).hostname;
|
|
2390
2392
|
}
|
|
2391
|
-
function
|
|
2392
|
-
return ` aws sso login --profile ${process.env.AWS_PROFILE ?? process.env.PL_AWS_PROFILE ??
|
|
2393
|
+
function Bi() {
|
|
2394
|
+
return ` aws sso login --profile ${process.env.AWS_PROFILE ?? process.env.PL_AWS_PROFILE ?? se.AWS_DEV_PROFILE}`;
|
|
2393
2395
|
}
|
|
2394
|
-
async function
|
|
2395
|
-
let n =
|
|
2396
|
-
if (n !==
|
|
2396
|
+
async function Vi(e, t) {
|
|
2397
|
+
let n = zi(e);
|
|
2398
|
+
if (n !== Ii) throw y.CLIError(`automatic docker login is only supported for '${Ii}', not '${n}'.\nLog in manually, or drop the ecr:// scheme from the push target to opt out.`);
|
|
2397
2399
|
t?.info(`Logging in to ECR registry '${n}'...`);
|
|
2398
2400
|
let r, i;
|
|
2399
2401
|
try {
|
|
2400
|
-
let e = (await new
|
|
2402
|
+
let e = (await new ve({ region: Li }).send(new ye({}))).authorizationData?.authorizationToken;
|
|
2401
2403
|
if (!e) throw Error("empty authorization token");
|
|
2402
2404
|
let t = Buffer.from(e, "base64").toString("utf8"), n = t.indexOf(":");
|
|
2403
2405
|
if (n < 0) throw Error("malformed authorization token (no ':' separator)");
|
|
2404
2406
|
r = t.slice(0, n), i = t.slice(n + 1);
|
|
2405
2407
|
} catch (e) {
|
|
2406
|
-
throw
|
|
2408
|
+
throw y.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` + Bi());
|
|
2407
2409
|
}
|
|
2408
|
-
let a =
|
|
2410
|
+
let a = _e("docker", [
|
|
2409
2411
|
"login",
|
|
2410
2412
|
"--username",
|
|
2411
2413
|
r,
|
|
@@ -2420,16 +2422,16 @@ async function Bi(e, t) {
|
|
|
2420
2422
|
],
|
|
2421
2423
|
env: {
|
|
2422
2424
|
...process.env,
|
|
2423
|
-
HOME: process.env.HOME ||
|
|
2425
|
+
HOME: process.env.HOME || pe.homedir()
|
|
2424
2426
|
}
|
|
2425
2427
|
});
|
|
2426
|
-
if (a.error || a.status !== 0) throw
|
|
2428
|
+
if (a.error || a.status !== 0) throw y.CLIError(`'docker login ${n}' failed`);
|
|
2427
2429
|
}
|
|
2428
2430
|
//#endregion
|
|
2429
2431
|
//#region src/cmd/software/run-build.ts
|
|
2430
|
-
async function
|
|
2432
|
+
async function Hi(e) {
|
|
2431
2433
|
let { core: t, scenario: n, options: r = {}, logger: i } = e, a = r.ids;
|
|
2432
|
-
t.buildMode =
|
|
2434
|
+
t.buildMode = Wi(n), Ui(n) || t.assertDockerCoverage();
|
|
2433
2435
|
let o = () => t.buildSoftwareArchives({
|
|
2434
2436
|
ids: a,
|
|
2435
2437
|
forceBuild: !!r.force,
|
|
@@ -2446,103 +2448,103 @@ async function Vi(e) {
|
|
|
2446
2448
|
r.buildDocker && t.buildDockerImages({
|
|
2447
2449
|
ids: a,
|
|
2448
2450
|
registry: r.dockerRegistry,
|
|
2449
|
-
strictPlatformMatching:
|
|
2451
|
+
strictPlatformMatching: v.isCI()
|
|
2450
2452
|
}), await o(), r.pushDocker && t.publishDockerImages({
|
|
2451
2453
|
ids: a,
|
|
2452
2454
|
pushTo: r.dockerPushTo,
|
|
2453
|
-
strictPlatformMatching:
|
|
2455
|
+
strictPlatformMatching: v.isCI()
|
|
2454
2456
|
});
|
|
2455
2457
|
break;
|
|
2456
2458
|
case "target": {
|
|
2457
|
-
let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f =
|
|
2459
|
+
let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f = qi(e, r);
|
|
2458
2460
|
l && t.buildDockerImages({
|
|
2459
2461
|
ids: a,
|
|
2460
2462
|
registry: f.pull,
|
|
2461
|
-
strictPlatformMatching:
|
|
2462
|
-
}), u && await o(), d && e === "dev" && (l || u) &&
|
|
2463
|
+
strictPlatformMatching: v.isCI()
|
|
2464
|
+
}), u && await o(), d && e === "dev" && (l || u) && Ri(i), l && d && (f.autoLogin && f.push && await Vi(f.push, i), t.publishDockerImages({
|
|
2463
2465
|
ids: a,
|
|
2464
2466
|
pushTo: f.push,
|
|
2465
|
-
strictPlatformMatching:
|
|
2467
|
+
strictPlatformMatching: v.isCI()
|
|
2466
2468
|
})), u && d && await t.publishPackages({
|
|
2467
2469
|
ids: a,
|
|
2468
2470
|
storageURL: r.storageUrl
|
|
2469
2471
|
});
|
|
2470
2472
|
break;
|
|
2471
2473
|
}
|
|
2472
|
-
default:
|
|
2474
|
+
default: y.assertNever(n);
|
|
2473
2475
|
}
|
|
2474
2476
|
t.buildSwJsonFiles({
|
|
2475
2477
|
packageIds: a,
|
|
2476
2478
|
noSoftware: n.kind === "no-software",
|
|
2477
|
-
skipDockerCoverage:
|
|
2479
|
+
skipDockerCoverage: Ui(n)
|
|
2478
2480
|
});
|
|
2479
2481
|
}
|
|
2480
|
-
function
|
|
2482
|
+
function Ui(e) {
|
|
2481
2483
|
return e.kind === "no-software" || e.kind === "binary-existing";
|
|
2482
2484
|
}
|
|
2483
|
-
function
|
|
2485
|
+
function Wi(e) {
|
|
2484
2486
|
return e.kind !== "target" || e.channel === "release" ? "release" : e.variant !== "docker" && e.location === "remote" ? "dev-remote" : "dev-local";
|
|
2485
2487
|
}
|
|
2486
|
-
function
|
|
2488
|
+
function Gi(e) {
|
|
2487
2489
|
if (!e.includes("://")) return e;
|
|
2488
2490
|
let t = new URL(e);
|
|
2489
2491
|
return t.host + t.pathname;
|
|
2490
2492
|
}
|
|
2491
|
-
function
|
|
2493
|
+
function Ki(e) {
|
|
2492
2494
|
return {
|
|
2493
|
-
registry:
|
|
2495
|
+
registry: Gi(e),
|
|
2494
2496
|
autoLogin: e.startsWith("ecr://")
|
|
2495
2497
|
};
|
|
2496
2498
|
}
|
|
2497
|
-
function
|
|
2498
|
-
let n = e === "dev", r = process.env[n ?
|
|
2499
|
+
function qi(e, t) {
|
|
2500
|
+
let n = e === "dev", r = process.env[n ? v.PL_DEV_DOCKER_PUSH_URL : v.PL_RELEASE_DOCKER_PUSH_URL], i = process.env[n ? v.PL_DEV_DOCKER_PULL_URL : v.PL_RELEASE_DOCKER_PULL_URL], a = t.dockerPushTo ?? r ?? (n ? se.DEV_DOCKER_PUSH_TARGET : void 0), o = a ? Ki(a) : {
|
|
2499
2501
|
registry: void 0,
|
|
2500
2502
|
autoLogin: !1
|
|
2501
|
-
}, s = t.dockerRegistry ?? i ?? (n ? a :
|
|
2503
|
+
}, s = t.dockerRegistry ?? i ?? (n ? a : se.DOCKER_REGISTRY);
|
|
2502
2504
|
return {
|
|
2503
|
-
pull: s ?
|
|
2505
|
+
pull: s ? Gi(s) : void 0,
|
|
2504
2506
|
push: o.registry,
|
|
2505
2507
|
autoLogin: o.autoLogin
|
|
2506
2508
|
};
|
|
2507
2509
|
}
|
|
2508
2510
|
//#endregion
|
|
2509
2511
|
//#region src/cmd/software/env.ts
|
|
2510
|
-
var
|
|
2511
|
-
|
|
2512
|
+
var Ji = "PL_BUILD_CHANNEL", Yi = "PL_BUILD_VARIANT", Xi = "PL_BUILD_LOCATION", Zi = "PL_BUILD_USE_PUBLISHED";
|
|
2513
|
+
v.PL_DOCKER_REGISTRY_PUSH_TO, v.PL_DEV_DOCKER_PUSH_URL, v.PL_DEV_DOCKER_PULL_URL, v.PL_DEV_BINARY_UPLOAD_URL, v.PL_RELEASE_DOCKER_PUSH_URL, v.PL_RELEASE_DOCKER_PULL_URL, v.PL_RELEASE_BINARY_UPLOAD_URL;
|
|
2512
2514
|
//#endregion
|
|
2513
2515
|
//#region src/cmd/software/build.ts
|
|
2514
|
-
function
|
|
2515
|
-
let e = new
|
|
2516
|
-
return e.addOption(new
|
|
2516
|
+
function Qi() {
|
|
2517
|
+
let e = new m("build").description("Build a software module for a target and write its .sw.json descriptor (build + push in one pass)");
|
|
2518
|
+
return e.addOption(new h("--channel <channel>", "registry channel to build for").choices([...Mi]).env(Ji)), e.addOption(new h("--variant <variant>", "artifact kind to build (default: all declared)").choices([...Ni]).env(Yi)), e.addOption(new h("--location <location>", "where the artifact lands (local = no push)").choices([...Pi]).env(Xi)), e.addOption(new h("--use-published", "do not build or push; emit a descriptor pointing at the already-published release artifact").env(Zi)), e.addOption(new h("--log-level <level>", "logging level").choices([
|
|
2517
2519
|
"error",
|
|
2518
2520
|
"warn",
|
|
2519
2521
|
"info",
|
|
2520
2522
|
"debug"
|
|
2521
|
-
]).default("info")), e.addOption(new
|
|
2522
|
-
let t =
|
|
2523
|
+
]).default("info")), e.addOption(new h("--package-root <path>", "path to directory with package.json file")), e.addOption(new h("--force", "force action, ignoring automatic safety checks").default(!1)), e.addOption(new h("--version <value>", "override package version (ignore package.json)")), e.addOption(new h("--platform <os-arch>", "{os}-{arch} pair; no effect on cross-platform packages").choices([...y.AllPlatforms]).env(v.PL_PKG_OS)), e.addOption(new h("--all-platforms", "build for all supported platforms").default(!1)), e.addOption(new h("--full-dir-hash", "hash file contents (not metadata) for the dev content hash").env(v.PL_PKG_FULL_HASH).default(!1)), e.addOption(new h("--package-id <id...>", "act only on selected packages")), e.addOption(new h("--content-root <path>", "override software content root").env(v.PL_PKG_CONTENT_ROOT)), e.addOption(new h("--storage-url <url>", "override binary upload registry URL").env(v.PL_PKG_STORAGE_URL)), e.addOption(new h("--docker-registry <registry>", "docker pull registry embedded in the descriptor").env(v.PL_DOCKER_REGISTRY)), e.addOption(new h("--docker-push-to <registry>", "alternative registry for docker push").env(v.PL_DOCKER_REGISTRY_PUSH_TO)), e.addOption(new h("--docker-build", "build docker images").env(v.PL_DOCKER_BUILD).default(!1)), e.addOption(new h("--docker-no-build", "do not build docker images").env(v.PL_DOCKER_NO_BUILD).default(!1)), e.addOption(new h("--docker-autopush", "push docker images after build").env(v.PL_DOCKER_AUTOPUSH).default(!1)), e.addOption(new h("--docker-no-autopush", "do not push docker images").env(v.PL_DOCKER_NO_AUTOPUSH).default(!1)), e.addOption(new h("--conda-build", "build conda environment before packing").env(v.PL_CONDA_BUILD).default(!1)), e.addOption(new h("--conda-no-build", "do not build conda environment").env(v.PL_CONDA_NO_BUILD).default(!1)), e.action(async (e) => {
|
|
2524
|
+
let t = y.createLogger(e.logLevel);
|
|
2523
2525
|
try {
|
|
2524
|
-
let n =
|
|
2526
|
+
let n = Fi({
|
|
2525
2527
|
channel: e.channel,
|
|
2526
2528
|
variant: e.variant,
|
|
2527
2529
|
location: e.location,
|
|
2528
2530
|
usePublished: !!e.usePublished
|
|
2529
|
-
}), r =
|
|
2531
|
+
}), r = oe(t, { packageRoot: e.packageRoot });
|
|
2530
2532
|
r.version = e.version, r.targetPlatform = e.platform, r.allPlatforms = !!e.allPlatforms, r.fullDirHash = !!e.fullDirHash;
|
|
2531
|
-
let i =
|
|
2532
|
-
default:
|
|
2533
|
+
let i = y.shouldDoAction({
|
|
2534
|
+
default: v.isCI(),
|
|
2533
2535
|
enable: e.dockerBuild,
|
|
2534
2536
|
disable: e.dockerNoBuild
|
|
2535
|
-
}), a = i &&
|
|
2536
|
-
default:
|
|
2537
|
+
}), a = i && y.shouldDoAction({
|
|
2538
|
+
default: v.isCI() && !r.isPrivate,
|
|
2537
2539
|
enable: e.dockerAutopush,
|
|
2538
2540
|
disable: e.dockerNoAutopush
|
|
2539
2541
|
});
|
|
2540
|
-
n.kind === "bare" &&
|
|
2542
|
+
n.kind === "bare" && ae({
|
|
2541
2543
|
buildDocker: i,
|
|
2542
2544
|
pushDocker: a,
|
|
2543
2545
|
pushDisabledExplicitly: !!e.dockerNoAutopush,
|
|
2544
2546
|
dockerPackageCount: r.selectedDockerPackages(e.packageId).length
|
|
2545
|
-
}), await
|
|
2547
|
+
}), await Hi({
|
|
2546
2548
|
core: r,
|
|
2547
2549
|
scenario: n,
|
|
2548
2550
|
logger: t,
|
|
@@ -2555,7 +2557,7 @@ function Zi() {
|
|
|
2555
2557
|
dockerPushTo: e.dockerPushTo,
|
|
2556
2558
|
buildDocker: i,
|
|
2557
2559
|
pushDocker: a,
|
|
2558
|
-
condaBuild:
|
|
2560
|
+
condaBuild: y.shouldDoAction({
|
|
2559
2561
|
default: !0,
|
|
2560
2562
|
enable: e.condaBuild,
|
|
2561
2563
|
disable: e.condaNoBuild
|
|
@@ -2569,22 +2571,22 @@ function Zi() {
|
|
|
2569
2571
|
}
|
|
2570
2572
|
//#endregion
|
|
2571
2573
|
//#region src/cmd/software/index.ts
|
|
2572
|
-
function
|
|
2573
|
-
let e = new
|
|
2574
|
-
return e.addCommand(
|
|
2574
|
+
function $i() {
|
|
2575
|
+
let e = new m("software").description("Build and publish a block's software modules");
|
|
2576
|
+
return e.addCommand(Qi()), e;
|
|
2575
2577
|
}
|
|
2576
2578
|
//#endregion
|
|
2577
2579
|
//#region src/cli.ts
|
|
2578
|
-
function
|
|
2579
|
-
let t = new
|
|
2580
|
-
t.name("block-tools").description("Utility to manipulate Platforma Blocks and Block Registry"), t.addCommand(
|
|
2581
|
-
let n = new
|
|
2582
|
-
return n.addCommand(
|
|
2580
|
+
function ea(e = process.cwd()) {
|
|
2581
|
+
let t = new m();
|
|
2582
|
+
t.name("block-tools").description("Utility to manipulate Platforma Blocks and Block Registry"), t.addCommand(be()), t.addCommand(Se()), t.addCommand(Ce()), t.addCommand(we()), t.addCommand(Ee()), t.addCommand(De()), t.addCommand(Oe()), t.addCommand(yi(e)), t.addCommand(bi()), t.addCommand(xi()), t.addCommand(Ti()), t.addCommand($i());
|
|
2583
|
+
let n = new m("structure").description("Manage block scaffolding against the canonical structure (check / init / refresh)");
|
|
2584
|
+
return n.addCommand(Ei(e)), n.addCommand(ji(e)), n.addCommand(vi(e)), t.addCommand(n), t;
|
|
2583
2585
|
}
|
|
2584
|
-
async function
|
|
2585
|
-
await
|
|
2586
|
+
async function ta(e, t) {
|
|
2587
|
+
await ea(t).parseAsync(e);
|
|
2586
2588
|
}
|
|
2587
2589
|
//#endregion
|
|
2588
|
-
export {
|
|
2590
|
+
export { ea as buildProgram, ta as run };
|
|
2589
2591
|
|
|
2590
2592
|
//# sourceMappingURL=cli.mjs.map
|