@wix/himalaya-cli 0.1967.0 → 0.1969.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 +75 -11
  2. package/package.json +2 -2
package/dist/cli.mjs CHANGED
@@ -3964,6 +3964,7 @@ var init_himi_package = __esm({
3964
3964
  var ICON_VIEW_BOX, ICON_STROKE_WIDTH, ICON_FALLBACK, ICON_CATALOG, ICON_NORMALIZED_INDEX, ICON_NAMES;
3965
3965
  var init_icon_catalog_generated = __esm({
3966
3966
  "../../core/ts/src/icon-catalog.generated.ts"() {
3967
+ "use strict";
3967
3968
  init_define_HHP_CATALOG();
3968
3969
  ICON_VIEW_BOX = 24;
3969
3970
  ICON_STROKE_WIDTH = 2;
@@ -19928,6 +19929,7 @@ function buttonVariant(style) {
19928
19929
  var SYSTEM_FONT_FAMILY, TONAL_ELEVATION_ALPHA, BUTTON_SIZES, BUTTON_MIN_HIT_TARGET, nonNegative, nonEmpty2, own2, COLOR_TOKEN_PROPS, TYPOGRAPHY_TOKEN_PROPS, BUTTON_VARIANTS;
19929
19930
  var init_tokens = __esm({
19930
19931
  "../../core/ts/src/tokens.ts"() {
19932
+ "use strict";
19931
19933
  init_define_HHP_CATALOG();
19932
19934
  SYSTEM_FONT_FAMILY = "$system";
19933
19935
  TONAL_ELEVATION_ALPHA = [0, 0.05, 0.08, 0.11, 0.12, 0.14];
@@ -44672,6 +44674,7 @@ function resolveIdiom(tokens2, ctx = {}) {
44672
44674
  var IDIOM_CONTEXTS, UNSAFE_KEYS;
44673
44675
  var init_idiom = __esm({
44674
44676
  "../../core/ts/src/idiom.ts"() {
44677
+ "use strict";
44675
44678
  init_define_HHP_CATALOG();
44676
44679
  IDIOM_CONTEXTS = {
44677
44680
  ios: { native: ["ios"] },
@@ -46433,6 +46436,7 @@ function shouldRevealError(args) {
46433
46436
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE, AUTHORED_PATTERN_LIMIT, authoredPatterns;
46434
46437
  var init_validation = __esm({
46435
46438
  "../../core/ts/src/validation.ts"() {
46439
+ "use strict";
46436
46440
  init_define_HHP_CATALOG();
46437
46441
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
46438
46442
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
@@ -204695,6 +204699,56 @@ function hashFilesAtOnce(root, paths2) {
204695
204699
  files.forEach((path2, i2) => oids.set(path2, lines2[i2].trim()));
204696
204700
  return oids;
204697
204701
  }
204702
+ function worktreeFromStatus(root) {
204703
+ const out2 = tryCountedGit(["--no-optional-locks", "status", "--porcelain=v2", "-z", "--no-renames", "--untracked-files=all"], root);
204704
+ if (out2 === null) return null;
204705
+ const staged = [];
204706
+ const unstaged = [];
204707
+ const untracked = [];
204708
+ const headEntries = /* @__PURE__ */ new Map();
204709
+ const indexEntries = /* @__PURE__ */ new Map();
204710
+ for (const record7 of out2.split("\0")) {
204711
+ if (record7 === "") continue;
204712
+ if (record7.startsWith("? ")) {
204713
+ untracked.push(record7.slice(2));
204714
+ continue;
204715
+ }
204716
+ if (!record7.startsWith("1 ")) return null;
204717
+ const fields2 = [];
204718
+ let at2 = 0;
204719
+ for (let i2 = 0; i2 < 8; i2++) {
204720
+ const space = record7.indexOf(" ", at2);
204721
+ if (space < 0) return null;
204722
+ fields2.push(record7.slice(at2, space));
204723
+ at2 = space + 1;
204724
+ }
204725
+ const path2 = record7.slice(at2);
204726
+ const [, xy, sub, mH, mI, , hH, hI] = fields2;
204727
+ if (path2 === "" || xy.length !== 2 || sub !== "N...") return null;
204728
+ if (xy[1] === "A" || EMPTY_BLOBS.has(hH) || EMPTY_BLOBS.has(hI)) return null;
204729
+ if (xy[0] !== ".") staged.push(path2);
204730
+ if (xy[1] !== ".") unstaged.push(path2);
204731
+ if (mH !== ABSENT_MODE) headEntries.set(path2, { mode: mH, oid: hH });
204732
+ if (mI !== ABSENT_MODE) indexEntries.set(path2, { mode: mI, oid: hI });
204733
+ }
204734
+ return { staged, unstaged, untracked, headEntries, indexEntries };
204735
+ }
204736
+ function rootHeadAndFormat(cwd) {
204737
+ spawnStats.gitCalls++;
204738
+ let out2;
204739
+ try {
204740
+ out2 = git(["rev-parse", "--show-toplevel", "--show-object-format", "--verify", "--quiet", "HEAD^{commit}"], { cwd });
204741
+ } catch {
204742
+ return null;
204743
+ }
204744
+ const lines2 = out2.replace(/\n$/, "").split("\n");
204745
+ if (lines2.length < 3) return null;
204746
+ const commit = lines2.pop().trim();
204747
+ const format = lines2.pop().trim();
204748
+ const root = lines2.join("\n");
204749
+ if (!root || !/^sha(1|256)$/.test(format) || !/^[0-9a-f]{40,64}$/.test(commit)) return null;
204750
+ return { root, head: commit, objectAlgorithm: format };
204751
+ }
204698
204752
  function sameEntry(left, right) {
204699
204753
  if (!left || !right) return left === right;
204700
204754
  return left.mode === right.mode && left.oid === right.oid;
@@ -204709,12 +204763,18 @@ function blobOid(contents, algorithm2) {
204709
204763
  return createHash42(algorithm2).update(Buffer.from(`blob ${body.byteLength}\0`)).update(body).digest("hex");
204710
204764
  }
204711
204765
  function validationDiffHash(cwd = process.cwd(), { shortcuts = true } = {}) {
204712
- spawnStats.gitCalls++;
204713
- const root = resolveRepoRoot2(cwd);
204766
+ const quick = shortcuts ? rootHeadAndFormat(cwd) : null;
204767
+ let root;
204768
+ if (quick) {
204769
+ root = quick.root;
204770
+ } else {
204771
+ spawnStats.gitCalls++;
204772
+ root = resolveRepoRoot2(cwd);
204773
+ }
204714
204774
  const run4 = (args) => countedGit(args, root);
204715
- let head2 = "";
204716
- let objectAlgorithm = "";
204717
- if (shortcuts) {
204775
+ let head2 = quick?.head ?? "";
204776
+ let objectAlgorithm = quick?.objectAlgorithm ?? "";
204777
+ if (shortcuts && !quick) {
204718
204778
  const [format, commit] = (tryCountedGit(["rev-parse", "--show-object-format", "--verify", "--quiet", "HEAD^{commit}"], root) ?? "").split("\n").map((line) => line.trim());
204719
204779
  if (/^sha(1|256)$/.test(format ?? "") && /^[0-9a-f]{40,64}$/.test(commit ?? "")) {
204720
204780
  head2 = commit;
@@ -204723,11 +204783,13 @@ function validationDiffHash(cwd = process.cwd(), { shortcuts = true } = {}) {
204723
204783
  }
204724
204784
  if (!objectAlgorithm) head2 = tryCountedGit(["rev-parse", "--verify", "--quiet", "HEAD^{commit}"], root)?.trim() ?? "";
204725
204785
  const born = head2 !== "";
204726
- const staged = run4(["diff", "--cached", "--name-only", "--no-renames", "-z", ...born ? ["HEAD"] : []]).split("\0").filter(Boolean);
204727
- const unstaged = run4(["diff", "--name-only", "--no-renames", "-z"]).split("\0").filter(Boolean);
204728
- const untracked = run4(["ls-files", "--others", "--exclude-standard", "-z"]).split("\0").filter(Boolean);
204729
- const headEntries = !born ? /* @__PURE__ */ new Map() : shortcuts ? headTreeEntries(root, head2) : treeEntries(run4(["ls-tree", "-rz", "--full-tree", "HEAD"]));
204730
- const indexEntries = treeEntries(run4(["ls-files", "--stage", "-z"]), true);
204786
+ const status2 = shortcuts && born ? worktreeFromStatus(root) : null;
204787
+ const listed = (args) => run4(args).split("\0").filter(Boolean);
204788
+ const staged = status2?.staged ?? listed(["diff", "--cached", "--name-only", "--no-renames", "-z", ...born ? ["HEAD"] : []]);
204789
+ const unstaged = status2?.unstaged ?? listed(["diff", "--name-only", "--no-renames", "-z"]);
204790
+ const untracked = status2?.untracked ?? listed(["ls-files", "--others", "--exclude-standard", "-z"]);
204791
+ const headEntries = status2?.headEntries ?? (!born ? /* @__PURE__ */ new Map() : shortcuts ? headTreeEntries(root, head2) : treeEntries(run4(["ls-tree", "-rz", "--full-tree", "HEAD"])));
204792
+ const indexEntries = status2?.indexEntries ?? treeEntries(run4(["ls-files", "--stage", "-z"]), true);
204731
204793
  if (!objectAlgorithm) objectAlgorithm = run4(["rev-parse", "--show-object-format"]).trim();
204732
204794
  let trustFilesystemMode = true;
204733
204795
  try {
@@ -204849,7 +204911,7 @@ function runSelfTest() {
204849
204911
  }
204850
204912
  return failed2;
204851
204913
  }
204852
- var VALIDATION_METADATA, spawnStats, COMMITTED_MEMO_ENTRIES, committedMemo, headTreeMemo, SELF_TEST_CASES;
204914
+ var VALIDATION_METADATA, spawnStats, COMMITTED_MEMO_ENTRIES, committedMemo, headTreeMemo, ABSENT_MODE, EMPTY_BLOBS, SELF_TEST_CASES;
204853
204915
  var init_diff_hash = __esm({
204854
204916
  "../verify-gate/diff-hash.mjs"() {
204855
204917
  init_define_HHP_CATALOG();
@@ -204862,6 +204924,8 @@ var init_diff_hash = __esm({
204862
204924
  COMMITTED_MEMO_ENTRIES = 4;
204863
204925
  committedMemo = /* @__PURE__ */ new Map();
204864
204926
  headTreeMemo = null;
204927
+ ABSENT_MODE = "000000";
204928
+ EMPTY_BLOBS = new Set(["sha1", "sha256"].map((algorithm2) => blobOid("", algorithm2)));
204865
204929
  SELF_TEST_CASES = [
204866
204930
  {
204867
204931
  name: "committed diffs are distinguished (the #1831 regression)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1967.0",
3
+ "version": "0.1969.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": "61259afc4f9b1d995bc88c31a906c0cc9fcea2adda1d603614a146d7"
85
+ "falconPackageHash": "d6f0534feead913ca7e95597435e552e50fcc8e749e031ad8ec57a1f"
86
86
  }