-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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: create-vite when targetDir is a valid packageName #4247
Conversation
The current code is doing what we intended, if the @spencer17x would you create an issue to describe what problem did you run into? |
@patak-js Now when it is created, although the project name is valid, the name of package.json is still empty. When the type is null, the problem is skipped directly, resulting in packageName being undefined |
Good catch @spencer17x. The condition is still fine, I think we should modify this line vite/packages/create-vite/index.js Line 253 in 0316f14
targetDir if packageName is undefined .
|
@patak-js I think so too, but considering that if the user expects the name of package.json to be inconsistent with the directory, this method requires the user to manually modify the name of package.json, so you think the method is better |
We discussed this with the team last time, and it was decided that we should enable people to chose a directory name that is not a valid package.json name. We also don't want to ask too many prompts, only the questions that are strictly needed. So the current approach is fine, but you found a bug. You could use this PR if you would like to fix it as we discussed 👍🏼 |
@patak-js So that's it, I understand, I modified it |
Description
fix create-vite without packageName
Additional context
isValidPackageName judgment
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).