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

Custom env variable #301

Open
jimafisk opened this issue Nov 28, 2023 · 0 comments
Open

Custom env variable #301

jimafisk opened this issue Nov 28, 2023 · 0 comments

Comments

@jimafisk
Copy link
Member

Currently some of the config set in plenti.json can be referenced in the magic env prop available at the top-level /layouts/global/html.svelte of your project:

  • env.baseurl
  • env.local
  • env.entrypointHTML
  • env.entrypointJS
  • env.cms.repo
  • env.cms.redirectUrl
  • env.cms.appId
  • env.cms.branch

I wonder if it makes sense to reserve env for custom key/values and instead pull defined settings out of a new variable called config:

  • config.baseurl
  • config.local
  • config.entrypointHTML
  • config.entrypointJS
  • config.cms.repo
  • config.cms.redirectUrl
  • config.cms.appId
  • config.cms.branch
  • config.env.myCustomKey <-- User defined under env key in plenti.json
  • config.env.myCustomKey2 <-- Same

Most projects allow for a .env file, but since we allow individual builds per environment (e.g. local / dev / stg / prod / etc.. per #183) using plenti.json config files, I think it makes the most sense to require that we define them there.

To avoid introducing a breaking change we could keep env and using a subcategory of custom or something instead. Would like to emphasize the best naming over backwards compatibility though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant