@platforma-sdk/block-tools 2.14.6 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -2429,7 +2429,7 @@ async function Bi(e, t) {
2429
2429
  //#region src/cmd/software/run-build.ts
2430
2430
  async function Vi(e) {
2431
2431
  let { core: t, scenario: n, options: r = {}, logger: i } = e, a = r.ids;
2432
- t.buildMode = Hi(n);
2432
+ t.buildMode = Ui(n), Hi(n) || t.assertDockerCoverage();
2433
2433
  let o = () => t.buildSoftwareArchives({
2434
2434
  ids: a,
2435
2435
  forceBuild: !!r.force,
@@ -2454,7 +2454,7 @@ async function Vi(e) {
2454
2454
  });
2455
2455
  break;
2456
2456
  case "target": {
2457
- let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f = Gi(e, r);
2457
+ let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f = Ki(e, r);
2458
2458
  l && t.buildDockerImages({
2459
2459
  ids: a,
2460
2460
  registry: f.pull,
@@ -2473,43 +2473,47 @@ async function Vi(e) {
2473
2473
  }
2474
2474
  t.buildSwJsonFiles({
2475
2475
  packageIds: a,
2476
- noSoftware: n.kind === "no-software"
2476
+ noSoftware: n.kind === "no-software",
2477
+ skipDockerCoverage: Hi(n)
2477
2478
  });
2478
2479
  }
2479
2480
  function Hi(e) {
2480
- return e.kind !== "target" || e.channel === "release" ? "release" : e.variant !== "docker" && e.location === "remote" ? "dev-remote" : "dev-local";
2481
+ return e.kind === "no-software" || e.kind === "binary-existing";
2481
2482
  }
2482
2483
  function Ui(e) {
2484
+ return e.kind !== "target" || e.channel === "release" ? "release" : e.variant !== "docker" && e.location === "remote" ? "dev-remote" : "dev-local";
2485
+ }
2486
+ function Wi(e) {
2483
2487
  if (!e.includes("://")) return e;
2484
2488
  let t = new URL(e);
2485
2489
  return t.host + t.pathname;
2486
2490
  }
2487
- function Wi(e) {
2491
+ function Gi(e) {
2488
2492
  return {
2489
- registry: Ui(e),
2493
+ registry: Wi(e),
2490
2494
  autoLogin: e.startsWith("ecr://")
2491
2495
  };
2492
2496
  }
2493
- function Gi(e, t) {
2494
- 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 ? ce.DEV_DOCKER_PUSH_TARGET : void 0), o = a ? Wi(a) : {
2497
+ function Ki(e, t) {
2498
+ 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 ? ce.DEV_DOCKER_PUSH_TARGET : void 0), o = a ? Gi(a) : {
2495
2499
  registry: void 0,
2496
2500
  autoLogin: !1
2497
2501
  }, s = t.dockerRegistry ?? i ?? (n ? a : ce.DOCKER_REGISTRY);
2498
2502
  return {
2499
- pull: s ? Ui(s) : void 0,
2503
+ pull: s ? Wi(s) : void 0,
2500
2504
  push: o.registry,
2501
2505
  autoLogin: o.autoLogin
2502
2506
  };
2503
2507
  }
2504
2508
  //#endregion
2505
2509
  //#region src/cmd/software/env.ts
2506
- var Ki = "PL_BUILD_CHANNEL", qi = "PL_BUILD_VARIANT", Ji = "PL_BUILD_LOCATION", Yi = "PL_BUILD_USE_PUBLISHED";
2510
+ var qi = "PL_BUILD_CHANNEL", Ji = "PL_BUILD_VARIANT", Yi = "PL_BUILD_LOCATION", Xi = "PL_BUILD_USE_PUBLISHED";
2507
2511
  _.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;
2508
2512
  //#endregion
2509
2513
  //#region src/cmd/software/build.ts
2510
- function Xi() {
2514
+ function Zi() {
2511
2515
  let e = new p("build").description("Build a software module for a target and write its .sw.json descriptor (build + push in one pass)");
2512
- return e.addOption(new m("--channel <channel>", "registry channel to build for").choices([...ji]).env(Ki)), e.addOption(new m("--variant <variant>", "artifact kind to build (default: all declared)").choices([...Mi]).env(qi)), e.addOption(new m("--location <location>", "where the artifact lands (local = no push)").choices([...Ni]).env(Ji)), e.addOption(new m("--use-published", "do not build or push; emit a descriptor pointing at the already-published release artifact").env(Yi)), e.addOption(new m("--log-level <level>", "logging level").choices([
2516
+ return e.addOption(new m("--channel <channel>", "registry channel to build for").choices([...ji]).env(qi)), e.addOption(new m("--variant <variant>", "artifact kind to build (default: all declared)").choices([...Mi]).env(Ji)), e.addOption(new m("--location <location>", "where the artifact lands (local = no push)").choices([...Ni]).env(Yi)), e.addOption(new m("--use-published", "do not build or push; emit a descriptor pointing at the already-published release artifact").env(Xi)), e.addOption(new m("--log-level <level>", "logging level").choices([
2513
2517
  "error",
2514
2518
  "warn",
2515
2519
  "info",
@@ -2565,22 +2569,22 @@ function Xi() {
2565
2569
  }
2566
2570
  //#endregion
2567
2571
  //#region src/cmd/software/index.ts
2568
- function Zi() {
2572
+ function Qi() {
2569
2573
  let e = new p("software").description("Build and publish a block's software modules");
2570
- return e.addCommand(Xi()), e;
2574
+ return e.addCommand(Zi()), e;
2571
2575
  }
2572
2576
  //#endregion
2573
2577
  //#region src/cli.ts
2574
- function Qi(e = process.cwd()) {
2578
+ function $i(e = process.cwd()) {
2575
2579
  let t = new p();
2576
- t.name("block-tools").description("Utility to manipulate Platforma Blocks and Block Registry"), t.addCommand(xe()), t.addCommand(Ce()), t.addCommand(we()), t.addCommand(Te()), t.addCommand(De()), t.addCommand(Oe()), t.addCommand(ke()), t.addCommand(vi(e)), t.addCommand(yi()), t.addCommand(bi()), t.addCommand(wi()), t.addCommand(Zi());
2580
+ t.name("block-tools").description("Utility to manipulate Platforma Blocks and Block Registry"), t.addCommand(xe()), t.addCommand(Ce()), t.addCommand(we()), t.addCommand(Te()), t.addCommand(De()), t.addCommand(Oe()), t.addCommand(ke()), t.addCommand(vi(e)), t.addCommand(yi()), t.addCommand(bi()), t.addCommand(wi()), t.addCommand(Qi());
2577
2581
  let n = new p("structure").description("Manage block scaffolding against the canonical structure (check / init / refresh)");
2578
2582
  return n.addCommand(Ti(e)), n.addCommand(Ai(e)), n.addCommand(_i(e)), t.addCommand(n), t;
2579
2583
  }
2580
- async function $i(e, t) {
2581
- await Qi(t).parseAsync(e);
2584
+ async function ea(e, t) {
2585
+ await $i(t).parseAsync(e);
2582
2586
  }
2583
2587
  //#endregion
2584
- export { Qi as buildProgram, $i as run };
2588
+ export { $i as buildProgram, ea as run };
2585
2589
 
2586
2590
  //# sourceMappingURL=cli.mjs.map