-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
index.ts
66 lines (53 loc) · 2.45 KB
/
index.ts
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env -S node --no-warnings --experimental-specifier-resolution=node
import downloadMaterialSource from "./actions/downloadMaterialSource";
import extractMaterialSource from "./actions/extractMaterialSource";
import genIconsMaterialSource from "./actions/genIconsMaterialSource";
import genIconsMaterialTyping from "./actions/genIconsMaterialTyping";
import genRoadmap from "./actions/genRoadmap";
import pack from "./actions/pack";
import patchTsConfigs from "./actions/patchTsConfigs";
import prebuild from "./actions/prebuild";
import syncIconsMaterial from "./actions/syncIconsMaterial";
import syncMaterialSource from "./actions/syncMaterialSource";
import { program } from "commander";
const muiVersion = "5.5.0";
export function snakeCase(value: string) {
return value.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
}
program
.command(snakeCase(downloadMaterialSource.name))
.option("--version [value]", "Material UI version", muiVersion)
.action((options: { version: string }) => downloadMaterialSource(options));
program
.command(snakeCase(extractMaterialSource.name))
.option("--version [value]", "Material UI version", muiVersion)
.action((options: { version: string }) => extractMaterialSource(options));
program
.command(snakeCase(genIconsMaterialSource.name))
.option("--version [value]", "Material UI version", muiVersion)
.action((options: { version: string }) => genIconsMaterialSource(options));
program
.command(snakeCase(genIconsMaterialTyping.name))
.action(() => genIconsMaterialTyping());
program.command(snakeCase(patchTsConfigs.name)).action(() => patchTsConfigs());
program.command(snakeCase(prebuild.name)).action(() => prebuild());
program
.command(snakeCase(genRoadmap.name))
.option("--version [value]", "Material UI version", muiVersion)
.action((options: { version: string }) => genRoadmap(options));
program
.command(snakeCase(pack.name))
.option(
"--patch [packagePath]",
"Patches the package file with the npm override config"
)
.action((options: { patch?: string }) => pack(options));
program
.command(snakeCase(syncIconsMaterial.name))
.option("--version [value]", "Material UI version", muiVersion)
.action((options: { version: string }) => syncIconsMaterial(options));
program
.command(snakeCase(syncMaterialSource.name))
.option("--version [value]", "Material UI version", muiVersion)
.action((options: { version: string }) => syncMaterialSource(options));
program.parse();