@wix/himalaya-cli 0.1836.0 → 0.1838.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 +64 -12
- package/guides/himi-json-output.md +1 -1
- package/guides/himi-test.md +6 -1
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -4445,6 +4445,7 @@ var init_himi_package = __esm({
|
|
|
4445
4445
|
var ICON_VIEW_BOX, ICON_STROKE_WIDTH, ICON_FALLBACK, ICON_CATALOG, ICON_NORMALIZED_INDEX, ICON_NAMES;
|
|
4446
4446
|
var init_icon_catalog_generated = __esm({
|
|
4447
4447
|
"../../core/ts/src/icon-catalog.generated.ts"() {
|
|
4448
|
+
"use strict";
|
|
4448
4449
|
init_define_HHP_CATALOG();
|
|
4449
4450
|
ICON_VIEW_BOX = 24;
|
|
4450
4451
|
ICON_STROKE_WIDTH = 2;
|
|
@@ -147750,26 +147751,26 @@ function buildRenderTree(node3, path2 = "$", provider = null, itemScope = void 0
|
|
|
147750
147751
|
}
|
|
147751
147752
|
}
|
|
147752
147753
|
if (type2 === "EmptyState") {
|
|
147753
|
-
const
|
|
147754
|
+
const painted3 = (raw) => {
|
|
147754
147755
|
if (typeof raw !== "string") return void 0;
|
|
147755
147756
|
const r3 = resolveTreeScalar(raw, provider, itemScope);
|
|
147756
147757
|
const s5 = typeof r3 === "string" ? r3 : typeof r3 === "number" ? String(r3) : void 0;
|
|
147757
147758
|
return s5 !== void 0 && s5.trim() !== "" ? s5 : void 0;
|
|
147758
147759
|
};
|
|
147759
|
-
const subtitle =
|
|
147760
|
+
const subtitle = painted3(props2.subtitle);
|
|
147760
147761
|
if (subtitle !== void 0) values.subtitle = subtitle;
|
|
147761
|
-
const actionLabel = props2.action != null ?
|
|
147762
|
+
const actionLabel = props2.action != null ? painted3(props2.actionLabel) : void 0;
|
|
147762
147763
|
if (actionLabel !== void 0) values.actionLabel = actionLabel;
|
|
147763
147764
|
}
|
|
147764
147765
|
if (type2 === "ErrorState") {
|
|
147765
|
-
const
|
|
147766
|
+
const painted3 = (raw) => {
|
|
147766
147767
|
if (typeof raw !== "string") return void 0;
|
|
147767
147768
|
const r3 = resolveTreeScalar(raw, provider, itemScope);
|
|
147768
147769
|
return typeof r3 === "string" && r3.trim() !== "" ? r3 : void 0;
|
|
147769
147770
|
};
|
|
147770
|
-
const body2 =
|
|
147771
|
+
const body2 = painted3(props2.body);
|
|
147771
147772
|
if (body2 !== void 0) values.body = body2;
|
|
147772
|
-
const ctaLabel = props2.cta != null ?
|
|
147773
|
+
const ctaLabel = props2.cta != null ? painted3(props2.ctaLabel) : void 0;
|
|
147773
147774
|
if (ctaLabel !== void 0) values.ctaLabel = ctaLabel;
|
|
147774
147775
|
}
|
|
147775
147776
|
const template = props2.template;
|
|
@@ -147838,10 +147839,35 @@ function buildRenderTree(node3, path2 = "$", provider = null, itemScope = void 0
|
|
|
147838
147839
|
}
|
|
147839
147840
|
}
|
|
147840
147841
|
};
|
|
147841
|
-
|
|
147842
|
+
const painted2 = provider && type2 === "FragmentSlot" ? paintedFragmentCase(props2, provider, itemScope) : null;
|
|
147843
|
+
if (painted2 !== null) {
|
|
147844
|
+
for (const [key4, value2] of Object.entries(props2)) {
|
|
147845
|
+
if (key4 !== "cases") {
|
|
147846
|
+
visit(value2, `${id}.${key4}`);
|
|
147847
|
+
continue;
|
|
147848
|
+
}
|
|
147849
|
+
value2.forEach((fragment, i2) => {
|
|
147850
|
+
const content = fragment?.content;
|
|
147851
|
+
const child3 = isSduiNode(content) ? buildRenderTree(content, `${id}/${type2}`, provider, itemScope, includeRawProps, env, a11yHidden) : null;
|
|
147852
|
+
if (!child3) return;
|
|
147853
|
+
if (i2 !== painted2) child3.hidden = true;
|
|
147854
|
+
children2.push(child3);
|
|
147855
|
+
});
|
|
147856
|
+
}
|
|
147857
|
+
} else visit(props2, id);
|
|
147842
147858
|
if (children2.length) out2.children = children2;
|
|
147843
147859
|
return out2;
|
|
147844
147860
|
}
|
|
147861
|
+
function paintedFragmentCase(props2, provider, itemScope) {
|
|
147862
|
+
const cases = props2.cases;
|
|
147863
|
+
const casePath = props2.casePath ?? props2.case_path;
|
|
147864
|
+
if (!Array.isArray(cases) || !cases.length || typeof casePath !== "string" || isEnvExpr(casePath)) return null;
|
|
147865
|
+
const idOf = (fragment) => fragment?.id;
|
|
147866
|
+
const answer = casePath.startsWith("$app:") ? provider.value(casePath) : resolveTreeScalar(casePath, provider, itemScope);
|
|
147867
|
+
const picked = cases.findIndex((fragment) => idOf(fragment) === answer);
|
|
147868
|
+
const fallback = cases.findIndex((fragment) => idOf(fragment) === (props2.defaultCase ?? props2.default_case));
|
|
147869
|
+
return picked >= 0 ? picked : Math.max(fallback, 0);
|
|
147870
|
+
}
|
|
147845
147871
|
function isSduiNode(node3) {
|
|
147846
147872
|
return !!node3 && typeof node3 === "object" && !!node3.body;
|
|
147847
147873
|
}
|
|
@@ -246433,11 +246459,37 @@ __export(input_evidence_isolation_exports, {
|
|
|
246433
246459
|
runInputEvidenceChild: () => runInputEvidenceChild
|
|
246434
246460
|
});
|
|
246435
246461
|
async function installInputEvidenceIsolation(dir) {
|
|
246436
|
-
const { lstatSync: lstatSync42, readdirSync: readdirSync67 } = await import("node:fs");
|
|
246437
|
-
const { join: join213 } = await import("node:path");
|
|
246462
|
+
const { lstatSync: lstatSync42, readdirSync: readdirSync67, readlinkSync: readlinkSync3, realpathSync: realpathSync26 } = await import("node:fs");
|
|
246463
|
+
const { dirname: dirname91, isAbsolute: isAbsolute23, join: join213, relative: relative40, resolve: resolve133, sep: sep37 } = await import("node:path");
|
|
246464
|
+
const root = resolve133(dir);
|
|
246465
|
+
const privateDir = join213(root, ".himi");
|
|
246466
|
+
const privateReal = join213(realpathSync26(root), ".himi") + sep37;
|
|
246467
|
+
const within2 = (base2, path2) => {
|
|
246468
|
+
const rel2 = relative40(base2, path2);
|
|
246469
|
+
return !!rel2 && rel2 !== ".." && !rel2.startsWith(`..${sep37}`) && !isAbsolute23(rel2);
|
|
246470
|
+
};
|
|
246471
|
+
const recording = join213(dir, "dev", "net-mocks.json");
|
|
246472
|
+
const isAllowedLink = (path2) => {
|
|
246473
|
+
try {
|
|
246474
|
+
if (path2 === recording) {
|
|
246475
|
+
const link4 = readlinkSync3(path2);
|
|
246476
|
+
if (isAbsolute23(link4)) return false;
|
|
246477
|
+
const target = resolve133(dirname91(path2), link4);
|
|
246478
|
+
if (!within2(privateDir, target)) return false;
|
|
246479
|
+
if (realpathSync26(path2) !== join213(realpathSync26(root), relative40(root, target))) return false;
|
|
246480
|
+
return lstatSync42(target).isFile();
|
|
246481
|
+
}
|
|
246482
|
+
return within2(privateDir, resolve133(path2)) && realpathSync26(path2).startsWith(privateReal);
|
|
246483
|
+
} catch {
|
|
246484
|
+
return false;
|
|
246485
|
+
}
|
|
246486
|
+
};
|
|
246438
246487
|
const check = (path2) => {
|
|
246439
246488
|
const stat10 = lstatSync42(path2);
|
|
246440
|
-
if (stat10.isSymbolicLink())
|
|
246489
|
+
if (stat10.isSymbolicLink()) {
|
|
246490
|
+
if (isAllowedLink(path2)) return;
|
|
246491
|
+
throw new Error("input evidence requires a content tree without symlinks");
|
|
246492
|
+
}
|
|
246441
246493
|
if (stat10.isDirectory()) for (const name of readdirSync67(path2)) check(join213(path2, name));
|
|
246442
246494
|
};
|
|
246443
246495
|
check(dir);
|
|
@@ -289088,8 +289140,8 @@ async function testCommand(ctx) {
|
|
|
289088
289140
|
print({ ok: false, code: "test_input_evidence_requires_json", error: "--input-evidence requires --json" });
|
|
289089
289141
|
return 2;
|
|
289090
289142
|
}
|
|
289091
|
-
if (captureInputEvidence && (flags.browser === true || existsSync115(join149(dir, "functions")))) {
|
|
289092
|
-
print({ ok: false, code: "test_input_evidence_unsupported_mode", error: "--input-evidence needs the local app worker crawl, not --browser or a functions package" });
|
|
289143
|
+
if (captureInputEvidence && (flags.browser === true || flags.record === true || existsSync115(join149(dir, "functions")))) {
|
|
289144
|
+
print({ ok: false, code: "test_input_evidence_unsupported_mode", error: "--input-evidence needs the local app worker crawl, not --browser, --record or a functions package" });
|
|
289093
289145
|
return 2;
|
|
289094
289146
|
}
|
|
289095
289147
|
let sourceArchiveHash;
|
|
@@ -142,7 +142,7 @@ keeps its existing fields and adds the code:
|
|
|
142
142
|
| `test_browser_cold_visits_unsupported` | `--browser` was requested with an authored `coldVisits` contract. Exit 2 before compilation or opening a browser; run without `--browser` to exercise those visits. The browser loop cannot certify saved-record return behavior. |
|
|
143
143
|
| `test_browser_journeys_unsupported` | `--browser` was requested with authored journeys that have no `coldVisits`. Exit 2 before compilation or opening a browser. The single-screen browser loop does not execute authored steps or root `expectText`/`absentText` assertions; run without `--browser` to execute that contract. The existing cold-visit code remains in use when any journey has `coldVisits`. |
|
|
144
144
|
| `test_input_evidence_requires_json` | `--input-evidence` was requested without explicit `--json`. Exit 2 before build or worker execution. |
|
|
145
|
-
| `test_input_evidence_unsupported_mode` | `--input-evidence` was combined with `--browser
|
|
145
|
+
| `test_input_evidence_unsupported_mode` | `--input-evidence` was combined with `--browser` or `--record` (the recording is outside the archived source hash), or the content is a functions package rather than an app worker crawl. Exit 2 before execution. |
|
|
146
146
|
| `test_input_evidence_unavailable` | The isolated input crawl cannot establish all contained realms, cannot read a stable source archive before/after the crawl, or fails to return one complete JSON report (including interruption, process timeout or output limit). Exit 1; no host-realm fallback or positive input acceptance. |
|
|
147
147
|
|
|
148
148
|
This is a scoped migration. Other legacy `himi test` failure paths retain their existing envelopes.
|
package/guides/himi-test.md
CHANGED
|
@@ -89,7 +89,12 @@ import confinement, and establishes QuickJS/WASM realms for generated dev module
|
|
|
89
89
|
config, worker boot and worker actions before loading generated modules. Explicit
|
|
90
90
|
host-realm overrides or unavailable isolation refuse with
|
|
91
91
|
`test_input_evidence_unavailable`; there is no host fallback. Packages containing
|
|
92
|
-
symlinks are refused
|
|
92
|
+
symlinks are refused, with two exceptions that the One App migration guide asks for, both
|
|
93
|
+
tied to the private `.himi/` folder (the source archive never contains it): `dev/net-mocks.json`
|
|
94
|
+
may be a relative link to a regular file inside `.himi/`, and a link inside `.himi/` may point
|
|
95
|
+
only inside `.himi/` (the `.bin` links npm makes for the guide's pixel tools). A recording read
|
|
96
|
+
through that link is not part of the archived source hash, so `--record` cannot be combined with
|
|
97
|
+
`--input-evidence`. The compiler accepts package-owned files and CLI-owned
|
|
93
98
|
source/staged SDK roots; it does not expand arbitrary app or ancestor dependency
|
|
94
99
|
links into trusted roots. A separate editor SDK install cannot substitute for the
|
|
95
100
|
pinned CLI's runtime in this mode. The trusted caller must keep the generated
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1838.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": [
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"artifactId": "himalaya-cli"
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
"falconPackageHash": "
|
|
85
|
+
"falconPackageHash": "db6d51cd30959d45758c8f062432b7c9833e59662d6c59a33fd8e5b3"
|
|
86
86
|
}
|