diff --git a/cli/src/helpers/createProject.ts b/cli/src/helpers/createProject.ts index 81b385485f..92aa6ed49e 100644 --- a/cli/src/helpers/createProject.ts +++ b/cli/src/helpers/createProject.ts @@ -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 }); diff --git a/cli/src/installers/envVars.ts b/cli/src/installers/envVars.ts index a7377ccf6e..281ea7e331 100644 --- a/cli/src/installers/envVars.ts +++ b/cli/src/installers/envVars.ts @@ -44,7 +44,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); } @@ -63,7 +63,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() diff --git a/cli/template/base/next.config.js b/cli/template/base/next.config.ts similarity index 55% rename from cli/template/base/next.config.js rename to cli/template/base/next.config.ts index 98b6f90a51..a3c840a8ca 100644 --- a/cli/template/base/next.config.js +++ b/cli/template/base/next.config.ts @@ -1,23 +1,18 @@ +import { type NextConfig } from "next"; + /** * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful * for Docker builds. */ -await import("./src/env.js"); +import "./src/env"; -/** @type {import("next").NextConfig} */ const config = { reactStrictMode: true, - - /** - * If you are using `appDir` then you must comment the below `i18n` config out. - * - * @see https://github.com/vercel/next.js/issues/41980 - */ i18n: { locales: ["en"], defaultLocale: "en", }, transpilePackages: ["geist"], -}; +} satisfies NextConfig; export default config; diff --git a/cli/template/base/package.json b/cli/template/base/package.json index fff75519f8..85dab873ef 100644 --- a/cli/template/base/package.json +++ b/cli/template/base/package.json @@ -16,7 +16,7 @@ "dependencies": { "@t3-oss/env-nextjs": "^0.10.1", "geist": "^1.3.0", - "next": "^14.2.4", + "next": "^15.0.0", "react": "^18.3.1", "react-dom": "^18.3.1", "zod": "^3.23.3" diff --git a/cli/template/base/src/env.js b/cli/template/base/src/env.ts similarity index 100% rename from cli/template/base/src/env.js rename to cli/template/base/src/env.ts diff --git a/cli/template/extras/config/next-config-appdir.js b/cli/template/extras/config/next-config-appdir.ts similarity index 60% rename from cli/template/extras/config/next-config-appdir.js rename to cli/template/extras/config/next-config-appdir.ts index 9bfe4a0e2a..812e25a83f 100644 --- a/cli/template/extras/config/next-config-appdir.js +++ b/cli/template/extras/config/next-config-appdir.ts @@ -1,10 +1,11 @@ +import { type NextConfig } from "next"; + /** * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful * for Docker builds. */ -await import("./src/env.js"); +import "./src/env"; -/** @type {import("next").NextConfig} */ -const config = {}; +const config = {} satisfies NextConfig; export default config;