@altertable/data-app-examples 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/README.md +7 -16
- package/dist/index.js +40 -42
- package/dist/index.js.map +1 -10
- package/dist/types/index.d.ts +11 -8
- package/package.json +3 -2
- package/templates/starter-data-app/index.tsx +3 -3
- package/templates/starter-local-data-app/.bun-version +1 -1
- package/templates/starter-local-data-app/.oxfmtrc.json +8 -1
- package/templates/starter-local-data-app/AGENTS.md +4 -12
- package/templates/starter-local-data-app/README.md +13 -30
- package/templates/starter-local-data-app/app.ts +14 -14
- package/templates/starter-local-data-app/package.json +11 -10
- package/templates/starter-local-data-app/src/App.tsx +3 -2
- package/templates/starter-local-data-app/src/assets.d.ts +1 -1
- package/templates/starter-local-data-app/src/data-context.ts +7 -6
- package/templates/starter-local-data-app/src/main.tsx +5 -4
- package/templates/starter-local-data-app/src/operations.ts +3 -2
- package/templates/starter-local-data-app/src/server.ts +6 -5
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# @altertable/data-app-examples
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
app authors. Templates use the published runtime packages and ship as editable
|
|
5
|
-
source files. This package has no runtime dependencies.
|
|
3
|
+
Editable starter templates for app authors and scaffolding tools.
|
|
6
4
|
|
|
7
5
|
## Use from scaffolding tools
|
|
8
6
|
|
|
@@ -12,16 +10,10 @@ import { copyExample } from '@altertable/data-app-examples';
|
|
|
12
10
|
await copyExample('starter-local-data-app', destination);
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
`dataAppExamples`
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
(npm excludes `.gitignore` from published archives). The destination must not
|
|
20
|
-
exist. Keep project naming, destination checks, and dependency installation
|
|
21
|
-
in the consuming tool. Generated apps do not depend on this package.
|
|
22
|
-
|
|
23
|
-
`getExampleDirectory()` returns an absolute source path for tools that need to
|
|
24
|
-
inspect templates. Both functions reject unknown IDs.
|
|
13
|
+
Use `dataAppExamples` for a starter picker and `getExampleDirectory()` to inspect
|
|
14
|
+
a template. `copyExample()` requires a new destination and restores `.gitignore`.
|
|
15
|
+
The caller owns naming and dependency installation; generated apps do not depend
|
|
16
|
+
on this package.
|
|
25
17
|
|
|
26
18
|
## Starters
|
|
27
19
|
|
|
@@ -30,9 +22,8 @@ inspect templates. Both functions reject unknown IDs.
|
|
|
30
22
|
| `starter-data-app` | [Hosted single-file app](templates/starter-data-app/index.tsx) |
|
|
31
23
|
| `starter-local-data-app` | [Local Bun and React project](templates/starter-local-data-app/README.md) |
|
|
32
24
|
|
|
33
|
-
Pin
|
|
34
|
-
|
|
35
|
-
The SDK authoring guides and API reference ship in `@altertable/data-app`.
|
|
25
|
+
Pin to the same exact version as `@altertable/data-app`. Authoring guides and
|
|
26
|
+
API reference ship in that base package.
|
|
36
27
|
|
|
37
28
|
## License
|
|
38
29
|
|
package/dist/index.js
CHANGED
|
@@ -1,50 +1,48 @@
|
|
|
1
|
-
// packages/data-app-examples/src/index.ts
|
|
2
1
|
import { cp, mkdir, readdir, rename, rm } from "node:fs/promises";
|
|
3
2
|
import { join, relative, sep } from "node:path";
|
|
4
3
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
//#region src/index.ts
|
|
5
|
+
const templateFileRenames = /* @__PURE__ */ new Map([["_gitignore", ".gitignore"]]);
|
|
6
|
+
/** Canonical starters available to scaffolding tools. IDs are stable across releases. */
|
|
7
|
+
const dataAppExamples = [{
|
|
8
|
+
id: "starter-data-app",
|
|
9
|
+
title: "Hosted data app",
|
|
10
|
+
description: "A single-file React app for hosted execution.",
|
|
11
|
+
mode: "hosted"
|
|
12
|
+
}, {
|
|
13
|
+
id: "starter-local-data-app",
|
|
14
|
+
title: "Local data app",
|
|
15
|
+
description: "A Bun and React project with server-side lakehouse access.",
|
|
16
|
+
mode: "local"
|
|
17
|
+
}];
|
|
18
|
+
/** Absolute source directory. Use copyExample() to restore npm-excluded filenames. */
|
|
20
19
|
function getExampleDirectory(id) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return fileURLToPath(new URL(`../templates/${example.id}/`, import.meta.url));
|
|
20
|
+
const example = dataAppExamples.find((example) => example.id === id);
|
|
21
|
+
if (!example) throw new Error(`Unknown data app example: ${id}`);
|
|
22
|
+
return fileURLToPath(new URL(`../templates/${example.id}/`, import.meta.url));
|
|
25
23
|
}
|
|
24
|
+
/** Copy a starter into a new directory; reject existing destinations. */
|
|
26
25
|
async function copyExample(id, destination) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
const source = getExampleDirectory(id);
|
|
27
|
+
await mkdir(destination);
|
|
28
|
+
try {
|
|
29
|
+
await cp(source, destination, {
|
|
30
|
+
recursive: true,
|
|
31
|
+
filter: (path) => relative(source, path).split(sep).every((part) => part !== "node_modules" && part !== "dist" && !part.startsWith(".env"))
|
|
32
|
+
});
|
|
33
|
+
for (const filename of await readdir(destination)) {
|
|
34
|
+
const target = templateFileRenames.get(filename);
|
|
35
|
+
if (target) await rename(join(destination, filename), join(destination, target));
|
|
36
|
+
}
|
|
37
|
+
} catch (error) {
|
|
38
|
+
await rm(destination, {
|
|
39
|
+
recursive: true,
|
|
40
|
+
force: true
|
|
41
|
+
});
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
dataAppExamples,
|
|
47
|
-
getExampleDirectory
|
|
48
|
-
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { copyExample, dataAppExamples, getExampleDirectory };
|
|
49
47
|
|
|
50
|
-
//#
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { cp, mkdir, readdir, rename, rm } from 'node:fs/promises';\nimport { join, relative, sep } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst templateFileRenames = new Map([['_gitignore', '.gitignore']]);\n\n/** Canonical starters available to scaffolding tools. IDs are stable across releases. */\nexport const dataAppExamples = [\n {\n id: 'starter-data-app',\n title: 'Hosted data app',\n description: 'A single-file React app for hosted execution.',\n mode: 'hosted',\n },\n {\n id: 'starter-local-data-app',\n title: 'Local data app',\n description: 'A Bun and React project with server-side lakehouse access.',\n mode: 'local',\n },\n] as const;\n\n/** Stable identifier for a canonical starter. */\nexport type DataAppExampleId = (typeof dataAppExamples)[number]['id'];\n\n/** Absolute source directory. Use copyExample() to restore npm-excluded filenames. */\nexport function getExampleDirectory(id: DataAppExampleId): string {\n const example = dataAppExamples.find(example => example.id === id);\n if (!example) throw new Error(`Unknown data app example: ${id}`);\n return fileURLToPath(new URL(`../templates/${example.id}/`, import.meta.url));\n}\n\n/** Copy a starter into a new directory; reject existing destinations. */\nexport async function copyExample(\n id: DataAppExampleId,\n destination: string\n): Promise<void> {\n const source = getExampleDirectory(id);\n await mkdir(destination);\n try {\n await cp(source, destination, {\n recursive: true,\n filter: path =>\n relative(source, path)\n .split(sep)\n .every(\n part =>\n part !== 'node_modules' &&\n part !== 'dist' &&\n !part.startsWith('.env')\n ),\n });\n for (const filename of await readdir(destination)) {\n const target = templateFileRenames.get(filename);\n if (target)\n await rename(join(destination, filename), join(destination, target));\n }\n } catch (error) {\n await rm(destination, { recursive: true, force: true });\n throw error;\n }\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";AAAA;AACA;AACA;AAEA,IAAM,sBAAsB,IAAI,IAAI,CAAC,CAAC,cAAc,YAAY,CAAC,CAAC;AAG3D,IAAM,kBAAkB;AAAA,EAC7B;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACR;AACF;AAMO,SAAS,mBAAmB,CAAC,IAA8B;AAAA,EAChE,MAAM,UAAU,gBAAgB,KAAK,aAAW,QAAQ,OAAO,EAAE;AAAA,EACjE,IAAI,CAAC;AAAA,IAAS,MAAM,IAAI,MAAM,6BAA6B,IAAI;AAAA,EAC/D,OAAO,cAAc,IAAI,IAAI,gBAAgB,QAAQ,OAAO,YAAY,GAAG,CAAC;AAAA;AAI9E,eAAsB,WAAW,CAC/B,IACA,aACe;AAAA,EACf,MAAM,SAAS,oBAAoB,EAAE;AAAA,EACrC,MAAM,MAAM,WAAW;AAAA,EACvB,IAAI;AAAA,IACF,MAAM,GAAG,QAAQ,aAAa;AAAA,MAC5B,WAAW;AAAA,MACX,QAAQ,UACN,SAAS,QAAQ,IAAI,EAClB,MAAM,GAAG,EACT,MACC,UACE,SAAS,kBACT,SAAS,UACT,CAAC,KAAK,WAAW,MAAM,CAC3B;AAAA,IACN,CAAC;AAAA,IACD,WAAW,YAAY,MAAM,QAAQ,WAAW,GAAG;AAAA,MACjD,MAAM,SAAS,oBAAoB,IAAI,QAAQ;AAAA,MAC/C,IAAI;AAAA,QACF,MAAM,OAAO,KAAK,aAAa,QAAQ,GAAG,KAAK,aAAa,MAAM,CAAC;AAAA,IACvE;AAAA,IACA,OAAO,OAAO;AAAA,IACd,MAAM,GAAG,aAAa,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,IACtD,MAAM;AAAA;AAAA;",
|
|
8
|
-
"debugId": "94DD5381B73C22BD64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { cp, mkdir, readdir, rename, rm } from 'node:fs/promises';\nimport { join, relative, sep } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst templateFileRenames = new Map([['_gitignore', '.gitignore']]);\n\n/** Canonical starters available to scaffolding tools. IDs are stable across releases. */\nexport const dataAppExamples = [\n {\n id: 'starter-data-app',\n title: 'Hosted data app',\n description: 'A single-file React app for hosted execution.',\n mode: 'hosted',\n },\n {\n id: 'starter-local-data-app',\n title: 'Local data app',\n description: 'A Bun and React project with server-side lakehouse access.',\n mode: 'local',\n },\n] as const;\n\n/** Stable identifier for a canonical starter. */\nexport type DataAppExampleId = (typeof dataAppExamples)[number]['id'];\n\n/** Absolute source directory. Use copyExample() to restore npm-excluded filenames. */\nexport function getExampleDirectory(id: DataAppExampleId): string {\n const example = dataAppExamples.find(example => example.id === id);\n if (!example) throw new Error(`Unknown data app example: ${id}`);\n return fileURLToPath(new URL(`../templates/${example.id}/`, import.meta.url));\n}\n\n/** Copy a starter into a new directory; reject existing destinations. */\nexport async function copyExample(\n id: DataAppExampleId,\n destination: string\n): Promise<void> {\n const source = getExampleDirectory(id);\n await mkdir(destination);\n try {\n await cp(source, destination, {\n recursive: true,\n filter: path =>\n relative(source, path)\n .split(sep)\n .every(\n part =>\n part !== 'node_modules' &&\n part !== 'dist' &&\n !part.startsWith('.env')\n ),\n });\n for (const filename of await readdir(destination)) {\n const target = templateFileRenames.get(filename);\n if (target)\n await rename(join(destination, filename), join(destination, target));\n }\n } catch (error) {\n await rm(destination, { recursive: true, force: true });\n throw error;\n }\n}\n"],"mappings":";;;;AAIA,MAAM,sCAAsB,IAAI,IAAI,CAAC,CAAC,cAAc,YAAY,CAAC,CAAC;;AAGlE,MAAa,kBAAkB,CAC7B;CACE,IAAI;CACJ,OAAO;CACP,aAAa;CACb,MAAM;AACR,GACA;CACE,IAAI;CACJ,OAAO;CACP,aAAa;CACb,MAAM;AACR,CACF;;AAMA,SAAgB,oBAAoB,IAA8B;CAChE,MAAM,UAAU,gBAAgB,MAAK,YAAW,QAAQ,OAAO,EAAE;CACjE,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,6BAA6B,IAAI;CAC/D,OAAO,cAAc,IAAI,IAAI,gBAAgB,QAAQ,GAAG,IAAI,YAAY,GAAG,CAAC;AAC9E;;AAGA,eAAsB,YACpB,IACA,aACe;CACf,MAAM,SAAS,oBAAoB,EAAE;CACrC,MAAM,MAAM,WAAW;CACvB,IAAI;EACF,MAAM,GAAG,QAAQ,aAAa;GAC5B,WAAW;GACX,SAAQ,SACN,SAAS,QAAQ,IAAI,CAAC,CACnB,MAAM,GAAG,CAAC,CACV,OACC,SACE,SAAS,kBACT,SAAS,UACT,CAAC,KAAK,WAAW,MAAM,CAC3B;EACN,CAAC;EACD,KAAK,MAAM,YAAY,MAAM,QAAQ,WAAW,GAAG;GACjD,MAAM,SAAS,oBAAoB,IAAI,QAAQ;GAC/C,IAAI,QACF,MAAM,OAAO,KAAK,aAAa,QAAQ,GAAG,KAAK,aAAa,MAAM,CAAC;EACvE;CACF,SAAS,OAAO;EACd,MAAM,GAAG,aAAa;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;EACtD,MAAM;CACR;AACF"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
1
2
|
/** Canonical starters available to scaffolding tools. IDs are stable across releases. */
|
|
2
3
|
export declare const dataAppExamples: readonly [{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
readonly id: 'starter-data-app';
|
|
5
|
+
readonly title: 'Hosted data app';
|
|
6
|
+
readonly description: 'A single-file React app for hosted execution.';
|
|
7
|
+
readonly mode: 'hosted';
|
|
7
8
|
}, {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
readonly id: 'starter-local-data-app';
|
|
10
|
+
readonly title: 'Local data app';
|
|
11
|
+
readonly description: 'A Bun and React project with server-side lakehouse access.';
|
|
12
|
+
readonly mode: 'local';
|
|
12
13
|
}];
|
|
13
14
|
/** Stable identifier for a canonical starter. */
|
|
14
15
|
export type DataAppExampleId = (typeof dataAppExamples)[number]['id'];
|
|
@@ -16,3 +17,5 @@ export type DataAppExampleId = (typeof dataAppExamples)[number]['id'];
|
|
|
16
17
|
export declare function getExampleDirectory(id: DataAppExampleId): string;
|
|
17
18
|
/** Copy a starter into a new directory; reject existing destinations. */
|
|
18
19
|
export declare function copyExample(id: DataAppExampleId, destination: string): Promise<void>;
|
|
20
|
+
//#endregion
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altertable/data-app-examples",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"description": "Canonical starter templates for Altertable data apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Altertable",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"registry": "https://registry.npmjs.org"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build": "bun ../../scripts/build.ts data-app-examples"
|
|
31
|
+
"build": "bun ../../scripts/build.ts data-app-examples",
|
|
32
|
+
"typecheck": "bun ../../node_modules/typescript/bin/tsc --noEmit -p tsconfig.build.json"
|
|
32
33
|
}
|
|
33
34
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { formatMetric } from '@altertable/data-app/format';
|
|
2
|
-
import { createDataClient } from '@altertable/data-app/client';
|
|
3
1
|
import { defineDataApp } from '@altertable/data-app';
|
|
4
|
-
import { parseCount } from '@altertable/data-app/contract';
|
|
5
2
|
import {
|
|
6
3
|
createDataContext,
|
|
7
4
|
createDataHooks,
|
|
@@ -17,6 +14,9 @@ import {
|
|
|
17
14
|
MetricWidget,
|
|
18
15
|
searchVariable,
|
|
19
16
|
} from '@altertable/data-app-react';
|
|
17
|
+
import { createDataClient } from '@altertable/data-app/client';
|
|
18
|
+
import { parseCount } from '@altertable/data-app/contract';
|
|
19
|
+
import { formatMetric } from '@altertable/data-app/format';
|
|
20
20
|
|
|
21
21
|
const dataApp = defineDataApp({
|
|
22
22
|
title: 'Sample counts',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
1.4.
|
|
1
|
+
1.4.3
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
|
3
|
-
"ignorePatterns": ["dist/**", "bun.lock"]
|
|
3
|
+
"ignorePatterns": ["dist/**", "bun.lock"],
|
|
4
|
+
"singleQuote": true,
|
|
5
|
+
"trailingComma": "es5",
|
|
6
|
+
"arrowParens": "avoid",
|
|
7
|
+
"printWidth": 80,
|
|
8
|
+
"endOfLine": "lf",
|
|
9
|
+
"sortImports": true,
|
|
10
|
+
"sortPackageJson": false
|
|
4
11
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# Build this local data app
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[SDK instructions](https://github.com/altertable-ai/data-app/blob/main/AGENTS.md) on GitHub.
|
|
3
|
+
Read `node_modules/@altertable/data-app/docs/app-authoring.md` and use this project
|
|
4
|
+
as the selected scaffold. If dependencies are unavailable, read the
|
|
5
|
+
[version-matched recipe](https://github.com/altertable-ai/data-app/blob/v0.73.0/docs/app-authoring.md). <!-- x-release-please-version -->
|
|
7
6
|
|
|
8
7
|
| Task | App-owned files |
|
|
9
8
|
| ---------------------------------------- | -------------------------------------------------------- |
|
|
@@ -16,11 +15,4 @@ Then use the app files below. Browse the latest
|
|
|
16
15
|
|
|
17
16
|
See [README.md](README.md) for setup and checks.
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Read the SDK's `docs/app-authoring.md` before changing the app, and search its
|
|
22
|
-
`REFERENCE.md` for props and signatures. Use the installed package when available;
|
|
23
|
-
otherwise follow these files in the same version tag as the instructions above. Follow their task routes for views, variables, widgets, evidence,
|
|
24
|
-
and stories/export. Prefer generated controls and bound readings; keep static
|
|
25
|
-
context visible during requests. Update this app's instructions when a reusable
|
|
26
|
-
app-specific convention changes. Package internals remain dependencies.
|
|
18
|
+
Keep reusable app-specific conventions here.
|
|
@@ -1,54 +1,37 @@
|
|
|
1
1
|
# Local data app starter
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Otherwise, read the [version-matched local authoring guide](https://github.com/altertable-ai/data-app/blob/v0.72.0/docs/local-data-apps.md). <!-- x-release-please-version -->
|
|
6
|
-
Browse the latest [local authoring guide](https://github.com/altertable-ai/data-app/blob/main/docs/local-data-apps.md)
|
|
7
|
-
on GitHub.
|
|
3
|
+
Use `node_modules/@altertable/data-app/docs/app-authoring.md` for this SDK version.
|
|
4
|
+
Otherwise, read the [version-matched authoring recipe](https://github.com/altertable-ai/data-app/blob/v0.73.0/docs/app-authoring.md). <!-- x-release-please-version -->
|
|
8
5
|
See [AGENTS.md](AGENTS.md) for app-owned files.
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
It starts with a lakehouse connectivity check. Replace that check with bounded
|
|
12
|
-
operations and views built from inspected data before sharing an analysis.
|
|
7
|
+
## Run the app
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
### Run your app
|
|
17
|
-
|
|
18
|
-
From the copied starter directory:
|
|
9
|
+
From the copied starter directory, install dependencies and set server-only
|
|
10
|
+
credentials before starting:
|
|
19
11
|
|
|
20
12
|
```fish
|
|
21
13
|
bun install
|
|
22
|
-
bun run dev
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Open <http://127.0.0.1:25837>. Missing credentials show the connection error state;
|
|
26
|
-
the page still runs. Set server-only credentials before starting the server:
|
|
27
|
-
|
|
28
|
-
```fish
|
|
29
14
|
set -gx ALTERTABLE_LAKEHOUSE_USERNAME your-username
|
|
30
15
|
read --silent --prompt-str 'Lakehouse password: ' ALTERTABLE_LAKEHOUSE_PASSWORD
|
|
31
16
|
set -gx ALTERTABLE_LAKEHOUSE_PASSWORD $ALTERTABLE_LAKEHOUSE_PASSWORD
|
|
32
17
|
bun run dev
|
|
33
18
|
```
|
|
34
19
|
|
|
35
|
-
Alternatively,
|
|
36
|
-
`ALTERTABLE_DATA_PROXY_TOKEN` for an existing
|
|
37
|
-
|
|
20
|
+
Open <http://127.0.0.1:25837>. Alternatively, configure
|
|
21
|
+
`ALTERTABLE_DATA_PROXY_URL` and `ALTERTABLE_DATA_PROXY_TOKEN` for an existing
|
|
22
|
+
CLI proxy. Missing credentials stop startup.
|
|
38
23
|
|
|
39
|
-
|
|
24
|
+
## Build the exploration
|
|
40
25
|
|
|
41
|
-
|
|
26
|
+
Replace the connectivity check with bounded operations, views, CSV export, and
|
|
27
|
+
story. Change identity, appearance, and queries in `app.ts`.
|
|
42
28
|
|
|
43
29
|
```fish
|
|
44
30
|
bun run check
|
|
45
31
|
```
|
|
46
32
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`bun run build` typechecks the app, then bundles the browser page into `dist/`. That browser artifact
|
|
51
|
-
still needs an authorized `/api/data` backend when hosted.
|
|
33
|
+
`bun run check` includes the build, which writes browser assets to `dist/`. Hosting them requires an authorized
|
|
34
|
+
`/api/data` backend; the local adapter does not authenticate hosted viewers.
|
|
52
35
|
|
|
53
36
|
## License
|
|
54
37
|
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineDataApp } from
|
|
1
|
+
import { defineDataApp } from '@altertable/data-app';
|
|
2
2
|
|
|
3
3
|
export const dataApp = defineDataApp({
|
|
4
|
-
title:
|
|
5
|
-
description:
|
|
4
|
+
title: 'Getting started',
|
|
5
|
+
description: 'Check your lakehouse connection, then build an exploration.',
|
|
6
6
|
scope: {
|
|
7
|
-
organization:
|
|
8
|
-
environment:
|
|
7
|
+
organization: 'Your organization',
|
|
8
|
+
environment: 'your environment',
|
|
9
9
|
},
|
|
10
10
|
appearance: {
|
|
11
|
-
theme:
|
|
12
|
-
baseColor:
|
|
13
|
-
density:
|
|
14
|
-
cornerRadius:
|
|
15
|
-
elevation:
|
|
11
|
+
theme: 'light',
|
|
12
|
+
baseColor: 'neutral',
|
|
13
|
+
density: 'comfortable',
|
|
14
|
+
cornerRadius: 'medium',
|
|
15
|
+
elevation: 'subtle',
|
|
16
16
|
typography: {
|
|
17
|
-
body:
|
|
18
|
-
heading:
|
|
17
|
+
body: 'system',
|
|
18
|
+
heading: 'system',
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
queries: {
|
|
22
22
|
connection: {
|
|
23
|
-
projections: { connection_check: { type:
|
|
24
|
-
statement:
|
|
23
|
+
projections: { connection_check: { type: 'number' } },
|
|
24
|
+
statement: 'SELECT 1 AS connection_check',
|
|
25
25
|
params: {},
|
|
26
26
|
},
|
|
27
27
|
},
|
|
@@ -13,23 +13,24 @@
|
|
|
13
13
|
"format:check": "oxfmt --check src app.ts",
|
|
14
14
|
"dev": "bun --hot src/server.ts",
|
|
15
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"
|
|
16
|
+
"check": "bun run lint && bun run format:check && bun run build",
|
|
17
|
+
"lint:fix": "oxlint --type-aware --fix src"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@altertable/data-app": "0.
|
|
20
|
-
"@altertable/data-app-bun": "0.
|
|
21
|
-
"@altertable/data-app-react": "0.
|
|
22
|
-
"react": "19.3.
|
|
23
|
-
"react-dom": "19.3.
|
|
20
|
+
"@altertable/data-app": "0.73.0",
|
|
21
|
+
"@altertable/data-app-bun": "0.73.0",
|
|
22
|
+
"@altertable/data-app-react": "0.73.0",
|
|
23
|
+
"react": "19.3.1",
|
|
24
|
+
"react-dom": "19.3.1"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"@types/bun": "1.4.
|
|
27
|
+
"@types/bun": "1.4.3",
|
|
27
28
|
"@types/react": "19.3.0",
|
|
28
29
|
"@types/react-dom": "19.3.0",
|
|
29
|
-
"oxfmt": "0.
|
|
30
|
-
"oxlint": "1.
|
|
30
|
+
"oxfmt": "0.71.0",
|
|
31
|
+
"oxlint": "1.86.0",
|
|
31
32
|
"oxlint-tsgolint": "7.0.2003",
|
|
32
33
|
"typescript": "7.0.2"
|
|
33
34
|
},
|
|
34
|
-
"packageManager": "bun@1.4.
|
|
35
|
+
"packageManager": "bun@1.4.3"
|
|
35
36
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { GettingStarted } from
|
|
2
|
-
|
|
1
|
+
import { GettingStarted } from '@altertable/data-app-react/ui';
|
|
2
|
+
|
|
3
|
+
import { dataContext } from '#app/data-context.ts';
|
|
3
4
|
|
|
4
5
|
/** Connectivity-only screen. Investigate the requested question, then replace this with a view
|
|
5
6
|
* that leads with a supported finding and explores the useful angles behind it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
declare module
|
|
1
|
+
declare module '*.css';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { createDataContext } from
|
|
2
|
-
import { dataApp } from "#config";
|
|
1
|
+
import { createDataContext } from '@altertable/data-app-react';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
import { dataApp } from '#config';
|
|
4
|
+
|
|
5
|
+
const connectionQueryNames = { connection: 'connection' } satisfies Record<
|
|
5
6
|
string,
|
|
6
7
|
keyof typeof dataApp.queries
|
|
7
8
|
>;
|
|
@@ -10,11 +11,11 @@ const connectionQueryNames = { connection: "connection" } satisfies Record<
|
|
|
10
11
|
* and query evidence after inspecting the source data. */
|
|
11
12
|
export const dataContext = createDataContext(connectionQueryNames)({
|
|
12
13
|
description:
|
|
13
|
-
|
|
14
|
+
'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
15
|
glossary: {
|
|
15
16
|
connectionVerified: {
|
|
16
|
-
term:
|
|
17
|
-
definition:
|
|
17
|
+
term: 'Connected',
|
|
18
|
+
definition: 'The latest connection-check query completed successfully.',
|
|
18
19
|
queryNames: [connectionQueryNames.connection],
|
|
19
20
|
},
|
|
20
21
|
},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { injectDataAppStyles, mountDataApp } from
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import { injectDataAppStyles, mountDataApp } from '@altertable/data-app-react';
|
|
2
|
+
|
|
3
|
+
import { App } from '#app/App.tsx';
|
|
4
|
+
import { dataApp } from '#config';
|
|
4
5
|
|
|
5
6
|
injectDataAppStyles();
|
|
6
7
|
|
|
7
|
-
mountDataApp({ app, component: App });
|
|
8
|
+
mountDataApp({ app: dataApp, component: App });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { connectionCheck } from '@altertable/data-app/contract';
|
|
2
|
+
|
|
3
|
+
import { dataApp } from '#config';
|
|
3
4
|
|
|
4
5
|
/** Connectivity probe only: its successful query supplies no analytical result. Replace it with
|
|
5
6
|
* bounded, validated operations that cover the questions the finished app will answer. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { serveLocalApp } from "@altertable/data-app-bun";
|
|
3
|
-
import { operations } from "#app/operations.ts";
|
|
4
|
-
import { dataApp as app } from "#config";
|
|
1
|
+
import { serveLocalApp } from '@altertable/data-app-bun';
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
import page from '#app/index.html';
|
|
4
|
+
import { operations } from '#app/operations.ts';
|
|
5
|
+
import { dataApp } from '#config';
|
|
6
|
+
|
|
7
|
+
serveLocalApp({ page, operations, title: dataApp.title });
|