update-your-vue2
v1.1.0
Published
A CLI tool to upgrade Vue 2 projects to Vue 3.
Downloads
777
Readme
update-your-vue2
Node.js CLI to upgrade Vue 2 projects to Vue 3 (MVP scaffold).
Install / Run
- Local dev
npm i
npm run build
node dist/cli.js --help- Global (development)
npm link
update-your-vue2 --helpMigrate a project (MVP)
Config file (root)
The CLI will auto-load update-your-vue2.json from the target project root.
Example config (migrate + install dependencies):
{
"target": "vite",
"useCompat": false,
"generateTypes": false,
"backup": true,
"backupDir": ".update-your-vue2/backups",
"install": true
}You can also point to a custom config file:
update-your-vue2 --config ./path/to/update-your-vue2.json- Dry run (recommended first)
update-your-vue2 --dry-run- Also supported (alias):
update-your-vue2 dry-run- Run (creates backup zip, updates package.json, writes migration-report.md)
update-your-vue2 --no-installNotes:
- Default backup output:
.update-your-vue2/backups/*.zip - Default build target:
vite(generatesvite.config.ts) --installis opt-in and runs after file changes apply
Restore from a backup zip
- Interactive selection
update-your-vue2 restore- Restore a specific zip
update-your-vue2 restore --zip .update-your-vue2/backups/<backup>.zip- Dry run
update-your-vue2 restore --zip .update-your-vue2/backups/<backup>.zip --dry-run- Skip default pre-backup
update-your-vue2 restore --zip .update-your-vue2/backups/<backup>.zip --no-prebackupFixture (for local verification)
The repo includes a minimal sample project at playground/vue2-sample/ so you can quickly try:
node dist/cli.js playground/vue2-sample --dry-run
node dist/cli.js playground/vue2-sample --no-installExpected after non-dry-run:
package.jsondependencies/scripts migrated and old scripts backed up atupdateYourVue2.backupScriptsvite.config.tsgenerated with alias/base defaultssrc/main.jstransformed tocreateApp(...).mount(...)when pattern is safe
