!feat(env): update environment configuration for web URLs #1561
Merged
tyler-dane merged 10 commits intomainfrom Mar 23, 2026
Merged
!feat(env): update environment configuration for web URLs #1561tyler-dane merged 10 commits intomainfrom
tyler-dane merged 10 commits intomainfrom
Conversation
…email reset link handling - Added LOCAL_WEB_URL to .env.local.example and updated env.constants.ts to include it. - Modified supertokens middleware to utilize LOCAL_WEB_URL for generating password reset links. - Updated tests to reflect changes in reset link generation and ensure correct behavior with the new URL structure. - Removed deprecated CLI domain variables in favor of the new web URL configuration. This change improves the clarity and maintainability of environment configurations and enhances the email reset functionality.
…environment variables - Updated jest.config.js to conditionally include global setup and teardown for MongoDB based on the requested project. - Added LOCAL_WEB_URL environment variable to backend test initialization for improved local testing configuration. These changes improve the testing setup for projects requiring MongoDB and enhance the clarity of environment configurations.
- Removed dotenv dependency from multiple package.json files and eliminated dotenv configuration from init.ts files. - Updated CLI and development scripts in package.json to utilize environment variables more effectively. - Enhanced webpack configuration to handle environment variables without relying on dotenv, improving clarity and maintainability. These changes simplify the environment configuration process and reduce unnecessary dependencies across the project.
- Updated the development script in package.json to unify the backend start command under "dev:backend", simplifying the command structure. - Removed the redundant "dev:backend-start" script, enhancing clarity and maintainability of the development setup. This change streamlines the development process for the backend, making it easier for developers to start the server.
- Removed unnecessary import of "@scripts/init" and adjusted the import order for better organization. - Streamlined the import section by consolidating related imports, enhancing code clarity and maintainability. This refactor improves the overall structure of the CLI script, making it easier to read and manage.
- Eliminated the onReady method and its associated event listener for ConnectionReadyEvent in the MongoService class, streamlining the connection handling logic. - This change enhances code clarity by removing unnecessary complexity related to connection state management.
- Implemented a check for the local environment in the getDomainAnswer function, returning the host from LOCAL_WEB_URL for improved local development support. - This enhancement streamlines the process of obtaining the correct domain for local setups, facilitating a smoother development experience.
Contributor
Author
|
TODO: test and integrate email sending |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

BREAKING CHANGE: Changes env variable(s)
fix: clarify local env file naming convention
Problem
The backend
dev:backendscript loaded--env-file=.env, but the actual file was named.env.local. This naming was inconsistent with the rest of the env file structure (.env.staging,.env.production) and made it unclear which file was for local development vs. other environments.Changes
package.json— updateddev:backendto load--env-file=.env.localinstead of--env-file=.env.env.local.example— updated the setup instruction to say "rename to.env.local" instead of.envEnv file structure
The intended convention is now explicit:
No bare
.env— the environment suffix makes the purpose of each file self-evident.Action required
If your local file is named
.env, rename it:Closes #1559
Note
Medium Risk
Touches password-reset email link generation and environment loading paths across backend, web build, and CLI; misconfigured
LOCAL_WEB_URL/*_WEB_URLcould break auth flows or scripts. Changes are straightforward but span multiple entrypoints (dev scripts, webpack, Jest).Overview
Standardizes environment configuration around explicit web URLs. Introduces required
LOCAL_WEB_URL(andSTAGING_WEB_URL/PROD_WEB_URLfor scripts) and updates the example env file and scripts CLI to stop using the old*_DOMAINvariables.Improves password reset email handling. Reset links are now rewritten using
ENV.LOCAL_WEB_URLvia an updatedbuildResetPasswordLink(frontendUrl)API, and EmailPassword email delivery now properly overridessendEmail(suppressed only intest, otherwise delegates to the original sender with the rewritten link); tests are updated accordingly.Switches runtime env loading to Node’s
--env-fileand reduces dotenv usage. Removesdotenvfrom backend/scripts, deletes scriptsinit.ts, updates rootdev:*/cliscripts to pass--env-file, and replaces webpack’sdotenvusage with a simple.env.*parser. Jest is also updated to only run@shelf/jest-mongodbglobal setup/teardown for projects that need Mongo.Written by Cursor Bugbot for commit e7f6fc0. This will update automatically on new commits. Configure here.