@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
@@ -1,56 +0,0 @@
1
- # Local data app starter
2
-
3
- Use this starter with the [local authoring guide](https://github.com/altertable-ai/data-app/blob/main/docs/local-data-apps.md).
4
- See [AGENTS.md](AGENTS.md) for app-owned files.
5
-
6
- A Bun and React starter for Altertable data apps using the published packages.
7
- It starts with a lakehouse connectivity check. Replace that check with bounded
8
- operations and views built from inspected data before sharing an analysis.
9
-
10
- ## Usage
11
-
12
- ### Run from this repository
13
-
14
- Use the Bun and Node versions in `.bun-version` and `.node-version`.
15
- From the repository root:
16
-
17
- ```fish
18
- bun install --frozen-lockfile
19
- bun run build
20
- cd examples/starter-local-data-app
21
- bun run dev
22
- ```
23
-
24
- Open <http://127.0.0.1:25837>. Missing credentials show the connection error state;
25
- the page still runs. Set server-only credentials before starting the server:
26
-
27
- ```fish
28
- set -gx ALTERTABLE_LAKEHOUSE_USERNAME your-username
29
- read --silent --prompt-str 'Lakehouse password: ' ALTERTABLE_LAKEHOUSE_PASSWORD
30
- set -gx ALTERTABLE_LAKEHOUSE_PASSWORD $ALTERTABLE_LAKEHOUSE_PASSWORD
31
- bun run dev
32
- ```
33
-
34
- Alternatively, supply `ALTERTABLE_DATA_PROXY_URL` and
35
- `ALTERTABLE_DATA_PROXY_TOKEN` for an existing CLI proxy. These values must stay
36
- on the server. This local adapter does not authorize hosted viewers.
37
-
38
- ### Make it your app
39
-
40
- This starter declares the published base, React, and Bun packages. Inside this
41
- repository, Bun links their workspace builds. When copying the starter elsewhere,
42
- run `bun install` to install those packages from npm.
43
-
44
- ```fish
45
- bun run check
46
- ```
47
-
48
- Edit the `defineDataApp()` declaration in `app.ts` for identity, appearance,
49
- and queries.
50
-
51
- `bun run build` typechecks the app, then bundles the browser page into `dist/`. That browser artifact
52
- still needs an authorized `/api/data` backend when hosted.
53
-
54
- ## License
55
-
56
- [MIT](../../LICENSE)
@@ -1,28 +0,0 @@
1
- import { defineDataApp } from "@altertable/data-app";
2
-
3
- export const dataApp = defineDataApp({
4
- title: "Getting started",
5
- description: "Check your lakehouse connection, then build an exploration.",
6
- scope: {
7
- organization: "Your organization",
8
- environment: "your environment",
9
- },
10
- appearance: {
11
- theme: "light",
12
- baseColor: "neutral",
13
- density: "comfortable",
14
- cornerRadius: "medium",
15
- elevation: "subtle",
16
- typography: {
17
- body: "system",
18
- heading: "system",
19
- },
20
- },
21
- queries: {
22
- connection: {
23
- projections: { connection_check: { type: "number" } },
24
- statement: "SELECT 1 AS connection_check",
25
- params: {},
26
- },
27
- },
28
- });
@@ -1,2 +0,0 @@
1
- [install]
2
- exact = true
@@ -1,35 +0,0 @@
1
- {
2
- "name": "data-app-starter",
3
- "private": true,
4
- "type": "module",
5
- "imports": {
6
- "#app/*": "./src/*",
7
- "#config": "./app.ts"
8
- },
9
- "scripts": {
10
- "typecheck": "tsc --noEmit",
11
- "lint": "oxlint --type-aware src",
12
- "format": "oxfmt src app.ts",
13
- "format:check": "oxfmt --check src app.ts",
14
- "dev": "bun --hot src/server.ts",
15
- "build": "bun run typecheck && bun build src/index.html --outdir=dist --production",
16
- "check": "bun run lint && bun run format:check && bun run build"
17
- },
18
- "dependencies": {
19
- "@altertable/data-app": "0.71.0",
20
- "@altertable/data-app-bun": "0.71.0",
21
- "@altertable/data-app-react": "0.71.0",
22
- "react": "19.3.0",
23
- "react-dom": "19.3.0"
24
- },
25
- "devDependencies": {
26
- "@types/bun": "1.4.2",
27
- "@types/react": "19.3.0",
28
- "@types/react-dom": "19.3.0",
29
- "oxfmt": "0.70.0",
30
- "oxlint": "1.85.0",
31
- "oxlint-tsgolint": "7.0.2003",
32
- "typescript": "7.0.2"
33
- },
34
- "packageManager": "bun@1.4.2"
35
- }
@@ -1,8 +0,0 @@
1
- import { GettingStarted } from "@altertable/data-app-react/ui";
2
- import { dataContext } from "#app/data-context.ts";
3
-
4
- /** Connectivity-only screen. Investigate the requested question, then replace this with a view
5
- * that leads with a supported finding and explores the useful angles behind it. */
6
- export function App() {
7
- return <GettingStarted dataContext={dataContext} />;
8
- }
@@ -1 +0,0 @@
1
- declare module "*.css";
@@ -1,21 +0,0 @@
1
- import { createDataContext } from "@altertable/data-app-react";
2
- import { dataApp } from "#config";
3
-
4
- const connectionQueryNames = { connection: "connection" } satisfies Record<
5
- string,
6
- keyof typeof dataApp.queries
7
- >;
8
-
9
- /** Setup context only. Replace it with the exploration's scope, exact definitions, limitations,
10
- * and query evidence after inspecting the source data. */
11
- export const dataContext = createDataContext(connectionQueryNames)({
12
- description:
13
- "This starter runs a lightweight query to verify that the selected lakehouse profile can execute SQL. It does not check access to individual datasets. Replace the check with a query that answers a real question before sharing the app.",
14
- glossary: {
15
- connectionVerified: {
16
- term: "Connected",
17
- definition: "The latest connection-check query completed successfully.",
18
- queryNames: [connectionQueryNames.connection],
19
- },
20
- },
21
- });
@@ -1,13 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 51 44">
2
- <style>
3
- path { fill: #01050b; }
4
- @media (prefers-color-scheme: dark) {
5
- path { fill: #fff; }
6
- }
7
- </style>
8
- <path
9
- fill-rule="evenodd"
10
- clip-rule="evenodd"
11
- d="M40.3274 28.9788L35.9663 28.8378L34.9541 28.6881L18.1066 10.301L24.1073 0L26.8738 0.545413L41.5212 25.6848L40.3274 28.9788ZM20.5319 20.1112L18.1894 15.6731L14.6154 16.2904L0 41.378L0.894584 44H12.9453L20.5769 20.4134L20.5319 20.1112ZM44.9804 31.6253L20.3808 36.9197L17.5838 41.2974L19.9001 44H49.2036L51 41.9551L44.9804 31.6253Z"
12
- />
13
- </svg>
@@ -1,14 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <meta name="theme-color" content="#ffffff" />
7
- <title>Altertable app</title>
8
- <link rel="icon" href="./favicon.svg" type="image/svg+xml" />
9
- <script type="module" src="./main.tsx"></script>
10
- </head>
11
- <body>
12
- <div id="root"></div>
13
- </body>
14
- </html>
@@ -1,7 +0,0 @@
1
- import { injectDataAppStyles, mountDataApp } from "@altertable/data-app-react";
2
- import { App } from "#app/App.tsx";
3
- import { dataApp as app } from "#config";
4
-
5
- injectDataAppStyles();
6
-
7
- mountDataApp({ app, component: App });
@@ -1,6 +0,0 @@
1
- import { dataApp } from "#config";
2
- import { connectionCheck } from "@altertable/data-app/contract";
3
-
4
- /** Connectivity probe only: its successful query supplies no analytical result. Replace it with
5
- * bounded, validated operations that cover the questions the finished app will answer. */
6
- export const operations = { connection: connectionCheck(dataApp.queries) };
@@ -1,6 +0,0 @@
1
- import page from "#app/index.html";
2
- import { serveLocalApp } from "@altertable/data-app-bun";
3
- import { operations } from "#app/operations.ts";
4
- import { dataApp as app } from "#config";
5
-
6
- serveLocalApp({ page, operations, title: app.title });
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "Preserve",
5
- "moduleResolution": "bundler",
6
- "allowImportingTsExtensions": true,
7
- "resolveJsonModule": true,
8
- "jsx": "react-jsx",
9
- "strict": true,
10
- "noUncheckedIndexedAccess": true,
11
- "noEmit": true,
12
- "skipLibCheck": true,
13
- "types": ["bun"],
14
- "noImplicitReturns": true,
15
- "noFallthroughCasesInSwitch": true,
16
- "noImplicitOverride": true,
17
- "allowUnreachableCode": false,
18
- "noUncheckedSideEffectImports": true
19
- },
20
- "include": ["src", "app.ts"]
21
- }