-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
test(create-gatsby): snapshot plugins-options-form and tiny refactoring #28366
Conversation
95b72f8
to
43106ca
Compare
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 like reading through these to see what you change. This one looks pretty straightforward to me, testing the output of makePluginConfigQuestions
so we don't do something that breaks what gets piped into the enquirer form 👍
Thanks for the feedback 😊 I (we actually 😬 ) tried to test from the enquirer standpoint and got in trouble when going in the CI. We then decided to step back and just test the different functions to make sure everything looks okay 😊 |
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.
Looks great! Just a couple of typos
const schemaToChoice = ([name, option]: [string, Schema]): IChoice => { | ||
const hasDefaultValue = | ||
option.flags?.default && | ||
supportedOptionTypes.includes(typeof option.flags?.default) |
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 realise this was how it was before, but I do wonder if there's a better way to do this, using the schema rather than checking the type of the default value
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.
a side note on that: right now, IIRC, none of the elements that are required have a default value 🤔 . This is a computation that lives there "for nothing" for now I would say :/
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.
Good point. Most of them aren't likely to either, because if there's a default it won't need to be required
Co-authored-by: Matt Kane <[email protected]>
Description
Snapshotting output of
makePluginConfigQuestions
and add a tiny refacto