-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
executable file
·44 lines (37 loc) · 1.1 KB
/
index.js
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
43
44
#!/usr/bin/env node
const clear = require("clear");
const inquirer = require("inquirer");
const { log } = require("./utils");
const { createLibBabel } = require("./create-lib-babel/create-lib-babel");
const { createLibTsReact } = require("./create-lib-ts-react/create-lib-ts-react");
const choose = () => {
const choices = [
{ name: "Opinionated React setup with Webpack 4 and Typescript", value: "CREATELIBTSREACT" },
{ name: "Opinionated JavaScript library setup with Babel ES6", value: "CREATELIBBABEL" },
{ name: "Upcoming?", disabled: "Dunno what else", value: "UPCOMING" }
];
const questions = [
{
type: "list",
name: "SCRIPTS",
message: "Choose script:",
choices
}
];
return inquirer.prompt(questions);
};
const run = async () => {
clear();
log.figlet();
const { SCRIPTS } = await choose();
console.log(SCRIPTS);
if(SCRIPTS === 'CREATELIBBABEL') {
createLibBabel();
} else if(SCRIPTS === 'CREATELIBTSREACT') {
createLibTsReact();
} else {
log.info('Bye bye!');
}
}
// TODO: update .jkallunki-scripts instead of erasing
run();