@wix/himalaya-cli 0.958.0 → 0.959.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 +96 -8
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -18547,7 +18547,6 @@ function shouldRevealError(args) {
|
|
|
18547
18547
|
var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE;
|
|
18548
18548
|
var init_validation = __esm({
|
|
18549
18549
|
"../../core/ts/src/validation.ts"() {
|
|
18550
|
-
"use strict";
|
|
18551
18550
|
EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
|
|
18552
18551
|
URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
|
|
18553
18552
|
INTEGER_RE = /^[+-]?[0-9]+$/;
|
|
@@ -21972,7 +21971,6 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
|
|
|
21972
21971
|
var WORKER_SUBTREE_CEILINGS, ID_PART, ACTION_ID;
|
|
21973
21972
|
var init_worker_subtree = __esm({
|
|
21974
21973
|
"../../core/ts/src/worker-subtree.ts"() {
|
|
21975
|
-
"use strict";
|
|
21976
21974
|
init_worker_subtree_safe_types_generated();
|
|
21977
21975
|
WORKER_SUBTREE_CEILINGS = Object.freeze({
|
|
21978
21976
|
maxEncodedBytes: 65536,
|
|
@@ -48471,8 +48469,11 @@ function cloneCell(template, prefix, vertical, card) {
|
|
|
48471
48469
|
cell.modifiers.accessibilityLabel = card.title;
|
|
48472
48470
|
return cell;
|
|
48473
48471
|
}
|
|
48472
|
+
function lineIndent(src, open) {
|
|
48473
|
+
return /^[ \t]*/.exec(src.slice(src.lastIndexOf("\n", open) + 1, open))[0];
|
|
48474
|
+
}
|
|
48474
48475
|
function serializeAt(node, src, open) {
|
|
48475
|
-
const indent =
|
|
48476
|
+
const indent = lineIndent(src, open);
|
|
48476
48477
|
return JSON.stringify(node, null, 2).split("\n").map((line, i) => i === 0 ? line : indent + line).join("\n");
|
|
48477
48478
|
}
|
|
48478
48479
|
function patchGrids(src, installed, patch) {
|
|
@@ -48570,14 +48571,88 @@ function patchModules(src, installed, patch) {
|
|
|
48570
48571
|
return `"homeModules": ${JSON.stringify(JSON.stringify(kept))}`;
|
|
48571
48572
|
});
|
|
48572
48573
|
}
|
|
48573
|
-
function
|
|
48574
|
+
function homeScreenSpan(src, homeActionId) {
|
|
48575
|
+
const OPEN = /"([A-Za-z_0-9]+)": \{\s*"screenId": "\1"/g;
|
|
48576
|
+
for (let m = OPEN.exec(src); m; m = OPEN.exec(src)) {
|
|
48577
|
+
const open = src.indexOf("{", m.index);
|
|
48578
|
+
const close = objectEnd(src, open);
|
|
48579
|
+
if (close < 0) continue;
|
|
48580
|
+
if (src.slice(open, close).includes(`"actionId": "${homeActionId}"`)) return { open, close };
|
|
48581
|
+
OPEN.lastIndex = close;
|
|
48582
|
+
}
|
|
48583
|
+
return void 0;
|
|
48584
|
+
}
|
|
48585
|
+
function isDeadStoreCta(node) {
|
|
48586
|
+
if (node.body?.type !== "Button") return false;
|
|
48587
|
+
const action = node.body.props?.action;
|
|
48588
|
+
const screenId = action?.params?.screenId;
|
|
48589
|
+
return typeof screenId === "string" && isStoreScreen(screenId);
|
|
48590
|
+
}
|
|
48591
|
+
function pruneNode(node, dropped) {
|
|
48592
|
+
const props = node.body?.props;
|
|
48593
|
+
if (!props) return true;
|
|
48594
|
+
const lists = props.itemsPath ? ["children"] : ["children", "items"];
|
|
48595
|
+
for (const key2 of lists) {
|
|
48596
|
+
const list = props[key2];
|
|
48597
|
+
if (!Array.isArray(list) || !list.length) continue;
|
|
48598
|
+
const kept = list.filter((child) => {
|
|
48599
|
+
if (!isNode2(child)) return true;
|
|
48600
|
+
if (isDeadStoreCta(child)) {
|
|
48601
|
+
dropped.push(typeof child.id === "string" && child.id ? child.id : "(unnamed CTA)");
|
|
48602
|
+
return false;
|
|
48603
|
+
}
|
|
48604
|
+
return pruneNode(child, dropped);
|
|
48605
|
+
});
|
|
48606
|
+
if (kept.length === list.length) continue;
|
|
48607
|
+
if (!kept.length) return false;
|
|
48608
|
+
props[key2] = kept;
|
|
48609
|
+
}
|
|
48610
|
+
for (const [key2, child] of Object.entries(props)) {
|
|
48611
|
+
if (lists.includes(key2)) continue;
|
|
48612
|
+
pruneWithin(child, dropped);
|
|
48613
|
+
}
|
|
48614
|
+
return true;
|
|
48615
|
+
}
|
|
48616
|
+
function pruneWithin(value, dropped) {
|
|
48617
|
+
if (Array.isArray(value)) {
|
|
48618
|
+
for (const child of value) pruneWithin(child, dropped);
|
|
48619
|
+
return;
|
|
48620
|
+
}
|
|
48621
|
+
if (!value || typeof value !== "object") return;
|
|
48622
|
+
if (isNode2(value)) {
|
|
48623
|
+
pruneNode(value, dropped);
|
|
48624
|
+
return;
|
|
48625
|
+
}
|
|
48626
|
+
for (const child of Object.values(value)) pruneWithin(child, dropped);
|
|
48627
|
+
}
|
|
48628
|
+
function patchStoreCtas(src, verticals, homeActionId) {
|
|
48629
|
+
if (verticals.includes("store")) return { src, dropped: [] };
|
|
48630
|
+
const span = homeScreenSpan(src, homeActionId);
|
|
48631
|
+
if (!span) return { src, dropped: [] };
|
|
48632
|
+
let screen;
|
|
48633
|
+
try {
|
|
48634
|
+
screen = JSON.parse(src.slice(span.open, span.close));
|
|
48635
|
+
} catch {
|
|
48636
|
+
return { src, dropped: [] };
|
|
48637
|
+
}
|
|
48638
|
+
if (!isNode2(screen.payload)) return { src, dropped: [] };
|
|
48639
|
+
const dropped = [];
|
|
48640
|
+
if (!pruneNode(screen.payload, dropped) || !dropped.length) return { src, dropped: [] };
|
|
48641
|
+
return {
|
|
48642
|
+
src: src.slice(0, span.open) + serializeAt(screen, src, span.open) + src.slice(span.close),
|
|
48643
|
+
dropped
|
|
48644
|
+
};
|
|
48645
|
+
}
|
|
48646
|
+
function patchHomeForVerticals(src, verticals, homeActionId) {
|
|
48574
48647
|
const installed = new Set(verticals.filter(isKnown));
|
|
48575
|
-
const patch = { src, cells: [], added: [], droppedModules: [], unreachable: [] };
|
|
48648
|
+
const patch = { src, cells: [], added: [], droppedModules: [], droppedCtas: [], unreachable: [] };
|
|
48576
48649
|
if (!installed.size) return patch;
|
|
48577
|
-
|
|
48650
|
+
const ctas = patchStoreCtas(patchModules(patchGrids(src, installed, patch), installed, patch), [...installed], homeActionId);
|
|
48651
|
+
patch.src = ctas.src;
|
|
48652
|
+
patch.droppedCtas = ctas.dropped;
|
|
48578
48653
|
return patch;
|
|
48579
48654
|
}
|
|
48580
|
-
var EXPLORE_CARDS, EXPLORE_ORDER, EXPLORE_MAX_CELLS, MODULE_SOURCE_VERTICALS, isKnown, GRID_VERTICAL_LABELS, escapeRe2, textProps;
|
|
48655
|
+
var EXPLORE_CARDS, EXPLORE_ORDER, EXPLORE_MAX_CELLS, MODULE_SOURCE_VERTICALS, isKnown, GRID_VERTICAL_LABELS, escapeRe2, textProps, STORE_SCREENS, isStoreScreen, isNode2;
|
|
48581
48656
|
var init_home_descriptor = __esm({
|
|
48582
48657
|
"src/site-analyze/home-descriptor.ts"() {
|
|
48583
48658
|
init_types2();
|
|
@@ -48651,6 +48726,16 @@ var init_home_descriptor = __esm({
|
|
|
48651
48726
|
GRID_VERTICAL_LABELS = /* @__PURE__ */ new Set([...KNOWN_VERTICALS, "faq"]);
|
|
48652
48727
|
escapeRe2 = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
48653
48728
|
textProps = (n) => n?.body?.props;
|
|
48729
|
+
STORE_SCREENS = /* @__PURE__ */ new Set([
|
|
48730
|
+
"himi_shop",
|
|
48731
|
+
"himi_saved_products",
|
|
48732
|
+
"himi_collections",
|
|
48733
|
+
"himi_collection",
|
|
48734
|
+
"himi_cart",
|
|
48735
|
+
"himi_orders"
|
|
48736
|
+
]);
|
|
48737
|
+
isStoreScreen = (id) => STORE_SCREENS.has(id) || /^himi_(?:product|order)[_/]/.test(id);
|
|
48738
|
+
isNode2 = (v) => !!v && typeof v === "object" && !!v.body && typeof v.body === "object";
|
|
48654
48739
|
}
|
|
48655
48740
|
});
|
|
48656
48741
|
|
|
@@ -48877,8 +48962,11 @@ async function applyOverlays(input) {
|
|
|
48877
48962
|
const patched = patchBrandParams(prev, overlay, homeAction);
|
|
48878
48963
|
let next = patched.src;
|
|
48879
48964
|
if (!patched.foreign && overlay.installedVerticals?.length) {
|
|
48880
|
-
const home = patchHomeForVerticals(next, overlay.installedVerticals);
|
|
48965
|
+
const home = patchHomeForVerticals(next, overlay.installedVerticals, homeAction);
|
|
48881
48966
|
next = home.src;
|
|
48967
|
+
if (home.droppedCtas.length) {
|
|
48968
|
+
notes.push(`removed the home's store call(s) to action (${home.droppedCtas.join(", ")}) \u2014 this site has no store`);
|
|
48969
|
+
}
|
|
48882
48970
|
if (home.unreachable.length) {
|
|
48883
48971
|
const named = home.unreachable.slice(0, 6).join(", ");
|
|
48884
48972
|
const rest = home.unreachable.length > 6 ? ` (and ${home.unreachable.length - 6} more)` : "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.959.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": [
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"artifactId": "himalaya-cli"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
"falconPackageHash": "
|
|
67
|
+
"falconPackageHash": "28086de6e860b4001b12cb38f701893e959b034a5b7fa2099a215151"
|
|
68
68
|
}
|