1.0.7 • Published 5 years ago

typevue v1.0.7

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

TypeVUE

Convert *.vue file from JavaScript object to TypeScript class;

Use

$ yarn global add typevue
# or
$ npm i -g typevue
$ typevue -d <input_path> -o <output_path> -c <config_file>

Config file format

Config file should be a json file or a js with module.exports = { ... };

// config schema
{
    "cssType": "css",
    "jsPathReg": "mixin",
    "importMap": {
        "ListMixin": {
            "oldPathReg": "@/common(/index)?",
            "newPath": "rds-vue"
        },
        "SelectMixin": {
            "oldPathReg": "@/common(/index)?",
            "newPath": "rds-vue"
        },
        "SomeModule": {
            "oldPath": "~/global",
            "newPath": "global-path"
        }
    }
}

cssType is used to specify the css language, default is css;

jsPathReg is used to set which path the js file will be transform;

importMap is used to change moudules import path, the oldPath property has high priority then oldPathReg;

TODO

  • provide/inject support;
  • replace substring;
  • generate code from AST;
1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago