@teable/create-app 1.0.1 → 1.0.2
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 +4 -2
- package/dist/template/AGENTS.md +23 -18
- package/dist/template/package.json +1 -1
- package/package.json +1 -1
- package/skill/teable-next-app/SKILL.md +26 -19
package/README.md
CHANGED
|
@@ -13,8 +13,10 @@ cd my-app && bun install && bun run check
|
|
|
13
13
|
which must be absent or empty (a lone `.git` is fine), and `teable.json`
|
|
14
14
|
naming the app on Teable; without `--app-id` it names none. The app's
|
|
15
15
|
`AGENTS.md` (read by Claude Code through `CLAUDE.md`, and by other agents)
|
|
16
|
-
holds its rules, commands and how to publish it with `teable
|
|
17
|
-
|
|
16
|
+
holds its rules, commands and how to publish it with `teable-next publish`
|
|
17
|
+
([`@teable/next-cli`](https://www.npmjs.com/package/@teable/next-cli), which
|
|
18
|
+
also starts an app in a project on Teable: `teable-next init <dir> --project
|
|
19
|
+
<projectId>`). It needs [Bun](https://bun.sh).
|
|
18
20
|
|
|
19
21
|
## The Agent Skill
|
|
20
22
|
|
package/dist/template/AGENTS.md
CHANGED
|
@@ -4,7 +4,7 @@ This repository is one Teable app: a Drizzle schema plus read, write and task
|
|
|
4
4
|
methods, written with `@teable/app`. Teable runs it on Cloudflare in a Durable
|
|
5
5
|
Object with its own SQLite database, and makes an HTTP API and MCP tools from
|
|
6
6
|
its methods. Change it here, run the checks, and publish it with
|
|
7
|
-
`teable
|
|
7
|
+
`teable-next publish`.
|
|
8
8
|
|
|
9
9
|
It starts as an example (a `notes` table, `listNotes`, `addNote`, a page, a
|
|
10
10
|
test at each level) that shows the whole shape. Replace it with the app the
|
|
@@ -21,7 +21,7 @@ user needs.
|
|
|
21
21
|
| `src/components/ui/` | shadcn's components on UI SDK, as `bunx shadcn add <name>` writes them (`components.json`); the app's own. |
|
|
22
22
|
| `test/` | Method tests. They run in workerd, against a real SQLite database. |
|
|
23
23
|
| `src/**/*.test.tsx` | Page tests, in jsdom, against a stubbed client. |
|
|
24
|
-
| `teable.json` | `appId`: which app on Teable this is.
|
|
24
|
+
| `teable.json` | `appId`: which app on Teable this is. `teable-next` and the pages read it; leave it as it is. |
|
|
25
25
|
| `dist/` | What `bun run build` writes: `server.js`, which publishing uploads, and `pages/`. Not committed. |
|
|
26
26
|
|
|
27
27
|
## Commands
|
|
@@ -32,13 +32,15 @@ bun run check # typecheck, tests, migration checks; befor
|
|
|
32
32
|
bun run build # dist/server.js (what publish uploads) and dist/pages/
|
|
33
33
|
bun run db:generate --name <change> # after changing schema.ts: the next migration
|
|
34
34
|
bun run test [file] [-t <name>] # tests only, or some of them
|
|
35
|
-
teable
|
|
36
|
-
teable
|
|
37
|
-
teable
|
|
38
|
-
teable
|
|
35
|
+
teable-next pull # before you start: the latest from Teable
|
|
36
|
+
teable-next push -m "<what changed>" # commit, and save the source to Teable
|
|
37
|
+
teable-next publish # check, build and deploy dist/server.js, with its commit, as the next version
|
|
38
|
+
teable-next versions # published versions, newest first: when, by whom, which commit
|
|
39
|
+
teable-next rollback --version <n> # deploy version n's code again, as the next version
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
`teable
|
|
42
|
+
`teable-next <command> --help` lists every option; without the CLI
|
|
43
|
+
installed, `npx @teable/next-cli <command>` runs it. There is no local server
|
|
42
44
|
(`dev`): the runtime that hosts apps is not published. Tests are the loop:
|
|
43
45
|
methods against a real database, pages against a stubbed client. Publish to
|
|
44
46
|
see the app running.
|
|
@@ -255,8 +257,10 @@ the migrations.
|
|
|
255
257
|
| `Declare capabilities: [...] in createApp`, or `not permitted to access the internet` | Declare the capability; use it in a task. |
|
|
256
258
|
| `must export the class from define() as "App"` (build) | `export const App = app.define({ ... })` in `src/server/index.ts`. |
|
|
257
259
|
| `Stripping types is currently unsupported for files under node_modules` | Vite or Vitest ran on Node; run them through `bun run test` and `bun run build`. |
|
|
258
|
-
| `
|
|
259
|
-
| `
|
|
260
|
+
| `uncommitted changes` or `is not pushed yet` from `teable-next publish` | Publishing deploys only what is pushed: `teable-next push -m "<what changed>"`, then publish again. |
|
|
261
|
+
| `moved to ... since your last pull` from `teable-next push` | Someone else pushed: `teable-next pull` (rebase on `teable/main` if your commits diverged), then push again. |
|
|
262
|
+
| `FORBIDDEN` from `teable-next publish` or `rollback` | Publishing takes the `creator` or `owner` role in the app's space; ask the user. |
|
|
263
|
+
| `CONFLICT` from `teable-next rollback` | That version lacks a migration the live database has run: roll forward with a new version instead. |
|
|
260
264
|
| `RATE_LIMITED` (HTTP 429) | Wait as long as `Retry-After` says, then try again. |
|
|
261
265
|
| `Deploy rejected: built for app protocol N; this runtime speaks M` (publish) | `bun add @teable/app@latest`, then check, build and publish again. |
|
|
262
266
|
| `Deploy rejected` with `Migration ... failed: ...` (publish) | The migration does not fit the live rows (a NOT NULL column without a default, a CHECK some rows break): make it handle them (a default, an `UPDATE` first). A rejected migration never ran: edit it. |
|
|
@@ -264,19 +268,20 @@ the migrations.
|
|
|
264
268
|
## Publishing
|
|
265
269
|
|
|
266
270
|
Once `bun run check` and `bun run build` pass, push and publish:
|
|
267
|
-
`teable
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
271
|
+
`teable-next push -m "<what changed>"`, then `teable-next publish`, which
|
|
272
|
+
deploys exactly the commit pushed: it runs the check and the build again,
|
|
273
|
+
and prints the app's URLs. Do not wait to be asked: publishing is how the
|
|
274
|
+
user gets the change, and a publish that fails changes nothing. It takes the
|
|
275
|
+
`creator` or `owner` role in the app's space. Teable starts the new version
|
|
276
|
+
on a copy of the live data first, running its migrations, then on the live
|
|
277
|
+
data, and makes it live only if both work; open pages read everything again.
|
|
278
|
+
Every version records when it was published, by whom, and from which commit.
|
|
279
|
+
Then tell the user what changed. The methods are live at once through the API
|
|
275
280
|
(`/api/v4/apps/<appId>/methods/<name>`, described at `.../openapi.json`), MCP
|
|
276
281
|
(`/api/v4/apps/<appId>/mcp`) and the app on Teable; Teable does not serve
|
|
277
282
|
`dist/pages` yet.
|
|
278
283
|
|
|
279
|
-
`teable
|
|
284
|
+
`teable-next rollback` deploys an earlier version's code again, as the next
|
|
280
285
|
version. It cannot go back past a migration: the live database has run it,
|
|
281
286
|
and code without it does not start, so the rollback is refused (`CONFLICT`);
|
|
282
287
|
undo a schema change with a new migration. A rollback changes only what
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@fontsource-variable/inter": "5.3.0",
|
|
15
15
|
"@tanstack/react-query": "5.108.4",
|
|
16
16
|
"@tanstack/react-router": "1.170.46",
|
|
17
|
-
"@teable/app": "^5.0.
|
|
17
|
+
"@teable/app": "^5.0.2",
|
|
18
18
|
"@ui-sdk/core": "0.1.0-beta.24",
|
|
19
19
|
"@ui-sdk/react": "0.1.0-beta.24",
|
|
20
20
|
"class-variance-authority": "0.7.1",
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ write and task methods (`src/server/index.ts`, with `@teable/app`), migrations
|
|
|
10
10
|
(`drizzle/`), pages (`src/web/`) and tests. Teable runs it on Cloudflare, one
|
|
11
11
|
Durable Object with its own SQLite database per app, and makes an HTTP API
|
|
12
12
|
and MCP tools from its methods. You build it in a shell, like any project,
|
|
13
|
-
and publish it with
|
|
13
|
+
and publish it with `teable-next`, the CLI for Teable apps.
|
|
14
14
|
|
|
15
15
|
## When to use it
|
|
16
16
|
|
|
@@ -24,17 +24,23 @@ and publish it with the `teable` CLI.
|
|
|
24
24
|
|
|
25
25
|
## Start
|
|
26
26
|
|
|
27
|
+
An app is a project on Teable that runs in teable-next: the app's id is the
|
|
28
|
+
project's (`bseXXX`), the project the user is working in.
|
|
29
|
+
|
|
27
30
|
```sh
|
|
28
|
-
teable
|
|
29
|
-
teable
|
|
30
|
-
teable
|
|
31
|
+
teable-next init <dir> --project <projectId> # a new app: writes it, pushes it to the project's repository
|
|
32
|
+
teable-next clone <projectId> [dir] # an app that has code: checks out its repository
|
|
33
|
+
teable-next pull # in a checkout you have: bring it up to date first
|
|
31
34
|
```
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
`teable-next` acts as the user, with their token: `TEABLE_TOKEN` (a Teable
|
|
37
|
+
sandbox sets it, and `TEABLE_ENDPOINT`), or the one `teable-next login
|
|
38
|
+
--token <token>` saved. Where it is not installed (Claude Code on someone's
|
|
39
|
+
own machine, say), `npx @teable/next-cli <command>` (or `bunx`) runs it. To
|
|
40
|
+
try an app with no project yet, `npx @teable/create-app <dir>` writes the
|
|
41
|
+
same blank app, without an app id; `git init` it. Then `bun install`, and
|
|
42
|
+
read the app's `AGENTS.md` before changing anything: it is the app's own
|
|
43
|
+
instructions, current for the SDK the app uses.
|
|
38
44
|
|
|
39
45
|
## The loop
|
|
40
46
|
|
|
@@ -42,16 +48,17 @@ the app's own instructions, current for the SDK the app uses.
|
|
|
42
48
|
2. `bun run check`: typecheck, tests (methods in workerd against a real
|
|
43
49
|
database, pages in jsdom), migration checks.
|
|
44
50
|
3. `bun run build`: `dist/server.js`, which publishing uploads.
|
|
45
|
-
4. `teable
|
|
46
|
-
|
|
47
|
-
5. `teable
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
takes the `creator` or `owner`
|
|
51
|
-
what changed
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
4. `teable-next push -m "<what changed>"`: commit and save the source to the
|
|
52
|
+
app's repository on Teable.
|
|
53
|
+
5. `teable-next publish`: the check and the build run again, then Teable
|
|
54
|
+
runs the new version's migrations on a copy of the live data, then on the
|
|
55
|
+
live data, and makes it live only if both work. Publish as soon as the
|
|
56
|
+
checks pass; do not wait to be asked. It takes the `creator` or `owner`
|
|
57
|
+
role in the app's space. Then tell the user what changed, with the URLs
|
|
58
|
+
it prints.
|
|
59
|
+
|
|
60
|
+
`teable-next versions` lists published versions, with who published each and
|
|
61
|
+
from which commit. `teable-next rollback --version <n>` deploys an earlier
|
|
55
62
|
version's code again, as the next version; it is refused past a migration
|
|
56
63
|
(roll forward instead), and it leaves the repository as it is, so fix or
|
|
57
64
|
revert the code before the next publish. There is no local server: tests are
|