@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.
Files changed (291) hide show
  1. package/AGENTS.md +7 -1
  2. package/CONTRIBUTING.md +73 -33
  3. package/README.md +23 -26
  4. package/REFERENCE.md +1904 -0
  5. package/dist/chunks/index-5a27erdg.js +54 -0
  6. package/dist/chunks/index-5a27erdg.js.map +10 -0
  7. package/dist/chunks/{index-58kks6a8.js → index-9yxr7nmm.js} +330 -21
  8. package/dist/chunks/index-9yxr7nmm.js.map +17 -0
  9. package/dist/chunks/{index-wjt6cavj.js → index-j5q5n3ra.js} +5 -5
  10. package/dist/chunks/index-j5q5n3ra.js.map +10 -0
  11. package/dist/chunks/{index-22d576sn.js → index-q75zm3a7.js} +3 -3
  12. package/dist/chunks/{index-22d576sn.js.map → index-q75zm3a7.js.map} +3 -3
  13. package/dist/chunks/{index-9zqbrv2z.js → index-vhaec7m5.js} +4 -6
  14. package/dist/chunks/index-vhaec7m5.js.map +10 -0
  15. package/dist/chunks/{index-q1w84fv9.js → index-zp78caex.js} +345 -84
  16. package/dist/chunks/index-zp78caex.js.map +19 -0
  17. package/dist/client/index.js +284 -16
  18. package/dist/client/index.js.map +7 -3
  19. package/dist/core/appearance.js +181 -11
  20. package/dist/core/appearance.js.map +4 -3
  21. package/dist/core/config.js +3 -3
  22. package/dist/core/contract.js +10 -12
  23. package/dist/core/contract.js.map +1 -1
  24. package/dist/core/format.js +1 -1
  25. package/dist/index.js +4 -4
  26. package/dist/index.js.map +1 -1
  27. package/dist/internal.js +418 -0
  28. package/dist/internal.js.map +15 -0
  29. package/dist/server/index.js +102 -0
  30. package/dist/server/index.js.map +10 -0
  31. package/dist/types/client/annotations.d.ts +1 -1
  32. package/dist/types/client/iframe.d.ts +6 -6
  33. package/dist/types/client/index.d.ts +3 -4
  34. package/dist/types/client/location.d.ts +2 -2
  35. package/dist/types/client/logger.d.ts +1 -1
  36. package/dist/types/client/navigation.d.ts +1 -1
  37. package/dist/types/client/transport.d.ts +1 -1
  38. package/dist/types/core/bridge.d.ts +1 -1
  39. package/dist/types/core/config.d.ts +8 -9
  40. package/dist/types/core/filters.d.ts +1 -1
  41. package/dist/types/core/format.d.ts +1 -2
  42. package/dist/types/core/messages.d.ts +3 -3
  43. package/dist/types/core/operation-types.d.ts +1 -1
  44. package/dist/types/core/presentation.d.ts +1 -1
  45. package/dist/types/core/reading.d.ts +1 -1
  46. package/dist/types/internal.d.ts +22 -0
  47. package/dist/types/server/index.d.ts +1 -2
  48. package/docs/app-authoring.md +18 -1
  49. package/docs/client.md +1 -1
  50. package/docs/contract.md +1 -1
  51. package/docs/data-context.md +3 -3
  52. package/docs/embed.md +4 -4
  53. package/docs/formatting-and-appearance.md +1 -1
  54. package/docs/hosted-apps.md +16 -8
  55. package/docs/local-data-apps.md +1 -1
  56. package/docs/react-embed.md +7 -6
  57. package/docs/react.md +6 -6
  58. package/docs/server-bun.md +6 -6
  59. package/docs/stories-and-export.md +3 -3
  60. package/docs/styling.md +2 -2
  61. package/docs/ui.md +6 -6
  62. package/docs/views.md +2 -2
  63. package/docs/widgets.md +4 -4
  64. package/docs/worker.md +4 -4
  65. package/package.json +15 -92
  66. package/THIRD_PARTY_NOTICES +0 -18
  67. package/dist/chunks/index-2ajhmsc4.js +0 -355
  68. package/dist/chunks/index-2ajhmsc4.js.map +0 -13
  69. package/dist/chunks/index-58kks6a8.js.map +0 -13
  70. package/dist/chunks/index-7q99hf1z.js +0 -87
  71. package/dist/chunks/index-7q99hf1z.js.map +0 -10
  72. package/dist/chunks/index-9zqbrv2z.js.map +0 -10
  73. package/dist/chunks/index-cv36cyna.js +0 -180
  74. package/dist/chunks/index-cv36cyna.js.map +0 -10
  75. package/dist/chunks/index-q1w84fv9.js.map +0 -15
  76. package/dist/chunks/index-rew95tbg.js +0 -272
  77. package/dist/chunks/index-rew95tbg.js.map +0 -13
  78. package/dist/chunks/index-vtpygsbq.js +0 -17270
  79. package/dist/chunks/index-vtpygsbq.js.map +0 -126
  80. package/dist/chunks/index-wjt6cavj.js.map +0 -10
  81. package/dist/chunks/index-wss3gd3h.js +0 -319
  82. package/dist/chunks/index-wss3gd3h.js.map +0 -13
  83. package/dist/chunks/index-xzb7sx6g.js +0 -221
  84. package/dist/chunks/index-xzb7sx6g.js.map +0 -12
  85. package/dist/embed/index.js +0 -138
  86. package/dist/embed/index.js.map +0 -12
  87. package/dist/local.js +0 -465
  88. package/dist/local.js.map +0 -16
  89. package/dist/preview.js +0 -1456
  90. package/dist/preview.js.map +0 -17
  91. package/dist/react/embed/index.js +0 -117
  92. package/dist/react/embed/index.js.map +0 -10
  93. package/dist/react/index.js +0 -2890
  94. package/dist/react/index.js.map +0 -23
  95. package/dist/react/ui/index.js +0 -3514
  96. package/dist/react/ui/index.js.map +0 -36
  97. package/dist/server.js +0 -334
  98. package/dist/server.js.map +0 -15
  99. package/dist/types/core/time-interval.d.ts +0 -96
  100. package/dist/types/embed/bootstrap.d.ts +0 -5
  101. package/dist/types/embed/bridge.d.ts +0 -12
  102. package/dist/types/embed/host.d.ts +0 -36
  103. package/dist/types/embed/index.d.ts +0 -14
  104. package/dist/types/embed/navigation.d.ts +0 -6
  105. package/dist/types/embed/runtime-html.d.ts +0 -2
  106. package/dist/types/embed/source.d.ts +0 -16
  107. package/dist/types/embed/sql.d.ts +0 -4
  108. package/dist/types/react/actions.d.ts +0 -53
  109. package/dist/types/react/annotations/AnnotationBar.d.ts +0 -30
  110. package/dist/types/react/annotations/AnnotationControls.d.ts +0 -10
  111. package/dist/types/react/annotations/AnnotationEditor.d.ts +0 -16
  112. package/dist/types/react/annotations/AnnotationMarkers.d.ts +0 -19
  113. package/dist/types/react/annotations/AnnotationSelectionLayer.d.ts +0 -12
  114. package/dist/types/react/annotations/AnnotationTarget.d.ts +0 -9
  115. package/dist/types/react/annotations/AnnotationTooltip.d.ts +0 -9
  116. package/dist/types/react/annotations/AnnotationTrigger.d.ts +0 -10
  117. package/dist/types/react/annotations/annotation-editor-state.d.ts +0 -58
  118. package/dist/types/react/annotations/annotation-screenshot.d.ts +0 -4
  119. package/dist/types/react/annotations/annotation-targets.d.ts +0 -34
  120. package/dist/types/react/annotations/getAnnotationProps.d.ts +0 -17
  121. package/dist/types/react/annotations/styles.d.ts +0 -3
  122. package/dist/types/react/annotations/useAnnotationGeometry.d.ts +0 -22
  123. package/dist/types/react/annotations/useDataAppAnnotations.d.ts +0 -22
  124. package/dist/types/react/app-context.d.ts +0 -3
  125. package/dist/types/react/bindings.d.ts +0 -169
  126. package/dist/types/react/content.d.ts +0 -36
  127. package/dist/types/react/date-formatting.d.ts +0 -12
  128. package/dist/types/react/details.d.ts +0 -46
  129. package/dist/types/react/embed/bridge.d.ts +0 -21
  130. package/dist/types/react/embed/index.d.ts +0 -7
  131. package/dist/types/react/exploration.d.ts +0 -44
  132. package/dist/types/react/hooks.d.ts +0 -113
  133. package/dist/types/react/index.d.ts +0 -78
  134. package/dist/types/react/injectStyles.d.ts +0 -7
  135. package/dist/types/react/mount.d.ts +0 -13
  136. package/dist/types/react/search-suggestions.d.ts +0 -8
  137. package/dist/types/react/source-owner.d.ts +0 -2
  138. package/dist/types/react/style-contract.d.ts +0 -88
  139. package/dist/types/react/style-validation.d.ts +0 -2
  140. package/dist/types/react/styles.d.ts +0 -8
  141. package/dist/types/react/ui/AboutData.d.ts +0 -73
  142. package/dist/types/react/ui/AltertableLogo.d.ts +0 -3
  143. package/dist/types/react/ui/AppFooter.d.ts +0 -6
  144. package/dist/types/react/ui/AppHeader.d.ts +0 -10
  145. package/dist/types/react/ui/AppLayout.d.ts +0 -10
  146. package/dist/types/react/ui/AppScope.d.ts +0 -7
  147. package/dist/types/react/ui/AppToolbar.d.ts +0 -30
  148. package/dist/types/react/ui/AreaChart.d.ts +0 -7
  149. package/dist/types/react/ui/BarChart.d.ts +0 -6
  150. package/dist/types/react/ui/Breakdown.d.ts +0 -13
  151. package/dist/types/react/ui/Button.d.ts +0 -12
  152. package/dist/types/react/ui/ChartLegend.d.ts +0 -32
  153. package/dist/types/react/ui/Checkbox.d.ts +0 -21
  154. package/dist/types/react/ui/CheckboxGroup.d.ts +0 -7
  155. package/dist/types/react/ui/ChoicePicker.d.ts +0 -39
  156. package/dist/types/react/ui/Comparison.d.ts +0 -14
  157. package/dist/types/react/ui/ComposedChart.d.ts +0 -41
  158. package/dist/types/react/ui/ComposedChartLegend.d.ts +0 -9
  159. package/dist/types/react/ui/ContentSkeleton.d.ts +0 -7
  160. package/dist/types/react/ui/DataApp.d.ts +0 -24
  161. package/dist/types/react/ui/DataAppFrame.d.ts +0 -52
  162. package/dist/types/react/ui/DataBoundary.d.ts +0 -14
  163. package/dist/types/react/ui/DataSection.d.ts +0 -14
  164. package/dist/types/react/ui/DataSectionBoundary.d.ts +0 -30
  165. package/dist/types/react/ui/DataTable.d.ts +0 -29
  166. package/dist/types/react/ui/DataValue.d.ts +0 -9
  167. package/dist/types/react/ui/DataViewToast.d.ts +0 -11
  168. package/dist/types/react/ui/DataWidget.d.ts +0 -37
  169. package/dist/types/react/ui/DateDisplay.d.ts +0 -9
  170. package/dist/types/react/ui/DateRangePicker.d.ts +0 -30
  171. package/dist/types/react/ui/DateTimeTooltip.d.ts +0 -10
  172. package/dist/types/react/ui/DimensionPicker.d.ts +0 -13
  173. package/dist/types/react/ui/EmptyState.d.ts +0 -6
  174. package/dist/types/react/ui/ExplorationActionControl.d.ts +0 -60
  175. package/dist/types/react/ui/ExportControl.d.ts +0 -4
  176. package/dist/types/react/ui/FilterActions.d.ts +0 -10
  177. package/dist/types/react/ui/FilterBar.d.ts +0 -3
  178. package/dist/types/react/ui/FunnelChart.d.ts +0 -20
  179. package/dist/types/react/ui/GettingStarted.d.ts +0 -6
  180. package/dist/types/react/ui/GlossaryDefinition.d.ts +0 -7
  181. package/dist/types/react/ui/GlossaryExplanation.d.ts +0 -16
  182. package/dist/types/react/ui/GradientScroll.d.ts +0 -23
  183. package/dist/types/react/ui/Grid.d.ts +0 -12
  184. package/dist/types/react/ui/GridItem.d.ts +0 -7
  185. package/dist/types/react/ui/HelpPopover.d.ts +0 -21
  186. package/dist/types/react/ui/IconButton.d.ts +0 -19
  187. package/dist/types/react/ui/InspectionContext.d.ts +0 -12
  188. package/dist/types/react/ui/InspectionProvider.d.ts +0 -29
  189. package/dist/types/react/ui/JourneyChart.d.ts +0 -10
  190. package/dist/types/react/ui/Kbd.d.ts +0 -7
  191. package/dist/types/react/ui/LineChart.d.ts +0 -7
  192. package/dist/types/react/ui/LiveControl.d.ts +0 -10
  193. package/dist/types/react/ui/Menu.d.ts +0 -13
  194. package/dist/types/react/ui/MetricWidget.d.ts +0 -51
  195. package/dist/types/react/ui/NumberField.d.ts +0 -27
  196. package/dist/types/react/ui/NumberFilterPicker.d.ts +0 -11
  197. package/dist/types/react/ui/PeriodSummary.d.ts +0 -17
  198. package/dist/types/react/ui/PickerField.d.ts +0 -23
  199. package/dist/types/react/ui/PieChart.d.ts +0 -11
  200. package/dist/types/react/ui/PopoverSurface.d.ts +0 -5
  201. package/dist/types/react/ui/PresentStory.d.ts +0 -30
  202. package/dist/types/react/ui/QueryList.d.ts +0 -14
  203. package/dist/types/react/ui/RadioGroup.d.ts +0 -18
  204. package/dist/types/react/ui/Ranking.d.ts +0 -13
  205. package/dist/types/react/ui/RefreshControl.d.ts +0 -9
  206. package/dist/types/react/ui/RequestHint.d.ts +0 -20
  207. package/dist/types/react/ui/RetentionChart.d.ts +0 -27
  208. package/dist/types/react/ui/ScatterChart.d.ts +0 -17
  209. package/dist/types/react/ui/SearchField.d.ts +0 -23
  210. package/dist/types/react/ui/SearchInput.d.ts +0 -10
  211. package/dist/types/react/ui/SearchMatch.d.ts +0 -6
  212. package/dist/types/react/ui/SearchTypeahead.d.ts +0 -15
  213. package/dist/types/react/ui/SectionHeading.d.ts +0 -8
  214. package/dist/types/react/ui/Select.d.ts +0 -22
  215. package/dist/types/react/ui/SelectionMark.d.ts +0 -5
  216. package/dist/types/react/ui/Sheet.d.ts +0 -21
  217. package/dist/types/react/ui/Skeleton.d.ts +0 -8
  218. package/dist/types/react/ui/Stack.d.ts +0 -7
  219. package/dist/types/react/ui/StaticDataApp.d.ts +0 -4
  220. package/dist/types/react/ui/StatusPanel.d.ts +0 -10
  221. package/dist/types/react/ui/TableWidget.d.ts +0 -67
  222. package/dist/types/react/ui/Tabs.d.ts +0 -10
  223. package/dist/types/react/ui/TextContent.d.ts +0 -4
  224. package/dist/types/react/ui/TextWidget.d.ts +0 -20
  225. package/dist/types/react/ui/ThemeSelector.d.ts +0 -12
  226. package/dist/types/react/ui/Toast.d.ts +0 -8
  227. package/dist/types/react/ui/Tooltip.d.ts +0 -23
  228. package/dist/types/react/ui/TooltipSurface.d.ts +0 -3
  229. package/dist/types/react/ui/TrendChart.d.ts +0 -5
  230. package/dist/types/react/ui/UpdatedAt.d.ts +0 -9
  231. package/dist/types/react/ui/VariableBar.d.ts +0 -6
  232. package/dist/types/react/ui/VisualizationWidget.d.ts +0 -43
  233. package/dist/types/react/ui/WidgetDisclosure.d.ts +0 -6
  234. package/dist/types/react/ui/WidgetEvidence.d.ts +0 -12
  235. package/dist/types/react/ui/WidgetViewTabs.d.ts +0 -16
  236. package/dist/types/react/ui/chart-data.d.ts +0 -36
  237. package/dist/types/react/ui/chart-date-axis.d.ts +0 -15
  238. package/dist/types/react/ui/chart-interaction.d.ts +0 -27
  239. package/dist/types/react/ui/chart-primitives.d.ts +0 -22
  240. package/dist/types/react/ui/chart-time.d.ts +0 -19
  241. package/dist/types/react/ui/chartColor.d.ts +0 -2
  242. package/dist/types/react/ui/classNames.d.ts +0 -1
  243. package/dist/types/react/ui/csv-export.d.ts +0 -19
  244. package/dist/types/react/ui/data-context.d.ts +0 -76
  245. package/dist/types/react/ui/data-identifiers.d.ts +0 -32
  246. package/dist/types/react/ui/icons.d.ts +0 -49
  247. package/dist/types/react/ui/index.d.ts +0 -111
  248. package/dist/types/react/ui/journey-flow.d.ts +0 -49
  249. package/dist/types/react/ui/keyboard.d.ts +0 -6
  250. package/dist/types/react/ui/metric-comparison.d.ts +0 -30
  251. package/dist/types/react/ui/metric.d.ts +0 -11
  252. package/dist/types/react/ui/presentation.d.ts +0 -25
  253. package/dist/types/react/ui/search.d.ts +0 -6
  254. package/dist/types/react/ui/searchItems.d.ts +0 -36
  255. package/dist/types/react/ui/shortcuts.d.ts +0 -45
  256. package/dist/types/react/ui/story.d.ts +0 -20
  257. package/dist/types/react/ui/use-chart-scroll-to-end.d.ts +0 -2
  258. package/dist/types/react/ui/useAppAppearance.d.ts +0 -3
  259. package/dist/types/react/ui/useDataAppPresentation.d.ts +0 -3
  260. package/dist/types/react/ui/useSvgId.d.ts +0 -2
  261. package/dist/types/react/ui/variables.d.ts +0 -38
  262. package/dist/types/react/ui/widget-views.d.ts +0 -3
  263. package/dist/types/react/view-control-bar.d.ts +0 -18
  264. package/dist/types/react/view-controls.d.ts +0 -20
  265. package/dist/types/react/view-runtime.d.ts +0 -34
  266. package/dist/types/react/view.d.ts +0 -87
  267. package/dist/types/react/widgets.d.ts +0 -90
  268. package/dist/types/server/local.d.ts +0 -19
  269. package/dist/types/server/preview/host.d.ts +0 -1
  270. package/dist/types/server/preview/index.d.ts +0 -16
  271. package/dist/types/server/reload-channel.d.ts +0 -6
  272. package/dist/worker.js +0 -106
  273. package/examples/starter-data-app/index.tsx +0 -193
  274. package/examples/starter-local-data-app/.bun-version +0 -1
  275. package/examples/starter-local-data-app/.node-version +0 -1
  276. package/examples/starter-local-data-app/.oxfmtrc.json +0 -4
  277. package/examples/starter-local-data-app/.oxlintrc.json +0 -33
  278. package/examples/starter-local-data-app/AGENTS.md +0 -22
  279. package/examples/starter-local-data-app/README.md +0 -54
  280. package/examples/starter-local-data-app/app.ts +0 -28
  281. package/examples/starter-local-data-app/bunfig.toml +0 -2
  282. package/examples/starter-local-data-app/package.json +0 -33
  283. package/examples/starter-local-data-app/src/App.tsx +0 -8
  284. package/examples/starter-local-data-app/src/assets.d.ts +0 -1
  285. package/examples/starter-local-data-app/src/data-context.ts +0 -21
  286. package/examples/starter-local-data-app/src/favicon.svg +0 -13
  287. package/examples/starter-local-data-app/src/index.html +0 -14
  288. package/examples/starter-local-data-app/src/main.tsx +0 -7
  289. package/examples/starter-local-data-app/src/operations.ts +0 -6
  290. package/examples/starter-local-data-app/src/server.ts +0 -6
  291. 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 `/react` with declared views and bound widgets. `/react/ui` is for setup,
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
- | Operations, validation, and data state | `src/core` |
16
- | Browser clients and navigation | `src/client` |
17
- | Request authorization and local serving | `src/server` |
18
- | Iframe hosting and bootstrap | `src/embed`, `src/worker` |
19
- | React bindings and UI | `src/react` |
20
- | Consumer examples | `examples/starter-local-data-app`, `examples/starter-data-app` |
21
- | Public guides | `docs` |
22
- | Build, package checks, and releases | `scripts` |
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 `src/react/styles.css`. Do not edit generated `dist`.
29
-
30
- Use `@/src/...` imports in repository source and `@altertable/data-app/<entry>`
31
- in consumer tests and examples. Run `bun run lint:fix` and `bun run format` for
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
- `@altertable/data-app/<entry>`. Assert consumer-visible results and errors. Supply
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, and injected styles |
69
- | `bun run check:styles` | Validate authored styling hooks |
70
- | `bun run typecheck` | Check source, tests, and scripts |
71
- | `bun run lint` | Run type-aware lint checks |
72
- | `bun run lint:md` | Check Markdown structure and syntax |
73
- | `bun run check:links` | Validate local files, images, and heading links |
74
- | `bun run check:links:external` | Check external URLs (requires network access) |
75
- | `bun run format` | Format source and docs |
76
- | `bun run test` | Verify high-level public API workflows with Vitest |
77
- | `bun run check:package` | Verify the npm archive as a consumer |
78
- | `bun run check:starter` | Typecheck, lint, and build the starter |
79
- | `bun run check:workflows` | Validate workflows and shell scripts |
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 `src`
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 `dist`, so the app needs no install. Run `bun run build`
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
- # Altertable Data App
1
+ # @altertable/data-app
2
2
 
3
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
3
+ Portable definitions, contracts, formatting, browser clients, and request handlers
4
+ for Altertable data apps.
4
5
 
5
- **Build data apps powered by Altertable.**
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
- ## Build an app
12
+ ## Usage
25
13
 
26
- Apps can be embedded in Altertable, ChatGPT, Claude, and other hosts that support
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
- | App | Guide | Starter |
30
- | --------------- | -------------------------------------- | ---------------------------------------------------------- |
31
- | Remote data app | [Remote guide](docs/hosted-apps.md) | [Single file](examples/starter-data-app/index.tsx) |
32
- | Local data app | [Local guide](docs/local-data-apps.md) | [Local project](examples/starter-local-data-app/README.md) |
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
- For agent-assisted work, direct your agent to [AGENTS.md](AGENTS.md).
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
- ## Development
31
+ ## Documentation
37
32
 
38
- See [Contributing](CONTRIBUTING.md) to develop and test the package.
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