@altertable/data-app 0.72.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.
- package/AGENTS.md +5 -61
- package/CONTRIBUTING.md +93 -180
- package/README.md +3 -4
- package/REFERENCE.md +30 -345
- package/dist/chunks/contract-BeLPJwlO.js +558 -0
- package/dist/chunks/contract-BeLPJwlO.js.map +1 -0
- package/dist/chunks/contract-Di8SP74I.js +462 -0
- package/dist/chunks/contract-Di8SP74I.js.map +1 -0
- package/dist/chunks/format-BdFlv_xa.js +148 -0
- package/dist/chunks/format-BdFlv_xa.js.map +1 -0
- package/dist/chunks/iframe-C3uCZEXh.js +809 -0
- package/dist/chunks/iframe-C3uCZEXh.js.map +1 -0
- package/dist/chunks/operation-CBxhjNhK.js +131 -0
- package/dist/chunks/operation-CBxhjNhK.js.map +1 -0
- package/dist/chunks/request-body-H1qPmmTN.js +50 -0
- package/dist/chunks/request-body-H1qPmmTN.js.map +1 -0
- package/dist/client/index.js +253 -285
- package/dist/client/index.js.map +1 -13
- package/dist/core/appearance.js +171 -162
- package/dist/core/appearance.js.map +1 -10
- package/dist/core/config.js +49 -11
- package/dist/core/config.js.map +1 -9
- package/dist/core/contract.js +3 -73
- package/dist/core/format.js +1 -26
- package/dist/index.js +1 -12
- package/dist/internal.js +352 -397
- package/dist/internal.js.map +1 -15
- package/dist/server/index.js +85 -97
- package/dist/server/index.js.map +1 -10
- package/dist/types/chunks/appearance.d.ts +45 -0
- package/dist/types/chunks/contract.d.ts +720 -0
- package/dist/types/chunks/index.d.ts +189 -0
- package/dist/types/client/index.d.ts +3 -13
- package/dist/types/core/appearance.d.ts +2 -42
- package/dist/types/core/config.d.ts +36 -39
- package/dist/types/core/contract.d.ts +2 -114
- package/dist/types/core/format.d.ts +44 -17
- package/dist/types/index.d.ts +3 -3
- package/dist/types/internal.d.ts +312 -22
- package/dist/types/server/index.d.ts +15 -4
- package/docs/app-authoring.md +72 -128
- package/docs/client.md +29 -63
- package/docs/composition.md +44 -75
- package/docs/contract.md +60 -100
- package/docs/data-context.md +35 -61
- package/docs/embed.md +83 -55
- package/docs/formatting-and-appearance.md +17 -38
- package/docs/hosted-apps.md +7 -14
- package/docs/layout.md +30 -47
- package/docs/local-data-apps.md +7 -7
- package/docs/react-embed.md +20 -26
- package/docs/react.md +10 -27
- package/docs/server-bun.md +2 -27
- package/docs/server.md +6 -12
- package/docs/stories-and-export.md +38 -40
- package/docs/styling.md +14 -22
- package/docs/ui-quality.md +5 -5
- package/docs/ui.md +68 -70
- package/docs/variables.md +142 -254
- package/docs/views.md +85 -116
- package/docs/widgets.md +100 -153
- package/docs/worker.md +15 -27
- package/package.json +3 -2
- package/dist/chunks/index-5a27erdg.js +0 -54
- package/dist/chunks/index-5a27erdg.js.map +0 -10
- package/dist/chunks/index-9yxr7nmm.js +0 -742
- package/dist/chunks/index-9yxr7nmm.js.map +0 -17
- package/dist/chunks/index-j5q5n3ra.js +0 -151
- package/dist/chunks/index-j5q5n3ra.js.map +0 -10
- package/dist/chunks/index-q75zm3a7.js +0 -153
- package/dist/chunks/index-q75zm3a7.js.map +0 -11
- package/dist/chunks/index-vhaec7m5.js +0 -30
- package/dist/chunks/index-vhaec7m5.js.map +0 -10
- package/dist/chunks/index-zp78caex.js +0 -1047
- package/dist/chunks/index-zp78caex.js.map +0 -19
- package/dist/core/contract.js.map +0 -9
- package/dist/core/format.js.map +0 -9
- package/dist/index.js.map +0 -9
- package/dist/types/client/annotations.d.ts +0 -27
- package/dist/types/client/data-client.d.ts +0 -43
- package/dist/types/client/download.d.ts +0 -5
- package/dist/types/client/iframe.d.ts +0 -59
- package/dist/types/client/location.d.ts +0 -13
- package/dist/types/client/logger.d.ts +0 -14
- package/dist/types/client/messages.d.ts +0 -7
- package/dist/types/client/navigation.d.ts +0 -15
- package/dist/types/client/transport.d.ts +0 -15
- package/dist/types/core/annotations.d.ts +0 -99
- package/dist/types/core/bridge-endpoint.d.ts +0 -21
- package/dist/types/core/bridge.d.ts +0 -172
- package/dist/types/core/data-view.d.ts +0 -46
- package/dist/types/core/date-format.d.ts +0 -24
- package/dist/types/core/date-range.d.ts +0 -20
- package/dist/types/core/dimension-source.d.ts +0 -64
- package/dist/types/core/dimension.d.ts +0 -71
- package/dist/types/core/facets.d.ts +0 -13
- package/dist/types/core/filters.d.ts +0 -45
- package/dist/types/core/invariant.d.ts +0 -2
- package/dist/types/core/keys.d.ts +0 -2
- package/dist/types/core/logger.d.ts +0 -12
- package/dist/types/core/messages.d.ts +0 -62
- package/dist/types/core/navigation.d.ts +0 -11
- package/dist/types/core/operation-types.d.ts +0 -80
- package/dist/types/core/operation.d.ts +0 -20
- package/dist/types/core/presentation.d.ts +0 -9
- package/dist/types/core/queries.d.ts +0 -84
- package/dist/types/core/reading.d.ts +0 -17
- package/dist/types/core/uuid.d.ts +0 -2
- package/dist/types/core/variables.d.ts +0 -133
- package/dist/types/server/handler.d.ts +0 -13
- package/dist/types/server/request-body.d.ts +0 -4
package/AGENTS.md
CHANGED
|
@@ -1,63 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Build Altertable data apps
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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,106 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
Use the
|
|
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
|
|
14
|
-
|
|
|
15
|
-
| Static
|
|
16
|
-
| Operations
|
|
17
|
-
| Browser clients and navigation
|
|
18
|
-
|
|
|
19
|
-
| Iframe hosting and bootstrap
|
|
20
|
-
| React bindings and UI
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
| Build
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
-
|
|
179
|
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
|
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).
|
|
34
|
-
[
|
|
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
|
|