-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refactor env variables #2911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor env variables #2911
Conversation
All right @cprecioso! I will go to vacation in a day or so, so please have somebody else review it, I thikn @infomiho might be a good candidate. It might also benefit from fresh pair of eyes. |
Deploying wasp-docs-on-main with
|
Latest commit: |
396ec95
|
Status: | ✅ Deploy successful! |
Preview URL: | https://11d62e4f.wasp-docs-on-main.pages.dev |
Branch Preview URL: | https://push-uuqynktmlxnr.wasp-docs-on-main.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some suggestions
where | ||
changeExtensionTo ext = (++ '.' : ext) . fst . splitExtension | ||
|
||
clientUrlFromServerEnvVarName :: String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: clientUrlFromServerEnvVarName
feels a bit off as a name because of the "from" (I understand that you wanted to say "from the perspective of") so I'd maybe go with just clientUrlEnvVarName
since we have the context of this being in the server generator? And I see that you qualified the imports so it reads like Server.clientUrlEnvVarName
.
// Wasp requires that the url is set to the ${databaseUrlEnvVarNameText} environment variable. | ||
url = env("${databaseUrlEnvVarNameText}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we can't provide the DATABASE_URL
variable name in the other starters via Haskell, should we just keep it hard-coded here as well? I'm think for consistency sake and maybe some sort of search and replace in the future will put this place in the same results as other starters in the future.
[ "isAuthEnabled" .= isJust maybeAuth, | ||
"clientUrlEnvVarName" .= Server.clientUrlFromServerEnvVarName, | ||
"serverUrlEnvVarName" .= Server.serverUrlFromServerEnvVarName, | ||
"jwtSecretEnvVarName" .= jwtSecretEnvVarName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd either move jwtSecretEnvVarName
to ServerGenerator.Common
so we get nice context when using the env var name Server.jwtSecretEnvVarName
or... if we believe that AuthG
is a different context, maybe then better to import it using a qualified import so we get AuthG.jwtSecretEnvVarName
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left it as AuthG.jwtSecretEnvVarName
@infomiho ready |
Extracts and refactors env variables based on #2796 (comment)