Skip to content
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

processEnv - initial module; #1796

Open
wants to merge 9 commits into
base: minor
Choose a base branch
from

Conversation

cityremade
Copy link
Member

@cityremade cityremade commented Jan 6, 2025

Introducing a process env module which passes environment variables and assigns defaults in order to avoid referencing process.env across the codebase.

@cityremade cityremade self-assigned this Jan 6, 2025
express.js Fixed Show fixed Hide fixed
express.js Fixed Show fixed Hide fixed
express.js Fixed Show fixed Hide fixed
express.js Fixed Show fixed Hide fixed
express.js Fixed Show fixed Hide fixed
express.js Fixed Show fixed Hide fixed
express.js Fixed Show fixed Hide fixed
express.js Fixed Show fixed Hide fixed
express.js Fixed Show fixed Hide fixed
express.js Fixed Show fixed Hide fixed
@cityremade cityremade linked an issue Jan 6, 2025 that may be closed by this pull request
@cityremade cityremade added the Code Issues related to the code structure and performance. label Jan 6, 2025
express.js Dismissed Show dismissed Hide dismissed
express.js Fixed Show fixed Hide fixed
express.js Fixed Show fixed Hide fixed
express.js Fixed Show fixed Hide fixed
express.js Dismissed Show dismissed Hide dismissed
express.js Dismissed Show dismissed Hide dismissed
express.js Dismissed Show dismissed Hide dismissed
express.js Dismissed Show dismissed Hide dismissed
express.js Dismissed Show dismissed Hide dismissed
express.js Dismissed Show dismissed Hide dismissed
@dbauszus-glx dbauszus-glx changed the base branch from main to minor January 8, 2025 13:32
express.js Dismissed Show dismissed Hide dismissed
express.js Dismissed Show dismissed Hide dismissed
@dbauszus-glx
Copy link
Member

@cityremade

Can you move the mapp_env module to the mod/utils directory and rename this to processEnv since this isn't really related to the mapp library but deals with the process environment for the xyz node modules.

Can you also move the globale env typedef from the api module into the processEnv utility module.

I had a look at the sonarcloud issues.

image

This can be fixed by assigning true or false boolean in the processEnv module.

@dbauszus-glx
Copy link
Member

dbauszus-glx commented Jan 8, 2025

@cityremade

image

You can fix the optional chaining warning like so:

image

Same should work here:
image

@cityremade cityremade marked this pull request as ready for review January 8, 2025 16:06
@cityremade cityremade changed the title Mapp_env - initial module; processEnv - initial module; Jan 8, 2025
@cityremade cityremade requested a review from simon-leech January 8, 2025 16:07
@RobAndrewHurst
Copy link
Contributor

I have some ideas for us avoiding importing the env utility module everywhere. I will do this tomorrow

Copy link

sonarqubecloud bot commented Jan 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Issues related to the code structure and performance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

URLSearchParams to split process.env variables
3 participants