-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathmain.ts
126 lines (124 loc) · 3.28 KB
/
main.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import { postinstall } from './postinstall';
import { setup } from './setup';
import { buildTypes } from './build-types';
import { preCommit } from './pre-commit';
import { buildClient, packClient } from './client';
import { buildBackend, buildUtils, packBackend, packUtils } from './backend';
import { buildSdk, packSdk } from './sdk';
import { buildUi, buildUiComponents, packUiComponents } from './ui';
import { publish } from './utils/publish';
import { createMainDockerImage } from './docker';
import { buildCli, packCli } from './cli';
async function main() {
const command = process.argv[2];
switch (command) {
case '--postinstall': {
await postinstall();
await setup();
await buildTypes();
return;
}
case '--setup': {
await setup();
await buildTypes();
return;
}
case '--pre-commit': {
return await preCommit();
}
case '--build-types': {
return await buildTypes();
}
case '--build-client': {
await buildClient();
return;
}
case '--pack-client': {
await packClient();
return;
}
case '--publish-client': {
await publish(['client', 'dist']);
return;
}
case '--build-cli': {
await buildCli();
return;
}
case '--pack-cli': {
await packCli();
return;
}
case '--publish-cli': {
await publish(['cli', 'dist']);
return;
}
case '--build-utils': {
await buildUtils();
return;
}
case '--pack-utils': {
await packUtils();
return;
}
case '--publish-utils': {
await publish(['backend', 'dist-utils']);
return;
}
case '--build-backend': {
await buildBackend();
return;
}
case '--build-backend-package': {
await buildBackend();
return;
}
case '--pack-backend': {
await packBackend();
return;
}
case '--publish-backend': {
await publish(['backend', 'dist']);
return;
}
case '--build-sdk': {
await buildSdk();
return;
}
case '--pack-sdk': {
await packSdk();
return;
}
case '--publish-sdk': {
await publish(['ui', 'dist-sdk']);
return;
}
case '--build-ui': {
await buildUi();
return;
}
case '--build-ui-components': {
await buildUiComponents();
return;
}
case '--pack-ui-components': {
await packUiComponents();
return;
}
case '--publish-ui-components': {
await publish(['ui', 'dist-components']);
return;
}
case '--build-docker-image': {
await createMainDockerImage();
return;
}
default: {
throw Error(`Unknown command: ${command}`);
}
}
}
main().catch((err) => {
console.error(err);
process.exit(1);
});