feat(framework): compose vike-* extensions + opt-in real-DB persistence (#187)#188
Merged
Merged
Conversation
Adds a vike-auth-composer persona (ai-autopilot) that tells the agent to compose vike-auth for authentication instead of hand-rolling sessions, cookies, and login pages, plus a vikeExtensionPersonas set that keeps the Prisma data persona but swaps in auth composition. Framework opts in via `--compose-extensions` / RunFrameworkOptions.composeExtensions; default framing is unchanged and publish-safe (no vike-auth), since the extensions currently resolve only inside the vike-data workspace. Offline-verified: persona content + opt-in wiring tests; ai-autopilot 261, framework 57; typecheck 20/20; --fake --compose-extensions runs clean. No changeset yet: not publish-ready until the live in-workspace proof lands and the vike-* publish story is decided.
…Prisma (#186) The vike-* compose path was still pointing domain data at Prisma, so a live run burned time on Prisma install/config/migrations for data that can ride the one adapter vike-auth already registers. Adds a vike-data-modeler persona (schema via @vike-data/vike-schema, repository via @universal-orm/core over the registered adapter, no ORM install / no migrations) and makes vikeExtensionPersonas [vikeDataModeler, vikeAuthComposer, uiIntentDesigner]. Default path stays on Prisma (publish-safe). ai-autopilot 262, framework 57.
…+ pglite) (#187) The composed vike-auth + universal-orm stack runs on the memory adapter, which resets on restart, so accounts and posts vanish on reboot. Teach the data and auth personas the opt-in swap to the Drizzle adapter over an embedded pglite Postgres: register it instead of the memory adapter, add vikeSchema() to codegen the drizzle schema, and derive/apply migrations with drizzle-kit. Schema and queries do not change, and because auth and data ride the same one adapter, the single swap makes both durable at once. Memory stays the zero-config dev default. Part of #186. Closes #187.
This was referenced Jul 3, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Composes the vike-* extensions instead of hand-rolling auth/data, and makes the composed stack persist. Personas only, opt-in, in-workspace.
Three commits on the compose-framing branch:
vike-auth-composer: compose vike-auth for login/sessions/CSRF instead of hand-rolling them.vike-data-modeler: model domain data on the universal-orm data layer (one registered adapter, no ORM install) instead of raw Prisma.Why persistence rides here: vike-auth's users/sessions and the app's posts/comments both use the SAME adapter registered in
+onCreateGlobalContext. Today that is the memory adapter, which resets on restart, so accounts and posts vanish on reboot. Swapping that one adapter to Drizzle over an embedded pglite Postgres makes auth AND data durable at once.defineSchematables anddb()queries do not change; only the adapter registration, thevikeSchema()Vite plugin (schema codegen), and drizzle-kit migrations are added. Memory stays the zero-config dev default.Reference: the proven
examples/drizzle-pglitetwin in the vike-data monorepo. The matching workspaceCLAUDE.md(the live-run target) gets the same opt-in steps.Tests:
@gemstack/ai-autopilotsuite green (262 pass); new assertions cover the persistence teaching (registerDrizzle / pglite / vikeSchema / drizzle-kit generate). Changeset: minor.Closes #187. Part of #186.