@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,306 @@
|
|
|
1
|
+
import { L as log, tt as isCancel } from "./dist-STQXl8ck.mjs";
|
|
2
|
+
import { u as openBrowser } from "./auth-xnkmpZUl.mjs";
|
|
3
|
+
import { f as import_picocolors, s as formatLink } from "./output-Bb34lF0w.mjs";
|
|
4
|
+
// src/cli/platform-plan-writes.ts
|
|
5
|
+
function planCreatesZone(plan) {
|
|
6
|
+
return plan.actions.some((action) => action.kind === "zone" && action.action === "create");
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Whether applying the plan writes a DNS record, which needs Zone → DNS → Edit.
|
|
10
|
+
* 'reuse' changes nothing and 'adopt' only records an existing record in the
|
|
11
|
+
* manifest; only 'create' calls the DNS API.
|
|
12
|
+
*/
|
|
13
|
+
function planWritesDns(plan) {
|
|
14
|
+
return plan.actions.some((action) => action.kind === "dns-record" && action.action !== "reuse" && action.action !== "adopt");
|
|
15
|
+
}
|
|
16
|
+
// src/cli/platform-setup.ts
|
|
17
|
+
/** Return a prompt answer, or stop the platform command when the prompt was cancelled. */
|
|
18
|
+
function platformPromptAnswer(value) {
|
|
19
|
+
if (isCancel(value) || typeof value === "symbol") throw new Error("platform: Cancelled.");
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
function platformSetupLink(page) {
|
|
23
|
+
return formatLink(import_picocolors.default.underline(page.title), page.url);
|
|
24
|
+
}
|
|
25
|
+
function platformSetupFieldHelp(key) {
|
|
26
|
+
const docs = (page, section, title) => platformSetupLink({
|
|
27
|
+
title,
|
|
28
|
+
url: `https://github.com/builtbyfriends/platform/blob/main/docs/guide/platform/installation/${page}.md#${section}`
|
|
29
|
+
});
|
|
30
|
+
switch (key) {
|
|
31
|
+
case "databaseUrl": return {
|
|
32
|
+
placeholder: "postgresql://user:pw@…/database",
|
|
33
|
+
description: "Provide a PostgreSQL database URL for platform users, projects, and deployments. Use an empty hosted database, e.g. " + platformSetupLink({
|
|
34
|
+
title: "Neon",
|
|
35
|
+
url: "https://neon.com/"
|
|
36
|
+
}) + ". " + docs("prerequisites", "platform-database", "Database setup")
|
|
37
|
+
};
|
|
38
|
+
case "jwtSecret": return { description: `Create a JWT signing key for platform login tokens. Run ${import_picocolors.default.blue("openssl rand -base64 32")}. Save the key in your password manager. ` + docs("credentials", "signing-and-encryption-keys", "Key setup") };
|
|
39
|
+
case "projectSecretKey": return { description: `Generate a project encryption key for app secrets. Run ${import_picocolors.default.blue("openssl rand -base64 32")} separately. Save this key for recovery. ` + docs("credentials", "signing-and-encryption-keys", "Key setup") };
|
|
40
|
+
default: return;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Dashboard keys use permission-catalog labels, which can differ from product names. */
|
|
44
|
+
function platformAccountTokenPermissions(includeAiGateway) {
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
key: "account_settings",
|
|
48
|
+
type: "read"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: "workers_scripts",
|
|
52
|
+
type: "edit"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: "workers_kv_storage",
|
|
56
|
+
type: "edit"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: "workers_r2",
|
|
60
|
+
type: "edit"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: "d1",
|
|
64
|
+
type: "edit"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: "queues",
|
|
68
|
+
type: "edit"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: "account_analytics",
|
|
72
|
+
type: "read"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: "workers_tail",
|
|
76
|
+
type: "read"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: "query_cache",
|
|
80
|
+
type: "edit"
|
|
81
|
+
},
|
|
82
|
+
...includeAiGateway ? [{
|
|
83
|
+
key: "aig",
|
|
84
|
+
type: "edit"
|
|
85
|
+
}] : []
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Account token links cannot preselect a zone: Cloudflare documents only
|
|
90
|
+
* `permissionGroupKeys` and `name`, and the form puts zone permissions in an
|
|
91
|
+
* "All Domains" policy. Tell the user which dashboard choice to change.
|
|
92
|
+
*/
|
|
93
|
+
function specifiedDomainsInstruction(zones) {
|
|
94
|
+
return `Change the zone policy from All Domains to Specified Domains → ${zones.join(" and ")}.`;
|
|
95
|
+
}
|
|
96
|
+
function plansZoneCreation(plan) {
|
|
97
|
+
return plan.actions.some((action) => action.kind === "zone" && action.action === "create");
|
|
98
|
+
}
|
|
99
|
+
function platformManagementSetupPage(plan, options) {
|
|
100
|
+
const createsZone = plansZoneCreation(plan);
|
|
101
|
+
const zoneName = plan.deployment.application.zoneName;
|
|
102
|
+
const apiHostname = plan.deployment.controlPlane.apiHostname;
|
|
103
|
+
const { access } = options;
|
|
104
|
+
const zones = [...zoneName ? [zoneName] : [], ...apiHostname && apiHostname !== zoneName && !apiHostname.endsWith(`.${zoneName}`) ? [`the zone for ${apiHostname}`] : []];
|
|
105
|
+
const accessLevel = access && access.readOnly ? "read" : "edit";
|
|
106
|
+
const appAccess = !!plan.deployment.appAccess;
|
|
107
|
+
const appAccessLevel = appAccess ? "edit" : accessLevel;
|
|
108
|
+
const permissions = [
|
|
109
|
+
...platformAccountTokenPermissions(true),
|
|
110
|
+
...zoneName || apiHostname || createsZone ? [
|
|
111
|
+
{
|
|
112
|
+
key: "zone",
|
|
113
|
+
type: createsZone ? "edit" : "read"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
key: "dns",
|
|
117
|
+
type: "edit"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
key: "workers_routes",
|
|
121
|
+
type: "edit"
|
|
122
|
+
}
|
|
123
|
+
] : [],
|
|
124
|
+
...access || appAccess ? [
|
|
125
|
+
{
|
|
126
|
+
key: "access",
|
|
127
|
+
type: appAccessLevel
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
key: "access_acct",
|
|
131
|
+
type: "read"
|
|
132
|
+
},
|
|
133
|
+
...access && access.protection ? [{
|
|
134
|
+
key: "access_service_token",
|
|
135
|
+
type: accessLevel
|
|
136
|
+
}] : []
|
|
137
|
+
] : [],
|
|
138
|
+
...zoneName && plan.deployment.application.baseDomain !== zoneName ? [{
|
|
139
|
+
key: "ssl_and_certificates",
|
|
140
|
+
type: "read"
|
|
141
|
+
}] : []
|
|
142
|
+
];
|
|
143
|
+
return {
|
|
144
|
+
title: "Cloudflare management API token",
|
|
145
|
+
linkInTitle: true,
|
|
146
|
+
url: "https://dash.cloudflare.com/?" + new URLSearchParams({
|
|
147
|
+
to: "/" + plan.account.id + "/api-tokens",
|
|
148
|
+
name: plan.deployment.displayName + " Management",
|
|
149
|
+
permissionGroupKeys: JSON.stringify(permissions)
|
|
150
|
+
}),
|
|
151
|
+
instructions: [
|
|
152
|
+
"This token lets the bwf CLI install your platform. bwf will now open a pre-configured token creation site. Please review the permissions and then paste the token here.",
|
|
153
|
+
`Scope it to ${plan.account.name}.`,
|
|
154
|
+
...createsZone ? [`Keep the zone policy on All Domains so bwf can create ${zoneName}.`] : zones.length ? [specifiedDomainsInstruction(zones)] : []
|
|
155
|
+
].join("\n")
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function platformSetupPages(plan) {
|
|
159
|
+
const permissions = [
|
|
160
|
+
...platformAccountTokenPermissions(plan.actions.some((action) => action.kind === "ai-gateway" && action.action === "inspect")),
|
|
161
|
+
...plan.deployment.application.zoneName ? [{
|
|
162
|
+
key: "cache",
|
|
163
|
+
type: "purge"
|
|
164
|
+
}] : [],
|
|
165
|
+
...plan.deployment.capabilities.customDomains ? [{
|
|
166
|
+
key: "ssl_and_certificates",
|
|
167
|
+
type: "edit"
|
|
168
|
+
}] : [],
|
|
169
|
+
...plan.deployment.capabilities.sandbox ? [{
|
|
170
|
+
key: "containers",
|
|
171
|
+
type: "edit"
|
|
172
|
+
}, {
|
|
173
|
+
key: "cloudchamber",
|
|
174
|
+
type: "edit"
|
|
175
|
+
}] : [],
|
|
176
|
+
...plan.deployment.capabilities.email ? [
|
|
177
|
+
{
|
|
178
|
+
key: "zone",
|
|
179
|
+
type: "read"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
key: "zone_settings",
|
|
183
|
+
type: "edit"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
key: "email_routing_address",
|
|
187
|
+
type: "edit"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
key: "email_routing_rule",
|
|
191
|
+
type: "edit"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
key: "email_sending",
|
|
195
|
+
type: "edit"
|
|
196
|
+
}
|
|
197
|
+
] : []
|
|
198
|
+
];
|
|
199
|
+
const zoneName = plan.deployment.application.zoneName;
|
|
200
|
+
return {
|
|
201
|
+
runtime: {
|
|
202
|
+
title: "Cloudflare runtime token",
|
|
203
|
+
linkInTitle: true,
|
|
204
|
+
url: "https://dash.cloudflare.com/?" + new URLSearchParams({
|
|
205
|
+
to: "/" + plan.account.id + "/api-tokens",
|
|
206
|
+
name: plan.deployment.displayName + " Runtime",
|
|
207
|
+
permissionGroupKeys: JSON.stringify(permissions)
|
|
208
|
+
}),
|
|
209
|
+
instructions: ["Create a Cloudflare runtime token that bwf can use to manage the platform. Please review the permissions and then paste the token here.", ...zoneName && plansZoneCreation(plan) ? [`Keep the zone policy on All Domains so the token can purge cache on ${zoneName} after bwf creates it.`] : zoneName ? [specifiedDomainsInstruction([zoneName, ...plan.deployment.capabilities.email ? ["every zone that will carry mail"] : []])] : []].join("\n")
|
|
210
|
+
},
|
|
211
|
+
github: {
|
|
212
|
+
title: "GitHub OAuth App",
|
|
213
|
+
url: "https://github.com/settings/applications/new",
|
|
214
|
+
instructions: "GitHub Auth will be used by the users of your bwf Platform instance. Register a GitHub app and generate a client secret.\nHomepage: " + plan.apiUrl + "\nRedirect URI: " + plan.apiUrl + "/auth/callback"
|
|
215
|
+
},
|
|
216
|
+
r2: {
|
|
217
|
+
title: "R2 upload token",
|
|
218
|
+
url: "https://dash.cloudflare.com/?" + new URLSearchParams({
|
|
219
|
+
to: "/" + plan.account.id + "/r2/api-tokens/create",
|
|
220
|
+
type: "account",
|
|
221
|
+
name: plan.deployment.displayName + " Uploads",
|
|
222
|
+
permission: "object-write",
|
|
223
|
+
bucketScope: "all"
|
|
224
|
+
}),
|
|
225
|
+
instructions: ["Review the preselected Object Read & Write access to all buckets in this account.", "Create the token, then copy the Access Key ID and Secret Access Key into the CLI."].join("\n")
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
function formatPlatformSetupPlan(plan, options = {}) {
|
|
230
|
+
const writesDns = planCreatesZone(plan) || planWritesDns(plan);
|
|
231
|
+
return [
|
|
232
|
+
"The installation will guide you through setting up the following credentials:",
|
|
233
|
+
"",
|
|
234
|
+
...[
|
|
235
|
+
...options.managementToken ? [options.managementAccess ? `Cloudflare management API token for ${writesDns ? "DNS changes and " : ""}Access setup` : "Cloudflare management API token for DNS changes"] : [],
|
|
236
|
+
"PostgreSQL database URL",
|
|
237
|
+
"Cloudflare runtime token",
|
|
238
|
+
"R2 upload token",
|
|
239
|
+
...plan.deployment.authentication.providers.includes("github") ? ["GitHub OAuth App client ID and secret"] : [],
|
|
240
|
+
...plan.deployment.authentication.providers.filter((provider) => provider !== "github").map((provider) => (provider === "google" ? "Google OAuth" : provider === "oidc" ? "OIDC" : "Cloudflare Access OIDC") + " client ID and secret"),
|
|
241
|
+
...plan.deployment.authentication.accessProtection ? ["Cloudflare Access application and installer credentials"] : [],
|
|
242
|
+
...plan.deployment.appAccess ? ["Cloudflare Access check and app-management token when needed (stored encrypted)"] : [],
|
|
243
|
+
...process.stdin.isTTY ? [] : ["JWT signing key and project encryption key for non-interactive installs"]
|
|
244
|
+
].map((credential) => `• ${credential}`)
|
|
245
|
+
].join("\n");
|
|
246
|
+
}
|
|
247
|
+
function platformInstallCommandArguments(options) {
|
|
248
|
+
const parts = [
|
|
249
|
+
options.commandName,
|
|
250
|
+
"platform",
|
|
251
|
+
"install"
|
|
252
|
+
];
|
|
253
|
+
const flag = (name, value) => {
|
|
254
|
+
if (value) parts.push(name, value);
|
|
255
|
+
};
|
|
256
|
+
if (options.resumeId) {
|
|
257
|
+
parts.push("--resume");
|
|
258
|
+
flag("--name", options.resumeId);
|
|
259
|
+
} else {
|
|
260
|
+
flag("--name", options.installationSlug);
|
|
261
|
+
flag("--account", options.accountId);
|
|
262
|
+
flag("--display-name", options.displayName);
|
|
263
|
+
if (options.workersDev) parts.push("--workers-dev");
|
|
264
|
+
else {
|
|
265
|
+
flag("--application-domain", options.applicationDomain);
|
|
266
|
+
flag("--zone", options.zoneName);
|
|
267
|
+
if (options.dedicatedZone) parts.push("--dedicated-zone");
|
|
268
|
+
else parts.push("--no-dedicated-zone");
|
|
269
|
+
if (options.customDomains) parts.push("--custom-domains");
|
|
270
|
+
}
|
|
271
|
+
flag("--control-plane-domain", options.controlPlaneDomain);
|
|
272
|
+
if (!options.controlPlaneDomain) parts.push("--no-control-plane-domain");
|
|
273
|
+
}
|
|
274
|
+
flag("--hyperdrive", options.hyperdrive ?? "");
|
|
275
|
+
flag("--auth-config", options.authConfig ?? "");
|
|
276
|
+
if (!options.resumeId && options.appAccess) flag("--app-access", options.appAccess);
|
|
277
|
+
if (!options.authConfig && !options.resumeId && options.authentication) {
|
|
278
|
+
flag("--login-methods", options.authentication.providers.join(","));
|
|
279
|
+
parts.push(options.authentication.accessProtection ? "--access-protection" : "--no-access-protection");
|
|
280
|
+
}
|
|
281
|
+
flag("--dashboard-url", options.dashboardUrl ?? "");
|
|
282
|
+
flag("--runtime", options.runtime);
|
|
283
|
+
flag("--runtime-logs", options.runtimeLogs ?? "");
|
|
284
|
+
flag("--storage-location", options.storageLocation ?? "");
|
|
285
|
+
if (options.yes) parts.push("--yes");
|
|
286
|
+
return parts;
|
|
287
|
+
}
|
|
288
|
+
function formatPlatformInstallCommand(options) {
|
|
289
|
+
return platformInstallCommandArguments(options).map((value) => {
|
|
290
|
+
if (/^[A-Za-z0-9_@%+=:,./-]+$/.test(value)) return value;
|
|
291
|
+
return process.platform === "win32" ? `'${value.replaceAll("'", "''")}'` : `'${value.replaceAll("'", "'\\''")}'`;
|
|
292
|
+
}).join(" ");
|
|
293
|
+
}
|
|
294
|
+
function openPlatformSetupPage(page, dependencies = {}) {
|
|
295
|
+
log.info((page.linkInTitle ? platformSetupLink(page) : page.title) + "\n" + page.instructions);
|
|
296
|
+
if (!page.linkInTitle) console.log(platformSetupLink({
|
|
297
|
+
...page,
|
|
298
|
+
title: "Open " + page.title
|
|
299
|
+
}));
|
|
300
|
+
if (dependencies.interactive ?? process.stdin.isTTY === true) try {
|
|
301
|
+
(dependencies.open ?? openBrowser)(page.url);
|
|
302
|
+
} catch {
|
|
303
|
+
log.info("Could not open the browser. Use the link above.");
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
export { platformManagementSetupPage as a, platformSetupLink as c, planWritesDns as d, platformInstallCommandArguments as i, platformSetupPages as l, formatPlatformSetupPlan as n, platformPromptAnswer as o, openPlatformSetupPage as r, platformSetupFieldHelp as s, formatPlatformInstallCommand as t, planCreatesZone as u };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { a as join } from "./dist-DMYe8CZJ.mjs";
|
|
2
|
+
import { t as analyzeApplication } from "./application-routing-DbR-W5lG.mjs";
|
|
3
|
+
import { a as projectAuthConfigImporter, i as loadBwfAuthConfig } from "./config-CN_RFRkS.mjs";
|
|
4
|
+
import { n as generateBwfAuthDrizzleSchema, t as generateBwfAuthDatabaseModule } from "./drizzle-DqVFXtlc.mjs";
|
|
5
|
+
import { c as getDatabaseCasing, f as readConfig } from "./config-tNx0HlFv.mjs";
|
|
6
|
+
import { t as discoverSchema } from "./discover-DJPmQcL5.mjs";
|
|
7
|
+
import { c as loadLocalEnv } from "./env-DUyTzroe.mjs";
|
|
8
|
+
import { c as generateDbDts, i as generateAuthTypes, l as generateBindingTypes, n as generateQueueTypes, r as generateProcedureTypes, t as generateRouteTypes } from "./route-types-CRWhr93D.mjs";
|
|
9
|
+
import { n as findEnvFileForPaths, r as generateEnvTypes } from "./env-types-Bg-dTh8u.mjs";
|
|
10
|
+
import { i as writeFileIfChanged, n as ensureProjectTsconfig } from "./project-tsconfig-P9X952KG.mjs";
|
|
11
|
+
import { existsSync, rmSync } from "node:fs";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
// src/codegen/prepare.ts
|
|
14
|
+
function writeGeneratedFile(outDir, fileName, content, written) {
|
|
15
|
+
if (writeFileIfChanged(join(outDir, fileName), content)) written.push(join(".bwf", fileName));
|
|
16
|
+
}
|
|
17
|
+
function removeGeneratedFile(outDir, fileName, removed) {
|
|
18
|
+
const filePath = join(outDir, fileName);
|
|
19
|
+
if (!existsSync(filePath)) return;
|
|
20
|
+
rmSync(filePath, { force: true });
|
|
21
|
+
removed.push(join(".bwf", fileName));
|
|
22
|
+
}
|
|
23
|
+
async function prepareProject(root) {
|
|
24
|
+
const config = readConfig(root);
|
|
25
|
+
const { paths, authConfigPath, authEnabled, dialect, scan } = await analyzeApplication(root, { config });
|
|
26
|
+
const outDir = join(root, ".bwf");
|
|
27
|
+
const written = [];
|
|
28
|
+
const removed = [];
|
|
29
|
+
const bindingTypes = generateBindingTypes(config);
|
|
30
|
+
if (bindingTypes) writeGeneratedFile(outDir, "bindings.d.ts", bindingTypes, written);
|
|
31
|
+
else removeGeneratedFile(outDir, "bindings.d.ts", removed);
|
|
32
|
+
const envFile = findEnvFileForPaths(root, paths);
|
|
33
|
+
if (envFile) {
|
|
34
|
+
const { dts } = generateEnvTypes(envFile, outDir);
|
|
35
|
+
writeGeneratedFile(outDir, "env.d.ts", dts, written);
|
|
36
|
+
} else removeGeneratedFile(outDir, "env.d.ts", removed);
|
|
37
|
+
if (authConfigPath) {
|
|
38
|
+
const { dts } = generateAuthTypes(authConfigPath, outDir);
|
|
39
|
+
writeGeneratedFile(outDir, "auth.d.ts", dts, written);
|
|
40
|
+
} else removeGeneratedFile(outDir, "auth.d.ts", removed);
|
|
41
|
+
const hasRouteTypes = scan.routes.length > 0 || (scan.websockets?.length ?? 0) > 0;
|
|
42
|
+
if (hasRouteTypes) {
|
|
43
|
+
const { dts } = generateRouteTypes(scan, paths.routesDir, outDir, { typedRoutes: config.routing?.typedRoutes });
|
|
44
|
+
writeGeneratedFile(outDir, "routes.d.ts", dts, written);
|
|
45
|
+
} else removeGeneratedFile(outDir, "routes.d.ts", removed);
|
|
46
|
+
if (existsSync(paths.queuesDir)) writeGeneratedFile(outDir, "queues.d.ts", generateQueueTypes(scan.queues, paths.queuesDir, outDir), written);
|
|
47
|
+
else removeGeneratedFile(outDir, "queues.d.ts", removed);
|
|
48
|
+
if (existsSync(paths.proceduresDir)) writeGeneratedFile(outDir, "procedures.d.ts", generateProcedureTypes(scan.procedures ?? [], paths.proceduresDir, outDir), written);
|
|
49
|
+
else removeGeneratedFile(outDir, "procedures.d.ts", removed);
|
|
50
|
+
const schema = discoverSchema(root, paths);
|
|
51
|
+
const hasDbRuntime = schema != null || authEnabled || getDatabaseCasing(config) !== void 0;
|
|
52
|
+
if (hasDbRuntime) {
|
|
53
|
+
if (generateDbDts(outDir, schema, dialect)) written.push(join(".bwf", "db.d.ts"));
|
|
54
|
+
} else removeGeneratedFile(outDir, "db.d.ts", removed);
|
|
55
|
+
if (ensureProjectTsconfig(root, hasRouteTypes, hasDbRuntime, schema != null, { paths })) written.push(join(".bwf", "tsconfig.json"));
|
|
56
|
+
if (authEnabled) {
|
|
57
|
+
const authRuntime = {
|
|
58
|
+
dialect,
|
|
59
|
+
providers: config.auth?.providers ?? null,
|
|
60
|
+
userConfig: await loadBwfAuthConfig(authConfigPath, projectAuthConfigImporter(root))
|
|
61
|
+
};
|
|
62
|
+
const env = {
|
|
63
|
+
...loadLocalEnv(root),
|
|
64
|
+
...process.env
|
|
65
|
+
};
|
|
66
|
+
const schemaPath = join(outDir, "better-auth-schema.ts");
|
|
67
|
+
const databasePath = join(outDir, "better-auth-db.ts");
|
|
68
|
+
const drizzleAdapterPath = fileURLToPath(import.meta.resolve("better-auth/adapters/drizzle"));
|
|
69
|
+
if (writeFileIfChanged(schemaPath, generateBwfAuthDrizzleSchema(authRuntime, env))) written.push(join(".bwf", "better-auth-schema.ts"));
|
|
70
|
+
if (writeFileIfChanged(databasePath, generateBwfAuthDatabaseModule({
|
|
71
|
+
dialect,
|
|
72
|
+
schemaImportPath: schemaPath,
|
|
73
|
+
drizzleAdapterPath
|
|
74
|
+
}))) written.push(join(".bwf", "better-auth-db.ts"));
|
|
75
|
+
} else {
|
|
76
|
+
removeGeneratedFile(outDir, "better-auth-schema.ts", removed);
|
|
77
|
+
removeGeneratedFile(outDir, "better-auth-db.ts", removed);
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
written,
|
|
81
|
+
removed
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export { prepareProject as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { L as log } from "./dist-STQXl8ck.mjs";
|
|
2
|
+
import { t as prepareProject } from "./prepare-B9mB47T5.mjs";
|
|
3
|
+
import { m as printSuccess, p as note } from "./output-Bb34lF0w.mjs";
|
|
4
|
+
// src/cli/prepare.ts
|
|
5
|
+
async function runPrepareCommand(root) {
|
|
6
|
+
console.log();
|
|
7
|
+
const result = await prepareProject(root);
|
|
8
|
+
if (result.written.length > 0) note(result.written.join("\n"), "Wrote");
|
|
9
|
+
if (result.removed.length > 0) note(result.removed.join("\n"), "Removed stale files");
|
|
10
|
+
if (result.written.length === 0 && result.removed.length === 0) log.info("No generated files changed.");
|
|
11
|
+
printSuccess("Project codegen is ready.");
|
|
12
|
+
}
|
|
13
|
+
export { runPrepareCommand };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as prepareProject } from "./prepare-B9mB47T5.mjs";
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { a as join, n as dirname } from "./dist-DMYe8CZJ.mjs";
|
|
2
|
+
import { c as normalizePlatformApiUrl, s as listPlatformConnections } from "./platform-registry-x1m9HBxf.mjs";
|
|
3
|
+
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { normalizeApplicationDomain } from "@builtbyfriends/platform";
|
|
5
|
+
// src/cli/project.ts
|
|
6
|
+
const PROJECT_FILE = ".bwf/project.json";
|
|
7
|
+
function readProjectConfigFile(root) {
|
|
8
|
+
const filePath = join(root, PROJECT_FILE);
|
|
9
|
+
try {
|
|
10
|
+
const raw = readFileSync(filePath, "utf-8");
|
|
11
|
+
const config = JSON.parse(raw);
|
|
12
|
+
if (typeof config !== "object" || config === null || Array.isArray(config)) return null;
|
|
13
|
+
return config;
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Read the project config from the project root.
|
|
20
|
+
* Returns null if no project.json exists.
|
|
21
|
+
* A file containing only internal metadata is not treated as a linked project.
|
|
22
|
+
*/
|
|
23
|
+
function readProjectConfig(root) {
|
|
24
|
+
const config = readProjectConfigFile(root);
|
|
25
|
+
if (!config || typeof config.projectId !== "string" || typeof config.slug !== "string") return null;
|
|
26
|
+
const result = {
|
|
27
|
+
projectId: config.projectId,
|
|
28
|
+
slug: config.slug
|
|
29
|
+
};
|
|
30
|
+
if (typeof config.platformUrl === "string") result.platformUrl = normalizePlatformApiUrl(config.platformUrl);
|
|
31
|
+
if (typeof config.applicationDomain === "string") result.applicationDomain = normalizeApplicationDomain(config.applicationDomain);
|
|
32
|
+
if (typeof config.proxyUrl === "string") result.proxyUrl = normalizePlatformApiUrl(config.proxyUrl);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Read the deployment platform selected during `bwf init`.
|
|
37
|
+
*
|
|
38
|
+
* Linked project files created before the platform field existed implicitly
|
|
39
|
+
* target bwf. A metadata-only file has no deployment preference.
|
|
40
|
+
*/
|
|
41
|
+
function readDeploymentPlatform(root) {
|
|
42
|
+
const config = readProjectConfigFile(root);
|
|
43
|
+
if (!config) return null;
|
|
44
|
+
if (config.platform === "cloudflare" || config.platform === "nosam" || config.platform === "none") return config.platform;
|
|
45
|
+
if (typeof config.projectId === "string" && typeof config.slug === "string") return "nosam";
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Persist a deployment preference without discarding an existing bwf project
|
|
50
|
+
* link. Keeping the link makes switching back to bwf non-destructive.
|
|
51
|
+
*/
|
|
52
|
+
function writeDeploymentPlatform(root, platform) {
|
|
53
|
+
const filePath = join(root, PROJECT_FILE);
|
|
54
|
+
const existing = readProjectConfigFile(root);
|
|
55
|
+
const next = { platform };
|
|
56
|
+
if (typeof existing?.projectId === "string") next.projectId = existing.projectId;
|
|
57
|
+
if (typeof existing?.platformUrl === "string") next.platformUrl = existing.platformUrl;
|
|
58
|
+
if (typeof existing?.applicationDomain === "string") next.applicationDomain = existing.applicationDomain;
|
|
59
|
+
if (typeof existing?.proxyUrl === "string") next.proxyUrl = existing.proxyUrl;
|
|
60
|
+
if (typeof existing?.slug === "string") next.slug = existing.slug;
|
|
61
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
62
|
+
writeFileSync(filePath, JSON.stringify(next, null, 2) + "\n");
|
|
63
|
+
}
|
|
64
|
+
/** Select a verified platform without changing an existing project link. */
|
|
65
|
+
function writePlatformSelection(root, connection) {
|
|
66
|
+
const existing = readProjectConfigFile(root);
|
|
67
|
+
const linked = readProjectConfig(root);
|
|
68
|
+
const pinnedUrl = linked?.platformUrl;
|
|
69
|
+
if (pinnedUrl && pinnedUrl !== connection.apiUrl) return false;
|
|
70
|
+
const metadata = { ...existing };
|
|
71
|
+
delete metadata.bwfInternalStaging;
|
|
72
|
+
if (linked && !pinnedUrl) {
|
|
73
|
+
delete metadata.projectId;
|
|
74
|
+
delete metadata.slug;
|
|
75
|
+
}
|
|
76
|
+
const filePath = join(root, PROJECT_FILE);
|
|
77
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
78
|
+
writeFileSync(filePath, JSON.stringify({
|
|
79
|
+
...metadata,
|
|
80
|
+
platform: "nosam",
|
|
81
|
+
platformUrl: normalizePlatformApiUrl(connection.apiUrl),
|
|
82
|
+
applicationDomain: normalizeApplicationDomain(connection.applicationDomain),
|
|
83
|
+
proxyUrl: normalizePlatformApiUrl(connection.proxyUrl)
|
|
84
|
+
}, null, 2) + "\n");
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
function readProjectPlatformUrl(root) {
|
|
88
|
+
const value = readProjectConfigFile(root)?.platformUrl;
|
|
89
|
+
return typeof value === "string" && value !== "" ? normalizePlatformApiUrl(value) : null;
|
|
90
|
+
}
|
|
91
|
+
/** A deploy can establish a first link, but must never replace a saved destination. */
|
|
92
|
+
function shouldLinkDeployProject(root, apiUrl) {
|
|
93
|
+
const platform = readDeploymentPlatform(root);
|
|
94
|
+
const selectedUrl = readProjectPlatformUrl(root);
|
|
95
|
+
return !readProjectConfig(root) && platform !== "cloudflare" && platform !== "none" && (!selectedUrl || selectedUrl === normalizePlatformApiUrl(apiUrl));
|
|
96
|
+
}
|
|
97
|
+
/** Resolve the immutable platform identity that every newly linked project records. */
|
|
98
|
+
function attachSelectedPlatform(config, platformApiUrl) {
|
|
99
|
+
const apiUrl = normalizePlatformApiUrl(platformApiUrl);
|
|
100
|
+
const connection = listPlatformConnections().find((entry) => entry.apiUrl === apiUrl);
|
|
101
|
+
if (connection?.applicationDomain && connection.proxyUrl) return {
|
|
102
|
+
...config,
|
|
103
|
+
applicationDomain: connection.applicationDomain,
|
|
104
|
+
platformUrl: connection.apiUrl,
|
|
105
|
+
proxyUrl: connection.proxyUrl
|
|
106
|
+
};
|
|
107
|
+
throw new Error(`platform: No verified metadata is registered for ${apiUrl}. Run \`bwf connect ${apiUrl}\` before linking a project.`);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Write the project config to the project root.
|
|
111
|
+
*/
|
|
112
|
+
function writeProjectConfig(root, config) {
|
|
113
|
+
const filePath = join(root, PROJECT_FILE);
|
|
114
|
+
const existing = readProjectConfigFile(root);
|
|
115
|
+
const next = {
|
|
116
|
+
platform: "nosam",
|
|
117
|
+
projectId: config.projectId,
|
|
118
|
+
slug: config.slug
|
|
119
|
+
};
|
|
120
|
+
if (config.platformUrl) next.platformUrl = normalizePlatformApiUrl(config.platformUrl);
|
|
121
|
+
else if (typeof existing?.platformUrl === "string") next.platformUrl = existing.platformUrl;
|
|
122
|
+
if (config.applicationDomain) next.applicationDomain = normalizeApplicationDomain(config.applicationDomain);
|
|
123
|
+
else if (typeof existing?.applicationDomain === "string") next.applicationDomain = existing.applicationDomain;
|
|
124
|
+
if (config.proxyUrl) next.proxyUrl = normalizePlatformApiUrl(config.proxyUrl);
|
|
125
|
+
else if (typeof existing?.proxyUrl === "string") next.proxyUrl = existing.proxyUrl;
|
|
126
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
127
|
+
writeFileSync(filePath, JSON.stringify(next, null, 2) + "\n");
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Remove the project config file. Returns true if removed, false if it didn't exist.
|
|
131
|
+
*/
|
|
132
|
+
function removeProjectConfig(root) {
|
|
133
|
+
const filePath = join(root, PROJECT_FILE);
|
|
134
|
+
try {
|
|
135
|
+
rmSync(filePath);
|
|
136
|
+
return true;
|
|
137
|
+
} catch {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export { removeProjectConfig as a, writePlatformSelection as c, readProjectPlatformUrl as i, writeProjectConfig as l, readDeploymentPlatform as n, shouldLinkDeployProject as o, readProjectConfig as r, writeDeploymentPlatform as s, attachSelectedPlatform as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as attachSelectedPlatform, l as writeProjectConfig } from "./project-CC7eN00D.mjs";
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { n as readDeploymentPlatform } from "./project-CC7eN00D.mjs";
|
|
2
|
+
import { H as outro, L as log } from "./dist-STQXl8ck.mjs";
|
|
3
|
+
import { c as getToken, s as getSiteDomain } from "./auth-xnkmpZUl.mjs";
|
|
4
|
+
import { r as PlatformClient } from "./client-D3D5RM5h.mjs";
|
|
5
|
+
import { _ as tablePrefix, f as import_picocolors, i as dim, l as formatUrl, o as formatCount } from "./output-Bb34lF0w.mjs";
|
|
6
|
+
// src/cli/projects.ts
|
|
7
|
+
async function runProjectsCommand(root) {
|
|
8
|
+
console.log();
|
|
9
|
+
const token = getToken(root);
|
|
10
|
+
if (!token) {
|
|
11
|
+
log.error("Not logged in. Run `bwf account login` first.");
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
const projects = await new PlatformClient(token, { root }).listProjects();
|
|
15
|
+
if (projects.length === 0) {
|
|
16
|
+
outro("No projects found.");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const rows = projects.map((p) => ({
|
|
20
|
+
slug: p.slug,
|
|
21
|
+
role: p.role,
|
|
22
|
+
appType: p.type ?? "worker",
|
|
23
|
+
url: p.custom_domain ? `https://${p.custom_domain}` : p.url ?? `https://${p.slug}.${getSiteDomain(root)}`
|
|
24
|
+
}));
|
|
25
|
+
const slugWidth = Math.max(4, ...rows.map((r) => r.slug.length));
|
|
26
|
+
const roleWidth = Math.max(4, ...rows.map((r) => r.role.length));
|
|
27
|
+
const typeWidth = Math.max(4, ...rows.map((r) => r.appType.length));
|
|
28
|
+
const prefix = tablePrefix();
|
|
29
|
+
const header = `${prefix}${dim(`${"slug".padEnd(slugWidth)} ${"role".padEnd(roleWidth)} ${"type".padEnd(typeWidth)} url`)}`;
|
|
30
|
+
const lines = rows.map((row) => `${prefix}${import_picocolors.default.green(row.slug)}${"".padEnd(slugWidth - row.slug.length)} ${row.role.padEnd(roleWidth)} ${row.appType.padEnd(typeWidth)} ${formatUrl(row.url)}`);
|
|
31
|
+
console.log(prefix);
|
|
32
|
+
console.log(header);
|
|
33
|
+
for (const line of lines) console.log(line);
|
|
34
|
+
outro(formatCount(projects.length, "project"));
|
|
35
|
+
}
|
|
36
|
+
// src/cli/project-cmd.ts
|
|
37
|
+
async function runProjectCommand(root, args) {
|
|
38
|
+
const cloudflare = readDeploymentPlatform(root) === "cloudflare";
|
|
39
|
+
if (args.subcommand === "status") {
|
|
40
|
+
const { runListCommand } = await import("./list-B1WAE9Wt.mjs");
|
|
41
|
+
return runListCommand(root, args.name || void 0);
|
|
42
|
+
}
|
|
43
|
+
if (args.subcommand === "link") {
|
|
44
|
+
if (cloudflare) throw new Error("project: Direct Cloudflare apps are identified by cloudflare.name in bwf.config.ts and do not need linking.");
|
|
45
|
+
const { runLink } = await import("./link-DinwJnon.mjs");
|
|
46
|
+
return runLink(root, args.name || void 0);
|
|
47
|
+
}
|
|
48
|
+
if (args.subcommand === "list") {
|
|
49
|
+
if (cloudflare) {
|
|
50
|
+
const { runListCommand } = await import("./list-B1WAE9Wt.mjs");
|
|
51
|
+
return runListCommand(root);
|
|
52
|
+
}
|
|
53
|
+
return runProjectsCommand(root);
|
|
54
|
+
}
|
|
55
|
+
if (args.subcommand === "token") {
|
|
56
|
+
if (cloudflare) throw new Error("project: CI deploy credentials are available only for bwf platform projects.");
|
|
57
|
+
const { runProjectTokenCommand } = await import("./project-token-CwZdUEGu.mjs");
|
|
58
|
+
return runProjectTokenCommand(root, args);
|
|
59
|
+
}
|
|
60
|
+
if (args.subcommand === "team") {
|
|
61
|
+
if (args.action === "") {
|
|
62
|
+
const { printHelpPage } = await import("./help-DaRezBj7.mjs");
|
|
63
|
+
printHelpPage(["project", "team"]);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const accountInvitationAction = args.action === "pending" || args.action === "accept" || args.action === "decline";
|
|
67
|
+
if (cloudflare && !accountInvitationAction) throw new Error("project: Teams are available only for projects hosted on a bwf platform, not direct Cloudflare deployments.");
|
|
68
|
+
const { runProjectTeamCommand } = await import("./project-team-CvdLhDF2.mjs");
|
|
69
|
+
return runProjectTeamCommand(root, args);
|
|
70
|
+
}
|
|
71
|
+
if (args.subcommand === "zero-trust") {
|
|
72
|
+
if (cloudflare) throw new Error("project: Zero Trust overrides are available only for projects hosted on a bwf platform.");
|
|
73
|
+
if (args.action === "") {
|
|
74
|
+
const { printHelpPage } = await import("./help-DaRezBj7.mjs");
|
|
75
|
+
printHelpPage(["project", "zero-trust"]);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const action = args.action;
|
|
79
|
+
const { runProjectZeroTrustCommand } = await import("./project-zero-trust-CKDoPdN1.mjs");
|
|
80
|
+
return runProjectZeroTrustCommand(root, {
|
|
81
|
+
...args,
|
|
82
|
+
action
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (args.subcommand === "logs") {
|
|
86
|
+
const { runLogsCommand } = await import("./logs-BjMJooJQ.mjs");
|
|
87
|
+
return runLogsCommand(root, args.filter, args.range, args.deployment || void 0, args.level || void 0);
|
|
88
|
+
}
|
|
89
|
+
if (args.subcommand === "requests") {
|
|
90
|
+
if (cloudflare) throw new Error("project: Historical request analytics require the bwf platform. Use `bwf project logs` for a live Cloudflare tail.");
|
|
91
|
+
const { runRequestsCommand } = await import("./requests-DNhfyF3l.mjs");
|
|
92
|
+
return runRequestsCommand(root, args.range, args.status || void 0);
|
|
93
|
+
}
|
|
94
|
+
if (args.subcommand === "rollback") {
|
|
95
|
+
const { runRollbackCommand } = await import("./rollback-wi6WK5T6.mjs");
|
|
96
|
+
return runRollbackCommand(root, args.deployId || void 0, args.platform);
|
|
97
|
+
}
|
|
98
|
+
if (args.subcommand === "cancel") {
|
|
99
|
+
if (cloudflare) throw new Error("project: Direct Cloudflare deploys activate only after readiness succeeds, so there is no remote build to cancel.");
|
|
100
|
+
const { runCancelDeployCommand } = await import("./cancel-deploy-DKAj5U1Z.mjs");
|
|
101
|
+
return runCancelDeployCommand(root, args.deployId || void 0);
|
|
102
|
+
}
|
|
103
|
+
if (args.subcommand === "delete") {
|
|
104
|
+
if (cloudflare) throw new Error("project: Refusing to delete Cloudflare resources through this command. Direct deployments are additive and existing resources may be shared.");
|
|
105
|
+
const { runDeleteCommand } = await import("./delete-BSKI7V23.mjs");
|
|
106
|
+
return runDeleteCommand(root, args.name || void 0, { force: args.force });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export { runProjectCommand };
|