# vue_miga

> Migrating Vue 2 codes to Composition API

Latest version **1.0.4** (published 2023-07-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install vue_miga
pnpm add vue_miga
yarn add vue_miga
bun add vue_miga
```

Provides the command `miga`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-07-24 |
| First published | 2023-07-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 73.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vo Truong An |
| Maintainers | laughing-cli |

## Links

- npm: https://www.npmjs.com/package/vue_miga
- npm.io page: https://npm.io/package/vue_miga

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21

## Recent versions

- 1.0.4 (latest) — 2023-07-24
- 1.0.3 — 2023-07-24
- 1.0.2 — 2023-07-24
- 1.0.1 — 2023-07-24
- 0.0.1 — 2023-07-24
- 1.0.0 — 2023-07-24

## README

# Vue-miga

Tool to migrate Vue 2 component from class component or option component to composition API.

After migrate to composition API, you could move to Vue 3 quite easily.

(ClassAPI | OptionAPI) => CompositionAPI


## Limitations
Built with many assumptions so there might be some cases that cannot fully migrate and need some manual jobs.


## Installation

Download the whole folder and run the below block. Remember to let `<THE_PATH_OF_MIGA>` point to the folder that this project is at
``` bash
export VUE_MIGA_HOME=<THE_PATH_OF_MIGA>
export PATH=$VUE_MIGA_HOME/bin:$PATH

cd $VUE_MIGA_HOME
chmod +x bin/miga
```

## Before using

This tool will emit code that use `@vue/composition-api` package, so your project need to have it before running this tool:

Install the `@vue/composition-api` package:
``` bash
npm install @vue/composition-api
```

Add `composition-api` to `main.ts`:
``` javascript
import Vue from 'vue'
import VueCompositionAPI from '@vue/composition-api'

Vue.use(VueCompositionAPI)
```

## Usages

Change dir your shell to the root folder of the project that you want to convert. Foreach file you want to migrate, run:
``` bash
miga <file_path>
```

---
_Source: https://npm.io/package/vue_miga · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
