-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: clarify some comments and rename some files in env (#245)
* fix: clarify some comments and rename some files in env * fix: filenames in installer * fix: import in next.config * fix: import after filechange * fix: forgotten rename Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
- Loading branch information
1 parent
5b97367
commit 2048783
Showing
15 changed files
with
142 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// @ts-check | ||
import { z } from "zod"; | ||
|
||
/** | ||
* Specify your server-side environment variables schema here. | ||
* This way you can ensure the app isn't built with invalid env vars. | ||
*/ | ||
export const serverSchema = z.object({ | ||
DATABASE_URL: z.string().url(), | ||
NODE_ENV: z.enum(["development", "test", "production"]), | ||
NEXTAUTH_SECRET: z.string(), | ||
NEXTAUTH_URL: z.string().url(), | ||
DISCORD_CLIENT_ID: z.string(), | ||
DISCORD_CLIENT_SECRET: z.string(), | ||
}); | ||
|
||
/** | ||
* Specify your client-side environment variables schema here. | ||
* This way you can ensure the app isn't built with invalid env vars. | ||
* To expose them to the client, prefix them with `NEXT_PUBLIC_`. | ||
*/ | ||
export const clientSchema = z.object({ | ||
// NEXT_PUBLIC_BAR: z.string(), | ||
}); | ||
|
||
/** | ||
* You can't destruct `process.env` as a regular object, so you have to do | ||
* it manually here. This is because Next.js evaluates this at build time, | ||
* and only used environment variables are included in the build. | ||
*/ | ||
export const clientEnv = { | ||
// NEXT_PUBLIC_BAR: process.env.NEXT_PUBLIC_BAR, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// @ts-check | ||
import { z } from "zod"; | ||
|
||
/** | ||
* Specify your server-side environment variables schema here. | ||
* This way you can ensure the app isn't built with invalid env vars. | ||
*/ | ||
export const serverSchema = z.object({ | ||
NEXTAUTH_SECRET: z.string(), | ||
NEXTAUTH_URL: z.string().url(), | ||
DISCORD_CLIENT_ID: z.string(), | ||
DISCORD_CLIENT_SECRET: z.string(), | ||
}); | ||
|
||
/** | ||
* Specify your client-side environment variables schema here. | ||
* This way you can ensure the app isn't built with invalid env vars. | ||
* To expose them to the client, prefix them with `NEXT_PUBLIC_`. | ||
*/ | ||
export const clientSchema = z.object({ | ||
// NEXT_PUBLIC_BAR: z.string(), | ||
}); | ||
|
||
/** | ||
* You can't destruct `process.env` as a regular object, so you have to do | ||
* it manually here. This is because Next.js evaluates this at build time, | ||
* and only used environment variables are included in the build. | ||
*/ | ||
export const clientEnv = { | ||
// NEXT_PUBLIC_BAR: process.env.NEXT_PUBLIC_BAR, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// @ts-check | ||
import { z } from "zod"; | ||
|
||
/** | ||
* Specify your server-side environment variables schema here. | ||
* This way you can ensure the app isn't built with invalid env vars. | ||
*/ | ||
export const serverSchema = z.object({ | ||
DATABASE_URL: z.string().url(), | ||
NODE_ENV: z.enum(["development", "test", "production"]), | ||
}); | ||
|
||
/** | ||
* Specify your client-side environment variables schema here. | ||
* This way you can ensure the app isn't built with invalid env vars. | ||
* To expose them to the client, prefix them with `NEXT_PUBLIC_`. | ||
*/ | ||
export const clientSchema = z.object({ | ||
// NEXT_PUBLIC_BAR: z.string(), | ||
}); | ||
|
||
/** | ||
* You can't destruct `process.env` as a regular object, so you have to do | ||
* it manually here. This is because Next.js evaluates this at build time, | ||
* and only used environment variables are included in the build. | ||
*/ | ||
export const clientEnv = { | ||
// NEXT_PUBLIC_BAR: process.env.NEXT_PUBLIC_BAR, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// @ts-check | ||
import { z } from "zod"; | ||
|
||
/** | ||
* Specify your server-side environment variables schema here. | ||
* This way you can ensure the app isn't built with invalid env vars. | ||
*/ | ||
export const serverSchema = z.object({ | ||
// FOO: z.string(), | ||
}); | ||
|
||
/** | ||
* Specify your client-side environment variables schema here. | ||
* This way you can ensure the app isn't built with invalid env vars. | ||
* To expose them to the client, prefix them with `NEXT_PUBLIC_`. | ||
*/ | ||
export const clientSchema = z.object({ | ||
// NEXT_PUBLIC_BAR: z.string(), | ||
}); | ||
|
||
/** | ||
* You can't destruct `process.env` as a regular object, so you have to do | ||
* it manually here. This is because Next.js evaluates this at build time, | ||
* and only used environment variables are included in the build. | ||
*/ | ||
export const clientEnv = { | ||
// NEXT_PUBLIC_BAR: process.env.NEXT_PUBLIC_BAR, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters