@wix/himalaya-cli 0.827.0 → 0.828.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
@@ -25258,7 +25258,6 @@ function shouldRevealError(args) {
25258
25258
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE;
25259
25259
  var init_validation = __esm({
25260
25260
  "../../core/ts/src/validation.ts"() {
25261
- "use strict";
25262
25261
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
25263
25262
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
25264
25263
  INTEGER_RE = /^[+-]?[0-9]+$/;
@@ -28646,7 +28645,6 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
28646
28645
  var WORKER_SUBTREE_CEILINGS, ID_PART, ACTION_ID;
28647
28646
  var init_worker_subtree = __esm({
28648
28647
  "../../core/ts/src/worker-subtree.ts"() {
28649
- "use strict";
28650
28648
  init_worker_subtree_safe_types_generated();
28651
28649
  WORKER_SUBTREE_CEILINGS = Object.freeze({
28652
28650
  maxEncodedBytes: 65536,
@@ -35840,11 +35838,20 @@ function readBuiltBundleMap(tier5Root, bundleName) {
35840
35838
  const p = resolve26(tier5Root, `${bundleName}.bundle.js.map`);
35841
35839
  return existsSync32(p) ? readFileSync37(p, "utf8") : void 0;
35842
35840
  }
35843
- function nativeSourceFiles(directory, extension) {
35841
+ function nativeSourceFiles(directory, extension, buildDirMaxDepth, depth = 1) {
35844
35842
  if (!existsSync32(directory)) return [];
35845
- return readdirSync17(directory, { withFileTypes: true }).flatMap((entry) => {
35843
+ let entries;
35844
+ try {
35845
+ entries = readdirSync17(directory, { withFileTypes: true });
35846
+ } catch (err) {
35847
+ if (!vanished(err)) throw err;
35848
+ return [];
35849
+ }
35850
+ return entries.flatMap((entry) => {
35851
+ if (NATIVE_SCRATCH_DIRS.has(entry.name)) return [];
35852
+ if (entry.name === BUILD_OUTPUT_DIR && depth <= buildDirMaxDepth) return [];
35846
35853
  const path = resolve26(directory, entry.name);
35847
- if (entry.isDirectory()) return nativeSourceFiles(path, extension);
35854
+ if (entry.isDirectory()) return nativeSourceFiles(path, extension, buildDirMaxDepth, depth + 1);
35848
35855
  return entry.name.endsWith(extension) ? [path] : [];
35849
35856
  });
35850
35857
  }
@@ -35853,14 +35860,23 @@ function registeredActions(source) {
35853
35860
  }
35854
35861
  function discoverNativeActions(appDir2) {
35855
35862
  const roots = NATIVE_SOURCE_ROOTS.filter(({ directory }) => existsSync32(resolve26(appDir2, directory)));
35856
- const sources = roots.flatMap(({ directory, extension }) => nativeSourceFiles(resolve26(appDir2, directory), extension));
35857
- const registered = sources.flatMap((source) => registeredActions(readFileSync37(source, "utf8")));
35863
+ const sources = roots.flatMap(({ directory, extension, buildDirMaxDepth }) => nativeSourceFiles(resolve26(appDir2, directory), extension, buildDirMaxDepth));
35864
+ const registered = sources.flatMap((source) => {
35865
+ let text2;
35866
+ try {
35867
+ text2 = readFileSync37(source, "utf8");
35868
+ } catch (err) {
35869
+ if (!vanished(err)) throw err;
35870
+ return [];
35871
+ }
35872
+ return registeredActions(text2);
35873
+ });
35858
35874
  return {
35859
35875
  registered: new Set(registered),
35860
35876
  searched: roots.map(({ searched }) => searched)
35861
35877
  };
35862
35878
  }
35863
- var nodeVmEvaluator, navContractMemo, NATIVE_SOURCE_ROOTS;
35879
+ var nodeVmEvaluator, navContractMemo, NATIVE_SCRATCH_DIRS, BUILD_OUTPUT_DIR, VANISHED, vanished, NATIVE_SOURCE_ROOTS;
35864
35880
  var init_validate_descriptor = __esm({
35865
35881
  "../../core/dev-server/src/validate-descriptor.ts"() {
35866
35882
  init_validate_descriptor_core();
@@ -35872,10 +35888,25 @@ var init_validate_descriptor = __esm({
35872
35888
  };
35873
35889
  setDefaultEvaluator(nodeVmEvaluator);
35874
35890
  navContractMemo = null;
35891
+ NATIVE_SCRATCH_DIRS = /* @__PURE__ */ new Set([
35892
+ ".build",
35893
+ "build-sim",
35894
+ "build-device",
35895
+ "build-mac",
35896
+ "SourcePackages",
35897
+ "DerivedData",
35898
+ ".swiftpm",
35899
+ "Pods",
35900
+ "node_modules",
35901
+ ".gradle"
35902
+ ]);
35903
+ BUILD_OUTPUT_DIR = "build";
35904
+ VANISHED = /* @__PURE__ */ new Set(["ENOENT", "ENOTDIR", "ELOOP"]);
35905
+ vanished = (err) => VANISHED.has(err?.code ?? "");
35875
35906
  NATIVE_SOURCE_ROOTS = [
35876
- { directory: "ios", extension: ".swift", searched: "ios/**/*.swift" },
35877
- { directory: "android", extension: ".kt", searched: "android/**/*.kt" },
35878
- { directory: "macos", extension: ".swift", searched: "macos/**/*.swift" }
35907
+ { directory: "ios", extension: ".swift", searched: "ios/**/*.swift", buildDirMaxDepth: 1 },
35908
+ { directory: "android", extension: ".kt", searched: "android/**/*.kt", buildDirMaxDepth: 2 },
35909
+ { directory: "macos", extension: ".swift", searched: "macos/**/*.swift", buildDirMaxDepth: 1 }
35879
35910
  ];
35880
35911
  }
35881
35912
  });
@@ -51765,6 +51796,13 @@ async function analyzeSite(input, ports) {
51765
51796
  bookingsCategories: bookingsCats,
51766
51797
  menuSections: probes.find((p) => p.vertical === "restaurants")?.items.map((m) => ({ id: m.id, name: m.title })) ?? [],
51767
51798
  cms,
51799
+ // The same three facts the warnings below report, recorded in the BOOK as well. The
51800
+ // warnings are transient stdout; `docs/wix-site-to-himi-app.md` sends the next agent to
51801
+ // `book.json` / `book.md`, where `cms: []` alone reads as "this site has no collections"
51802
+ // (#2484). Mirrors `permissions.memberRolesStatus`, which carries the same distinction.
51803
+ cmsStatus: cmsRead.status,
51804
+ ...cmsRead.errorStatus ? { cmsErrorStatus: cmsRead.errorStatus } : {},
51805
+ ...cmsRead.truncated ? { cmsTruncated: cmsRead.truncated } : {},
51768
51806
  pageRoles: pageRolesOf(look, siteUrl),
51769
51807
  topics: topicsFrom(probes),
51770
51808
  installedApps: mergeApps(installedApps, published.appDefIds),
@@ -52035,6 +52073,32 @@ function cmsLabel(c) {
52035
52073
  const roles = [c.readRole && `read=${c.readRole}`, c.writeRole && `write=${c.writeRole}`].filter(Boolean);
52036
52074
  return roles.length ? `${name} [${roles.join(" ")}]` : name;
52037
52075
  }
52076
+ function cmsStatusNote(taxonomy) {
52077
+ const bits = [];
52078
+ switch (taxonomy.cmsStatus) {
52079
+ case "ok":
52080
+ bits.push("ok");
52081
+ break;
52082
+ case "empty":
52083
+ bits.push("empty: the site reported no data collections");
52084
+ break;
52085
+ case "skipped":
52086
+ bits.push("skipped: no owner token \u2014 re-run with `--site <msid>` (owner auth) to list the site's collections");
52087
+ break;
52088
+ case "error": {
52089
+ const http = taxonomy.cmsErrorStatus;
52090
+ const remedy = http === 429 ? "the site rate-limited the listing \u2014 wait and re-run" : http != null && http >= 500 ? "Wix Data failed upstream \u2014 retry later, and investigate the service if it persists" : http === 401 || http === 403 ? "check the owner token is current and carries the Wix Data read permission, then re-run" : "check the owner token and the `--site <msid>` you passed, then re-run";
52091
+ bits.push(`error${http ? ` HTTP ${http}` : ""}: the listing call failed \u2014 ${remedy}`);
52092
+ break;
52093
+ }
52094
+ default:
52095
+ break;
52096
+ }
52097
+ if (taxonomy.cmsTruncated) {
52098
+ bits.push(`${taxonomy.cmsTruncated} more not read \u2014 the listing stops at ${CMS_LIST_LIMIT}`);
52099
+ }
52100
+ return bits.length ? ` (${bits.join("; ")})` : "";
52101
+ }
52038
52102
  function yn(v) {
52039
52103
  return v == null || v === "" ? "\u2014" : String(v);
52040
52104
  }
@@ -52231,7 +52295,7 @@ function renderBookMarkdown(book) {
52231
52295
  lines.push(`- bookings categories: ${taxonomy.bookingsCategories.map((c) => c.name).join(", ") || "\u2014"}`);
52232
52296
  lines.push(`- blog categories: ${taxonomy.blogCategories.map((c) => c.name).join(", ") || "\u2014"}`);
52233
52297
  lines.push(`- menu sections: ${taxonomy.menuSections.map((c) => c.name).join(", ") || "\u2014"}`);
52234
- lines.push(`- cms collections: ${taxonomy.cms.map(cmsLabel).join(", ") || "\u2014"}`);
52298
+ lines.push(`- cms collections: ${taxonomy.cms.map(cmsLabel).join(", ") || "\u2014"}${cmsStatusNote(taxonomy)}`);
52235
52299
  if (taxonomy.installedApps.length) lines.push(`- installed apps: ${taxonomy.installedApps.map((a) => a.name ?? a.id).join(", ")}`);
52236
52300
  lines.push(`- member roles: ${taxonomy.memberRoles.join(", ") || "\u2014"}`);
52237
52301
  if (taxonomy.faviconUrl) lines.push(`- favicon: ${taxonomy.faviconUrl}`);
@@ -52325,6 +52389,7 @@ var AUTH_ONLY_ASCII, EVIDENCE_ROW_WITH, EVIDENCE_ROW_WITHOUT, EVIDENCE_ROW_GATED
52325
52389
  var init_book = __esm({
52326
52390
  "src/site-analyze/book.ts"() {
52327
52391
  init_permissions();
52392
+ init_probes();
52328
52393
  AUTH_ONLY_ASCII = /^(sign[ -]?up|sign[ -]?in|log[ -]?in|login|register|create (an )?account|members? area)$/i;
52329
52394
  EVIDENCE_ROW_WITH = "; **`pages/*.png` \u2014 full-page screenshots of the real site**";
52330
52395
  EVIDENCE_ROW_WITHOUT = "; `pages/` is EMPTY (no screenshots were captured)";
@@ -156,9 +156,16 @@ in-repo `prepare:customer` path — never Amit1 `provisioning.json`, but also
156
156
  not your new app.
157
157
 
158
158
  ```sh
159
- himi site analyze --client-id … --url … --out .himi/business-book --apply --content .
159
+ himi site analyze --client-id … --url … --site <msid> --out .himi/business-book --apply --content .
160
160
  ```
161
161
 
162
+ Keep `--site <msid>` here, exactly as in step 1. It is what mints the **owner** token, and
163
+ `--apply` without one ships `cmsCollections: []` — collections are *enumerated* with an owner
164
+ token (`GET /data/v2/collections` wants *Manage Data Collections*; a visitor token can read the
165
+ items of an `ANYONE`-read collection but cannot list it), so a tokenless run never looks. The
166
+ book says which happened on the `cms collections:` line (`(skipped: no owner token …)`).
167
+ The `clientId`-is-the-binding rule above is about the **app's** runtime site binding, not this.
168
+
162
169
  `--apply` writes `provisioning.json` + token **values**, and patches the branded-lite
163
170
  home `onAppear` params (`ownerDefaultLayout`, `brandAccent`, `verticals`) in
164
171
  `dev/index.ts`. It does **not** rewrite `config.ts` tabBar — you still set 2–4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.827.0",
3
+ "version": "0.828.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": [
@@ -63,5 +63,5 @@
63
63
  "artifactId": "himalaya-cli"
64
64
  }
65
65
  },
66
- "falconPackageHash": "1f67eedd183563d5753b32ea4eb82f8764a58881413ef36f01f8324c"
66
+ "falconPackageHash": "9b8ef92ce555e23d472d3c713aab28c03bbaced8c26a646065503929"
67
67
  }