@wix/himalaya-cli 0.1735.0 → 0.1736.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
@@ -3749,8 +3749,10 @@ var init_dist_jobs = __esm({
3749
3749
  // adds App Attest (`appAttest: false`) and starts every release from the site profile, which
3750
3750
  // drops `live_activity` and with it the App Group (still added when a release declares it, as
3751
3751
  // Brandy's own Live Activity target did).
3752
- // `contentAppDir` keeps `site analyze --apply --shell brandy` on the in-repo Brandy app until its
3753
- // native folders are retired (6F-b).
3752
+ // `contentAppDir` is the in-repo Brandy content app (`apps/himi-brandy`: config, dev module, seed,
3753
+ // provisioning). Its committed `site` block is what `site analyze --shell brandy` reads to know the
3754
+ // target is a site shell. It has no native tree since 6F-b, so an in-repo `--apply --shell brandy`
3755
+ // has nothing to bake and refuses; the binary is always this alias's branded-lite build.
3754
3756
  brandy: {
3755
3757
  appDir: "apps/himi-branded-lite",
3756
3758
  aliasOf: "branded-lite",
@@ -4803,6 +4805,10 @@ function shellAppDir(name) {
4803
4805
  assertKnownShell(name);
4804
4806
  return DIST_SHELLS[name].contentAppDir ?? DIST_SHELLS[name].appDir;
4805
4807
  }
4808
+ function shellAliasOf(name) {
4809
+ assertKnownShell(name);
4810
+ return DIST_SHELLS[name].aliasOf;
4811
+ }
4806
4812
  function homeRefreshActionId(name) {
4807
4813
  assertKnownShell(name);
4808
4814
  return Object.hasOwn(HOME_REFRESH_ACTIONS, name) ? HOME_REFRESH_ACTIONS[name] : void 0;
@@ -40519,7 +40525,6 @@ function shouldRevealError(args) {
40519
40525
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE, AUTHORED_PATTERN_LIMIT, authoredPatterns;
40520
40526
  var init_validation = __esm({
40521
40527
  "../../core/ts/src/validation.ts"() {
40522
- "use strict";
40523
40528
  init_define_HHP_CATALOG();
40524
40529
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
40525
40530
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
@@ -262347,6 +262352,11 @@ var init_customer_build = __esm({
262347
262352
  import { existsSync as existsSync144, readFileSync as readFileSync174, writeFileSync as writeFileSync70, copyFileSync as copyFileSync2, mkdirSync as mkdirSync65, realpathSync as realpathSync23, statSync as statSync49 } from "node:fs";
262348
262353
  import { dirname as dirname79, isAbsolute as isAbsolute17, join as join182, resolve as resolve114, sep as sep28 } from "node:path";
262349
262354
  import { spawnSync as spawnSync11 } from "node:child_process";
262355
+ function inRepoBakeRefusal(repoRoot2, shell) {
262356
+ if (isBrandable(repoRoot2, shell)) return null;
262357
+ const alias2 = shellAliasOf(shell);
262358
+ return alias2 ? `shell "${shell}" has no native tree in this repo to bake \u2014 it ships on ${alias2}'s (himi dist --shell ${shell}); run --apply in a content package made with himi init --template ${shell} instead` : `shell "${shell}" cannot bake a customer brand \u2014 it ships no prepare:customer script`;
262359
+ }
262350
262360
  function siteHostRefusal(shell) {
262351
262361
  return `--site-pages adds website pages beside a native app's own screens, and shell "${shell}" hosts none \u2014 it works with --shell ${sitePageHosts().join(" or ")}. A site shell (--shell brandy) is all website pages already.`;
262352
262362
  }
@@ -262672,11 +262682,8 @@ async function applyOverlays(input) {
262672
262682
  const notes = [];
262673
262683
  const repoRoot2 = brandableRepoRoot(cwd);
262674
262684
  if (repoRoot2) {
262675
- if (!isBrandable(repoRoot2, shell)) {
262676
- throw new Error(
262677
- `shell "${shell}" cannot bake a customer brand \u2014 it ships no prepare:customer script`
262678
- );
262679
- }
262685
+ const bakeRefusal = inRepoBakeRefusal(repoRoot2, shell);
262686
+ if (bakeRefusal) throw Object.assign(new Error(bakeRefusal), { exit: 2, code: APPLY_SHELL_CANNOT_BAKE });
262680
262687
  const appDir3 = join182(repoRoot2, shellAppDir(shell));
262681
262688
  assertOverlayNamesSite(join182(appDir3, "provisioning.json"), overlay, `shell "${shell}"`, ` --shell ${shell}`);
262682
262689
  const packageDir = dirname79(resolve114(input.overlayPath));
@@ -262947,7 +262954,7 @@ function patchBrandParams(src, overlay, homeActionId) {
262947
262954
  }
262948
262955
  return { src: out2 + src.slice(cursor), applied, unparsed, foreign: false };
262949
262956
  }
262950
- var SITE_PAGES_SHELL_UNSUPPORTED, SITE_SHELL_NEEDS_SITE, STAGED;
262957
+ var APPLY_SHELL_CANNOT_BAKE, SITE_PAGES_SHELL_UNSUPPORTED, SITE_SHELL_NEEDS_SITE, STAGED;
262951
262958
  var init_apply3 = __esm({
262952
262959
  "src/site-analyze/apply.ts"() {
262953
262960
  init_define_HHP_CATALOG();
@@ -262965,6 +262972,7 @@ var init_apply3 = __esm({
262965
262972
  init_catalog2();
262966
262973
  init_plan_fonts();
262967
262974
  init_tokens();
262975
+ APPLY_SHELL_CANNOT_BAKE = "apply_shell_cannot_bake";
262968
262976
  SITE_PAGES_SHELL_UNSUPPORTED = "site_pages_shell_unsupported";
262969
262977
  SITE_SHELL_NEEDS_SITE = "site_shell_needs_site";
262970
262978
  STAGED = ".himi/brand";
@@ -263950,6 +263958,11 @@ async function runSiteAnalyze(opts) {
263950
263958
  const cwd = resolve115(opts.cwd ?? process.cwd());
263951
263959
  const pagesRefusal = sitePagesRefusal({ ...opts, cwd });
263952
263960
  if (pagesRefusal) throw Object.assign(new Error(pagesRefusal.error), { exit: 2, code: pagesRefusal.code });
263961
+ if (opts.apply) {
263962
+ const repoRoot2 = brandableRepoRoot(cwd);
263963
+ const bakeRefusal = repoRoot2 ? inRepoBakeRefusal(repoRoot2, opts.shell ?? DEFAULT_BRANDABLE_SHELL) : null;
263964
+ if (bakeRefusal) throw Object.assign(new Error(bakeRefusal), { exit: 2, code: APPLY_SHELL_CANNOT_BAKE });
263965
+ }
263953
263966
  const siteShell = targetIsSiteShell({ shell: opts.shell, cwd });
263954
263967
  if (!opts.clientId?.trim()) {
263955
263968
  if (opts.apply && !siteShell) throw Object.assign(new Error(APPLY_NEEDS_CLIENT), { exit: 2 });
@@ -408,13 +408,15 @@ An invalid manifest fails with `manifest_invalid`, like the other `store iap` co
408
408
  `--site-pages` (opt-in website pages beside a native app) and its `--dry-run`
409
409
  refuse an unusable combination before any network work, on stderr with `ok: false`, `code`,
410
410
  `error` and `usage`. Exit 2. `--apply` onto a site shell with no `site` block in the overlay
411
- refuses after the analysis, on stderr with `ok: false`, `code` and `error`, exit 2. This is not
411
+ refuses after the analysis, on stderr with `ok: false`, `code` and `error`, exit 2. An `--apply` run inside
412
+ the Himi repository, to a shell with nothing to bake there, refuses before the analysis, the same way. This is not
412
413
  a migration of `himi site analyze`: its other failures keep their legacy envelopes.
413
414
 
414
415
  | Code | Meaning |
415
416
  |---|---|
416
417
  | `site_pages_shell_unsupported` | `--site-pages` names a shell that hosts no website pages beside native screens, or a target that is a site shell. Only `--shell branded-lite` (the default) hosts them; a site shell (`brandy`, or any target whose contract has a `site` block, such as a website-template package) is all website pages already. Nothing was read or written. |
417
418
  | `site_shell_needs_site` | `--apply` targets a site shell (the contract it writes has a `site` block: a shell such as `brandy` in the repo, or a content package whose provisioning.json names its website), and the overlay has no `site` block, usually because the page map could not be derived. Applying it would keep the previous website. Re-run `himi site analyze` to derive the page map, or write `site` into `provisioning.overlay.json` by hand. The app was not changed (the business book was still written). |
419
+ | `apply_shell_cannot_bake` | An `--apply` run inside the Himi repository names a shell that checkout cannot bake: a host shell (`player`) ships no `prepare:customer`, and `brandy` is an alias of `branded-lite` whose content app has no native tree of its own. Run `--apply` in a content package (`himi init --template brandy`) instead; `himi dist --shell brandy` builds the binary. |
418
420
  | `dry_run_needs_site_pages` | `--dry-run` was passed without both `--apply` and `--site-pages`. It previews `--apply --site-pages` only; plain analyze already writes nothing into the app, and `book.md` → `## Site pages` shows what `--site-pages` would add. Nothing was read or written. |
419
421
 
420
422
  ## `himi store iap connect` codes
@@ -242,9 +242,8 @@ The content build writes and builds it, on any shell: when the app's `provisioni
242
242
  declares `webSdk`, `himi build` (and so `himi push`, `himi pack` and `himi validate`) writes
243
243
  the companion's source to `tier5-src/himi-webview-page-<hash>/` and compiles it with your other
244
244
  workers. The name is reserved, so do not edit that folder; it is rewritten from `webSdk` on
245
- every build. (Inside the Himi repository Brandy's customer build does the same:
246
- `npm run prepare:customer -w @apps/himi-brandy`, or `npm run web-sdk:companion -w @apps/himi-brandy`
247
- for a local preview.) To expose
245
+ every build. (Inside the Himi repository the Brandy content app builds the same companion
246
+ for a local preview with `npm run web-sdk:companion -w @apps/himi-brandy`.) To expose
248
247
  fewer methods, write your own companion and name it in `bundle` — a named bundle is used as is.
249
248
 
250
249
  Each site screen must also carry the companion, so its pages can reach it. In a site-shell
@@ -249,9 +249,9 @@ himi site analyze --url https://owner.wixsite.com/site --shell brandy # writes
249
249
  himi site analyze --url https://owner.wixsite.com/site --shell brandy --apply
250
250
  ```
251
251
 
252
- No `--client-id` is needed here: a site shell is visitor-only, its pages are the site itself, and its contract binds no Headless client. For an off-repo brandy app (`himi init --template brandy`), run the `--apply` inside the app folder: it writes the derived `site` block into the package's own `provisioning.json`, which the template's `config.ts` builds every tab and screen from.
252
+ No `--client-id` is needed here: a site shell is visitor-only, its pages are the site itself, and its contract binds no Headless client. Run the `--apply` inside a brandy app folder (`himi init --template brandy`): it writes the derived `site` block into the package's own `provisioning.json`, which the template's `config.ts` builds every tab and screen from. Inside the Himi repository there is no Brandy tree to bake (a Brandy binary is a branded-lite build, `himi dist --shell brandy`), so `--apply --shell brandy` run there is refused before the analysis runs.
253
253
 
254
- What makes a target a site shell is its contract, not the shell's name: the analysis derives the page map whenever the contract `--apply` writes has a `site` block. In the repo that is the shell's committed `apps/<shell>/provisioning.json` (Brandy's has one, Branded Lite's does not); off-repo it is the content package's own `provisioning.json`, so a website template on the Branded Lite shell is a site shell with no `--shell` at all. A Branded Lite target without a `site` block stays a native app, `--site-pages` included. The drawer-only block `--site-pages` writes does not make a target a site shell.
254
+ What makes a target a site shell is its contract, not the shell's name: the analysis derives the page map whenever the contract `--apply` writes has a `site` block. In the repo that is the shell's committed `apps/<shell>/provisioning.json` (the Brandy content's has one, Branded Lite's does not); off-repo it is the content package's own `provisioning.json`, so a website template on the Branded Lite shell is a site shell with no `--shell` at all. A Branded Lite target without a `site` block stays a native app, `--site-pages` included. The drawer-only block `--site-pages` writes does not make a target a site shell.
255
255
 
256
256
  The map comes from what the analysis already reads without owner credentials, because Wix has no public menu API: the published page list (`look.sitePages`), the header menu the crawl saw (`look.navLinks`, label and href), and each page's role.
257
257
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1735.0",
3
+ "version": "0.1736.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": "e74e96cc657d078d8a87e02ad1290c32867f2733775c622b6d0839e4"
85
+ "falconPackageHash": "fe82e35c0e89292dbb81138c5f50c7b06b104d3cabe0524fb23c6512"
86
86
  }