Skip to content

feat(framework): compose vike-* extensions + opt-in real-DB persistence (#187)#188

Merged
suleimansh merged 3 commits into
mainfrom
suleimansh/feat/186-vike-extensions-framing
Jul 3, 2026
Merged

feat(framework): compose vike-* extensions + opt-in real-DB persistence (#187)#188
suleimansh merged 3 commits into
mainfrom
suleimansh/feat/186-vike-extensions-framing

Conversation

@suleimansh

Copy link
Copy Markdown
Member

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.
  • Persistence (this issue): teach the "make it real" swap so a composed blog survives a dev-server restart.

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. defineSchema tables and db() queries do not change; only the adapter registration, the vikeSchema() Vite plugin (schema codegen), and drizzle-kit migrations are added. Memory stays the zero-config dev default.

Reference: the proven examples/drizzle-pglite twin in the vike-data monorepo. The matching workspace CLAUDE.md (the live-run target) gets the same opt-in steps.

Tests: @gemstack/ai-autopilot suite green (262 pass); new assertions cover the persistence teaching (registerDrizzle / pglite / vikeSchema / drizzle-kit generate). Changeset: minor.

Closes #187. Part of #186.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: high Should be addressed soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compose layer: real-DB persistence (drizzle + pglite) — accounts + data survive restart

1 participant