@quickback-dev/cli 0.66.0 → 0.66.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 +7 -4
- package/dist/commands/build.d.ts +51 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +793 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/build.test.d.ts +2 -0
- package/dist/commands/build.test.d.ts.map +1 -0
- package/dist/commands/build.test.js +150 -0
- package/dist/commands/build.test.js.map +1 -0
- package/dist/commands/check.d.ts +2 -2
- package/dist/commands/check.js +4 -4
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/create.d.ts +1 -1
- package/dist/commands/create.js +7 -7
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/deploy.d.ts +6 -6
- package/dist/commands/deploy.js +23 -23
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/example.js +1 -1
- package/dist/commands/example.js.map +1 -1
- package/dist/commands/mcp.js +1 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/migrate.d.ts +1 -1
- package/dist/commands/migrate.js +3 -3
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/migrations.js +2 -2
- package/dist/commands/migrations.js.map +1 -1
- package/dist/commands/push.js +1 -1
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/start.js +1 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/cursor/quickback.mdc +1 -1
- package/dist/index.js +18 -15
- package/dist/index.js.map +1 -1
- package/dist/lib/auth.js +1 -1
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/compiler-floor.d.ts +1 -1
- package/dist/lib/compiler-floor.js +1 -1
- package/dist/lib/file-loader.js +2 -2
- package/dist/lib/file-loader.js.map +1 -1
- package/dist/lib/file-writer.d.ts +2 -0
- package/dist/lib/file-writer.d.ts.map +1 -1
- package/dist/lib/file-writer.js +16 -0
- package/dist/lib/file-writer.js.map +1 -1
- package/dist/lib/file-writer.test.js +16 -0
- package/dist/lib/file-writer.test.js.map +1 -1
- package/dist/lib/migrations/file-envelopes.js +3 -3
- package/dist/lib/migrations/file-envelopes.js.map +1 -1
- package/dist/lib/prepare-output.test.js +1 -1
- package/dist/lib/prepare-output.test.js.map +1 -1
- package/dist/lib/schema-sync/index.js +1 -1
- package/dist/lib/schema-sync/index.test.js +1 -1
- package/dist/lib/schema-sync/index.test.js.map +1 -1
- package/dist/lib/wrangler-resources.d.ts.map +1 -1
- package/dist/lib/wrangler-resources.js +5 -2
- package/dist/lib/wrangler-resources.js.map +1 -1
- package/dist/lib/wrangler-resources.test.js +6 -0
- package/dist/lib/wrangler-resources.test.js.map +1 -1
- package/dist/skill/SKILL.md +24 -9
- package/dist/skill/docs/api/crud.md +7 -0
- package/dist/skill/docs/api/index.md +1 -1
- package/dist/skill/docs/api/openapi.md +1 -1
- package/dist/skill/docs/changelog/index.md +27 -1
- package/dist/skill/docs/configure/agents.md +1 -1
- package/dist/skill/docs/configure/domains.md +1 -1
- package/dist/skill/docs/configure/index.md +11 -5
- package/dist/skill/docs/configure/providers.md +6 -3
- package/dist/skill/docs/configure/single-tenant.md +7 -3
- package/dist/skill/docs/configure/variables.md +3 -3
- package/dist/skill/docs/define/access.md +10 -0
- package/dist/skill/docs/define/actions/defining.md +35 -7
- package/dist/skill/docs/define/actions/index.md +1 -1
- package/dist/skill/docs/define/actions/record-and-standalone.md +7 -4
- package/dist/skill/docs/define/actions/scoped-db.md +68 -21
- package/dist/skill/docs/define/areas.md +1 -1
- package/dist/skill/docs/define/diagnostics.md +1 -0
- package/dist/skill/docs/define/encryption.md +1 -1
- package/dist/skill/docs/define/feature.md +17 -8
- package/dist/skill/docs/define/firewall.md +2 -0
- package/dist/skill/docs/define/guards.md +27 -3
- package/dist/skill/docs/define/index.md +1 -1
- package/dist/skill/docs/define/relationships.md +7 -0
- package/dist/skill/docs/define/schema.md +44 -14
- package/dist/skill/docs/define/security.md +1 -1
- package/dist/skill/docs/define/transitions.md +35 -4
- package/dist/skill/docs/define/triggers.md +14 -3
- package/dist/skill/docs/define/views.md +33 -0
- package/dist/skill/docs/index.md +2 -2
- package/dist/skill/docs/platform/auth/api-keys.md +2 -2
- package/dist/skill/docs/platform/auth/using-auth.md +37 -0
- package/dist/skill/docs/platform/database/d1.md +15 -3
- package/dist/skill/docs/platform/database/neon.md +4 -4
- package/dist/skill/docs/platform/email/index.md +1 -1
- package/dist/skill/docs/platform/queues/handlers.md +1 -1
- package/dist/skill/docs/platform/queues/using-queues.md +1 -1
- package/dist/skill/docs/platform/realtime/using-realtime.md +6 -4
- package/dist/skill/docs/platform/schedules/index.md +1 -1
- package/dist/skill/docs/platform/storage/index.md +3 -3
- package/dist/skill/docs/platform/storage/r2.md +87 -37
- package/dist/skill/docs/platform/storage/using-r2.md +99 -19
- package/dist/skill/docs/platform/webhooks/inbound.md +40 -0
- package/dist/skill/docs/start/deploy-browser.md +40 -45
- package/dist/skill/docs/start/deploy-owner-access.md +60 -52
- package/dist/skill/docs/start/deploy.md +4 -4
- package/dist/skill/docs/start/first-api.md +2 -2
- package/dist/skill/docs/start/hand-crafted.md +3 -3
- package/dist/skill/docs/start/index.md +3 -3
- package/dist/skill/docs/start/patterns.md +17 -2
- package/dist/skill/docs/start/quickstart.md +3 -3
- package/dist/skill/docs/start/template-blog.md +2 -2
- package/dist/skill/docs/start/template-cloudflare.md +3 -3
- package/dist/skill/docs/start/template-empty.md +1 -1
- package/dist/skill/docs/start/templates.md +1 -1
- package/dist/skill/docs/tooling/claude-skill.md +1 -1
- package/dist/skill/docs/tooling/cli.md +21 -16
- package/dist/skill/docs/tooling/cloud-compiler/authentication.md +2 -2
- package/dist/skill/docs/tooling/cloud-compiler/endpoints.md +5 -3
- package/dist/skill/docs/tooling/cloud-compiler/index.md +1 -1
- package/dist/skill/docs/tooling/cloud-compiler/local-compiler.md +2 -2
- package/dist/skill/docs/tooling/cloud-compiler/troubleshooting.md +74 -1
- package/dist/skill/docs/tooling/output.md +23 -2
- package/dist/skill/docs/tooling/troubleshooting.md +1 -1
- package/dist/skill/docs/ui/account/customization.md +1 -1
- package/dist/skill/docs/ui/account/environment-variables.md +2 -2
- package/dist/skill/docs/ui/account/features/admin.md +1 -1
- package/dist/skill/docs/ui/account/features/api-keys.md +10 -8
- package/dist/skill/docs/ui/account/features/avatars.md +24 -8
- package/dist/skill/docs/ui/account/features/index.md +16 -11
- package/dist/skill/docs/ui/account/features/organizations.md +3 -2
- package/dist/skill/docs/ui/account/hooks.md +2 -0
- package/dist/skill/docs/ui/account/index.md +10 -5
- package/dist/skill/docs/ui/account/with-quickback.md +2 -2
- package/dist/skill/docs/ui/admin/actions.md +97 -3
- package/dist/skill/docs/ui/admin/components.md +4 -6
- package/dist/skill/docs/ui/admin/connecting.md +15 -3
- package/dist/skill/docs/ui/admin/index.md +71 -6
- package/dist/skill/docs/ui/admin/inline-editing.md +38 -4
- package/dist/skill/docs/ui/admin/record-layouts.md +22 -21
- package/dist/skill/docs/ui/admin/schema-format.md +39 -2
- package/dist/skill/docs/ui/admin/schema-registry.md +107 -7
- package/dist/skill/docs/ui/admin/security.md +19 -4
- package/dist/skill/docs/ui/admin/table-views.md +59 -12
- package/package.json +1 -1
- package/src/cursor/quickback.mdc +1 -1
- package/src/skill/SKILL.md +24 -9
- package/src/skill/docs/api/crud.md +7 -0
- package/src/skill/docs/api/index.md +1 -1
- package/src/skill/docs/api/openapi.md +1 -1
- package/src/skill/docs/changelog/index.md +27 -1
- package/src/skill/docs/configure/agents.md +1 -1
- package/src/skill/docs/configure/domains.md +1 -1
- package/src/skill/docs/configure/index.md +11 -5
- package/src/skill/docs/configure/providers.md +6 -3
- package/src/skill/docs/configure/single-tenant.md +7 -3
- package/src/skill/docs/configure/variables.md +3 -3
- package/src/skill/docs/define/access.md +10 -0
- package/src/skill/docs/define/actions/defining.md +35 -7
- package/src/skill/docs/define/actions/index.md +1 -1
- package/src/skill/docs/define/actions/record-and-standalone.md +7 -4
- package/src/skill/docs/define/actions/scoped-db.md +68 -21
- package/src/skill/docs/define/areas.md +1 -1
- package/src/skill/docs/define/diagnostics.md +1 -0
- package/src/skill/docs/define/encryption.md +1 -1
- package/src/skill/docs/define/feature.md +17 -8
- package/src/skill/docs/define/firewall.md +2 -0
- package/src/skill/docs/define/guards.md +27 -3
- package/src/skill/docs/define/index.md +1 -1
- package/src/skill/docs/define/relationships.md +7 -0
- package/src/skill/docs/define/schema.md +44 -14
- package/src/skill/docs/define/security.md +1 -1
- package/src/skill/docs/define/transitions.md +35 -4
- package/src/skill/docs/define/triggers.md +14 -3
- package/src/skill/docs/define/views.md +33 -0
- package/src/skill/docs/index.md +2 -2
- package/src/skill/docs/platform/auth/api-keys.md +2 -2
- package/src/skill/docs/platform/auth/using-auth.md +37 -0
- package/src/skill/docs/platform/database/d1.md +15 -3
- package/src/skill/docs/platform/database/neon.md +4 -4
- package/src/skill/docs/platform/email/index.md +1 -1
- package/src/skill/docs/platform/queues/handlers.md +1 -1
- package/src/skill/docs/platform/queues/using-queues.md +1 -1
- package/src/skill/docs/platform/realtime/using-realtime.md +6 -4
- package/src/skill/docs/platform/schedules/index.md +1 -1
- package/src/skill/docs/platform/storage/index.md +3 -3
- package/src/skill/docs/platform/storage/r2.md +87 -37
- package/src/skill/docs/platform/storage/using-r2.md +99 -19
- package/src/skill/docs/platform/webhooks/inbound.md +40 -0
- package/src/skill/docs/start/deploy-browser.md +40 -45
- package/src/skill/docs/start/deploy-owner-access.md +60 -52
- package/src/skill/docs/start/deploy.md +4 -4
- package/src/skill/docs/start/first-api.md +2 -2
- package/src/skill/docs/start/hand-crafted.md +3 -3
- package/src/skill/docs/start/index.md +3 -3
- package/src/skill/docs/start/patterns.md +17 -2
- package/src/skill/docs/start/quickstart.md +3 -3
- package/src/skill/docs/start/template-blog.md +2 -2
- package/src/skill/docs/start/template-cloudflare.md +3 -3
- package/src/skill/docs/start/template-empty.md +1 -1
- package/src/skill/docs/start/templates.md +1 -1
- package/src/skill/docs/tooling/claude-skill.md +1 -1
- package/src/skill/docs/tooling/cli.md +21 -16
- package/src/skill/docs/tooling/cloud-compiler/authentication.md +2 -2
- package/src/skill/docs/tooling/cloud-compiler/endpoints.md +5 -3
- package/src/skill/docs/tooling/cloud-compiler/index.md +1 -1
- package/src/skill/docs/tooling/cloud-compiler/local-compiler.md +2 -2
- package/src/skill/docs/tooling/cloud-compiler/troubleshooting.md +74 -1
- package/src/skill/docs/tooling/output.md +23 -2
- package/src/skill/docs/tooling/troubleshooting.md +1 -1
- package/src/skill/docs/ui/account/customization.md +1 -1
- package/src/skill/docs/ui/account/environment-variables.md +2 -2
- package/src/skill/docs/ui/account/features/admin.md +1 -1
- package/src/skill/docs/ui/account/features/api-keys.md +10 -8
- package/src/skill/docs/ui/account/features/avatars.md +24 -8
- package/src/skill/docs/ui/account/features/index.md +16 -11
- package/src/skill/docs/ui/account/features/organizations.md +3 -2
- package/src/skill/docs/ui/account/hooks.md +2 -0
- package/src/skill/docs/ui/account/index.md +10 -5
- package/src/skill/docs/ui/account/with-quickback.md +2 -2
- package/src/skill/docs/ui/admin/actions.md +97 -3
- package/src/skill/docs/ui/admin/components.md +4 -6
- package/src/skill/docs/ui/admin/connecting.md +15 -3
- package/src/skill/docs/ui/admin/index.md +71 -6
- package/src/skill/docs/ui/admin/inline-editing.md +38 -4
- package/src/skill/docs/ui/admin/record-layouts.md +22 -21
- package/src/skill/docs/ui/admin/schema-format.md +39 -2
- package/src/skill/docs/ui/admin/schema-registry.md +107 -7
- package/src/skill/docs/ui/admin/security.md +19 -4
- package/src/skill/docs/ui/admin/table-views.md +59 -12
|
@@ -1,73 +1,81 @@
|
|
|
1
1
|
# Owner access after a browser deploy
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
first deploy seeds your app's first administrator
|
|
5
|
-
|
|
3
|
+
After you build in **Generated Backend** and deploy from **Cloudflare
|
|
4
|
+
Infrastructure**, the very first deploy seeds your app's first administrator
|
|
5
|
+
(`user.role === "sysadmin"`), a first organization they own, and a password.
|
|
6
|
+
Cloudflare Infrastructure shows the **email**, a **click-to-reveal password**,
|
|
7
|
+
and a normal link to your app's Account login:
|
|
6
8
|
|
|
7
9
|
```
|
|
8
|
-
https://<your-app>.<subdomain>.workers.dev/
|
|
10
|
+
https://<your-app>.<subdomain>.workers.dev/account/login
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
13
|
+
Sign in with that email and password. That's the whole setup. After sign-in,
|
|
14
|
+
`/cms/` opens on the **organization membership** the deploy also seeded — you
|
|
15
|
+
are `owner` of the first org. That is the role hierarchy (`owner` / `admin` /
|
|
16
|
+
`member`), not `user.role`. Start sets `cms.access: "member"` so the CMS uses
|
|
17
|
+
that seat. `user.role === "sysadmin"` is the platform data-plane tier (one
|
|
18
|
+
above `appmanager`); the CMS only falls back to it when you belong to no
|
|
19
|
+
organization.
|
|
20
|
+
|
|
21
|
+
## What you get
|
|
22
|
+
|
|
23
|
+
- **Shown once.** The plaintext password is returned to Start on the deploy
|
|
24
|
+
that created the admin. Quickback stores the hash in your app's auth
|
|
25
|
+
database, never the password. Copy it when you see it — a later refresh
|
|
26
|
+
does not show it again.
|
|
27
|
+
- **A first organization.** The deploy also inserts an organization named after
|
|
28
|
+
your Worker and seats the admin as `owner`, so org-scoped tables and the CMS
|
|
29
|
+
tenant picker have somewhere to land. A routine redeploy does not create a
|
|
30
|
+
second one. If the compiled config sets `features.pinnedOrganizationId`, that
|
|
31
|
+
string **is** the organization id — the pin and the AUTH_DB row match, the
|
|
32
|
+
CMS skips the tenant picker, and the seeded sysadmin is `owner` of that org
|
|
33
|
+
(so create/update/delete in the CMS actually work). Without a pin the id is
|
|
34
|
+
a random hex.
|
|
35
|
+
- **Your app's login.** After that reveal you sign in through **your app's
|
|
36
|
+
own auth** — the same email + password login every other user of your app
|
|
37
|
+
gets. If your app has the Account UI enabled, that's `/account/login`.
|
|
38
|
+
- **A public URL, not a secret.** The login link is an ordinary
|
|
39
|
+
`<a href="…/account/login">`. It does not carry a token. Anyone can open
|
|
40
|
+
the page; only the password signs you in.
|
|
41
|
+
|
|
42
|
+
The email is the **verified address on your Quickback account** — the same
|
|
43
|
+
one you used to sign in to Start. It is written once, when the admin is
|
|
44
|
+
created. The broker never changes the email afterwards.
|
|
45
|
+
|
|
46
|
+
Type it exactly as shown next to the password. Apps seeded before this keep
|
|
47
|
+
whatever address they were given (`owner@<app>.invalid` on older deploys).
|
|
40
48
|
|
|
41
49
|
## Signing up yourself doesn't make you an admin
|
|
42
50
|
|
|
43
51
|
`/account/signup` creates an ordinary user. It never sets
|
|
44
|
-
`role === "
|
|
45
|
-
the only path to the first
|
|
52
|
+
`role === "sysadmin"`, so that account can't open `/cms/`. The seeded
|
|
53
|
+
admin is the only path to the first administrator.
|
|
46
54
|
|
|
47
55
|
No confirmation email is sent, either — apps built from Start default to email
|
|
48
56
|
and password with verification off, because a `workers.dev` deploy has no
|
|
49
57
|
verified sending domain. If you're waiting on a signup email, nothing is
|
|
50
|
-
coming;
|
|
58
|
+
coming; use the credentials in Cloudflare Infrastructure.
|
|
51
59
|
|
|
52
|
-
**Quickback is not your app's identity provider.** The
|
|
53
|
-
bootstrap window, not a login method: once
|
|
54
|
-
no runtime dependency on Quickback or the deploy broker for
|
|
60
|
+
**Quickback is not your app's identity provider.** The password reveal is a
|
|
61
|
+
bootstrap window, not a login method: once you've signed in (or reset), your
|
|
62
|
+
app has no runtime dependency on Quickback or the deploy broker for
|
|
63
|
+
authentication.
|
|
55
64
|
|
|
56
|
-
## Lost access
|
|
65
|
+
## Lost access
|
|
57
66
|
|
|
58
|
-
Deployed apps on `workers.dev` can't send password-reset email
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
67
|
+
Deployed apps on `workers.dev` can't send password-reset email until the
|
|
68
|
+
app has outbound email (a custom domain + a sending provider). Copy the
|
|
69
|
+
password when Cloudflare Infrastructure first shows it. Once email works,
|
|
70
|
+
Better Auth's own forgot-password flow can reach that inbox, because it is
|
|
71
|
+
a real, verified address.
|
|
62
72
|
|
|
63
|
-
|
|
64
|
-
working, claimed or not. A fresh link re-opens the claim page on its own —
|
|
65
|
-
nothing has to be reset first, because "claimable" just means a signed,
|
|
66
|
-
unexpired, unused token exists.
|
|
73
|
+
A routine redeploy does **not** re-surface credentials.
|
|
67
74
|
|
|
68
75
|
## For CLI deploys
|
|
69
76
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
Browser deploys seed the admin automatically. Apps deployed with
|
|
78
|
+
`quickback deploy` don't; create your admin through your own flow, or deploy
|
|
79
|
+
once through Start to bootstrap. The generated `/__quickback/claim` route
|
|
80
|
+
still exists for older apps and answers 404 unless a leftover
|
|
81
|
+
`QUICKBACK_CLAIM_KEY` Worker secret is set — new deploys do not set it.
|
|
@@ -13,9 +13,9 @@ cd my-app && quickback deploy
|
|
|
13
13
|
## What it does
|
|
14
14
|
|
|
15
15
|
1. **Preflight** — verifies `wrangler` is runnable (via `npx`) and authenticated with Cloudflare (`wrangler whoami`). Log in with `npx wrangler login` or set `CLOUDFLARE_API_TOKEN`.
|
|
16
|
-
2. **Compiles first if needed** — if the project has never compiled (no `wrangler.toml`), it runs the same flow as `quickback
|
|
16
|
+
2. **Compiles first if needed** — if the project has never compiled (no `wrangler.toml`), it runs the same flow as `quickback build` before planning anything.
|
|
17
17
|
3. **Plans from wrangler.toml** — reads the generated `wrangler.toml` and finds every resource whose id is still a placeholder:
|
|
18
|
-
- **D1 databases** — auth, features, files, and
|
|
18
|
+
- **D1 databases** — auth, features, files, webhooks, and audit databases (whichever your project's features pull in; split-database projects get one entry each)
|
|
19
19
|
- **KV namespace** — the `KV` binding used for rate limiting and session overflow
|
|
20
20
|
- **R2 buckets** — file-storage buckets (R2 is referenced by name, so buckets are simply ensured to exist)
|
|
21
21
|
4. **Creates what's missing** — `wrangler d1 create <name>`, `wrangler kv namespace create <BINDING>`, `wrangler r2 bucket create <name>`. Resources are named from your project name exactly the way the compiler names them (`my-app-auth`, `my-app-features`, `my-app-files`, `my-app-KV`, …). If a resource with the expected name already exists in your account, its id is reused instead of creating a duplicate.
|
|
@@ -53,7 +53,7 @@ Run it again any time. When every id is real, there's nothing to create — the
|
|
|
53
53
|
| `--dry-run` | Print the provisioning plan (what would be created vs. what's already set) and exit. Creates nothing. |
|
|
54
54
|
| `--skip-deploy` | Provision resources + sync ids + recompile, but skip migrations and the deploy itself. |
|
|
55
55
|
| `--force` | Overwrite a config id that differs from what Cloudflare reports. Without it, a mismatch prints both values and aborts — never silently overwritten. |
|
|
56
|
-
| `--verbose` | Detailed remote compile failure output (same as `quickback
|
|
56
|
+
| `--verbose` | Detailed remote compile failure output (same as `quickback build --verbose`). |
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
59
|
# See the plan without touching your account
|
|
@@ -78,7 +78,7 @@ Re-run with `--force` to take Cloudflare's value, or fix the config by hand.
|
|
|
78
78
|
|
|
79
79
|
## Notes
|
|
80
80
|
|
|
81
|
-
- **Security-audit database** — projects using unsafe
|
|
81
|
+
- **Security-audit database** — projects using unsafe, `PUBLIC`, or hard-delete actions get an `AUDIT_DB` D1. Compile emits a placeholder id; `quickback deploy` creates the database and writes `auditDatabaseId` back, same as AUTH_DB / features DB. Direct `wrangler deploy` of the placeholder fails Cloudflare 10021 — use `quickback deploy`.
|
|
82
82
|
- **Neon projects** — `quickback deploy` does not apply Postgres migrations. Run `npm run db:migrate` (needs `DATABASE_MIGRATION_URL`) before traffic hits the worker, or use the generated project's `npm run deploy` script which chains both.
|
|
83
83
|
- **Hyperdrive** — a Hyperdrive binding can't be auto-created (it needs your database connection string). Create it with `wrangler hyperdrive create <name> --connection-string=… --caching-disabled` and set `providers.database.config.hyperdrive.id`.
|
|
84
84
|
- **Two logins** — the compile step uses your Quickback account (`quickback login`); resource creation and deploy use your wrangler credentials.
|
|
@@ -70,7 +70,7 @@ export default feature('candidates', {
|
|
|
70
70
|
});
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
> `mode: 'hard'` is also available, but hard deletes erase the row — so they require the security-audit pipeline. On D1
|
|
73
|
+
> `mode: 'hard'` is also available, but hard deletes erase the row — so they require the security-audit pipeline. On D1 the compiler emits an `AUDIT_DB` binding (placeholder id until `quickback deploy` creates the database). A table only drops `...q.softDelete()` when **both** `delete.mode` and `batchDelete.mode` are `'hard'`; declaring the pair on a hard-delete table is itself a compile error.
|
|
74
74
|
|
|
75
75
|
> Prefer the explicit two-export form (or interop with existing Drizzle schemas)? See [feature() — single-export sugar](/define/feature) and [Schema: choosing between `q` and Drizzle](/define/schema#choosing-between-q-and-drizzle). All forms compile identically; mix freely per file.
|
|
76
76
|
|
|
@@ -78,7 +78,7 @@ export default feature('candidates', {
|
|
|
78
78
|
|
|
79
79
|
## What Quickback Generates
|
|
80
80
|
|
|
81
|
-
Run `quickback
|
|
81
|
+
Run `quickback build` and Quickback generates production-ready code.
|
|
82
82
|
|
|
83
83
|
### Security Helpers
|
|
84
84
|
|
|
@@ -118,7 +118,7 @@ export default defineTable(candidates, {
|
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
120
|
quickback login
|
|
121
|
-
quickback
|
|
121
|
+
quickback build
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
The compiler generates a complete `src/` directory with route handlers, middleware, database schemas, and migrations.
|
|
@@ -191,7 +191,7 @@ To add a new feature, create a new directory under `quickback/features/` and rec
|
|
|
191
191
|
```bash
|
|
192
192
|
mkdir quickback/features/jobs
|
|
193
193
|
# Create jobs/jobs.ts with defineTable(...)
|
|
194
|
-
quickback
|
|
194
|
+
quickback build
|
|
195
195
|
```
|
|
196
196
|
|
|
197
197
|
The compiler detects all features automatically — no registration needed.
|
|
@@ -201,7 +201,7 @@ The compiler detects all features automatically — no registration needed.
|
|
|
201
201
|
After any change to your definitions, recompile to regenerate the output:
|
|
202
202
|
|
|
203
203
|
```bash
|
|
204
|
-
quickback
|
|
204
|
+
quickback build
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
The compiler regenerates the entire `src/` directory. Your definitions in `quickback/` are the source of truth — never edit the generated files directly.
|
|
@@ -6,11 +6,11 @@ Cloudflare Workers, backed by D1 or Neon.
|
|
|
6
6
|
|
|
7
7
|
```
|
|
8
8
|
feature() ─┐
|
|
9
|
-
├─► quickback
|
|
9
|
+
├─► quickback build ─► Hono API on Cloudflare
|
|
10
10
|
defineAction() ─┘ (D1 or Neon)
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
When you run `quickback
|
|
13
|
+
When you run `quickback build`, it:
|
|
14
14
|
|
|
15
15
|
1. **Reads your definitions** — every `feature()`, `defineAction()`, and `defineConfig()` in your project
|
|
16
16
|
2. **Validates security** — firewall, access, guards, and masking are checked for consistency
|
|
@@ -84,6 +84,6 @@ The rest of this page is the vocabulary the other pages assume.
|
|
|
84
84
|
|
|
85
85
|
| Term | Definition |
|
|
86
86
|
|------|-----------|
|
|
87
|
-
| **Compiler** | The generator behind `quickback
|
|
87
|
+
| **Compiler** | The generator behind `quickback build`. Use the zero-setup hosted service at `compiler.quickback.dev`, or run the same compiler image locally when source policy or build availability calls for it. |
|
|
88
88
|
| **Stack** | The runtime infrastructure (Cloudflare Workers, D1, KV, R2, Better Auth) where your compiled API runs. |
|
|
89
89
|
| **Template** | A pre-configured project starter (`cloudflare`, `bun`, `turso`) created by `quickback create`. |
|
|
@@ -161,7 +161,14 @@ export default defineAction({
|
|
|
161
161
|
|
|
162
162
|
## Referencing Users / Org Members (Assignees)
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
The **caller's** identity is already on the request — `ctx.userId`,
|
|
165
|
+
`ctx.activeOrgId`, `ctx.roles`, `ctx.userRole`. Do not query `AUTH_DB` for
|
|
166
|
+
the acting user.
|
|
167
|
+
|
|
168
|
+
Assignee-style features need to validate that a *submitted* `userId` is
|
|
169
|
+
actually a member of the caller's organization. The scoped `db` never
|
|
170
|
+
includes Better Auth tables — that is by design. Reach AUTH_DB from an
|
|
171
|
+
**action** via `c.get("authDb")` and the generated `getOrgMemberRole` helper:
|
|
165
172
|
|
|
166
173
|
```typescript
|
|
167
174
|
// quickback/features/projects/actions/assign.ts
|
|
@@ -189,7 +196,15 @@ export default defineAction({
|
|
|
189
196
|
});
|
|
190
197
|
```
|
|
191
198
|
|
|
192
|
-
Store the assignee as a plain text column (e.g. `assigneeId: q.text().optional()`) — don't name it `userId`. `userId` is *not* auto-detected as an owner column on feature tables (that column is `ownerId`), but the compiler flags it: an error if it's the only candidate column on the table, a warning alongside a detected isolation column. Rename to `assigneeId`, or declare `firewall: { owner: { column: "userId" } }` if the column really is the row's owner. See [Firewall](/define/firewall).
|
|
199
|
+
Store the assignee as a plain text column (e.g. `assigneeId: q.text().optional()`) — don't name it `userId`, and **never** `.references(() => users.id)`. Better Auth tables live in `AUTH_DB`; feature tables live in `DB`. A SQL FK across those databases is not possible, and drizzle-kit fails generating features migrations. `userId` is *not* auto-detected as an owner column on feature tables (that column is `ownerId`), but the compiler flags it: an error if it's the only candidate column on the table, a warning alongside a detected isolation column. Rename to `assigneeId`, or declare `firewall: { owner: { column: "userId" } }` if the column really is the row's owner. See [Firewall](/define/firewall) and [Schema → References](/define/schema).
|
|
200
|
+
|
|
201
|
+
On D1 the Better Auth tables are `user`, `organization`, and `member` — not
|
|
202
|
+
`organization_membership`. For a richer query from an `actions/` file, import
|
|
203
|
+
those from `../../../auth/schema` and query `c.get("authDb")`. Account hooks
|
|
204
|
+
get `{ authDb, authSchema }` injected ([Auth Hooks](/ui/account/hooks)).
|
|
205
|
+
Trigger `handler:` args are `{ ctx, db, env }` — `db` is features only; there
|
|
206
|
+
is no `c` and no `authDb`. Prefer `ctx`. Do not import `../../auth/schema`
|
|
207
|
+
from a table file ([Triggers](/define/triggers)).
|
|
193
208
|
|
|
194
209
|
## Admin-Only Status Field
|
|
195
210
|
|
|
@@ -9,7 +9,7 @@ mkdir my-app && cd my-app
|
|
|
9
9
|
npx @quickback-dev/cli start
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
`quickback start` is interactive — it asks for a template and project name, scaffolds the project on disk, and only prompts for an account just before compiling. If you cancel at the login prompt the scaffold stays put; finish later with `quickback login && quickback
|
|
12
|
+
`quickback start` is interactive — it asks for a template and project name, scaffolds the project on disk, and only prompts for an account just before compiling. If you cancel at the login prompt the scaffold stays put; finish later with `quickback login && quickback build`.
|
|
13
13
|
|
|
14
14
|
Already know what you want? Pass the template (and optionally a name) to skip the prompts:
|
|
15
15
|
|
|
@@ -141,7 +141,7 @@ See [feature() — the canonical form](/define/feature) and [Schema: Drizzle int
|
|
|
141
141
|
```bash
|
|
142
142
|
# Compile your definitions — prompts you to sign in or sign up
|
|
143
143
|
# if you haven't already (no separate `quickback login` step needed)
|
|
144
|
-
quickback
|
|
144
|
+
quickback build
|
|
145
145
|
|
|
146
146
|
# Run locally
|
|
147
147
|
npm run dev
|
|
@@ -173,7 +173,7 @@ Quickback generates these endpoints from the example above:
|
|
|
173
173
|
|
|
174
174
|
## Test Your API
|
|
175
175
|
|
|
176
|
-
After `quickback
|
|
176
|
+
After `quickback build` and `npm run dev`, your API is running locally. Open a second terminal and try these requests:
|
|
177
177
|
|
|
178
178
|
```bash
|
|
179
179
|
# 1. Create a user account
|
|
@@ -171,7 +171,7 @@ quickback login
|
|
|
171
171
|
### 3. Compile Your Definitions
|
|
172
172
|
|
|
173
173
|
```bash
|
|
174
|
-
quickback
|
|
174
|
+
quickback build
|
|
175
175
|
```
|
|
176
176
|
|
|
177
177
|
### 4. Create D1 Databases
|
|
@@ -296,7 +296,7 @@ export default defineTable(pages, {
|
|
|
296
296
|
Then recompile:
|
|
297
297
|
|
|
298
298
|
```bash
|
|
299
|
-
quickback
|
|
299
|
+
quickback build
|
|
300
300
|
```
|
|
301
301
|
|
|
302
302
|
## Deploying to Production
|
|
@@ -28,7 +28,7 @@ my-app/
|
|
|
28
28
|
├── quickback/
|
|
29
29
|
│ ├── quickback.config.ts # Compiler configuration
|
|
30
30
|
│ └── features/ # (empty — add your own)
|
|
31
|
-
├── src/ # Compiled output (generated by `quickback
|
|
31
|
+
├── src/ # Compiled output (generated by `quickback build`)
|
|
32
32
|
├── package.json
|
|
33
33
|
├── tsconfig.json
|
|
34
34
|
├── wrangler.toml
|
|
@@ -117,7 +117,7 @@ npm install
|
|
|
117
117
|
### 2. Compile Your Definitions
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
|
-
quickback
|
|
120
|
+
quickback build
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
This prompts for an account on the first run (sign in or create one in the browser), then generates the full `src/` directory, migrations, and configuration files. Subsequent compiles re-use the stored session.
|
|
@@ -216,7 +216,7 @@ Depending on your configuration, the compiler may also generate bindings for:
|
|
|
216
216
|
|
|
217
217
|
By default, the Cloudflare template separates auth tables from application tables:
|
|
218
218
|
|
|
219
|
-
- **`AUTH_DB`** — Better Auth tables (`
|
|
219
|
+
- **`AUTH_DB`** — Better Auth tables (`user`, `session`, `account`, `organization`, `member`)
|
|
220
220
|
- **`DB`** — Your feature tables (`todos`, etc.)
|
|
221
221
|
|
|
222
222
|
This keeps auth data isolated and allows independent scaling. Each database gets its own migration directory:
|
|
@@ -106,7 +106,7 @@ For convenience, templates have short aliases:
|
|
|
106
106
|
|
|
107
107
|
```bash
|
|
108
108
|
cd my-app
|
|
109
|
-
quickback
|
|
109
|
+
quickback build # prompts for login on first run; reuses session after
|
|
110
110
|
npm run dev
|
|
111
111
|
```
|
|
112
112
|
|
|
@@ -263,7 +263,7 @@ Make sure the skill file exists and Claude Code is restarted. You can also invok
|
|
|
263
263
|
|
|
264
264
|
### Generated code has errors
|
|
265
265
|
|
|
266
|
-
Run `quickback
|
|
266
|
+
Run `quickback build` to validate. Share the error messages with Claude for fixes.
|
|
267
267
|
|
|
268
268
|
## Cursor IDE Rules
|
|
269
269
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CLI Reference
|
|
2
2
|
|
|
3
|
-
The Quickback CLI is the fastest way to create,
|
|
3
|
+
The Quickback CLI is the fastest way to create, build, and manage your backend projects.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ Interactive onboarding designed for new users. No flags required.
|
|
|
25
25
|
- Prompts for a template (`cloudflare`, `todos`, `blog`, `empty`)
|
|
26
26
|
- Prompts for a project name (defaults to the current directory's name if empty)
|
|
27
27
|
- Auto-detects whether to scaffold in-place or create a `./<name>/` subdirectory
|
|
28
|
-
- Defers login until just before the
|
|
28
|
+
- Defers login until just before the build step — cancel at the auth prompt and the scaffold stays on disk, ready for `quickback build` later
|
|
29
29
|
|
|
30
30
|
**Example:**
|
|
31
31
|
```bash
|
|
@@ -58,14 +58,19 @@ This scaffolds a complete project with:
|
|
|
58
58
|
|
|
59
59
|
See the [Templates](/start/templates) page for a deeper guide on choosing between them.
|
|
60
60
|
|
|
61
|
-
###
|
|
61
|
+
### Build Your API
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
quickback
|
|
64
|
+
quickback build
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
> `quickback compile` is the former name of this command and still works as an
|
|
68
|
+
> alias — existing scripts and CI pipelines keep running unchanged. `build` is
|
|
69
|
+
> the name used throughout the docs.
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
Use `quickback build --verbose` when a remote build fails and you need the
|
|
73
|
+
underlying command, exit code, stderr/stdout tail, and suggested fixes.
|
|
69
74
|
|
|
70
75
|
Reads your definitions and generates:
|
|
71
76
|
- Database migrations (Drizzle)
|
|
@@ -126,8 +131,8 @@ no server: this is your editor's view of the source, on demand.
|
|
|
126
131
|
|
|
127
132
|
Exit codes: `0` clean · `1` type errors · `2` setup missing. A fresh clone
|
|
128
133
|
(or a project that has never compiled) exits `2` with a pointer at
|
|
129
|
-
`quickback
|
|
130
|
-
resolves against. Re-run `quickback
|
|
134
|
+
`quickback build`, which generates the tsconfig and helpers the check
|
|
135
|
+
resolves against. Re-run `quickback build` after schema changes so the
|
|
131
136
|
helpers track your tables.
|
|
132
137
|
|
|
133
138
|
### Synchronize Managed Columns
|
|
@@ -325,7 +330,7 @@ cd my-app
|
|
|
325
330
|
npm run dev
|
|
326
331
|
|
|
327
332
|
# 3. Recompile after editing definitions
|
|
328
|
-
quickback
|
|
333
|
+
quickback build
|
|
329
334
|
```
|
|
330
335
|
|
|
331
336
|
## Options
|
|
@@ -352,7 +357,7 @@ The CLI parses your feature files with the TypeScript compiler API, and falls ba
|
|
|
352
357
|
Set `QUICKBACK_STRICT_PARSE=1` in CI so a regex-parsed build fails the pipeline instead of shipping:
|
|
353
358
|
|
|
354
359
|
```bash
|
|
355
|
-
QUICKBACK_STRICT_PARSE=1 quickback
|
|
360
|
+
QUICKBACK_STRICT_PARSE=1 quickback build
|
|
356
361
|
```
|
|
357
362
|
|
|
358
363
|
Having no `typescript` installed at all is a supported setup and stays silent — the fallback is the intended path there.
|
|
@@ -363,16 +368,16 @@ Use an API key instead of interactive login. Useful for CI/CD pipelines and auto
|
|
|
363
368
|
|
|
364
369
|
```bash
|
|
365
370
|
# Pass API key for a single command
|
|
366
|
-
QUICKBACK_API_KEY=your_api_key quickback
|
|
371
|
+
QUICKBACK_API_KEY=your_api_key quickback build
|
|
367
372
|
|
|
368
373
|
# Or export for the session
|
|
369
374
|
export QUICKBACK_API_KEY=your_api_key
|
|
370
|
-
quickback
|
|
375
|
+
quickback build
|
|
371
376
|
```
|
|
372
377
|
|
|
373
378
|
The API key takes precedence over stored credentials from `quickback login`.
|
|
374
379
|
|
|
375
|
-
You can create API keys from your [Quickback account](https://account.quickback.dev/
|
|
380
|
+
You can create API keys from your [Quickback account](https://account.quickback.dev/api-keys). Each key is scoped to your organization.
|
|
376
381
|
|
|
377
382
|
### Custom Compiler URL
|
|
378
383
|
|
|
@@ -380,11 +385,11 @@ Point the CLI to a different compiler (local or custom):
|
|
|
380
385
|
|
|
381
386
|
```bash
|
|
382
387
|
# Use a local compiler
|
|
383
|
-
QUICKBACK_API_URL=http://localhost:3000 quickback
|
|
388
|
+
QUICKBACK_API_URL=http://localhost:3000 quickback build
|
|
384
389
|
|
|
385
390
|
# Or export for the session
|
|
386
391
|
export QUICKBACK_API_URL=http://localhost:3000
|
|
387
|
-
quickback
|
|
392
|
+
quickback build
|
|
388
393
|
```
|
|
389
394
|
|
|
390
395
|
See [Local Compiler](/tooling/cloud-compiler/local-compiler) for running the compiler locally with Docker.
|
|
@@ -407,7 +412,7 @@ npx @quickback-dev/cli start
|
|
|
407
412
|
|
|
408
413
|
1. Check your `quickback.config.ts` exists and is valid
|
|
409
414
|
2. Ensure all tables in `quickback/features/` have valid exports
|
|
410
|
-
3. Run `quickback
|
|
415
|
+
3. Run `quickback build` with `--verbose` for detailed output
|
|
411
416
|
4. For rename-related Drizzle failures in CI/headless runs, configure `compiler.migrations.renames` in `quickback.config.ts`
|
|
412
417
|
|
|
413
418
|
### Authentication issues
|
|
@@ -19,10 +19,10 @@ Credentials are stored at `~/.quickback/credentials.json` and include your sessi
|
|
|
19
19
|
For non-interactive environments (CI/CD, scripts), use an API key:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
QUICKBACK_API_KEY=your_api_key quickback
|
|
22
|
+
QUICKBACK_API_KEY=your_api_key quickback build
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Create API keys from your [Quickback account](https://account.quickback.dev/
|
|
25
|
+
Create API keys from your [Quickback account](https://account.quickback.dev/api-keys). Each key is scoped to your organization.
|
|
26
26
|
|
|
27
27
|
The API key takes precedence over stored credentials from `quickback login`.
|
|
28
28
|
|
|
@@ -33,7 +33,7 @@ The `/compile` endpoint requires either a session token (from `quickback login`)
|
|
|
33
33
|
}
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
The map uses project-root-relative paths and follows the same layout `quickback
|
|
36
|
+
The map uses project-root-relative paths and follows the same layout `quickback build` reads from disk: `quickback/quickback.config.ts`, `quickback/features/**`, `quickback/services/**`, `quickback/{lib,hooks,plugins,middlewares,email-templates}/**`, plus `quickback/drizzle/**/meta/**` and `wrangler.toml` for incremental builds.
|
|
37
37
|
|
|
38
38
|
Two constraints, both fail-closed:
|
|
39
39
|
|
|
@@ -56,7 +56,9 @@ The response header `X-Quickback-Compile-Backend` says which backend answered:
|
|
|
56
56
|
| `container-fallback` | Edge is enabled but failed (5xx/unreachable); the container answered instead |
|
|
57
57
|
| _(absent)_ | Edge routing is not enabled; the container answered, as before |
|
|
58
58
|
|
|
59
|
-
Complete compiles (`?complete=true`, the default) always run in the container — they need the CLI toolchain (drizzle-kit, prebuilt SPA assets). The edge Worker rejects
|
|
59
|
+
Complete compiles (`?complete=true`, the default) always run in the container — they need the CLI toolchain (drizzle-kit, prebuilt SPA assets). For Cloudflare projects they also run `wrangler deploy --dry-run` as a bundle check (the same command package-mode deploy uses, without collecting a deployment artifact), so missing named exports and unresolved imports fail here instead of at deploy. The edge Worker rejects complete compiles with a 400 pointing at the container endpoint.
|
|
60
|
+
|
|
61
|
+
Validation compiles (`?complete=false`) still skip that bundle check — they may run on the edge Worker, which has no Wrangler.
|
|
60
62
|
|
|
61
63
|
## Environment Variables
|
|
62
64
|
|
|
@@ -70,7 +72,7 @@ Complete compiles (`?complete=true`, the default) always run in the container
|
|
|
70
72
|
Point the CLI to a different compiler (local or custom):
|
|
71
73
|
|
|
72
74
|
```bash
|
|
73
|
-
QUICKBACK_API_URL=http://localhost:3000 quickback
|
|
75
|
+
QUICKBACK_API_URL=http://localhost:3000 quickback build
|
|
74
76
|
```
|
|
75
77
|
|
|
76
78
|
See [Local Compiler](/tooling/cloud-compiler/local-compiler) for running the compiler locally with Docker.
|
|
@@ -91,7 +91,7 @@ npx @quickback-dev/cli start
|
|
|
91
91
|
npm install -g @quickback-dev/cli
|
|
92
92
|
quickback create cloudflare my-app
|
|
93
93
|
cd my-app
|
|
94
|
-
quickback
|
|
94
|
+
quickback build # prompts for login on the first run
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
## Existing Databases
|
|
@@ -35,14 +35,14 @@ bash dev.sh 3001
|
|
|
35
35
|
Point the CLI to your local compiler:
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
QUICKBACK_API_URL=http://localhost:3000 quickback
|
|
38
|
+
QUICKBACK_API_URL=http://localhost:3000 quickback build
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
Or export it for the session:
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
44
|
export QUICKBACK_API_URL=http://localhost:3000
|
|
45
|
-
quickback
|
|
45
|
+
quickback build
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
The supported launcher does not require `quickback login`. It opts the compiler
|