-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add support for a JSON configuration file #814
Add support for a JSON configuration file #814
Conversation
AP-3623 Add CLI support for a chromatic.js config file that allows multiple environments and configuration outside of .storybook/
Currently users must configure their chromatic cli inside of storybook configuration and through cli flags. This may be confusing as users might require different settings for local builds vs ci builds. We may be able to improve this by allowing users to define their configurations in a separate, type-safe config file. This should be an additional form of configuration, and allow backwards compatibility for existing setups using cli flags and ci configuration. It may need to allow both approaches to be mixed. Multiple Environments: With the addon-visual-tests having more users run builds outside of CI, configuration for the cli may need to vary based on the environment. Supporting multiple environments, through environment-suffixed names or programatic configuration would help optimize configuration for local builds. Related Slack thread: https://chromaticqa.slack.com/archives/C051TQR6QLC/p1693198584200749 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the filename, but otherwise looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmeasday left some questions for you that we can follow async to address the documentation accordingly. I'm approving this to unblock you on this.
Co-authored-by: Gert Hengeveld <info@ghengeveld.nl>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a question and a couple suggestions about using the flag to override configuration instead of the other way around.
6f0837c
to
5460c6c
Compare
Also add `options.diagnostics` and rename `options.verbose`=>`options.debug`
Note that I made a judgement on which keys to support in the file (see
chromatic-cli/node-src/lib/getConfiguration.ts
Lines 9 to 34 in 72ab4cc