@diagonal-hq/cli 0.41.5 → 0.41.7

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/README.md CHANGED
@@ -259,6 +259,25 @@ export default defineConfig({
259
259
  - `domains` declares the domains of the workspace, and `primaryDomain` names the one that is primary. See [Domains](#domains).
260
260
  - `defaultMenu` names the default menu as `Menus.<Name>.uid` from `@app/generated/navigation`, such as `defaultMenu: Menus.Main.uid` for `navigation/main.ts`. The name is the studly case of the file name, so `navigation/front-desk-team.ts` is `Menus.FrontDeskTeam`. `diagonal check` writes `generated/navigation.ts`, which exports `Menus` and exports the default menu as `defaultMenu`, or an empty menu without `defaultMenu`. A layout that imports `defaultMenu` from `@app/generated/navigation` and passes it to `useMenu` shows the default menu. A sign-in without a login redirect lands on the first page of the default menu that the visitor can open. The check refuses an unknown name, a value that is not a uid, and a uid that no menu file exports. **Set as Default Menu** on the Navigation settings page commits this option and deploys it.
261
261
 
262
+ ### Installed package configuration
263
+
264
+ The optional `packages` object in `defineConfig` holds this workspace's choices for all installed packages. Each key is the dependency's npm name. Each package entry maps its input identities (`kind:uid`) to a selected source UID, a `{ value: ... }` choice, or an opaque `{ secret: ... }` revision. Actual passwords stay in encrypted workspace storage.
265
+
266
+ ```ts
267
+ export default defineConfig({
268
+ name: 'Northstar Association',
269
+ packages: {
270
+ '@northstar/member-kit': {
271
+ 'workspace_field:019a5b1e-2c3d-7e4f-8a9b-0c1d2e3f4f01': {
272
+ value: 'Welcome to Northstar'
273
+ }
274
+ }
275
+ }
276
+ });
277
+ ```
278
+
279
+ Omitted value choices follow the package release's defaults. Required mappings and credentials must be supplied. An explicit `{ value: null }` clears a value. An explicit `{ secret: null }` clears a credential. Install, update, and removal save package choices with dependency changes in one commit. An unsuccessful build or a stale form preserves the previous source and active values. Removing the last package choice removes only `packages`; other workspace configuration stays intact. The config file does not ship in a package release. See [Package inputs](../../app/packages/README.md#file-based-packages).
280
+
262
281
  ### Domains
263
282
 
264
283
  - Each key of `domains` starts with a lowercase letter, contains only letters and digits, and has at most 64 characters. A declaration is `{}` or `{ fallback: 'primary' }`. With `fallback: 'primary'`, the routes of the domain serve on the primary hostname while the domain has no active hostname. The check refuses any other value or option, and `fallback` on the primary domain, at its line.
@@ -344,7 +363,7 @@ export default defineWorkspaceField({
344
363
  - `key` is the field key. It is optional: without it, the file name without `.ts` is the key. The build uses the file name as it is: `support-email.ts` does not give the key `support_email`. A key starts with a lowercase letter and contains only a-z, 0-9, and `_`. It cannot be the key of a built-in setting, such as `name` or `website`, or a record key, such as `id`. The file name gives the `WorkspaceFields` name, so it follows the same rule. The check reports a file name that breaks the rule at the file, and a `key` that breaks it at the `key`. A workspace field has no `slug` option: use `key`.
345
364
  - The build reads only the `.ts` files directly in `workspace-fields/`. It reports any other file in the folder.
346
365
  - `definition` is a `field.<type>({...})` builder. A workspace field takes `label`, `description`, `required`, `guard`, and `settings`. It cannot be a `relation`, and the builder has no `uid`, `unique`, `index`, `computed`, `getter`, or `setter`.
347
- - `value` is the value of the field. It is required: write `null` for a field without a value. The type of `value` follows the field type. The file owns the value.
366
+ - `value` is the value of the field. It is required: write `null` for a field without a value. The type of `value` follows the field type. For workspace-owned fields, the file owns the value. Installed package definitions remain publisher-owned. Saved destination values use `diagonal.config.ts.packages`; an absent choice follows the release value. See [Package inputs](../../app/packages/README.md#file-based-packages).
348
367
  - The build does not use `default`. A `default` in `definition` gives a warning at the `default`, and the field takes its value from `value`.
349
368
  - The check refuses a value that does not match its definition at the line of the value. The deploy checks each literal value again with the `guard` rules of the field.
350
369
  - A value can contain `RecordBindings.<Name>.reference` from `@app/generated/record-bindings`, for example as the value of a UUID field. The deploy stores the reference and does not check it with the `guard` rules. Each read resolves the reference to the record that the workspace selects, and then checks the resolved value with the `guard` rules. A missing selection, a missing or archived record, or a failed guard rule gives a setup error when a page or workflow reads that field. The other fields stay available.
@@ -352,7 +371,7 @@ export default defineWorkspaceField({
352
371
  - A removed file archives its field on the next deploy, and a file with the same uid restores it. A field that something still uses, such as a workflow, stops the deploy with the message of the entity graph.
353
372
  - A deploy refuses a field without a `uid`. Run `diagonal check` to write one.
354
373
  - A new field takes its place in the byte order of the file names. A deploy does not reorder the fields that the workspace already has.
355
- - The files own every custom workspace field. A deploy archives each custom field that no file declares, and never writes a built-in field. The admin UI, the API, and the AI assistant refuse to create, change, or delete a custom field, or to change its value.
374
+ - The files own every custom workspace field. A deploy archives each custom field that no file declares, and never writes a built-in field. Supported admin, API, and AI field edits commit and deploy source changes. Workspace-owned definitions and values use their `workspace-fields/` files. Installed package definitions remain publisher-owned; these editors can change only their destination values, through `diagonal.config.ts.packages`.
356
375
  - `diagonal.config.ts` has no `workspaceFields` option. The check refuses it and names the `workspace-fields/` folder.
357
376
 
358
377
  ### WorkspaceFields