@altertable/data-app 0.72.0 → 0.74.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.
Files changed (112) hide show
  1. package/AGENTS.md +5 -61
  2. package/CONTRIBUTING.md +130 -181
  3. package/README.md +3 -4
  4. package/REFERENCE.md +35 -345
  5. package/dist/chunks/contract-BeLPJwlO.js +558 -0
  6. package/dist/chunks/contract-BeLPJwlO.js.map +1 -0
  7. package/dist/chunks/contract-Di8SP74I.js +462 -0
  8. package/dist/chunks/contract-Di8SP74I.js.map +1 -0
  9. package/dist/chunks/diagnostics-BTZSlNtW.js +967 -0
  10. package/dist/chunks/diagnostics-BTZSlNtW.js.map +1 -0
  11. package/dist/chunks/format-BdFlv_xa.js +148 -0
  12. package/dist/chunks/format-BdFlv_xa.js.map +1 -0
  13. package/dist/chunks/operation-CSM9UmO3.js +134 -0
  14. package/dist/chunks/operation-CSM9UmO3.js.map +1 -0
  15. package/dist/chunks/request-body-H1qPmmTN.js +50 -0
  16. package/dist/chunks/request-body-H1qPmmTN.js.map +1 -0
  17. package/dist/client/index.js +273 -285
  18. package/dist/client/index.js.map +1 -13
  19. package/dist/core/appearance.js +171 -162
  20. package/dist/core/appearance.js.map +1 -10
  21. package/dist/core/config.js +49 -11
  22. package/dist/core/config.js.map +1 -9
  23. package/dist/core/contract.js +3 -73
  24. package/dist/core/format.js +1 -26
  25. package/dist/index.js +1 -12
  26. package/dist/internal.js +352 -397
  27. package/dist/internal.js.map +1 -15
  28. package/dist/server/index.js +85 -97
  29. package/dist/server/index.js.map +1 -10
  30. package/dist/types/chunks/appearance.d.ts +45 -0
  31. package/dist/types/chunks/contract.d.ts +720 -0
  32. package/dist/types/chunks/index.d.ts +240 -0
  33. package/dist/types/client/index.d.ts +3 -13
  34. package/dist/types/core/appearance.d.ts +2 -42
  35. package/dist/types/core/config.d.ts +36 -39
  36. package/dist/types/core/contract.d.ts +2 -114
  37. package/dist/types/core/format.d.ts +44 -17
  38. package/dist/types/index.d.ts +3 -3
  39. package/dist/types/internal.d.ts +312 -22
  40. package/dist/types/server/index.d.ts +15 -4
  41. package/docs/app-authoring.md +77 -128
  42. package/docs/client.md +29 -63
  43. package/docs/composition.md +44 -75
  44. package/docs/contract.md +60 -100
  45. package/docs/data-context.md +35 -61
  46. package/docs/diagnostics.md +45 -0
  47. package/docs/embed.md +86 -55
  48. package/docs/formatting-and-appearance.md +17 -38
  49. package/docs/hosted-apps.md +7 -14
  50. package/docs/layout.md +30 -47
  51. package/docs/local-data-apps.md +7 -7
  52. package/docs/react-embed.md +20 -26
  53. package/docs/react.md +10 -27
  54. package/docs/server-bun.md +2 -27
  55. package/docs/server.md +6 -12
  56. package/docs/stories-and-export.md +38 -40
  57. package/docs/styling.md +14 -22
  58. package/docs/ui-quality.md +5 -5
  59. package/docs/ui.md +93 -70
  60. package/docs/variables.md +142 -254
  61. package/docs/views.md +85 -116
  62. package/docs/widgets.md +100 -153
  63. package/docs/worker.md +15 -27
  64. package/package.json +3 -2
  65. package/dist/chunks/index-5a27erdg.js +0 -54
  66. package/dist/chunks/index-5a27erdg.js.map +0 -10
  67. package/dist/chunks/index-9yxr7nmm.js +0 -742
  68. package/dist/chunks/index-9yxr7nmm.js.map +0 -17
  69. package/dist/chunks/index-j5q5n3ra.js +0 -151
  70. package/dist/chunks/index-j5q5n3ra.js.map +0 -10
  71. package/dist/chunks/index-q75zm3a7.js +0 -153
  72. package/dist/chunks/index-q75zm3a7.js.map +0 -11
  73. package/dist/chunks/index-vhaec7m5.js +0 -30
  74. package/dist/chunks/index-vhaec7m5.js.map +0 -10
  75. package/dist/chunks/index-zp78caex.js +0 -1047
  76. package/dist/chunks/index-zp78caex.js.map +0 -19
  77. package/dist/core/contract.js.map +0 -9
  78. package/dist/core/format.js.map +0 -9
  79. package/dist/index.js.map +0 -9
  80. package/dist/types/client/annotations.d.ts +0 -27
  81. package/dist/types/client/data-client.d.ts +0 -43
  82. package/dist/types/client/download.d.ts +0 -5
  83. package/dist/types/client/iframe.d.ts +0 -59
  84. package/dist/types/client/location.d.ts +0 -13
  85. package/dist/types/client/logger.d.ts +0 -14
  86. package/dist/types/client/messages.d.ts +0 -7
  87. package/dist/types/client/navigation.d.ts +0 -15
  88. package/dist/types/client/transport.d.ts +0 -15
  89. package/dist/types/core/annotations.d.ts +0 -99
  90. package/dist/types/core/bridge-endpoint.d.ts +0 -21
  91. package/dist/types/core/bridge.d.ts +0 -172
  92. package/dist/types/core/data-view.d.ts +0 -46
  93. package/dist/types/core/date-format.d.ts +0 -24
  94. package/dist/types/core/date-range.d.ts +0 -20
  95. package/dist/types/core/dimension-source.d.ts +0 -64
  96. package/dist/types/core/dimension.d.ts +0 -71
  97. package/dist/types/core/facets.d.ts +0 -13
  98. package/dist/types/core/filters.d.ts +0 -45
  99. package/dist/types/core/invariant.d.ts +0 -2
  100. package/dist/types/core/keys.d.ts +0 -2
  101. package/dist/types/core/logger.d.ts +0 -12
  102. package/dist/types/core/messages.d.ts +0 -62
  103. package/dist/types/core/navigation.d.ts +0 -11
  104. package/dist/types/core/operation-types.d.ts +0 -80
  105. package/dist/types/core/operation.d.ts +0 -20
  106. package/dist/types/core/presentation.d.ts +0 -9
  107. package/dist/types/core/queries.d.ts +0 -84
  108. package/dist/types/core/reading.d.ts +0 -17
  109. package/dist/types/core/uuid.d.ts +0 -2
  110. package/dist/types/core/variables.d.ts +0 -133
  111. package/dist/types/server/handler.d.ts +0 -13
  112. package/dist/types/server/request-body.d.ts +0 -4
package/AGENTS.md CHANGED
@@ -1,63 +1,7 @@
1
- # @altertable/data-app
1
+ # Build Altertable data apps
2
2
 
3
- Build Altertable data apps with `@altertable/data-app`. They render in an iframe
4
- in Altertable, a chat app, or locally in a browser.
3
+ Follow [app authoring](docs/app-authoring.md) with the selected starter for a new
4
+ app or the current source for an existing app. Open another guide only when the
5
+ task needs a pattern that source does not cover. Search [REFERENCE.md](REFERENCE.md) for the exact export or prop.
5
6
 
6
- Every data app includes CSV export and a story in the built-in toolbar,
7
- both derived from the displayed result. Setup and static screens may omit them.
8
-
9
- Follow [app authoring](docs/app-authoring.md) for the shared workflow, the data app
10
- and local data app paths, and task-specific documentation.
11
-
12
- Look up exports in the generated [API reference](REFERENCE.md), which ships in
13
- the package. It has one line per export and per prop, with types, `?` for
14
- optional, and a JSDoc summary. `rg '^LineChart\b' REFERENCE.md` returns a
15
- component and its props.
16
-
17
- ## Styling
18
-
19
- Use components and typed props first; customize through app-owned `className`
20
- and public tokens. Follow [Styling](docs/styling.md)
21
- and [UI quality](docs/ui-quality.md).
22
- Do not copy package classes onto markup or select private descendants.
23
-
24
- ## UI platform changes
25
-
26
- Express intent through small typed props and simple data structures. Derive UI
27
- from the displayed source; configure only meaning the platform cannot infer.
28
- Follow the [UI platform principles](CONTRIBUTING.md#ui-platform-principles).
29
-
30
- ## Documentation
31
-
32
- Use `<Component>` notation for React components. Keep guidance concise; leave
33
- prop details to TypeScript and JSDoc. Describe the current API without migration
34
- or legacy instructions.
35
-
36
- ## App authoring
37
-
38
- Read the matching guide before generating an app. Package contributors follow
39
- [Contributing](CONTRIBUTING.md).
40
-
41
- | Task | Read |
42
- | -------------------------------------- | -------------------------------------------------------------- |
43
- | Choose hosted or local execution | [App authoring](docs/app-authoring.md) |
44
- | Plan a coherent exploration and story | [Composition](docs/composition.md) |
45
- | Load data and compose loading states | [Views](docs/views.md) |
46
- | Add filters | [Variables](docs/variables.md) |
47
- | Compose visuals, tables, and narrative | [Widgets](docs/widgets.md), [layout](docs/layout.md) |
48
- | Define sources and evidence | [Data context](docs/data-context.md) |
49
- | Present findings and export results | [Stories and export](docs/stories-and-export.md) |
50
- | Format values and appearance | [Formatting and appearance](docs/formatting-and-appearance.md) |
51
- | Look up props, signatures, and types | [API reference](REFERENCE.md) |
52
-
53
- Use `@altertable/data-app-react` with declared views and bound widgets. `@altertable/data-app-react/ui` is for setup,
54
- static displays, and deliberately custom UI; see [direct composition](docs/ui.md).
55
- Prefer derivation over repeated configuration. Keep static context outside loading boundaries. Derive labels, findings, and
56
- exports from the displayed result and its input. Edit app-owned files; installed
57
- package files are dependencies.
58
- Declare typed `params` and `projections`; derive operation data from `query()` rows
59
- without duplicate schemas or type assertions. See [contracts](docs/contract.md)
60
- and [facets](docs/variables.md#fixed-options-and-query-backed-facets).
61
-
62
- Keep `docs/` focused on knowledge agents need to build data apps. Put package
63
- implementation, testing, and release guidance in `CONTRIBUTING.md`.
7
+ Package contributors follow [Contributing](CONTRIBUTING.md).
package/CONTRIBUTING.md CHANGED
@@ -1,193 +1,142 @@
1
1
  # Contributing
2
2
 
3
- Use the Bun and Node.js versions in `.bun-version` and `.node-version`.
3
+ Use the versions in `.bun-version` and `.node-version`.
4
4
 
5
- ```fish
5
+ ```sh
6
6
  bun install --frozen-lockfile
7
7
  bash scripts/install-test-browser.sh
8
- bun run check
9
8
  ```
10
9
 
10
+ ## Workflow
11
+
12
+ 1. **Locate the owner.** Use the code map below. Read additional guidance only
13
+ for the kind of change being made.
14
+ 2. **Change source and consumers.** Keep the public API focused on concrete app
15
+ needs. Preserve package boundaries and explicit exports. Update affected
16
+ callers, starters, and guides with public behavior changes.
17
+ 3. **Run focused checks.** Build with `bun run build` before consumer tests.
18
+ Select the test file or `-t "workflow name"` matching the change. For example,
19
+ CSV export changes use `bun run test tests/public-api/apps-export.test.ts`.
20
+ Docs-only edits use `bun run lint:md`, `bun run check:links`, and
21
+ `bun run format:check`.
22
+ 4. **Run final verification.** Use `bun run check` for package changes. Run
23
+ `bun run check:workflows` when changing workflows or shell scripts. Fix failures;
24
+ report checks that could not run.
25
+ 5. **Commit the change.** Use Conventional Commits. Describe behavior and
26
+ verification in PRs and flag breaking changes.
27
+
11
28
  ## Find the code
12
29
 
13
- | Task | Location |
14
- | --------------------------------------- | ----------------------------------------------------------- |
15
- | Static source manifest tooling | `packages/data-app-manifest` |
16
- | Operations, validation, and data state | `packages/data-app/src/core` |
17
- | Browser clients and navigation | `packages/data-app/src/client` |
18
- | Request authorization and local serving | `packages/data-app/src/server`, `packages/data-app-bun/src` |
19
- | Iframe hosting and bootstrap | `packages/data-app-embed`, `packages/data-app-worker` |
20
- | React bindings and UI | `packages/data-app-react/src` |
21
- | Consumer examples | `packages/data-app-examples/templates` |
22
- | Public guides | `docs` |
23
- | Build, package checks, and releases | `scripts` |
24
-
25
- Keep browser entries free of server implementations and credentials. Core,
26
- client, server, and embed remain independent of React. Implementations import
27
- focused modules; public entry points declare the supported exports explicitly.
28
- Keep style injection explicit; importing React must not modify the DOM. Add new
29
- styles to `packages/data-app-react/src/styles.css`. Do not edit generated `dist`.
30
-
31
- Use relative imports within each package and declared package exports across
32
- packages. Relative source imports include their `.ts` or `.tsx` extension; builds
33
- emit JavaScript and normalize declaration imports to `.js`. Consumers import
34
- package names and exported subpaths. Use repository-root `@/` imports for
35
- contributor tooling and fixtures.
36
- Consumer tests and examples import the published package names. The base
37
- `/internal` entry is shared implementation for coordinated packages; app authors
38
- use documented entries. Run `bun run lint:fix` and `bun run format` for
39
- style fixes.
40
-
41
- Compose the gallery from provided components, including layouts. Let primitives
42
- own sizing, spacing, and responsive behavior. Report missing primitives and keep
43
- fallbacks minimal.
44
-
45
- ## Workspace packages
46
-
47
- The root is private. Publishable packages live in `packages/`; the local starter remains a private workspace. Canonical templates live in
48
- `packages/data-app-examples/templates` and ship only in `@altertable/data-app-examples`. `scripts/packages.ts` lists packages in dependency order.
49
- Run `bun run build` from the root to build JavaScript, declarations, explicit
50
- styles, the embed bootstrap, the bundled preview host, and the standalone Worker.
51
- Package-level builds require their dependencies to have been built first.
52
- Scaffolding tools consume the examples package catalog and `copyExample()`;
53
- template selection and destination handling belong to the caller.
54
-
55
- `@altertable/data-app-manifest` owns TypeScript 5 for static source extraction.
56
- Keep compiler dependencies in this tooling package; runtime packages must not
57
- depend on it. Root tooling and declaration builds use TypeScript 7.
58
-
59
- Every package declares its own runtime dependencies and peers. Cross-package
60
- builds externalize dependencies to preserve shared module identity. The Worker,
61
- bootstrap, and preview host are deliberately self-contained build artifacts.
62
-
63
- `bun run check:boundaries` verifies ownership and release version consistency.
64
- `bun run check:package` packs every package and installs consumer combinations
65
- outside the checkout to verify dependency isolation, portable types, browser
66
- bundling, and Bun previews without workspace hoisting.
67
-
68
- ## Verify changes
69
-
70
- Write high-level public API tests with Vitest in `tests/public-api`. Define an
71
- operation, authorize and query it, compose a view, or embed an app through
72
- the published package exports. Assert consumer-visible results and errors. Supply
73
- data and failures through public dependency injection; do not import private
74
- source, fabricate internal state, or assert implementation details. Prefer queries by role and accessible name, or by label for form fields. Scope
75
- content assertions to the relevant region, status, alert, or dialog; use text
76
- queries for prose with no meaningful role. Do not invent ARIA roles for tests.
77
- Group browser workflows by consumer capability in `apps-*.test.ts`; keep tests
78
- self-contained and setup local until repetition warrants sharing it.
79
-
80
- `bun run test` runs the complete suite against the built package. Browser
81
- workflows launch Chromium through Playwright from Vitest. They use public
82
- consumer fixtures, an isolated local server, and a fresh browser context per
83
- test. Build first; run one file with `bun run test tests/public-api/apps-export.test.ts`
84
- or one workflow with `bun run test -t "workflow name"`.
85
-
86
- Update the relevant guide when changing public behavior. In documentation prose,
87
- write functions as `functionName()` and components as `<ComponentName>`. Keep JSDoc for
88
- constraints, ownership, units, and runtime boundaries; leave implementation
89
- explanations in the code. App instructions belong in the consuming app's
90
- `AGENTS.md`; see the [local starter](https://github.com/altertable-ai/data-app/tree/main/packages/data-app-examples/templates/starter-local-data-app)
91
- and [hosted authoring](docs/hosted-apps.md).
92
-
93
- `bun run check` builds first and runs all required source, Markdown, local link, package, and starter
94
- checks. Build before running consumer tests individually.
95
-
96
- | Command | Purpose |
97
- | ------------------------------ | -------------------------------------------------- |
98
- | `bun run build` | Build JavaScript, declarations, styles, reference |
99
- | `bun run check:reference` | Verify the staged `REFERENCE.md` is current |
100
- | `bun run check:styles` | Validate authored styling hooks |
101
- | `bun run typecheck` | Check source, tests, and scripts |
102
- | `bun run lint` | Run type-aware lint checks |
103
- | `bun run lint:md` | Check Markdown structure and syntax |
104
- | `bun run check:links` | Validate local files, images, and heading links |
105
- | `bun run check:links:external` | Check external URLs (requires network access) |
106
- | `bun run format` | Format source and docs |
107
- | `bun run test` | Verify high-level public API workflows with Vitest |
108
- | `bun run check:package` | Verify the npm archive as a consumer |
109
- | `bun run check:starter` | Typecheck, lint, and build the starter |
110
- | `bun run check:workflows` | Validate workflows and shell scripts |
111
-
112
- `scripts/build-reference.ts` generates `REFERENCE.md` from the emitted
113
- declarations with the TypeScript checker, covering documented workspace package
114
- entry points. Undocumented implementation entries remain excluded. The base
115
- package ships a generated copy alongside its guides. Commit the root reference
116
- when a build changes it. Generation fails when an export or prop type does not
117
- resolve, and `bun run check:reference` fails when the staged file differs from
118
- the generated one. Improve entries through JSDoc and types, not by editing the
119
- file.
120
-
121
- Markdown checks cover all authored `.md` files, including `AGENTS.md` and the
122
- starter docs. Oxfmt owns formatting. Release Please owns `CHANGELOG.md`, so
123
- Markdown style linting excludes it; link validation still includes it. Both
124
- Markdown linting and local link validation run in `bun run check` and CI.
125
-
126
- Run `bun run check:links:external` explicitly to check external HTTP(S) links.
127
- It skips local development URLs and checks reachability without external heading
128
- validation. It stays outside required checks because third-party availability and
129
- rate limits can cause failures unrelated to a change.
130
-
131
- Run `bun run dev` to preview UI examples at `http://127.0.0.1:27418/gallery`
132
- and a playground at `/playground` (`dev/playground.tsx`, querying the demo
133
- tables from `dev/seed.ts` that `scripts/dev.ts` seeds). It builds once, then rebuilds `dist` when package source
134
- changes; open pages reload on package, fixture, and playground edits. Restart it after changing
135
- `dev/server.ts`; rerun `bun run build` to refresh declarations. Add `?delay=2000` to a host page URL
136
- to delay its SQL responses and inspect loading states. It needs Docker: SQL runs
137
- against a mocked Altertable API
138
- ([altertable-mock](https://github.com/altertable-ai/altertable-mock), DuckDB)
139
- started with Testcontainers and stopped on exit. Public API tests use their own deterministic consumer fixtures.
140
-
141
- Run `bun run dev:file <path>` to preview a single-file data app such as
142
- `packages/data-app-examples/templates/starter-data-app/index.tsx` from anywhere on disk, or `bun run dev:dir <path>`
143
- for a local data app directory with `src/server.ts`. Both resolve `@altertable/data-app`
144
- and React from this checkout's package builds, so the app needs no install. Run `bun run build`
145
- after package changes. File previews replace the app iframe on edits and preserve
146
- URL filters. Directory previews restart the app server when its imports change.
147
- Unlike `bun run dev`, neither uses the mocked API: set `ALTERTABLE_USERNAME` and `ALTERTABLE_PASSWORD` (or the
148
- `ALTERTABLE_LAKEHOUSE_` names) to query `https://api.altertable.ai`, or another lakehouse
149
- with `ALTERTABLE_API_BASE`. A CLI proxy (`ALTERTABLE_DATA_PROXY_URL`) takes precedence.
150
- Each command prints the lakehouse it targets on startup.
151
-
152
- Open the **Widgets** tab (`/gallery?view=widgets`) for one ready example of each
153
- composable data display inside `<VisualizationWidget>`. The other tabs cover
154
- composed apps, variants, and request states.
155
-
156
- Use Conventional Commits and describe behavior changes and verification in PRs.
157
- Flag breaking API changes. Release Please owns `CHANGELOG.md`; see
158
- [Releasing](https://github.com/altertable-ai/data-app/blob/main/.github/RELEASING.md) for release setup and recovery.
159
-
160
- ## Focused public API
161
-
162
- Keep exports and options focused on concrete app needs. Prefer defaults and
163
- derivation from existing state over new knobs; keep implementation details private.
164
-
165
- For public changes, update the relevant guide, migrate callers and starters,
166
- and verify published usage. Flag breaking changes in commits and PRs.
167
-
168
- Docs help agents generate data apps: show current usage and focused examples.
169
- Keep package architecture and contributor rules here. Document author decisions
170
- and minimal composition examples; leave automatic interaction mechanics and prop
171
- inventories to code, TypeScript, and JSDoc.
30
+ | Task | Location |
31
+ | ------------------------------- | ----------------------------------------------------------- |
32
+ | Static manifest tooling | `packages/data-app-manifest` |
33
+ | Operations and data state | `packages/data-app/src/core` |
34
+ | Browser clients and navigation | `packages/data-app/src/client` |
35
+ | Authorization and local serving | `packages/data-app/src/server`, `packages/data-app-bun/src` |
36
+ | Iframe hosting and bootstrap | `packages/data-app-embed`, `packages/data-app-worker` |
37
+ | React bindings and UI | `packages/data-app-react/src` |
38
+ | Starter templates | `packages/data-app-examples/templates` |
39
+ | App authoring guides | `docs` |
40
+ | Build and release tooling | `scripts` |
41
+
42
+ ## Package boundaries
43
+
44
+ Keep server implementations and credentials out of browser entries. Core,
45
+ client, server, and embed remain independent of React. Import focused modules
46
+ internally and declare public exports explicitly. Use relative `.ts`/`.tsx`
47
+ imports within packages and declared exports across packages; root tooling and
48
+ fixtures may use `@/`.
49
+
50
+ Declare dependencies and peers in their owning package. Keep runtime packages
51
+ free of compiler dependencies. Edit source, not generated `dist`.
52
+
53
+ ## Public API changes
54
+
55
+ Write consumer-visible workflows in `tests/public-api` using published exports.
56
+ Supply data and failures through public dependency injection. Avoid private
57
+ imports, fabricated internal state, and implementation assertions. Prefer
58
+ accessible role/name or label queries scoped to the relevant region. Keep browser
59
+ workflows self-contained in `apps-*.test.ts`.
60
+
61
+ Update the relevant guide and starter. Keep app authoring in `docs/`; document
62
+ current usage with one focused example, `<Component>` and `functionName()` notation.
63
+ Show complete enclosing calls and components; use `// ...` for unrelated setup.
64
+ Name the app declaration `dataApp`; keep the API's `app` prop name.
65
+ Leave prop inventories to TypeScript and JSDoc. Generate `REFERENCE.md` with
66
+ `bun run build` and stage it before `bun run check:reference`; improve entries
67
+ through types and JSDoc, never generated output.
172
68
 
173
69
  ## UI platform principles
174
70
 
175
- Design defaults that let agents build useful data apps with minimal configuration:
176
-
177
- - Express user intent through small typed props and explicit ownership.
178
- - Derive values from the displayed source rather than asking authors to repeat them.
179
- - Configure only semantics that cannot be inferred reliably, such as which filters affect a dataset.
180
- - Keep data structures simple, data flow direct, and names specific to their purpose.
181
- - Compose existing primitives; remove unnecessary wrappers and intermediate state.
182
- - Let components own loading, keyboard behavior, focus recovery, and responsive layout.
183
- - Document the default path with one short authoring example; keep constraints in TypeScript and JSDoc.
184
- - Verify public behavior across loading, empty, updating, and ready states.
185
-
186
- ## Component CSS
187
-
188
- Keep defaults in authored CSS: inherited values in `tokens.css`, presets in
189
- `appearance.css`, and optional overrides in native `var()` fallbacks at use sites.
190
- Use the four layers (`atbl.tokens`, `atbl.base`, `atbl.components`,
191
- `atbl.interaction`) and shared focus/state rules rather than duplicate control
192
- paint. Keep geometry local. Document public variables beside declarations or
193
- consumption sites; update the name contract in `style-contract.ts` when adding hooks.
71
+ - Express intent through small typed props and simple data structures.
72
+ - Derive values from the displayed source; configure only meaning the platform
73
+ cannot infer, such as which filters affect a dataset.
74
+ - Compose existing primitives. Let components own loading, keyboard behavior,
75
+ focus recovery, sizing, and responsive layout.
76
+ - Verify loading, empty, updating, and ready behavior through public APIs.
77
+ - Own standard theme, responsive, and containment behavior in SDK tests, plus
78
+ keyboard/focus behavior for controls. Exercise both themes and narrow/wide
79
+ widths, including long labels.
80
+
81
+ For CSS changes, keep defaults in `tokens.css` and `appearance.css`, with optional
82
+ native `var()` fallbacks. Reuse focus/state rules and keep geometry local. Add
83
+ styles through `styles.css` with explicit injection; imports must not modify the
84
+ DOM. Update `style-contract.ts` for public hooks.
85
+
86
+ ## Develop linked packages
87
+
88
+ From this checkout:
89
+
90
+ ```sh
91
+ bun install --frozen-lockfile
92
+ bun run dev
93
+ ```
94
+
95
+ `dev` builds and watches every package, including declarations and embedded CSS.
96
+ Failed builds retain the last successful output. Consumers share one watcher per
97
+ checkout; Ctrl-C detaches a consumer and the last consumer stops the watcher.
98
+ Stop all consumers before production builds, the gallery, or package checks.
99
+
100
+ Prefer the consuming project's local SDK launcher when available. For manual Bun
101
+ linking, run this from the consumer, replacing the checkout path:
102
+
103
+ ```sh
104
+ data_app_checkout=/absolute/path/to/data-app
105
+ bun link --cwd "$data_app_checkout/packages/data-app"
106
+ bun link --cwd "$data_app_checkout/packages/data-app-react"
107
+ bun link --no-save @altertable/data-app @altertable/data-app-react
108
+ ```
109
+
110
+ Link any transitive workspace packages too. Keep one React instance supplied by
111
+ the consumer, and configure its bundler to refresh linked output after builds.
112
+
113
+ Launchers parse stdout lines prefixed with `DATA_APP_DEV` and a space. The JSON
114
+ payload looks like `{"event":"ready","generation":1}`. Events are `building`, `ready`, `error`, and
115
+ `stopped`; generation increases only after successful publication. Start or refresh
116
+ consumers after `ready`. New subscribers receive the current event and must wait
117
+ for the next `ready` if a build is in progress or failed. Existing subscribers may
118
+ resume their last successful build after `error`. Unexpected watcher exits return
119
+ a nonzero status; rerun the command to reconnect.
120
+
121
+ ## Preview UI changes
122
+
123
+ For SDK UI work, `bun run dev:gallery` starts the example gallery at
124
+ `http://127.0.0.1:27418/gallery`, `/playground`, and a Docker-backed mock API.
125
+ Package and fixture edits reload. Restart after changing `dev/server.ts`; add
126
+ `?delay=2000` to inspect loading states.
127
+
128
+ Use `bun run dev:file <path>` for a single-file app or `bun run dev:dir <path>`
129
+ for an app directory with `src/server.ts`. These previews use built packages and
130
+ a real lakehouse: configure server-only `ALTERTABLE_LAKEHOUSE_USERNAME` and
131
+ `ALTERTABLE_LAKEHOUSE_PASSWORD`, or the CLI proxy's `ALTERTABLE_DATA_PROXY_URL`
132
+ and `ALTERTABLE_DATA_PROXY_TOKEN`. Use `ALTERTABLE_API_BASE` for another endpoint.
133
+
134
+ ## Packaging and releases
135
+
136
+ For packaging changes, run `bun run check:package` after building to test packed
137
+ consumers, and `bun run check:starter` for starter changes. Packages share one
138
+ version; `scripts/packages.ts` defines publication order.
139
+
140
+ Release Please owns `CHANGELOG.md`. Read
141
+ [Releasing](https://github.com/altertable-ai/data-app/blob/main/.github/RELEASING.md)
142
+ only when changing release setup or retrying publication.
package/README.md CHANGED
@@ -16,7 +16,7 @@ Declare an app's identity and query registry:
16
16
  ```ts
17
17
  import { defineDataApp } from '@altertable/data-app';
18
18
 
19
- const app = defineDataApp({
19
+ const dataApp = defineDataApp({
20
20
  title: 'Activity',
21
21
  description: 'Explore activity across your organization.',
22
22
  scope: { organization: 'demo', environment: 'production' },
@@ -30,9 +30,8 @@ UI or `@altertable/data-app-embed` to host an app. This package requires no Reac
30
30
 
31
31
  ## Documentation
32
32
 
33
- Start with [app authoring](docs/app-authoring.md). Use the installed,
34
- [release-matched starters](docs/app-authoring.md#use-release-matched-starters). Guides and
35
- [agent instructions](AGENTS.md) ship with this package.
33
+ Start with [app authoring](docs/app-authoring.md). Guides, [agent instructions](AGENTS.md),
34
+ and the [API reference](REFERENCE.md) ship with this package.
36
35
 
37
36
  ## License
38
37