Skip to content

Commit ab0790e

Browse files
authored
fix: fix type of serverEnv and clientEnv (#1131)
1 parent f367b20 commit ab0790e

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

Diff for: .changeset/quiet-carrots-push.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-t3-app": patch
3+
---
4+
5+
fix: fix types of serverEnv and clientEnv

Diff for: cli/template/base/src/env/schema.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const serverSchema = z.object({
1212
/**
1313
* You can't destruct `process.env` as a regular object in the Next.js
1414
* middleware, so you have to do it manually here.
15-
* @type {{ [k in keyof z.infer<typeof serverSchema>]: z.infer<typeof serverSchema>[k] | undefined }}
15+
* @type {{ [k in keyof z.input<typeof serverSchema>]: string | undefined }}
1616
*/
1717
export const serverEnv = {
1818
NODE_ENV: process.env.NODE_ENV,
@@ -31,7 +31,7 @@ export const clientSchema = z.object({
3131
* You can't destruct `process.env` as a regular object, so you have to do
3232
* it manually here. This is because Next.js evaluates this at build time,
3333
* and only used environment variables are included in the build.
34-
* @type {{ [k in keyof z.infer<typeof clientSchema>]: z.infer<typeof clientSchema>[k] | undefined }}
34+
* @type {{ [k in keyof z.input<typeof clientSchema>]: string | undefined }}
3535
*/
3636
export const clientEnv = {
3737
// NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,

Diff for: cli/template/extras/src/env/schema/with-auth-prisma.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const serverSchema = z.object({
2626
/**
2727
* You can't destruct `process.env` as a regular object in the Next.js
2828
* middleware, so you have to do it manually here.
29-
* @type {{ [k in keyof z.infer<typeof serverSchema>]: z.infer<typeof serverSchema>[k] | undefined }}
29+
* @type {{ [k in keyof z.input<typeof serverSchema>]: string | undefined }}
3030
*/
3131
export const serverEnv = {
3232
DATABASE_URL: process.env.DATABASE_URL,
@@ -50,7 +50,7 @@ export const clientSchema = z.object({
5050
* You can't destruct `process.env` as a regular object, so you have to do
5151
* it manually here. This is because Next.js evaluates this at build time,
5252
* and only used environment variables are included in the build.
53-
* @type {{ [k in keyof z.infer<typeof clientSchema>]: z.infer<typeof clientSchema>[k] | undefined }}
53+
* @type {{ [k in keyof z.input<typeof clientSchema>]: string | undefined }}
5454
*/
5555
export const clientEnv = {
5656
// NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,

Diff for: cli/template/extras/src/env/schema/with-auth.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const serverSchema = z.object({
2525
/**
2626
* You can't destruct `process.env` as a regular object in the Next.js
2727
* middleware, so you have to do it manually here.
28-
* @type {{ [k in keyof z.infer<typeof serverSchema>]: z.infer<typeof serverSchema>[k] | undefined }}
28+
* @type {{ [k in keyof z.input<typeof serverSchema>]: string | undefined }}
2929
*/
3030
export const serverEnv = {
3131
NODE_ENV: process.env.NODE_ENV,
@@ -48,7 +48,7 @@ export const clientSchema = z.object({
4848
* You can't destruct `process.env` as a regular object, so you have to do
4949
* it manually here. This is because Next.js evaluates this at build time,
5050
* and only used environment variables are included in the build.
51-
* @type {{ [k in keyof z.infer<typeof clientSchema>]: z.infer<typeof clientSchema>[k] | undefined }}
51+
* @type {{ [k in keyof z.input<typeof clientSchema>]: string | undefined }}
5252
*/
5353
export const clientEnv = {
5454
// NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,

Diff for: cli/template/extras/src/env/schema/with-prisma.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const serverSchema = z.object({
1313
/**
1414
* You can't destruct `process.env` as a regular object in the Next.js
1515
* middleware, so you have to do it manually here.
16-
* @type {{ [k in keyof z.infer<typeof serverSchema>]: z.infer<typeof serverSchema>[k] | undefined }}
16+
* @type {{ [k in keyof z.input<typeof serverSchema>]: string | undefined }}
1717
*/
1818
export const serverEnv = {
1919
DATABASE_URL: process.env.DATABASE_URL,
@@ -33,7 +33,7 @@ export const clientSchema = z.object({
3333
* You can't destruct `process.env` as a regular object, so you have to do
3434
* it manually here. This is because Next.js evaluates this at build time,
3535
* and only used environment variables are included in the build.
36-
* @type {{ [k in keyof z.infer<typeof clientSchema>]: z.infer<typeof clientSchema>[k] | undefined }}
36+
* @type {{ [k in keyof z.input<typeof clientSchema>]: string | undefined }}
3737
*/
3838
export const clientEnv = {
3939
// NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,

0 commit comments

Comments
 (0)