-
Notifications
You must be signed in to change notification settings - Fork 843
/
cli.js
73 lines (63 loc) · 2.21 KB
/
cli.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// @ts-check
import { program } from "commander";
import {
checkObsoleteFrameworks,
cleanFrameworkDirectories,
configureStyles,
copyProjectToDist,
createFrameworkZipArchive,
updateFrameworkLockfiles,
rebuildAllFrameworks,
rebuildSingleFramework,
} from "./cli/index.js";
program.command("zip").description("Create a zip archive of frameworks").action(createFrameworkZipArchive);
program.command("copy").description("Copy project to dist directory").action(copyProjectToDist);
program
.command("check-obsolete")
.description("Check for obsolete frameworks in the frameworks directory")
.option("--debug [boolean]", "", false)
.action((options) => {
checkObsoleteFrameworks(options);
});
program
.command("cleanup")
.description(
"Clean all framework directories of package-lock.json, yarn-lock and the elm-stuff, node-modules, bower-components and dist directories"
)
.option("--frameworks-dir-path [string]", "", "frameworks")
.option("--frameworks-types [types...]", "", ["keyed", "non-keyed"])
.action((options) => {
cleanFrameworkDirectories(options);
});
program
.command("update-lockfiles")
.description("Update lockfiles for all frameworks in the frameworks directory")
.option("--frameworks-dir-path [string]", "", "frameworks")
.option("--frameworks-types [types...]", "", ["keyed", "non-keyed"])
.option("--latest-lockfile-version [number]", "", "3")
.action((options) => {
updateFrameworkLockfiles(options);
});
program
.command("configure-styles")
.description("Configure CSS styles for all frameworks in the frameworks directory")
.option("--bootstrap [boolean]", "", false)
.option("--minimal [boolean]", "", false)
.action(async (options) => {
await configureStyles(options);
});
program
.command("rebuild-all")
.option("--ci [boolean]", "", false)
.option("--restart-with-framework [string]", "", "")
.action((options) => {
rebuildAllFrameworks({ restartWithFramework: options.restartWithFramework, useCi: options.ci });
});
program
.command("rebuild-single")
.option("-f, --frameworks [frameworks...]", "", [])
.option("--ci [boolean]", "", false)
.action((options) => {
rebuildSingleFramework(options);
});
program.parse();