@builtbyfriends/bwf 0.0.0-stage → 1.9.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/AGENTS_TEMPLATE.md +4 -0
- package/LICENSE +22 -0
- package/README.md +48 -2
- package/dist/account-cmd-Ddt8lGeL.mjs +45 -0
- package/dist/agents-BLiMq9E1.mjs +113 -0
- package/dist/application-analysis-C9Ck2Yeg.mjs +1498 -0
- package/dist/application-routing-DbR-W5lG.mjs +25 -0
- package/dist/atomic-write-DA6eD1Kp.mjs +17 -0
- package/dist/auth-BKsUmWbT.d.mts +77 -0
- package/dist/auth-DkvoW5hB.mjs +33 -0
- package/dist/auth-aKyIWkdS.mjs +1 -0
- package/dist/auth-client-6-Ft9i9T.d.mts +5 -0
- package/dist/auth-client-DwCdwKbw.mjs +5 -0
- package/dist/auth-client-react-CJdeErvM.mjs +5 -0
- package/dist/auth-client-react-DvQLe5Zb.d.mts +5 -0
- package/dist/auth-link-CCl-hJol.mjs +26 -0
- package/dist/auth-migrations-DDeifS3v.mjs +206 -0
- package/dist/auth-router-BG74WFUf.mjs +66 -0
- package/dist/auth-xnkmpZUl.mjs +311 -0
- package/dist/base64-ikl9yBy3.mjs +15 -0
- package/dist/better-auth-shared-Br6TNaYJ.mjs +473 -0
- package/dist/better-auth-shared-CsBNvPOU.d.mts +56 -0
- package/dist/build-cmd-BnZezraT.mjs +153 -0
- package/dist/build-output-dir-Clj_unKN.mjs +402 -0
- package/dist/cancel-deploy-DKAj5U1Z.mjs +57 -0
- package/dist/cf-access-Bhz9wX6p.mjs +131 -0
- package/dist/cf-access-CUP5L08W.mjs +67 -0
- package/dist/cf-build-output-DA6uJomQ.mjs +1 -0
- package/dist/cf-build-output-DNQTwMNU.mjs +438 -0
- package/dist/cf-command-values-2kOtxMo1.mjs +26 -0
- package/dist/cf-config-migrate-COOCi4Ge.mjs +330 -0
- package/dist/cf-worker-settings-CIh4t_yG.mjs +41 -0
- package/dist/cli/cli.d.mts +1 -0
- package/dist/cli/cli.mjs +88 -0
- package/dist/cli/cloudflare-operation-process.d.mts +1 -0
- package/dist/cli/cloudflare-operation-process.mjs +1284 -0
- package/dist/cli/env-schema-probe.d.mts +43 -0
- package/dist/cli/env-schema-probe.mjs +165 -0
- package/dist/cli-main-BfYf6fnB.mjs +1846 -0
- package/dist/client-D3D5RM5h.mjs +940 -0
- package/dist/client-VF2Nzc7Z.mjs +1 -0
- package/dist/cloudflare-auth-DzkU9H6r.mjs +152 -0
- package/dist/cloudflare-cmd-Bm6UhzAQ.mjs +59 -0
- package/dist/cloudflare-config-i8yanry0.mjs +186 -0
- package/dist/cloudflare-connect-B4ItSbJi.mjs +55 -0
- package/dist/cloudflare-operations-BcK849ue.mjs +1 -0
- package/dist/cloudflare-operations-DGF7xH7O.mjs +627 -0
- package/dist/cloudflare-process-tThIjEB2.mjs +309 -0
- package/dist/cloudflare-user-output-CqONaAbP.mjs +19 -0
- package/dist/collect-8i0wU63d.mjs +1 -0
- package/dist/collect-C6Blu9yw.mjs +48 -0
- package/dist/config-CN_RFRkS.mjs +86 -0
- package/dist/config-D5G-Tx6o.mjs +1 -0
- package/dist/config-DOaFIK3w.mjs +88 -0
- package/dist/config-entry.d.mts +202 -0
- package/dist/config-entry.mjs +6 -0
- package/dist/config-tNx0HlFv.mjs +516 -0
- package/dist/connect-CSNWKLzB.mjs +84 -0
- package/dist/create-project-B35ux-LA.mjs +126 -0
- package/dist/create-project-tJ1KwNss.mjs +1 -0
- package/dist/database-provider-DkZo4VwN.mjs +5 -0
- package/dist/database-provider.d.mts +25 -0
- package/dist/database-provider.mjs +1 -0
- package/dist/db-SOv4E9wr.mjs +1735 -0
- package/dist/delete-BSKI7V23.mjs +65 -0
- package/dist/deploy-BCSQoKC0.mjs +2 -0
- package/dist/deploy-CWJ3JJs_.mjs +6512 -0
- package/dist/deploy.d.mts +31 -0
- package/dist/deploy.mjs +118 -0
- package/dist/dev-inbox-I0nqTCdf.mjs +216 -0
- package/dist/discover-DJPmQcL5.mjs +36 -0
- package/dist/discover-EVuydEoM.mjs +1 -0
- package/dist/dist-B6eN80gc.mjs +1612 -0
- package/dist/dist-Cp4b1_T9.mjs +1 -0
- package/dist/dist-DMYe8CZJ.mjs +48 -0
- package/dist/dist-STQXl8ck.mjs +1878 -0
- package/dist/domain-BJaAbxuQ.mjs +149 -0
- package/dist/dotenv-4NdUCXbB.mjs +156 -0
- package/dist/drizzle-DqVFXtlc.mjs +306 -0
- package/dist/drizzle-Ds5P0n-S.mjs +1 -0
- package/dist/edge.d.mts +2 -0
- package/dist/edge.mjs +1 -0
- package/dist/email-C_ATvNIG.mjs +2865 -0
- package/dist/email-cloudflare-oXk2G1G3.mjs +854 -0
- package/dist/email-protocol-CZ0bAkI8.mjs +81 -0
- package/dist/email-rIfZgVAB.mjs +742 -0
- package/dist/env-BGTu3KWZ.mjs +73 -0
- package/dist/env-DUyTzroe.mjs +88 -0
- package/dist/env-Dl4Wggec.mjs +71 -0
- package/dist/env-helpers-BX0APszT.mjs +135 -0
- package/dist/env-helpers-U56xuFgL.d.mts +20 -0
- package/dist/env-mask-BsHxq3R8.mjs +46 -0
- package/dist/env-public-Cw_xPi1D.d.mts +119 -0
- package/dist/env-raw-Bo6TtrHU.mjs +41 -0
- package/dist/env-types-Bg-dTh8u.mjs +56 -0
- package/dist/env-validation-BlXzGgLZ.mjs +1 -0
- package/dist/env-validation-DeqFUSKg.mjs +488 -0
- package/dist/fetch-CBgyyhzm.d.mts +87 -0
- package/dist/fetch-error-DmlRM6e4.mjs +264 -0
- package/dist/fetch-stream-2GUN3YN1.mjs +102 -0
- package/dist/fetch-stream-bUXynOyZ.d.mts +32 -0
- package/dist/fetch-tpPiSK10.mjs +25 -0
- package/dist/gen-dc13IRXh.mjs +509 -0
- package/dist/gen-kQqhFyOP.mjs +1 -0
- package/dist/generate-BgtlYpKg.mjs +1 -0
- package/dist/generate-Da9mWKzU.mjs +80 -0
- package/dist/generated-wrangler-config-CoDaaFsA.mjs +17 -0
- package/dist/git-metadata-Cukp5kV5.mjs +82 -0
- package/dist/github-cmd-DT5Onu6E.mjs +690 -0
- package/dist/handler-B_ocHStk.d.mts +279 -0
- package/dist/handler-CNq7aSs1.mjs +161 -0
- package/dist/help-BK35YcRa.mjs +1946 -0
- package/dist/help-DaRezBj7.mjs +1 -0
- package/dist/inbound-CqubE-9T.d.mts +311 -0
- package/dist/inbound-lHugZPuK.mjs +509 -0
- package/dist/index.d.mts +64 -0
- package/dist/index.mjs +4163 -0
- package/dist/info-CLQoCenb.mjs +109 -0
- package/dist/init-CXanf5ck.mjs +2486 -0
- package/dist/limits-CMmYT2l8.d.mts +16 -0
- package/dist/limits-D27Lp6FP.mjs +46 -0
- package/dist/link-DinwJnon.mjs +52 -0
- package/dist/list-B1WAE9Wt.mjs +130 -0
- package/dist/live-KkEeda1Z.d.mts +105 -0
- package/dist/live-saC8barp.mjs +410 -0
- package/dist/load-user-env-g0ahkZcj.mjs +34 -0
- package/dist/local-d1-bUoAtFUe.mjs +103 -0
- package/dist/log-JDnPc0cF.mjs +23 -0
- package/dist/login-BUzyiyHV.mjs +1 -0
- package/dist/login-Dbv_T3Ru.mjs +87 -0
- package/dist/logs-BjMJooJQ.mjs +129 -0
- package/dist/migrate-DjW9_-sS.mjs +1 -0
- package/dist/migrate-DtcfKqPW.mjs +125 -0
- package/dist/migration-handler-22qiuWPq.mjs +469 -0
- package/dist/migration-handler-Bb2BJh6g.d.mts +38 -0
- package/dist/mime-BMUN_QKG.mjs +1004 -0
- package/dist/mysql-migration-sql-CNuBSqdx.mjs +239 -0
- package/dist/neon-CJzQSycr.mjs +52 -0
- package/dist/node-tfv-3v0V.mjs +64 -0
- package/dist/operator-ai-logging-Ay7M4KWw.mjs +121 -0
- package/dist/operator-args-BiGmSlZx.mjs +722 -0
- package/dist/operator-auth-DdYZYEkO.mjs +47 -0
- package/dist/operator-client-DBujdELO.mjs +82 -0
- package/dist/operator-cmd-BsHKYJYt.mjs +1 -0
- package/dist/operator-cmd-DTIkOAnP.mjs +443 -0
- package/dist/output-Bb34lF0w.mjs +173 -0
- package/dist/output-CVolXKC1.mjs +1 -0
- package/dist/package-BX_giUBX.mjs +1444 -0
- package/dist/package-json-DvS6IFRv.mjs +43 -0
- package/dist/pg-DoyPxa_X.mjs +15 -0
- package/dist/picocolors-D1NxSLw-.mjs +71 -0
- package/dist/plan-BHNt1QhK.mjs +1 -0
- package/dist/plan-DX4_-OM5.mjs +58 -0
- package/dist/platform-args-C-DyuCNX.mjs +1 -0
- package/dist/platform-args-CyeQWaZ7.mjs +538 -0
- package/dist/platform-auth-config-BfXqKSyZ.mjs +371 -0
- package/dist/platform-auth-protection-5FR6qoP_.mjs +231 -0
- package/dist/platform-auth-recovery-B5ZlqA8K.mjs +309 -0
- package/dist/platform-cmd-CcFDxtrl.mjs +1 -0
- package/dist/platform-cmd-ChXeBrRH.mjs +193 -0
- package/dist/platform-discovery-Bxg9aZXU.mjs +40 -0
- package/dist/platform-domain-CwatS3cz.mjs +256 -0
- package/dist/platform-lifecycle-0cXTmMsh.mjs +8928 -0
- package/dist/platform-lifecycle-BcoBAMux.mjs +1 -0
- package/dist/platform-management-6Wbdbob5.mjs +1607 -0
- package/dist/platform-management-hhnczOzr.mjs +1 -0
- package/dist/platform-plans-config-CkbUKFpm.mjs +447 -0
- package/dist/platform-recovery-DgIwlqB-.mjs +96 -0
- package/dist/platform-registry-x1m9HBxf.mjs +450 -0
- package/dist/platform-runtime-logs-kkoiYFpF.mjs +72 -0
- package/dist/platform-setup-DX8y_6Kh.mjs +306 -0
- package/dist/prepare-B9mB47T5.mjs +84 -0
- package/dist/prepare-DNIq07so.mjs +13 -0
- package/dist/prepare-LHkyJqxi.mjs +1 -0
- package/dist/project-CC7eN00D.mjs +141 -0
- package/dist/project-DcSd4BeI.mjs +1 -0
- package/dist/project-cmd-BydRwr-x.mjs +109 -0
- package/dist/project-paths-iXHKRTTQ.mjs +159 -0
- package/dist/project-slug-BUy0lmyR.mjs +1 -0
- package/dist/project-slug-CO6ci9XG.mjs +7 -0
- package/dist/project-team-CvdLhDF2.mjs +129 -0
- package/dist/project-token-CwZdUEGu.mjs +70 -0
- package/dist/project-tsconfig-P9X952KG.mjs +98 -0
- package/dist/project-zero-trust-CKDoPdN1.mjs +64 -0
- package/dist/providers-Cd3c7wi0.mjs +64 -0
- package/dist/providers-Df69hb_X.d.mts +5 -0
- package/dist/provision-BA59NCPO.mjs +1 -0
- package/dist/provision-C90fULHJ.mjs +1814 -0
- package/dist/queues-Bc3FsBQT.d.mts +5 -0
- package/dist/r2-conditions-DSLmkiR5.mjs +60 -0
- package/dist/requests-DNhfyF3l.mjs +52 -0
- package/dist/resolve-project-BCsAMDRA.mjs +47 -0
- package/dist/resolve-project-DhU9_lIo.mjs +1 -0
- package/dist/resource-name-DlJ9QXzg.mjs +10 -0
- package/dist/response-HmNjB30w.mjs +29 -0
- package/dist/rollback-wi6WK5T6.mjs +150 -0
- package/dist/rolldown-runtime-uD8oG6U2.mjs +24 -0
- package/dist/route-types-CRWhr93D.mjs +592 -0
- package/dist/route-url-BIDZT78M.mjs +58 -0
- package/dist/route-url-Bla3Upsy.d.mts +42 -0
- package/dist/routes-stub.d.mts +24 -0
- package/dist/routes-stub.mjs +1 -0
- package/dist/routing-assets-CSheDWWM.mjs +54 -0
- package/dist/rpc-DcByS_q0.d.mts +39 -0
- package/dist/rpc-DtxIN9Tv.mjs +19 -0
- package/dist/runner-CPerdjIl.mjs +163 -0
- package/dist/runner-CUNtS5x7.mjs +1 -0
- package/dist/runner-mysql-BjSoQ-mW.mjs +1 -0
- package/dist/runner-mysql-BmTI2EiF.mjs +145 -0
- package/dist/runner-pg-2pjltt0t.mjs +1 -0
- package/dist/runner-pg-mYc75KfH.mjs +61 -0
- package/dist/runtime/ai.d.mts +50 -0
- package/dist/runtime/ai.mjs +455 -0
- package/dist/runtime/auth-client-react.d.mts +2 -0
- package/dist/runtime/auth-client-react.mjs +1 -0
- package/dist/runtime/auth-client.d.mts +2 -0
- package/dist/runtime/auth-client.mjs +1 -0
- package/dist/runtime/auth.d.mts +2 -0
- package/dist/runtime/auth.mjs +1 -0
- package/dist/runtime/better-auth-mysql.d.mts +5 -0
- package/dist/runtime/better-auth-mysql.mjs +21 -0
- package/dist/runtime/better-auth-pg.d.mts +5 -0
- package/dist/runtime/better-auth-pg.mjs +21 -0
- package/dist/runtime/better-auth.d.mts +6 -0
- package/dist/runtime/better-auth.mjs +22 -0
- package/dist/runtime/client-react.d.mts +5 -0
- package/dist/runtime/client-react.mjs +5 -0
- package/dist/runtime/client.d.mts +5 -0
- package/dist/runtime/client.mjs +5 -0
- package/dist/runtime/db-mysql.d.mts +2 -0
- package/dist/runtime/db-mysql.mjs +1 -0
- package/dist/runtime/db-pg.d.mts +2 -0
- package/dist/runtime/db-pg.mjs +1 -0
- package/dist/runtime/db.d.mts +17 -0
- package/dist/runtime/db.mjs +36 -0
- package/dist/runtime/drizzle-arktype.d.mts +1 -0
- package/dist/runtime/drizzle-arktype.mjs +2 -0
- package/dist/runtime/drizzle-valibot.d.mts +1 -0
- package/dist/runtime/drizzle-valibot.mjs +2 -0
- package/dist/runtime/drizzle-zod.d.mts +1 -0
- package/dist/runtime/drizzle-zod.mjs +2 -0
- package/dist/runtime/durable.d.mts +64 -0
- package/dist/runtime/durable.mjs +165 -0
- package/dist/runtime/email/testing.d.mts +108 -0
- package/dist/runtime/email/testing.mjs +268 -0
- package/dist/runtime/email-protocol.d.mts +25 -0
- package/dist/runtime/email-protocol.mjs +1 -0
- package/dist/runtime/email.d.mts +26 -0
- package/dist/runtime/email.mjs +524 -0
- package/dist/runtime/env-public-client.d.mts +19 -0
- package/dist/runtime/env-public-client.mjs +55 -0
- package/dist/runtime/env-public.d.mts +4 -0
- package/dist/runtime/env-public.mjs +277 -0
- package/dist/runtime/env.d.mts +12 -0
- package/dist/runtime/env.mjs +1 -0
- package/dist/runtime/fetch-server.d.mts +6 -0
- package/dist/runtime/fetch-server.mjs +29 -0
- package/dist/runtime/fetch-stream.d.mts +3 -0
- package/dist/runtime/fetch-stream.mjs +3 -0
- package/dist/runtime/fetch.d.mts +2 -0
- package/dist/runtime/fetch.mjs +3 -0
- package/dist/runtime/handler.d.mts +3 -0
- package/dist/runtime/handler.mjs +1 -0
- package/dist/runtime/kv.d.mts +45 -0
- package/dist/runtime/kv.mjs +103 -0
- package/dist/runtime/limits.d.mts +2 -0
- package/dist/runtime/limits.mjs +1 -0
- package/dist/runtime/live-client.d.mts +40 -0
- package/dist/runtime/live-client.mjs +282 -0
- package/dist/runtime/live-server.d.mts +11 -0
- package/dist/runtime/live-server.mjs +419 -0
- package/dist/runtime/live.d.mts +3 -0
- package/dist/runtime/live.mjs +1 -0
- package/dist/runtime/log.d.mts +24 -0
- package/dist/runtime/log.mjs +57 -0
- package/dist/runtime/migration-handler-mysql.d.mts +2 -0
- package/dist/runtime/migration-handler-mysql.mjs +111 -0
- package/dist/runtime/migration-handler-pg.d.mts +2 -0
- package/dist/runtime/migration-handler-pg.mjs +94 -0
- package/dist/runtime/migration-handler.d.mts +2 -0
- package/dist/runtime/migration-handler.mjs +1 -0
- package/dist/runtime/procedure.d.mts +27 -0
- package/dist/runtime/procedure.mjs +36 -0
- package/dist/runtime/procedures.d.mts +24 -0
- package/dist/runtime/procedures.mjs +56 -0
- package/dist/runtime/queues.d.mts +2 -0
- package/dist/runtime/queues.mjs +8 -0
- package/dist/runtime/remote/binding-handler.d.mts +11 -0
- package/dist/runtime/remote/binding-handler.mjs +227 -0
- package/dist/runtime/remote/index.d.mts +12 -0
- package/dist/runtime/remote/index.mjs +467 -0
- package/dist/runtime/response.d.mts +11 -0
- package/dist/runtime/response.mjs +1 -0
- package/dist/runtime/route-url.d.mts +2 -0
- package/dist/runtime/route-url.mjs +1 -0
- package/dist/runtime/routing.d.mts +53 -0
- package/dist/runtime/routing.mjs +425 -0
- package/dist/runtime/rpc-react.d.mts +16 -0
- package/dist/runtime/rpc-react.mjs +50 -0
- package/dist/runtime/rpc.d.mts +2 -0
- package/dist/runtime/rpc.mjs +1 -0
- package/dist/runtime/sandbox-container.d.mts +3 -0
- package/dist/runtime/sandbox-container.mjs +1 -0
- package/dist/runtime/sandbox.d.mts +5 -0
- package/dist/runtime/sandbox.mjs +196 -0
- package/dist/runtime/schema-d1.d.mts +1 -0
- package/dist/runtime/schema-d1.mjs +2 -0
- package/dist/runtime/schema-mysql.d.mts +1 -0
- package/dist/runtime/schema-mysql.mjs +2 -0
- package/dist/runtime/schema-pg.d.mts +1 -0
- package/dist/runtime/schema-pg.mjs +2 -0
- package/dist/runtime/seed.d.mts +34 -0
- package/dist/runtime/seed.mjs +5 -0
- package/dist/runtime/sse-client.d.mts +31 -0
- package/dist/runtime/sse-client.mjs +42 -0
- package/dist/runtime/sse.d.mts +32 -0
- package/dist/runtime/sse.mjs +1 -0
- package/dist/runtime/storage.d.mts +4 -0
- package/dist/runtime/storage.mjs +13 -0
- package/dist/runtime/validator.d.mts +2 -0
- package/dist/runtime/validator.mjs +1 -0
- package/dist/runtime/ws-server.d.mts +26 -0
- package/dist/runtime/ws-server.mjs +297 -0
- package/dist/runtime/ws.d.mts +2 -0
- package/dist/runtime/ws.mjs +108 -0
- package/dist/sandbox-CWDjoEG2.d.mts +50 -0
- package/dist/sandbox-container-BqamdFCx.d.mts +73 -0
- package/dist/sandbox-container-d1AHLpgn.mjs +291 -0
- package/dist/secret-D5XrWshs.mjs +146 -0
- package/dist/skills-Dr3AjuBF.mjs +63 -0
- package/dist/sqlite-validation-CLJXXN93.mjs +24 -0
- package/dist/sse-CxR30yMF.mjs +174 -0
- package/dist/standard-schema-CuDawHOC.d.mts +40 -0
- package/dist/static-asset-marker-mWMX2dLa.mjs +38 -0
- package/dist/subcommand-prompt-B9yUo--u.mjs +370 -0
- package/dist/terminal-log-text-DNsWJREL.mjs +31 -0
- package/dist/types-D7-4tBu7.d.mts +1 -0
- package/dist/untrusted-env-lL7RkYiC.mjs +50 -0
- package/dist/validate-B-zsjhiz.mjs +162 -0
- package/dist/validate-DbqGdPPY.mjs +1 -0
- package/dist/validator-8-NZs2Xr.mjs +168 -0
- package/dist/version-metadata-DPhqnpaa.mjs +23 -0
- package/dist/wrangler-C3uyPadQ.mjs +1 -0
- package/dist/wrangler-TqTvJFWS.mjs +1452 -0
- package/dist/ws-DZRiIpYw.d.mts +137 -0
- package/dist/yarn-pnp-DgWbE7z5.mjs +91 -0
- package/docs/guide/ai.md +273 -0
- package/docs/guide/app-types.md +101 -0
- package/docs/guide/auth.md +255 -0
- package/docs/guide/database/d1.md +86 -0
- package/docs/guide/database/mysql.md +72 -0
- package/docs/guide/database/postgresql.md +94 -0
- package/docs/guide/database.md +454 -0
- package/docs/guide/deployment.md +124 -0
- package/docs/guide/durable-state.md +192 -0
- package/docs/guide/edge/headers.md +47 -0
- package/docs/guide/edge/redirects.md +85 -0
- package/docs/guide/edge/rewrites.md +119 -0
- package/docs/guide/edge/static-assets.md +94 -0
- package/docs/guide/email/domains.md +119 -0
- package/docs/guide/email/receiving.md +142 -0
- package/docs/guide/email/sending.md +262 -0
- package/docs/guide/email.md +23 -0
- package/docs/guide/env-vars.md +115 -0
- package/docs/guide/index.md +37 -0
- package/docs/guide/jobs.md +80 -0
- package/docs/guide/kv.md +100 -0
- package/docs/guide/live.md +181 -0
- package/docs/guide/platform/administration/access.md +165 -0
- package/docs/guide/platform/administration/connected-apps.md +84 -0
- package/docs/guide/platform/administration/email.md +169 -0
- package/docs/guide/platform/administration/operations.md +100 -0
- package/docs/guide/platform/administration/plans.md +156 -0
- package/docs/guide/platform/administration/projects.md +74 -0
- package/docs/guide/platform/administration/zero-trust.md +205 -0
- package/docs/guide/platform/development/local.md +122 -0
- package/docs/guide/platform/development/runtime.md +115 -0
- package/docs/guide/platform/development/schema-ci.md +44 -0
- package/docs/guide/platform/installation/ci.md +62 -0
- package/docs/guide/platform/installation/credentials.md +140 -0
- package/docs/guide/platform/installation/domains.md +120 -0
- package/docs/guide/platform/installation/first-deployment.md +95 -0
- package/docs/guide/platform/installation/maintenance.md +250 -0
- package/docs/guide/platform/installation/prerequisites.md +176 -0
- package/docs/guide/platform/installation/setup.md +300 -0
- package/docs/guide/platform/installation/uninstall.md +110 -0
- package/docs/guide/platform-administration.md +19 -0
- package/docs/guide/platform-development.md +16 -0
- package/docs/guide/procedures.md +48 -0
- package/docs/guide/project-collaboration.md +99 -0
- package/docs/guide/queues.md +149 -0
- package/docs/guide/quickstart.md +129 -0
- package/docs/guide/remote-dev.md +67 -0
- package/docs/guide/sandboxes.md +134 -0
- package/docs/guide/self-hosted-platform.md +45 -0
- package/docs/guide/server-routing.md +283 -0
- package/docs/guide/sse.md +174 -0
- package/docs/guide/storage.md +82 -0
- package/docs/guide/testing.md +64 -0
- package/docs/guide/type-safety.md +270 -0
- package/docs/guide/typed-fetch.md +98 -0
- package/docs/guide/websockets.md +230 -0
- package/docs/index.md +102 -0
- package/docs/integrations/agents.md +38 -0
- package/docs/integrations/cloudflare.md +241 -0
- package/docs/integrations/hono.md +127 -0
- package/docs/reference/api/auth.md +195 -0
- package/docs/reference/api/client.md +90 -0
- package/docs/reference/api/database.md +118 -0
- package/docs/reference/api/deploy.md +63 -0
- package/docs/reference/api/durable.md +47 -0
- package/docs/reference/api/env.md +51 -0
- package/docs/reference/api/handlers.md +189 -0
- package/docs/reference/api/plugin.md +40 -0
- package/docs/reference/api/resources.md +116 -0
- package/docs/reference/api/rewrites.md +111 -0
- package/docs/reference/api/types.md +126 -0
- package/docs/reference/api.md +71 -0
- package/docs/reference/cli/auth.md +87 -0
- package/docs/reference/cli/database.md +159 -0
- package/docs/reference/cli/deploy.md +117 -0
- package/docs/reference/cli/domains.md +42 -0
- package/docs/reference/cli/email.md +145 -0
- package/docs/reference/cli/generate.md +113 -0
- package/docs/reference/cli/github.md +181 -0
- package/docs/reference/cli/platform-config.md +93 -0
- package/docs/reference/cli/platform-email.md +81 -0
- package/docs/reference/cli/platform-installation.md +166 -0
- package/docs/reference/cli/platform-operations.md +90 -0
- package/docs/reference/cli/platform-users.md +159 -0
- package/docs/reference/cli/platform-zero-trust.md +60 -0
- package/docs/reference/cli/platform.md +78 -0
- package/docs/reference/cli/project.md +208 -0
- package/docs/reference/cli/secrets.md +79 -0
- package/docs/reference/cli/setup.md +88 -0
- package/docs/reference/cli.md +115 -0
- package/docs/reference/config.md +478 -0
- package/docs/reference/resource-inference.md +72 -0
- package/docs/reference/structure.md +138 -0
- package/package.json +389 -3
- package/sandbox.Dockerfile +4 -0
- package/schema.json +353 -0
- package/skills/bwf/SKILL.md +100 -0
- package/skills/migrate-vite-cloudflare-to-bwf/SKILL.md +53 -0
- package/templates/assets/bwf.svg +5 -0
- package/templates/assets/icons.svg +49 -0
- package/templates/assets/react.svg +1 -0
- package/templates/assets/stack.svg +35 -0
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Define tables in TypeScript and query them with Drizzle. Use the same schema with D1, PostgreSQL, or MySQL.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<script setup>
|
|
7
|
+
const dbFileItems = [
|
|
8
|
+
{
|
|
9
|
+
name: "db/",
|
|
10
|
+
children: [
|
|
11
|
+
{ name: "schema.ts", description: "Table definitions (source of truth)" },
|
|
12
|
+
{
|
|
13
|
+
name: "schema/",
|
|
14
|
+
description: "Split schema files (optional)",
|
|
15
|
+
children: [
|
|
16
|
+
{ name: "users.ts" },
|
|
17
|
+
{ name: "posts.ts" },
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "migrations/",
|
|
22
|
+
description: "Generated SQL migration files",
|
|
23
|
+
children: [
|
|
24
|
+
{ name: "20260410161500_create_users.sql" },
|
|
25
|
+
{ name: "20260410161501_add_posts.sql" },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{ name: "seed.ts", description: "Programmatic seed script (optional)" },
|
|
29
|
+
{ name: "seed.sql", description: "Raw SQL seed file (optional alternative)" },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
# Database
|
|
36
|
+
|
|
37
|
+
Define your tables in TypeScript, then query them with `db` from `@builtbyfriends/bwf/db`. bwf includes [Drizzle ORM](https://orm.drizzle.team) and configures the connection, so you can use the same schema and query workflow with D1, PostgreSQL, or MySQL.
|
|
38
|
+
|
|
39
|
+
<FileTree :items="dbFileItems" default-expanded />
|
|
40
|
+
|
|
41
|
+
## Choosing a Dialect
|
|
42
|
+
|
|
43
|
+
Choose a database during `bwf init`, or set `database` in `bwf.config.ts`:
|
|
44
|
+
|
|
45
|
+
| | [D1 (SQLite)](./database/d1) | [PostgreSQL](./database/postgresql) | [MySQL](./database/mysql) |
|
|
46
|
+
| ---------- | ---------------------------- | ----------------------------------- | ------------------------- |
|
|
47
|
+
| Config | Default | `"database": "pg"` | `"database": "mysql"` |
|
|
48
|
+
| Managed by | bwf | Bring your own database | Bring your own database |
|
|
49
|
+
| Connection | Automatic D1 binding | Hyperdrive | Hyperdrive |
|
|
50
|
+
|
|
51
|
+
A bwf platform keeps Hyperdrive query caching off for your database connection, so reads reflect completed writes. An existing connection is updated on the project's next deploy.
|
|
52
|
+
|
|
53
|
+
## Schema Definition
|
|
54
|
+
|
|
55
|
+
Define your tables in `db/schema.ts` using column helpers from `@builtbyfriends/bwf/schema-d1`, `@builtbyfriends/bwf/schema-pg`, or `@builtbyfriends/bwf/schema-mysql`.
|
|
56
|
+
|
|
57
|
+
::: code-group
|
|
58
|
+
|
|
59
|
+
```ts [SQLite (D1)]
|
|
60
|
+
// db/schema.ts
|
|
61
|
+
import { sql } from '@builtbyfriends/bwf/db';
|
|
62
|
+
import { sqliteTable, text, integer } from '@builtbyfriends/bwf/schema-d1';
|
|
63
|
+
|
|
64
|
+
export const users = sqliteTable('users', {
|
|
65
|
+
id: integer('id').primaryKey({ autoIncrement: true }),
|
|
66
|
+
name: text('name').notNull(),
|
|
67
|
+
email: text('email').notNull().unique(),
|
|
68
|
+
role: text('role').notNull().default('user'),
|
|
69
|
+
createdAt: text('created_at')
|
|
70
|
+
.notNull()
|
|
71
|
+
.default(sql`(datetime('now'))`),
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```ts [PostgreSQL]
|
|
76
|
+
// db/schema.ts
|
|
77
|
+
import { pgTable, serial, text, timestamp } from '@builtbyfriends/bwf/schema-pg';
|
|
78
|
+
|
|
79
|
+
export const users = pgTable('users', {
|
|
80
|
+
id: serial('id').primaryKey(),
|
|
81
|
+
name: text('name').notNull(),
|
|
82
|
+
email: text('email').notNull().unique(),
|
|
83
|
+
role: text('role').notNull().default('user'),
|
|
84
|
+
createdAt: timestamp('created_at').notNull().defaultNow(),
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```ts [MySQL]
|
|
89
|
+
// db/schema.ts
|
|
90
|
+
import { int, mysqlTable, text, timestamp } from '@builtbyfriends/bwf/schema-mysql';
|
|
91
|
+
|
|
92
|
+
export const users = mysqlTable('users', {
|
|
93
|
+
id: int('id').autoincrement().primaryKey(),
|
|
94
|
+
name: text('name').notNull(),
|
|
95
|
+
email: text('email').notNull(),
|
|
96
|
+
createdAt: timestamp('created_at').notNull().defaultNow(),
|
|
97
|
+
});
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
:::
|
|
101
|
+
|
|
102
|
+
The schema helpers are included in `bwf`. You can write tables yourself or generate a starting point with `bwf gen model`.
|
|
103
|
+
|
|
104
|
+
You can also split your schema across multiple files under `db/schema/` and re-export from a barrel file:
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
// db/schema/users.ts
|
|
108
|
+
export const users = ...;
|
|
109
|
+
|
|
110
|
+
// db/schema/posts.ts
|
|
111
|
+
export const posts = ...;
|
|
112
|
+
|
|
113
|
+
// db/schema.ts (barrel)
|
|
114
|
+
export * from "./schema/users";
|
|
115
|
+
export * from "./schema/posts";
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Column casing
|
|
119
|
+
|
|
120
|
+
By default, a column declared without a name, such as `createdAt: timestamp()`, uses its key as the column name. Set `database.casing` to `'snake_case'` to store these columns as `created_at` instead. It applies to `@builtbyfriends/bwf/db` queries and to `bwf db` commands such as `generate`, `push`, and `seed`. Columns with an explicit name, such as `text('created_at')`, keep that name.
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
// bwf.config.ts
|
|
124
|
+
import { defineConfig } from '@builtbyfriends/bwf/config';
|
|
125
|
+
|
|
126
|
+
export default defineConfig({
|
|
127
|
+
database: { dialect: 'pg', casing: 'snake_case' },
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
// db/schema.ts
|
|
133
|
+
import { pgTable, serial, text, timestamp } from '@builtbyfriends/bwf/schema-pg';
|
|
134
|
+
|
|
135
|
+
export const posts = pgTable('posts', {
|
|
136
|
+
id: serial().primaryKey(),
|
|
137
|
+
title: text().notNull(),
|
|
138
|
+
createdAt: timestamp().notNull().defaultNow(), // created_at
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Omit `dialect` for D1. If your database already has tables, run `bwf db generate` after you change `casing` and review the migration before you apply it.
|
|
143
|
+
|
|
144
|
+
## Querying
|
|
145
|
+
|
|
146
|
+
bwf re-exports all common [Drizzle query operators](https://orm.drizzle.team/docs/select) from `@builtbyfriends/bwf/db` so you don't need to install `drizzle-orm` separately. Import `db` from `@builtbyfriends/bwf/db` and your tables from `@schema`:
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
import { db } from '@builtbyfriends/bwf/db';
|
|
150
|
+
import { users } from '@schema';
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
::: info What is `@schema`?
|
|
154
|
+
`@schema` is a Vite path alias that the bwf plugin configures automatically. It points to your `db/schema.ts` file, or `db/schema/` if you split tables across files. You can just use it to import table definitions.
|
|
155
|
+
:::
|
|
156
|
+
|
|
157
|
+
### List rows
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
const allUsers = await db.select().from(users);
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Filter with `where`
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
import { db, eq, and, or } from '@builtbyfriends/bwf/db';
|
|
167
|
+
import { users } from '@schema';
|
|
168
|
+
|
|
169
|
+
// Single condition
|
|
170
|
+
const user = await db.select().from(users).where(eq(users.id, 1));
|
|
171
|
+
|
|
172
|
+
// Multiple conditions
|
|
173
|
+
const admins = await db
|
|
174
|
+
.select()
|
|
175
|
+
.from(users)
|
|
176
|
+
.where(and(eq(users.role, 'admin'), eq(users.name, 'Alice')));
|
|
177
|
+
|
|
178
|
+
// OR conditions
|
|
179
|
+
const result = await db
|
|
180
|
+
.select()
|
|
181
|
+
.from(users)
|
|
182
|
+
.where(or(eq(users.role, 'admin'), eq(users.role, 'editor')));
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Insert
|
|
186
|
+
|
|
187
|
+
```ts
|
|
188
|
+
// Single row
|
|
189
|
+
await db.insert(users).values({
|
|
190
|
+
name: 'Alice',
|
|
191
|
+
email: 'alice@example.com',
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
// Insert and return the created row
|
|
195
|
+
const [created] = await db
|
|
196
|
+
.insert(users)
|
|
197
|
+
.values({ name: 'Bob', email: 'bob@example.com' })
|
|
198
|
+
.returning();
|
|
199
|
+
|
|
200
|
+
// Multiple rows
|
|
201
|
+
await db.insert(users).values([
|
|
202
|
+
{ name: 'Alice', email: 'alice@example.com' },
|
|
203
|
+
{ name: 'Bob', email: 'bob@example.com' },
|
|
204
|
+
]);
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Update
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
await db.update(users).set({ role: 'admin' }).where(eq(users.id, 1));
|
|
211
|
+
|
|
212
|
+
// Update and return the modified row
|
|
213
|
+
const [updated] = await db.update(users).set({ role: 'admin' }).where(eq(users.id, 1)).returning();
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Delete
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
await db.delete(users).where(eq(users.id, 1));
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Column selection
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
const names = await db.select({ name: users.name, email: users.email }).from(users);
|
|
226
|
+
// names: { name: string; email: string }[]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Ordering and pagination
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
import { db, desc } from '@builtbyfriends/bwf/db';
|
|
233
|
+
import { users } from '@schema';
|
|
234
|
+
|
|
235
|
+
const page = await db.select().from(users).orderBy(desc(users.createdAt)).limit(10).offset(20);
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Joins
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
import { db, eq } from '@builtbyfriends/bwf/db';
|
|
242
|
+
import { users, posts } from '@schema';
|
|
243
|
+
|
|
244
|
+
const results = await db
|
|
245
|
+
.select({
|
|
246
|
+
id: posts.id,
|
|
247
|
+
title: posts.title,
|
|
248
|
+
author: users.name,
|
|
249
|
+
})
|
|
250
|
+
.from(posts)
|
|
251
|
+
.innerJoin(users, eq(posts.userId, users.id));
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Relational queries
|
|
255
|
+
|
|
256
|
+
If your schema defines [relations](https://orm.drizzle.team/docs/relations), you can use Drizzle's relational query API:
|
|
257
|
+
|
|
258
|
+
```ts
|
|
259
|
+
const usersWithPosts = await db.query.users.findMany({
|
|
260
|
+
with: { posts: true },
|
|
261
|
+
});
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Seeding
|
|
265
|
+
|
|
266
|
+
Use `bwf db seed` to reset your local database, re-apply migrations, and then run a seed file.
|
|
267
|
+
|
|
268
|
+
Use `db/seed.ts` for a programmatic seed or `db/seed.sql` for SQL. JavaScript and `.mts` / `.mjs` files also work. If more than one seed file exists, choose one with `--file <path>`.
|
|
269
|
+
|
|
270
|
+
### Programmatic seeding
|
|
271
|
+
|
|
272
|
+
Use `db/seed.ts` when you want to generate seed data in code. Export a default function or a named `seed` function.
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
// db/seed.ts
|
|
276
|
+
import { defineSeed } from '@builtbyfriends/bwf/seed';
|
|
277
|
+
|
|
278
|
+
export default defineSeed<typeof import('./schema')>(async ({ db, schema }) => {
|
|
279
|
+
const rows = Array.from({ length: 100 }, (_, i) => ({
|
|
280
|
+
text: `Seed message ${i + 1}`,
|
|
281
|
+
}));
|
|
282
|
+
|
|
283
|
+
await db.insert(schema.messages).values(rows);
|
|
284
|
+
});
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
The seed context includes:
|
|
288
|
+
|
|
289
|
+
- `dialect`: `"sqlite"`, `"postgresql"`, or `"mysql"`
|
|
290
|
+
- `db`: a Drizzle instance for the local database
|
|
291
|
+
- `schema`: the exports from your `db/schema.ts` or `db/schema/` modules
|
|
292
|
+
|
|
293
|
+
### SQL seeding
|
|
294
|
+
|
|
295
|
+
If you prefer raw SQL, keep using `db/seed.sql`:
|
|
296
|
+
|
|
297
|
+
```sql
|
|
298
|
+
INSERT INTO messages (text) VALUES ('Hello from SQL');
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
## Schema-Derived Validators
|
|
302
|
+
|
|
303
|
+
Derive request validators from your tables with `@builtbyfriends/bwf/drizzle-zod`, `@builtbyfriends/bwf/drizzle-valibot`, or `@builtbyfriends/bwf/drizzle-arktype`. Add the validator after your table definition:
|
|
304
|
+
|
|
305
|
+
::: code-group
|
|
306
|
+
|
|
307
|
+
```ts [Zod]
|
|
308
|
+
// db/schema.ts
|
|
309
|
+
import { createInsertSchema } from '@builtbyfriends/bwf/drizzle-zod';
|
|
310
|
+
|
|
311
|
+
export const insertUserSchema = createInsertSchema(users, {
|
|
312
|
+
name: (schema) => schema.min(1),
|
|
313
|
+
email: (schema) => schema.email(),
|
|
314
|
+
});
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
```ts [Valibot]
|
|
318
|
+
import { createInsertSchema } from '@builtbyfriends/bwf/drizzle-valibot';
|
|
319
|
+
// db/schema.ts
|
|
320
|
+
import { pipe, minLength, email } from 'valibot';
|
|
321
|
+
|
|
322
|
+
export const insertUserSchema = createInsertSchema(users, {
|
|
323
|
+
name: (schema) => pipe(schema, minLength(1)),
|
|
324
|
+
email: (schema) => pipe(schema, email()),
|
|
325
|
+
});
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
```ts [ArkType]
|
|
329
|
+
import { createInsertSchema } from '@builtbyfriends/bwf/drizzle-arktype';
|
|
330
|
+
// db/schema.ts
|
|
331
|
+
import { type } from 'arktype';
|
|
332
|
+
|
|
333
|
+
export const insertUserSchema = createInsertSchema(users, {
|
|
334
|
+
name: type('string > 0'),
|
|
335
|
+
email: type('string.email'),
|
|
336
|
+
});
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
:::
|
|
340
|
+
|
|
341
|
+
`createInsertSchema` generates a validator that matches `$inferInsert`. Columns with defaults or auto-increments become optional, while `NOT NULL` columns stay required. The optional second argument lets you refine individual columns, either with a callback that receives the generated schema or by passing a type directly to override a field.
|
|
342
|
+
|
|
343
|
+
Use the derived schema in your route handlers with [`withValidator()`](./server-routing.md#validation):
|
|
344
|
+
|
|
345
|
+
```ts
|
|
346
|
+
import { defineHandler } from '@builtbyfriends/bwf';
|
|
347
|
+
import { db } from '@builtbyfriends/bwf/db';
|
|
348
|
+
// routes/api/users/index.ts
|
|
349
|
+
import { users, insertUserSchema } from '@schema';
|
|
350
|
+
|
|
351
|
+
export const POST = defineHandler.withValidator({
|
|
352
|
+
body: insertUserSchema,
|
|
353
|
+
})(async (c, { body }) => {
|
|
354
|
+
const [created] = await db.insert(users).values(body).returning();
|
|
355
|
+
return created;
|
|
356
|
+
});
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Three functions are available:
|
|
360
|
+
|
|
361
|
+
| Function | Purpose |
|
|
362
|
+
| -------------------- | ----------------------------------------------------------------------------- |
|
|
363
|
+
| `createInsertSchema` | Validates insert data, excluding auto-generated columns and applying defaults |
|
|
364
|
+
| `createSelectSchema` | Matches the shape of selected rows |
|
|
365
|
+
| `createUpdateSchema` | Like insert but all fields are optional (partial update) |
|
|
366
|
+
|
|
367
|
+
bwf already bundles the Drizzle adapters. Install the validator library itself if you use its direct APIs in your schema file:
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
npm install zod
|
|
371
|
+
# or
|
|
372
|
+
npm install valibot
|
|
373
|
+
# or
|
|
374
|
+
npm install arktype
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
## CLI Commands
|
|
378
|
+
|
|
379
|
+
| Command | Purpose |
|
|
380
|
+
| ----------------- | ---------------------------------------------------- |
|
|
381
|
+
| `bwf db push` | Apply schema changes locally without migration files |
|
|
382
|
+
| `bwf db generate` | Generate SQL migrations |
|
|
383
|
+
| `bwf db migrate` | Apply pending migrations locally |
|
|
384
|
+
| `bwf db status` | Check schema drift and pending migrations |
|
|
385
|
+
| `bwf db seed` | Reset the local database and run a seed file |
|
|
386
|
+
|
|
387
|
+
See the [CLI reference](../reference/cli/database.md#database) for connection setup, SQL execution, Studio, exports, and other commands.
|
|
388
|
+
|
|
389
|
+
## Adopt an existing Drizzle PostgreSQL database {#adopt-existing-drizzle}
|
|
390
|
+
|
|
391
|
+
To use bwf with a PostgreSQL database that Drizzle has already migrated, record its applied migrations before your first deployment:
|
|
392
|
+
|
|
393
|
+
1. Back up the database and pause deployments. Try the procedure on a restored copy first.
|
|
394
|
+
2. Set `database: 'pg'` in `bwf.config.ts`. Keep your existing schema, SQL filenames, and `db/migrations/meta/` directory. Do not regenerate or rename migrations during adoption.
|
|
395
|
+
3. Read Drizzle's migration history. The default table is `drizzle.__drizzle_migrations`; use your configured schema and table if different.
|
|
396
|
+
|
|
397
|
+
```sql
|
|
398
|
+
SELECT hash, created_at FROM drizzle.__drizzle_migrations ORDER BY created_at;
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Match each row's `created_at` to `when` in `meta/_journal.json`, and its `hash` to the SQL file's SHA-256. Resolve any differences before continuing.
|
|
402
|
+
|
|
403
|
+
4. Save this as `adopt-nosam.sql`. Replace the example filenames with **only the migrations you verified as applied**, including `.sql`. Leave pending migrations out.
|
|
404
|
+
|
|
405
|
+
```sql [adopt-nosam.sql]
|
|
406
|
+
BEGIN;
|
|
407
|
+
CREATE TABLE IF NOT EXISTS _void_migrations (
|
|
408
|
+
name TEXT PRIMARY KEY,
|
|
409
|
+
applied_at TEXT NOT NULL
|
|
410
|
+
);
|
|
411
|
+
INSERT INTO _void_migrations (name, applied_at)
|
|
412
|
+
VALUES
|
|
413
|
+
('0000_create_users.sql', CURRENT_TIMESTAMP::text),
|
|
414
|
+
('0001_add_email.sql', CURRENT_TIMESTAMP::text)
|
|
415
|
+
ON CONFLICT (name) DO NOTHING;
|
|
416
|
+
COMMIT;
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
5. Run the file with your PostgreSQL client, stopping on errors. Use the database and search path bwf will use. This records the filenames without running their SQL or changing Drizzle's history.
|
|
420
|
+
6. Connect bwf to the database and run `bwf db status`. Only new migrations should be pending. For direct Cloudflare deployments, set `DATABASE_URL` in the shell or CI environment that runs `bwf deploy`.
|
|
421
|
+
|
|
422
|
+
Repeat these steps for each database; development and production may have different migration histories. Keep Drizzle's history table, and use bwf for future migrations.
|
|
423
|
+
|
|
424
|
+
## Hand-written migrations {#hand-written-migrations}
|
|
425
|
+
|
|
426
|
+
Deploy compares your Drizzle schema with the snapshots in `db/migrations/meta/`. If you have SQL migrations without this metadata, running `bwf db generate` would create another migration for the same tables.
|
|
427
|
+
|
|
428
|
+
To keep an existing migration history:
|
|
429
|
+
|
|
430
|
+
1. Make your Drizzle schema match the tables your SQL migrations create.
|
|
431
|
+
2. In a scratch copy of the project, remove `db/migrations/` and run `bwf db generate`.
|
|
432
|
+
3. Copy the generated `meta/` folder into your original migration directory. In `_journal.json`, replace `entries` with an entry for each existing SQL file in order. Use consecutive `idx` values starting at `0`, the file name without `.sql` as `tag`, increasing timestamps as `when`, and the generated entry's `version`. Set `breakpoints` to whether the file uses `--> statement-breakpoint` lines.
|
|
433
|
+
4. Rename the generated snapshot to `<prefix>_snapshot.json`, where `<prefix>` is the part of the last migration tag before its first `_`. For `001_create_users.sql`, use `001_snapshot.json`.
|
|
434
|
+
|
|
435
|
+
Review and commit the metadata, then run `bwf deploy` again. If no database has applied the SQL yet, you can instead replace it with migrations from `bwf db generate`.
|
|
436
|
+
|
|
437
|
+
For D1 migrations containing triggers, and MySQL migrations containing triggers, procedures, functions or events, add a `--> statement-breakpoint` line after each complete SQL statement, including the trigger's closing `END;`. Keep the trigger body together.
|
|
438
|
+
|
|
439
|
+
## Scaffolding
|
|
440
|
+
|
|
441
|
+
The `bwf gen model` command generates dialect-appropriate `sqliteTable`, `pgTable`, or `mysqlTable` definitions.
|
|
442
|
+
|
|
443
|
+
```bash
|
|
444
|
+
bwf gen model posts title:string body:text published:boolean
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
This creates:
|
|
448
|
+
|
|
449
|
+
1. `db/schema/posts.ts`: a Drizzle table definition with `id`, `createdAt`, `updatedAt`, and your columns
|
|
450
|
+
2. Updates `db/schema.ts` with `export * from "./schema/posts"`
|
|
451
|
+
3. `routes/api/posts/index.ts`: `GET` for list and `POST` for insert with validation
|
|
452
|
+
4. `routes/api/posts/[id].ts`: `GET` by id with `404` handling
|
|
453
|
+
|
|
454
|
+
See the [CLI reference](../reference/cli/generate.md#code-generation) for the full list of generators.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Deploy with void deploy. It builds your app, provisions resources, applies migrations, and publishes to Cloudflare or a team platform.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Deployment
|
|
7
|
+
|
|
8
|
+
`bwf deploy` builds your app, provisions resources, applies migrations, and deploys it. Choose your own Cloudflare account or a bwf platform run by your team.
|
|
9
|
+
|
|
10
|
+
After a successful deployment, bwf prints your deployment URL in a summary box with the details reported by your deployment target.
|
|
11
|
+
|
|
12
|
+
## Deploy to Cloudflare
|
|
13
|
+
|
|
14
|
+
Choose Cloudflare during `bwf init`, or connect later:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
bwf connect --platform cloudflare
|
|
18
|
+
bwf deploy --platform cloudflare
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
bwf opens your browser to sign in and asks which account to use. Later deploys use the saved target, so you can run `bwf deploy`.
|
|
22
|
+
|
|
23
|
+
Native apps work on Workers Free within its quotas. [Sandboxes](./sandboxes.md#requirements) require Workers Paid and Containers access. See the [Cloudflare guide](../integrations/cloudflare.md) for configuration, token permissions, and features with additional requirements.
|
|
24
|
+
|
|
25
|
+
If you already have a Worker and a root `wrangler.jsonc` or `wrangler.json`, `bwf deploy` can link it and preserve its resources. See [Deploy an existing Worker](../integrations/cloudflare.md#deploy-an-existing-worker).
|
|
26
|
+
|
|
27
|
+
## Prepare your app
|
|
28
|
+
|
|
29
|
+
### Migrations
|
|
30
|
+
|
|
31
|
+
Deploy applies pending SQL migrations from `db/migrations/`. If your schema has changes without a migration, deploy stops:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
bwf db generate
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Review and commit the SQL, then deploy again. Rollback does not reverse database migrations. See [Database](./database.md) for the local workflow.
|
|
38
|
+
|
|
39
|
+
If you run migrations in a separate release step, or a preview shares your database, deploy without applying SQL migrations:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
bwf deploy --skip-migrations
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The app must work with the database's current schema. Both deployment destinations support this option, and the next deploy without it applies pending migrations. See [`--skip-migrations`](../reference/cli/deploy.md#nosam-deploy) for requirements and [`bwf db migrate`](../reference/cli/database.md#nosam-db-migrate) to apply migrations separately.
|
|
46
|
+
|
|
47
|
+
For D1 on your own Cloudflare account, deploy saves a restore point before applying migrations and prints a [`bwf db restore`](../reference/cli/database.md#nosam-db-restore) command. Use it to recover from a bad migration, then fix the migration before deploying again. A restore discards writes made after that point; check that your deployed code works with the restored schema. See the command reference for the recovery steps and retention limits.
|
|
48
|
+
|
|
49
|
+
### Environment variables
|
|
50
|
+
|
|
51
|
+
Declare values in `env.ts` and set production server secrets with `bwf secret put`. Deploy never uploads your local `.env`. Supply public `VITE_*` values through the build environment. See [Environment Variables](./env-vars.md).
|
|
52
|
+
|
|
53
|
+
Keep the CLI and framework adapters on matching versions, and commit `bwf.config.ts` and `bwf.lock.json` when generated.
|
|
54
|
+
|
|
55
|
+
## Deploy from GitHub {#github}
|
|
56
|
+
|
|
57
|
+
Generate a workflow for your saved target and package manager:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
bwf init --github
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
For Cloudflare, add `CLOUDFLARE_API_TOKEN` to your repository secrets. The token needs access to the account and products your app uses. PostgreSQL and MySQL apps also need `DATABASE_URL`.
|
|
64
|
+
|
|
65
|
+
Follow the [Cloudflare CI setup](../integrations/cloudflare.md#deploying-from-ci) for Worker preview URLs and Cloudflare Access credentials.
|
|
66
|
+
|
|
67
|
+
### Team platform CI
|
|
68
|
+
|
|
69
|
+
For a core self-hosted platform, use your own workflow with a [project deploy token](./platform/installation/first-deployment.md). Set `BWF_TOKEN`, `BWF_API_URL`, and the project slug, then connect in each fresh CI environment:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
bwf connect "$BWF_API_URL" --no-login
|
|
73
|
+
bwf deploy --platform void --project "$BWF_PROJECT"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Platforms with the optional GitHub Actions integration use short-lived OIDC credentials. Authorize the repository with `bwf github connect <project> --repo <owner/repo> --executor github_actions`, set the repository's `BWF_API_URL`, and keep `permissions: id-token: write` in the generated workflow.
|
|
77
|
+
|
|
78
|
+
If your platform supports managed GitHub builds, the GitHub App can deploy on push without a workflow file. See [GitHub commands](../reference/cli/github.md#github) to install the App and connect your repository.
|
|
79
|
+
|
|
80
|
+
If CI runs typechecking before deploy, run `bwf prepare` after installing dependencies to generate the `.bwf/` types.
|
|
81
|
+
|
|
82
|
+
## Deploy to a team platform
|
|
83
|
+
|
|
84
|
+
Use the API URL from your administrator. In a new or unlinked app:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
bwf connect platform.example.com
|
|
88
|
+
bwf deploy --platform void --project my-app
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Sign in and confirm project creation when asked. To use an existing project, run `bwf project link`. Later deploys use the saved destination.
|
|
92
|
+
|
|
93
|
+
Project owners can [share access](./project-collaboration.md). To install a platform for your team, start with [Install a bwf Platform](./self-hosted-platform.md), which also compares the deployment features of both targets.
|
|
94
|
+
|
|
95
|
+
### Deploy to another bwf platform
|
|
96
|
+
|
|
97
|
+
For a single deployment to a different platform, connect and name its project:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
bwf connect second.example.com
|
|
101
|
+
BWF_API_URL=https://second.example.com bwf deploy --platform void --project my-app
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This keeps your saved destination. Each platform has its own projects, secrets, and data. See the [CLI reference](../reference/cli/deploy.md) for target selection and other flags.
|
|
105
|
+
|
|
106
|
+
## Logs and rollback
|
|
107
|
+
|
|
108
|
+
Inspect your deployment, read runtime logs, or select a previous deployment:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
bwf project status
|
|
112
|
+
bwf project logs
|
|
113
|
+
bwf project rollback
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Cloudflare logs use a live tail; team platforms retain log history. Before rolling back, check that the earlier code works with your current database schema. See [Project commands](../reference/cli/project.md).
|
|
117
|
+
|
|
118
|
+
## Usage and execution limit pages
|
|
119
|
+
|
|
120
|
+
Team platforms return a structured HTTP 429 to API and Pages action requests when an app exceeds its request or CPU allowance. Browser requests get an error page.
|
|
121
|
+
|
|
122
|
+
To customize it, add `public/usage-limit.html` for request limits or `public/execution-limit.html` for execution limits. Use standalone HTML with inline CSS and data-URL images. Scripts, external assets, and form submissions are disabled. Missing custom pages use the built-in page.
|
|
123
|
+
|
|
124
|
+
Responses are not cached. A streaming response that has already started cannot be replaced with an error page; handle stream failures in your UI.
|