@wix/himalaya-cli 0.1365.0 → 0.1366.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
@@ -1827,7 +1827,7 @@ var init_scaffold = __esm({
1827
1827
  MODULE_SOURCE_FILE = /\.(?:[cm]?[jt]sx?)$/i;
1828
1828
  TEMPLATES_DIR = resolve2(dirname2(fileURLToPath(import.meta.url)), "../templates");
1829
1829
  SHOWCASE_TEMPLATES_DIR = resolve2(dirname2(fileURLToPath(import.meta.url)), "../showcase-apps");
1830
- SHOWCASE_TEMPLATE_NAMES = ["video-courses", "base44-starter", "base44-booking"];
1830
+ SHOWCASE_TEMPLATE_NAMES = ["video-courses", "base44-starter", "base44-booking", "base44-inspections"];
1831
1831
  BASE44_APP_ID_PLACEHOLDER = "ReplaceWithYourBase44AppId";
1832
1832
  BASE44_APP_ID_RE = /^[A-Za-z0-9]{8,64}$/;
1833
1833
  TEMPLATE_META_FILE = "himalaya.template.json";
@@ -7706,7 +7706,6 @@ function resolveTranslation(value, catalog3, sourceCatalog) {
7706
7706
  var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
7707
7707
  var init_bindings = __esm({
7708
7708
  "../../core/ts/src/bindings.ts"() {
7709
- "use strict";
7710
7709
  BINDING_SIGILS = ["service", "flag", "item", "t"];
7711
7710
  BINDING_SIGIL_RE = new RegExp(
7712
7711
  `^\\$(?:${BINDING_SIGILS.filter((s2) => s2 !== "t").join("|")})\\b|^\\$t:`
@@ -136209,7 +136208,7 @@ import { dirname as dirname31, join as join47, resolve as resolve39 } from "node
136209
136208
  import { fileURLToPath as fileURLToPath23 } from "node:url";
136210
136209
  import { createRequire as createRequire2 } from "node:module";
136211
136210
  import { execFileSync as execFileSync4 } from "node:child_process";
136212
- import { gzipSync } from "node:zlib";
136211
+ import { gzipSync as gzipSync2 } from "node:zlib";
136213
136212
  function bakeNeedsLiveOrigin(collect2, templatedRoutes = []) {
136214
136213
  if (collect2?.render !== void 0) return true;
136215
136214
  return templatedRoutes.some((t2) => typeof t2.seedIds === "function");
@@ -136835,7 +136834,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
136835
136834
  await store.putBundle(app, hash2, bytes2);
136836
136835
  const integrity2 = sri2(bytes2);
136837
136836
  bundles[name] = { sha256: hash2, sri: integrity2, bytes: bytes2.length };
136838
- tierBundles.set(name, { name, integrity: integrity2, gzippedKilobytes: gzipSync(bytes2).length / 1024 });
136837
+ tierBundles.set(name, { name, integrity: integrity2, gzippedKilobytes: gzipSync2(bytes2).length / 1024 });
136839
136838
  addrCache.set(name, hash2);
136840
136839
  return hash2;
136841
136840
  };
@@ -174147,6 +174146,7 @@ import { join as join84, resolve as resolve61, relative as relative15, basename
174147
174146
  import { fileURLToPath as fileURLToPath29 } from "node:url";
174148
174147
 
174149
174148
  // ../serve-cli/src/client.ts
174149
+ import { gzipSync } from "node:zlib";
174150
174150
  var MAX_PUBLISH_BODY_BYTES = 8 * 1024 * 1024;
174151
174151
  function publishReleaseBody(payload, meta, draft = false) {
174152
174152
  return { ...payload, ...meta ?? {}, ...draft ? { draft: true } : {} };
@@ -174154,6 +174154,17 @@ function publishReleaseBody(payload, meta, draft = false) {
174154
174154
  function publishReleaseBodyBytes(payload, meta, draft = false) {
174155
174155
  return Buffer.byteLength(JSON.stringify(publishReleaseBody(payload, meta, draft)), "utf8");
174156
174156
  }
174157
+ function publishReleaseWireBytes(payload, meta, draft = false) {
174158
+ return encodePublishBody(publishReleaseBody(payload, meta, draft)).bytes.byteLength;
174159
+ }
174160
+ var MAX_DECODED_PUBLISH_BODY_BYTES = 32 * 1024 * 1024;
174161
+ function encodePublishBody(body) {
174162
+ const plain2 = Buffer.from(JSON.stringify(body), "utf8");
174163
+ if (plain2.byteLength <= MAX_PUBLISH_BODY_BYTES || plain2.byteLength > MAX_DECODED_PUBLISH_BODY_BYTES) {
174164
+ return { bytes: plain2, gzip: false };
174165
+ }
174166
+ return { bytes: gzipSync(plain2), gzip: true };
174167
+ }
174157
174168
  var CREDENTIAL_HEADERS = /* @__PURE__ */ new Set([
174158
174169
  "x-control-token",
174159
174170
  "x-telemetry-token",
@@ -174176,13 +174187,13 @@ var ServeCliClient = class {
174176
174187
  if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$/.test(this.target.previewRoute)) throw new Error("invalid_dist_preview_route");
174177
174188
  headers2["x-wix-route-serve"] = this.target.previewRoute;
174178
174189
  }
174179
- if (opts.body !== void 0) headers2["content-type"] = "application/json";
174190
+ if (opts.body !== void 0 || opts.rawBody !== void 0) headers2["content-type"] = "application/json";
174180
174191
  const carriesCredential = Object.keys(headers2).some((h3) => CREDENTIAL_HEADERS.has(h3.toLowerCase()));
174181
174192
  const res = await this.fetchImpl(this.baseFor(plane) + path2, {
174182
174193
  method,
174183
174194
  headers: headers2,
174184
174195
  ...carriesCredential ? { redirect: "error" } : {},
174185
- body: opts.body !== void 0 ? JSON.stringify(opts.body) : void 0
174196
+ body: opts.rawBody !== void 0 ? new Uint8Array(opts.rawBody) : opts.body !== void 0 ? JSON.stringify(opts.body) : void 0
174186
174197
  });
174187
174198
  const text9 = await res.text();
174188
174199
  let json6 = null;
@@ -174424,8 +174435,15 @@ var ServeCliClient = class {
174424
174435
  }
174425
174436
  /** Publish a built release into the store (POST /v1/admin/release), with optional label/notes/gitSha.
174426
174437
  * `draft: true` stores it fully servable (pinned reads) WITHOUT moving the live release. */
174427
- publishRelease(payload, meta, draft = false) {
174428
- return this.request("control", "POST", "/v1/admin/release", { body: publishReleaseBody(payload, meta, draft), headers: this.ctrlHeaders() });
174438
+ async publishRelease(payload, meta, draft = false) {
174439
+ const { bytes: bytes2, gzip } = encodePublishBody(publishReleaseBody(payload, meta, draft));
174440
+ const headers2 = { ...this.ctrlHeaders(), ...gzip ? { "content-encoding": "gzip" } : {} };
174441
+ const res = await this.request("control", "POST", "/v1/admin/release", { rawBody: bytes2, headers: headers2 });
174442
+ if (gzip && res.status === 400 && res.json?.error === "bad_json") {
174443
+ const json6 = { error: "compressed_publish_unsupported", hint: "this body is over the plain publish cap, and this serve plane does not accept a compressed one yet; it takes a serve deploy carrying gzip publish bodies" };
174444
+ return { ...res, json: json6, text: JSON.stringify(json6) };
174445
+ }
174446
+ return res;
174429
174447
  }
174430
174448
  /** The app's own source archive for one release (GET /v1/owner/source) — what `himi pull`
174431
174449
  * restores from.
@@ -179718,19 +179736,23 @@ ${doNow.map((l2) => ` ${l2}`).join("\n")}`);
179718
179736
  let sendPayload = payload;
179719
179737
  let templateBodyBytes = publishReleaseBodyBytes(payload, publishMeta);
179720
179738
  let sourceGzChars;
179739
+ let bodyGzipped = false;
179721
179740
  if (templateBodyBytes > MAX_PUBLISH_BODY_BYTES) {
179722
- const { gzipSync: gzipSync2 } = await import("node:zlib");
179741
+ const { gzipSync: gzipSync3 } = await import("node:zlib");
179723
179742
  const { source: plainSource, ...rest } = payload;
179724
- const sourceGz = gzipSync2(Buffer.from(JSON.stringify(plainSource), "utf8"), { level: 9 }).toString("base64");
179743
+ const sourceGz = gzipSync3(Buffer.from(JSON.stringify(plainSource), "utf8"), { level: 9 }).toString("base64");
179725
179744
  sourceGzChars = sourceGz.length;
179726
179745
  const gzipped = { ...rest, sourceGz };
179727
179746
  const gzBytes = publishReleaseBodyBytes(gzipped, publishMeta);
179728
179747
  if (gzBytes <= MAX_PUBLISH_BODY_BYTES) {
179729
179748
  sendPayload = gzipped;
179730
179749
  templateBodyBytes = gzBytes;
179750
+ } else if (Buffer.byteLength(JSON.stringify(plainSource), "utf8") <= MAX_PUBLISH_BODY_BYTES && publishReleaseWireBytes(payload, publishMeta) <= MAX_PUBLISH_BODY_BYTES) {
179751
+ sendPayload = payload;
179752
+ bodyGzipped = true;
179731
179753
  }
179732
179754
  }
179733
- if (templateBodyBytes > MAX_PUBLISH_BODY_BYTES) {
179755
+ if (templateBodyBytes > MAX_PUBLISH_BODY_BYTES && !bodyGzipped) {
179734
179756
  io2.error(JSON.stringify({
179735
179757
  ok: false,
179736
179758
  template: name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1365.0",
3
+ "version": "0.1366.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": [
@@ -71,5 +71,5 @@
71
71
  "artifactId": "himalaya-cli"
72
72
  }
73
73
  },
74
- "falconPackageHash": "ba734484945c55507351443800ba12569f99c00d2324c1d84e355d00"
74
+ "falconPackageHash": "2252ba70fda9f2dd25a520a0ec7d75a7d716dcdcb74564bf1f929780"
75
75
  }