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!: redesigns vue upgrade, supports code migration #4090

Merged
merged 23 commits into from Jul 2, 2019

Conversation

sodatea
Copy link
Member

@sodatea sodatea commented Jun 2, 2019

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 command

Usage: upgrade [options] [package-name]

upgrade vue cli service / plugins

Options:
  -t, --to <version>    upgrade to a version that is not latest
  -r, --registry <url>  Use specified npm registry when installing dependencies

The 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 and MigratorAPI, such as api.move and api.remove.


TODOs in this PR:

  • clean the code (there're all kinds of TODOs and FIXMEs in it and many functionalities are broken)
  • tests
  • an example migrator (in the babel plugin)
  • interactive "upgrade all" command
  • documentation

A few ideas with regard to the GeneratorAPI:

@sodatea sodatea marked this pull request as ready for review July 1, 2019 16:48
@sodatea sodatea changed the title [WIP] feat: add MigratorAPI for vue upgrade usage feat: implement a new vue upgrade command that supports code migration Jul 1, 2019
@sodatea sodatea merged commit 867c6ea into vuejs:dev Jul 2, 2019
@sodatea sodatea changed the title feat: implement a new vue upgrade command that supports code migration feat!: redesigns vue upgrade, supports code migration Jul 2, 2019
cexbrayat added a commit to cexbrayat/vue-cli that referenced this pull request Jul 2, 2019
A `debugger` instruction was left after vuejs#4090
@cexbrayat cexbrayat mentioned this pull request Jul 2, 2019
sodatea pushed a commit that referenced this pull request Jul 3, 2019
A `debugger` instruction was left after #4090
@bodograumann bodograumann mentioned this pull request Jul 24, 2019
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant