Skip to content

Commit 6e1cc2d

Browse files
feat(cli): Upgrade to Next 16
1 parent 46b928a commit 6e1cc2d

File tree

7 files changed

+42
-37
lines changed

7 files changed

+42
-37
lines changed

apps/cli/src/constants.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export function getDefaultConfig() {
4040
export const DEFAULT_CONFIG = getDefaultConfig();
4141

4242
export const dependencyVersionMap = {
43-
"better-auth": "^1.3.13",
44-
"@better-auth/expo": "^1.3.13",
43+
"better-auth": "^1.3.28",
44+
"@better-auth/expo": "^1.3.28",
4545

4646
"@clerk/nextjs": "^6.31.5",
4747
"@clerk/clerk-react": "^5.45.0",
@@ -116,11 +116,11 @@ export const dependencyVersionMap = {
116116
streamdown: "^1.3.0",
117117
shiki: "^3.12.2",
118118

119-
"@orpc/server": "^1.9.0",
120-
"@orpc/client": "^1.9.0",
121-
"@orpc/openapi": "^1.9.0",
122-
"@orpc/zod": "^1.9.0",
123-
"@orpc/tanstack-query": "^1.9.0",
119+
"@orpc/server": "^1.10.0",
120+
"@orpc/client": "^1.10.0",
121+
"@orpc/openapi": "^1.10.0",
122+
"@orpc/zod": "^1.10.0",
123+
"@orpc/tanstack-query": "^1.10.0",
124124

125125
"@trpc/tanstack-react-query": "^11.5.0",
126126
"@trpc/server": "^11.5.0",

apps/cli/templates/addons/ruler/.ruler/ruler.toml.hbs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ url = "https://mcp.chonkie.ai/better-auth/better-auth-builder/mcp"
6868
url = "https://ui.nuxt.com/mcp"
6969
{{/if}}
7070

71+
{{#if (includes frontend "next")}}
72+
[mcp_servers.next-devtools]
73+
command = "npx"
74+
args = ["-y", "next-devtools-mcp@latest"]
75+
{{/if}}
76+
7177
# --- Global .gitignore Configuration ---
7278
[gitignore]
7379
# Enable/disable automatic .gitignore updates (default: true)

apps/cli/templates/auth/better-auth/server/base/src/index.ts.hbs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{{#if (eq orm "prisma")}}
2-
import { betterAuth } from "better-auth";
2+
import { betterAuth, type BetterAuthOptions } from "better-auth";
33
import { prismaAdapter } from "better-auth/adapters/prisma";
44
{{#if (eq payments "polar")}}
55
import { polar, checkout, portal } from "@polar-sh/better-auth";
66
import { polarClient } from "./lib/payments";
77
{{/if}}
88
import prisma from "@{{projectName}}/db";
99

10-
export const auth = betterAuth({
10+
export const auth = betterAuth<BetterAuthOptions>({
1111
database: prismaAdapter(prisma, {
12-
{{#if (eq database "postgres")}}provider: "postgresql"{{/if}}
13-
{{#if (eq database "sqlite")}}provider: "sqlite"{{/if}}
14-
{{#if (eq database "mysql")}}provider: "mysql"{{/if}}
15-
{{#if (eq database "mongodb")}}provider: "mongodb"{{/if}}
12+
{{#if (eq database "postgres")}}provider: "postgresql",{{/if}}
13+
{{#if (eq database "sqlite")}}provider: "sqlite",{{/if}}
14+
{{#if (eq database "mysql")}}provider: "mysql",{{/if}}
15+
{{#if (eq database "mongodb")}}provider: "mongodb",{{/if}}
1616
}),
1717
trustedOrigins: [
1818
process.env.CORS_ORIGIN || "",
@@ -59,7 +59,7 @@ export const auth = betterAuth({
5959

6060
{{#if (eq orm "drizzle")}}
6161
{{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
62-
import { betterAuth } from "better-auth";
62+
import { betterAuth, type BetterAuthOptions } from "better-auth";
6363
import { drizzleAdapter } from "better-auth/adapters/drizzle";
6464
{{#if (eq payments "polar")}}
6565
import { polar, checkout, portal } from "@polar-sh/better-auth";
@@ -68,7 +68,7 @@ import { polarClient } from "./lib/payments";
6868
import { db } from "@{{projectName}}/db";
6969
import * as schema from "@{{projectName}}/db/schema/auth";
7070

71-
export const auth = betterAuth({
71+
export const auth = betterAuth<BetterAuthOptions>({
7272
database: drizzleAdapter(db, {
7373
{{#if (eq database "postgres")}}provider: "pg",{{/if}}
7474
{{#if (eq database "sqlite")}}provider: "sqlite",{{/if}}
@@ -119,7 +119,7 @@ export const auth = betterAuth({
119119
{{/if}}
120120

121121
{{#if (eq runtime "workers")}}
122-
import { betterAuth } from "better-auth";
122+
import { betterAuth, type BetterAuthOptions } from "better-auth";
123123
import { drizzleAdapter } from "better-auth/adapters/drizzle";
124124
{{#if (eq payments "polar")}}
125125
import { polar, checkout, portal } from "@polar-sh/better-auth";
@@ -129,7 +129,7 @@ import { db } from "@{{projectName}}/db";
129129
import * as schema from "@{{projectName}}/db/schema/auth";
130130
import { env } from "cloudflare:workers";
131131

132-
export const auth = betterAuth({
132+
export const auth = betterAuth<BetterAuthOptions>({
133133
database: drizzleAdapter(db, {
134134
{{#if (eq database "postgres")}}provider: "pg",{{/if}}
135135
{{#if (eq database "sqlite")}}provider: "sqlite",{{/if}}
@@ -190,19 +190,19 @@ export const auth = betterAuth({
190190
],
191191
{{/if}}
192192
});
193-
{{/if}}
193+
{{/if}}
194194
{{/if}}
195195

196196
{{#if (eq orm "mongoose")}}
197-
import { betterAuth } from "better-auth";
197+
import { betterAuth, type BetterAuthOptions } from "better-auth";
198198
import { mongodbAdapter } from "better-auth/adapters/mongodb";
199199
{{#if (eq payments "polar")}}
200200
import { polar, checkout, portal } from "@polar-sh/better-auth";
201201
import { polarClient } from "./lib/payments";
202202
{{/if}}
203203
import { client } from "@{{projectName}}/db";
204204

205-
export const auth = betterAuth({
205+
export const auth = betterAuth<BetterAuthOptions>({
206206
database: mongodbAdapter(client),
207207
trustedOrigins: [
208208
process.env.CORS_ORIGIN || "",
@@ -248,13 +248,13 @@ export const auth = betterAuth({
248248
{{/if}}
249249

250250
{{#if (eq orm "none")}}
251-
import { betterAuth } from "better-auth";
251+
import { betterAuth, type BetterAuthOptions } from "better-auth";
252252
{{#if (eq payments "polar")}}
253253
import { polar, checkout, portal } from "@polar-sh/better-auth";
254254
import { polarClient } from "./lib/payments";
255255
{{/if}}
256256

257-
export const auth = betterAuth({
257+
export const auth = betterAuth<BetterAuthOptions>({
258258
database: "", // Invalid configuration
259259
trustedOrigins: [
260260
process.env.CORS_ORIGIN || "",
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
import type { auth } from "@{{projectName}}/auth";
12
import { createAuthClient } from "better-auth/react";
2-
{{#if (eq payments "polar")}}
3-
import { polarClient } from "@polar-sh/better-auth";
4-
{{/if}}
3+
import { inferAdditionalFields } from "better-auth/client/plugins";
54

65
export const authClient = createAuthClient({
76
{{#unless (eq backend "self")}}
@@ -12,7 +11,5 @@ export const authClient = createAuthClient({
1211
import.meta.env.VITE_SERVER_URL,
1312
{{/if}}
1413
{{/unless}}
15-
{{#if (eq payments "polar")}}
16-
plugins: [polarClient()]
17-
{{/if}}
14+
plugins: [inferAdditionalFields<typeof auth>()],
1815
});

apps/cli/templates/examples/ai/web/react/next/src/app/ai/page.tsx.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function AIPage() {
3131
const [input, setInput] = useState("");
3232
const { messages, sendMessage } = useChat({
3333
transport: new DefaultChatTransport({
34-
api: `${process.env.NEXT_PUBLIC_SERVER_URL}/ai`,
34+
api: {{#if (eq backend "self")}}"/api/ai"{{else}}`${process.env.NEXT_PUBLIC_SERVER_URL}/ai`{{/if}},
3535
}),
3636
});
3737

apps/cli/templates/frontend/react/next/next.config.ts.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { NextConfig } from "next";
55

66
const nextConfig: NextConfig = {
77
typedRoutes: true,
8+
reactCompiler: true,
89
{{#if (includes examples "ai")}}
910
transpilePackages: ["shiki"],
1011
{{/if}}

apps/cli/templates/frontend/react/next/package.json.hbs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev --turbopack --port=3001",
6+
"dev": "next dev --port=3001",
77
"build": "next build",
88
"start": "next start"
99
},
@@ -12,21 +12,22 @@
1212
"@tanstack/react-form": "^1.12.3",
1313
"class-variance-authority": "^0.7.1",
1414
"clsx": "^2.1.1",
15-
"lucide-react": "^0.487.0",
16-
"next": "15.5.4",
15+
"lucide-react": "^0.546.0",
16+
"next": "16.0.0",
1717
"next-themes": "^0.4.6",
18-
"react": "19.1.0",
19-
"react-dom": "19.1.0",
18+
"react": "19.2.0",
19+
"react-dom": "19.2.0",
2020
"sonner": "^2.0.5",
2121
"tailwind-merge": "^3.3.1",
2222
"tw-animate-css": "^1.3.4",
23-
"zod": "^4.0.2"
23+
"zod": "^4.1.12",
24+
"babel-plugin-react-compiler": "^1.0.0"
2425
},
2526
"devDependencies": {
2627
"@tailwindcss/postcss": "^4.1.10",
2728
"@types/node": "^20",
28-
"@types/react": "~19.1.10",
29-
"@types/react-dom": "^19",
29+
"@types/react": "19.2.2",
30+
"@types/react-dom": "19.2.2",
3031
"tailwindcss": "^4.1.10",
3132
"typescript": "^5"
3233
}

0 commit comments

Comments
 (0)