@quickback-dev/cli 0.60.1 → 0.60.3
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/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +1 -9
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/cursor.d.ts.map +1 -1
- package/dist/commands/cursor.js +6 -7
- package/dist/commands/cursor.js.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +1 -9
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +3 -1
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +3 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/migrations.d.ts.map +1 -1
- package/dist/commands/migrations.js +1 -9
- package/dist/commands/migrations.js.map +1 -1
- package/dist/docs/index.d.ts +25 -0
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +70 -0
- package/dist/docs/index.js.map +1 -0
- package/dist/docs/index.test.d.ts +2 -0
- package/dist/docs/index.test.d.ts.map +1 -0
- package/dist/docs/index.test.js +51 -0
- package/dist/docs/index.test.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/lib/auth.d.ts +0 -4
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +0 -16
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/compiler-stubs.d.ts +22 -67
- package/dist/lib/compiler-stubs.d.ts.map +1 -1
- package/dist/lib/compiler-stubs.js +35 -100
- package/dist/lib/compiler-stubs.js.map +1 -1
- package/dist/lib/copy-passthrough.d.ts +43 -0
- package/dist/lib/copy-passthrough.d.ts.map +1 -0
- package/dist/lib/copy-passthrough.js +118 -0
- package/dist/lib/copy-passthrough.js.map +1 -0
- package/dist/lib/copy-public-assets.d.ts +19 -22
- package/dist/lib/copy-public-assets.d.ts.map +1 -1
- package/dist/lib/copy-public-assets.js +20 -99
- package/dist/lib/copy-public-assets.js.map +1 -1
- package/dist/lib/copy-source-apps.d.ts +22 -20
- package/dist/lib/copy-source-apps.d.ts.map +1 -1
- package/dist/lib/copy-source-apps.js +21 -105
- package/dist/lib/copy-source-apps.js.map +1 -1
- package/dist/lib/file-writer.d.ts +0 -5
- package/dist/lib/file-writer.d.ts.map +1 -1
- package/dist/lib/file-writer.js +0 -17
- package/dist/lib/file-writer.js.map +1 -1
- package/dist/lib/prepare-output.d.ts.map +1 -1
- package/dist/lib/prepare-output.js +1 -9
- package/dist/lib/prepare-output.js.map +1 -1
- package/dist/skill/docs/configure/index.md +3 -0
- package/dist/skill/docs/platform/database/d1.md +98 -0
- package/dist/skill/docs/platform/database/neon.md +14 -7
- package/dist/skill/docs/start/deploy-browser.md +37 -2
- package/dist/templates/registry.d.ts +0 -5
- package/dist/templates/registry.d.ts.map +1 -1
- package/dist/templates/registry.js +0 -21
- package/dist/templates/registry.js.map +1 -1
- package/package.json +2 -3
- package/src/skill/docs/configure/index.md +3 -0
- package/src/skill/docs/platform/database/d1.md +98 -0
- package/src/skill/docs/platform/database/neon.md +14 -7
- package/src/skill/docs/start/deploy-browser.md +37 -2
- package/dist/docs/content.d.ts +0 -7
- package/dist/docs/content.d.ts.map +0 -1
- package/dist/docs/content.js +0 -737
- package/dist/docs/content.js.map +0 -1
- package/dist/lib/helpers.d.ts +0 -39
- package/dist/lib/helpers.d.ts.map +0 -1
- package/dist/lib/helpers.js +0 -299
- package/dist/lib/helpers.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-writer.js","sourceRoot":"","sources":["../../src/lib/file-writer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,UAAU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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare-output.d.ts","sourceRoot":"","sources":["../../src/lib/prepare-output.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prepare-output.d.ts","sourceRoot":"","sources":["../../src/lib/prepare-output.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,KAAK,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,OAAO,CAAC,EAAE,kBAAkB,GAAG,gBAAgB,CAAC;CACjD;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,EAC1B,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,aAAa,CAAC,CA2BxB;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAO3G;AAED,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQpG"}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { promises as fs } from 'fs';
|
|
23
23
|
import { join, sep } from 'path';
|
|
24
|
+
import { pathExists } from './async-utils.js';
|
|
24
25
|
const DEFAULT_ARCHIVE_KEEP = 3;
|
|
25
26
|
/**
|
|
26
27
|
* Archive then wipe the target dir, in preparation for a fresh write.
|
|
@@ -75,15 +76,6 @@ export async function pruneArchives(archiveBase, prefix, keep) {
|
|
|
75
76
|
await fs.rm(join(archiveBase, old), { recursive: true, force: true }).catch(() => { });
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
|
-
async function pathExists(p) {
|
|
79
|
-
try {
|
|
80
|
-
await fs.access(p);
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
catch {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
79
|
function normalizePath(p) {
|
|
88
80
|
return sep === '/' ? p : p.split(sep).join('/');
|
|
89
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare-output.js","sourceRoot":"","sources":["../../src/lib/prepare-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"prepare-output.js","sourceRoot":"","sources":["../../src/lib/prepare-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAsB/B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,SAAiB,EACjB,SAAiB,EACjB,QAA0B,EAC1B,UAA0B,EAAE;IAE5B,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAE9C,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QACpC,OA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CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS;IACzB,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC"}
|
|
@@ -107,10 +107,13 @@ Every optional top-level key the config accepts is listed below. You never have
|
|
|
107
107
|
| `agents` | `boolean \| object` | AI/agent discovery surface (`robots.txt`, `llms.txt`, MCP, OAuth discovery) — see [Agents](/configure/agents) |
|
|
108
108
|
| `security` | `object \| false` | HTTP response security headers (CSP, HSTS, COOP/COEP, Referrer/Permissions-Policy) — see [Security Headers](/configure/security) |
|
|
109
109
|
| `openapi` | `object` | OpenAPI spec generation (`generate`, `publish`, `docs: 'scalar' \| 'swagger'`, `types`) — see [OpenAPI](/api/openapi) |
|
|
110
|
+
| `types` | `boolean \| object` | Quickback's first-party TypeScript contract (`output`, `brandIds`) — see [TypeScript](/api/typescript) |
|
|
110
111
|
| `schemaRegistry` | `object` | Schema registry generation for the CMS (`{ generate: false }` to disable) — see [Schema Registry](/ui/admin/schema-registry) |
|
|
111
112
|
| `etag` | `object` | ETag caching for GET responses (`{ enabled: false }` to disable) — see [Caching & ETags](/api/caching) |
|
|
112
113
|
| `email` | `object` | Email delivery config (`provider`, `from`, `fromName`, `region`) — see [Email Configuration](#email-configuration) |
|
|
114
|
+
| `push` | `object` | Web Push (VAPID keys, TTL/urgency defaults, queue fan-out) — see [Push](/platform/push) |
|
|
113
115
|
| `bindings` | `object` | Extra Cloudflare bindings (durable objects, queues, R2, services, `vars`, AI) — see [Bindings](/configure/bindings) |
|
|
116
|
+
| `environments` | `object` | Named deployment targets (`dev`/`staging`/`production`) → one `[env.<name>]` Wrangler stanza each, on Cloudflare D1 or Neon Hyperdrive — see [D1](/platform/database/d1#named-cloudflare-deployment-environments) and [Neon](/platform/database/neon#named-cloudflare-deployment-environments) |
|
|
114
117
|
| `compiler` | `object` | Compiler internals — `features.auditFields: false`, `migrations.renames` (headless CI), Neon `migrations.foreignKeys`, `securityContracts`, `injectId`, `routes` |
|
|
115
118
|
| `build` | `object` | Build options (`outputDir`, `packageManager`, `dependencies`) — see [Custom Dependencies](#custom-dependencies) |
|
|
116
119
|
| `dev` | `object` | Local development settings (`port`, `api`, `cms`, `account`, `hostnames`) — see [Variables](/configure/variables) |
|
|
@@ -140,6 +140,104 @@ wrangler d1 create my-app-files
|
|
|
140
140
|
> `wrangler d1 create` dance only when you need to control provisioning yourself.
|
|
141
141
|
|
|
142
142
|
|
|
143
|
+
## Named Cloudflare deployment environments
|
|
144
|
+
|
|
145
|
+
The bindings above describe a single deploy target. A project that needs
|
|
146
|
+
isolated `dev` / `staging` / `production` Workers — each with its own D1
|
|
147
|
+
databases — declares them under the top-level `environments` block instead of
|
|
148
|
+
hand-maintaining a second `wrangler.dev.toml`:
|
|
149
|
+
|
|
150
|
+
```typescript title="quickback/quickback.config.ts"
|
|
151
|
+
export default defineConfig({
|
|
152
|
+
name: "my-app",
|
|
153
|
+
providers: {
|
|
154
|
+
runtime: defineRuntime("cloudflare"),
|
|
155
|
+
database: defineDatabase("cloudflare-d1", {}),
|
|
156
|
+
auth: defineAuth("better-auth"),
|
|
157
|
+
},
|
|
158
|
+
environments: {
|
|
159
|
+
dev: {
|
|
160
|
+
domain: "api-dev.example.com",
|
|
161
|
+
// `name` is optional — defaults to `${config.name}-${key}` ("my-app-dev")
|
|
162
|
+
worker: {
|
|
163
|
+
env: "dev",
|
|
164
|
+
workersDev: true,
|
|
165
|
+
previewUrls: false,
|
|
166
|
+
vars: { BETTER_AUTH_URL: "https://api-dev.example.com" },
|
|
167
|
+
requiredSecrets: ["BETTER_AUTH_SECRET"],
|
|
168
|
+
bindings: {
|
|
169
|
+
d1: {
|
|
170
|
+
auth: { databaseId: "…", databaseName: "my-app-auth-dev" },
|
|
171
|
+
features: { databaseId: "…", databaseName: "my-app-features-dev" },
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
production: {
|
|
177
|
+
domain: "api.example.com",
|
|
178
|
+
worker: {
|
|
179
|
+
env: "production",
|
|
180
|
+
workersDev: true,
|
|
181
|
+
previewUrls: false,
|
|
182
|
+
vars: { BETTER_AUTH_URL: "https://api.example.com" },
|
|
183
|
+
requiredSecrets: ["BETTER_AUTH_SECRET"],
|
|
184
|
+
bindings: {
|
|
185
|
+
d1: {
|
|
186
|
+
auth: { databaseId: "…", databaseName: "my-app-auth-prod" },
|
|
187
|
+
features: { databaseId: "…", databaseName: "my-app-features-prod" },
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Each entry emits one `[env.<name>]` stanza. Wrangler does **not** inherit
|
|
197
|
+
bindings or vars into a named environment, so Quickback repeats the full set
|
|
198
|
+
per target: `[[env.<name>.d1_databases]]` for every role the primary config
|
|
199
|
+
declares, plus `vars`, required secrets, KV, rate-limits, Cloudflare Email,
|
|
200
|
+
queue producers/consumers, R2 buckets, and the `[assets]` block. Binding names
|
|
201
|
+
and `migrations_dir` inherit from the primary config so runtime code reads by
|
|
202
|
+
binding name unchanged across environments; only `database_id` (and optionally
|
|
203
|
+
`database_name`) is per-environment.
|
|
204
|
+
|
|
205
|
+
While `environments` is present, the primary top-level binding blocks are
|
|
206
|
+
suppressed and there is no bare `deploy` script — every deployment names its
|
|
207
|
+
target:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
npm run deploy:dev # wrangler deploy --env dev
|
|
211
|
+
npm run deploy:production # wrangler deploy --env production
|
|
212
|
+
|
|
213
|
+
npm run db:migrate:dev:auth:remote # wrangler d1 migrations apply my-app-auth-dev --remote
|
|
214
|
+
npm run db:migrate:dev:remote # fan-out over every declared role
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
The contract fails closed:
|
|
218
|
+
|
|
219
|
+
- Better Auth is required, and a logical `dev` target must exist (it is what
|
|
220
|
+
`npm run dev` selects).
|
|
221
|
+
- Every D1 role the primary config declares — `auth`, `features`, plus `audit`
|
|
222
|
+
and `webhooks` when enabled — needs its own `databaseId` per environment.
|
|
223
|
+
A missing role is a compile error, not a Worker that boots without a
|
|
224
|
+
database.
|
|
225
|
+
- The same `database_id` cannot appear in two environments; sharing one would
|
|
226
|
+
race the migration ledger.
|
|
227
|
+
- `requiredSecrets` and `rateLimits` must match the generated runtime
|
|
228
|
+
inventory exactly, so adding a feature tells you which override changed.
|
|
229
|
+
- `workersDev: true` and `previewUrls: false` must be explicit on each target.
|
|
230
|
+
|
|
231
|
+
Set secrets per target: `wrangler secret put BETTER_AUTH_SECRET --env dev`.
|
|
232
|
+
|
|
233
|
+
> `environments` may live at the top level (preferred) or under
|
|
234
|
+
> `providers.database.environments` (the original placement, still accepted).
|
|
235
|
+
> Declaring it in both places is a compile error. The same block powers
|
|
236
|
+
> [Neon Hyperdrive projects](/platform/database/neon#named-cloudflare-deployment-environments),
|
|
237
|
+
> which swap `bindings.d1` for `bindings.hyperdrive` and add a Neon `branch` per
|
|
238
|
+
> target.
|
|
239
|
+
|
|
240
|
+
|
|
143
241
|
## Accessing Data via API
|
|
144
242
|
|
|
145
243
|
All data access in Quickback goes through the generated API endpoints—never direct database queries. This ensures security rules (firewall, access, guards, masking) are always enforced.
|
|
@@ -83,9 +83,15 @@ transactions (see [Interactive transactions](#interactive-transactions)).
|
|
|
83
83
|
## Named Cloudflare deployment environments
|
|
84
84
|
|
|
85
85
|
Neon Hyperdrive projects can declare isolated Worker targets under
|
|
86
|
-
`
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
`environments`. A logical `dev` / `prod` pair on a project named `attend-v2`
|
|
87
|
+
deploys through Wrangler as `attend-v2-dev` and `attend-v2-prod`:
|
|
88
|
+
|
|
89
|
+
> `environments` reads from either the **top-level** `environments` slot (the
|
|
90
|
+
> preferred placement, and the one the config scaffold advertises) or the
|
|
91
|
+
> original `providers.database.environments` slot shown below. Both are accepted
|
|
92
|
+
> and behave identically; declaring the block in **both** places is a compile
|
|
93
|
+
> error, because there would be no single source of truth.
|
|
94
|
+
|
|
89
95
|
|
|
90
96
|
```typescript title="quickback/quickback.config.ts"
|
|
91
97
|
export default defineConfig({
|
|
@@ -215,10 +221,11 @@ maps to its configured Wrangler environment. Apply that branch's migrations
|
|
|
215
221
|
first; migrations intentionally remain a separate target-owned step.
|
|
216
222
|
|
|
217
223
|
Projects that omit `environments` retain the existing `wrangler.toml` and
|
|
218
|
-
package scripts byte-for-byte. Named environments
|
|
219
|
-
Neon with `connectionMode: "hyperdrive"`
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
package scripts byte-for-byte. Named environments require Better Auth, plus
|
|
225
|
+
either Neon with `connectionMode: "hyperdrive"` (this page) or Cloudflare D1
|
|
226
|
+
(see [Named deployment environments](/platform/database/d1#named-cloudflare-deployment-environments)).
|
|
227
|
+
Quickback rejects other providers or partial binding sets instead of emitting a
|
|
228
|
+
Worker that can deploy but fail at runtime.
|
|
222
229
|
|
|
223
230
|
## Environment variables
|
|
224
231
|
|
|
@@ -4,7 +4,7 @@ Build a backend in [Quickback Start](https://start.quickback.dev), get a green c
|
|
|
4
4
|
|
|
5
5
|
This page covers the browser flow. For local projects, or anything the browser flow doesn't support yet, use [`quickback deploy`](/start/deploy) — the CLI covers every resource type and is always available.
|
|
6
6
|
|
|
7
|
-
> Browser deployment is
|
|
7
|
+
> Browser deployment is new. The hosted deploy service sits behind a kill switch, and provisioning is rate-limited to 5 deploys per minute per user — enough to stop a runaway retry loop, not something a normal deploy will ever hit. `quickback deploy` works for everyone today.
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
## Browser vs CLI
|
|
@@ -75,6 +75,41 @@ What's requested, and why:
|
|
|
75
75
|
|
|
76
76
|
Nothing broader is requested — no zone, DNS, billing, or account-management access.
|
|
77
77
|
|
|
78
|
+
If you cancel at Cloudflare's consent screen — or Cloudflare ends the attempt for any other reason — you land back in Start with the card explaining what happened and a **Try Cloudflare again** button. Nothing is stored on a cancelled attempt, and a connection you already had is left untouched.
|
|
79
|
+
|
|
80
|
+
## Connection states and recovery
|
|
81
|
+
|
|
82
|
+
The deploy card is the whole connection UI: it reports the state of your Cloudflare connection and offers exactly one thing to do about it.
|
|
83
|
+
|
|
84
|
+
| What you see | What happened | What to do |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| **Connect your Cloudflare account** | No connection stored | **Continue with Cloudflare** |
|
|
87
|
+
| Masked email badge, green | Connected and healthy | Deploy |
|
|
88
|
+
| "This connection expires in N minutes" | The access token is near the end of its life | Nothing yet — reconnect when it lapses |
|
|
89
|
+
| Badge turns amber, "· reconnect" | Token expired, grant revoked in Cloudflare, or the connection was deleted | **Reconnect Cloudflare** — one consent, same connection record |
|
|
90
|
+
| "This Cloudflare connection can't …" | The grant is missing a permission a deploy needs (an older connection, or a scope your OAuth client didn't allow) | **Reconnect Cloudflare** to grant the rest |
|
|
91
|
+
| "This Cloudflare login isn't a member of any account" | The identity you connected belongs to no Cloudflare account | Create or join an account in the Cloudflare dashboard, then reconnect |
|
|
92
|
+
| "Couldn't reach the deploy service…" | Transient failure talking to Quickback or Cloudflare | **Try again** |
|
|
93
|
+
| "Browser deploys aren't fully configured on the server yet" | A deploy-service misconfiguration, not anything on your side | Use [`quickback deploy`](/start/deploy) for now |
|
|
94
|
+
| "Too many deploys in a minute" | More than 5 provisions in a minute on one account | Wait for the `Retry-After` window and click Deploy again |
|
|
95
|
+
|
|
96
|
+
Deploy is disabled while a reconnect is pending, so a deploy never starts on a connection that can't finish it. If a connection dies *during* a deploy, the failure comes back as a reconnect prompt rather than a raw error — the deploy is safe to re-run after reconnecting, because provisioning adopts and migrations apply once.
|
|
97
|
+
|
|
98
|
+
### Reconnecting
|
|
99
|
+
|
|
100
|
+
**Reconnect** re-runs the same consent and lands on the **same connection record** — your account picker, deploys, and claim links all keep working. Reconnecting is also how you widen a grant that's missing a permission.
|
|
101
|
+
|
|
102
|
+
### Connecting more than one Cloudflare account
|
|
103
|
+
|
|
104
|
+
Connect a second Cloudflare login with **Connect another** and the card grows a login picker above the account picker. Start remembers which one you deployed with last and preselects it.
|
|
105
|
+
|
|
106
|
+
### Disconnecting vs. revoking
|
|
107
|
+
|
|
108
|
+
Two different things, and you usually want both:
|
|
109
|
+
|
|
110
|
+
- **Disconnect** (in the card) makes Quickback forget the connection and its stored token. It doesn't touch anything in your Cloudflare account, and it never touches deployed apps — they're plain Workers in your account and keep running.
|
|
111
|
+
- **Revoke** (Cloudflare dashboard → **My Profile → Access Management → Connected Applications**, linked from the card) withdraws the grant itself. The stored ciphertext becomes useless immediately; the next thing Start tries turns into a reconnect prompt.
|
|
112
|
+
|
|
78
113
|
## Where your token lives
|
|
79
114
|
|
|
80
115
|
The OAuth token never reaches your browser, the chat model, or the compiler. It is held by the deploy service and:
|
|
@@ -83,7 +118,7 @@ The OAuth token never reaches your browser, the chat model, or the compiler. It
|
|
|
83
118
|
- bound to its connection record (the ciphertext is unusable if copied elsewhere);
|
|
84
119
|
- decrypted only inside the API calls of an active deploy, then discarded.
|
|
85
120
|
|
|
86
|
-
Tokens expire; when one does, Start shows a reconnect prompt and a fresh consent re-issues it onto the same connection. Revoking in Cloudflare kills the token immediately — the stored ciphertext becomes useless.
|
|
121
|
+
Tokens expire; when one does, Start shows a reconnect prompt and a fresh consent re-issues it onto the same connection. Revoking in Cloudflare kills the token immediately — the stored ciphertext becomes useless, and the card turns the next failed call into that same reconnect prompt. See [Connection states and recovery](#connection-states-and-recovery) for the full set.
|
|
87
122
|
|
|
88
123
|
## Secrets on the deployed app
|
|
89
124
|
|
|
@@ -6,10 +6,7 @@
|
|
|
6
6
|
export interface TemplateDefinition {
|
|
7
7
|
name: string;
|
|
8
8
|
description: string;
|
|
9
|
-
category: "auth" | "saas" | "api" | "payments";
|
|
10
9
|
tags: string[];
|
|
11
|
-
author: string;
|
|
12
|
-
version: string;
|
|
13
10
|
includes: string[];
|
|
14
11
|
preset: string;
|
|
15
12
|
requiresCloudflare: boolean;
|
|
@@ -18,7 +15,5 @@ export declare const TEMPLATE_REGISTRY: Record<string, TemplateDefinition>;
|
|
|
18
15
|
export declare const TEMPLATE_ALIASES: Record<string, string>;
|
|
19
16
|
export declare function getTemplate(nameOrAlias: string): TemplateDefinition | undefined;
|
|
20
17
|
export declare function listTemplates(): TemplateDefinition[];
|
|
21
|
-
export declare function listTemplateNames(): string[];
|
|
22
|
-
export declare function listAliases(): Record<string, string>;
|
|
23
18
|
export declare function formatTemplateList(): string;
|
|
24
19
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CA6ChE,CAAC;AAKF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CASnD,CAAC;AAEF,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAG/E;AAED,wBAAgB,aAAa,IAAI,kBAAkB,EAAE,CAEpD;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAgB3C"}
|
|
@@ -7,10 +7,7 @@ export const TEMPLATE_REGISTRY = {
|
|
|
7
7
|
"betterauth-d1-cloudflare": {
|
|
8
8
|
name: "Better Auth + D1 + Cloudflare",
|
|
9
9
|
description: "Authentication with Better Auth, D1 database, deployed to Cloudflare Workers — bare scaffold, add your own features",
|
|
10
|
-
category: "auth",
|
|
11
10
|
tags: ["auth", "cloudflare", "d1", "hono"],
|
|
12
|
-
author: "quickback",
|
|
13
|
-
version: "1.0.0",
|
|
14
11
|
includes: ["betterauth", "d1", "hono", "drizzle"],
|
|
15
12
|
preset: "cloudflare",
|
|
16
13
|
requiresCloudflare: true,
|
|
@@ -18,10 +15,7 @@ export const TEMPLATE_REGISTRY = {
|
|
|
18
15
|
"todos-cloudflare": {
|
|
19
16
|
name: "Todos Example (Cloudflare)",
|
|
20
17
|
description: "Working todos example — schema with masking, two record-based actions (complete / uncomplete), Better Auth, D1. Read the source as a learning template.",
|
|
21
|
-
category: "api",
|
|
22
18
|
tags: ["example", "todos", "actions", "cloudflare", "d1"],
|
|
23
|
-
author: "quickback",
|
|
24
|
-
version: "1.0.0",
|
|
25
19
|
includes: ["betterauth", "d1", "hono", "drizzle"],
|
|
26
20
|
preset: "cloudflare",
|
|
27
21
|
requiresCloudflare: true,
|
|
@@ -31,10 +25,7 @@ export const TEMPLATE_REGISTRY = {
|
|
|
31
25
|
"b2bsaas-cloudflare": {
|
|
32
26
|
name: "B2B SaaS Starter",
|
|
33
27
|
description: "Full B2B SaaS with auth, organizations, file storage (R2), webhooks, and views",
|
|
34
|
-
category: "saas",
|
|
35
28
|
tags: ["saas", "b2b", "cloudflare", "r2", "webhooks", "teams"],
|
|
36
|
-
author: "quickback",
|
|
37
|
-
version: "1.0.0",
|
|
38
29
|
includes: ["betterauth", "organizations", "d1", "r2", "files", "webhooks", "hono", "drizzle"],
|
|
39
30
|
preset: "cloudflare",
|
|
40
31
|
requiresCloudflare: true,
|
|
@@ -43,10 +34,7 @@ export const TEMPLATE_REGISTRY = {
|
|
|
43
34
|
"blog-cloudflare": {
|
|
44
35
|
name: "Blog / CMS Starter",
|
|
45
36
|
description: "Blog/CMS starter with a pinned organization id, public pages, and admin-only editing on Cloudflare Workers",
|
|
46
|
-
category: "api",
|
|
47
37
|
tags: ["blog", "cms", "pinned-organization", "cloudflare", "d1"],
|
|
48
|
-
author: "quickback",
|
|
49
|
-
version: "1.0.0",
|
|
50
38
|
includes: ["betterauth", "d1", "hono", "drizzle"],
|
|
51
39
|
preset: "blog",
|
|
52
40
|
requiresCloudflare: true,
|
|
@@ -54,10 +42,7 @@ export const TEMPLATE_REGISTRY = {
|
|
|
54
42
|
"empty-cloudflare": {
|
|
55
43
|
name: "Empty Scaffold (Cloudflare)",
|
|
56
44
|
description: "Empty project structure with config only — no example features. Add your own definitions.",
|
|
57
|
-
category: "api",
|
|
58
45
|
tags: ["empty", "scaffold", "cloudflare", "d1"],
|
|
59
|
-
author: "quickback",
|
|
60
|
-
version: "1.0.0",
|
|
61
46
|
includes: ["betterauth", "d1", "hono", "drizzle"],
|
|
62
47
|
preset: "cloudflare",
|
|
63
48
|
requiresCloudflare: true,
|
|
@@ -84,12 +69,6 @@ export function getTemplate(nameOrAlias) {
|
|
|
84
69
|
export function listTemplates() {
|
|
85
70
|
return Object.values(TEMPLATE_REGISTRY);
|
|
86
71
|
}
|
|
87
|
-
export function listTemplateNames() {
|
|
88
|
-
return Object.keys(TEMPLATE_REGISTRY);
|
|
89
|
-
}
|
|
90
|
-
export function listAliases() {
|
|
91
|
-
return TEMPLATE_ALIASES;
|
|
92
|
-
}
|
|
93
72
|
export function formatTemplateList() {
|
|
94
73
|
const lines = ["Available templates:\n"];
|
|
95
74
|
for (const [id, template] of Object.entries(TEMPLATE_REGISTRY)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,MAAM,CAAC,MAAM,iBAAiB,GAAuC;IACjE,0BAA0B,EAAE;QACxB,IAAI,EAAE,+BAA+B;QACrC,WAAW,EAAE,qHAAqH;QAClI,IAAI,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC;QAC1C,QAAQ,EAAE,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC;QACjD,MAAM,EAAE,YAAY;QACpB,kBAAkB,EAAE,IAAI;KAC3B;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,4BAA4B;QAClC,WAAW,EAAE,yJAAyJ;QACtK,IAAI,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,CAAC;QACzD,QAAQ,EAAE,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC;QACjD,MAAM,EAAE,YAAY;QACpB,kBAAkB,EAAE,IAAI;KAC3B;IACD,wFAAwF;IACxF,qEAAqE;IACrE,oBAAoB,EAAE;QAClB,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,gFAAgF;QAC7F,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC;QAC9D,QAAQ,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC;QAC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AC;AAED,MAAM,UAAU,kBAAkB;IAC9B,MAAM,KAAK,GAAa,CAAC,wBAAwB,CAAC,CAAC;IAEnD,KAAK,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,aAAa,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvB,KAAK,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,OAAO,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quickback-dev/cli",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.3",
|
|
4
4
|
"description": "CLI for Quickback — define your backend in TypeScript, compile to a fully wired Cloudflare Worker (or Bun / Node) with auth, database, migrations, security, CMS, and Account UI.",
|
|
5
5
|
"author": "Kardoe Incorporated <paul@kardoe.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,13 +42,12 @@
|
|
|
42
42
|
"LICENSE"
|
|
43
43
|
],
|
|
44
44
|
"scripts": {
|
|
45
|
-
"prebuild": "npx tsx scripts/inject-version.ts && npm run bundle:
|
|
45
|
+
"prebuild": "npx tsx scripts/inject-version.ts && npm run bundle:skill && npm run bundle:examples",
|
|
46
46
|
"build": "tsc && npm run bundle:schema-engine",
|
|
47
47
|
"postbuild": "npx tsx scripts/bundle-cursor.ts && rm -rf dist/skill dist/examples && cp -r src/skill dist/skill && cp -r src/examples dist/examples",
|
|
48
48
|
"dev": "tsc --watch",
|
|
49
49
|
"test": "bun test",
|
|
50
50
|
"typecheck": "tsc --noEmit",
|
|
51
|
-
"bundle:docs": "npx tsx scripts/bundle-docs.ts",
|
|
52
51
|
"bundle:schema-engine": "node --import tsx scripts/bundle-schema-engine.ts",
|
|
53
52
|
"bundle:skill": "npx tsx scripts/bundle-skill.ts",
|
|
54
53
|
"bundle:cursor": "npx tsx scripts/bundle-cursor.ts",
|
|
@@ -107,10 +107,13 @@ Every optional top-level key the config accepts is listed below. You never have
|
|
|
107
107
|
| `agents` | `boolean \| object` | AI/agent discovery surface (`robots.txt`, `llms.txt`, MCP, OAuth discovery) — see [Agents](/configure/agents) |
|
|
108
108
|
| `security` | `object \| false` | HTTP response security headers (CSP, HSTS, COOP/COEP, Referrer/Permissions-Policy) — see [Security Headers](/configure/security) |
|
|
109
109
|
| `openapi` | `object` | OpenAPI spec generation (`generate`, `publish`, `docs: 'scalar' \| 'swagger'`, `types`) — see [OpenAPI](/api/openapi) |
|
|
110
|
+
| `types` | `boolean \| object` | Quickback's first-party TypeScript contract (`output`, `brandIds`) — see [TypeScript](/api/typescript) |
|
|
110
111
|
| `schemaRegistry` | `object` | Schema registry generation for the CMS (`{ generate: false }` to disable) — see [Schema Registry](/ui/admin/schema-registry) |
|
|
111
112
|
| `etag` | `object` | ETag caching for GET responses (`{ enabled: false }` to disable) — see [Caching & ETags](/api/caching) |
|
|
112
113
|
| `email` | `object` | Email delivery config (`provider`, `from`, `fromName`, `region`) — see [Email Configuration](#email-configuration) |
|
|
114
|
+
| `push` | `object` | Web Push (VAPID keys, TTL/urgency defaults, queue fan-out) — see [Push](/platform/push) |
|
|
113
115
|
| `bindings` | `object` | Extra Cloudflare bindings (durable objects, queues, R2, services, `vars`, AI) — see [Bindings](/configure/bindings) |
|
|
116
|
+
| `environments` | `object` | Named deployment targets (`dev`/`staging`/`production`) → one `[env.<name>]` Wrangler stanza each, on Cloudflare D1 or Neon Hyperdrive — see [D1](/platform/database/d1#named-cloudflare-deployment-environments) and [Neon](/platform/database/neon#named-cloudflare-deployment-environments) |
|
|
114
117
|
| `compiler` | `object` | Compiler internals — `features.auditFields: false`, `migrations.renames` (headless CI), Neon `migrations.foreignKeys`, `securityContracts`, `injectId`, `routes` |
|
|
115
118
|
| `build` | `object` | Build options (`outputDir`, `packageManager`, `dependencies`) — see [Custom Dependencies](#custom-dependencies) |
|
|
116
119
|
| `dev` | `object` | Local development settings (`port`, `api`, `cms`, `account`, `hostnames`) — see [Variables](/configure/variables) |
|
|
@@ -140,6 +140,104 @@ wrangler d1 create my-app-files
|
|
|
140
140
|
> `wrangler d1 create` dance only when you need to control provisioning yourself.
|
|
141
141
|
|
|
142
142
|
|
|
143
|
+
## Named Cloudflare deployment environments
|
|
144
|
+
|
|
145
|
+
The bindings above describe a single deploy target. A project that needs
|
|
146
|
+
isolated `dev` / `staging` / `production` Workers — each with its own D1
|
|
147
|
+
databases — declares them under the top-level `environments` block instead of
|
|
148
|
+
hand-maintaining a second `wrangler.dev.toml`:
|
|
149
|
+
|
|
150
|
+
```typescript title="quickback/quickback.config.ts"
|
|
151
|
+
export default defineConfig({
|
|
152
|
+
name: "my-app",
|
|
153
|
+
providers: {
|
|
154
|
+
runtime: defineRuntime("cloudflare"),
|
|
155
|
+
database: defineDatabase("cloudflare-d1", {}),
|
|
156
|
+
auth: defineAuth("better-auth"),
|
|
157
|
+
},
|
|
158
|
+
environments: {
|
|
159
|
+
dev: {
|
|
160
|
+
domain: "api-dev.example.com",
|
|
161
|
+
// `name` is optional — defaults to `${config.name}-${key}` ("my-app-dev")
|
|
162
|
+
worker: {
|
|
163
|
+
env: "dev",
|
|
164
|
+
workersDev: true,
|
|
165
|
+
previewUrls: false,
|
|
166
|
+
vars: { BETTER_AUTH_URL: "https://api-dev.example.com" },
|
|
167
|
+
requiredSecrets: ["BETTER_AUTH_SECRET"],
|
|
168
|
+
bindings: {
|
|
169
|
+
d1: {
|
|
170
|
+
auth: { databaseId: "…", databaseName: "my-app-auth-dev" },
|
|
171
|
+
features: { databaseId: "…", databaseName: "my-app-features-dev" },
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
production: {
|
|
177
|
+
domain: "api.example.com",
|
|
178
|
+
worker: {
|
|
179
|
+
env: "production",
|
|
180
|
+
workersDev: true,
|
|
181
|
+
previewUrls: false,
|
|
182
|
+
vars: { BETTER_AUTH_URL: "https://api.example.com" },
|
|
183
|
+
requiredSecrets: ["BETTER_AUTH_SECRET"],
|
|
184
|
+
bindings: {
|
|
185
|
+
d1: {
|
|
186
|
+
auth: { databaseId: "…", databaseName: "my-app-auth-prod" },
|
|
187
|
+
features: { databaseId: "…", databaseName: "my-app-features-prod" },
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Each entry emits one `[env.<name>]` stanza. Wrangler does **not** inherit
|
|
197
|
+
bindings or vars into a named environment, so Quickback repeats the full set
|
|
198
|
+
per target: `[[env.<name>.d1_databases]]` for every role the primary config
|
|
199
|
+
declares, plus `vars`, required secrets, KV, rate-limits, Cloudflare Email,
|
|
200
|
+
queue producers/consumers, R2 buckets, and the `[assets]` block. Binding names
|
|
201
|
+
and `migrations_dir` inherit from the primary config so runtime code reads by
|
|
202
|
+
binding name unchanged across environments; only `database_id` (and optionally
|
|
203
|
+
`database_name`) is per-environment.
|
|
204
|
+
|
|
205
|
+
While `environments` is present, the primary top-level binding blocks are
|
|
206
|
+
suppressed and there is no bare `deploy` script — every deployment names its
|
|
207
|
+
target:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
npm run deploy:dev # wrangler deploy --env dev
|
|
211
|
+
npm run deploy:production # wrangler deploy --env production
|
|
212
|
+
|
|
213
|
+
npm run db:migrate:dev:auth:remote # wrangler d1 migrations apply my-app-auth-dev --remote
|
|
214
|
+
npm run db:migrate:dev:remote # fan-out over every declared role
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
The contract fails closed:
|
|
218
|
+
|
|
219
|
+
- Better Auth is required, and a logical `dev` target must exist (it is what
|
|
220
|
+
`npm run dev` selects).
|
|
221
|
+
- Every D1 role the primary config declares — `auth`, `features`, plus `audit`
|
|
222
|
+
and `webhooks` when enabled — needs its own `databaseId` per environment.
|
|
223
|
+
A missing role is a compile error, not a Worker that boots without a
|
|
224
|
+
database.
|
|
225
|
+
- The same `database_id` cannot appear in two environments; sharing one would
|
|
226
|
+
race the migration ledger.
|
|
227
|
+
- `requiredSecrets` and `rateLimits` must match the generated runtime
|
|
228
|
+
inventory exactly, so adding a feature tells you which override changed.
|
|
229
|
+
- `workersDev: true` and `previewUrls: false` must be explicit on each target.
|
|
230
|
+
|
|
231
|
+
Set secrets per target: `wrangler secret put BETTER_AUTH_SECRET --env dev`.
|
|
232
|
+
|
|
233
|
+
> `environments` may live at the top level (preferred) or under
|
|
234
|
+
> `providers.database.environments` (the original placement, still accepted).
|
|
235
|
+
> Declaring it in both places is a compile error. The same block powers
|
|
236
|
+
> [Neon Hyperdrive projects](/platform/database/neon#named-cloudflare-deployment-environments),
|
|
237
|
+
> which swap `bindings.d1` for `bindings.hyperdrive` and add a Neon `branch` per
|
|
238
|
+
> target.
|
|
239
|
+
|
|
240
|
+
|
|
143
241
|
## Accessing Data via API
|
|
144
242
|
|
|
145
243
|
All data access in Quickback goes through the generated API endpoints—never direct database queries. This ensures security rules (firewall, access, guards, masking) are always enforced.
|
|
@@ -83,9 +83,15 @@ transactions (see [Interactive transactions](#interactive-transactions)).
|
|
|
83
83
|
## Named Cloudflare deployment environments
|
|
84
84
|
|
|
85
85
|
Neon Hyperdrive projects can declare isolated Worker targets under
|
|
86
|
-
`
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
`environments`. A logical `dev` / `prod` pair on a project named `attend-v2`
|
|
87
|
+
deploys through Wrangler as `attend-v2-dev` and `attend-v2-prod`:
|
|
88
|
+
|
|
89
|
+
> `environments` reads from either the **top-level** `environments` slot (the
|
|
90
|
+
> preferred placement, and the one the config scaffold advertises) or the
|
|
91
|
+
> original `providers.database.environments` slot shown below. Both are accepted
|
|
92
|
+
> and behave identically; declaring the block in **both** places is a compile
|
|
93
|
+
> error, because there would be no single source of truth.
|
|
94
|
+
|
|
89
95
|
|
|
90
96
|
```typescript title="quickback/quickback.config.ts"
|
|
91
97
|
export default defineConfig({
|
|
@@ -215,10 +221,11 @@ maps to its configured Wrangler environment. Apply that branch's migrations
|
|
|
215
221
|
first; migrations intentionally remain a separate target-owned step.
|
|
216
222
|
|
|
217
223
|
Projects that omit `environments` retain the existing `wrangler.toml` and
|
|
218
|
-
package scripts byte-for-byte. Named environments
|
|
219
|
-
Neon with `connectionMode: "hyperdrive"`
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
package scripts byte-for-byte. Named environments require Better Auth, plus
|
|
225
|
+
either Neon with `connectionMode: "hyperdrive"` (this page) or Cloudflare D1
|
|
226
|
+
(see [Named deployment environments](/platform/database/d1#named-cloudflare-deployment-environments)).
|
|
227
|
+
Quickback rejects other providers or partial binding sets instead of emitting a
|
|
228
|
+
Worker that can deploy but fail at runtime.
|
|
222
229
|
|
|
223
230
|
## Environment variables
|
|
224
231
|
|