-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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!: redesigns vue upgrade
, supports code migration
#4090
Merged
Conversation
This file contains 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
haoqunjiang
changed the title
[WIP] feat: add MigratorAPI for
feat: implement a new Jul 1, 2019
vue upgrade
usagevue upgrade
command that supports code migration
haoqunjiang
changed the title
feat: implement a new
feat!: redesigns Jul 2, 2019
vue upgrade
command that supports code migrationvue upgrade
, supports code migration
cexbrayat
added a commit
to cexbrayat/vue-cli
that referenced
this pull request
Jul 2, 2019
A `debugger` instruction was left after vuejs#4090
Merged
haoqunjiang
pushed a commit
that referenced
this pull request
Jul 3, 2019
A `debugger` instruction was left after #4090
ghost
mentioned this pull request
Aug 15, 2021
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.
The basic idea
Inspired by https://nodepackjs.com/guide/app-migrations.html and https://github.com/angular/angular-cli/blob/master/docs/specifications/update.md
The new
vue upgrade
commandThe old command is only an adapter for
npm install
and only takes care of core plugins.After this change, third-party plugins can also benefit from this command.
In the future, we may also extend this utility for core package migrations (if possible) (e.g.
vue upgrade vuex --to 4.0.0
)The new
MigratorAPI
:Basically the same as
GeneratorAPI
, except for one more method:fromVersion
and it's triggered on plugin upgrade only.Migrator implementation should be located under
./migrator
directory.The idea is to provide a minimal API interface for migration utilities and to be fully programmable/customizable.
Later I'd also like to add a few handy helper methods to both
GeneratorAPI
andMigratorAPI
, such asapi.move
andapi.remove
.TODOs in this PR:
A few ideas with regard to the
GeneratorAPI
:api.move
api.remove
api.transformScript
, utilizing jscodeshift and vue-jscodeshift-adapterdon't feel it's necessaryapi.patchJSON
, utilizing golden-fleece