vue-jscodeshift-adapter

Run jscodeshift on Vue single file components
1,779,231 32
Install
npm install vue-jscodeshift-adapter
Latest Version:3.0.0
License:MIT
Last Updated:May 11, 2024
Links: GitHub  ·  npm
Maintainer: psalaets

vue-jscodeshift-adapter

Build Status

Run jscodeshift on Vue single file components

Install

npm install vue-jscodeshift-adapter -D

Usage

The instructions below assume you're familiar with jscodeshift.

Run a codemod on some .js and/or .vue files

When transforming fileInfo.source will be
.js the contents of the file
.vue the contents of <script>

The source file will be updated appropriately based on the return value of your transform().

If .vue file doesn't have a <script>, your transform() will not be called and the source file will not be changed.

1. Create wrapped transform function
// my-transform.js
import adapt from 'vue-jscodeshift-adapter';
import someCodemod from 'some-codemod';

export default adapt(someCodemod);
2. Run jscodeshift
$ jscodeshift <path> -t my-transform.js --extensions vue,js

See jscodeshift readme for more info on jscodeshift CLI.

License

MIT

Related Packages

j-vue

.vue single-file component back-end compiler. Belong to "Plan J"./.vue 单文件组...

6,068 7
vue-metamorph

Codemod framework for Vue files

3,458,690 121
@vue/component-compiler

bundler agnostic API for compiling Vue SFC

3,126,609 343
@vuedx/compiler-sfc

This package extracts `parse()` function [@vue/compiler-sfc] as ES module.

250,768 1,251
@femessage/log-viewer

💻 View terminal logs in browser

11,528 119

Version History

Version Released License
3.0.0 MIT
2.2.1 MIT
2.2.0 MIT
2.1.0 MIT
2.0.3 MIT