Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-class-migrator

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-class-migrator

CLI tool to help migrating vue class components to vue 3 compatible components.

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
178
increased by15.58%
Maintainers
0
Weekly downloads
 
Created
Source

CI

npm npm

Vue Class Migrator CLI

Vue Class Migrator is a utility designed to facilitate the migration of Vue and TypeScript files using the @component decorator from vue-class-components to the defineComponent format. Under the hood, it employs ts-morph for parsing and generating files.

Installation

You can install vue-class-migrator globally using npm:

npm install -g vue-class-migrator

How to use the tool

Accepted options

  • -d: Specifies the directory you want to migrate.
  • --sfc: (Optional flag, default: false) Removes original TS and style files, generating a final Vue Single File Component (SFC).
npm run migrate -- -d <your_path>

Considerations

The tool also migrates decorators from vuex-class and vue-property-decorator.

If the tool encounters unsupported code in your class, it will produce errors. Monitor the output and verify the generated file. In such cases, you can contribute to the migrator to add support or correct the file manually.

Migration workflow recommendation

Initially, avoid using --sfc directly.

First, run the tool without it and compare the changes in the TS files using version control. If satisfied, discard the changes and rerun with --sfc.

Compatibility note

In addition to migrating the class to the defineComponent format, vue-class-migrator also migrates the following libraries out of the box.

vuex-class

DecoratorSupport
@State❌ Not yet
@Getter
@namespace.Getter❌ Not yet
@Action
@Mutation

vue-property-decorator

DecoratorSupport
@Prop
@PropSync
@Model
@ModelSync
@Watch
@Provide❌ Not yet
@Inject❌ Not yet
@ProvideReactive❌ Not yet
@InjectReactive❌ Not yet
@Emit❌ Not yet
@Ref
@VModel❌ Not yet
@Component
@Mixins

Security

For security matters please contact security@getyourguide.com.

Copyright 2023 GetYourGuide GmbH.

vue-class-migrator is licensed under the Apache License, Version 2.0. See LICENSE for the full text.

Keywords

FAQs

Package last updated on 25 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc