@altertable/data-app 0.71.0 → 0.73.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 (130) hide show
  1. package/AGENTS.md +5 -61
  2. package/CONTRIBUTING.md +93 -173
  3. package/README.md +3 -3
  4. package/REFERENCE.md +30 -341
  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/format-BdFlv_xa.js +148 -0
  10. package/dist/chunks/format-BdFlv_xa.js.map +1 -0
  11. package/dist/chunks/iframe-C3uCZEXh.js +809 -0
  12. package/dist/chunks/iframe-C3uCZEXh.js.map +1 -0
  13. package/dist/chunks/operation-CBxhjNhK.js +131 -0
  14. package/dist/chunks/operation-CBxhjNhK.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 +253 -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 +189 -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 +44 -48
  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 +72 -112
  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/embed.md +83 -55
  47. package/docs/formatting-and-appearance.md +17 -38
  48. package/docs/hosted-apps.md +12 -15
  49. package/docs/layout.md +30 -47
  50. package/docs/local-data-apps.md +7 -7
  51. package/docs/react-embed.md +20 -26
  52. package/docs/react.md +10 -27
  53. package/docs/server-bun.md +3 -28
  54. package/docs/server.md +6 -12
  55. package/docs/stories-and-export.md +38 -40
  56. package/docs/styling.md +14 -22
  57. package/docs/ui-quality.md +5 -5
  58. package/docs/ui.md +68 -70
  59. package/docs/variables.md +142 -254
  60. package/docs/views.md +85 -116
  61. package/docs/widgets.md +100 -153
  62. package/docs/worker.md +15 -27
  63. package/package.json +3 -3
  64. package/dist/chunks/index-5a27erdg.js +0 -54
  65. package/dist/chunks/index-5a27erdg.js.map +0 -10
  66. package/dist/chunks/index-9yxr7nmm.js +0 -742
  67. package/dist/chunks/index-9yxr7nmm.js.map +0 -17
  68. package/dist/chunks/index-j5q5n3ra.js +0 -151
  69. package/dist/chunks/index-j5q5n3ra.js.map +0 -10
  70. package/dist/chunks/index-q75zm3a7.js +0 -153
  71. package/dist/chunks/index-q75zm3a7.js.map +0 -11
  72. package/dist/chunks/index-vhaec7m5.js +0 -30
  73. package/dist/chunks/index-vhaec7m5.js.map +0 -10
  74. package/dist/chunks/index-zp78caex.js +0 -1047
  75. package/dist/chunks/index-zp78caex.js.map +0 -19
  76. package/dist/core/contract.js.map +0 -9
  77. package/dist/core/format.js.map +0 -9
  78. package/dist/index.js.map +0 -9
  79. package/dist/types/client/annotations.d.ts +0 -27
  80. package/dist/types/client/data-client.d.ts +0 -43
  81. package/dist/types/client/download.d.ts +0 -5
  82. package/dist/types/client/iframe.d.ts +0 -59
  83. package/dist/types/client/location.d.ts +0 -13
  84. package/dist/types/client/logger.d.ts +0 -14
  85. package/dist/types/client/messages.d.ts +0 -7
  86. package/dist/types/client/navigation.d.ts +0 -15
  87. package/dist/types/client/transport.d.ts +0 -15
  88. package/dist/types/core/annotations.d.ts +0 -99
  89. package/dist/types/core/bridge-endpoint.d.ts +0 -21
  90. package/dist/types/core/bridge.d.ts +0 -172
  91. package/dist/types/core/data-view.d.ts +0 -46
  92. package/dist/types/core/date-format.d.ts +0 -24
  93. package/dist/types/core/date-range.d.ts +0 -20
  94. package/dist/types/core/dimension-source.d.ts +0 -64
  95. package/dist/types/core/dimension.d.ts +0 -71
  96. package/dist/types/core/facets.d.ts +0 -13
  97. package/dist/types/core/filters.d.ts +0 -45
  98. package/dist/types/core/invariant.d.ts +0 -2
  99. package/dist/types/core/keys.d.ts +0 -2
  100. package/dist/types/core/logger.d.ts +0 -12
  101. package/dist/types/core/messages.d.ts +0 -62
  102. package/dist/types/core/navigation.d.ts +0 -11
  103. package/dist/types/core/operation-types.d.ts +0 -80
  104. package/dist/types/core/operation.d.ts +0 -20
  105. package/dist/types/core/presentation.d.ts +0 -9
  106. package/dist/types/core/queries.d.ts +0 -84
  107. package/dist/types/core/reading.d.ts +0 -17
  108. package/dist/types/core/uuid.d.ts +0 -2
  109. package/dist/types/core/variables.d.ts +0 -133
  110. package/dist/types/server/handler.d.ts +0 -13
  111. package/dist/types/server/request-body.d.ts +0 -4
  112. package/examples/starter-data-app/index.tsx +0 -193
  113. package/examples/starter-local-data-app/.bun-version +0 -1
  114. package/examples/starter-local-data-app/.node-version +0 -1
  115. package/examples/starter-local-data-app/.oxfmtrc.json +0 -4
  116. package/examples/starter-local-data-app/.oxlintrc.json +0 -33
  117. package/examples/starter-local-data-app/AGENTS.md +0 -22
  118. package/examples/starter-local-data-app/README.md +0 -56
  119. package/examples/starter-local-data-app/app.ts +0 -28
  120. package/examples/starter-local-data-app/bunfig.toml +0 -2
  121. package/examples/starter-local-data-app/package.json +0 -35
  122. package/examples/starter-local-data-app/src/App.tsx +0 -8
  123. package/examples/starter-local-data-app/src/assets.d.ts +0 -1
  124. package/examples/starter-local-data-app/src/data-context.ts +0 -21
  125. package/examples/starter-local-data-app/src/favicon.svg +0 -13
  126. package/examples/starter-local-data-app/src/index.html +0 -14
  127. package/examples/starter-local-data-app/src/main.tsx +0 -7
  128. package/examples/starter-local-data-app/src/operations.ts +0 -6
  129. package/examples/starter-local-data-app/src/server.ts +0 -6
  130. package/examples/starter-local-data-app/tsconfig.json +0 -21
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,186 +1,106 @@
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
5
  ```fish
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
- | Operations, validation, and data state | `packages/data-app/src/core` |
16
- | Browser clients and navigation | `packages/data-app/src/client` |
17
- | Request authorization and local serving | `packages/data-app/src/server`, `packages/data-app-bun/src` |
18
- | Iframe hosting and bootstrap | `packages/data-app-embed`, `packages/data-app-worker` |
19
- | React bindings and UI | `packages/data-app-react/src` |
20
- | Consumer examples | `examples/starter-local-data-app`, `examples/starter-data-app` |
21
- | Public guides | `docs` |
22
- | Build, package checks, and releases | `scripts` |
23
-
24
- Keep browser entries free of server implementations and credentials. Core,
25
- client, server, and embed remain independent of React. Implementations import
26
- focused modules; public entry points declare the supported exports explicitly.
27
- Keep style injection explicit; importing React must not modify the DOM. Add new
28
- styles to `packages/data-app-react/src/styles.css`. Do not edit generated `dist`.
29
-
30
- Use relative imports within each package and declared package exports across
31
- packages. Relative source imports include their `.ts` or `.tsx` extension; builds
32
- emit JavaScript and normalize declaration imports to `.js`. Consumers import
33
- package names and exported subpaths. Use repository-root `@/` imports for
34
- contributor tooling and fixtures.
35
- Consumer tests and examples import the published package names. The base
36
- `/internal` entry is shared implementation for coordinated packages; app authors
37
- use documented entries. Run `bun run lint:fix` and `bun run format` for
38
- style fixes.
39
-
40
- Compose the gallery from provided components, including layouts. Let primitives
41
- own sizing, spacing, and responsive behavior. Report missing primitives and keep
42
- fallbacks minimal.
43
-
44
- ## Workspace packages
45
-
46
- The root is private. Publishable packages live in `packages/`; examples remain
47
- private workspaces. `scripts/packages.ts` lists packages in dependency order.
48
- Run `bun run build` from the root to build JavaScript, declarations, explicit
49
- styles, the embed bootstrap, the bundled preview host, and the standalone Worker.
50
- Package-level builds require their dependencies to have been built first.
51
-
52
- Every package declares its own runtime dependencies and peers. Cross-package
53
- builds externalize dependencies to preserve shared module identity. The Worker,
54
- bootstrap, and preview host are deliberately self-contained build artifacts.
55
-
56
- `bun run check:boundaries` verifies ownership and release version consistency.
57
- `bun run check:package` packs every package and installs consumer combinations
58
- outside the checkout to verify dependency isolation, portable types, browser
59
- bundling, and Bun previews without workspace hoisting.
60
-
61
- ## Verify changes
62
-
63
- Write high-level public API tests with Vitest in `tests/public-api`. Define an
64
- operation, authorize and query it, compose a view, or embed an app through
65
- the published package exports. Assert consumer-visible results and errors. Supply
66
- data and failures through public dependency injection; do not import private
67
- source, fabricate internal state, or assert implementation details. Prefer queries by role and accessible name, or by label for form fields. Scope
68
- content assertions to the relevant region, status, alert, or dialog; use text
69
- queries for prose with no meaningful role. Do not invent ARIA roles for tests.
70
- Group browser workflows by consumer capability in `apps-*.test.ts`; keep tests
71
- self-contained and setup local until repetition warrants sharing it.
72
-
73
- `bun run test` runs the complete suite against the built package. Browser
74
- workflows launch Chromium through Playwright from Vitest. They use public
75
- consumer fixtures, an isolated local server, and a fresh browser context per
76
- test. Build first; run one file with `bun run test tests/public-api/apps-export.test.ts`
77
- or one workflow with `bun run test -t "workflow name"`.
78
-
79
- Update the relevant guide when changing public behavior. In documentation prose,
80
- write functions as `functionName()` and components as `<ComponentName>`. Keep JSDoc for
81
- constraints, ownership, units, and runtime boundaries; leave implementation
82
- explanations in the code. App instructions belong in the consuming app's
83
- `AGENTS.md`; see the [local starter](https://github.com/altertable-ai/data-app/tree/main/examples/starter-local-data-app)
84
- and [hosted authoring](docs/hosted-apps.md).
85
-
86
- `bun run check` builds first and runs all required source, Markdown, local link, package, and starter
87
- checks. Build before running consumer tests individually.
88
-
89
- | Command | Purpose |
90
- | ------------------------------ | -------------------------------------------------- |
91
- | `bun run build` | Build JavaScript, declarations, styles, reference |
92
- | `bun run check:reference` | Verify the staged `REFERENCE.md` is current |
93
- | `bun run check:styles` | Validate authored styling hooks |
94
- | `bun run typecheck` | Check source, tests, and scripts |
95
- | `bun run lint` | Run type-aware lint checks |
96
- | `bun run lint:md` | Check Markdown structure and syntax |
97
- | `bun run check:links` | Validate local files, images, and heading links |
98
- | `bun run check:links:external` | Check external URLs (requires network access) |
99
- | `bun run format` | Format source and docs |
100
- | `bun run test` | Verify high-level public API workflows with Vitest |
101
- | `bun run check:package` | Verify the npm archive as a consumer |
102
- | `bun run check:starter` | Typecheck, lint, and build the starter |
103
- | `bun run check:workflows` | Validate workflows and shell scripts |
104
-
105
- `scripts/build-reference.ts` generates `REFERENCE.md` from the emitted
106
- declarations with the TypeScript checker, covering documented workspace package
107
- entry points. Undocumented implementation entries remain excluded. The base
108
- package ships a generated copy alongside its guides. Commit the root reference
109
- when a build changes it. Generation fails when an export or prop type does not
110
- resolve, and `bun run check:reference` fails when the staged file differs from
111
- the generated one. Improve entries through JSDoc and types, not by editing the
112
- file.
113
-
114
- Markdown checks cover all authored `.md` files, including `AGENTS.md` and the
115
- starter docs. Oxfmt owns formatting. Release Please owns `CHANGELOG.md`, so
116
- Markdown style linting excludes it; link validation still includes it. Both
117
- Markdown linting and local link validation run in `bun run check` and CI.
118
-
119
- Run `bun run check:links:external` explicitly to check external HTTP(S) links.
120
- It skips local development URLs and checks reachability without external heading
121
- validation. It stays outside required checks because third-party availability and
122
- rate limits can cause failures unrelated to a change.
123
-
124
- Run `bun run dev` to preview UI examples at `http://127.0.0.1:27418/gallery`
125
- and a playground at `/playground` (`dev/playground.tsx`, querying the demo
126
- tables from `dev/seed.ts` that `scripts/dev.ts` seeds). It builds once, then rebuilds `dist` when package source
127
- changes; open pages reload on package, fixture, and playground edits. Restart it after changing
128
- `dev/server.ts`; rerun `bun run build` to refresh declarations. Add `?delay=2000` to a host page URL
129
- to delay its SQL responses and inspect loading states. It needs Docker: SQL runs
130
- against a mocked Altertable API
131
- ([altertable-mock](https://github.com/altertable-ai/altertable-mock), DuckDB)
132
- started with Testcontainers and stopped on exit. Public API tests use their own deterministic consumer fixtures.
133
-
134
- Run `bun run dev:file <path>` to preview a single-file data app such as
135
- `examples/starter-data-app/index.tsx` from anywhere on disk, or `bun run dev:dir <path>`
136
- for a local data app directory with `src/server.ts`. Both resolve `@altertable/data-app`
137
- and React from this checkout's package builds, so the app needs no install. Run `bun run build`
138
- after package changes. File previews replace the app iframe on edits and preserve
139
- URL filters. Directory previews restart the app server when its imports change.
140
- Unlike `bun run dev`, neither uses the mocked API: set `ALTERTABLE_USERNAME` and `ALTERTABLE_PASSWORD` (or the
141
- `ALTERTABLE_LAKEHOUSE_` names) to query `https://api.altertable.ai`, or another lakehouse
142
- with `ALTERTABLE_API_BASE`. A CLI proxy (`ALTERTABLE_DATA_PROXY_URL`) takes precedence.
143
- Each command prints the lakehouse it targets on startup.
144
-
145
- Open the **Widgets** tab (`/gallery?view=widgets`) for one ready example of each
146
- composable data display inside `<VisualizationWidget>`. The other tabs cover
147
- composed apps, variants, and request states.
148
-
149
- Use Conventional Commits and describe behavior changes and verification in PRs.
150
- Flag breaking API changes. Release Please owns `CHANGELOG.md`; see
151
- [Releasing](https://github.com/altertable-ai/data-app/blob/main/.github/RELEASING.md) for release setup and recovery.
152
-
153
- ## Focused public API
154
-
155
- Keep exports and options focused on concrete app needs. Prefer defaults and
156
- derivation from existing state over new knobs; keep implementation details private.
157
-
158
- For public changes, update the relevant guide, migrate callers and starters,
159
- and verify published usage. Flag breaking changes in commits and PRs.
160
-
161
- Docs help agents generate data apps: show current usage and focused examples.
162
- Keep package architecture and contributor rules here. Document author decisions
163
- and minimal composition examples; leave automatic interaction mechanics and prop
164
- 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.
165
68
 
166
69
  ## UI platform principles
167
70
 
168
- Design defaults that let agents build useful data apps with minimal configuration:
169
-
170
- - Express user intent through small typed props and explicit ownership.
171
- - Derive values from the displayed source rather than asking authors to repeat them.
172
- - Configure only semantics that cannot be inferred reliably, such as which filters affect a dataset.
173
- - Keep data structures simple, data flow direct, and names specific to their purpose.
174
- - Compose existing primitives; remove unnecessary wrappers and intermediate state.
175
- - Let components own loading, keyboard behavior, focus recovery, and responsive layout.
176
- - Document the default path with one short authoring example; keep constraints in TypeScript and JSDoc.
177
- - Verify public behavior across loading, empty, updating, and ready states.
178
-
179
- ## Component CSS
180
-
181
- Keep defaults in authored CSS: inherited values in `tokens.css`, presets in
182
- `appearance.css`, and optional overrides in native `var()` fallbacks at use sites.
183
- Use the four layers (`atbl.tokens`, `atbl.base`, `atbl.components`,
184
- `atbl.interaction`) and shared focus/state rules rather than duplicate control
185
- paint. Keep geometry local. Document public variables beside declarations or
186
- 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
+ ## Preview UI changes
87
+
88
+ Use `bun run dev` for the gallery at `http://127.0.0.1:27418/gallery` and
89
+ `/playground`; it requires Docker. Package and fixture edits reload. Restart after
90
+ changing `dev/server.ts`; add `?delay=2000` to inspect loading states.
91
+
92
+ Use `bun run dev:file <path>` for a single-file app or `bun run dev:dir <path>`
93
+ for an app directory with `src/server.ts`. These previews use built packages and
94
+ a real lakehouse: configure server-only `ALTERTABLE_LAKEHOUSE_USERNAME` and
95
+ `ALTERTABLE_LAKEHOUSE_PASSWORD`, or the CLI proxy's `ALTERTABLE_DATA_PROXY_URL`
96
+ and `ALTERTABLE_DATA_PROXY_TOKEN`. Use `ALTERTABLE_API_BASE` for another endpoint.
97
+
98
+ ## Packaging and releases
99
+
100
+ For packaging changes, run `bun run check:package` after building to test packed
101
+ consumers, and `bun run check:starter` for starter changes. Packages share one
102
+ version; `scripts/packages.ts` defines publication order.
103
+
104
+ Release Please owns `CHANGELOG.md`. Read
105
+ [Releasing](https://github.com/altertable-ai/data-app/blob/main/.github/RELEASING.md)
106
+ 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,8 +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). Guides, starters, and
34
- [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.
35
35
 
36
36
  ## License
37
37