refactor: normalize scripts and commands naming#5207
Merged
Conversation
patak-cat
commented
Oct 6, 2021
patak-cat
commented
Oct 6, 2021
Shinigami92
reviewed
Oct 6, 2021
Shinigami92
approved these changes
Oct 6, 2021
CHOYSEN
approved these changes
Oct 8, 2021
antfu
approved these changes
Oct 8, 2021
Member
antfu
left a comment
There was a problem hiding this comment.
I am good with these changes. But maybe let's have Evan aware of this first in today's meeting?
Member
Author
|
We decided to move forward with this change. I think we can do it in the next minor even if it doesn't affect core with a breaking change, and only create-vite. I'll update the docs to make it more clear that |
4 tasks
Member
Author
|
I'll merge this one and then send another PR with a new section for the CLI in the docs. We don't really have a CLI reference at this point so it is hard to see where to properly add this info. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
See #5097 for context. That PR explored what would be needed to change
servebydeveverywhere, also in the internal API. As plugins are already usingconfig.command === 'serve', it is hard to justify such a breaking change for the ecosystem.Looks like SvelteKit, Astro and others are using
previewas a script name without issues. Maybe this is only a problem when there is aviewscript? (but that would be already in the hands of the user to arrange). So, this PR changes the current setup from:to:
pnpm run serve->pnpm run preview. This is only used internally and in templates, so we don't need to keep the old script around. We could add the script and log a message for a while but it may be overkill and add noise to the starter templates.devis introduced as an alias forserveto run the dev server. Current users are used to seeingdevas the script name, and this aligns Vite to other tools in the ecosystem.serveisn't deprecated at this point, because the internal API still usescommand === 'serve'. IMO it is best to keep both aliases for the cli.What is the purpose of this pull request?