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

feat(create-vite): add help usage #16390

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

Conversation

edvardsanta
Copy link

@edvardsanta edvardsanta commented Apr 9, 2024

Description

closes #16374
image

- 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
Copy link

stackblitz bot commented Apr 9, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@edvardsanta edvardsanta changed the title Feat/add help create vite feat: add create vite help usage Apr 9, 2024
@edvardsanta edvardsanta changed the title feat: add create vite help usage feat(create-vite): add help usage Apr 10, 2024
- Using alias to define template and help
@edvardsanta edvardsanta marked this pull request as ready for review April 11, 2024 04:14
Copy link
Member

@bluwy bluwy left a 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
Create a new JavaScript project based on Vite.
Create a new Vite project in JavaScript or TypeScript.

Comment on lines +597 to +604
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(' ')}`
})
}
Copy link
Member

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.

@bluwy bluwy added p2-nice-to-have Not breaking anything but nice to have (priority) feat: create-vite create-vite package labels May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: create-vite create-vite package p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create-vite: add CLI argument help
2 participants