Skip to content

Commit

Permalink
feat: update to next 15
Browse files Browse the repository at this point in the history
  • Loading branch information
ronanru committed Oct 22, 2024
1 parent fe85a23 commit 57adb65
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
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
4 changes: 2 additions & 2 deletions cli/src/installers/envVars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion cli/template/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 57adb65

Please sign in to comment.