You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I brought this up on the Discord channel as well but the discussion got lost there so I thought it was better to move it to an actual GH issue.
The NODE_ENV variable seems to never have been officially described how it should be used. Instead it seems to have been used arbitrarily by the npm community to sometimes change the runtime behavior of packages. It seems package maintainers are checking for at least development/production/test and have that affect the behavior.
By Foal only allowing NODE_ENV as the single way to specify which configuration to use, it takes away control from users who cannot both control which config files to use at the same time as controlling runtime behavior of npm packages.
As a theoretical example we might have:
Two production-like environments staging and production
Some npm package that does things one way for NODE_ENV===production and another way when NODE_ENV!==production
In this case it would be impossible or at best very difficult to specify that we want the NODE_ENV===production from the npm package but want to read config from the staging.json and .env.staging files.
It seems NODE_ENV is only referenced a few times in FoalTS's code base so it seems it shouldn't be too hard to use another environment variable such as FOAL_ENV or RUN_ENV which could be set to override NODE_ENV when looking up env values or config values.
The text was updated successfully, but these errors were encountered:
I brought this up on the Discord channel as well but the discussion got lost there so I thought it was better to move it to an actual GH issue.
The NODE_ENV variable seems to never have been officially described how it should be used. Instead it seems to have been used arbitrarily by the npm community to sometimes change the runtime behavior of packages. It seems package maintainers are checking for at least development/production/test and have that affect the behavior.
By Foal only allowing NODE_ENV as the single way to specify which configuration to use, it takes away control from users who cannot both control which config files to use at the same time as controlling runtime behavior of npm packages.
As a theoretical example we might have:
In this case it would be impossible or at best very difficult to specify that we want the NODE_ENV===production from the npm package but want to read config from the staging.json and .env.staging files.
It seems NODE_ENV is only referenced a few times in FoalTS's code base so it seems it shouldn't be too hard to use another environment variable such as FOAL_ENV or RUN_ENV which could be set to override NODE_ENV when looking up env values or config values.
The text was updated successfully, but these errors were encountered: