@wix/himalaya-cli 0.1095.0 → 0.1096.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
@@ -24584,6 +24584,7 @@ function shouldRevealError(args) {
24584
24584
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE;
24585
24585
  var init_validation = __esm({
24586
24586
  "../../core/ts/src/validation.ts"() {
24587
+ "use strict";
24587
24588
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
24588
24589
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
24589
24590
  INTEGER_RE = /^[+-]?[0-9]+$/;
@@ -28204,6 +28205,7 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
28204
28205
  var WORKER_SUBTREE_CEILINGS, ID_PART, ACTION_ID;
28205
28206
  var init_worker_subtree = __esm({
28206
28207
  "../../core/ts/src/worker-subtree.ts"() {
28208
+ "use strict";
28207
28209
  init_worker_subtree_safe_types_generated();
28208
28210
  WORKER_SUBTREE_CEILINGS = Object.freeze({
28209
28211
  maxEncodedBytes: 65536,
@@ -55228,10 +55230,41 @@ function assetBytes(asset) {
55228
55230
  `preview asset (${asset.contentType}) has neither bytes nor base64 \u2014 exactly one must be set by the producer`
55229
55231
  );
55230
55232
  }
55231
- function bytes(asset, cacheControl) {
55233
+ function bytes(asset, cacheControl, cors = false) {
55232
55234
  return new Response(assetBytes(asset), {
55233
55235
  status: 200,
55234
- headers: { "content-type": asset.contentType, "cache-control": cacheControl }
55236
+ headers: {
55237
+ "content-type": asset.contentType,
55238
+ "cache-control": cacheControl,
55239
+ // #3425 — an EMBEDDED boot loads the bundle and its fonts from another origin: a module
55240
+ // script and an @font-face are always fetched in CORS mode. Public, content-addressed (or
55241
+ // shell) bytes with no credential attached, so `*` — never a reflected origin, never
55242
+ // Allow-Credentials.
55243
+ ...cors ? { "access-control-allow-origin": "*" } : {}
55244
+ }
55245
+ });
55246
+ }
55247
+ function embedManifest(assets) {
55248
+ const index = assets.get("index.html");
55249
+ if (!index) {
55250
+ return new Response(JSON.stringify({ error: "preview_not_built" }), {
55251
+ status: 503,
55252
+ headers: { "content-type": "application/json; charset=utf-8", "access-control-allow-origin": "*" }
55253
+ });
55254
+ }
55255
+ const html = new TextDecoder().decode(assetBytes(index)).replace(/(=|url\()(["']?)\/preview\//g, "$1$2");
55256
+ const attr = (tag, name) => tag.match(new RegExp(`\\s${name}=["']([^"']+)["']`, "i"))?.[1];
55257
+ const script = [...html.matchAll(/<script\b[^>]*>/gi)].map((m) => m[0]).filter((t) => /type=["']module["']/i.test(t)).map((t) => attr(t, "src")).find(Boolean);
55258
+ const styles = [...html.matchAll(/<link\b[^>]*>/gi)].map((m) => m[0]).filter((t) => /rel=["']stylesheet["']/i.test(t)).map((t) => attr(t, "href")).filter((h) => !!h);
55259
+ const css = [...html.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi)].map((m) => m[1]).join("\n");
55260
+ return new Response(JSON.stringify({ v: 1, base: "preview/", script: script ?? null, styles, css, frame: "t5-frame.html" }), {
55261
+ status: 200,
55262
+ headers: {
55263
+ "content-type": "application/json; charset=utf-8",
55264
+ // It changes on every artifact deploy (new hashed entry), so it is never cached as immutable.
55265
+ "cache-control": "no-cache",
55266
+ "access-control-allow-origin": "*"
55267
+ }
55235
55268
  });
55236
55269
  }
55237
55270
  function scriptNonce() {
@@ -55289,6 +55322,7 @@ function indexHtml(asset, pathname, creds, handoverAttempted = false) {
55289
55322
  }
55290
55323
  function previewResponse(pathname, assets, mount = "/preview", creds, handoverAttempted = false) {
55291
55324
  const key2 = pathname.replace(MOUNT_STRIP[mount], "") || "index.html";
55325
+ if (key2 === "embed.json") return embedManifest(assets);
55292
55326
  const hit = assets.get(key2);
55293
55327
  if (hit) {
55294
55328
  if (key2 === "index.html") return indexHtml(hit, pathname, creds, handoverAttempted);
@@ -55305,8 +55339,8 @@ function previewResponse(pathname, assets, mount = "/preview", creds, handoverAt
55305
55339
  });
55306
55340
  }
55307
55341
  const immutable = key2.startsWith("assets/");
55308
- if (key2.startsWith("fonts/")) return bytes(hit, "public, max-age=86400, stale-while-revalidate=604800");
55309
- return bytes(hit, immutable ? "public, max-age=31536000, immutable" : "no-cache");
55342
+ if (key2.startsWith("fonts/")) return bytes(hit, "public, max-age=86400, stale-while-revalidate=604800", true);
55343
+ return bytes(hit, immutable ? "public, max-age=31536000, immutable" : "no-cache", immutable);
55310
55344
  }
55311
55345
  if (key2.startsWith("assets/") || key2.startsWith("__himi/")) {
55312
55346
  return new Response(JSON.stringify({ error: "preview_asset_not_found", key: key2 }), {
@@ -55613,21 +55647,21 @@ var init_preview_assets_generated = __esm({
55613
55647
  "../../packages/serve/src/preview-assets.generated.ts"() {
55614
55648
  init_preview_assets_format();
55615
55649
  PREVIEW_ASSET_MANIFEST = [
55616
- { key: "assets/index-BtkpizCd.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1084929, sha256: "31c667f8a14df2ebf95ca6f3c8d16763cc48e4c4a687efc97f8e7e13a90d71fa" },
55617
- { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 1084937, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
55618
- { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 1089547, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
55619
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 1578131, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
55620
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 1669055, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
55621
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 1760039, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
55622
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 1851019, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
55623
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 1941891, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
55624
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 2032871, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
55625
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 2141507, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
55626
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 2250591, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
55627
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 2359639, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
55628
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 2467339, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
55629
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 2555447, length: 4947, sha256: "6b533f016eba30621c9c3e7dc26c86c26031f1663b5f107249fe3e848b7d785d" },
55630
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 2560394, length: 17209, sha256: "dffc9718e2faa63ae2cc919e0a842f585ed565aaaa7c53778e90379442c731b6" }
55650
+ { key: "assets/index-CkJJIVgC.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1086565, sha256: "23abe36ec66a0951f04e69988f44efc2bebcf316b5e62c106b189b3c98c43833" },
55651
+ { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 1086573, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
55652
+ { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 1091183, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
55653
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 1579767, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
55654
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 1670691, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
55655
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 1761675, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
55656
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 1852655, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
55657
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 1943527, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
55658
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 2034507, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
55659
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 2143143, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
55660
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 2252227, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
55661
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 2361275, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
55662
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 2468975, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
55663
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 2557083, length: 4947, sha256: "000fae927c619a62d02eac8479271fdfbe65747b09affafd58490063eaaf614a" },
55664
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 2562030, length: 17209, sha256: "dffc9718e2faa63ae2cc919e0a842f585ed565aaaa7c53778e90379442c731b6" }
55631
55665
  ];
55632
55666
  }
55633
55667
  });
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1095.0",
3
+ "version": "0.1096.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": [
@@ -67,5 +67,5 @@
67
67
  "artifactId": "himalaya-cli"
68
68
  }
69
69
  },
70
- "falconPackageHash": "3bc088681bc2460aba97337c0ea933769ccdab5b89076e5c716775a1"
70
+ "falconPackageHash": "8c3d412276bbc440753d0cea961d942686f0bc403cf0c4552ef2f12c"
71
71
  }