Repository navigation
Conversation
`altertable app dev --file index.tsx` previews a single-file data app locally. The CLI reads the literal `defineDataApp` scope, refuses a profile mismatch, installs a pinned `@altertable/data-app` runtime under the config directory, and serves the file through the loopback lakehouse proxy with live reload. The preview server only accepts SQL from its own origin and host. Co-authored-by: Cursor <cursoragent@cursor.com>
Member
Author
|
@francoischalifour it's a bit more code than I anticipated because with a single file we need to provide the runtime. But it works nicely! |
albert20260301
approved these changes
Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
altertable app dev --file index.tsx, which previews a single-file data app locally. This is the sameindex.tsxformat thatapp publishandapp validatealready accept.defineDataApp({ scope })from the file and refuses to start if it doesn't match the selected profile. The file goes throughBun.Transpilerfirst, so JSX, TypeScript and regex literals don't confuse the scope reader.@altertable/data-appruntime (the same version as the starter) under the config directory. Installation reuses the starter's frozen lockfile and is an offline no-op once installed./api/sqlonly accepts requests from the server's own origin (Origin andSec-Fetch-Sitechecks), and every route except the static page checks theHostheader to block DNS rebinding.--dirand--filecan't be combined.--portdefaults to 25837 for--file.Why
Single-file apps can be validated and published, but there was no way to iterate on one locally against the lakehouse before publishing.
Follow-up: the preview server and host page are generic and should eventually move into
@altertable/data-app(next toserveLocalApp), leaving the CLI with a thin launcher.Checklist
CHANGELOG.mdupdatedBREAKING CHANGE: …) and changelog (not a breaking change)./scripts/verify.shpasses locally. I also ran the preview server against the real@altertable/data-app0.68.0 package: the page and bundle load, valid same-origin SQL goes through, a request without an Origin header gets 403, and an invalid query gets 400.