@mainset/cli 0.4.3 ā 0.4.4-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,6 +10,8 @@ function registerNodeSourcerCommand(program) {
|
|
|
10
10
|
.requiredOption('-e, --exec <type>', 'Execution mode: build or watch')
|
|
11
11
|
// .option('-b, --builder <builder>', 'Builder tool (default: rslib)', 'rslib')
|
|
12
12
|
.option('-c, --config <path>', 'Path to config file', './rslib.config.mts')
|
|
13
|
+
.option('--noTypes', 'Skip type-only compilation step', false)
|
|
14
|
+
.option('--noPurge', 'Skip purging the dist folder before build', false)
|
|
13
15
|
.action((options) => {
|
|
14
16
|
// Step 0: determinate command params
|
|
15
17
|
const customRslibConfigPath = path.resolve(runtimePathById.root, options.config);
|
|
@@ -23,12 +25,14 @@ function registerNodeSourcerCommand(program) {
|
|
|
23
25
|
console.log('\nšļø [mainset cli] node-sourcer: build');
|
|
24
26
|
try {
|
|
25
27
|
// Step 1: purge dist folder
|
|
26
|
-
|
|
28
|
+
if (!options.noPurge)
|
|
29
|
+
execImmediatePurgeDist();
|
|
27
30
|
// Step 2: build source code
|
|
28
31
|
console.log('\nš¦ Compiling Source Code with Rslib ...');
|
|
29
32
|
execImmediateRslibCLICommand(`build --config ${rslibConfigPath}`);
|
|
30
33
|
// Step 3: build type only
|
|
31
|
-
|
|
34
|
+
if (!options.noTypes)
|
|
35
|
+
execImmediateTypeScriptCompileTypeOnly();
|
|
32
36
|
console.log('\nā
Build completed successfully\n');
|
|
33
37
|
}
|
|
34
38
|
catch (error) {
|
|
@@ -40,7 +44,8 @@ function registerNodeSourcerCommand(program) {
|
|
|
40
44
|
console.log('\nšļø [mainset cli] node-sourcer: watch');
|
|
41
45
|
try {
|
|
42
46
|
// Step 1: purge dist folder
|
|
43
|
-
|
|
47
|
+
if (!options.noPurge)
|
|
48
|
+
execImmediatePurgeDist();
|
|
44
49
|
// Step 2: watch source code
|
|
45
50
|
runStreamingRslibCLICommand([
|
|
46
51
|
'build',
|
|
@@ -49,7 +54,8 @@ function registerNodeSourcerCommand(program) {
|
|
|
49
54
|
'--watch',
|
|
50
55
|
]);
|
|
51
56
|
// Step 3: watch type only
|
|
52
|
-
|
|
57
|
+
if (!options.noTypes)
|
|
58
|
+
runStreamingTypeScriptCompileTypeOnly();
|
|
53
59
|
}
|
|
54
60
|
catch (error) {
|
|
55
61
|
initProcessCatchErrorLogger('node-sourcer', error, 'watch');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mainset/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4-rc.1",
|
|
4
4
|
"description": "A unified CLI tool for accelerating development, based on mainset vision of front-end infrastructure",
|
|
5
5
|
"homepage": "https://github.com/mainset/dev-stack-fe/tree/main/packages/cli",
|
|
6
6
|
"bugs": {
|