-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
feat(create-vite): add help usage #16390
base: main
Are you sure you want to change the base?
Conversation
- help argument will be used as "--help" and by default it is false
- i want to find a way to decouple the text from the code
Run & review this pull request in StackBlitz Codeflow. |
- Using alias to define template and help
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.
Some formatting nits, otherwise a nice addition to me!
function getUsageInfo() { | ||
const formattedFrameworkNames = getFormattedVariantNames() | ||
return `Usage: create-vite [OPTION]... [DIRECTORY] | ||
Create a new JavaScript project based on Vite. |
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.
nit
Create a new JavaScript project based on Vite. | |
Create a new Vite project in JavaScript or TypeScript. |
function getFormattedVariantNames() { | ||
return FRAMEWORKS.filter( | ||
(framework) => framework.name !== 'others' && framework.variants.length > 0, | ||
).map((framework) => { | ||
const variantNames = framework.variants.map((variant) => variant.name) | ||
return `${variantNames.join(' ')}` | ||
}) | ||
} |
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 think we should also put the variants each on their new line as well, otherwise it may be hard to read if some are on a single line.
Also, I think we should filter out the templates that have customCommand
as they're redirects to other CLIs.
Description
closes #16374