|
| 1 | +// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license. |
| 2 | + |
| 3 | +import type { Doc } from '@objectstack/spec/system'; |
| 4 | + |
| 5 | +/** |
| 6 | + * Studio app overview doc (ADR-0046), registered in this package's manifest so |
| 7 | + * it groups under "Studio" in the `/_console/docs` index. |
| 8 | + * |
| 9 | + * Authored inline rather than as a flat `src/docs/*.md` file because this is a |
| 10 | + * TS-first code package built by tsup, not a user app built by `os build` — |
| 11 | + * `defineStack({ docs })` / manifest `docs[]` is the supported path for those |
| 12 | + * (see `DocSchema` in `@objectstack/spec/system`). The `content` below is plain |
| 13 | + * CommonMark + GFM with no images/MDX, per ADR-0046 §3.4. |
| 14 | + * |
| 15 | + * Principle (from the HotCRM reference docs): document the *invisible* |
| 16 | + * business logic, not what the Studio UI already shows on screen. |
| 17 | + */ |
| 18 | +export const STUDIO_OVERVIEW_DOC: Doc = { |
| 19 | + name: 'studio_overview', |
| 20 | + label: 'Studio overview', |
| 21 | + description: 'Orientation for builders: the metadata-first model, overlay precedence, and publishing.', |
| 22 | + content: `# Studio overview |
| 23 | +
|
| 24 | +Studio is the builder app — the workbench for shaping the platform's |
| 25 | +*metadata*: objects, fields, views, flows, agents, and the rest. Most of its |
| 26 | +screens are self-explanatory; this page covers the one rule that is not visible |
| 27 | +on screen but governs everything you do here. For the full reference, see |
| 28 | +<https://docs.objectstack.ai>. |
| 29 | +
|
| 30 | +## Metadata-first |
| 31 | +
|
| 32 | +In Studio you do not edit a running database — you edit *definitions*. Every |
| 33 | +object, field, and view is a metadata record, and the live application is |
| 34 | +generated from that metadata. This is why a change in Studio can reshape the UI |
| 35 | +and the API at once: you are changing the model, not patching a screen. |
| 36 | +
|
| 37 | +## Edits are overlays (the invisible rule) |
| 38 | +
|
| 39 | +Your changes do not mutate the metadata shipped by a package in place. Studio |
| 40 | +writes an **overlay** on top of the base definition, and the runtime resolves |
| 41 | +the two by precedence: an unpublished **draft** wins for you while you work, a |
| 42 | +published **tenant overlay** wins over the package's baseline, and the package |
| 43 | +baseline is the fallback (ADR-0005, ADR-0033). The practical consequence: the |
| 44 | +base definition is never destroyed, so an overlay can always be reverted to |
| 45 | +recover the original — and a field that "won't change" is usually being shadowed |
| 46 | +by a higher-precedence layer. |
| 47 | +
|
| 48 | +## Publishing & deploying |
| 49 | +
|
| 50 | +A draft is visible only to you until you **publish** it, which promotes the |
| 51 | +overlay so the rest of the tenant sees it. Moving changes between environments |
| 52 | +(for example dev → production) is a separate **deploy** step, not an automatic |
| 53 | +side effect of publishing — keeping the two distinct is what lets you build |
| 54 | +safely in one environment before shipping. |
| 55 | +
|
| 56 | +See <https://docs.objectstack.ai> for drafts, overlays, and deployment in depth. |
| 57 | +`, |
| 58 | +}; |
0 commit comments