Config: Add redwood.toml setting to disable generating tests and storybook with every generator
See original GitHub issueNot everyone cares about tests and/or storybook so it’s kind of annoying to keep creating the files every time. Let’s add config options in redwood.toml
to stop creating them during generation.
Some folks may also want to generate tests/storybook for only some component types but not others. Maybe you always want them for services, but never for pages. So perhaps there’s a global config option as well as per-type config option.
Here are a couple options for syntax:
# global setting
[generate]
tests = true
storybook = false
# per-side setting
[generate.web]
tests = true
storybook = false
[generate.api]
tests = false
# individual type setting
[generate.services]
tests = true
# more specific settings win (all web-side tests are generated, only services api-side tests are generated)
[generate]
tests = true
[generate.api]
tests = false
[generate.services]
tests = true
Another suggestion is just an array of types to generator for. By default, everything is enabled, but as soon as you add the tests
or storybook
key then everything becomes disabled except what’s included in the array. It seems kind of weird that just the existence of the key causes all tests to be generated or not, so maybe this isn’t the most clear option:
[generate]
tests = ["services", "cells"]
storybook = ["cells"]
For now we’re talking about defaulting to true
for the global setting, so existing behavior doesn’t change.
Someone also suggested maybe after you’ve used the generators 3 or 4 times you get an extra notification after the 4th generator saying something like “Did you know you can skip test or storybook generation? See https://redwoodjs.com/docs/redwood.toml”
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Just some sign of life; I’m still working on this, but my time is a bit limited past period
@mojombo In the CLI I used
stories
. I was planning on doing the same here.