Better than doing it manually 😁
We know that migrations take time, so VMT(Vue Migration Tool) was created to help solve solve this problem.
Migrating a Vue 2.x project to Vue 3.x.
To use Vue Migration Tool, your code must follow the standards in this Vue Guide.
⚠️ If your code has a different implementation than the guide, there may be inconsistencies after migration.
Here we go!
Clone the project:
git clone https://github.com/tthheusalmeida/vue-migration-tool.git
Install the dependencies:
npm install
For run the project we have some environment variables:
REPOSITORY: HTTPS link from project. (required)
BRANCH: Branch name, if there is no name, main is used. (optional)
Then run one of these commands
cross-env REPOSITORY=<repository-link> npm start
Example: cross-env REPOSITORY=https://github.com/tthheusalmeida/pokedex.git npm start
cross-env REPOSITORY=<repository-link> BRANCH=<branch-name> npm start
Example: cross-env REPOSITORY=https://github.com/tthheusalmeida/pokedex.git BRANCH=migrate npm start
cross-env REPOSITORY=<repository-link> npm run start:log
Example: cross-env REPOSITORY=https://github.com/tthheusalmeida/pokedex.git npm run start:log
also works with BRANCH:
cross-env REPOSITORY=<repository-link> BRANCH=migrate npm run start:log
Example: cross-env REPOSITORY=https://github.com/tthheusalmeida/pokedex.git BRANCH=migrate npm run start:log
At the end of the execution the code will be available in the migrated folder.
Enjoy! 😎
Each dependency has its own list with checkboxes. When a checkbox is ✔️, it means the change has been implemented.
Here is a list of breaking changes from each dependency that were implemented in the project:
Over time, the project may receive more migrations of other plugins, libraries, etc., which can cause breaking changes.
- First, leave ⭐ if you liked it!
- Fork this repository.
- Create a branch for your feature:
git checkout -b my-feature - If you are adding a new dependency breaking change:
- Create a folder with the dependency's name in
src/operation/tranformer. - Inside this folder, create a folder for scripts and/or templates.
- Create a constant containing all functions from this dependency as
{dependency}_TEMPLATE_TRANSFORM_LISTor{dependency}_SCRIPT_TRANSFORM_LIST. - In
src/operation/tranformer/index.js, import your constant totemplateRulesorscriptRules. - Create a
README.mdfile to list breaking changes, whether they have been migrated or not. - Follow the steps below..
- Create a folder with the dependency's name in
- If you are updating an existing dependency breaking change:
- Add a breaking change message in
src/utils/message.js. - Create a function in
src/operation/tranformer/{dependency}/template/index.jsorsrc/operation/tranformer/{dependency}/script/index.js. - Include
showLogwith a new breaking change message in the created function. - Add the created function to
{dependency}_TEMPLATE_TRANSFORM_LISTor{dependency}_SCRIPT_TRANSFORM_LIST.
- Add a breaking change message in
- Commit:
git commit -m 'feat: my new feature' - Push your branch:
git push origin my-feature
This project is under the MIT license. see the license page for more details.
Made by Matheus Almeida