Skip to content

chore(templates): update template dependencies, fix Varlock deploys and Docker images - #1304

Merged
AmanVarshney01 merged 2 commits into
mainfrom
chore/update-template-deps-nov
Nov 14, 2026
Merged

AmanVarshney01 merged 2 commits into
mainfrom
chore/update-template-deps-nov

Conversation

@AmanVarshney01

@AmanVarshney01 AmanVarshney01 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Updates every template dependency to its latest release and fixes the templates where the new versions changed APIs.

Version bumps

  • All ^/~ 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, …).
  • Exact pins: Alchemy beta.86 (+ @alchemy.run/*), Effect 4.1.4, Better Auth 1.7.22, @cloudflare/vite-plugin 1.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.
  • Expo SDK 58.0.24 expected versions: react-native 0.88.1, react-native-screens ~4.30.1, react-native-safe-area-context ~5.11.1.
  • postgres 4.1.1 (used by Drizzle on Cloudflare Workers).

Pins removed

  • Convex + Better Auth: @convex-dev/better-auth 0.13 accepts better-auth >=1.7.16 <1.8, so the 1.6.17 pin is gone.
  • Convex AI example: @convex-dev/agent now requires ai ^7; the ai ^6 / @ai-sdk/google ^3 override is removed.

Migrations

  • Polar → @polar-sh/better-auth 2.x / @polar-sh/sdk 1.x
    • 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
@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
create-better-t-stack-web Ready Ready Preview Nov 13, 2026 1:20pm UTC

Request Review

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-12T15:34:35.620856Z
We couldn’t complete this review. Comment @codex review to try again.
546f6fe PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

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 environment and artifact handling
packages/template-generator/src/generators/alchemy/*, packages/template-generator/src/processors/{env-deps,readme-generator,varlock}.ts, packages/template-generator/templates/deploy/vercel/scripts/sync-vercel-env.ts.hbs, apps/cli/test/generated-builds.test.ts, apps/cli/test/generated-builds/probes.ts
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.
Generated build samples
apps/cli/test/generated-builds/samples.ts
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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed 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.

Share

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 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e409a1e5-68b8-48e3-b68e-65f1489e6de1
Commits

Reviewing files that changed from the base of the PR and between 546f6fe and ac26800.

Files ignored due to path filters: 1

  • packages/template-generator/src/templates.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 24

  • apps/cli/test/generated-builds.test.ts
  • apps/cli/test/generated-builds/probes.ts
  • apps/cli/test/generated-builds/samples.ts
  • apps/web/content/docs/guides/docker.mdx
  • packages/template-generator/src/generators/alchemy/env.ts
  • packages/template-generator/src/generators/alchemy/render.ts
  • packages/template-generator/src/processors/auth-deps.ts
  • packages/template-generator/src/processors/env-deps.ts
  • packages/template-generator/src/processors/readme-generator.ts
  • packages/template-generator/src/processors/varlock.ts
  • packages/template-generator/src/utils/add-deps.ts
  • packages/template-generator/templates/db-setup/docker-compose/mongodb/docker-compose.yml.hbs
  • packages/template-generator/templates/db-setup/docker-compose/mysql/docker-compose.yml.hbs
  • packages/template-generator/templates/deploy/docker/compose/docker-compose.yml.hbs
  • packages/template-generator/templates/deploy/docker/server/Dockerfile.hbs
  • packages/template-generator/templates/deploy/docker/web/astro/Dockerfile.hbs
  • packages/template-generator/templates/deploy/docker/web/nuxt/Dockerfile.hbs
  • packages/template-generator/templates/deploy/docker/web/react/next/Dockerfile.hbs
  • packages/template-generator/templates/deploy/docker/web/react/react-router/Dockerfile.hbs
  • packages/template-generator/templates/deploy/docker/web/react/tanstack-router/Dockerfile.hbs
  • packages/template-generator/templates/deploy/docker/web/react/tanstack-start/Dockerfile.hbs
  • packages/template-generator/templates/deploy/docker/web/solid/Dockerfile.hbs
  • packages/template-generator/templates/deploy/docker/web/svelte/Dockerfile.hbs
  • packages/template-generator/templates/deploy/vercel/scripts/sync-vercel-env.ts.hbs
Files with no reviewable changes: 1

  • packages/template-generator/src/processors/auth-deps.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@@ -398,6 +428,7 @@ export async function bootAndValidatePrismaWebArtifact(
HOST: "127.0.0.1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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)

Proposed fix

--- "a/apps/cli/test/generated-builds/probes.ts"
+++ "b/apps/cli/test/generated-builds/probes.ts"
@@ -425,7 +425,8 @@
         reject: false,
         env: {
           ...process.env,
           HOST: "127.0.0.1",
+          HOSTNAME: "127.0.0.1",
           NODE_ENV: "production",
           PORT: String(port),
           _VARLOCK_ENV_KEY: prismaNextEnvKey(sample),
Committable suggestion

IMPORTANT
Review the replacement and indentation, then test before committing.

Suggested change
HOST: "127.0.0.1",
HOST: "127.0.0.1",
HOSTNAME: "127.0.0.1",

Comment on lines +58 to +60
USER bun
{{else}}
USER node

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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`.",
       );

@AmanVarshney01
AmanVarshney01 merged commit 9710754 into main Nov 14, 2026
12 checks passed
@AmanVarshney01
AmanVarshney01 deleted the chore/update-template-deps-nov branch November 14, 2026 11:30

This branch was successfully deployed

1 active deployment
Preview — ac268008 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant