-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
executable file
·55 lines (43 loc) · 1.14 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
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env node
import shelljs from "shelljs";
import {
commit,
execOrFail,
gitignore,
logEnd,
logStart,
} from "./helpers/index.js";
import { addPrettier } from "./prettier/index.js";
import { addStylelint } from "./stylelint/index.js";
import { execFileSync } from "child_process";
import { addEslint } from "./eslint/index.js";
import { addLefthook } from "./lefthook/index.js";
const appName = process.argv[2];
logStart("Scaffolding Angular application...");
execFileSync("npx", ["@angular/cli@18", "new", appName, "--style", "scss"], {
stdio: "inherit",
});
logEnd("Angular application scaffolded");
shelljs.cd(appName);
addEslint();
commit("Add ESLint");
gitignore(`# lint caches
.eslintcache`);
commit("Add .eslintcache to .gitignore");
addPrettier();
commit("Add Prettier");
addStylelint();
commit("Add Stylelint");
gitignore(`.stylelintcache`);
commit("Add .stylelintcache to .gitignore");
// Add svgo
execOrFail({
cmd: "npm i -D svgo@3",
startMsg: "Installing svgo",
errorMsg: "Error during svgo installation",
endMsg: "svgo installed",
});
commit("Add SVGo");
addLefthook();
commit("Add Lefthook");
logEnd("Ready to work!");