Teach codegen to consume adapter packages: serverPackage entries, setupFn, and manifest routes - #4729
Conversation
Deploying wasp-docs-on-main with
|
| Latest commit: |
39de0f6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://267fb9f7.wasp-docs-on-main.pages.dev |
| Branch Preview URL: | https://franjo-auth2-6-adapter-codeg.wasp-docs-on-main.pages.dev |
8bc71eb to
a4736f3
Compare
a4736f3 to
3076119
Compare
@wasp.sh/spec
@wasp.sh/wasp-cli
@wasp.sh/wasp-cli-darwin-arm64-unknown
@wasp.sh/wasp-cli-darwin-x64-unknown
@wasp.sh/wasp-cli-linux-arm64-glibc
@wasp.sh/wasp-cli-linux-x64-glibc
@wasp.sh/wasp-cli-linux-x64-musl
commit: |
3076119 to
dbe0cc4
Compare
dbe0cc4 to
577d9d4
Compare
577d9d4 to
0fea5a2
Compare
0fea5a2 to
40c7c3e
Compare
|
New since last review: the runtime window gains an optional eager-provisioning channel, |
40c7c3e to
39de0f6
Compare
39de0f6 to
8d191da
Compare
…upFn, and manifest routes
8d191da to
ca9ab7c
Compare
|
Dropped the |
|
This pull request is now stale. Next steps if the PR is still relevant, and you are able to devote time to it:
If no action is taken, this PR will be automatically closed in 7 days. |
Description
Stack 6/7. Codegen learns to consume adapter packages, and the contract gains the adapter-package surface together with its consumers:
@wasp.sh/auth-contractgrowsWaspServerRuntime(db, dbProvider, validated env, URLs — the adapter's only window into the app),ServerAdapter,ServerAdapterExtensions { setupFn }andServerAdapterFactory. Adapters must not import generated code or readprocess.env; this boundary is what lets an adapter package typecheck and version independently of any app.genAuthProviderIndexTsfinal form: forserver: { package }manifests it emits thecreateServerAdapter(runtime, options, extensions)call with the manifest'soptionsdelivered verbatim and the app'ssetupFn(theprismaSetupFn-convention escape hatch) passed through a newRegisteredAuthProviderSetupFnvirtual module.routeHandlerat the manifest's declaredbasePath, withrawBody: trueroutes exempted from the JSON body parser (Better Auth reads its own stream).No app in the repo uses a package entry until 7/7, so golden churn here is minimal; the shape is exercised by two real packages one PR later.
Type of change
Checklist
I tested my change in a Wasp app to verify that it works as intended.
🧪 Tests and apps:
examples/kitchen-sink/e2e-tests.waspc/data/Cli/templates, as needed.examples/, as needed.examples/tutorials) I updated the tutorial in the docs (and vice versa).📜 Documentation:
web/docs/.🆕 Changelog: (if change is more than just code/docs improvement)
waspc/ChangeLog.mdwith a user-friendly description of the change.web/docs/migration-guides/.versioninwaspc/waspc.cabalto reflect the changes I introduced.