Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Generate, preview, and upgrade data apps with data-app 0.78.0. New projects use the editable standalone example and a shared `app.ts` declaration; directory and file previews verify its scope statically. Upgrades preserve existing source and identity; older `app.json` projects require an author-owned source migration.
- Generate, preview, and upgrade data apps with data-app 0.79.0. New projects use the published starter with view-bound widgets and a shared `app.ts` declaration; directory and file previews verify its scope statically. Upgrades preserve existing source and identity; source changes for breaking SDK releases remain author-owned.
- Raise the default `--connect-timeout` from 5 to 30 seconds, so queries that take a few seconds to start responding no longer time out.
- Timeout errors now name the CLI flag that fired, explain that the limit is client-side (the request may still be running on the server, and slow networks can cause it), and say how to raise it.

Expand Down
8 changes: 4 additions & 4 deletions cli/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"yaml": "2.9.0"
},
"devDependencies": {
"@altertable/data-app-examples": "0.78.0",
"@altertable/data-app-manifest": "0.78.0",
"@altertable/data-app-examples": "0.79.0",
"@altertable/data-app-manifest": "0.79.0",
"@types/bun": "1.4.3",
"eslint-plugin-no-relative-import-paths": "1.6.1",
"knip": "6.32.2",
Expand Down
8 changes: 4 additions & 4 deletions cli/scripts/smoke-data-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ export async function smokeDataApp(
throw new Error('File preview did not bundle the app.');
}
const query = await fetch(
`${url}${singleFile ? '/api/query' : '/api/query/totalCost'}`,
`${url}${singleFile ? '/api/query' : '/api/query/sampleCountsByGroup'}`,
{
signal: AbortSignal.timeout(5000),
method: 'POST',
headers: { origin: url, 'content-type': 'application/json' },
body: JSON.stringify(
singleFile
? { queryId: 'connection', limit: 1, params: {} }
: { limit: 1, params: { month: '2026-09', customerName: '' } }
: { limit: 1, params: { groupName: 'all' } }
),
}
);
Expand All @@ -126,7 +126,7 @@ export async function smokeDataApp(
rows?: unknown[][];
data?: unknown;
};
if (result.rows?.[0]?.[0] !== (singleFile ? 1 : 1320000))
if (result.rows?.[0]?.[0] !== (singleFile ? 1 : 'Alpha'))
throw new Error('Preview did not return the lakehouse query result.');
} catch (error) {
failure = error;
Expand Down Expand Up @@ -204,7 +204,7 @@ export async function smokeDataApp(
return new Response(
statement === 'SELECT 1 AS connection_check'
? '{"query_id":"smoke"}\n[{"name":"connection_check","type":"INTEGER"}]\n[1]'
: '{"query_id":"smoke"}\n[{"name":"cost_cents","type":"BIGINT"},{"name":"customer_count","type":"BIGINT"}]\n[1320000,3]',
: '{"query_id":"smoke"}\n[{"name":"group_name","type":"VARCHAR"},{"name":"sample_count","type":"BIGINT"}]\n["Alpha",2000]',
{
headers: { 'content-type': 'application/x-ndjson' },
}
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/app/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('app create', () => {
expect(paths).toContain('src/App.tsx');
expect(paths).toContain('.oxlintrc.json');
expect(readFileSync(join(directory, 'AGENTS.md'), 'utf8')).toContain(
'https://github.com/altertable-ai/data-app/blob/v0.78.0/docs/app-authoring.md'
`https://github.com/altertable-ai/data-app/blob/v${recommendedDataAppVersion(dataAppPayload)}/docs/app-authoring.md`
);
expect(
paths.some(path => /tests|fixtures|node_modules|\.txt$/.test(path))
Expand Down
12 changes: 5 additions & 7 deletions cli/src/commands/app/lib/distribution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ test('distribution embeds a deterministic starter with an exact package pin and
title: identity.title,
scope: identity.scope,
});
expect(
JSON.parse(files['package.json']!).dependencies['@altertable/data-app']
).toBe(recommendedDataAppVersion(dataAppPayload));
const version = recommendedDataAppVersion(dataAppPayload);
expect(JSON.parse(files['package.json']!).dependencies).toMatchObject({
'@altertable/data-app': '0.78.0',
'@altertable/data-app-react': '0.78.0',
'@altertable/data-app-bun': '0.78.0',
'@altertable/data-app': version,
'@altertable/data-app-react': version,
'@altertable/data-app-bun': version,
});
expect(files['src/main.tsx']).toContain("from '@altertable/data-app-react'");
expect(files['src/App.tsx']).toBe(payload.starter['src/App.tsx']);
Expand All @@ -68,7 +66,7 @@ test('app-owned authoring links resolve within the generated files', async () =>
scope: { organization: 'Test', environment: 'test' },
});
expect(files['AGENTS.md']).toContain(
'https://github.com/altertable-ai/data-app/blob/v0.78.0/docs/app-authoring.md'
`https://github.com/altertable-ai/data-app/blob/v${recommendedDataAppVersion(dataAppPayload)}/docs/app-authoring.md`
);
for (const [name, content] of Object.entries(files)) {
if (!name.endsWith('.md')) continue;
Expand Down
35 changes: 34 additions & 1 deletion cli/src/commands/app/upgrade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from '@/commands/app/lib/package.ts';
import { loadDataAppPayload } from '@/commands/app/lib/payload.ts';
import { upgradeApp } from '@/commands/app/upgrade.ts';
import { runCommandWithTestRuntime } from '@/test-utils/cli.ts';

const dataAppPayload = await loadDataAppPayload();

Expand Down Expand Up @@ -95,6 +96,17 @@ test('an exact current pin is a no-op', async () => {
expect(await snapshot(directory)).toEqual(before);
});

test('upgrade reports an actionable error when the app lockfile is missing', async () => {
const directory = await fixture();
await rm(join(directory, 'bun.lock'));
expect(
runCommandWithTestRuntime(['app', 'upgrade', '--dir', directory])
).rejects.toMatchObject({
exitCode: 10,
message: expect.stringContaining('Cannot read a valid bun.lock'),
});
});

test('failed resolution restores the manifest and lockfile', async () => {
const directory = await fixture();
await updateManifest(directory, pkg => {
Expand Down Expand Up @@ -405,12 +417,33 @@ test('upgrades a published 0.77 app without replacing its identity or custom UI'
});
}
await install();
expect(await upgradeApp(directory)).toBe(true);
const result = await runCommandWithTestRuntime([
'app',
'upgrade',
'--dir',
directory,
]);
expect(result.exitCode).toBe(0);
const output = JSON.parse(result.stdout.join(''));
expect(output).toMatchObject({
upgraded: true,
runtimeVersion: recommendedDataAppVersion(dataAppPayload),
});
expect(await readFile(join(directory, 'app.ts'), 'utf8')).toBe(appSource);
expect(await readFile(join(directory, 'src/App.tsx'), 'utf8')).toBe(
customView
);
await install(true);
const { checkAppProject } = await import('@/commands/app/lint.ts');
await checkAppProject(directory);
const current = await runCommandWithTestRuntime([
'app',
'upgrade',
'--dir',
directory,
]);
expect(JSON.parse(current.stdout.join(''))).toMatchObject({
upgraded: false,
nextSteps: [],
});
}, 60_000);
11 changes: 0 additions & 11 deletions data-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,6 @@ bun install --cwd data-app/starter --lockfile-only
Update the other lockfiles, then run setup and the verification below. Review and commit the
lockfiles; never resolve `latest` during app creation.

## Upgrades

`app upgrade` updates declared data-app dependencies and lockfiles to the CLI's tested version,
preserving source, identity, dependency placement, and unrelated packages. It does not downgrade
newer installations and restores the manifest and lockfile if resolution fails.

SDK 0.78 uses a shared literal `app.ts` declaration, browser-run operations, and
`serveLocalApp({ app, page })`. Older `app.json` projects require an author-owned source migration
using their existing identity, queries, and UI. Upgrade never replaces their source with a demo.
Adapt the source using the installed SDK authoring recipe, run `app lint`, and restart previews.

## Verify

```fish
Expand Down
16 changes: 8 additions & 8 deletions data-app/file-preview/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions data-app/file-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"dev": "data-app-preview"
},
"dependencies": {
"@altertable/data-app": "0.78.0",
"@altertable/data-app-bun": "0.78.0",
"@altertable/data-app-react": "0.78.0",
"@altertable/data-app": "0.79.0",
"@altertable/data-app-bun": "0.79.0",
"@altertable/data-app-react": "0.79.0",
"react": "19.3.1",
"react-dom": "19.3.1",
"@altertable/data-app-manifest": "0.78.0"
"@altertable/data-app-manifest": "0.79.0"
}
}
14 changes: 7 additions & 7 deletions data-app/starter/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions data-app/tests/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions data-app/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"typescript": "7.0.2"
},
"dependencies": {
"@altertable/data-app": "0.78.0",
"@altertable/data-app-bun": "0.78.0"
"@altertable/data-app": "0.79.0",
"@altertable/data-app-bun": "0.79.0"
}
}
Loading
Loading