forked from tec8297729/fe-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfe
More file actions
executable file
·42 lines (39 loc) · 1.26 KB
/
fe
File metadata and controls
executable file
·42 lines (39 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env node
const { program } = require('commander');
const figlet = require('figlet');
const Printer = require('@darkobits/lolcatjs');
const shell = require('shelljs');
const chalk = require('chalk');
const inquirer = require('inquirer');
const ora = require('ora');
const download = require('download-git-repo');
const { version } = require('../package.json');
const api2code = require('../scripts/api2code');
const vue2code = require('../scripts/vue2code');
const react2code = require('../scripts/react2code');
const envir2code = require('../scripts/envir2code');
const loadConfig = require('../lib/loadConfig');
const versionStr = figlet.textSync('Fe Code');
program.version(
Printer.fromString(
` \n 前端代码生成器${version}\n www.yidengfe.com \n${versionStr}`,
),
);
// 接口生成代码部分
api2code(program);
// 生成Vue代码部分
vue2code(program);
// 生成react代码部分
react2code(program);
// 生成运行环境代码部分
envir2code(program);
program
.usage('[对应Commands]')
.arguments('<cmd>')
.action((cmd, otherParmas) => {
const whiteList = ['api2ts'];
if (whiteList.indexOf(cmd) < 0) {
console.log(`🐝 ${chalk.blue(`${cmd}`)} ${chalk.red('暂未支持~')}`);
}
});
program.parse(process.argv);