typevue
Convert `*.vue` file from JavaScript object to TypeScript class;
Last updated 2 months ago by lzxhahaha .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install typevue 
SYNC missed versions from official npm registry.

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;

Current Tags

  • 1.0.7                                ...           latest (2 months ago)

8 Versions

  • 1.0.7                                ...           2 months ago
  • 1.0.6                                ...           2 months ago
  • 1.0.5                                ...           2 months ago
  • 1.0.4                                ...           2 months ago
  • 1.0.3                                ...           2 months ago
  • 1.0.2                                ...           2 months ago
  • 1.0.1                                ...           2 months ago
  • 1.0.0                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 17
Dependencies (6)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |