vue-transformer is a utility to transform Vue components written using the Options API to the Composition API. This tool aims to facilitate the transition to Vue 3's Composition API by automating the transformation process for various component options such as data, methods, computed, lifecycle hooks, and more.
First, clone the repository and navigate to its directory:
git clonehttps://github.com/mpiniarski/vue-options-to-compostion.git
cd vue-options-to-compositionInstall the dependencies:
npm installThe vue-transformer tool can be run from the command line. Provide the path to the source file you want to transform and an optional destination path for the transformed file.
npm start path/to/sourceFile.vue [path/to/destinationFile.vue]For example:
npm start src/components/MyComponent.vue dist/components/MyComponent-composition.vueFeel free to open an issue or submit a pull request if you encounter any problems or have suggestions for improvements.
The following scripts are available in the package.json file:
build: Compiles the TypeScript code to JavaScript usingtsc.start: Runs the transformation script usingts-node.test: Runs the test suite using Jest.pbcopy: Copies project files to a clipboard using a custom script.