npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue3-migrate

v1.2.4

Published

This is a command-line tool that utilizes ChatGPT to automatically refactor Vue.js code from version 2 to version 3.

Downloads

5

Readme

npm version npm downloads NPM license donate GitHub Repo stars

Vue.js Code Migration Tool

This is a command-line tool that utilizes ChatGPT to automatically refactor Vue.js code from version 2 to version 3. It helps developers migrate their code by transforming it to use Typescript with the Composition API.

Usage

Installation

npm install -g vue3-migrate

Refactor a Single Vue File

To refactor a single Vue file, use the convert command:

$ vue3-migrate convert <filename> [options]

Replace <filename> with the path to the Vue file you want to refactor.

Options

  • -t, --token <token>: Specify the GPT token (required)
  • -m, --model <model>: Specify the GPT model to use (default: gpt-3.5-turbo-16k, optional)
  • -p, --prompt <prompt>: Specify the path to the prompt file (optional)
  • -mt, --max_tokens <max_tokens>: The GPT max tokens (default: 4096, optional).
  • -r, --replace: replace exist refactor files.

see help: vue3-migrate convert -h

Refactor All Vue Files in a Directory

To refactor all Vue files in a directory, use the directory command:

$ vue3-migrate directory <directory> [options]

Replace <directory> with the path to the directory containing the Vue files you want to refactor.

Options

  • -t, --token <token>: Specify the GPT token (required)
  • -m, --model <model>: Specify the GPT model to use (default: gpt-3.5-turbo-16k, optional)
  • -p, --prompt <prompt>: Specify the path to the prompt file (optional)
  • -t, --timeout <timeout>: The timeout option allows you to specify the timeout duration in milliseconds between each refactoring request when using the directory command. It determines the waiting time before sending the next request to the OpenAI API (default: 20 seconds, optional).
  • -mt, --max_tokens <max_tokens>: The GPT max tokens (default: 4096, optional).
  • -r, --replace: replace exist refactor files.

see help: vue3-migrate convert -h

Examples

Refactor a single Vue file:

$ vue3-migrate convert /path/MyView.vue --token=sk-...

Refactor all Vue files in a directory:

$ vue3-migrate directory /path/src/components --token=sk-...

Configuration

Before running the tool, make sure to set up the following:

  1. Obtain a GPT token from OpenAI. You can sign up for an API key at https://openai.com/.
  2. Create a prompt text file (md for example, default: prompt.md) that contains the instructions for the refactoring process. This file should specify the rules and guidelines for the refactoring.

Notes

  • The tool uses the OpenAI GPT API for code refactoring. Make sure you have a valid API key and appropriate permissions.
  • It's recommended to review the refactored code manually to ensure correctness and make any necessary adjustments.

License

This project is licensed under the MIT License.