@wix/himalaya-cli 0.1845.0 → 0.1846.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 +492 -169
  2. 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;
@@ -42978,7 +42979,6 @@ function shouldRevealError(args) {
42978
42979
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE, AUTHORED_PATTERN_LIMIT, authoredPatterns;
42979
42980
  var init_validation = __esm({
42980
42981
  "../../core/ts/src/validation.ts"() {
42981
- "use strict";
42982
42982
  init_define_HHP_CATALOG();
42983
42983
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
42984
42984
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
@@ -265502,6 +265502,486 @@ var init_setup_check = __esm({
265502
265502
  }
265503
265503
  });
265504
265504
 
265505
+ // ../ci/presentation-lint/lex-native.mjs
265506
+ function chainBefore(src, end2) {
265507
+ let i2 = end2;
265508
+ while (i2 > 0 && /\s/.test(src[i2 - 1])) i2 -= 1;
265509
+ const stop2 = i2;
265510
+ let start2 = i2;
265511
+ let leadingDot = false;
265512
+ for (; ; ) {
265513
+ let j2 = start2;
265514
+ while (j2 > 0 && IDENT2.test(src[j2 - 1])) j2 -= 1;
265515
+ if (j2 === start2) break;
265516
+ start2 = j2;
265517
+ let k3 = j2;
265518
+ while (k3 > 0 && /\s/.test(src[k3 - 1])) k3 -= 1;
265519
+ if (k3 > 0 && src[k3 - 1] === ".") {
265520
+ k3 -= 1;
265521
+ if (k3 > 0 && (src[k3 - 1] === "?" || src[k3 - 1] === "!")) k3 -= 1;
265522
+ while (k3 > 0 && /\s/.test(src[k3 - 1])) k3 -= 1;
265523
+ let w2 = k3;
265524
+ while (w2 > 0 && IDENT2.test(src[w2 - 1])) w2 -= 1;
265525
+ if (k3 > 0 && IDENT2.test(src[k3 - 1]) && !KEYWORDS.has(src.slice(w2, k3))) {
265526
+ start2 = k3;
265527
+ continue;
265528
+ }
265529
+ leadingDot = true;
265530
+ }
265531
+ break;
265532
+ }
265533
+ if (start2 === stop2) return void 0;
265534
+ const chain = src.slice(start2, stop2).replace(/[\s?!]+/g, "");
265535
+ return /^[A-Za-z_]/.test(chain) ? leadingDot ? `.${chain}` : chain : void 0;
265536
+ }
265537
+ function lexNative(src, { strict = false, lang } = {}) {
265538
+ const dollar = lang !== "swift";
265539
+ const literals = [];
265540
+ const markers = [];
265541
+ const n2 = src.length;
265542
+ const fail16 = (what, at2) => {
265543
+ if (strict) throw new Error(`${what} at line ${lineOf3(at2)}`);
265544
+ };
265545
+ const lineStarts = [0];
265546
+ for (let k3 = 0; k3 < n2; k3 += 1) if (src[k3] === "\n") lineStarts.push(k3 + 1);
265547
+ const lineOf3 = (pos) => {
265548
+ let lo2 = 0;
265549
+ let hi2 = lineStarts.length - 1;
265550
+ while (lo2 < hi2) {
265551
+ const mid = lo2 + hi2 + 1 >> 1;
265552
+ if (lineStarts[mid] <= pos) lo2 = mid;
265553
+ else hi2 = mid - 1;
265554
+ }
265555
+ return lo2 + 1;
265556
+ };
265557
+ const lineText = (line) => src.slice(lineStarts[line - 1], (lineStarts[line] ?? n2 + 1) - 1).replace(/\r$/, "");
265558
+ const stack = [];
265559
+ const conds = [];
265560
+ const inDebug = () => conds.some((c2) => c2.debug);
265561
+ let pendingSkip;
265562
+ let lastClosedCallee;
265563
+ const skippedNow = () => inDebug() || stack.length > 0 && stack[stack.length - 1].skipped;
265564
+ function readString(i3, collect2) {
265565
+ let hashes = 0;
265566
+ while (src[i3 + hashes] === "#") hashes += 1;
265567
+ const q4 = i3 + hashes;
265568
+ const triple = src.startsWith('"""', q4);
265569
+ const quoteLen = triple ? 3 : 1;
265570
+ const close = '"'.repeat(quoteLen) + "#".repeat(hashes);
265571
+ const kotlinRaw = triple && hashes === 0 && lang === "kotlin";
265572
+ let p2 = q4 + quoteLen;
265573
+ let text32 = "";
265574
+ for (; ; ) {
265575
+ if (p2 >= n2) {
265576
+ fail16("unterminated string", i3);
265577
+ return { end: n2, text: text32 };
265578
+ }
265579
+ if (src.startsWith(close, p2)) {
265580
+ if (triple && hashes === 0 && src[p2 + 3] === '"') {
265581
+ text32 += '"';
265582
+ p2 += 1;
265583
+ continue;
265584
+ }
265585
+ return { end: p2 + close.length, text: text32 };
265586
+ }
265587
+ const ch2 = src[p2];
265588
+ if (!triple && ch2 === "\n") {
265589
+ fail16("unterminated string", i3);
265590
+ return { end: p2, text: text32 };
265591
+ }
265592
+ if (hashes > 0) {
265593
+ if (src.startsWith("\\" + "#".repeat(hashes) + "(", p2)) {
265594
+ p2 = skipBalanced(p2 + 1 + hashes, "(", ")");
265595
+ text32 += "{}";
265596
+ continue;
265597
+ }
265598
+ text32 += ch2;
265599
+ p2 += 1;
265600
+ continue;
265601
+ }
265602
+ if (kotlinRaw && ch2 === "\\") {
265603
+ text32 += ch2;
265604
+ p2 += 1;
265605
+ continue;
265606
+ }
265607
+ if (ch2 === "\\" && src[p2 + 1] === "(") {
265608
+ p2 = skipBalanced(p2 + 1, "(", ")");
265609
+ text32 += "{}";
265610
+ continue;
265611
+ }
265612
+ if (dollar && ch2 === "$" && src[p2 + 1] === "{") {
265613
+ p2 = skipBalanced(p2 + 1, "{", "}");
265614
+ text32 += "{}";
265615
+ continue;
265616
+ }
265617
+ if (dollar && ch2 === "$" && /[A-Za-z_]/.test(src[p2 + 1] ?? "")) {
265618
+ p2 += 1;
265619
+ while (p2 < n2 && IDENT2.test(src[p2])) p2 += 1;
265620
+ text32 += "{}";
265621
+ continue;
265622
+ }
265623
+ if (ch2 === "\\") {
265624
+ text32 += src[p2 + 1] ?? "";
265625
+ p2 += 2;
265626
+ continue;
265627
+ }
265628
+ text32 += ch2;
265629
+ p2 += 1;
265630
+ }
265631
+ }
265632
+ function skipBalanced(p2, open6, close) {
265633
+ let depth = 0;
265634
+ while (p2 < n2) {
265635
+ const ch2 = src[p2];
265636
+ if (ch2 === '"') {
265637
+ p2 = readString(p2).end;
265638
+ continue;
265639
+ }
265640
+ if (ch2 === "/" && src[p2 + 1] === "/") {
265641
+ while (p2 < n2 && src[p2] !== "\n") p2 += 1;
265642
+ continue;
265643
+ }
265644
+ if (ch2 === open6) depth += 1;
265645
+ else if (ch2 === close) {
265646
+ depth -= 1;
265647
+ if (depth === 0) return p2 + 1;
265648
+ }
265649
+ p2 += 1;
265650
+ }
265651
+ fail16("unterminated interpolation", p2);
265652
+ return n2;
265653
+ }
265654
+ function noteComment(startPos, endPos, body) {
265655
+ const m2 = MARKER.exec(body.split("\n").find((l3) => MARKER.test(l3)) ?? "");
265656
+ if (!m2) return;
265657
+ const trailing = src.slice(lineStarts[lineOf3(startPos) - 1], startPos).trim() !== "";
265658
+ markers.push({ rule: m2[1], reason: m2[2], line: lineOf3(endPos - 1 > startPos ? endPos - 1 : startPos), trailing });
265659
+ }
265660
+ function directive(i3) {
265661
+ const rest = src.slice(i3, src.indexOf("\n", i3) === -1 ? n2 : src.indexOf("\n", i3));
265662
+ let m2;
265663
+ if (m2 = /^#if\s+(.*?)\s*(?:\/\/.*)?$/.exec(rest)) {
265664
+ const cond = m2[1];
265665
+ conds.push({ debug: cond === "DEBUG", cond });
265666
+ } else if (m2 = /^#elseif\b/.exec(rest)) {
265667
+ if (conds.length) conds[conds.length - 1] = { debug: false, cond: "" };
265668
+ } else if (/^#else\b/.test(rest)) {
265669
+ if (conds.length) {
265670
+ const top = conds[conds.length - 1];
265671
+ conds[conds.length - 1] = { debug: top.cond === "!DEBUG", cond: "" };
265672
+ }
265673
+ } else if (/^#endif\b/.test(rest)) {
265674
+ if (conds.length) conds.pop();
265675
+ else fail16("#endif without #if", i3);
265676
+ }
265677
+ }
265678
+ let atLineStart = true;
265679
+ let i2 = 0;
265680
+ while (i2 < n2) {
265681
+ const c2 = src[i2];
265682
+ const d2 = src[i2 + 1];
265683
+ if (c2 === "\n") {
265684
+ atLineStart = true;
265685
+ i2 += 1;
265686
+ continue;
265687
+ }
265688
+ if (c2 === " " || c2 === " " || c2 === "\r") {
265689
+ i2 += 1;
265690
+ continue;
265691
+ }
265692
+ const wasLineStart = atLineStart;
265693
+ atLineStart = false;
265694
+ if (c2 === "/" && d2 === "/") {
265695
+ let e2 = src.indexOf("\n", i2);
265696
+ if (e2 === -1) e2 = n2;
265697
+ noteComment(i2, e2, src.slice(i2, e2));
265698
+ i2 = e2;
265699
+ continue;
265700
+ }
265701
+ if (c2 === "/" && d2 === "*") {
265702
+ let depth = 0;
265703
+ let p2 = i2;
265704
+ while (p2 < n2) {
265705
+ if (src[p2] === "/" && src[p2 + 1] === "*") {
265706
+ depth += 1;
265707
+ p2 += 2;
265708
+ continue;
265709
+ }
265710
+ if (src[p2] === "*" && src[p2 + 1] === "/") {
265711
+ depth -= 1;
265712
+ p2 += 2;
265713
+ if (depth === 0) break;
265714
+ continue;
265715
+ }
265716
+ p2 += 1;
265717
+ }
265718
+ if (depth !== 0) fail16("unterminated block comment", i2);
265719
+ noteComment(i2, p2, src.slice(i2, p2));
265720
+ i2 = p2;
265721
+ continue;
265722
+ }
265723
+ if (c2 === "#" && wasLineStart && /^#(?:if|elseif|else|endif)\b/.test(src.slice(i2, i2 + 8))) {
265724
+ directive(i2);
265725
+ let e2 = src.indexOf("\n", i2);
265726
+ if (e2 === -1) e2 = n2;
265727
+ i2 = e2;
265728
+ continue;
265729
+ }
265730
+ if (c2 === "#") {
265731
+ let h2 = 0;
265732
+ while (src[i2 + h2] === "#") h2 += 1;
265733
+ if (src[i2 + h2] === '"') {
265734
+ } else {
265735
+ if (src.startsWith("#Preview", i2) && !IDENT2.test(src[i2 + 8] ?? "")) pendingSkip = { depth: stack.length };
265736
+ i2 += 1;
265737
+ continue;
265738
+ }
265739
+ }
265740
+ if (c2 === "@" && src.startsWith("@Preview", i2) && !IDENT2.test(src[i2 + 8] ?? "")) {
265741
+ pendingSkip = { depth: stack.length };
265742
+ i2 += 8;
265743
+ continue;
265744
+ }
265745
+ if (c2 === "a" && pendingSkip && pendingSkip.depth === stack.length && !IDENT2.test(src[i2 - 1] ?? " ") && /^annotation\s+class\b/.test(src.slice(i2, i2 + 40))) {
265746
+ pendingSkip = void 0;
265747
+ i2 += 10;
265748
+ continue;
265749
+ }
265750
+ if (c2 === "P" && src.startsWith("PreviewProvider", i2) && !IDENT2.test(src[i2 - 1] ?? " ") && !IDENT2.test(src[i2 + 15] ?? " ")) {
265751
+ pendingSkip = { depth: stack.length };
265752
+ i2 += 15;
265753
+ continue;
265754
+ }
265755
+ if (c2 === "'") {
265756
+ const m2 = /^'(?:\\u[0-9A-Fa-f]{4}|\\.|[^\\'\n])'/.exec(src.slice(i2, i2 + 8));
265757
+ i2 += m2 ? m2[0].length : 1;
265758
+ continue;
265759
+ }
265760
+ if (c2 === '"' || c2 === "#") {
265761
+ const lineNo = lineOf3(i2);
265762
+ const lineStart = lineStarts[lineNo - 1];
265763
+ const before = src.slice(lineStart, i2);
265764
+ const top = stack[stack.length - 1];
265765
+ let label4;
265766
+ const lead = src.slice(Math.max(0, i2 - 120), i2);
265767
+ if (top && top.open === "(") {
265768
+ const argHead = src.slice(top.argStart, i2).trim();
265769
+ const m2 = /^([A-Za-z_][A-Za-z0-9_]*)\s*:$/.exec(argHead);
265770
+ if (m2) label4 = m2[1];
265771
+ }
265772
+ if (!label4) {
265773
+ const m2 = /(?:^|[^=!<>+\-*/%])\b([A-Za-z_][A-Za-z0-9_]*)\s*=\s*$/.exec(lead);
265774
+ if (m2) label4 = m2[1];
265775
+ }
265776
+ const { end: end2, text: text32 } = readString(i2);
265777
+ literals.push({
265778
+ line: lineNo,
265779
+ text: text32,
265780
+ lineText: lineText(lineNo),
265781
+ before,
265782
+ callee: top?.callee,
265783
+ label: label4,
265784
+ skipped: skippedNow()
265785
+ });
265786
+ i2 = end2;
265787
+ continue;
265788
+ }
265789
+ if (c2 in OPENERS) {
265790
+ let callee;
265791
+ if (c2 === "(") callee = DECLARATION.test(src.slice(Math.max(0, i2 - 200), i2)) ? void 0 : chainBefore(src, i2);
265792
+ else if (c2 === "{") {
265793
+ let k3 = i2;
265794
+ while (k3 > 0 && /\s/.test(src[k3 - 1])) k3 -= 1;
265795
+ if (lang !== "swift" && src[k3 - 1] === ")" && lastClosedCallee && lastClosedCallee.at === k3 - 1) callee = lastClosedCallee.callee;
265796
+ }
265797
+ let skipped = skippedNow();
265798
+ if (c2 === "(" && pendingSkip && pendingSkip.depth === stack.length) skipped = true;
265799
+ if (c2 === "{" && pendingSkip && pendingSkip.depth === stack.length) {
265800
+ skipped = true;
265801
+ pendingSkip = void 0;
265802
+ }
265803
+ stack.push({ open: c2, callee, argStart: i2 + 1, skipped });
265804
+ i2 += 1;
265805
+ continue;
265806
+ }
265807
+ if (CLOSERS.has(c2)) {
265808
+ const top = stack[stack.length - 1];
265809
+ if (!top || OPENERS[top.open] !== c2) {
265810
+ fail16(`unbalanced "${c2}"`, i2);
265811
+ if (top) stack.pop();
265812
+ } else {
265813
+ stack.pop();
265814
+ if (c2 === ")") lastClosedCallee = { at: i2, callee: top.callee };
265815
+ if (pendingSkip && stack.length < pendingSkip.depth) pendingSkip = void 0;
265816
+ }
265817
+ i2 += 1;
265818
+ continue;
265819
+ }
265820
+ if (c2 === "=" && d2 !== "=" && !"=!<>".includes(src[i2 - 1] ?? "") && pendingSkip && pendingSkip.depth === stack.length) pendingSkip = void 0;
265821
+ if (c2 === ",") {
265822
+ const top = stack[stack.length - 1];
265823
+ if (top) top.argStart = i2 + 1;
265824
+ }
265825
+ i2 += 1;
265826
+ }
265827
+ if (stack.length) fail16(`unclosed "${stack[stack.length - 1].open}"`, n2 - 1);
265828
+ if (conds.length) fail16("#if without #endif", n2 - 1);
265829
+ return { literals, markers };
265830
+ }
265831
+ function markerFor(markers, line, rule) {
265832
+ return markers.find((m2) => m2.rule === rule && m2.line === line) ?? markers.find((m2) => m2.rule === rule && m2.line === line - 1 && !m2.trailing);
265833
+ }
265834
+ var IDENT2, OPENERS, CLOSERS, KEYWORDS, DECLARATION, MARKER;
265835
+ var init_lex_native = __esm({
265836
+ "../ci/presentation-lint/lex-native.mjs"() {
265837
+ init_define_HHP_CATALOG();
265838
+ IDENT2 = /[A-Za-z0-9_]/;
265839
+ OPENERS = { "(": ")", "[": "]", "{": "}" };
265840
+ CLOSERS = /* @__PURE__ */ new Set([")", "]", "}"]);
265841
+ KEYWORDS = /* @__PURE__ */ new Set(["return", "case", "in", "else", "throw", "try", "await", "yield", "is", "as", "where", "if", "guard", "while", "switch"]);
265842
+ DECLARATION = /\b(?:fun|func)\s+(?:<[^>]*>\s*)?(?:[A-Za-z_][A-Za-z0-9_]*\s*\.\s*)*[A-Za-z_][A-Za-z0-9_]*\s*(?:<[^>]*>\s*)?$/;
265843
+ MARKER = /himi-literal-ok\(\s*([A-Za-z][A-Za-z0-9_-]*)\s*\)\s*:\s*(.*?)\s*(?:\*\/)?\s*$/;
265844
+ }
265845
+ });
265846
+
265847
+ // ../ci/presentation-lint/rules.mjs
265848
+ function isNonCopyContext(lit) {
265849
+ if (lit.label && NON_COPY_LABELS.has(lit.label)) return true;
265850
+ if (!lit.callee) return false;
265851
+ const parts = lit.callee.split(".");
265852
+ const name = parts.at(-1);
265853
+ if (!NON_COPY_CALLEES.has(name)) return false;
265854
+ if (LOG_LEVELS.has(name)) return parts.at(-2) === "Log";
265855
+ if (name === "error") return parts.length === 1 || /log/i.test(parts.at(-2) ?? "");
265856
+ return true;
265857
+ }
265858
+ function looksLikeCopy(text32) {
265859
+ const t2 = text32.replace(/\{\}/g, " ").trim();
265860
+ if (!/[A-Za-z]/.test(t2)) return false;
265861
+ if (/^(?:https?:|[a-z][a-z0-9+.-]*:\/\/)/.test(t2)) return false;
265862
+ if (/^\$t:/.test(t2)) return false;
265863
+ if (/\s/.test(t2)) return true;
265864
+ return /^[A-Z][a-z]/.test(t2);
265865
+ }
265866
+ var NON_COPY_CALLEES, LOG_LEVELS, NON_COPY_LABELS, RULES, RULE_NAMES;
265867
+ var init_rules = __esm({
265868
+ "../ci/presentation-lint/rules.mjs"() {
265869
+ init_define_HHP_CATALOG();
265870
+ NON_COPY_CALLEES = /* @__PURE__ */ new Set([
265871
+ "print",
265872
+ "println",
265873
+ "NSLog",
265874
+ "os_log",
265875
+ "require",
265876
+ "requireNotNull",
265877
+ "check",
265878
+ "checkNotNull",
265879
+ "precondition",
265880
+ "preconditionFailure",
265881
+ "assert",
265882
+ "assertionFailure",
265883
+ "fatalError",
265884
+ "error",
265885
+ "d",
265886
+ "i",
265887
+ "w",
265888
+ "e",
265889
+ "v",
265890
+ // android.util.Log.<level>, only when the receiver is Log (below)
265891
+ "testTag",
265892
+ "accessibilityIdentifier",
265893
+ "himiFont",
265894
+ "color",
265895
+ "textStyle",
265896
+ "forHTTPHeaderField",
265897
+ "setValue",
265898
+ "addValue",
265899
+ "header",
265900
+ "setRequestProperty"
265901
+ ]);
265902
+ LOG_LEVELS = /* @__PURE__ */ new Set(["d", "i", "w", "e", "v"]);
265903
+ NON_COPY_LABELS = /* @__PURE__ */ new Set(["systemName", "forHTTPHeaderField", "testTag", "identifier"]);
265904
+ RULES = Object.freeze({
265905
+ resolvingIfKey: {
265906
+ why: 'resolvingIfKey is a no-op for any input that is not a "$t:" key, so wrapping an English literal in it translates nothing',
265907
+ fix: "route the string through RuntimeCopy.text(...) instead",
265908
+ // A literal with no letter (`?? ""`, "$4.50") carries no English to translate, so it is not the trap.
265909
+ check: (lit) => lit.callee?.split(".").at(-1) === "resolvingIfKey" && /[A-Za-z]/.test(lit.text) && !/^\$t:/.test(lit.text)
265910
+ },
265911
+ copy: {
265912
+ why: "user-visible copy baked into the runtime \u2014 it cannot be translated or fixed over the air",
265913
+ fix: 'RuntimeCopy.text("runtime.<area>.<key>") with the key in core/runtime/l10n/runtime/en.json, then npm run l10n:runtime',
265914
+ check: (lit) => looksLikeCopy(lit.text) && !isNonCopyContext(lit)
265915
+ }
265916
+ });
265917
+ RULE_NAMES = Object.freeze(Object.keys(RULES));
265918
+ }
265919
+ });
265920
+
265921
+ // ../ci/presentation-lint/policy.json
265922
+ var policy_default;
265923
+ var init_policy3 = __esm({
265924
+ "../ci/presentation-lint/policy.json"() {
265925
+ policy_default = {
265926
+ $comment: "What tools/ci/lint-presentation.mjs scans (#6319). Paths are repo-relative globs: `**/` crosses directories, `*` does not. Everything excluded below is excluded for a stated reason; dev-only status is NEVER inferred from a file name (ImagePreview* is a shipped feature), only listed.",
265927
+ roots: [
265928
+ "core/runtime/ios/**/Sources/**/*.swift",
265929
+ "core/runtime/android/**/src/main/**/*.kt"
265930
+ ],
265931
+ exclude: [
265932
+ "**/Tests/**",
265933
+ "**/src/test/**",
265934
+ "**/src/androidTest/**"
265935
+ ],
265936
+ excludeNote: "Tests never ship. React Native paths (RN_FROZEN, tools/ci/frozen-renderers.mjs) and every path in tools/ci/derived-paths.mjs are excluded in code, from their own sources of truth (a 'Generated by' header excludes nothing: any hand-written file can carry one).",
265937
+ devOnly: [
265938
+ { path: "core/runtime/ios/HimalayaCore/Sources/HimalayaCore/DevReloadHUD.swift", reason: "Dev-only 'Reloading\u2026' HUD; shown only against a dev-server." },
265939
+ { path: "core/runtime/ios/HimalayaCore/Sources/HimalayaCore/DevReloadKeyCatcher.swift", reason: "Dev-only \u2318R key catcher for dev reload." },
265940
+ { path: "core/runtime/ios/HimalayaCore/Sources/HimalayaCore/DevScreenReload.swift", reason: "Dev-only SSE-driven screen hot-reload client." },
265941
+ { path: "core/runtime/ios/HimalayaCore/Sources/HimalayaCore/DevServerBadge.swift", reason: "Dev-only 'which server?' DEV/PROD badge." },
265942
+ { path: "core/runtime/ios/HimalayaCore/Sources/HimalayaCore/HimalayaDevNetProtocol.swift", reason: "Dev-only app-wide network gateway URLProtocol." },
265943
+ { path: "core/runtime/android/io/himalaya/core/src/main/kotlin/io/himalaya/core/DevServerBadge.kt", reason: "Dev-only 'which server?' badge; Android mirror of DevServerBadge.swift." },
265944
+ { path: "core/runtime/android/io/himalaya/core/src/main/kotlin/io/himalaya/core/DevReloadIndicator.kt", reason: "Dev-only 'Reloading\u2026' toast for dev reload." },
265945
+ { path: "core/runtime/android/io/himalaya/core/src/main/kotlin/io/himalaya/core/DevNetHttpExecutor.kt", reason: "Dev-only app-wide network gateway decorator." }
265946
+ ],
265947
+ markerCaps: {
265948
+ copy: 4,
265949
+ resolvingIfKey: 0
265950
+ }
265951
+ };
265952
+ }
265953
+ });
265954
+
265955
+ // ../ci/presentation-lint/governs.mjs
265956
+ function policyGlob(glob) {
265957
+ let out2 = "";
265958
+ for (let i2 = 0; i2 < glob.length; i2 += 1) {
265959
+ const c2 = glob[i2];
265960
+ if (c2 === "*" && glob[i2 + 1] === "*") {
265961
+ if (glob[i2 + 2] === "/") {
265962
+ out2 += "(?:[^/]+/)*";
265963
+ i2 += 2;
265964
+ } else {
265965
+ out2 += ".*";
265966
+ i2 += 1;
265967
+ }
265968
+ } else if (c2 === "*") out2 += "[^/]*";
265969
+ else out2 += c2.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
265970
+ }
265971
+ return new RegExp(`^${out2}$`);
265972
+ }
265973
+ function governs(rel2, policy = policy_default) {
265974
+ if (!policy.roots.some((g2) => policyGlob(g2).test(rel2))) return false;
265975
+ if ((policy.exclude ?? []).some((g2) => policyGlob(g2).test(rel2))) return false;
265976
+ return !(policy.devOnly ?? []).some((d2) => d2.path === rel2);
265977
+ }
265978
+ var init_governs = __esm({
265979
+ "../ci/presentation-lint/governs.mjs"() {
265980
+ init_define_HHP_CATALOG();
265981
+ init_policy3();
265982
+ }
265983
+ });
265984
+
265505
265985
  // ../l10n/runtime-copy.ts
265506
265986
  var runtime_copy_exports = {};
265507
265987
  __export(runtime_copy_exports, {
@@ -265825,120 +266305,7 @@ function serializeCatalog(c2) {
265825
266305
  return JSON.stringify(c2, null, 2) + "\n";
265826
266306
  }
265827
266307
  function scanLiterals(src) {
265828
- const out2 = [];
265829
- const lines2 = src.split("\n");
265830
- let i2 = 0;
265831
- let line = 1;
265832
- const n2 = src.length;
265833
- const adv = () => {
265834
- if (src[i2] === "\n") line++;
265835
- i2++;
265836
- };
265837
- while (i2 < n2) {
265838
- const c2 = src[i2];
265839
- const d2 = src[i2 + 1];
265840
- if (c2 === "/" && d2 === "/") {
265841
- while (i2 < n2 && src[i2] !== "\n") i2++;
265842
- continue;
265843
- }
265844
- if (c2 === "/" && d2 === "*") {
265845
- let depth = 0;
265846
- while (i2 < n2) {
265847
- if (src[i2] === "/" && src[i2 + 1] === "*") {
265848
- depth++;
265849
- adv();
265850
- adv();
265851
- continue;
265852
- }
265853
- if (src[i2] === "*" && src[i2 + 1] === "/") {
265854
- depth--;
265855
- adv();
265856
- adv();
265857
- if (depth === 0) break;
265858
- continue;
265859
- }
265860
- adv();
265861
- }
265862
- continue;
265863
- }
265864
- if (c2 === "'") {
265865
- if (src[i2 + 2] === "'" || src[i2 + 1] === "\\" && src[i2 + 3] === "'") {
265866
- i2 += src[i2 + 1] === "\\" ? 4 : 3;
265867
- continue;
265868
- }
265869
- adv();
265870
- continue;
265871
- }
265872
- if (c2 === '"') {
265873
- const startLine = line;
265874
- const lineStart = src.lastIndexOf("\n", i2 - 1) + 1;
265875
- const before = src.slice(lineStart, i2);
265876
- const triple = src.startsWith('"""', i2);
265877
- i2 += triple ? 3 : 1;
265878
- let text32 = "";
265879
- while (i2 < n2) {
265880
- if (triple ? src.startsWith('"""', i2) : src[i2] === '"') {
265881
- i2 += triple ? 3 : 1;
265882
- break;
265883
- }
265884
- if (!triple && src[i2] === "\n") break;
265885
- if (src[i2] === "\\" && src[i2 + 1] === "(") {
265886
- i2 += 2;
265887
- let depth = 1;
265888
- while (i2 < n2 && depth > 0) {
265889
- if (src[i2] === "(") depth++;
265890
- else if (src[i2] === ")") depth--;
265891
- else if (src[i2] === '"') {
265892
- adv();
265893
- while (i2 < n2 && src[i2] !== '"') {
265894
- if (src[i2] === "\\") adv();
265895
- adv();
265896
- }
265897
- }
265898
- adv();
265899
- }
265900
- text32 += "{}";
265901
- continue;
265902
- }
265903
- if (src[i2] === "$" && src[i2 + 1] === "{") {
265904
- i2 += 2;
265905
- let depth = 1;
265906
- while (i2 < n2 && depth > 0) {
265907
- if (src[i2] === "{") depth++;
265908
- else if (src[i2] === "}") depth--;
265909
- else if (src[i2] === '"') {
265910
- adv();
265911
- while (i2 < n2 && src[i2] !== '"') {
265912
- if (src[i2] === "\\") adv();
265913
- adv();
265914
- }
265915
- }
265916
- adv();
265917
- }
265918
- text32 += "{}";
265919
- continue;
265920
- }
265921
- if (src[i2] === "$" && /[A-Za-z_]/.test(src[i2 + 1] ?? "")) {
265922
- i2++;
265923
- while (i2 < n2 && /[A-Za-z0-9_]/.test(src[i2])) i2++;
265924
- text32 += "{}";
265925
- continue;
265926
- }
265927
- if (src[i2] === "\\") {
265928
- text32 += src[i2 + 1] ?? "";
265929
- adv();
265930
- adv();
265931
- continue;
265932
- }
265933
- text32 += src[i2];
265934
- adv();
265935
- }
265936
- out2.push({ line: startLine, text: text32, lineText: lines2[startLine - 1] ?? "", before });
265937
- continue;
265938
- }
265939
- adv();
265940
- }
265941
- return out2;
266308
+ return lexNative(src).literals;
265942
266309
  }
265943
266310
  function innermostCallee(before) {
265944
266311
  const stack = [];
@@ -265951,25 +266318,6 @@ function innermostCallee(before) {
265951
266318
  const m2 = /([A-Za-z_][A-Za-z0-9_]*(?:\s*\.\s*[A-Za-z_][A-Za-z0-9_]*)*)\s*$/.exec(before.slice(0, open6));
265952
266319
  return m2?.[1].replace(/\s+/g, "");
265953
266320
  }
265954
- function isNonCopyContext(lit) {
265955
- if (/systemName:\s*$/.test(lit.before)) return true;
265956
- if (/\b(?:require|check|requireNotNull|checkNotNull)\s*\([^)]*\)\s*\{\s*$/.test(lit.before)) return true;
265957
- const callee = innermostCallee(lit.before);
265958
- if (!callee) return false;
265959
- const parts = callee.split(".");
265960
- const name = parts.at(-1);
265961
- if (!NON_COPY_CALLEES.has(name)) return false;
265962
- if (LOG_LEVELS.has(name)) return parts.at(-2) === "Log";
265963
- return true;
265964
- }
265965
- function looksLikeCopy(text32) {
265966
- const t2 = text32.replace(/\{\}/g, " ").trim();
265967
- if (!/[A-Za-z]/.test(t2)) return false;
265968
- if (/^(?:https?:|[a-z][a-z0-9+.-]*:\/\/)/.test(t2)) return false;
265969
- if (/^\$t:/.test(t2)) return false;
265970
- if (/\s/.test(t2)) return true;
265971
- return /^[A-Z][a-z]/.test(t2);
265972
- }
265973
266321
  function loadAllow(section3, path2 = ALLOW_PATH) {
265974
266322
  const raw = JSON.parse(readFileSync168(path2, "utf8"));
265975
266323
  const list5 = raw[section3] ?? [];
@@ -265982,9 +266330,14 @@ function scanProse(files, allow = [], read2 = (rel2) => readFileSync168(join179(
265982
266330
  const hits = [];
265983
266331
  const usedAllow = /* @__PURE__ */ new Set();
265984
266332
  for (const file2 of files) {
265985
- for (const lit of scanLiterals(read2(file2))) {
266333
+ const src = read2(file2);
266334
+ const { literals, markers } = lexNative(src, { lang: file2.endsWith(".swift") ? "swift" : file2.endsWith(".kt") ? "kotlin" : void 0 });
266335
+ const honourMarkers = governs(file2);
266336
+ for (const lit of literals) {
266337
+ if (lit.skipped) continue;
265986
266338
  if (isNonCopyContext(lit)) continue;
265987
266339
  if (!looksLikeCopy(lit.text)) continue;
266340
+ if (honourMarkers && markerFor(markers, lit.line, "copy")) continue;
265988
266341
  const a3 = allow.find((e2) => e2.file === file2 && e2.text === lit.text);
265989
266342
  if (a3) {
265990
266343
  usedAllow.add(a3);
@@ -266022,10 +266375,13 @@ function scanThrownMessages(files, read2 = (rel2) => readFileSync168(join179(REP
266022
266375
  }
266023
266376
  return out2;
266024
266377
  }
266025
- var HERE5, REPO_ROOT9, TABLE_PATH2, SWIFT_OUT2, KOTLIN_OUT2, GATE_SOURCES, IDENTITY_COPY_SOURCES, MESSAGE_FILE, MESSAGE_SOURCES, HEADER4, GATE_KIND, NATIVE_KIND, NON_COPY_CALLEES, LOG_LEVELS, ALLOW_PATH, MESSAGE_SITE;
266378
+ var HERE5, REPO_ROOT9, TABLE_PATH2, SWIFT_OUT2, KOTLIN_OUT2, GATE_SOURCES, IDENTITY_COPY_SOURCES, MESSAGE_FILE, MESSAGE_SOURCES, HEADER4, GATE_KIND, NATIVE_KIND, ALLOW_PATH, MESSAGE_SITE;
266026
266379
  var init_auth_gate_copy = __esm({
266027
266380
  "../l10n/auth-gate-copy.ts"() {
266028
266381
  init_define_HHP_CATALOG();
266382
+ init_lex_native();
266383
+ init_rules();
266384
+ init_governs();
266029
266385
  init_runtime_copy();
266030
266386
  HERE5 = dirname81(fileURLToPath40(import.meta.url));
266031
266387
  REPO_ROOT9 = resolve114(HERE5, "../..");
@@ -266064,39 +266420,6 @@ var init_auth_gate_copy = __esm({
266064
266420
  `;
266065
266421
  GATE_KIND = "AuthGate.native";
266066
266422
  NATIVE_KIND = "Native.app";
266067
- NON_COPY_CALLEES = /* @__PURE__ */ new Set([
266068
- "print",
266069
- "println",
266070
- "NSLog",
266071
- "os_log",
266072
- "require",
266073
- "requireNotNull",
266074
- "check",
266075
- "checkNotNull",
266076
- "precondition",
266077
- "preconditionFailure",
266078
- "assert",
266079
- "assertionFailure",
266080
- "fatalError",
266081
- "error",
266082
- "d",
266083
- "i",
266084
- "w",
266085
- "e",
266086
- "v",
266087
- // android.util.Log.<level>, only when the receiver is Log (below)
266088
- "testTag",
266089
- "accessibilityIdentifier",
266090
- "himiFont",
266091
- "color",
266092
- "textStyle",
266093
- "forHTTPHeaderField",
266094
- "setValue",
266095
- "addValue",
266096
- "header",
266097
- "setRequestProperty"
266098
- ]);
266099
- LOG_LEVELS = /* @__PURE__ */ new Set(["d", "i", "w", "e", "v"]);
266100
266423
  ALLOW_PATH = join179(HERE5, "auth-gate-copy.allow.json");
266101
266424
  if (false) main();
266102
266425
  MESSAGE_SITE = /NativeAuthError\.|NativeAuthException\(|BiometricException\(|\.retrieve\(|reason:|message:|\bcase\s+\.[A-Za-z]+[^:\n]*:\s*return\s+(?:m\.isEmpty\s*\?\s*)?"/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1845.0",
3
+ "version": "0.1846.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": "a884cf8b13e6e6a67886e7a57e074b7fb5241f262425fd5a257e1fca"
85
+ "falconPackageHash": "b27cca4fbde9662507d796805d29624fdece3ac59a1c30ad528d0c62"
86
86
  }