Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fae33f4
feat: prisma v7
HimanshuKumarDutt094 Nov 23, 2025
abcda50
feat: prisma v7 fix
HimanshuKumarDutt094 Nov 23, 2025
66e55c8
fix: postinstall for prisma generate
HimanshuKumarDutt094 Nov 23, 2025
f4a3768
fix: remove driver adapter
HimanshuKumarDutt094 Nov 23, 2025
40564c9
bump:better-auth 1.4, fix: drizzle better-auth db schemas
HimanshuKumarDutt094 Nov 22, 2025
46a5c4a
update eslint config
HimanshuKumarDutt094 Nov 15, 2025
1f0e046
bump: astro ,run format and lint fix
HimanshuKumarDutt094 Nov 15, 2025
0cd88f7
fix: add type submit, upgrade env,next config to ts,upgrade zod to v4
HimanshuKumarDutt094 Nov 15, 2025
bafed8c
bump react to 19.2
HimanshuKumarDutt094 Nov 8, 2025
48d41ef
fix: use BETTER_AUTH_URL
HimanshuKumarDutt094 Nov 27, 2025
3807d72
update prisma in package json
HimanshuKumarDutt094 Nov 27, 2025
79e919c
chore: changeset + format + lint + button type for build
HimanshuKumarDutt094 Nov 27, 2025
424e4e1
version bumps wip
HimanshuKumarDutt094 Nov 8, 2025
b330869
cherry pick v16 upgrade
HimanshuKumarDutt094 Nov 27, 2025
550d4a8
lint format fix + prcess env update ,classname update
HimanshuKumarDutt094 Nov 27, 2025
997ef33
format fix
HimanshuKumarDutt094 Nov 27, 2025
8f18fc7
update types/node , fix astro png buffer
HimanshuKumarDutt094 Nov 27, 2025
edaba8f
bump prisma to 7.0.1 for bug fixes in studio
HimanshuKumarDutt094 Nov 27, 2025
42a183a
Merge branch 'main' into feat/next16-clean
HimanshuKumarDutt094 Nov 28, 2025
e2755d2
revert: vercel env preset
HimanshuKumarDutt094 Nov 28, 2025
7ae168f
revert: use implicit table name for better-auth(snake_case for db cam…
HimanshuKumarDutt094 Nov 28, 2025
ce32fc1
changeset update
HimanshuKumarDutt094 Nov 28, 2025
e989347
fix: make getBaseUrl vendor agnostic
HimanshuKumarDutt094 Nov 28, 2025
f3c5a9d
quote undefined check
HimanshuKumarDutt094 Nov 28, 2025
edc040e
use ?? instead of ||
HimanshuKumarDutt094 Nov 28, 2025
927ddab
fix: prisma sqlite need better-sqlite3 as a dependency
HimanshuKumarDutt094 Dec 2, 2025
9a723e1
chore: format
HimanshuKumarDutt094 Dec 2, 2025
0d00ab4
urgent: bump react 19.2.1 for cve dix
HimanshuKumarDutt094 Dec 5, 2025
90b8e90
chore: remvoe --turbopack as its default
HimanshuKumarDutt094 Dec 5, 2025
6519240
Merge branch 'main' into feat/next16-clean
HimanshuKumarDutt094 Dec 5, 2025
5dbe761
bump next to 16.0.7
HimanshuKumarDutt094 Dec 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clear-rice-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": minor
---

feat prisma v7
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"updateInternalDependencies": "patch",
"ignore": ["@ct3a/www"],
"changedFilePatterns": ["src/**", "template/**"]
}
}
5 changes: 5 additions & 0 deletions .changeset/good-sites-stick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": minor
---

feat: better-auth 1.4
5 changes: 5 additions & 0 deletions .changeset/young-donuts-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": minor
---

feat: Next.js v16
1 change: 0 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@
This release adds a new option to use [`drizzle-orm`](https://orm.drizzle.team/docs/overview) as an alternative to Prisma.

To make the different ORM options as similar as possible, some minor changes has also been made to the Prisma installer:

- a new script `db:push` has been added and is included in both ORM options.
- the prisma client has been renamed to `db` in the trpc context - you now access your database client like
```ts
Expand Down
26 changes: 13 additions & 13 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,35 +66,35 @@
"@auth/prisma-adapter": "^1.6.0",
"@libsql/client": "^0.14.0",
"@planetscale/database": "^1.19.0",
"@prisma/adapter-planetscale": "^6.6.0",
"@prisma/client": "^6.6.0",
"@t3-oss/env-nextjs": "^0.12.0",
"@tailwindcss/postcss": "^4.0.15",
"@prisma/adapter-planetscale": "^7.0.1",
"@prisma/client": "^7.0.1",
"@t3-oss/env-nextjs": "^0.13.8",
"@tailwindcss/postcss": "^4.1.16",
"@tanstack/react-query": "^5.69.0",
"@trpc/client": "11.0.0",
"@trpc/next": "11.0.0",
"@trpc/react-query": "11.0.0",
"@trpc/server": "11.0.0",
"@types/fs-extra": "^11.0.4",
"@types/gradient-string": "^1.1.6",
"@types/node": "^24.10.1",
"better-auth": "^1.3",
"@types/node": "^22.19.1",
"better-auth": "^1.4.0",
"drizzle-kit": "^0.30.5",
"drizzle-orm": "^0.41.0",
"mysql2": "^3.11.0",
"next": "^15.5.6",
"next-auth": "^4.24.7",
"next": "^16.0.7",
"next-auth": "^4.24.13",
"postgres": "^3.4.4",
"prettier": "^3.5.3",
"prettier-plugin-tailwindcss": "^0.6.11",
"prisma": "^6.6.0",
"react": "^19.1.2",
"react-dom": "^19.1.2",
"prisma": "^7.0.1",
"react": "^19.2.1",
"react-dom": "^19.2.1",
"superjson": "^2.2.1",
"tailwindcss": "^4.0.15",
"tailwindcss": "^4.1.16",
"tsup": "^6.7.0",
"type-fest": "^3.13.1",
"typescript": "^5.8.2",
"zod": "^3.24.2"
"zod": "^4.1.12"
}
}
4 changes: 2 additions & 2 deletions cli/src/helpers/createProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export const createProject = async ({
if (appRouter) {
// Replace next.config
fs.copyFileSync(
path.join(PKG_ROOT, "template/extras/config/next-config-appdir.js"),
path.join(projectDir, "next.config.js")
path.join(PKG_ROOT, "template/extras/config/next-config-appdir.ts"),
path.join(projectDir, "next.config.ts")
);

selectLayoutFile({ projectDir, packages });
Expand Down
5 changes: 4 additions & 1 deletion cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ const main = async () => {

if (usePackages.prisma.inUse) {
logger.info("Generating Prisma client...");
await execa("npx", ["prisma", "generate"], { cwd: projectDir });
await execa(pkgManager, ["run", "with-env", "prisma", "generate"], {
cwd: projectDir,
env: { SKIP_ENV_VALIDATION: "1" },
});
logger.info("Successfully generated Prisma client!");
}

Expand Down
24 changes: 16 additions & 8 deletions cli/src/installers/dependencyVersionMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@ export const dependencyVersionMap = {
"@auth/drizzle-adapter": "^1.7.2",

// Better-Auth
"better-auth": "^1.3",
"better-auth": "^1.4.0",

// Prisma
prisma: "^6.6.0",
"@prisma/client": "^6.6.0",
"@prisma/adapter-planetscale": "^6.6.0",
prisma: "^7.0.1",
"@prisma/client": "^7.0.1",
"@prisma/adapter-planetscale": "^7.0.1",
"@prisma/adapter-pg": "^7.0.1",
"@prisma/adapter-mariadb": "^7.0.1",
"@prisma/adapter-better-sqlite3": "^7.0.1",
"better-sqlite3": "12.5.0",
pg: "^8.13.1",
"@types/pg": "^8.11.10",
"@types/better-sqlite3": "^7.6.11",
"@types/node": "^22.19.1",
"dotenv-cli": "^8.0.0",

// Drizzle
"drizzle-kit": "^0.30.5",
Expand All @@ -25,9 +34,8 @@ export const dependencyVersionMap = {
"@libsql/client": "^0.14.0",

// TailwindCSS
tailwindcss: "^4.0.15",
postcss: "^8.5.3",
"@tailwindcss/postcss": "^4.0.15",
tailwindcss: "^4.1.16",
"@tailwindcss/postcss": "^4.1.16",

// tRPC
"@trpc/client": "^11.0.0",
Expand All @@ -46,7 +54,7 @@ export const dependencyVersionMap = {
"@eslint/eslintrc": "^3.3.1",
"prettier-plugin-tailwindcss": "^0.6.11",
eslint: "^9.23.0",
"eslint-config-next": "^15.2.3",
"eslint-config-next": "^16.0.0",
"eslint-plugin-drizzle": "^0.2.3",
"typescript-eslint": "^8.27.0",
} as const;
Expand Down
10 changes: 8 additions & 2 deletions cli/src/installers/envVars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const envVariablesInstaller: Installer = ({
"template/extras/src/env",
envFile
);
const envSchemaDest = path.join(projectDir, "src/env.js");
const envSchemaDest = path.join(projectDir, "src/env.ts");
fs.copyFileSync(envSchemaSrc, envSchemaDest);
}

Expand Down Expand Up @@ -86,7 +86,7 @@ const getEnvContent = (
scopedAppName: string
) => {
let content = `
# When adding additional environment variables, the schema in "/src/env.js"
# When adding additional environment variables, the schema in "/src/env.ts"
# should be updated accordingly.
`
.trim()
Expand All @@ -103,6 +103,10 @@ AUTH_SECRET=""
# Next Auth Discord Provider
AUTH_DISCORD_ID=""
AUTH_DISCORD_SECRET=""

# Production App URL in case its custom (see react.tsx / api.ts)
APP_URL="http://localhost:3000"

`;

if (usingBetterAuth)
Expand All @@ -114,6 +118,8 @@ BETTER_AUTH_SECRET=""
# Better Auth GitHub OAuth
BETTER_AUTH_GITHUB_CLIENT_ID=""
BETTER_AUTH_GITHUB_CLIENT_SECRET=""
BETTER_AUTH_URL="http://localhost:3000" # Production App URL in case its custom (see react.tsx / api.ts)

`;

if (usingPrisma)
Expand Down
6 changes: 3 additions & 3 deletions cli/src/installers/eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export const dynamicEslintInstaller: Installer = ({ projectDir, packages }) => {
addPackageScript({
projectDir,
scripts: {
lint: "next lint",
"lint:fix": "next lint --fix",
check: "next lint && tsc --noEmit",
lint: "eslint .",
"lint:fix": "eslint --fix .",
check: "eslint . && tsc --noEmit",
"format:write": 'prettier --write "**/*.{ts,tsx,js,jsx,mdx}" --cache',
"format:check": 'prettier --check "**/*.{ts,tsx,js,jsx,mdx}" --cache',
},
Expand Down
96 changes: 82 additions & 14 deletions cli/src/installers/prisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,47 @@ import path from "path";
import fs from "fs-extra";

import { PKG_ROOT } from "~/consts.js";
import { type Installer } from "~/installers/index.js";
import { type AvailableDependencies } from "~/installers/dependencyVersionMap.js";
import { type DatabaseProvider, type Installer } from "~/installers/index.js";
import { addPackageDependency } from "~/utils/addPackageDependency.js";
import { addPackageScript } from "~/utils/addPackageScript.js";

// Provider-specific dependency map
interface ProviderDependencies {
adapter: AvailableDependencies;
driver?: AvailableDependencies;
types: AvailableDependencies[];
}

const providerDependencyMap: Record<DatabaseProvider, ProviderDependencies> = {
postgres: {
adapter: "@prisma/adapter-pg",
driver: "pg",
types: ["@types/pg"],
},
mysql: {
adapter: "@prisma/adapter-mariadb",
types: ["@types/node"],
},
sqlite: {
adapter: "@prisma/adapter-better-sqlite3",
driver: "better-sqlite3",
types: ["@types/better-sqlite3"],
},
planetscale: {
adapter: "@prisma/adapter-planetscale",
driver: "@planetscale/database",
types: ["@types/node"],
},
};

export const prismaInstaller: Installer = ({
projectDir,
packages,
pkgManager,
databaseProvider,
}) => {
// Install base Prisma v7 packages
addPackageDependency({
projectDir,
dependencies: ["prisma"],
Expand All @@ -21,15 +53,47 @@ export const prismaInstaller: Installer = ({
dependencies: ["@prisma/client"],
devMode: false,
});
if (databaseProvider === "planetscale")

// Install dotenv-cli as dev dependency
addPackageDependency({
projectDir,
dependencies: ["dotenv-cli"],
devMode: true,
});

// Get provider-specific dependencies
const providerDeps = providerDependencyMap[databaseProvider];

// Install provider-specific adapter package
addPackageDependency({
projectDir,
dependencies: [providerDeps.adapter],
devMode: false,
});

// Install provider-specific driver package (if required)
if (providerDeps.driver) {
addPackageDependency({
projectDir,
dependencies: ["@prisma/adapter-planetscale", "@planetscale/database"],
dependencies: [providerDeps.driver],
devMode: false,
});
}

// Install provider-specific TypeScript types
addPackageDependency({
projectDir,
dependencies: providerDeps.types,
devMode: true,
});

const extrasDir = path.join(PKG_ROOT, "template/extras");

// Copy universal prisma.config.ts to project root
const prismaConfigSrc = path.join(extrasDir, "config/prisma.config.ts");
const prismaConfigDest = path.join(projectDir, "prisma.config.ts");
fs.copySync(prismaConfigSrc, prismaConfigDest);

const schemaBaseName = packages?.betterAuth.inUse
? "with-better-auth"
: packages?.nextAuth.inUse
Expand Down Expand Up @@ -62,22 +126,26 @@ export const prismaInstaller: Installer = ({
fs.mkdirSync(path.dirname(schemaDest), { recursive: true });
fs.writeFileSync(schemaDest, schemaText);

const clientSrc = path.join(
extrasDir,
databaseProvider === "planetscale"
? "src/server/db/db-prisma-planetscale.ts"
: "src/server/db/db-prisma.ts"
);
// Select and copy correct db client template based on provider
const dbClientTemplateMap: Record<DatabaseProvider, string> = {
postgres: "src/server/db/db-prisma-postgres.ts",
mysql: "src/server/db/db-prisma-mysql.ts",
sqlite: "src/server/db/db-prisma-sqlite.ts",
planetscale: "src/server/db/db-prisma-planetscale.ts",
};

const clientSrc = path.join(extrasDir, dbClientTemplateMap[databaseProvider]);
const clientDest = path.join(projectDir, "src/server/db.ts");

addPackageScript({
projectDir,
scripts: {
postinstall: "prisma generate",
"db:push": "prisma db push",
"db:studio": "prisma studio",
"db:generate": "prisma migrate dev",
"db:migrate": "prisma migrate deploy",
"with-env": "dotenv -e .env --",
postinstall: `${pkgManager} run with-env prisma generate`,
"db:push": `${pkgManager} run with-env prisma db push`,
"db:studio": `${pkgManager} run with-env prisma studio`,
"db:generate": `${pkgManager} run with-env prisma migrate dev`,
"db:migrate": `${pkgManager} run with-env prisma migrate deploy`,
},
});

Expand Down
2 changes: 1 addition & 1 deletion cli/src/installers/tailwind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { addPackageDependency } from "~/utils/addPackageDependency.js";
export const tailwindInstaller: Installer = ({ projectDir }) => {
addPackageDependency({
projectDir,
dependencies: ["tailwindcss", "postcss", "@tailwindcss/postcss"],
dependencies: ["tailwindcss", "@tailwindcss/postcss"],
devMode: true,
});

Expand Down
14 changes: 13 additions & 1 deletion cli/src/installers/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ export const trpcInstaller: Installer = ({
}

copySrcDest.forEach(([src, dest]) => {
fs.copySync(src, dest);
if (
usingBetterAuth &&
(src.endsWith("utils/api.ts") || src.endsWith("trpc/react.tsx"))
) {
const content = fs.readFileSync(src, "utf-8");
const newContent = content.replace(
/process\.env\.APP_URL/g,
"process.env.BETTER_AUTH_URL"
);
fs.outputFileSync(dest, newContent);
} else {
fs.copySync(src, dest);
}
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
import "./src/env.js";
import { type NextConfig } from "next";

/** @type {import("next").NextConfig} */
const config = {
import "./src/env";

const config: NextConfig = {
reactStrictMode: true,

/**
Expand Down
Loading
Loading