vue3-migration 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# vue3-migration
|
|
2
|
+
|
|
3
|
+
A CLI tool that helps you migrate Vue 2 mixins to Vue 3 composables.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js >= 14
|
|
8
|
+
- Python >= 3.9
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -D vue3-migration
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
Run from the root of your Vue project:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx vue3-migration
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This opens an interactive menu with all options.
|
|
25
|
+
|
|
26
|
+
### Commands
|
|
27
|
+
|
|
28
|
+
| Command | Description |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `npx vue3-migration` | Interactive menu |
|
|
31
|
+
| `npx vue3-migration scan` | Scan the project — lists all components still using mixins and shows which composables already exist |
|
|
32
|
+
| `npx vue3-migration component <path>` | Migrate a single component — matches its mixins to composables and injects `setup()` |
|
|
33
|
+
| `npx vue3-migration audit <mixin> [composable]` | Audit a mixin — shows every component that uses it and what members they rely on |
|
|
34
|
+
|
|
35
|
+
### Examples
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Scan the whole project
|
|
39
|
+
npx vue3-migration scan
|
|
40
|
+
|
|
41
|
+
# Migrate a specific component
|
|
42
|
+
npx vue3-migration component src/components/UserProfile.vue
|
|
43
|
+
|
|
44
|
+
# Audit a mixin
|
|
45
|
+
npx vue3-migration audit src/mixins/authMixin.js
|
|
46
|
+
|
|
47
|
+
# Audit a mixin and compare against its composable
|
|
48
|
+
npx vue3-migration audit src/mixins/authMixin.js src/composables/useAuth.js
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Workflow
|
|
52
|
+
|
|
53
|
+
1. Run **scan** to see which components still use mixins and which composables are already available.
|
|
54
|
+
2. Pick a component and run **component** to migrate it. The tool matches each mixin to a composable, reports what's missing, and injects `setup()` for every ready composable.
|
|
55
|
+
3. To focus on a single mixin across the codebase, run **audit** to see every component that depends on it and what members they use.
|