You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server client uses createPolarCore from @polar-sh/sdk/2026-10.
Customer state fields are snake_case (active_subscriptions); Next/Nuxt use models.CustomerState.
Native checkout uses success_url / return_url.
The SDK's metering outpost lazily imports optional peers (ioredis, @opentelemetry/*) that are never installed; TanStack Start and Solid self-backend builds mark them external, and Next self-backend lists @polar-sh/sdk in serverExternalPackages.
TanStack Start passes hasProSubscription through route context instead of the full customer state (SDK 1.x types it with non-serializable fields).
Convex stays on @polar-sh/sdk ^0.49: @convex-dev/polar imports core.js / funcs/*, which 1.x no longer exports.
varlock Next integration 2.0: standalone output needs an explicit freezeIntoBundle. Docker uses false (boots through varlock/auto-load), Prisma Compute uses true (no CLI there; _VARLOCK_ENV_KEY is already forwarded).
Varlock deploys
The @next/env override pointed at @varlock/nextjs-integration@1.2.2 while the plugin was 2.x; it now uses the same version.
Next on Vercel: Varlock 2.x freezes the env into the build and fails without _VARLOCK_ENV_KEY. The env sync script now sets a fresh key per Vercel environment.
Next on Prisma Compute (freezeIntoBundle: true): Alchemy generates the key once (Alchemy.makeRandom) and passes it to build and runtime.
@generateTsTypes(..., auto=not(forEnv(production))): production servers no longer write src/env.ts at boot (needed for read-only, non-root images); dev and varlock codegen still generate it.
Docker
node:26-slim (Node 26 is Active LTS since 2026-10-28), mysql:9.7 (current LTS tag), mongo:9, pnpm 12, checked against nodejs.org, Docker Hub and npm.
Runtime images run as the unprivileged node/bun user (Next copies .next with --chown).
Next + local SQLite: create .data before next build (broken on main too).
Mongo + Better Auth
mongodb 7.9.0 shipped while Mongoose pins ~7.8; the direct mongodb dependency installed a second driver and broke type checks. Removed (nothing imports it).
Express/Fastify server bundles inlined Mongoose's driver while the Better Auth adapter stayed external, so sign-in returned 500 (INVALID_ID). mongoose is now a server dependency, so it stays external.
Still pinned (unchanged)
TypeScript 6 (TS 7 is not supported by svelte-check and other tooling), Prisma 7 (Prisma 8 deferred), @planetscale/database 1.x (drizzle-orm#6398), tailwind-variants 3 (heroui-native peer), @babel/core 7 (Expo), @tanstack/query-core 5.101.4 (solid-query rc.5).
Verification
bun run check clean; test:ci 112 pass.
Generated builds (BTS_BUILD_SAMPLES=1) full local run: 84/85; the failure was the new sample's probe path, fixed and re-run green together with the changed Mongoose sample.
New samples: workers-postgres-js, tanstack-start-self-polar (Vercel), nuxt-self-polar, svelte-self-polar, next-prisma-compute-artifact; solid-v2-express-node-mongoose now uses Better Auth.
Live checks (local, not in CI):
postgres 4.1.1 + drizzle-orm 1.0.0-rc.5 against a real Postgres.
TanStack Start (node-server) and Next (standalone) self-backend Polar apps booted: / 200, /api/auth/ok, unauthenticated checkout 401.
Next + Varlock: next dev/next start; simulated Vercel build fails without the key and boots from the frozen env with only the key; Prisma standalone boots with only the key and no .env; an invalid secret fails the build with the value redacted.
Docker: 11 stacks with docker compose up --build --wait (every Dockerfile template; Hono/Express/Fastify/Elysia on Bun and Node; npm/pnpm/bun; Postgres 18, MySQL 9.7, MongoDB 9, SQLite) all healthy, with sign-up, sign-in and session working.
Not verified: real Vercel / Prisma Compute deploys, real Polar sandbox checkout.
Summary by CodeRabbit
New Features
Added generated-build examples for self-hosted Polar payments, a Prisma-powered Next.js app, and a Cloudflare Workers todo app.
Bug Fixes
Improved Polar checkout and subscription status handling across generated app templates.
Updated generated build and deployment configurations for Prisma, Polar, Vercel, and Cloudflare setups.
Chores
Refreshed framework, tooling, and database image versions in generated projects.
Docker-based apps now run as unprivileged users.
Documentation
Updated Docker deployment guidance with current runtime and database image details.
…DK 1.x
- Bump every template dependency to its latest release (TypeScript stays on 6; Prisma 8, PlanetScale 2, tailwind-variants 4 and Babel 8 stay pinned)
- Drop the Convex better-auth 1.6.17 pin now that @convex-dev/better-auth 0.13 supports 1.7
- Use ai 7 for the Convex AI example, as @convex-dev/agent now requires
- Migrate Polar to @polar-sh/better-auth 2.x and @polar-sh/sdk 1.x; Convex stays on SDK 0.49
- Set freezeIntoBundle for Next standalone builds (varlock Next integration 2.0)
- Add workers-postgres-js and self-backend Polar build samples
The pull request updates generated dependency constraints and templates. It changes Polar checkout and subscription handling, adds Next.js Prisma environment and build support, updates Docker images and runtime users, and adds generated-build samples for additional configurations.
Changes
Template generation and deployment
Layer / File(s)
Summary
Dependency declarations and version constraints packages/template-generator/src/processors/*, packages/template-generator/src/utils/add-deps.ts, packages/template-generator/src/template-handlers/extras.ts, packages/template-generator/templates/*/package.json.hbs
Dependency processors change Convex, AI, Better Auth, and Polar declarations. The dependency map and generated manifests update package ranges across frameworks, databases, tooling, and payments.
Polar checkout and subscription handling packages/template-generator/templates/auth/better-auth/*, packages/template-generator/templates/payments/polar/*, packages/template-generator/templates/frontend/react/tanstack-start/vite.config.ts.hbs, packages/template-generator/templates/frontend/solid/vite.config.ts.hbs, packages/template-generator/templates/frontend/react/next/next.config.ts.hbs
Polar templates use snake-case checkout options and active_subscriptions. TanStack Start passes a subscription boolean through route context. Payment and build templates use the updated SDK client and Polar-specific external packages.
Next.js Prisma generation adds a random Varlock key and uses Alchemy RandomProvider. Build probes locate and launch the standalone server with an environment key. Vercel sync generates a key, and generated deployment instructions document the sync step.
Docker runtime images and users packages/template-generator/templates/deploy/docker/*, packages/template-generator/templates/db-setup/docker-compose/*, packages/template-generator/templates/deploy/docker/compose/docker-compose.yml.hbs, apps/web/content/docs/guides/docker.mdx
Docker templates update Node.js, pnpm, MySQL, and MongoDB versions. Runtime stages select unprivileged users, and the Next.js builder creates .data for the specified SQLite configuration. The guide lists runtime users and database image versions.
Samples add self-hosted Polar configurations for TanStack Start, Nuxt, and Svelte; a Next.js Prisma sample; and a Cloudflare Workers sample. The Solid Mongoose sample now enables Better Auth.
Merge Risk: Moderate · up to ac268
Generated Docker Compose projects using local SQLite can lose database write access on Linux hosts whose user is not UID 1000, and the generated README does not tell users how to fix it. The new Next artifact test can also fail spuriously in container-based environments. Address the permission setup before merging, and fix the test environment variable when convenient.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title uses the conventional commit form and names two themes: template dependency updates and Varlock/Docker changes. The changeset covers those themes, along with Polar SDK migration, Next.js Pri…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title uses the conventional commit form and names two themes: template dependency updates and Varlock/Docker changes. The changeset covers those themes, along with Polar SDK migration, Next.js Prisma Compute handling, and test updates. The title covers real parts of the change but does not name the main Polar migration or the Varlock env-key work in detail, so it is partially related and overly broad. It is not vague or misleading, so it passes.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ESLint install timed out. The project may have too many dependencies for the sandbox.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Varlock:
- Update varlock 1.25.0 and integrations (Next 2.0.1, Vite 1.5.6, Nuxt 0.1.6,
Astro 1.4.6, Cloudflare 1.6.4); the @next/env override now matches the plugin
version instead of 1.2.2.
- Next on Vercel freezes the env and needs _VARLOCK_ENV_KEY: the env sync script
sets a fresh key per environment.
- Next on Prisma Compute: Alchemy generates the key once (Alchemy.Random) and
passes it to build and runtime.
- Skip type generation on production loads (auto=not(forEnv(production))) so
servers never write src/env.ts at boot.
Docker:
- node:26-slim (current LTS), mysql:9.7 (LTS), mongo:9, pnpm 12.
- Run runtime images as the unprivileged node/bun user.
- Next with local SQLite creates .data before next build.
Mongo + Better Auth:
- Drop the direct mongodb dependency that installed a second driver next to
Mongoose's pinned one.
- Keep mongoose external in Express/Fastify server bundles so the adapter's
ObjectId checks see one driver.
Tests: add next-prisma-compute-artifact (frozen standalone boot) and run the
Mongoose sample with Better Auth.
AmanVarshney01
changed the title
chore(templates): update template dependencies and migrate Polar to SDK 1.x
chore(templates): update template dependencies, fix Varlock deploys and Docker images
Nov 13, 2026
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Set HOSTNAME for the newly supported Next standalone runtime.
Next.js 16.4 standalone reads process.env.HOSTNAME, not HOST. If the parent environment supplies a hostname that resolves to a non-loopback address, the server binds there while this probe requests 127.0.0.1. The artifact check then fails even when the artifact is valid. Override HOSTNAME in the subprocess environment. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Major · Stability & Availability · Quick win
Make the SQLite bind mount writable for the non-root web user.
The web service binds the host ./.data directory to /data when the database is SQLite with dbSetup set to none. DATABASE_URL points to file:/data/local.db. The web images now run as bun or node. If the host directory or local.db belongs to a UID other than the container user's UID, SQLite cannot write to them. The generated README runs db:push on the host but does not set ownership for the container user.
The server service mounts the same host path, so the same fix applies to both services. Solid and Svelte have the same non-root runner setup.
Add a README step after db:push that gives UID 1000 write access. The official bun and node runtime users both use UID 1000.
Suggested fix
lines.push(
"",
`Docker Compose uses the local \`./.data/local.db\` file. Run \`${packageManagerRunCmd} db:push\` before starting the stack.`,
+ "The containers run as UID 1000. Give that user write access to `./.data`, for example `sudo chown -R 1000:1000 .data`.",
);
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
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.
Summary
Updates every template dependency to its latest release and fixes the templates where the new versions changed APIs.
Version bumps
^/~ranges raised to the current latest (Clerk, oRPC, tRPC, TanStack, Next 16.4, Astro 7.4, Nuxt 4.6, SvelteKit 3.2, Hono, Elysia, Fastify, Wrangler, Turbo, Oxlint, Zod 4.6, …).@alchemy.run/*), Effect 4.1.4, Better Auth 1.7.22,@cloudflare/vite-plugin1.69.1, varlock 1.25.0 + integrations (Next 2.0.1), Nitro 3.0.261103-rc, Solid rc.21 / router next.44 / vite-plugin next.57, filesystem-routing 0.5.0, rolldown 1.3.2, vite-plus 1.6.0, oxfmt 0.78, jsdom 31.react-native0.88.1,react-native-screens~4.30.1,react-native-safe-area-context~5.11.1.postgres4.1.1 (used by Drizzle on Cloudflare Workers).Pins removed
@convex-dev/better-auth0.13 acceptsbetter-auth >=1.7.16 <1.8, so the 1.6.17 pin is gone.@convex-dev/agentnow requiresai ^7; theai ^6/@ai-sdk/google ^3override is removed.Migrations
@polar-sh/better-auth2.x /@polar-sh/sdk1.xcreatePolarCorefrom@polar-sh/sdk/2026-10.active_subscriptions); Next/Nuxt usemodels.CustomerState.success_url/return_url.ioredis,@opentelemetry/*) that are never installed; TanStack Start and Solid self-backend builds mark them external, and Next self-backend lists@polar-sh/sdkinserverExternalPackages.hasProSubscriptionthrough route context instead of the full customer state (SDK 1.x types it with non-serializable fields).@polar-sh/sdk^0.49:@convex-dev/polarimportscore.js/funcs/*, which 1.x no longer exports.freezeIntoBundle. Docker usesfalse(boots throughvarlock/auto-load), Prisma Compute usestrue(no CLI there;_VARLOCK_ENV_KEYis already forwarded).Varlock deploys
@next/envoverride pointed at@varlock/nextjs-integration@1.2.2while the plugin was 2.x; it now uses the same version._VARLOCK_ENV_KEY. The env sync script now sets a fresh key per Vercel environment.freezeIntoBundle: true): Alchemy generates the key once (Alchemy.makeRandom) and passes it to build and runtime.@generateTsTypes(..., auto=not(forEnv(production))): production servers no longer writesrc/env.tsat boot (needed for read-only, non-root images); dev andvarlock codegenstill generate it.Docker
node:26-slim(Node 26 is Active LTS since 2026-10-28),mysql:9.7(current LTS tag),mongo:9, pnpm 12, checked against nodejs.org, Docker Hub and npm.node/bunuser (Next copies.nextwith--chown)..databeforenext build(broken on main too).Mongo + Better Auth
mongodb7.9.0 shipped while Mongoose pins~7.8; the directmongodbdependency installed a second driver and broke type checks. Removed (nothing imports it).INVALID_ID).mongooseis now a server dependency, so it stays external.Still pinned (unchanged)
TypeScript 6 (TS 7 is not supported by
svelte-checkand other tooling), Prisma 7 (Prisma 8 deferred),@planetscale/database1.x (drizzle-orm#6398),tailwind-variants3 (heroui-nativepeer),@babel/core7 (Expo),@tanstack/query-core5.101.4 (solid-queryrc.5).Verification
bun run checkclean;test:ci112 pass.BTS_BUILD_SAMPLES=1) full local run: 84/85; the failure was the new sample's probe path, fixed and re-run green together with the changed Mongoose sample.workers-postgres-js,tanstack-start-self-polar(Vercel),nuxt-self-polar,svelte-self-polar,next-prisma-compute-artifact;solid-v2-express-node-mongoosenow uses Better Auth.postgres4.1.1 +drizzle-orm1.0.0-rc.5 against a real Postgres./200,/api/auth/ok, unauthenticated checkout 401.next dev/next start; simulated Vercel build fails without the key and boots from the frozen env with only the key; Prisma standalone boots with only the key and no.env; an invalid secret fails the build with the value redacted.docker compose up --build --wait(every Dockerfile template; Hono/Express/Fastify/Elysia on Bun and Node; npm/pnpm/bun; Postgres 18, MySQL 9.7, MongoDB 9, SQLite) all healthy, with sign-up, sign-in and session working.Summary by CodeRabbit