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
This can be in the form of a cinnamon.toml that is unique to a specific environment and dynamically selectable with NODE_ENV or CINNAMON_ENV (as an option for where NODE_ENV might, inexplicably, affect other code).
Replace cinnamon.toml/framework.core.development_mode with true environment variables (as it is overridden by them historically anyway).
To avoid confusion, remove cinnamon.toml/framework.core.development_mode: ignore its value and, if set, provide an error message or warning to the user that they must migrate. (This property was easier to work with initially and used to mean less, but now it affects many behaviors - particularly security-related functionality can potentially be accidentally left enabled when deploying).
Start the framework in development mode IF AND ONLY IFNODE_ENV === "development" OR CINNAMON_ENV === "development"
CINNAMON_ENV takes priority over NODE_ENV when set (but we will recommend that everybody use NODE_ENV in docs, etc., for consistency).
Add yarn dev to package.json as well as yarn start which can just set the environment variable.
The Cinnamon environment (core/framework.environment) will now be set as follows:
If CINNAMON_ENV is set and not empty, its exact string value will be used as the environment name. Otherwise,
If NODE_ENV is set and not empty, its exact string value will be used as the environment name. Otherwise,
The framework will be started in production mode "production".
core/framework.environment will be added and equal to the environment string and inDevMode will now be a getter for core/framework.environment === "development"
The main cinnamon.toml file will be loaded as always, however if cinnamon.<environment>.toml exists, it will be loaded too and its properties will be deep merged onto the existing configuration (from cinnamon.toml).
To give projects control over setting up the environment:
If cinnamon.<environment>.toml does not exist, but cinnamon.<environment>.dist.toml does exist BUT there are placeholder values (to be decided and documented) in the file: create-cinnamon-project will be invoked if possible to handle copying the file and prompting the user for placeholder values OR an error message about the file needing to be created will be displayed and the framework will terminate.
Alternatively, if no placeholder values exist, the file will just be silently copied during startup.
The text was updated successfully, but these errors were encountered:
This can be in the form of a
cinnamon.toml
that is unique to a specific environment and dynamically selectable with NODE_ENV or CINNAMON_ENV (as an option for where NODE_ENV might, inexplicably, affect other code).cinnamon.toml/framework.core.development_mode
with true environment variables (as it is overridden by them historically anyway).cinnamon.toml/framework.core.development_mode
: ignore its value and, if set, provide an error message or warning to the user that they must migrate. (This property was easier to work with initially and used to mean less, but now it affects many behaviors - particularly security-related functionality can potentially be accidentally left enabled when deploying).NODE_ENV === "development" OR CINNAMON_ENV === "development"
CINNAMON_ENV
takes priority overNODE_ENV
when set (but we will recommend that everybody useNODE_ENV
in docs, etc., for consistency).yarn dev
topackage.json
as well asyarn start
which can just set the environment variable.core/framework.environment
) will now be set as follows:CINNAMON_ENV
is set and not empty, its exact string value will be used as the environment name. Otherwise,NODE_ENV
is set and not empty, its exact string value will be used as the environment name. Otherwise,"production"
.core/framework.environment
will be added and equal to the environment string andinDevMode
will now be a getter forcore/framework.environment === "development"
cinnamon.toml
file will be loaded as always, however ifcinnamon.<environment>.toml
exists, it will be loaded too and its properties will be deep merged onto the existing configuration (fromcinnamon.toml
).To give projects control over setting up the environment:
cinnamon.<environment>.toml
does not exist, butcinnamon.<environment>.dist.toml
does exist BUT there are placeholder values (to be decided and documented) in the file:create-cinnamon-project
will be invoked if possible to handle copying the file and prompting the user for placeholder values OR an error message about the file needing to be created will be displayed and the framework will terminate.The text was updated successfully, but these errors were encountered: