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

fix(cli): Allow common custom scaffold template files #11755

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

esteban-url
Copy link
Contributor

This PR fixes #11754 by adding the ability to generate test, stories and mock files when custom scaffold templates are in use.

Right now these files are not supported/generated even if a template file is there. This PR will allow a dev to define their own test, stories and mock templates for components and/or pages and have the yarn rw g scaffold [model] command correctly generate it for them.

Please let me know what you think of it and/or it any testing is required.

Thanks!

@esteban-url esteban-url changed the title fix(cli): Allow common custom scaffold files fix(cli): Allow common custom scaffold template files Dec 7, 2024
@Tobbe Tobbe added the release:feature This PR introduces a new feature label Dec 8, 2024
@Tobbe Tobbe added this to the next-release milestone Dec 8, 2024
@Tobbe
Copy link
Member

Tobbe commented Dec 11, 2024

I like this addition. I just want to spend some time thinking about what unit tests, if any, can be added

@esteban-url
Copy link
Contributor Author

thanks @Tobbe I gave it some though, but couldn't come up with any, so I thought better to ask the team. Also, this is "user land", and a somewhat "advanced" scenario, so they've already strayed out of the path, and have accepted that they're pretty much on their own, since they ejected the generators.

It's me, I'm "they" 😅

@Tobbe
Copy link
Member

Tobbe commented Dec 27, 2024

@esteban-url I added some tests. Please take a look and edit/add as you see fit. Another thing I realized is that now when you run yarn rw setup generator scaffold it should probably also spit out template test, mock, stories etc files as well. Can you please update the code to do that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature This PR introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug?]: Custom scaffold tests, mocks and stories are not generated
2 participants