@builtbyfriends/bwf 0.0.0-stage → 1.9.1
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-Cj0I2_bJ.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-D-DddkCQ.mjs +26 -0
- package/dist/auth-migrations-DDeifS3v.mjs +206 -0
- package/dist/auth-router-tWzIwf8f.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-HeXRQml6.mjs +1846 -0
- package/dist/client-D3D5RM5h.mjs +940 -0
- package/dist/client-VF2Nzc7Z.mjs +1 -0
- package/dist/cloudflare-auth-jb-1e43r.mjs +152 -0
- package/dist/cloudflare-cmd-B62t8Fm-.mjs +59 -0
- package/dist/cloudflare-config-i8yanry0.mjs +186 -0
- package/dist/cloudflare-connect-x7IsYghw.mjs +55 -0
- package/dist/cloudflare-operations-BeK7bhnP.mjs +627 -0
- package/dist/cloudflare-operations-C3Uu0Emj.mjs +1 -0
- package/dist/cloudflare-process-Cc6oiJqk.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-hLPNppu3.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-BH_md90k.mjs +1735 -0
- package/dist/delete-BSKI7V23.mjs +65 -0
- package/dist/deploy-C8KHBNsh.mjs +6512 -0
- package/dist/deploy-DCZBr7Ey.mjs +2 -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-C4ZhEiFG.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-B3TWga7x.mjs +742 -0
- package/dist/email-C_ATvNIG.mjs +2865 -0
- package/dist/email-cloudflare-DuAc9zny.mjs +854 -0
- package/dist/email-protocol-CZ0bAkI8.mjs +81 -0
- package/dist/env-CTAo8ifZ.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-BufZConV.mjs +488 -0
- package/dist/env-validation-DPqDo4DU.mjs +1 -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-CJ7DiiRF.mjs +161 -0
- package/dist/handler-CVsIfRv7.d.mts +279 -0
- package/dist/help-Bpv6Qeqn.mjs +1946 -0
- package/dist/help-CfZ4Bsw5.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-DRUR0j8C.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-B84t4BhW.mjs +130 -0
- package/dist/live-Dui0-aj_.d.mts +105 -0
- package/dist/live-saC8barp.mjs +410 -0
- package/dist/load-user-env-g0ahkZcj.mjs +34 -0
- package/dist/local-d1-C3EeOV7-.mjs +103 -0
- package/dist/log-JDnPc0cF.mjs +23 -0
- package/dist/login-Bl5lH8nH.mjs +87 -0
- package/dist/login-DoI7AsbY.mjs +1 -0
- package/dist/logs-CaT2N2f7.mjs +129 -0
- package/dist/migrate-CbGscX-V.mjs +125 -0
- package/dist/migrate-Ce3JKLVs.mjs +1 -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-BFg32YyY.mjs +722 -0
- package/dist/operator-auth-DdYZYEkO.mjs +47 -0
- package/dist/operator-client-DBujdELO.mjs +82 -0
- package/dist/operator-cmd-C73WWJBl.mjs +443 -0
- package/dist/operator-cmd-CdZytuAF.mjs +1 -0
- package/dist/output-Bb34lF0w.mjs +173 -0
- package/dist/output-CVolXKC1.mjs +1 -0
- package/dist/package-DO4d3Qz5.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-NI_vfWvD.mjs +538 -0
- package/dist/platform-args-ZC1-A1N9.mjs +1 -0
- package/dist/platform-auth-config-d-lY5-aY.mjs +371 -0
- package/dist/platform-auth-protection-Dhw7lUCk.mjs +231 -0
- package/dist/platform-auth-recovery-DaCc0tlx.mjs +309 -0
- package/dist/platform-cmd-5Ry-C9im.mjs +193 -0
- package/dist/platform-cmd-5oZq91lI.mjs +1 -0
- package/dist/platform-discovery-Bxg9aZXU.mjs +40 -0
- package/dist/platform-domain-DLVdGvGG.mjs +256 -0
- package/dist/platform-lifecycle-CUgjipXO.mjs +1 -0
- package/dist/platform-lifecycle-fRt5VMls.mjs +8928 -0
- package/dist/platform-management-5hEsRfR2.mjs +1 -0
- package/dist/platform-management-Djh1hzLP.mjs +1607 -0
- package/dist/platform-plans-config-CkbUKFpm.mjs +447 -0
- package/dist/platform-recovery-Cghx7FCR.mjs +96 -0
- package/dist/platform-registry-x1m9HBxf.mjs +450 -0
- package/dist/platform-runtime-logs-kkoiYFpF.mjs +72 -0
- package/dist/platform-setup-SfwCwnZg.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-DTF19-fC.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-DGlFJ3T9.mjs +1 -0
- package/dist/provision-mYVLuQiy.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-BvCHol52.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-7aA5hGoM.mjs +145 -0
- package/dist/runner-mysql-DrMKw203.mjs +1 -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-DCF9RXTc.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-DsSoNsKJ.mjs +23 -0
- package/dist/wrangler-DU784Dkf.mjs +1452 -0
- package/dist/wrangler-Rr9_76DQ.mjs +1 -0
- package/dist/ws-Q_osq9VK.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,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Define typed server functions in procedures/ and call them from your React app with rpc.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Procedures
|
|
7
|
+
|
|
8
|
+
Procedures are the typed server functions of your app. Define each one in `procedures/`, then call it from React with `rpc`. Every procedure is served at `POST /rpc/<name>`.
|
|
9
|
+
|
|
10
|
+
## Defining procedures
|
|
11
|
+
|
|
12
|
+
A procedure's name comes from its file and export. `procedures/contacts.ts` exporting `get` is `contacts.get`, `procedures/billing/invoices.ts` exporting `list` is `billing.invoices.list`, and a default export or an `index.ts` takes the file's or folder's name. Files and folders starting with `_` are ignored.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
// procedures/contacts.ts
|
|
16
|
+
import { procedure, signedIn } from '@builtbyfriends/bwf/procedure';
|
|
17
|
+
|
|
18
|
+
export const get = procedure()
|
|
19
|
+
.auth(signedIn)
|
|
20
|
+
.input(schema)
|
|
21
|
+
.output(schema)
|
|
22
|
+
// ...
|
|
23
|
+
.handler(({ input, env }) => findContact(env, input.id));
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Each procedure must make every decision (authentication, input, output, authorization, errors, analytics, MCP, CLI and AI tool exposure), either by choosing one or by opting out with a reason. An unfinished procedure stops the Worker from starting, so `bwf deploy` fails instead of shipping it. `bwf gen procedure contacts.get` writes a starting point.
|
|
27
|
+
|
|
28
|
+
`signedIn` accepts the Better Auth session. Use `apiTokens` with `anyOf` to also accept bearer tokens from the CLI and agents.
|
|
29
|
+
|
|
30
|
+
## Calling procedures
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { rpc } from '@builtbyfriends/bwf/rpc';
|
|
34
|
+
import { useCall } from '@builtbyfriends/bwf/rpc/react';
|
|
35
|
+
|
|
36
|
+
function Contact({ id }: { id: string }) {
|
|
37
|
+
const { data, error, loading, refetch } = useCall(rpc.contacts.get, { id });
|
|
38
|
+
// ...
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
await rpc.contacts.update({ id, name });
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Inputs, outputs and the error codes of a failed call are typed from the procedure. A failed call throws an `RpcError` with a `code` such as `UNAUTHENTICATED` or `INVALID_INPUT`. `useCall` tracks loading state, errors and refetch, and nothing else: wrap `rpc` in a cache if you need one.
|
|
45
|
+
|
|
46
|
+
Types come from `.bwf/procedures.d.ts`, which `bwf dev`, `bwf build` and `bwf prepare` keep current. It imports only types, so no server code reaches the browser.
|
|
47
|
+
|
|
48
|
+
To call procedures from another origin or a script, create a client with `createRpc({ baseUrl, token })` from `@builtbyfriends/bwf/rpc`.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Invite readers, collaborators, and project administrators to a hosted project. Direct Cloudflare deploys stay single-user.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Project Collaboration
|
|
7
|
+
|
|
8
|
+
A project hosted on a bwf platform can have one owner and additional readers, collaborators, and project administrators. Team access is a platform feature; it is not available for projects deployed directly to Cloudflare.
|
|
9
|
+
|
|
10
|
+
## Roles
|
|
11
|
+
|
|
12
|
+
| Role | Access |
|
|
13
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
14
|
+
| Reader | View the project, usage, resources, deployments, builds, logs, and member roster. Cannot deploy. |
|
|
15
|
+
| Collaborator | Reader access plus deploy, rollback, cancellation, migrations, secrets, database configuration, and deploy prerequisites. |
|
|
16
|
+
| Project administrator | Collaborator access plus domains, email destinations, GitHub configuration, invitations, roles, and member removal. |
|
|
17
|
+
| Owner | Project administrator access plus project deletion. |
|
|
18
|
+
|
|
19
|
+
Only the owner can create, list, renew, or revoke the project's CI deploy
|
|
20
|
+
credentials. Those credentials run unattended deployments as the billing owner
|
|
21
|
+
and remain independent of a member's login session, so collaborators and
|
|
22
|
+
project administrators deploy with their own account instead of minting a
|
|
23
|
+
durable owner credential.
|
|
24
|
+
|
|
25
|
+
The owner's plan, limits, and suspension state govern the project. A member's
|
|
26
|
+
own plan does not change the project's available usage, and acting through a
|
|
27
|
+
collaborator does not bypass an owner suspension. A project administrator is
|
|
28
|
+
not an installation administrator and receives no platform-wide access.
|
|
29
|
+
|
|
30
|
+
## Invite a Registered User
|
|
31
|
+
|
|
32
|
+
An owner or project administrator can invite someone by the email address registered to their existing account on the same platform:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
bwf project team invite teammate@example.com --role collaborator
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Pass `--project <slug>` to manage a project other than the linked project. An unknown email is rejected. A project invitation neither creates an account nor adds the address to a restricted-signup allowlist.
|
|
39
|
+
|
|
40
|
+
Invitations expire after seven days. If the platform cannot send invitation
|
|
41
|
+
email, the CLI prints the invitation ID and connection and acceptance commands
|
|
42
|
+
to share with the invited user. The invitation also appears when that user runs
|
|
43
|
+
`bwf project team pending` on the same platform.
|
|
44
|
+
|
|
45
|
+
List the roster and sent invitations with:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
bwf project team list
|
|
49
|
+
bwf project team invitations
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Respond to an Invitation
|
|
53
|
+
|
|
54
|
+
Connect to the platform from your invitation, then see invitations addressed to
|
|
55
|
+
your account and respond using the invitation ID:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
bwf connect api.example.com
|
|
59
|
+
bwf project team pending
|
|
60
|
+
bwf project team accept <invitation-id>
|
|
61
|
+
# or
|
|
62
|
+
bwf project team decline <invitation-id>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
An invitation is bound to the registered account. Forwarding its ID does not let another user accept it.
|
|
66
|
+
|
|
67
|
+
These three commands use the active platform connection selected by
|
|
68
|
+
`bwf connect`, even inside a directory linked to another project or deployed
|
|
69
|
+
directly to Cloudflare. `BWF_API_URL` takes precedence when set. If you use
|
|
70
|
+
`BWF_TOKEN`, also set `BWF_API_URL` to the matching platform. Each command
|
|
71
|
+
shows the platform it contacts.
|
|
72
|
+
|
|
73
|
+
Accepting an invitation grants access without linking your current directory.
|
|
74
|
+
Open the invited application's directory and run `bwf project link` if it is
|
|
75
|
+
not linked yet. If it is already linked to another project, use a separate
|
|
76
|
+
checkout without `.bwf/project.json`, connect to the invited platform there,
|
|
77
|
+
and run `bwf project link`.
|
|
78
|
+
|
|
79
|
+
If the invitation is missing, check the platform and signed-in account. To
|
|
80
|
+
switch accounts, set `BWF_API_URL` to the invitation's platform URL, unset
|
|
81
|
+
`BWF_TOKEN` if present, then run `bwf account logout` and `bwf account login` using
|
|
82
|
+
the invited email address. For an expired or revoked invitation, ask a project
|
|
83
|
+
administrator to invite you again.
|
|
84
|
+
|
|
85
|
+
## Change or Remove Access
|
|
86
|
+
|
|
87
|
+
Owners and project administrators can change any non-owner member or revoke a pending invitation:
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
bwf project team role <user-id> reader
|
|
91
|
+
bwf project team remove <user-id>
|
|
92
|
+
bwf project team revoke <invitation-id>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
A non-owner member can leave with `bwf project team leave`. The owner cannot leave; an installation administrator must [transfer ownership](./platform/administration/projects.md#transferring-project-ownership) first.
|
|
96
|
+
|
|
97
|
+
When a collaborator or admin is removed, leaves, or is changed to reader, the platform replaces the credentials the project's Workers use to call platform services such as AI, email, and remote bindings. The old credentials stop working once every Worker of the project has the new ones, usually within about 10 minutes, later while a deploy is running. If the replacement cannot finish, the old credentials keep working until it does, and owners and admins see a warning in `bwf project status` and `bwf project team list`. WebSocket connections reconnect once. While a Worker is switched to the new credentials, its calls to platform services can fail for a moment, a scheduled run can be skipped, and queue messages are delivered again a couple of minutes later.
|
|
98
|
+
|
|
99
|
+
Code the removed person deployed keeps running until you replace it. If you no longer trust it, deploy code you trust; the platform replaces the credentials again after that deploy. Earlier deployments of theirs kept for rollback keep the old credentials, so after a rollback to one of them, AI and email fail until you deploy again.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Process work asynchronously with a consumer in queues/, then send it typed messages from your app.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Queues
|
|
7
|
+
|
|
8
|
+
Use queues to process work asynchronously, such as sending emails or handling uploads. Define a consumer in `queues/`, then send it typed messages from your app.
|
|
9
|
+
|
|
10
|
+
## Defining queues
|
|
11
|
+
|
|
12
|
+
Create a consumer in `queues/`. TypeScript and JavaScript files are supported (`.ts`, `.mts`, `.js`, `.mjs`). Its path determines the queue name: `queues/emails.ts` creates `emails`, and `queues/order/notifications.ts` creates `order-notifications`. Each queue must have a unique name.
|
|
13
|
+
|
|
14
|
+
The resulting name must follow Cloudflare's queue naming rules: 1–63 characters, only letters, digits, and `-`, beginning and ending with a letter or digit. On `bwf deploy --platform cloudflare`, the Cloudflare queue also carries the Worker name, so the limit applies to that full name; see [Cloudflare queue names](#cloudflare-queue-names).
|
|
15
|
+
|
|
16
|
+
Export a default handler wrapped with [`defineQueue<T>`](../reference/api/handlers.md#definequeue-t-handler). `T` defines the message body for both the consumer and calls to `send()`:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
// queues/emails.ts
|
|
20
|
+
import { defineQueue } from '@builtbyfriends/bwf';
|
|
21
|
+
|
|
22
|
+
interface Message {
|
|
23
|
+
to: string;
|
|
24
|
+
subject: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default defineQueue<Message>(async (batch, env) => {
|
|
28
|
+
for (const msg of batch.messages) {
|
|
29
|
+
console.log(`Send to ${msg.body.to}: ${msg.body.subject}`);
|
|
30
|
+
msg.ack(); // Acknowledge successful processing
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Files or directories starting with `_` are ignored.
|
|
36
|
+
|
|
37
|
+
## Sending messages
|
|
38
|
+
|
|
39
|
+
Import the typed `queues` proxy from `@builtbyfriends/bwf/queues` to send messages. Each queue is available as a property matching its name, with full type safety from the consumer's `defineQueue<T>` generic.
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
// routes/api/orders.ts
|
|
43
|
+
import { defineHandler } from '@builtbyfriends/bwf';
|
|
44
|
+
import { queues } from '@builtbyfriends/bwf/queues';
|
|
45
|
+
|
|
46
|
+
export const POST = defineHandler(async (c) => {
|
|
47
|
+
const order = await c.req.json();
|
|
48
|
+
// Fully typed: body must match the
|
|
49
|
+
// Message interface from queues/emails.ts
|
|
50
|
+
await queues.emails.send({
|
|
51
|
+
to: order.email,
|
|
52
|
+
subject: 'Order confirmed',
|
|
53
|
+
});
|
|
54
|
+
return c.json({ ok: true });
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Per-message acknowledgment
|
|
59
|
+
|
|
60
|
+
Each message in the batch has `ack()` and `retry()` methods matching the [Cloudflare Queues API](https://developers.cloudflare.com/queues/configuration/consumer-concurrency/):
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
export default defineQueue<Message>(async (batch, env) => {
|
|
64
|
+
for (const msg of batch.messages) {
|
|
65
|
+
try {
|
|
66
|
+
await processMessage(msg.body);
|
|
67
|
+
msg.ack(); // Remove from queue
|
|
68
|
+
} catch {
|
|
69
|
+
msg.retry({ delaySeconds: 30 }); // Re-deliver after 30s
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
- `msg.ack()`: acknowledge the message and remove it from the queue
|
|
76
|
+
- `msg.retry(options?)`: retry the message, optionally with a `{ delaySeconds }` delay
|
|
77
|
+
- `batch.ackAll()`: acknowledge all messages in the batch
|
|
78
|
+
- `batch.retryAll(options?)`: retry all messages in the batch
|
|
79
|
+
|
|
80
|
+
The first `ack()` or `retry()` call wins for each message. Messages without an explicit decision are acknowledged when the handler succeeds and retried when it throws. bwf logs handler errors automatically.
|
|
81
|
+
|
|
82
|
+
The `timestamp` field on each message is a `Date` object.
|
|
83
|
+
|
|
84
|
+
## Consumer options
|
|
85
|
+
|
|
86
|
+
Export named constants to configure how Cloudflare delivers batches to your consumer:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
// queues/emails.ts
|
|
90
|
+
import { defineQueue } from '@builtbyfriends/bwf';
|
|
91
|
+
|
|
92
|
+
interface Message {
|
|
93
|
+
to: string;
|
|
94
|
+
subject: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const maxBatchSize = 50;
|
|
98
|
+
export const maxBatchTimeout = 10; // seconds
|
|
99
|
+
export const maxRetries = 5;
|
|
100
|
+
export const retryDelay = 30; // seconds
|
|
101
|
+
|
|
102
|
+
export default defineQueue<Message>(async (batch, env) => {
|
|
103
|
+
for (const msg of batch.messages) {
|
|
104
|
+
console.log(`Send to ${msg.body.to}: ${msg.body.subject}`);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- `maxBatchSize`: maximum number of messages per batch (default `10`)
|
|
110
|
+
- `maxBatchTimeout`: maximum seconds to wait before delivering an incomplete batch (default `5`)
|
|
111
|
+
- `maxRetries`: maximum number of retries before delivery is exhausted (default `3`)
|
|
112
|
+
- `retryDelay`: seconds to wait between retries (default `0`)
|
|
113
|
+
|
|
114
|
+
Export each option directly from the queue file as a whole number, such as `export const maxRetries = 5`. Computed values and re-exports aren't supported; repeat shared settings in each queue file.
|
|
115
|
+
|
|
116
|
+
Nosam-managed queues do not configure a dead-letter queue. Cloudflare permanently
|
|
117
|
+
deletes messages that exhaust their retries without one; see
|
|
118
|
+
[Cloudflare's dead-letter queue guide](https://developers.cloudflare.com/queues/configuration/dead-letter-queues/).
|
|
119
|
+
|
|
120
|
+
bwf provisions queues and connects their producers and consumers when you deploy.
|
|
121
|
+
|
|
122
|
+
### Cloudflare queue names
|
|
123
|
+
|
|
124
|
+
With `bwf deploy --platform cloudflare`, queue names include the Worker name: `queues/jobs.ts` in `app-staging` creates `app-staging-jobs`. Underscores in the Worker name become hyphens. Your app uses `queues.jobs.send()` in every environment.
|
|
125
|
+
|
|
126
|
+
Keep the full name within 63 characters and unique within the account. Each Cloudflare queue supports one consumer; bwf reports naming or consumer conflicts during deploy.
|
|
127
|
+
|
|
128
|
+
Existing deployments keep their queues and messages. To adopt the new naming, pause producers, drain the old queue, remove its Worker consumer in Cloudflare, and redeploy. Check that the old queue is empty before deleting it.
|
|
129
|
+
|
|
130
|
+
## Local development
|
|
131
|
+
|
|
132
|
+
In native bwf apps, sending a message through a queue binding automatically invokes the consumer in Miniflare. Local delivery uses the same handler as production.
|
|
133
|
+
|
|
134
|
+
You can also manually dispatch a batch by POSTing to the dev endpoint bwf exposes:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
POST /__nosam/queue
|
|
138
|
+
Content-Type: application/json
|
|
139
|
+
{ "queue": "<queue-name>", "messages": [{ "id": "1", "timestamp": <unix_ms>, "body": <any>, "attempts": 1 }] }
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The endpoint requires a local dev trigger token. bwf prints a paste-ready curl command with the current token when the dev server starts.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
curl -X POST http://localhost:5173/__nosam/queue \
|
|
146
|
+
-H "Content-Type: application/json" \
|
|
147
|
+
-H "x-nosam-dev-trigger: <printed-token>" \
|
|
148
|
+
-d '{"queue":"my-queue","messages":[{"id":"1","timestamp":'"$(date +%s000)"',"body":{"hello":"world"},"attempts":1}]}'
|
|
149
|
+
```
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Create a bwf app, run it locally, and deploy it. You can also add bwf to an existing Vite app.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Quickstart
|
|
7
|
+
|
|
8
|
+
Create a bwf app, run it locally, and deploy it. You can also [add bwf to an existing Vite app](#adding-to-an-existing-vite-app).
|
|
9
|
+
|
|
10
|
+
## Create an app
|
|
11
|
+
|
|
12
|
+
In an empty directory, install bwf and run setup:
|
|
13
|
+
|
|
14
|
+
::: code-group
|
|
15
|
+
|
|
16
|
+
```sh [npm]
|
|
17
|
+
npm install -D @builtbyfriends/bwf
|
|
18
|
+
npx bwf init
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```sh [pnpm]
|
|
22
|
+
pnpm add -D @builtbyfriends/bwf
|
|
23
|
+
pnpm bwf init
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```sh [yarn]
|
|
27
|
+
yarn add -D @builtbyfriends/bwf
|
|
28
|
+
yarn bwf init
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```sh [bun]
|
|
32
|
+
# bunx runs bwf with the `node` on your PATH: use Node.js 24.22+ or 26.12+
|
|
33
|
+
bun add -D @builtbyfriends/bwf
|
|
34
|
+
bunx bwf init
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```sh [vp]
|
|
38
|
+
vp add -D @builtbyfriends/bwf
|
|
39
|
+
vpx bwf init
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
:::
|
|
43
|
+
|
|
44
|
+
Choose your UI framework, a starter, and a deployment target. Vite+ is the default build tool. D1 is a good first database: it runs locally without a separate database server. Choose Cloudflare to deploy to your own account, or skip deployment setup for now.
|
|
45
|
+
|
|
46
|
+
You do not need to install Vite+ globally. Setup preserves your existing package-manager versions and lockfiles.
|
|
47
|
+
|
|
48
|
+
With pnpm, `pnpm create bwf my-app` also creates the project directory and configures native build permissions for you.
|
|
49
|
+
|
|
50
|
+
## Run locally
|
|
51
|
+
|
|
52
|
+
::: code-group
|
|
53
|
+
|
|
54
|
+
```sh [npm]
|
|
55
|
+
npm run dev
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```sh [pnpm]
|
|
59
|
+
pnpm run dev
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```sh [yarn]
|
|
63
|
+
yarn run dev
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```sh [bun]
|
|
67
|
+
bun run dev
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```sh [vp]
|
|
71
|
+
vpr dev
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
:::
|
|
75
|
+
|
|
76
|
+
Open `http://localhost:5173`. `src/` contains your React app, and `routes/` contains the server routes it calls.
|
|
77
|
+
|
|
78
|
+
## Call a server route
|
|
79
|
+
|
|
80
|
+
Edit `routes/api/hello.ts`, or create it if your starter doesn't include it:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
import { defineHandler } from '@builtbyfriends/bwf';
|
|
84
|
+
|
|
85
|
+
export const GET = defineHandler(() => {
|
|
86
|
+
return { message: 'Hello from bwf' };
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Visit `http://localhost:5173/api/hello` to see the response. From your client code, call it with bwf's typed fetch:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
import { fetch } from '@builtbyfriends/bwf/client';
|
|
94
|
+
|
|
95
|
+
const { message } = await fetch('/api/hello');
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The file path defines the URL, and the handler defines the response type. Change `message` in the handler and TypeScript checks the client against the new shape.
|
|
99
|
+
|
|
100
|
+
Database starters also include `db/schema.ts`. Its Drizzle schema defines your tables and query types; bwf runs a local database and provisions one when you deploy.
|
|
101
|
+
|
|
102
|
+
## Deploy
|
|
103
|
+
|
|
104
|
+
If you chose a target during setup:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
npx bwf deploy
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
If you skipped setup, select your Cloudflare account:
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
npx bwf deploy --platform cloudflare
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
bwf opens your browser to sign in when needed, builds the app, provisions resources, applies migrations, and prints the deployed URL. Later deploys use the saved target. See [Deployment](./deployment.md) for team platforms, CI, and rollback.
|
|
117
|
+
|
|
118
|
+
## Adding to an existing Vite app
|
|
119
|
+
|
|
120
|
+
Install bwf and run `bwf init` with your package manager as shown [above](#create-an-app). Setup adds `bwfPlugin()` to your Vite config and creates the remaining project files. If the config needs a manual edit, the CLI shows the change to make.
|
|
121
|
+
|
|
122
|
+
## Next steps
|
|
123
|
+
|
|
124
|
+
- [Server Routing](./server-routing.md): params, middleware, and validation
|
|
125
|
+
- [Database](./database.md): queries and migrations
|
|
126
|
+
- [Environment Variables](./env-vars.md): local values and production secrets
|
|
127
|
+
- [Coding Agents](../integrations/agents.md): use bwf's bundled docs and skills
|
|
128
|
+
|
|
129
|
+
If a manual pnpm install reports blocked build scripts, run `pnpm approve-builds` for `esbuild`, `sharp`, and `workerd`. Set `better-sqlite3: false` in `pnpm-workspace.yaml`'s `allowBuilds`; bwf uses its bundled binaries.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Run local code against a project already deployed to your bwf platform, including its database and storage.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Remote Development
|
|
7
|
+
|
|
8
|
+
bwf normally uses local D1, KV, and R2 through [Miniflare](https://miniflare.dev/). Remote mode lets you run local code against a project deployed to your bwf platform, for example to test with existing data or investigate an issue.
|
|
9
|
+
|
|
10
|
+
Calls such as `db.select()` and `env.KV.get()` use the deployed resources without changing your application code. Writes affect real data, so use a staging project when possible.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
Before enabling remote mode, you need:
|
|
15
|
+
|
|
16
|
+
1. Connect to your team's platform with `bwf connect <url>`. It signs you in when needed.
|
|
17
|
+
2. Link a project with `bwf project link`. Deploy it at least once so its resources exist.
|
|
18
|
+
|
|
19
|
+
## Enabling Remote Mode
|
|
20
|
+
|
|
21
|
+
### In `bwf.config.ts` (persistent)
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"remote": true
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Via environment variable (one-off)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
BWF_REMOTE=1 vite dev
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`BWF_REMOTE=0` disables remote mode even if `bwf.config.ts` has `"remote": true`.
|
|
36
|
+
|
|
37
|
+
## Supported Bindings
|
|
38
|
+
|
|
39
|
+
| Binding | Local (default) | Remote |
|
|
40
|
+
| ------- | -------------------------- | ------------------- |
|
|
41
|
+
| D1 | Local SQLite via Miniflare | Remote D1 database |
|
|
42
|
+
| KV | Local file-backed KV | Remote KV namespace |
|
|
43
|
+
| R2 | Local file-backed R2 | Remote R2 bucket |
|
|
44
|
+
| AI | Always proxied | Always proxied |
|
|
45
|
+
|
|
46
|
+
AI requests use your platform’s account and allowance in both local and remote mode. There is no local AI simulator.
|
|
47
|
+
|
|
48
|
+
## Checking Remote Mode
|
|
49
|
+
|
|
50
|
+
When the dev server starts with remote mode active, it prints:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
[void] Remote bindings active
|
|
54
|
+
DB → remote D1
|
|
55
|
+
KV → remote KV
|
|
56
|
+
STORAGE → remote R2
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Limitations
|
|
60
|
+
|
|
61
|
+
- **Network latency:** each binding call makes a network request, so responses may be slower than local development.
|
|
62
|
+
- **R2 multipart uploads:** `createMultipartUpload()` and `resumeMultipartUpload()` are not supported in remote mode.
|
|
63
|
+
- **R2 range and conditional reads:** in remote mode, `get()` ignores request headers passed as `range` or `onlyIf` and returns the whole object. For example, `get(key, { range: request.headers, onlyIf: request.headers })` returns the whole object when the request has a `Range` or `If-None-Match` header. `get()` throws when `range` or `onlyIf` is an object that asks for a byte range or a condition, such as `{ offset: 0, length: 100 }` or `{ etagMatches: etag }`.
|
|
64
|
+
- **R2 conditional writes:** `put(..., { onlyIf })` requires an updated platform and project deployment. Failed preconditions return `null`.
|
|
65
|
+
- **R2 metadata and list options:** custom metadata, HTTP metadata, and `list()` with `delimiter`, `startAfter`, or `include` require an updated project deployment. Without one, `list()` with these options and `put()` with metadata other than `contentType` throw an error.
|
|
66
|
+
- **D1 dump:** `db.dump()` is not supported in remote mode.
|
|
67
|
+
- **D1 batches:** `db.batch()` requires an updated platform and project deployment.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Run commands, work with files, and connect to servers inside an isolated Cloudflare Sandbox.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sandboxes
|
|
7
|
+
|
|
8
|
+
Use a Cloudflare Sandbox to run commands, work with files, and connect to servers from server code. Each Sandbox ID selects an isolated container.
|
|
9
|
+
|
|
10
|
+
## Requirements
|
|
11
|
+
|
|
12
|
+
Cloudflare deployments require [Workers Paid](https://dash.cloudflare.com/?to=/:account/workers/plans) and Containers access. Run Docker for local development and direct deployments that build an image. A team platform's runtime token needs Account / Containers: Edit and Account / Cloudchamber: Edit.
|
|
13
|
+
|
|
14
|
+
## Run a command
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { defineHandler } from '@builtbyfriends/bwf';
|
|
18
|
+
import { getSandbox } from '@builtbyfriends/bwf/sandbox';
|
|
19
|
+
|
|
20
|
+
export const POST = defineHandler(async (c) => {
|
|
21
|
+
const sandbox = await getSandbox('default');
|
|
22
|
+
const result = await sandbox.run(['node', '--version']);
|
|
23
|
+
return c.json({
|
|
24
|
+
exitCode: result.exitCode,
|
|
25
|
+
stdout: new TextDecoder().decode(result.stdout),
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Importing from `@builtbyfriends/bwf/sandbox` enables the required resources. Local development, direct Cloudflare deployments, and team platforms share the same runtime API.
|
|
31
|
+
|
|
32
|
+
## Runtime API
|
|
33
|
+
|
|
34
|
+
`getSandbox(id, options)` resolves a Sandbox without starting it. The first command, file operation, or port request starts the container. IDs contain 1–63 characters and are lowercased by default; pass `normalizeId: false` to preserve case.
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { getSandbox } from '@builtbyfriends/bwf/sandbox';
|
|
38
|
+
|
|
39
|
+
const sandbox = await getSandbox(`user-${user.id}`, {
|
|
40
|
+
inactivityTimeoutMs: 10 * 60 * 1000,
|
|
41
|
+
enableInternet: false,
|
|
42
|
+
});
|
|
43
|
+
const result = await sandbox.run(['node', '--version'], {
|
|
44
|
+
signal: AbortSignal.timeout(5_000),
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Commands take an executable and arguments as an array. For shell syntax, explicitly run `['sh', '-c', command]`. Execution options include `cwd` (default `/workspace`), `env`, `user`, `signal`, `pty`, `stdin`, `stdout`, and `stderr`.
|
|
49
|
+
|
|
50
|
+
Sandbox operations return promises. `run()` resolves with `stdout` and `stderr` as `ArrayBuffer`s and the command's exit code. Usage limits reject with [`UsageLimit`](#usage-limits); other failures reject normally.
|
|
51
|
+
|
|
52
|
+
`exec()` resolves with a process. Await `process.output()` to collect its output and exit code, or read the streams and await `process.exitCode`. Waiting for completion keeps a long command active during pauses in its output; unattended background commands can stop when the Sandbox becomes idle. A runtime limit can reject completion after a command has successfully started.
|
|
53
|
+
|
|
54
|
+
Use `stdin: 'pipe'` for a writable input stream. `kill(signal?)` stops a process, and `resize(cols, rows)` resizes its terminal.
|
|
55
|
+
|
|
56
|
+
File operations live under `sandbox.files`: `readFile`, `writeFile`, `stat`, `lstat`, `readDirectory`, `mkdir`, `rename`, and `remove`. Await `readFile()` to receive a streaming `Response`, then use `.text()`, `.arrayBuffer()`, or `.body`. `writeFile()` accepts text, binary data, or a byte stream. Relative file paths require an explicit `cwd` option.
|
|
57
|
+
|
|
58
|
+
To reach a server inside the container, await `sandbox.fetch(port, new Request(url))`. `sandbox.running()` checks whether the container is running; `sandbox.destroy()` stops it.
|
|
59
|
+
|
|
60
|
+
On native Cloudflare deployments, `sandbox.fetch()` also supports WebSocket upgrade requests. Return its response from your Worker handler to connect the client to the container. WebSocket upgrades are currently unavailable on managed bwf deployments.
|
|
61
|
+
|
|
62
|
+
`getSandbox()` options include `inactivityTimeoutMs` (default ten minutes, maximum six hours), `enableInternet` (default `false`), and string `labels`. Internet access and labels take effect on the next container start. `binding` selects a custom native binding; managed platforms use the configured binding.
|
|
63
|
+
|
|
64
|
+
For code that runs on both deployment targets, use `getSandbox()`. Direct access through `c.env.SANDBOX` is available only on local and native Cloudflare deployments.
|
|
65
|
+
|
|
66
|
+
## Usage limits
|
|
67
|
+
|
|
68
|
+
Sandbox limits reject with `SandboxLimitError`, which extends `UsageLimit` from `@builtbyfriends/bwf/limits`. The error includes `resource: 'sandbox'` and a `reason` of `concurrency` or `runtime_budget`. bwf route handlers and Pages actions automatically send a structured HTTP 429 when the error is left uncaught.
|
|
69
|
+
|
|
70
|
+
Use `instanceof UsageLimit` to optionally handle both AI and Sandbox limits, or `instanceof SandboxLimitError` for Sandbox-specific handling:
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import { defineHandler } from '@builtbyfriends/bwf';
|
|
74
|
+
import { UsageLimit } from '@builtbyfriends/bwf/limits';
|
|
75
|
+
import { getSandbox } from '@builtbyfriends/bwf/sandbox';
|
|
76
|
+
|
|
77
|
+
export const POST = defineHandler(async (c) => {
|
|
78
|
+
const sandbox = await getSandbox('default');
|
|
79
|
+
try {
|
|
80
|
+
const result = await sandbox.run(['node', 'task.mjs']);
|
|
81
|
+
return c.json({ exitCode: result.exitCode });
|
|
82
|
+
} catch (error) {
|
|
83
|
+
if (error instanceof UsageLimit) {
|
|
84
|
+
return error.response({
|
|
85
|
+
message: 'Execution is temporarily unavailable. Try again shortly.',
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Keep user input available so it can be retried. Checking `running()`, stopping a process, and `destroy()` remain available after a usage limit.
|
|
94
|
+
|
|
95
|
+
## State persistence
|
|
96
|
+
|
|
97
|
+
`getSandbox(id)` selects the same Durable Object for that ID within a deployment. Native Cloudflare deployments preserve that namespace across Worker versions. Each managed platform deployment has its own namespace; rolling back to a retained deployment reconnects to that deployment's namespace.
|
|
98
|
+
|
|
99
|
+
Files, running processes, and listening servers last only as long as the container. It can stop after inactivity, crash, or restart. Save anything you need to keep in your database, KV, or R2. Deleting a project on a bwf platform removes both its Durable Objects and containers.
|
|
100
|
+
|
|
101
|
+
## Configuration
|
|
102
|
+
|
|
103
|
+
The default environment provides Node.js 26 on Debian Trixie. Managed platform deploys use Cloudflare's managed Node.js image.
|
|
104
|
+
|
|
105
|
+
Use `bwf.config.ts` when you need a custom image or container size:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import { defineConfig } from '@builtbyfriends/bwf/config';
|
|
109
|
+
|
|
110
|
+
export default defineConfig({
|
|
111
|
+
sandbox: {
|
|
112
|
+
image: './Dockerfile.sandbox',
|
|
113
|
+
platformImage: 'registry.cloudflare.com/<account-id>/sandbox@sha256:<digest>',
|
|
114
|
+
instanceType: 'standard-1',
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
See the [configuration reference](../reference/config.md#sandbox) for binding names, image settings, and container sizes.
|
|
120
|
+
|
|
121
|
+
Custom images must include the helper matching bwf's installed Sandbox SDK version. The SDK image supplies this binary, but is not a runnable environment itself:
|
|
122
|
+
|
|
123
|
+
```dockerfile
|
|
124
|
+
FROM node:26.12.1-trixie-slim
|
|
125
|
+
COPY --from=docker.io/cloudflare/sandbox:1.0.2 /usr/local/bin/sandbox-shim /usr/local/bin/sandbox-shim
|
|
126
|
+
WORKDIR /workspace
|
|
127
|
+
CMD ["sleep", "infinity"]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
For a managed platform, push your custom image to that platform account's Cloudflare registry and set `platformImage` to its digest-pinned reference. If `image` is already a Cloudflare registry reference, it also becomes the default `platformImage`. External registries and mutable tags are not supported. See [Cloudflare's image management guide](https://developers.cloudflare.com/containers/guides/image-management/#push-images-to-the-cloudflare-registry).
|
|
131
|
+
|
|
132
|
+
## Deployment
|
|
133
|
+
|
|
134
|
+
`bwf deploy --platform cloudflare` builds native images and deploys the Sandbox alongside the application. `bwf deploy` on a connected bwf Platform applies the platform's Sandbox concurrency and runtime limits.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Install a shared deployment environment in your Cloudflare account so your team can deploy without account credentials.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Install a bwf Platform
|
|
7
|
+
|
|
8
|
+
A bwf platform lets your team deploy apps into a shared Cloudflare account. As an administrator, you install and maintain the platform. Developers connect the bwf CLI to its URL, sign in through an enabled login method, and deploy their apps.
|
|
9
|
+
|
|
10
|
+
For an individual app, [deploy directly to Cloudflare](/integrations/cloudflare#deploy-to-your-own-cloudflare-account).
|
|
11
|
+
|
|
12
|
+
The core platform supports GitHub, Google, generic OIDC, and Cloudflare Access login, CLI deploys, D1, KV, R2, Queues, cron jobs, Workers AI, WebSockets, SSE, routing, logs, and rollback.
|
|
13
|
+
|
|
14
|
+
The core installation also includes managed Sandboxes and an email gateway. Configure a shared mail domain and zone to enable email, and add `--custom-domains` for [project custom domains](/guide/platform/installation/domains#project-custom-domains). A user dashboard and managed GitHub builds require a [custom platform build](/guide/platform-development).
|
|
15
|
+
|
|
16
|
+
## Deployment features
|
|
17
|
+
|
|
18
|
+
Both targets use the same application APIs. A core platform adds shared access and retained deployment history:
|
|
19
|
+
|
|
20
|
+
| Feature | Direct Cloudflare | Core self-hosted platform |
|
|
21
|
+
| ----------------------------------------------- | -------------------------------- | --------------------------------------------- |
|
|
22
|
+
| Static sites, SPAs, and bwf apps | Supported | Supported |
|
|
23
|
+
| Routing rules, WebSockets, queues, and cron | Supported | Supported |
|
|
24
|
+
| D1, KV, R2, and external SQL through Hyperdrive | Supported | Supported |
|
|
25
|
+
| Workers AI and provider requests | Your account and gateway | Installation gateway and proxy |
|
|
26
|
+
| Runtime logs | Live Cloudflare tail | Retained platform logs |
|
|
27
|
+
| Application rollback | Worker versions | Retained platform deployments |
|
|
28
|
+
| Typed Durable State and native Durable Objects | Supported | Supported |
|
|
29
|
+
| Sandboxes | Requires Workers Paid and Docker | Requires Workers Paid on the platform account |
|
|
30
|
+
| Custom application domains | Supported | Enable with `--custom-domains` |
|
|
31
|
+
| Generated GitHub deployment workflow | Supported | Use your CI with a scoped developer token |
|
|
32
|
+
| User dashboard and managed GitHub builds | Not required | Not included in a standard installation |
|
|
33
|
+
|
|
34
|
+
A team platform requires Workers for Platforms and the [documented infrastructure](/guide/platform/installation/domains#cloudflare-footprint). Features depend on the installation's configuration.
|
|
35
|
+
|
|
36
|
+
## Installation Guides
|
|
37
|
+
|
|
38
|
+
- [Prerequisites](/guide/platform/installation/prerequisites)
|
|
39
|
+
- [Credentials](/guide/platform/installation/credentials)
|
|
40
|
+
- [Install and Configure Login](/guide/platform/installation/setup)
|
|
41
|
+
- [First Deployment](/guide/platform/installation/first-deployment)
|
|
42
|
+
- [Domains and Resources](/guide/platform/installation/domains)
|
|
43
|
+
- [Maintenance and Recovery](/guide/platform/installation/maintenance)
|
|
44
|
+
- [Install from CI](/guide/platform/installation/ci)
|
|
45
|
+
- [Disable and Uninstall](/guide/platform/installation/uninstall)
|