@wix/himalaya-cli 0.854.0 → 0.855.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +34 -3
  2. package/package.json +2 -2
package/dist/cli.mjs CHANGED
@@ -62569,7 +62569,21 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
62569
62569
  ...str5(flags.notes) ? { notes: str5(flags.notes) } : {},
62570
62570
  ...tplVis.value ? { visibility: tplVis.value } : {}
62571
62571
  };
62572
- const templateBodyBytes = publishReleaseBodyBytes(payload, publishMeta);
62572
+ let sendPayload = payload;
62573
+ let templateBodyBytes = publishReleaseBodyBytes(payload, publishMeta);
62574
+ let sourceGzChars;
62575
+ if (templateBodyBytes > MAX_PUBLISH_BODY_BYTES) {
62576
+ const { gzipSync: gzipSync2 } = await import("node:zlib");
62577
+ const { source: plainSource, ...rest } = payload;
62578
+ const sourceGz = gzipSync2(Buffer.from(JSON.stringify(plainSource), "utf8"), { level: 9 }).toString("base64");
62579
+ sourceGzChars = sourceGz.length;
62580
+ const gzipped = { ...rest, sourceGz };
62581
+ const gzBytes = publishReleaseBodyBytes(gzipped, publishMeta);
62582
+ if (gzBytes <= MAX_PUBLISH_BODY_BYTES) {
62583
+ sendPayload = gzipped;
62584
+ templateBodyBytes = gzBytes;
62585
+ }
62586
+ }
62573
62587
  if (templateBodyBytes > MAX_PUBLISH_BODY_BYTES) {
62574
62588
  io.error(JSON.stringify({
62575
62589
  ok: false,
@@ -62586,13 +62600,19 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
62586
62600
  // separately rather than summed into a figure that double-counts it.
62587
62601
  sourceChars: JSON.stringify(payload.source).length,
62588
62602
  appSourceBytes: templateSourceB64.length,
62589
- hint: "trim the template's source tree \u2014 a template carries its tree twice (the public catalog view and the private archive), and neither is optional, so there is no flag that publishes without them"
62603
+ // The catalog view is reported COMPRESSED as well, because "trim the tree" was the
62604
+ // wrong instruction and cost real time: the collector already drops binaries,
62605
+ // symlinks and dist/node_modules/.git/.himi, so there is rarely anything to trim.
62606
+ // What the two figures actually say is whether compression can still save you --
62607
+ // `sourceGzChars` is what this publish already tried and what remains after it.
62608
+ sourceGzChars,
62609
+ hint: "the catalog view is already sent gzipped when the plain body would not fit, and it still does not: the remainder is the release itself (screens, bundles, assets) plus the private archive, which no flag omits. Cut what the app ships, not the source tree \u2014 the collector already excludes binaries, symlinks, dist/, node_modules/, .git/ and .himi/."
62590
62610
  }));
62591
62611
  return 1;
62592
62612
  }
62593
62613
  let r;
62594
62614
  try {
62595
- r = await client3().publishRelease(payload, publishMeta);
62615
+ r = await client3().publishRelease(sendPayload, publishMeta);
62596
62616
  } catch (e) {
62597
62617
  const target = targetName();
62598
62618
  io.error(JSON.stringify(serveUnreachableError(target, serveBase(), e.message)));
@@ -62602,6 +62622,17 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
62602
62622
  print({ ok: false, status: r.status, body: r.json ?? r.text });
62603
62623
  return 1;
62604
62624
  }
62625
+ if (sendPayload.sourceGz && r.json?.template !== true) {
62626
+ io.error(JSON.stringify({
62627
+ ok: false,
62628
+ template: name,
62629
+ app: templateAppId,
62630
+ published: false,
62631
+ error: "serve_plane_ignored_source_gz",
62632
+ hint: `this plane accepted the publish but did not score it as a template, which means it predates compressed catalog views (\`sourceGz\`). A release WAS created for ${templateAppId} as an ordinary app \u2014 it carries no template source and will not appear in \`himi template list --remote\`. Upgrade the serve plane, then publish again; the republish repairs it.`
62633
+ }));
62634
+ return 1;
62635
+ }
62605
62636
  const releaseId = r.json?.releaseId ?? payload.manifest.releaseId;
62606
62637
  const targetFlag = str5(flags.target) ? ` --target ${str5(flags.target)}` : "";
62607
62638
  print({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.854.0",
3
+ "version": "0.855.0",
4
4
  "type": "module",
5
5
  "description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
6
6
  "keywords": [
@@ -63,5 +63,5 @@
63
63
  "artifactId": "himalaya-cli"
64
64
  }
65
65
  },
66
- "falconPackageHash": "5adfd6ba9551cfc305ff63e7d506c64fe0b3874c74bd3561fe465869"
66
+ "falconPackageHash": "40bff5342044d54ba5f7a74cc5a432f6a7367a0228eb885fec4a3e2c"
67
67
  }