@wix/himalaya-cli 0.851.0 → 0.852.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.
@@ -261,7 +261,11 @@ export interface AppConfig {
261
261
  telemetry: TelemetrySink;
262
262
  /** Local-agent configuration. */
263
263
  agent: AgentConfig;
264
- /** Domain entities and their cache materialization shape. */
264
+ /** Domain entities and their cache materialization shape. REQUIRED — an app with no
265
+ * domain entities writes `entities: {}` (what the scaffold emits), and omitting the key
266
+ * is a `defineApp` error. NOT the place to declare data the app PERSISTS at runtime,
267
+ * despite `dataSchema` below describing itself in terms of "entities": on-device storage
268
+ * is `dataSchema`, and Wix-backed collections are `cms`. */
265
269
  entities: Record<string, EntityConfig>;
266
270
  /**
267
271
  * Local-DB schema descriptor (local-DB roadmap Phase 3). Declares the app's
@@ -145,10 +145,10 @@ export interface Modifiers {
145
145
  * HStack a `Button` and a `Toggle` are implicitly weighted, so they DIVIDE the
146
146
  * row with your weighted child instead of taking a width ahead of it —
147
147
  * `[VStack(weight:1), Button, Button]` is a three-way split, not "the VStack gets
148
- * the remainder". The RELIABLE opt-outs are `iconOnly` and `tertiary`/`link` with
149
- * `fullWidth` unset. `fullWidth: false` is NOT reliable here: only Android honors
150
- * it in a weighted row (`wantsRowStretch`); iOS (`WeightedStack`) and web still
151
- * hand the button a share. Otherwise give the actions their own row.
148
+ * the remainder". To opt a Button out on EVERY renderer set `fullWidth: false`
149
+ * (an explicit flag wins in both directions; absent falls back to the style
150
+ * default, which is "share" for every style but `tertiary`/`link`), or use
151
+ * `iconOnly`. Otherwise give the actions their own row.
152
152
  * See `himi docs designing-himi-screens` §4. */
153
153
  weight?: number;
154
154
  /** RTL — pin the subtree's writing direction: `"ltr"` | `"rtl"` | `"locale"`
@@ -7476,7 +7476,22 @@ function validateConfigShape(config) {
7476
7476
  seen.add(screenId);
7477
7477
  }
7478
7478
  }
7479
+ if (config.entities === void 0 || config.entities === null) {
7480
+ throw new Error(
7481
+ 'defineApp: "entities" is required \u2014 add `entities: {},` to config.ts (an app with no domain entities declares the empty object).'
7482
+ );
7483
+ }
7484
+ if (typeof config.entities !== "object" || Array.isArray(config.entities)) {
7485
+ throw new Error(
7486
+ `defineApp: "entities" must be an object of { "<name>": { file | directory } } (got ${Array.isArray(config.entities) ? "an array" : typeof config.entities}).`
7487
+ );
7488
+ }
7479
7489
  for (const [name, entity] of Object.entries(config.entities)) {
7490
+ if (entity === null || typeof entity !== "object") {
7491
+ throw new Error(
7492
+ `defineApp: entity "${name}" must be an object declaring "file" or "directory" (got ${entity === null ? "null" : typeof entity}).`
7493
+ );
7494
+ }
7480
7495
  if (!entity.file && !entity.directory) {
7481
7496
  throw new Error(
7482
7497
  `defineApp: entity "${name}" must declare either "file" or "directory".`