-
Notifications
You must be signed in to change notification settings - Fork 77
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
[PFX-547]: Option for next custom server/fastify/express in presets #785
Conversation
@@ -1,3 +1,96 @@ | |||
function prompts(context, prompt) { |
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.
Why were the Nextjs prompts moved to the preset-prompt? Would this lead to code duplication in the webapp preset and any other preset in the future that uses the next plugin.
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.
They were moved because there was duplication. They should be removed from the plugin itself.
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.
@jpina1-godaddy not sure if you saw this!
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.
Where was the duplication? Weren't these only called in the nextjs plugin?
If we want to use some of these prompts for the webapp preset, for example the promptAppRouter prompt, wouldn't we have to copy and paste this promptAppRouter prompt code from here into the webapp preset instead of sharing the code between the two presets if it was located in the nextjs plugin?
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.
Yea this change doesn't seem correct.
The general rule should be:
- Preset prompts present choices of which plugins to use.
- Plugin prompts present choices of which features to use.
If my present includes the a plugin, I expect that plugin to ask about what features to set up.
If I want to give my users options between different plugins, then I add that choice as a prompt to my preset. After that, if there are any feature choices, the plugin should ask about it.
So, unless I'm missing or overlooking something here, these Next.js prompts should remain in the Next.js plugin.
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.
Oh, it might be an ordering issue?
- Preset prompts fire
- Next.js Plugin asks if you want Custom Server
- If you do, then the Preset can no longer ask if you want Express or Fastify for the Custom Server
Is that the scenario here?
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.
After a team chat, this is going to be explored further to define a good pattern moving forward. Approving for now to unblock.
Closing in favor of #811 |
Summary
This PR allows for users to select which server type they would like to use with a preset. The options include
fastify
,express
andCustom Next Server
.Ticket: PFX-547
Changelog
@gasket/preset-api
and@gasket/preset-nextjs
Test Plan