@wix/himalaya-cli 0.1540.0 → 0.1542.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.
Binary file
@@ -287,6 +287,16 @@ unresolved migration finding.
287
287
  - `topbar_coverage_failed`: a source top-bar control has no matching action
288
288
  with a non-empty `onTap.actionId` (exit 1).
289
289
 
290
+ ## `himi one-app validate-design` codes
291
+
292
+ - `invalid_usage`: required options are missing or incompatible (exit 2).
293
+ - `evidence_invalid`: the collected source evidence is missing or invalid (exit 1).
294
+ - `tokens_unreadable`: the token file cannot be read, or `--fix` cannot safely write it (exit 1).
295
+ - `design_mismatch`: a source value differs from the drawn target value (exit 1).
296
+ - `design_unresolved`: `--record` was requested while a design value still needs an
297
+ adapted ledger row; no evidence is written (exit 1).
298
+ - `record_failed`: `--record` could not safely write its private evidence files (exit 1).
299
+
290
300
  ## `himi one-app coverage` codes
291
301
 
292
302
  - `invalid_usage`: the mode or required paths are missing (exit 2).
@@ -65,7 +65,7 @@ partial artifacts are diagnostics for recovery, never a usable empty fallback.
65
65
  the complete-manifest check or provide a resume command.
66
66
 
67
67
  The migration invocation authorizes this scoped continuation: plan, local app
68
- implementation, necessary same-site OAuth client reconciliation, validation, and
68
+ implementation, the same-site One App visitor binding, validation, and
69
69
  an authenticated hosted draft. Do not restart generic product discovery or add a
70
70
  generic plan-approval pause. Carry this scope through installed agent instructions
71
71
  and resume sessions. It does not authorize live promotion, native distribution,
@@ -151,6 +151,23 @@ Apply these interpretation rules:
151
151
  a feature to account for; they do not alone prove visibility or access for every
152
152
  visitor or member. Resolve those rules separately. This check is specific to this
153
153
  migration workflow; it does not change the behavior of `himi validate`.
154
+ - Before publishing, run the migration-only design check:
155
+ `himi one-app validate-design --evidence-dir .himi/one-app --content .`.
156
+ It resolves the effective source theme with the reader the source app instance
157
+ actually uses, then compares the resolved primary, background and content colors
158
+ and each button's `borderRadius` and `outlineWidth` against the app's `tokens.json`.
159
+ Hex case and shorthand are normalized; an absent button token is compared with the
160
+ value the renderer draws (an outline only on `secondary`; a radius of `radius.pill`,
161
+ else 24), not called a difference. A variant without its own radius must draw the
162
+ source radius at every Button size. A descriptor's per-button `cornerRadius` overrides
163
+ the tokens and is not checked. `--fix` writes the mismatching source values into
164
+ `tokens.json` and pins the dark and high-contrast schemes to what they drew before,
165
+ because a missing scheme falls back to the light value. Rebuild after `--fix`.
166
+ The report names every theme pointer the check did not compare, including typography
167
+ kits and any button `uppercase`, which Himi tokens cannot carry; resolve those
168
+ explicitly rather than treating a pass as full design parity. A deliberate difference
169
+ is waived only by a `design` coverage row with status `adapted` that cites the user's
170
+ instruction and explains the change. This check compares values, not rendered screens.
154
171
  - For each configured Detailed header, import and call the shared
155
172
  `detailedHeader` builder from `@wix/himalaya/screens`. Do not recreate its
156
173
  component tree in the app. Resolve the source fallback and visibility rules
@@ -254,15 +271,17 @@ Run `himi one-app coverage init --evidence-dir .himi/one-app --content .` to
254
271
  create `ONE-APP-COVERAGE.json` from the verified source graph. After edits or a
255
272
  CLI upgrade, run `coverage sync` and review new rows; `coverage check` fails when
256
273
  the file is absent or source requirements have appeared, disappeared or changed.
257
- Rows cover source graph warnings as well as routes and controls. This is an
258
- inventory of migration obligations, not proof that their target actions work.
274
+ Rows cover source graph warnings and app-wide design values as well as routes and
275
+ controls. This is an inventory of migration obligations, not proof that their target
276
+ actions work.
259
277
 
260
278
  Map each row to a target screen and, for interactions or top-bar controls, a
261
- target control. Set its `status` to `supported`, `adapted`, `conditional`, or
279
+ target control. A `design` row is app-wide, so it needs no screen or control: it is
280
+ satisfied by the design check instead. Set its `status` to `supported`, `adapted`, `conditional`, or
262
281
  `unresolved`. For an adaptation, cite the user's instruction and explain the
263
282
  change. Each resolved row needs a `verification` record using the required check
264
283
  ID for its kind (`route-walkthrough`, `visual-comparison`, `behavior-crawl`,
265
- `topbar-control`, `access-state`, or `source-resolution`), a safe relative path to
284
+ `topbar-control`, `access-state`, `design-token`, or `source-resolution`), a safe relative path to
266
285
  a JSON check record, and the exact release payload SHA-256 in `releaseHash`.
267
286
  The JSON file's `checks[]` must contain a passed record with that requirement ID,
268
287
  check ID, release hash, target mapping, and a relative `artifact` path to the
@@ -270,6 +289,25 @@ actual screenshot, test output, or walkthrough record. Multiple rows may share
270
289
  one file, but each needs its own passed check record. Keep private evidence under
271
290
  `.himi/` so it is excluded from the app source archive.
272
291
 
292
+ `design-token` evidence is the one kind nobody writes by hand. Run
293
+ `himi one-app validate-design --evidence-dir .himi/one-app --content . --record
294
+ --release-hash <64-hex-sha256>` after the release is built: it writes
295
+ `.himi/one-app/design-report.json` and `.himi/one-app/design-checks.json`, with one
296
+ passed record per matched or adapted design row, and refuses to write either file when
297
+ the check does not pass or any design row remains unresolved. Point each `design` row's
298
+ `verification` at the checks file. `--fix` writes only to a regular token file inside the
299
+ content directory; read-only validation can inspect an external token path.
300
+ The check also compares each idiom overlay selected by the app's statically readable policy
301
+ against the source value. An active overlay
302
+ that changes it needs a deliberate edit or an adapted ledger row that lists the overlay name in
303
+ `adaptation.idioms` (for example, `["ios"]`); a base-token adaptation alone does not waive it.
304
+ `--fix` repairs base tokens only.
305
+ A row the check cannot compare — an `unresolved` one, such as a button `uppercase` —
306
+ gets a record only once it is resolved as `adapted`, with the user's instruction and an
307
+ explanation. An adaptation counts only while the ledger's `sourceHashes` match the
308
+ collected evidence; after recollection, run `coverage sync` and decide again. `--record`
309
+ refuses `--fix` in the same run: the release hash names the tokens as built.
310
+
273
311
  For example, one entry in the referenced JSON file is:
274
312
 
275
313
  ```json
@@ -357,7 +395,31 @@ not share mutable filters accidentally. Keep static authored content in the app,
357
395
  and products, services, availability, posts and member records live on the same site.
358
396
  Refresh data after operations without reconnecting layout to the One App editor.
359
397
 
360
- Resolve the same site's mobile OAuth client using the existing idempotent command:
398
+ Bind the app to the same site through its **One App visitor identity**. It is the
399
+ identity a visitor of the source Branded app already has, so it needs no OAuth client
400
+ and creates nothing on the customer's site. The `branded-lite` template does not supply `provisioning.json`:
401
+ bind it directly in the generated app's `config.ts`, with its existing
402
+ `WixConsumerAuthProvider` import and the [Wix auth configuration contract](https://apps.wix.com/_api/himi-serve/docs/wix-api-usage.md).
403
+ Replace the template's placeholders and environment fallbacks so an unrelated local
404
+ `WIX_CLIENT_ID` cannot repoint the build:
405
+
406
+ ```ts
407
+ auth: WixConsumerAuthProvider({
408
+ visitorSource: "one-app",
409
+ metaSiteId: "<source-msid>",
410
+ siteUrl: "<verified-source-website-publicUrl>",
411
+ bootAsVisitor: true,
412
+ preserveVisitorOnSignOut: true,
413
+ }),
414
+ ```
415
+
416
+ Every surface reads the site with it: the native apps, the hosted draft preview, and
417
+ `himi run`, `himi render --live` and `himi test --record`. It is a visitor: member
418
+ sign-in still needs a Headless OAuth client.
419
+
420
+ **Only when the site owner wants member sign-in now**, and with their agreement,
421
+ resolve the site's mobile OAuth client with the existing idempotent command (it is
422
+ an owner-scoped write to the customer's site):
361
423
 
362
424
  ```sh
363
425
  himi site client ensure --site <source-msid> --name <stable-migration-client-name> \
@@ -366,17 +428,13 @@ himi site client ensure --site <source-msid> --name <stable-migration-client-nam
366
428
 
367
429
  Reuse a compatible client first; create or update only as necessary. Preserve its
368
430
  existing redirect URIs when adding the app's redirect. Require a successful,
369
- non-dry-run result and verify its `siteId`, public `clientId` and `redirectUri`.
370
- This command reconciles the OAuth client; it does not configure the generated app.
371
-
372
- The `branded-lite` template does not supply `provisioning.json`. Bind the result
373
- directly in the generated app's `config.ts`, using its existing
374
- `WixConsumerAuthProvider` import and the [Wix auth configuration contract](https://apps.wix.com/_api/himi-serve/docs/wix-api-usage.md).
375
- Replace the template's placeholders and environment fallbacks with this app's
376
- verified binding so an unrelated local `WIX_CLIENT_ID` cannot repoint the build:
431
+ non-dry-run result and verify its `siteId`, public `clientId` and `redirectUri`, then
432
+ add them beside the One App binding:
377
433
 
378
434
  ```ts
379
435
  auth: WixConsumerAuthProvider({
436
+ visitorSource: "one-app",
437
+ metaSiteId: "<source-msid>",
380
438
  clientId: "<returned-public-client-id>",
381
439
  siteUrl: "<verified-source-website-publicUrl>",
382
440
  redirectUri: "<returned-registered-app-redirect-uri>",
@@ -389,8 +447,9 @@ The site URL comes from the verified `website.publicUrl` in the collected Busine
389
447
  context or an existing verified binding; `site client ensure` does not return it.
390
448
  Keep visitor/member gates from the reconstruction plan and resolve a missing site
391
449
  URL against the auth contract instead of shipping a template URL. Verify that the
392
- built app uses the intended client and the exact registered redirect. The public
393
- client ID is app configuration; the collection credential is not.
450
+ built app reads the intended site (and, with a client, uses the exact registered
451
+ redirect). The MetaSite and a public client ID are app configuration; the collection
452
+ credential is not.
394
453
 
395
454
  Use `--write-provisioning <path>` only when a valid adoption manifest already
396
455
  exists, including its identity, branding and installed verticals. That option
@@ -65,11 +65,11 @@ export default defineApp({
65
65
  // …
66
66
  auth: WixConsumerAuthProvider({
67
67
  clientId: "4f58d461-…", // the site's headless clientId — THIS is the site binding
68
- // (metaSiteId is implied by it; there is no separate field)
68
+ // (metaSiteId is implied by it; `metaSiteId` is only for one-app mode below)
69
69
  siteUrl: "https://<site>.wixsite.com/<slug>",
70
- redirectUri: "himalaya-<app>://oauth/callback", // REQUIRED — the provider throws
70
+ redirectUri: "himalaya-<app>://oauth/callback", // REQUIRED with a clientId — the provider throws
71
71
  // "WixConsumerAuthProvider: redirectUri is required." without it,
72
- // even when bootAsVisitor is true (the check fires unconditionally).
72
+ // even when bootAsVisitor is true.
73
73
  // Use your app's URL scheme; the scaffolds ship this exact shape.
74
74
  bootAsVisitor: true, // mint an anonymous visitor token at boot
75
75
  }),
@@ -85,6 +85,28 @@ members, etc. Scope is **visitor**: reads a site exposes anonymously work; owner
85
85
  live at `@himalaya/wix-auth` in-repo / `@wix/himalaya/wix-auth` off-repo — `himi sdk` lists the runtime
86
86
  data clients, not these config-time providers).
87
87
 
88
+ **No OAuth client on the site? Bind by MetaSite instead (`visitorSource: "one-app"`).** A Headless
89
+ OAuth client can only be created by the site's owner. An app migrated from a Branded One App reads its
90
+ site the way that app's visitors already do — the site's **One App visitor signed instance** — so it
91
+ needs no client and creates nothing on the site:
92
+
93
+ ```ts
94
+ auth: WixConsumerAuthProvider({
95
+ visitorSource: "one-app",
96
+ metaSiteId: "0c55162c-…", // the site's MetaSite ID
97
+ siteUrl: "https://www.<site>.com/",
98
+ bootAsVisitor: true,
99
+ }),
100
+ ```
101
+
102
+ The instance comes from `GET apps.wix.com/_api/one-app-session-web/v3/businesses/<metaSiteId>/signed-instance?signed_instance_type=Visitor`
103
+ (no credentials) and is sent as a bare `Authorization` header (`Bearer <instance>` is a 400). Native
104
+ mints it directly; the browser cannot (no CORS), so the app's own origin mints it at `/v1/visitor/instance`;
105
+ `himi run`, `render --live` and `test --record` mint it in Node. Each mint is a new visitor, so it is
106
+ kept until its `validUntil` (~4h) and re-minted only once expired — a 401 on an unexpired instance is
107
+ the endpoint's answer (members-only reads refuse every visitor). Scope is visitor: member sign-in still
108
+ needs a `clientId` (+ `redirectUri`), which you may add beside it.
109
+
88
110
  Monorepo / native Branded Lite (env overrides, auth bake, shareable binary with icon/splash):
89
111
  [branded-lite-site-binding.md](branded-lite-site-binding.md).
90
112
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1540.0",
3
+ "version": "0.1542.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": [
@@ -71,5 +71,5 @@
71
71
  "artifactId": "himalaya-cli"
72
72
  }
73
73
  },
74
- "falconPackageHash": "a1d4dc831a852d303dab5ab6d7d7c2eea37f28a6f0c949a4d2c1ce6f"
74
+ "falconPackageHash": "df1b4ea698663ced2b915395398ceb7e54e9d4ef814dbfe53215381d"
75
75
  }