@wix/himalaya-cli 0.1708.0 → 0.1710.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
@@ -13652,6 +13652,7 @@ function buttonVariant(style) {
13652
13652
  var SYSTEM_FONT_FAMILY, TONAL_ELEVATION_ALPHA, BUTTON_SIZES, BUTTON_MIN_HIT_TARGET, nonNegative, nonEmpty2, own2, COLOR_TOKEN_PROPS, TYPOGRAPHY_TOKEN_PROPS, BUTTON_VARIANTS;
13653
13653
  var init_tokens = __esm({
13654
13654
  "../../core/ts/src/tokens.ts"() {
13655
+ "use strict";
13655
13656
  init_define_HHP_CATALOG();
13656
13657
  SYSTEM_FONT_FAMILY = "$system";
13657
13658
  TONAL_ELEVATION_ALPHA = [0, 0.05, 0.08, 0.11, 0.12, 0.14];
@@ -27243,13 +27244,64 @@ function resolveServeBuildSha({ env = {}, git: git2 }) {
27243
27244
  }
27244
27245
  return "";
27245
27246
  }
27246
- var DEFAULT_BRANCH_REFS, FULL_SHA;
27247
+ function mergedDefaultBranchSha({ git: git2, head: head3, base: base2 }) {
27248
+ const tryGit2 = (args) => {
27249
+ try {
27250
+ const out2 = git2(args);
27251
+ return typeof out2 === "string" ? out2.trim() : "";
27252
+ } catch {
27253
+ return "";
27254
+ }
27255
+ };
27256
+ if (!FULL_SHA.test(head3 ?? "") || !FULL_SHA.test(base2 ?? "") || head3 === base2) return "";
27257
+ const ref = DEFAULT_BRANCH_REFS.find((r3) => {
27258
+ if (!tryGit2(["rev-parse", "--verify", "--quiet", r3])) return false;
27259
+ try {
27260
+ git2(["merge-base", "--is-ancestor", base2, r3]);
27261
+ return true;
27262
+ } catch {
27263
+ return false;
27264
+ }
27265
+ });
27266
+ if (!ref) return "";
27267
+ let rawPaths = "";
27268
+ try {
27269
+ rawPaths = String(git2(["diff", "--no-renames", "--name-only", "-z", base2, head3]));
27270
+ } catch {
27271
+ return "";
27272
+ }
27273
+ const paths2 = rawPaths.split("\0").filter(Boolean);
27274
+ if (paths2.length === 0 || paths2.length > MAX_MERGED_PATHS) return "";
27275
+ const candidates = tryGit2(["--literal-pathspecs", "rev-list", "--reverse", "--ancestry-path", `${base2}..${ref}`, "--", ...paths2]).split("\n").filter((c2) => FULL_SHA.test(c2)).slice(0, MAX_MERGED_CANDIDATES);
27276
+ let canMergeTree = true;
27277
+ for (const c2 of candidates) {
27278
+ if (canMergeTree) {
27279
+ try {
27280
+ const merged = String(git2(["merge-tree", "--write-tree", c2, head3])).split("\n")[0].trim();
27281
+ if (FULL_SHA.test(merged) && merged === tryGit2(["rev-parse", `${c2}^{tree}`])) return c2;
27282
+ continue;
27283
+ } catch (err) {
27284
+ if (err?.status === 1) continue;
27285
+ canMergeTree = false;
27286
+ }
27287
+ }
27288
+ try {
27289
+ git2(["--literal-pathspecs", "diff", "--quiet", c2, head3, "--", ...paths2]);
27290
+ return c2;
27291
+ } catch {
27292
+ }
27293
+ }
27294
+ return "";
27295
+ }
27296
+ var DEFAULT_BRANCH_REFS, FULL_SHA, MAX_MERGED_PATHS, MAX_MERGED_CANDIDATES;
27247
27297
  var init_build_sha = __esm({
27248
27298
  "../../packages/serve/scripts/build-sha.mjs"() {
27249
27299
  "use strict";
27250
27300
  init_define_HHP_CATALOG();
27251
27301
  DEFAULT_BRANCH_REFS = ["origin/master", "origin/main", "refs/remotes/origin/HEAD"];
27252
27302
  FULL_SHA = /^[0-9a-f]{40}$/i;
27303
+ MAX_MERGED_PATHS = 500;
27304
+ MAX_MERGED_CANDIDATES = 200;
27253
27305
  }
27254
27306
  });
27255
27307
 
@@ -34855,7 +34907,6 @@ function shouldRevealError(args) {
34855
34907
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE, AUTHORED_PATTERN_LIMIT, authoredPatterns;
34856
34908
  var init_validation = __esm({
34857
34909
  "../../core/ts/src/validation.ts"() {
34858
- "use strict";
34859
34910
  init_define_HHP_CATALOG();
34860
34911
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
34861
34912
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
@@ -150764,15 +150815,24 @@ function rebindReleaseId(manifest2) {
150764
150815
  }
150765
150816
  function shellSha(root = REPO_ROOT5) {
150766
150817
  if (!isMonorepoCheckout(root)) return "";
150767
- return resolveServeBuildSha({
150818
+ const git2 = (args) => execFileSync2("git", args, { cwd: root, stdio: ["ignore", "pipe", "ignore"] }).toString();
150819
+ const base2 = resolveServeBuildSha({
150768
150820
  // NO env. The resolver accepts a CI-supplied candidate (BUILD_VCS_NUMBER) because the serve
150769
150821
  // artifact wants "the commit CI built me from" — but here the answer must be an ancestor of
150770
150822
  // the commit we are PUBLISHING, i.e. of whatever `gitSha()` just reported. In CI those two
150771
150823
  // need not be equal, and anchoring to the wrong one would record a shellSha unrelated to this
150772
150824
  // release's own history. Empty env forces `rev-parse HEAD`, the same source gitSha() uses.
150773
150825
  env: {},
150774
- git: (args) => execFileSync2("git", args, { cwd: root, stdio: ["ignore", "pipe", "ignore"] }).toString()
150826
+ git: git2
150775
150827
  });
150828
+ if (!base2) return "";
150829
+ let head3 = "";
150830
+ try {
150831
+ head3 = git2(["rev-parse", "HEAD"]).trim();
150832
+ } catch {
150833
+ return base2;
150834
+ }
150835
+ return mergedDefaultBranchSha({ git: git2, head: head3, base: base2 }) || base2;
150776
150836
  }
150777
150837
  function isMonorepoCheckout(dir) {
150778
150838
  try {
@@ -263669,7 +263729,7 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
263669
263729
  himi dist [--app <a>] [--platform ios,android] [--release <id>] [--allow-draft] [--target <t>]
263670
263730
  [--shell branded-lite|owner-lite|brandy|base44|game|player|demo-app] [--signing wix-managed|byo]
263671
263731
  [--android-signing qa-keystore|wix-keystore|debug|owner] [--aab]
263672
- [--package-name <id> --google-services <file>]
263732
+ [--package-name <id> --google-services <file>] [--min-version-code <n>]
263673
263733
  [--app-name <name> --app-icon-url <url>]
263674
263734
  [--borrow-ios-id <bundleId>] [--no-wait] [--force] [--plan]
263675
263735
  build an INSTALLABLE QA binary (signed IPA / APK) on
@@ -263728,6 +263788,10 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
263728
263788
  for an app bound to no Wix site, with no APK beside
263729
263789
  it. Sign it with your own upload key before
263730
263790
  uploading. No Wix site or plan needed.
263791
+ A Play bundle's versionCode counts from 1 per package
263792
+ (Himi's record + 1); --min-version-code <n> raises it
263793
+ to at least n, for a listing with uploads Himi didn't
263794
+ build (e.g. its highest code + 1).
263731
263795
  --app-name / --app-icon-url (together) give the binary
263732
263796
  a name and icon in place of the release's; the icon is
263733
263797
  a https://static.wixstatic.com/media/<file> URL. A
@@ -264178,7 +264242,7 @@ var COMMANDS = [
264178
264242
  { name: "patch", summary: 'change ONE item of a published app \u2014 a screen descriptor, a Tier-5 bundle, tokens, or the app-config baseline \u2014 from a RAW FILE, with no content package and no build. The low-level door: it does not lint your package, because there is no package here; `himi push --only <selector>` is the same edit with the full build + lint gate and is what to reach for when the package is in hand. Derives a new release from the app\'s current LIVE release, or from `--from-release <id>`. An explicit `--draft` or `--live` is REQUIRED \u2014 a patch has no default blast radius \u2014 and `--notes` is required with `--live` on a screen or app-config patch, because off-repo `gitSha` is "dev" and the ledger notes are then the only durable record of bytes that correspond to no commit. A branch does not merge: activating one derived from an older release reverts every item the patch does not move, so that case is refused until `--accept-regressions`. A bundle patch must repoint a screen (`--for-screen`) or the bytes land under a manifest key nothing reads. It cannot ADD a screen (screens are git-only, RFC 0012), never claims a slug \u2014 the app must already be published \u2014 and carries no attestation, source archive, assets, icon or minBinaryVersion, each named in the output.', required: "screen <id> --file <descriptor.json> [--bundle <sha256|none>] | bundle --file <bundle.js> (--for-screen <id>[,<id>] | --no-rebind) | tokens --file <tokens.json> | app-config --file <app-config.json> ; (--draft|--live) --app <a> [--from-release <id>] [--accept-regressions] [--label <n>] [--notes <t>] [--force] [--allow-binary-gap] [--target <t>] (--control-token)" },
264179
264243
  { name: "flags", summary: "read and change the app's OPERATIONAL flags (RFC 0013) \u2014 `list` prints what the DEVICE door serves, `set <key> --definition` creates or replaces one, `ramp <key>` moves its rollout share or kills it, `rm <key>` deletes it and echoes the definition back so the removal is reversible. Every write is followed by a read of the same door the device uses, and the answer is reported as `servedNow`: flags are stored in the app's git-committed flags.json, so a control plane with no checkout accepts a write it will never serve.", required: "list|set|ramp|rm [<key>] [--definition <json|@file>] [--percent 0-100] [--enabled true|false] [--app <a>] (--control-token)" },
264180
264244
  { name: "visibility", summary: "read (no value) or set whether the public registry (/v1/apps + the Himi Player picker) LISTS the app. `public` lists it for everyone; `unlisted` hides it from listings while direct reads by app id \u2014 deep links, previews \u2014 keep working. App from --app or the content dir. Setting it needs no republish.", required: "[public|unlisted] [--app <a>] [--content <dir>] (--control-token)" },
264181
- { name: "dist", summary: "build an INSTALLABLE QA binary (signed IPA / APK) on the Wix Job Service Mac pool and return an install link \u2014 the serve plane brokers the job, the pool builds it. WAITS for the build by default (~4 min) and prints the install link; `--no-wait` returns a jobId immediately instead. Omitting `--release` builds whatever is LIVE for the app. A named draft is refused unless `--allow-draft` makes that exceptional build explicit. `status <jobId>` / `watch <jobId>` / `list --app <a>` / `cancel <jobId>` inspect and stop builds (`watch` reports up front whether the job mints its own signing identity or borrows one, so a doomed iOS build is cancellable in seconds rather than after the archive). Off-repo, name a target \u2014 `--target wix` for a self-serve Wix login or `--target bo` for the internal employee path (the in-repo default is a local dev plane that isn't reachable off-repo); self-serve callers may build their OWN apps under a tighter budget (2 in flight / 5 per 24h), while a manage-only owner-role credential is refused. `--shell` picks the native host to sign into (branded-lite | owner-lite | brandy | base44 | game | player | demo-app) and defaults to the content package's himalaya.content.json `shell` (templates carry the one they were written for), else branded-lite. The per-app shells ADD the release's declared capabilities to the binary, while Himi Player and demo-app refuse a release declaring one they lack; `--plan` previews it without building; `brandy` is the site shell \u2014 the customer's own website as native-framed tabs; `game` is the Godot game shell, the only one that serves `godot`. `--signing` defaults to `wix-managed` \u2014 the Wix Apple account mints a per-app signing identity for the build, so the caller provisions no Apple credentials of their own; `--signing byo --site <id>` reuses an existing customer ad-hoc profile and certificate for iOS; requires an owned site and a completed personal signing binding. `--android-signing` is the Android counterpart and a SEPARATE axis (a keystore, not an Apple account): `qa-keystore` (default \u2014 the repo's committed QA key, identical on every pool machine, so a build installs over the previous one), `wix-keystore` (the Wix key the pool machine carries; the build FAILS naming the paths searched if it carries none, rather than quietly signing with something else), or `debug` (the old per-machine key \u2014 QA must uninstall any previous build first). `--aab` builds an Android App Bundle (.aab) for the owner to upload to Google Play AND an APK from the same build \u2014 a download link for the .aab, an install link and QR for the APK; Android only; the bundle is signed with the Wix production key (`wix-keystore`, the upload key Branded apps use) \u2014 any other `--android-signing` is refused \u2014 and the APK with the committed QA key; a self-serve caller gets one only as the store build of its own Containers app (it must own the app's site, and `--aab` sends your Wix login); any other self-serve `--aab` gets 403 android_format_not_allowed. `--app-name <name> --app-icon-url <url>` (together; the icon a `https://static.wixstatic.com/media/<file>` URL) give the binary a name and icon in place of the release's, and a Containers app's store build (`--aab`, or its TestFlight build) needs both. NOT the normal way to ship: screens, Tier-5 bundles, tokens and app-config all go over the air with `himi push` in seconds \u2014 a binary trip is only needed for a NATIVE delta (a new SDUI component, a new declared capability/entitlement, a new bundle id, or a minBinaryVersion floor bump). Refuses to build an app whose launcher icon is missing, a placeholder, or one a store would reject \u2014 the one thing a binary carries that no later OTA push can fix; `--force` builds anyway. Also refuses a release whose member login (WixConsumerAuthProvider) names no siteId, or not in lower case, when Wix says its site requires a member CAPTCHA \u2014 such a binary ships without the CAPTCHA key and every member sign-in fails; whatever it cannot read (the release, the site's setting) only warns and builds; `--skip-captcha-check` builds anyway", required: "[--app <a>] [--platform ios,android] [--release <id>] [--allow-draft] [--target <t>] [--shell branded-lite|owner-lite|brandy|base44|game|player|demo-app] [--signing wix-managed|byo] [--site <id>] [--android-signing qa-keystore|wix-keystore|debug] [--aab] [--app-name <name> --app-icon-url <url>] [--borrow-ios-id <bundleId>] [--no-wait] [--force] [--skip-captcha-check] [--plan] | status <jobId> [--target <t>] | watch <jobId> [--target <t>] [--interval <ms>] | list --app <a> [--target <t>] | cancel <jobId> [--target <t>]" },
264245
+ { name: "dist", summary: "build an INSTALLABLE QA binary (signed IPA / APK) on the Wix Job Service Mac pool and return an install link \u2014 the serve plane brokers the job, the pool builds it. WAITS for the build by default (~4 min) and prints the install link; `--no-wait` returns a jobId immediately instead. Omitting `--release` builds whatever is LIVE for the app. A named draft is refused unless `--allow-draft` makes that exceptional build explicit. `status <jobId>` / `watch <jobId>` / `list --app <a>` / `cancel <jobId>` inspect and stop builds (`watch` reports up front whether the job mints its own signing identity or borrows one, so a doomed iOS build is cancellable in seconds rather than after the archive). Off-repo, name a target \u2014 `--target wix` for a self-serve Wix login or `--target bo` for the internal employee path (the in-repo default is a local dev plane that isn't reachable off-repo); self-serve callers may build their OWN apps under a tighter budget (2 in flight / 5 per 24h), while a manage-only owner-role credential is refused. `--shell` picks the native host to sign into (branded-lite | owner-lite | brandy | base44 | game | player | demo-app) and defaults to the content package's himalaya.content.json `shell` (templates carry the one they were written for), else branded-lite. The per-app shells ADD the release's declared capabilities to the binary, while Himi Player and demo-app refuse a release declaring one they lack; `--plan` previews it without building; `brandy` is the site shell \u2014 the customer's own website as native-framed tabs; `game` is the Godot game shell, the only one that serves `godot`. `--signing` defaults to `wix-managed` \u2014 the Wix Apple account mints a per-app signing identity for the build, so the caller provisions no Apple credentials of their own; `--signing byo --site <id>` reuses an existing customer ad-hoc profile and certificate for iOS; requires an owned site and a completed personal signing binding. `--android-signing` is the Android counterpart and a SEPARATE axis (a keystore, not an Apple account): `qa-keystore` (default \u2014 the repo's committed QA key, identical on every pool machine, so a build installs over the previous one), `wix-keystore` (the Wix key the pool machine carries; the build FAILS naming the paths searched if it carries none, rather than quietly signing with something else), or `debug` (the old per-machine key \u2014 QA must uninstall any previous build first). `--aab` builds an Android App Bundle (.aab) for the owner to upload to Google Play AND an APK from the same build \u2014 a download link for the .aab, an install link and QR for the APK; Android only; the bundle is signed with the Wix production key (`wix-keystore`, the upload key Branded apps use) \u2014 any other `--android-signing` is refused \u2014 and the APK with the committed QA key; a self-serve caller gets one only as the store build of its own Containers app (it must own the app's site, and `--aab` sends your Wix login); any other self-serve `--aab` gets 403 android_format_not_allowed. `--app-name <name> --app-icon-url <url>` (together; the icon a `https://static.wixstatic.com/media/<file>` URL) give the binary a name and icon in place of the release's, and a Containers app's store build (`--aab`, or its TestFlight build) needs both. NOT the normal way to ship: screens, Tier-5 bundles, tokens and app-config all go over the air with `himi push` in seconds \u2014 a binary trip is only needed for a NATIVE delta (a new SDUI component, a new declared capability/entitlement, a new bundle id, or a minBinaryVersion floor bump). Refuses to build an app whose launcher icon is missing, a placeholder, or one a store would reject \u2014 the one thing a binary carries that no later OTA push can fix; `--force` builds anyway. Also refuses a release whose member login (WixConsumerAuthProvider) names no siteId, or not in lower case, when Wix says its site requires a member CAPTCHA \u2014 such a binary ships without the CAPTCHA key and every member sign-in fails; whatever it cannot read (the release, the site's setting) only warns and builds; `--skip-captcha-check` builds anyway", required: "[--app <a>] [--platform ios,android] [--release <id>] [--allow-draft] [--target <t>] [--shell branded-lite|owner-lite|brandy|base44|game|player|demo-app] [--signing wix-managed|byo] [--site <id>] [--android-signing qa-keystore|wix-keystore|debug] [--aab] [--min-version-code <n>] [--app-name <name> --app-icon-url <url>] [--borrow-ios-id <bundleId>] [--no-wait] [--force] [--skip-captcha-check] [--plan] | status <jobId> [--target <t>] | watch <jobId> [--target <t>] [--interval <ms>] | list --app <a> [--target <t>] | cancel <jobId> [--target <t>]" },
264182
264246
  { name: "testflight", summary: 'build, sign and upload an app to TestFlight (internal testers \u2014 no Beta App Review), then WAIT until App Store Connect finishes processing it. Sugar for `store upload --track testflight`. Prompts first: a build number is consumed permanently on a real Apple account and cannot be reused \u2014 `--yes` for CI, `--dry-run` to see the plan without touching anything. The wait is the real check, not a nicety: fastlane prints "Successfully uploaded" for a binary App Store Connect then rejects in processing, and a rejected binary leaves NO build record at all (the reason is emailed). Public App Store review is deliberately NOT automatable here \u2014 `--track appstore` is refused; use /submit-ios-app when you mean to go public', required: "<app> [--track testflight|internal] [--profile <name>] [--yes] [--dry-run] [--skip-build] [--no-wait] [--json]" },
264183
264247
  { name: "store", summary: "`app set --app <id> --site <msid> --android-package himi.<name>` gives an app YOUR account owns (one made with `himi init`) the Google Play store app of a Wix site your account also owns, so `himi dist --aab` makes its Wix-signed (WixOne) Play bundle: the app is LINKED to the site, never converted into a site app, so your `himi login` token keeps working for push and the rest. One site per app and one app per site; the package name is permanent once a build locks it. `app show --app <id> --site <msid>` runs the store build's checks without building (saved package name, the site's Premium plan). Both send your `himi login` control token plus the account `wix token`, which the plane uses to verify your account owns the app and the site (`himi docs qa-builds`). `apple-keys setup|status` onboards the owner\u2019s ASC and In-App Purchase keys independently of push and signing profiles. `connect` and `submission status|plan|apply|rejection|reply` submit an app to the App Store from YOUR computer under YOUR Apple account, off-repo (Node 24+): `connect` opens a sign-in page on 127.0.0.1 where you type your Apple ID password and 2FA code (no flag takes them) and creates an Admin API key saved in this computer's keychain, shared with Wix for App Store builds when the app's store/app-store.json names its site; `submission plan` plans the next ordered batch and `apply` applies it only after you type the plan hash's first 8 characters (or click Approve on a local page). The same steps are the store_* tools of `himi mcp` (`himi docs store-submission`). `--platform android` takes `connect` and `submission status|plan|apply|rejection|reply` to Google Play instead: `connect` signs you in to Google in your browser (the OAuth client file from GPLAY_OAUTH_CLIENT_FILE or gplay-node's state dir, else a gcloud sign-in), the facts come from the app's store/google-play.json (category, contactEmail, privacyPolicyUrl, targetAudience, contentRatingCategory, packageName), a site-linked himi.<name> app is Wix-signed (`himi dist --aab`) and any other owner-signed (`--android-signing owner --google-services <file>`, then `google keygen <package>` makes the upload key once and `google resign <in.aab> --keystore <file.p12> --storepass-file <file>` signs the bundle, both on this computer), `apply` takes one `--job`, and `submission approve-reply --platform android --issue <id> --kind appeal|resubmit --text <reply>` records your typed yes on one exact policy reply (no --yes), the only way `reply` or store_reply can plan it. `handoff` uploads the app's asc-node records (allowlisted ids, statuses and outcomes; never keys, cookies or passwords) so Wix RelOps can take the submission over, `--out`/`--dry-run` keep it local; `relops request` records your consent that RelOps may act for the app (`--scope read` by default, or `read,submit`; `--platform android` adds the Google Play scopes `android-build` and `play-console`; you type the app id, or pass --yes). Both are site-owner only. `relops request --platform android --seat-email <name@wix.com>` also brings that RelOps person into YOUR Google Play account after one typed yes at a terminal (no --yes): it saves the `himi.<name>` package, signs you in to Google if needed and invites the seat with the RelOps app permissions for 90 days (plus create-apps while the app has no Play app id); `relops end` removes the seat; `google create-app --name <n>` creates the app in your own Play Console after you read Google's Create app declarations and type yes. The App Store Connect group behind `testflight`. `preflight <app>` checks readiness offline (icon, entitlements, encryption flag, version, store.config ids, listing + review record); `upload <app>` is what `testflight` runs; `status <app>` reads live build + processing state. `--profile` selects WHICH App Store Connect account: an app built for a Wix customer ships under the CUSTOMER's Apple team (Apple guideline 4.2.6 forbids an app-generation service submitting on a client's behalf), declared per-app as ios.credentialProfile in store.config.yaml and resolved from ~/.himalaya/store-credentials/<name>.json \u2014 the .p8 itself never enters the repo. `iap draft|plan|apply|status|connect|screenshots|check|mappings` registers an app owner's digital products as in-app purchases (non-consumables, or consumable price tiers): draft reads the Wix catalog and writes the manifest, plan and status only read, apply is the one App Store mutation boundary, connect readies the Wix site to sell them (purchases app, In-App Purchase key, appleIAP provider, product mappings; --preview-tag routes only its Serve calls to a deploy preview), legacy screenshots --profile renders each product's purchase screen from the app (--content) as a bound iPhone shows it to a signed-in member and names the 1290\xD72796 PNG as the item's App Review screenshot, and none of them builds, signs or needs a checkout (`himi docs iap-products`) IAP provisioning defaults to Catalog; managed apply generates screenshots on the server with no local .p8 or profile fallback; --managed is optional and --profile selects legacy mode; --catalog-route or HIMI_IAP_CATALOG_ROUTE has no default.", required: "app set --app <id> --site <msid> --android-package himi.<name> | app show --app <id> --site <msid> | connect [--dir <app>] [--app <id> --site <msid>] [--no-key] [--profile <name>] | submission status|plan|rejection [--dir <app>] [--apple-id <id>] [--profile <name>] | submission apply (--batch <id> | --job <id>) --plan-hash <hash> | submission reply --text <reply> [--attach <file>]\u2026 [--thread <id>] [--dir <app>] | connect --platform android | submission status|plan|rejection --platform android [--dir <app>] [--issue <id>] | submission apply --platform android --job <id> --plan-hash <hash> | submission reply|approve-reply --platform android --issue <id> --kind appeal|resubmit --text <reply> [--dir <app>] | handoff [--dir <app>] [--app <id> --site <msid>] [--apple-app-id <id>] [--out <file> | --dry-run] | relops request [--dir <app>] [--app <id> --site <msid>] [--platform ios|android] [--scope read|read,submit] [--yes] | relops request --platform android --seat-email <name@wix.com> [--app <id> --site <msid>] [--developer <id>] [--app-id <n>] [--android-package himi.<name>] | relops end --platform android --seat-email <name@wix.com> [--app <id> --site <msid>] [--developer <id>] | google create-app --name <app name> [--app <id> --site <msid>] [--developer <id>] [--android-package himi.<name>] | google keygen <package> [--out <file.p12>] [--alias <name>] [--name <certificate name>] | google resign <in.aab> --keystore <file.p12> (--storepass-file <file> | --storepass-env <NAME>) [--alias <name>] [--out <file.aab>] | apple-keys setup|status --app <slug> --site <metaSiteId> --bundle-id <id> [--asc-key-file <p8> --asc-key-id <id> --asc-issuer-id <issuer>] [--iap-key <p8> --iap-key-id <id> --iap-issuer-id <issuer>] [--yes|--dry-run] [--json] | preflight <app> [--profile <n>] | upload <app> [--track <t>] [--profile <n>] [--yes] [--dry-run] | status <app> [--profile <n>] | iap draft --site <msid> " + IAP_CREDENTIAL_OPTIONS + " --apple-app <id> --bundle <id> --base-territory <t> --out <f> [--territories <a,b>] [--locale <l>] [--mode per-item|tiers] [--merge <f>] [--report <f>] [--json] | iap plan --manifest <f> " + IAP_CREDENTIAL_OPTIONS + " --out <f> [--json] | iap apply --plan <f> " + IAP_CREDENTIAL_OPTIONS + " --out <f> [--yes] [--limit <n>] [--no-submit] [--json] | iap status --manifest <f> " + IAP_CREDENTIAL_OPTIONS + " [--out <f>] [--json] | iap connect --manifest <f> [--profile <n>] [--catalog-route <prefix>] [--iap-key <AuthKey.p8> --iap-key-id <id>] [--content <dir>] [--preview-tag dp-<tag>] [--dry-run] [--yes] [--out <f>] [--json] | iap screenshots --manifest <f> --content <dir> --profile <n> [--out-dir <d>] [--only <id,\u2026>] [--force] [--dry-run] [--json] | iap check --manifest <f> --catalog-route <prefix> [--purchases-app <id>] [--content <dir>] [--plist <file>] [--visitor-client <id>] [--json] | iap mappings --site <msid> --purchases-app <id> --catalog-route <prefix> [--product <id> --active true|false --yes] [--json]" },
264184
264248
  { name: "guide", summary: "print the Himalaya overview + headless dev loop + available topics (offline)", required: "[--json]" },
@@ -267563,6 +267627,10 @@ async function pushCommand(ctx) {
267563
267627
  app: app2,
267564
267628
  releaseId: release3,
267565
267629
  draft,
267630
+ // A push with neither --draft nor --live is a draft BY POLICY, for every app: going live is a
267631
+ // deliberate second step. Without this line the RFC 0080 P1 verification read `draft: true` on
267632
+ // a push it ran without --draft as a bug, so the envelope says it rather than leaving it to the help text.
267633
+ ...draft && flags.draft !== true ? { draftNote: `a draft by default: every \`himi push\` is owner-private and NOT live unless it is given --live. Make this release live with \`himi promote --app ${app2} --release ${release3}${targetName2() !== "local" ? ` --target ${targetName2()}` : ""}\`.` } : {},
267566
267634
  ...publishWarnings.length ? { warnings: publishWarnings } : {},
267567
267635
  ...ringPinReport ? { ringPins: ringPinReport.ringPins } : {},
267568
267636
  ...needsBinary ? { needsBinary } : {},
@@ -269770,13 +269838,20 @@ function shellShaDivergenceWarnings(jobs) {
269770
269838
  const seen = /* @__PURE__ */ new Map();
269771
269839
  for (const j2 of jobs) {
269772
269840
  const release3 = typeof j2.release === "string" ? j2.release : void 0;
269773
- const built = typeof j2.gitCommitSha === "string" ? j2.gitCommitSha : void 0;
269774
- if (j2.shellShaSource === "release" && release3 && built && release3 !== built) seen.set(release3, built);
269841
+ const built = typeof j2.gitCommitSha === "string" ? j2.gitCommitSha.trim().toLowerCase() : void 0;
269842
+ if (j2.shellShaSource !== "release" || !release3 || !built) continue;
269843
+ const commit = releaseCommit(release3) ?? release3.trim().toLowerCase();
269844
+ if (built.startsWith(commit)) continue;
269845
+ seen.set(release3, { commit, built });
269775
269846
  }
269776
269847
  return [...seen].map(
269777
- ([release3, built]) => `\u26A0 this build compiles the native shell at ${built.slice(0, 12)}, not release ${release3.slice(0, 12)} \u2014 the release was pushed from a branch whose HEAD is not on the default branch, so the Mac pool checks out the nearest default-branch ancestor. A native-shell or tools/mobile-dist/** change on that branch is NOT in this binary even if the job reports SUCCESS; re-push from a checkout whose HEAD is on origin/master to validate it.`
269848
+ ([release3, { commit, built }]) => `\u26A0 this build compiles the native shell at ${built.slice(0, 12)}, not release ${release3.slice(0, 12)}'s own commit ${commit.slice(0, 12)}, which is not on the default branch \u2014 so the Mac pool builds a default-branch commit instead: the one that merged that branch when it is already merged, otherwise the commit it was cut from. In the second case a native-shell or tools/mobile-dist/** change on that branch is NOT in this binary even if the job reports SUCCESS; re-push from a checkout whose HEAD is on origin/master to validate it.`
269778
269849
  );
269779
269850
  }
269851
+ function releaseCommit(release3) {
269852
+ const head3 = release3.trim().toLowerCase().split("-")[0] ?? "";
269853
+ return /^[0-9a-f]{7,40}$/.test(head3) ? head3 : void 0;
269854
+ }
269780
269855
  function customerUploadWaiting(record3) {
269781
269856
  const pending2 = record3?.customerAppStore;
269782
269857
  return pending2?.status === "READY_FOR_UPLOAD" || pending2?.status === "UPLOADING";
@@ -270103,6 +270178,18 @@ ${label4}`);
270103
270178
  return 1;
270104
270179
  }
270105
270180
  }
270181
+ const PLAY_VERSION_CODE_MAX = 21e8;
270182
+ const minVersionCodeRaw = flags["min-version-code"] === void 0 ? void 0 : str3(flags["min-version-code"]) ?? "";
270183
+ const minVersionCode = minVersionCodeRaw === void 0 ? void 0 : Number(minVersionCodeRaw.trim());
270184
+ if (minVersionCodeRaw !== void 0 && (!/^\d+$/.test(minVersionCodeRaw.trim()) || !Number.isSafeInteger(minVersionCode) || minVersionCode < 1 || minVersionCode > PLAY_VERSION_CODE_MAX)) {
270185
+ print({
270186
+ ok: false,
270187
+ error: "min_version_code_invalid",
270188
+ code: "min_version_code_invalid",
270189
+ message: `--min-version-code must be a whole number from 1 to ${PLAY_VERSION_CODE_MAX}`
270190
+ });
270191
+ return 1;
270192
+ }
270106
270193
  let wixAuthorization;
270107
270194
  const testflight = str3(flags.destination) === "testflight";
270108
270195
  const customerTestflight = str3(flags.signing)?.trim().toLowerCase() === "byo" && testflight;
@@ -270175,6 +270262,7 @@ ${label4}`);
270175
270262
  // An owner bundle (--android-signing owner): the plane leaves it unsigned, under this name.
270176
270263
  ...str3(flags["package-name"]) ? { androidPackageName: str3(flags["package-name"]) } : {},
270177
270264
  ...googleServicesJson !== void 0 ? { googleServicesJson } : {},
270265
+ ...minVersionCode !== void 0 ? { minVersionCode } : {},
270178
270266
  // The App name and icon (a Wix Media file) a Containers app's store build ships under, in place
270179
270267
  // of the release's; a store build needs both. Sent as typed, so the plane gives the refusals.
270180
270268
  ...str3(flags["app-name"]) !== void 0 ? { appName: str3(flags["app-name"]) } : {},
@@ -336,6 +336,16 @@ So the serve plane checks first and refuses with **`409 release_sha_not_on_remot
336
336
  sha. **The fix is to re-publish from a checkout whose HEAD is on the default branch**
337
337
  (`git checkout origin/master`, then `himi push`) and dist the new release id.
338
338
 
339
+ **Which commit a branch push builds.** A release pushed from a Himalaya checkout also records a
340
+ `shellSha`, the default-branch commit the pool builds instead of a branch head. When the branch is
341
+ **already merged** it is the master commit that merged it: the oldest one that already contains the
342
+ branch's changes, so merging the branch into it would change nothing. Otherwise it is the commit the
343
+ branch was cut from (its merge-base), which holds none of the branch's native changes. The search is
344
+ bounded (500 changed files, 200 candidate commits) and uses `merge-tree --write-tree` (git 2.38+; an older git matches exact bytes only);
345
+ past those it keeps the merge-base. `himi dist` warns when the built commit is not the release's
346
+ own. The merge-base rule alone gave a push from a squash-merged branch a shell from before its own
347
+ change, and that shell rejected the release's newer brand contract.
348
+
339
349
  The check is deliberately narrow, because a false refusal blocks a QA build that would have
340
350
  worked. It refuses only what it can positively establish:
341
351
 
@@ -699,14 +709,41 @@ because those write it down.
699
709
  ### Build number
700
710
 
701
711
  A store-bound build can also carry a **store floor**: **`DIST_BUILD_FLOOR_IOS`** /
702
- **`DIST_BUILD_FLOOR_ANDROID`**, the lowest build number the store will accept for the listing (its
703
- highest uploaded build + 1). The build machine never reads a store or holds store credentials: the
704
- floor is an input the job carries. Nothing sets it automatically yet; the store lanes that will read
705
- the store once per job and pass it are tracked in #4650. When the floor is set, the build number is
706
- `max(derived, floor)`, and the log says which won (`build 58 (floor: DIST_BUILD_FLOOR_ANDROID 58)` or
707
- `(derived)`). An explicit `DIST_BUILD_NUMBER` **below** the floor is refused before anything is
708
- archived, with a message naming the floor; a floor that is not an integer in `1..2100000000` fails
709
- the job rather than being ignored. A QA (`link`) build gets no floor and is unchanged.
712
+ **`DIST_BUILD_FLOOR_ANDROID`**, the lowest build number the store will accept for the listing. The
713
+ build machine never reads a store or holds store credentials: the floor is an input the job carries.
714
+ When the floor is set, the build number is `max(derived, floor)`, and the log says which won
715
+ (`build 58 (floor: DIST_BUILD_FLOOR_ANDROID 58)` or `(derived)`). An explicit `DIST_BUILD_NUMBER`
716
+ **below** the floor is refused before anything is archived, with a message naming the floor; a floor
717
+ that is not an integer in `1..2100000000` fails the job rather than being ignored. A QA (`link`) build
718
+ gets no floor and is unchanged.
719
+
720
+ **Google Play bundles count from 1.** A Containers app's store build and an owner bundle
721
+ (`--android-signing owner`) get their `versionCode` from Himi's own record of the package, kept per
722
+ app, not the clock: serve reserves the package's highest code + 1 at dispatch (one atomic write, so two builds
723
+ dispatched together never share one) and sends it as `DIST_BUILD_FLOOR_ANDROID` with
724
+ **`DIST_BUILD_SCHEME=counter`**, which tells the pool to stamp exactly that number. A new package's
725
+ first bundle is `1`, then `2`, and so on. The clock (~216M) made Google list the first release under
726
+ *Errors* and ask the owner to accept, permanently, that the app's codes can never go down.
727
+
728
+ - **Apps already on the clock continue from it.** The first counter build of a package seeds the record
729
+ from the app's job history: the highest code any of its jobs for that package was stamped with. When
730
+ the history can't prove that (a result from a runner too old to report its code, or a full index with
731
+ no code of the package in it), it seeds from the clock reading instead, which is above every
732
+ clock-numbered build. While a clock-numbered build of the package is still queued or running, the next
733
+ one builds on the clock too, and a later build seeds. Either way the next build is never below one
734
+ the package already carries.
735
+ - **An upload made some other way** is invisible to that record. Owner-signed builds can pass
736
+ **`himi dist --min-version-code <n>`** (`minVersionCode`, the lowest code the Play listing will take,
737
+ e.g. its highest + 1): the build gets `max(n, record + 1)`, and the record moves up with it. It applies
738
+ only to a Play bundle (`400 min_version_code_requires_play_bundle`); anything but a whole number in
739
+ `1..2100000000` is `400 min_version_code_invalid`.
740
+ - **If the record can't be read or written, the build is refused** (`dist_version_code_unavailable`,
741
+ retryable) rather than falling back to the clock, which would lock a new app's codes high for good.
742
+ A store with no atomic update keeps the clock, as before.
743
+ - **A pool commit older than this ignores `DIST_BUILD_SCHEME`** and keeps the clock, which is always
744
+ above the floor; the result callback raises the record to the code the pool actually stamped.
745
+ - **iOS is unchanged.** App Store Connect doesn't warn, and build numbers only need to rise within a
746
+ marketing version.
710
747
 
711
748
  ## Where an artifact lives, and when it is deleted
712
749
 
@@ -1414,6 +1451,9 @@ himi dist --app <app> --platform android --aab --android-signing owner \
1414
1451
  --package-name com.acme.app --google-services ./google-services.json --version 1.0.0 --target wix
1415
1452
  ```
1416
1453
 
1454
+ Its `versionCode` counts from 1 per package ([Build number](#build-number)). If the listing already has
1455
+ uploads Himi didn't build, add `--min-version-code <the listing's highest + 1>`.
1456
+
1417
1457
  - **What you get:** an **unsigned** `.aab` as `artifact.downloadUrl`, with `androidSigning: "unsigned"`
1418
1458
  and `ownerBundle` (`packageName`, `firebaseProjectId`, `configSha256`) on the job. No APK comes with
1419
1459
  it, because that would be an installable file on a Wix link under any name the caller typed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1708.0",
3
+ "version": "0.1710.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": [
@@ -81,5 +81,5 @@
81
81
  "artifactId": "himalaya-cli"
82
82
  }
83
83
  },
84
- "falconPackageHash": "1810894eb1012098dc1b0a2ed960adebf1b3b33436a7092551f8bdb7"
84
+ "falconPackageHash": "c7fb4af8a8070c3153a9da52446ee94e1e57f2ad99514c5ccd90cb71"
85
85
  }