@@ -36,42 +36,52 @@ export const envVariablesInstaller: Installer = ({ projectDir, packages }) => {
36
36
} ;
37
37
38
38
const getEnvContent = ( usingAuth : boolean , usingPrisma : boolean ) => {
39
- let content =
40
- "# When adding additional env variables, the schema in /env/schema.mjs should be updated accordingly" ;
39
+ let content = `
40
+ # When adding additional environment variables, the schema in "/env/schema.mjs"
41
+ # should be updated accordingly.
42
+ `
43
+ . trim ( )
44
+ . concat ( "\n" ) ;
41
45
42
46
if ( usingPrisma )
43
47
content += `
44
48
# Prisma
45
- DATABASE_URL=file:./db.sqlite
49
+ # https://www.prisma.io/docs/reference/database-reference/connection-urls#env
50
+ DATABASE_URL="file:./db.sqlite"
46
51
` ;
47
52
48
53
if ( usingAuth )
49
54
content += `
50
55
# Next Auth
51
- # You can generate the secret via 'openssl rand -base64 32' on Linux
52
- # More info: https://next-auth.js.org/configuration/options#secret
53
- # NEXTAUTH_SECRET=
54
- NEXTAUTH_URL=http://localhost:3000
56
+ # You can generate a new secret on the command line with:
57
+ # openssl rand -base64 32
58
+ # https://next-auth.js.org/configuration/options#secret
59
+ #NEXTAUTH_SECRET=""
60
+ NEXTAUTH_URL="http://localhost:3000"
55
61
56
62
# Next Auth Discord Provider
57
- DISCORD_CLIENT_ID=
58
- DISCORD_CLIENT_SECRET=
63
+ DISCORD_CLIENT_ID=""
64
+ DISCORD_CLIENT_SECRET=""
59
65
` ;
60
66
61
67
if ( ! usingAuth && ! usingPrisma )
62
68
content += `
63
69
# Example:
64
- # SERVERVAR=foo
65
- # NEXT_PUBLIC_CLIENTVAR=bar
70
+ # SERVERVAR=" foo"
71
+ # NEXT_PUBLIC_CLIENTVAR=" bar"
66
72
` ;
67
73
68
74
return content ;
69
75
} ;
70
76
71
- const exampleEnvContent = `# Since .env is gitignored, you can use .env.example to build a new \`.env\` file when you clone the repo.
72
- # Keep this file up-to-date when you add new variables to \`.env\`.
77
+ const exampleEnvContent = `
78
+ # Since the ".env" file is gitignored, you can use the ".env.example" file to
79
+ # build a new ".env" file when you clone the repo. Keep this file up-to-date
80
+ # when you add new variables to \`.env\`.
73
81
74
- # This file will be committed to version control, so make sure not to have any secrets in it.
75
- # If you are cloning this repo, create a copy of this file named \`.env\` and populate it with your secrets.
76
-
77
- ` ;
82
+ # This file will be committed to version control, so make sure not to have any
83
+ # secrets in it. If you are cloning this repo, create a copy of this file named
84
+ # ".env" and populate it with your secrets.
85
+ `
86
+ . trim ( )
87
+ . concat ( "\n\n" ) ;
0 commit comments