Open craineum opened 2 years ago
One option is to have all of the scaffolds support all these features, but require opting-in by removing:
[generate]
tests = false
stories = false
From the redwood.toml
which could be default. Personally, I don't use either.
Outside of that I only use all my versions of the templates, and while it can be hard to figure out the occasional breaking change but its been worth it.
Other ideas for scaffold improvement:
@dthyresson I mean, if we are putting together a scaffolding wish list...
but back on task now...
@orta I like the idea of adding configuration. But to me opting out would be better, that way people know it is there, otherwise it can get overlooked easily. I would rather see people have to choose not to include stories/tests, especially for early career developers.
I am curious if you are generating stories/tests with your custom templates. And what else your custom templates are doing that the default ones are not.
I've added my generators to the relay example app: https://github.com/orta/relay-redwood-app-example - I don't use much redwood infra on the web site, and instead use the artsy omakase stack in redwood but a lot of it is about conforming to the additional graphql specs around object identification and pagination
Aye, the default redwood settings today does include stories and tests, that setting I included is what I use to disable it FWIW
What I love about Redwood is enforcing the right pattern of product development - one of which is design led development with storybook. As a new dev - or when building a product - it's very helpful to to able experiment quickly and try things out and scaffold is big time saver for that. However, right now it's a real pain to have to manually go figure out how to get storybook working for the scaffold generated layouts, pages, components and cells OR generate these one by one again using the cli - just to get the storybooks and tests.
I'd argue for a new dev, it's actually more helpful to maintain the expected behaviour that redwood will always add storybooks and tests for you by default ... and have it be clear in the excellent redwood docs :)
My 2c
Summary
After a discussion on the forums, I would like to propose adding stories and tests to the scaffold generators.
Secondarily the scaffolds do not have the Metatags generated for page title.
Motivation
The biggest motivation is to establish good patterns for things that the Redwood generators are providing. While the individual generators create stories and tests, the scaffolds do not. This creates an inconsistency and mixed messaging to users of Redwood, especially early career developers.
Stories and tests are a great way to document the code for future developers to review. Leaving them off I think sends an unintended message.
The Metatags not being included on the scaffolding, I think speaks to a larger issue where the scaffold generators can easily be forgotten when making updates to the other generators.
Detailed proposal
As part of the CLI scaffold generator, they should be updated with stories, tests, and metatags.
Possible implementations
Why hasn't this happened already?
There is concern about overwhelming someone by generating a ton of files. Adding stories and tests will basically triple that amount.
Another point of view is that scaffolding is just that, something that is put up quickly which allows us to build something that actually makes sense, and then destroy the scaffolding once the new thing is in place.
Are you interested in working on this?