@altertable/data-app 0.70.0 → 0.72.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 +7 -1
- package/CONTRIBUTING.md +73 -33
- package/README.md +23 -26
- package/REFERENCE.md +1904 -0
- package/dist/chunks/index-5a27erdg.js +54 -0
- package/dist/chunks/index-5a27erdg.js.map +10 -0
- package/dist/chunks/{index-58kks6a8.js → index-9yxr7nmm.js} +330 -21
- package/dist/chunks/index-9yxr7nmm.js.map +17 -0
- package/dist/chunks/{index-wjt6cavj.js → index-j5q5n3ra.js} +5 -5
- package/dist/chunks/index-j5q5n3ra.js.map +10 -0
- package/dist/chunks/{index-22d576sn.js → index-q75zm3a7.js} +3 -3
- package/dist/chunks/{index-22d576sn.js.map → index-q75zm3a7.js.map} +3 -3
- package/dist/chunks/{index-9zqbrv2z.js → index-vhaec7m5.js} +4 -6
- package/dist/chunks/index-vhaec7m5.js.map +10 -0
- package/dist/chunks/{index-q1w84fv9.js → index-zp78caex.js} +345 -84
- package/dist/chunks/index-zp78caex.js.map +19 -0
- package/dist/client/index.js +284 -16
- package/dist/client/index.js.map +7 -3
- package/dist/core/appearance.js +181 -11
- package/dist/core/appearance.js.map +4 -3
- package/dist/core/config.js +3 -3
- package/dist/core/contract.js +10 -12
- package/dist/core/contract.js.map +1 -1
- package/dist/core/format.js +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/internal.js +418 -0
- package/dist/internal.js.map +15 -0
- package/dist/server/index.js +102 -0
- package/dist/server/index.js.map +10 -0
- package/dist/types/client/annotations.d.ts +1 -1
- package/dist/types/client/iframe.d.ts +6 -6
- package/dist/types/client/index.d.ts +3 -4
- package/dist/types/client/location.d.ts +2 -2
- package/dist/types/client/logger.d.ts +1 -1
- package/dist/types/client/navigation.d.ts +1 -1
- package/dist/types/client/transport.d.ts +1 -1
- package/dist/types/core/bridge.d.ts +1 -1
- package/dist/types/core/config.d.ts +8 -9
- package/dist/types/core/filters.d.ts +1 -1
- package/dist/types/core/format.d.ts +1 -2
- package/dist/types/core/messages.d.ts +3 -3
- package/dist/types/core/operation-types.d.ts +1 -1
- package/dist/types/core/presentation.d.ts +1 -1
- package/dist/types/core/reading.d.ts +1 -1
- package/dist/types/internal.d.ts +22 -0
- package/dist/types/server/index.d.ts +1 -2
- package/docs/app-authoring.md +18 -1
- package/docs/client.md +1 -1
- package/docs/contract.md +1 -1
- package/docs/data-context.md +3 -3
- package/docs/embed.md +4 -4
- package/docs/formatting-and-appearance.md +1 -1
- package/docs/hosted-apps.md +16 -8
- package/docs/local-data-apps.md +1 -1
- package/docs/react-embed.md +7 -6
- package/docs/react.md +6 -6
- package/docs/server-bun.md +6 -6
- package/docs/stories-and-export.md +3 -3
- package/docs/styling.md +2 -2
- package/docs/ui.md +6 -6
- package/docs/views.md +2 -2
- package/docs/widgets.md +4 -4
- package/docs/worker.md +4 -4
- package/package.json +15 -92
- package/THIRD_PARTY_NOTICES +0 -18
- package/dist/chunks/index-2ajhmsc4.js +0 -355
- package/dist/chunks/index-2ajhmsc4.js.map +0 -13
- package/dist/chunks/index-58kks6a8.js.map +0 -13
- package/dist/chunks/index-7q99hf1z.js +0 -87
- package/dist/chunks/index-7q99hf1z.js.map +0 -10
- package/dist/chunks/index-9zqbrv2z.js.map +0 -10
- package/dist/chunks/index-cv36cyna.js +0 -180
- package/dist/chunks/index-cv36cyna.js.map +0 -10
- package/dist/chunks/index-q1w84fv9.js.map +0 -15
- package/dist/chunks/index-rew95tbg.js +0 -272
- package/dist/chunks/index-rew95tbg.js.map +0 -13
- package/dist/chunks/index-vtpygsbq.js +0 -17270
- package/dist/chunks/index-vtpygsbq.js.map +0 -126
- package/dist/chunks/index-wjt6cavj.js.map +0 -10
- package/dist/chunks/index-wss3gd3h.js +0 -319
- package/dist/chunks/index-wss3gd3h.js.map +0 -13
- package/dist/chunks/index-xzb7sx6g.js +0 -221
- package/dist/chunks/index-xzb7sx6g.js.map +0 -12
- package/dist/embed/index.js +0 -138
- package/dist/embed/index.js.map +0 -12
- package/dist/local.js +0 -465
- package/dist/local.js.map +0 -16
- package/dist/preview.js +0 -1456
- package/dist/preview.js.map +0 -17
- package/dist/react/embed/index.js +0 -117
- package/dist/react/embed/index.js.map +0 -10
- package/dist/react/index.js +0 -2890
- package/dist/react/index.js.map +0 -23
- package/dist/react/ui/index.js +0 -3514
- package/dist/react/ui/index.js.map +0 -36
- package/dist/server.js +0 -334
- package/dist/server.js.map +0 -15
- package/dist/types/core/time-interval.d.ts +0 -96
- package/dist/types/embed/bootstrap.d.ts +0 -5
- package/dist/types/embed/bridge.d.ts +0 -12
- package/dist/types/embed/host.d.ts +0 -36
- package/dist/types/embed/index.d.ts +0 -14
- package/dist/types/embed/navigation.d.ts +0 -6
- package/dist/types/embed/runtime-html.d.ts +0 -2
- package/dist/types/embed/source.d.ts +0 -16
- package/dist/types/embed/sql.d.ts +0 -4
- package/dist/types/react/actions.d.ts +0 -53
- package/dist/types/react/annotations/AnnotationBar.d.ts +0 -30
- package/dist/types/react/annotations/AnnotationControls.d.ts +0 -10
- package/dist/types/react/annotations/AnnotationEditor.d.ts +0 -16
- package/dist/types/react/annotations/AnnotationMarkers.d.ts +0 -19
- package/dist/types/react/annotations/AnnotationSelectionLayer.d.ts +0 -12
- package/dist/types/react/annotations/AnnotationTarget.d.ts +0 -9
- package/dist/types/react/annotations/AnnotationTooltip.d.ts +0 -9
- package/dist/types/react/annotations/AnnotationTrigger.d.ts +0 -10
- package/dist/types/react/annotations/annotation-editor-state.d.ts +0 -58
- package/dist/types/react/annotations/annotation-screenshot.d.ts +0 -4
- package/dist/types/react/annotations/annotation-targets.d.ts +0 -34
- package/dist/types/react/annotations/getAnnotationProps.d.ts +0 -17
- package/dist/types/react/annotations/styles.d.ts +0 -3
- package/dist/types/react/annotations/useAnnotationGeometry.d.ts +0 -22
- package/dist/types/react/annotations/useDataAppAnnotations.d.ts +0 -22
- package/dist/types/react/app-context.d.ts +0 -3
- package/dist/types/react/bindings.d.ts +0 -169
- package/dist/types/react/content.d.ts +0 -36
- package/dist/types/react/date-formatting.d.ts +0 -12
- package/dist/types/react/details.d.ts +0 -46
- package/dist/types/react/embed/bridge.d.ts +0 -21
- package/dist/types/react/embed/index.d.ts +0 -7
- package/dist/types/react/exploration.d.ts +0 -44
- package/dist/types/react/hooks.d.ts +0 -113
- package/dist/types/react/index.d.ts +0 -78
- package/dist/types/react/injectStyles.d.ts +0 -7
- package/dist/types/react/mount.d.ts +0 -13
- package/dist/types/react/search-suggestions.d.ts +0 -8
- package/dist/types/react/source-owner.d.ts +0 -2
- package/dist/types/react/style-contract.d.ts +0 -88
- package/dist/types/react/style-validation.d.ts +0 -2
- package/dist/types/react/styles.d.ts +0 -8
- package/dist/types/react/ui/AboutData.d.ts +0 -73
- package/dist/types/react/ui/AltertableLogo.d.ts +0 -3
- package/dist/types/react/ui/AppFooter.d.ts +0 -6
- package/dist/types/react/ui/AppHeader.d.ts +0 -10
- package/dist/types/react/ui/AppLayout.d.ts +0 -10
- package/dist/types/react/ui/AppScope.d.ts +0 -7
- package/dist/types/react/ui/AppToolbar.d.ts +0 -30
- package/dist/types/react/ui/AreaChart.d.ts +0 -7
- package/dist/types/react/ui/BarChart.d.ts +0 -6
- package/dist/types/react/ui/Breakdown.d.ts +0 -13
- package/dist/types/react/ui/Button.d.ts +0 -12
- package/dist/types/react/ui/ChartLegend.d.ts +0 -32
- package/dist/types/react/ui/Checkbox.d.ts +0 -21
- package/dist/types/react/ui/CheckboxGroup.d.ts +0 -7
- package/dist/types/react/ui/ChoicePicker.d.ts +0 -39
- package/dist/types/react/ui/Comparison.d.ts +0 -14
- package/dist/types/react/ui/ComposedChart.d.ts +0 -41
- package/dist/types/react/ui/ComposedChartLegend.d.ts +0 -9
- package/dist/types/react/ui/ContentSkeleton.d.ts +0 -7
- package/dist/types/react/ui/DataApp.d.ts +0 -24
- package/dist/types/react/ui/DataAppFrame.d.ts +0 -52
- package/dist/types/react/ui/DataBoundary.d.ts +0 -14
- package/dist/types/react/ui/DataSection.d.ts +0 -14
- package/dist/types/react/ui/DataSectionBoundary.d.ts +0 -30
- package/dist/types/react/ui/DataTable.d.ts +0 -29
- package/dist/types/react/ui/DataValue.d.ts +0 -9
- package/dist/types/react/ui/DataViewToast.d.ts +0 -11
- package/dist/types/react/ui/DataWidget.d.ts +0 -37
- package/dist/types/react/ui/DateDisplay.d.ts +0 -9
- package/dist/types/react/ui/DateRangePicker.d.ts +0 -30
- package/dist/types/react/ui/DateTimeTooltip.d.ts +0 -10
- package/dist/types/react/ui/DimensionPicker.d.ts +0 -13
- package/dist/types/react/ui/EmptyState.d.ts +0 -6
- package/dist/types/react/ui/ExplorationActionControl.d.ts +0 -60
- package/dist/types/react/ui/ExportControl.d.ts +0 -4
- package/dist/types/react/ui/FilterActions.d.ts +0 -10
- package/dist/types/react/ui/FilterBar.d.ts +0 -3
- package/dist/types/react/ui/FunnelChart.d.ts +0 -20
- package/dist/types/react/ui/GettingStarted.d.ts +0 -6
- package/dist/types/react/ui/GlossaryDefinition.d.ts +0 -7
- package/dist/types/react/ui/GlossaryExplanation.d.ts +0 -16
- package/dist/types/react/ui/GradientScroll.d.ts +0 -23
- package/dist/types/react/ui/Grid.d.ts +0 -12
- package/dist/types/react/ui/GridItem.d.ts +0 -7
- package/dist/types/react/ui/HelpPopover.d.ts +0 -21
- package/dist/types/react/ui/IconButton.d.ts +0 -19
- package/dist/types/react/ui/InspectionContext.d.ts +0 -12
- package/dist/types/react/ui/InspectionProvider.d.ts +0 -29
- package/dist/types/react/ui/JourneyChart.d.ts +0 -10
- package/dist/types/react/ui/Kbd.d.ts +0 -7
- package/dist/types/react/ui/LineChart.d.ts +0 -7
- package/dist/types/react/ui/LiveControl.d.ts +0 -10
- package/dist/types/react/ui/Menu.d.ts +0 -13
- package/dist/types/react/ui/MetricWidget.d.ts +0 -51
- package/dist/types/react/ui/NumberField.d.ts +0 -27
- package/dist/types/react/ui/NumberFilterPicker.d.ts +0 -11
- package/dist/types/react/ui/PeriodSummary.d.ts +0 -17
- package/dist/types/react/ui/PickerField.d.ts +0 -23
- package/dist/types/react/ui/PieChart.d.ts +0 -11
- package/dist/types/react/ui/PopoverSurface.d.ts +0 -5
- package/dist/types/react/ui/PresentStory.d.ts +0 -30
- package/dist/types/react/ui/QueryList.d.ts +0 -14
- package/dist/types/react/ui/RadioGroup.d.ts +0 -18
- package/dist/types/react/ui/Ranking.d.ts +0 -13
- package/dist/types/react/ui/RefreshControl.d.ts +0 -9
- package/dist/types/react/ui/RequestHint.d.ts +0 -20
- package/dist/types/react/ui/RetentionChart.d.ts +0 -27
- package/dist/types/react/ui/ScatterChart.d.ts +0 -17
- package/dist/types/react/ui/SearchField.d.ts +0 -23
- package/dist/types/react/ui/SearchInput.d.ts +0 -10
- package/dist/types/react/ui/SearchMatch.d.ts +0 -6
- package/dist/types/react/ui/SearchTypeahead.d.ts +0 -15
- package/dist/types/react/ui/SectionHeading.d.ts +0 -8
- package/dist/types/react/ui/Select.d.ts +0 -22
- package/dist/types/react/ui/SelectionMark.d.ts +0 -5
- package/dist/types/react/ui/Sheet.d.ts +0 -21
- package/dist/types/react/ui/Skeleton.d.ts +0 -8
- package/dist/types/react/ui/Stack.d.ts +0 -7
- package/dist/types/react/ui/StaticDataApp.d.ts +0 -4
- package/dist/types/react/ui/StatusPanel.d.ts +0 -10
- package/dist/types/react/ui/TableWidget.d.ts +0 -67
- package/dist/types/react/ui/Tabs.d.ts +0 -10
- package/dist/types/react/ui/TextContent.d.ts +0 -4
- package/dist/types/react/ui/TextWidget.d.ts +0 -20
- package/dist/types/react/ui/ThemeSelector.d.ts +0 -12
- package/dist/types/react/ui/Toast.d.ts +0 -8
- package/dist/types/react/ui/Tooltip.d.ts +0 -23
- package/dist/types/react/ui/TooltipSurface.d.ts +0 -3
- package/dist/types/react/ui/TrendChart.d.ts +0 -5
- package/dist/types/react/ui/UpdatedAt.d.ts +0 -9
- package/dist/types/react/ui/VariableBar.d.ts +0 -6
- package/dist/types/react/ui/VisualizationWidget.d.ts +0 -43
- package/dist/types/react/ui/WidgetDisclosure.d.ts +0 -6
- package/dist/types/react/ui/WidgetEvidence.d.ts +0 -12
- package/dist/types/react/ui/WidgetViewTabs.d.ts +0 -16
- package/dist/types/react/ui/chart-data.d.ts +0 -36
- package/dist/types/react/ui/chart-date-axis.d.ts +0 -15
- package/dist/types/react/ui/chart-interaction.d.ts +0 -27
- package/dist/types/react/ui/chart-primitives.d.ts +0 -22
- package/dist/types/react/ui/chart-time.d.ts +0 -19
- package/dist/types/react/ui/chartColor.d.ts +0 -2
- package/dist/types/react/ui/classNames.d.ts +0 -1
- package/dist/types/react/ui/csv-export.d.ts +0 -19
- package/dist/types/react/ui/data-context.d.ts +0 -76
- package/dist/types/react/ui/data-identifiers.d.ts +0 -32
- package/dist/types/react/ui/icons.d.ts +0 -49
- package/dist/types/react/ui/index.d.ts +0 -111
- package/dist/types/react/ui/journey-flow.d.ts +0 -49
- package/dist/types/react/ui/keyboard.d.ts +0 -6
- package/dist/types/react/ui/metric-comparison.d.ts +0 -30
- package/dist/types/react/ui/metric.d.ts +0 -11
- package/dist/types/react/ui/presentation.d.ts +0 -25
- package/dist/types/react/ui/search.d.ts +0 -6
- package/dist/types/react/ui/searchItems.d.ts +0 -36
- package/dist/types/react/ui/shortcuts.d.ts +0 -45
- package/dist/types/react/ui/story.d.ts +0 -20
- package/dist/types/react/ui/use-chart-scroll-to-end.d.ts +0 -2
- package/dist/types/react/ui/useAppAppearance.d.ts +0 -3
- package/dist/types/react/ui/useDataAppPresentation.d.ts +0 -3
- package/dist/types/react/ui/useSvgId.d.ts +0 -2
- package/dist/types/react/ui/variables.d.ts +0 -38
- package/dist/types/react/ui/widget-views.d.ts +0 -3
- package/dist/types/react/view-control-bar.d.ts +0 -18
- package/dist/types/react/view-controls.d.ts +0 -20
- package/dist/types/react/view-runtime.d.ts +0 -34
- package/dist/types/react/view.d.ts +0 -87
- package/dist/types/react/widgets.d.ts +0 -90
- package/dist/types/server/local.d.ts +0 -19
- package/dist/types/server/preview/host.d.ts +0 -1
- package/dist/types/server/preview/index.d.ts +0 -16
- package/dist/types/server/reload-channel.d.ts +0 -6
- package/dist/worker.js +0 -106
- package/examples/starter-data-app/index.tsx +0 -193
- package/examples/starter-local-data-app/.bun-version +0 -1
- package/examples/starter-local-data-app/.node-version +0 -1
- package/examples/starter-local-data-app/.oxfmtrc.json +0 -4
- package/examples/starter-local-data-app/.oxlintrc.json +0 -33
- package/examples/starter-local-data-app/AGENTS.md +0 -22
- package/examples/starter-local-data-app/README.md +0 -54
- package/examples/starter-local-data-app/app.ts +0 -28
- package/examples/starter-local-data-app/bunfig.toml +0 -2
- package/examples/starter-local-data-app/package.json +0 -33
- package/examples/starter-local-data-app/src/App.tsx +0 -8
- package/examples/starter-local-data-app/src/assets.d.ts +0 -1
- package/examples/starter-local-data-app/src/data-context.ts +0 -21
- package/examples/starter-local-data-app/src/favicon.svg +0 -13
- package/examples/starter-local-data-app/src/index.html +0 -14
- package/examples/starter-local-data-app/src/main.tsx +0 -7
- package/examples/starter-local-data-app/src/operations.ts +0 -6
- package/examples/starter-local-data-app/src/server.ts +0 -6
- package/examples/starter-local-data-app/tsconfig.json +0 -21
package/AGENTS.md
CHANGED
|
@@ -9,6 +9,11 @@ both derived from the displayed result. Setup and static screens may omit them.
|
|
|
9
9
|
Follow [app authoring](docs/app-authoring.md) for the shared workflow, the data app
|
|
10
10
|
and local data app paths, and task-specific documentation.
|
|
11
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
|
+
|
|
12
17
|
## Styling
|
|
13
18
|
|
|
14
19
|
Use components and typed props first; customize through app-owned `className`
|
|
@@ -43,8 +48,9 @@ Read the matching guide before generating an app. Package contributors follow
|
|
|
43
48
|
| Define sources and evidence | [Data context](docs/data-context.md) |
|
|
44
49
|
| Present findings and export results | [Stories and export](docs/stories-and-export.md) |
|
|
45
50
|
| Format values and appearance | [Formatting and appearance](docs/formatting-and-appearance.md) |
|
|
51
|
+
| Look up props, signatures, and types | [API reference](REFERENCE.md) |
|
|
46
52
|
|
|
47
|
-
Use
|
|
53
|
+
Use `@altertable/data-app-react` with declared views and bound widgets. `@altertable/data-app-react/ui` is for setup,
|
|
48
54
|
static displays, and deliberately custom UI; see [direct composition](docs/ui.md).
|
|
49
55
|
Prefer derivation over repeated configuration. Keep static context outside loading boundaries. Derive labels, findings, and
|
|
50
56
|
exports from the displayed result and its input. Edit app-owned files; installed
|
package/CONTRIBUTING.md
CHANGED
|
@@ -10,36 +10,66 @@ bun run check
|
|
|
10
10
|
|
|
11
11
|
## Find the code
|
|
12
12
|
|
|
13
|
-
| Task | Location
|
|
14
|
-
| --------------------------------------- |
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
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` |
|
|
23
24
|
|
|
24
25
|
Keep browser entries free of server implementations and credentials. Core,
|
|
25
26
|
client, server, and embed remain independent of React. Implementations import
|
|
26
27
|
focused modules; public entry points declare the supported exports explicitly.
|
|
27
28
|
Keep style injection explicit; importing React must not modify the DOM. Add new
|
|
28
|
-
styles to `
|
|
29
|
-
|
|
30
|
-
Use
|
|
31
|
-
|
|
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
|
|
32
39
|
style fixes.
|
|
33
40
|
|
|
34
41
|
Compose the gallery from provided components, including layouts. Let primitives
|
|
35
42
|
own sizing, spacing, and responsive behavior. Report missing primitives and keep
|
|
36
43
|
fallbacks minimal.
|
|
37
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
|
+
|
|
38
68
|
## Verify changes
|
|
39
69
|
|
|
40
70
|
Write high-level public API tests with Vitest in `tests/public-api`. Define an
|
|
41
71
|
operation, authorize and query it, compose a view, or embed an app through
|
|
42
|
-
|
|
72
|
+
the published package exports. Assert consumer-visible results and errors. Supply
|
|
43
73
|
data and failures through public dependency injection; do not import private
|
|
44
74
|
source, fabricate internal state, or assert implementation details. Prefer queries by role and accessible name, or by label for form fields. Scope
|
|
45
75
|
content assertions to the relevant region, status, alert, or dialog; use text
|
|
@@ -57,26 +87,36 @@ Update the relevant guide when changing public behavior. In documentation prose,
|
|
|
57
87
|
write functions as `functionName()` and components as `<ComponentName>`. Keep JSDoc for
|
|
58
88
|
constraints, ownership, units, and runtime boundaries; leave implementation
|
|
59
89
|
explanations in the code. App instructions belong in the consuming app's
|
|
60
|
-
`AGENTS.md`; see the [local starter](https://github.com/altertable-ai/data-app/tree/main/examples/starter-local-data-app)
|
|
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)
|
|
61
91
|
and [hosted authoring](docs/hosted-apps.md).
|
|
62
92
|
|
|
63
93
|
`bun run check` builds first and runs all required source, Markdown, local link, package, and starter
|
|
64
94
|
checks. Build before running consumer tests individually.
|
|
65
95
|
|
|
66
|
-
| Command | Purpose
|
|
67
|
-
| ------------------------------ |
|
|
68
|
-
| `bun run build` | Build JavaScript, declarations,
|
|
69
|
-
| `bun run check:
|
|
70
|
-
| `bun run
|
|
71
|
-
| `bun run
|
|
72
|
-
| `bun run lint
|
|
73
|
-
| `bun run
|
|
74
|
-
| `bun run check:links
|
|
75
|
-
| `bun run
|
|
76
|
-
| `bun run
|
|
77
|
-
| `bun run
|
|
78
|
-
| `bun run check:
|
|
79
|
-
| `bun run check:
|
|
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.
|
|
80
120
|
|
|
81
121
|
Markdown checks cover all authored `.md` files, including `AGENTS.md` and the
|
|
82
122
|
starter docs. Oxfmt owns formatting. Release Please owns `CHANGELOG.md`, so
|
|
@@ -90,7 +130,7 @@ rate limits can cause failures unrelated to a change.
|
|
|
90
130
|
|
|
91
131
|
Run `bun run dev` to preview UI examples at `http://127.0.0.1:27418/gallery`
|
|
92
132
|
and a playground at `/playground` (`dev/playground.tsx`, querying the demo
|
|
93
|
-
tables from `dev/seed.ts` that `scripts/dev.ts` seeds). It builds once, then rebuilds `dist` when
|
|
133
|
+
tables from `dev/seed.ts` that `scripts/dev.ts` seeds). It builds once, then rebuilds `dist` when package source
|
|
94
134
|
changes; open pages reload on package, fixture, and playground edits. Restart it after changing
|
|
95
135
|
`dev/server.ts`; rerun `bun run build` to refresh declarations. Add `?delay=2000` to a host page URL
|
|
96
136
|
to delay its SQL responses and inspect loading states. It needs Docker: SQL runs
|
|
@@ -99,9 +139,9 @@ against a mocked Altertable API
|
|
|
99
139
|
started with Testcontainers and stopped on exit. Public API tests use their own deterministic consumer fixtures.
|
|
100
140
|
|
|
101
141
|
Run `bun run dev:file <path>` to preview a single-file data app such as
|
|
102
|
-
`examples/starter-data-app/index.tsx` from anywhere on disk, or `bun run dev:dir <path>`
|
|
142
|
+
`packages/data-app-examples/templates/starter-data-app/index.tsx` from anywhere on disk, or `bun run dev:dir <path>`
|
|
103
143
|
for a local data app directory with `src/server.ts`. Both resolve `@altertable/data-app`
|
|
104
|
-
and React from this checkout's
|
|
144
|
+
and React from this checkout's package builds, so the app needs no install. Run `bun run build`
|
|
105
145
|
after package changes. File previews replace the app iframe on edits and preserve
|
|
106
146
|
URL filters. Directory previews restart the app server when its imports change.
|
|
107
147
|
Unlike `bun run dev`, neither uses the mocked API: set `ALTERTABLE_USERNAME` and `ALTERTABLE_PASSWORD` (or the
|
package/README.md
CHANGED
|
@@ -1,41 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @altertable/data-app
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Portable definitions, contracts, formatting, browser clients, and request handlers
|
|
4
|
+
for Altertable data apps.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
A TypeScript and React toolkit with APIs, components, and authoring guides for
|
|
8
|
-
developers and AI agents to build data apps powered by Altertable.
|
|
9
|
-
|
|
10
|
-
A data app combines interactive exploration with explanations and findings,
|
|
11
|
-
helping users answer questions with data. Compose filters, charts, tables, and
|
|
12
|
-
narrative, then let users present findings and export results.
|
|
13
|
-
|
|
14
|
-
## Install
|
|
6
|
+
## Installation
|
|
15
7
|
|
|
16
8
|
```fish
|
|
17
|
-
npm install @altertable/data-app
|
|
18
|
-
# or
|
|
19
|
-
pnpm add @altertable/data-app
|
|
20
|
-
# or
|
|
21
9
|
bun add @altertable/data-app
|
|
22
10
|
```
|
|
23
11
|
|
|
24
|
-
##
|
|
12
|
+
## Usage
|
|
25
13
|
|
|
26
|
-
|
|
27
|
-
MCP Apps through a host integration, or run locally in a browser.
|
|
14
|
+
Declare an app's identity and query registry:
|
|
28
15
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
```ts
|
|
17
|
+
import { defineDataApp } from '@altertable/data-app';
|
|
18
|
+
|
|
19
|
+
const app = defineDataApp({
|
|
20
|
+
title: 'Activity',
|
|
21
|
+
description: 'Explore activity across your organization.',
|
|
22
|
+
scope: { organization: 'demo', environment: 'production' },
|
|
23
|
+
queries: {},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
33
26
|
|
|
34
|
-
|
|
27
|
+
Use `/contract` for operations and validation, `/client` for browser requests,
|
|
28
|
+
and `/server` for request handling. Add `@altertable/data-app-react` to build app
|
|
29
|
+
UI or `@altertable/data-app-embed` to host an app. This package requires no React.
|
|
35
30
|
|
|
36
|
-
##
|
|
31
|
+
## Documentation
|
|
37
32
|
|
|
38
|
-
|
|
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.
|
|
39
36
|
|
|
40
37
|
## License
|
|
41
38
|
|