@mpis/monorepo 0.0.24 → 0.0.26
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function runBuild(): Promise<
|
|
1
|
+
export declare function runBuild(): Promise<never>;
|
|
2
2
|
//# sourceMappingURL=cmd.build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd.build.d.ts","sourceRoot":"","sources":["../../src/actions/cmd.build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cmd.build.d.ts","sourceRoot":"","sources":["../../src/actions/cmd.build.ts"],"names":[],"mappings":"AA2CA,wBAAsB,QAAQ,mBAmF7B"}
|
package/lib/actions/cmd.build.js
CHANGED
|
@@ -1,18 +1,45 @@
|
|
|
1
1
|
import { argv } from '@idlebox/args/default';
|
|
2
|
-
import { functionToDisposable, prettyPrintError, registerGlobalLifecycle } from '@idlebox/common';
|
|
2
|
+
import { convertCaughtError, functionToDisposable, Interval, prettyPrintError, registerGlobalLifecycle, RequiredMap } from '@idlebox/common';
|
|
3
3
|
import { logger } from '@idlebox/logger';
|
|
4
|
-
import {
|
|
4
|
+
import { CollectingStream, isShuttingDown, shutdown } from '@idlebox/node';
|
|
5
5
|
import { terminal } from '@idlebox/terminal-control/default';
|
|
6
6
|
import { CompileError } from '@mpis/server';
|
|
7
7
|
import { url } from 'node:inspector';
|
|
8
8
|
import { debugMode } from '../common/args.js';
|
|
9
9
|
import { createMonorepoObject } from '../common/workspace.js';
|
|
10
|
+
const ciState = new RequiredMap();
|
|
11
|
+
function createProjectState(displayTitle) {
|
|
12
|
+
const buffer = new CollectingStream();
|
|
13
|
+
const timer = new Interval(300);
|
|
14
|
+
timer.onTick(() => {
|
|
15
|
+
if (isShuttingDown())
|
|
16
|
+
return;
|
|
17
|
+
flush();
|
|
18
|
+
});
|
|
19
|
+
const r = { timer, buffer, status: false };
|
|
20
|
+
function flush() {
|
|
21
|
+
const output = buffer.getOutput().trim();
|
|
22
|
+
if (!output)
|
|
23
|
+
return;
|
|
24
|
+
console.log(`::group::${r.status ? '✅ 成功' : '❌ 失败'} - ${displayTitle}`);
|
|
25
|
+
if (output) {
|
|
26
|
+
console.log(output);
|
|
27
|
+
}
|
|
28
|
+
console.log(`::endgroup::`);
|
|
29
|
+
buffer.clear();
|
|
30
|
+
}
|
|
31
|
+
registerGlobalLifecycle(functionToDisposable(() => {
|
|
32
|
+
timer.dispose();
|
|
33
|
+
flush();
|
|
34
|
+
}));
|
|
35
|
+
return r;
|
|
36
|
+
}
|
|
10
37
|
export async function runBuild() {
|
|
11
38
|
if (argv.unused().length) {
|
|
12
39
|
logger.error `Unknown arguments: ${argv.unused().join(', ')}`;
|
|
13
40
|
return shutdown(1);
|
|
14
41
|
}
|
|
15
|
-
const hasCi = process.env.CI;
|
|
42
|
+
const hasCi = !!process.env.CI;
|
|
16
43
|
const activeOutput = !debugMode && !hasCi && !url();
|
|
17
44
|
const repo = await createMonorepoObject();
|
|
18
45
|
if (activeOutput) {
|
|
@@ -26,8 +53,9 @@ export async function runBuild() {
|
|
|
26
53
|
repo.printScreen();
|
|
27
54
|
});
|
|
28
55
|
}
|
|
56
|
+
let cid;
|
|
29
57
|
if (hasCi) {
|
|
30
|
-
repo.onStateChange((project) => {
|
|
58
|
+
cid = repo.onStateChange((project) => {
|
|
31
59
|
if (isShuttingDown())
|
|
32
60
|
return;
|
|
33
61
|
const worker = repo._debugWorker(project);
|
|
@@ -35,13 +63,21 @@ export async function runBuild() {
|
|
|
35
63
|
console.error(`[impossible] Worker for project ${project.name} not found`);
|
|
36
64
|
return;
|
|
37
65
|
}
|
|
66
|
+
const state = ciState.entry(worker.displayTitle, createProjectState);
|
|
38
67
|
if (worker.isSuccess || worker.isFail) {
|
|
39
68
|
const output = worker.outputStream.toString().trim();
|
|
40
69
|
if (output) {
|
|
41
|
-
|
|
42
|
-
console.log(output);
|
|
43
|
-
console.log(`::endgroup::`);
|
|
70
|
+
state.buffer.write(output);
|
|
44
71
|
}
|
|
72
|
+
state.status = worker.isSuccess;
|
|
73
|
+
state.timer.reset();
|
|
74
|
+
// console.error(repo.workersManager.finalize().debugFormatSummary());
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// start
|
|
78
|
+
state.status = false;
|
|
79
|
+
state.buffer.clear();
|
|
80
|
+
state.timer.pause();
|
|
45
81
|
}
|
|
46
82
|
});
|
|
47
83
|
}
|
|
@@ -50,11 +86,13 @@ export async function runBuild() {
|
|
|
50
86
|
}));
|
|
51
87
|
try {
|
|
52
88
|
await repo.startup();
|
|
89
|
+
cid?.dispose();
|
|
53
90
|
logger.success('Monorepo started successfully');
|
|
54
91
|
// completed = true;
|
|
55
|
-
setExitCodeIfNot(0);
|
|
56
92
|
}
|
|
57
93
|
catch (error) {
|
|
94
|
+
cid?.dispose();
|
|
95
|
+
const e = convertCaughtError(error);
|
|
58
96
|
if (activeOutput) {
|
|
59
97
|
terminal.reset();
|
|
60
98
|
}
|
|
@@ -62,13 +100,14 @@ export async function runBuild() {
|
|
|
62
100
|
console.error('='.repeat(process.stderr.columns || 80));
|
|
63
101
|
}
|
|
64
102
|
repo.printScreen(false, true);
|
|
65
|
-
if (!logger.debug.isEnabled &&
|
|
66
|
-
logger.error `编译失败: ${
|
|
103
|
+
if (!logger.debug.isEnabled && e instanceof CompileError) {
|
|
104
|
+
logger.error `编译失败: ${e.message}`;
|
|
67
105
|
}
|
|
68
106
|
else {
|
|
69
|
-
prettyPrintError('monorepo build',
|
|
107
|
+
prettyPrintError('monorepo build', e);
|
|
70
108
|
}
|
|
71
109
|
shutdown(1);
|
|
72
110
|
}
|
|
111
|
+
shutdown(0);
|
|
73
112
|
}
|
|
74
113
|
//# sourceMappingURL=cmd.build.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd.build.js","sourceRoot":"","sources":["../../src/actions/cmd.build.ts"],"names":[],"mappings":"AAAA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6
|
+
"license": "MIT",
|
|
7
|
+
"author": "GongT <admin@gongt.me>",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./package.json": "./package.json"
|
|
10
|
+
},
|
|
6
11
|
"bin": {
|
|
7
12
|
"build-manager": "./loader/bin.js",
|
|
8
13
|
"mpis-build": "./loader/bin.js"
|
|
9
14
|
},
|
|
10
|
-
"exports": {
|
|
11
|
-
"./package.json": "./package.json"
|
|
12
|
-
},
|
|
13
15
|
"dependencies": {
|
|
14
16
|
"@rushstack/rig-package": "^0.6.0",
|
|
15
17
|
"split-cmd": "^1.1.0",
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
18
|
-
"@idlebox/common": "^1.5.
|
|
19
|
-
"@idlebox/logger": "^0.0.
|
|
20
|
-
"@idlebox/node": "^1.4.
|
|
21
|
-
"@
|
|
22
|
-
"@idlebox/
|
|
23
|
-
"@
|
|
18
|
+
"@build-script/monorepo-lib": "^0.0.27",
|
|
19
|
+
"@idlebox/args": "^0.0.28",
|
|
20
|
+
"@idlebox/common": "^1.5.25",
|
|
21
|
+
"@idlebox/logger": "^0.0.26",
|
|
22
|
+
"@idlebox/node": "^1.4.33",
|
|
23
|
+
"@idlebox/source-map-support": "^0.0.22",
|
|
24
|
+
"@idlebox/terminal-control": "^0.0.6",
|
|
25
|
+
"@mpis/server": "^0.0.23"
|
|
24
26
|
},
|
|
25
27
|
"devDependencies": {
|
|
26
|
-
"test": "./test",
|
|
27
28
|
"@types/node": "^25.5.0",
|
|
28
|
-
"@mpis/typescript": "^0.0.24",
|
|
29
|
-
"@mpis/run": "^0.0.26",
|
|
30
29
|
"@build-script/baseline-rig": "latest"
|
|
31
30
|
},
|
|
32
|
-
"sideEffects": false,
|
|
33
|
-
"license": "MIT",
|
|
34
|
-
"author": "GongT <admin@gongt.me>",
|
|
35
31
|
"repository": {
|
|
36
32
|
"type": "git",
|
|
37
33
|
"url": "git+https://github.com/GongT/baobao.git",
|
|
38
34
|
"directory": "@mpis/monorepo"
|
|
39
35
|
},
|
|
36
|
+
"sideEffects": false,
|
|
40
37
|
"scripts": {
|
|
41
38
|
"build": "mpis-run build",
|
|
42
39
|
"watch": "mpis-run watch",
|
package/src/actions/cmd.build.ts
CHANGED
|
@@ -1,20 +1,53 @@
|
|
|
1
1
|
import { argv } from '@idlebox/args/default';
|
|
2
|
-
import { functionToDisposable, prettyPrintError, registerGlobalLifecycle } from '@idlebox/common';
|
|
2
|
+
import { convertCaughtError, functionToDisposable, Interval, prettyPrintError, registerGlobalLifecycle, RequiredMap } from '@idlebox/common';
|
|
3
3
|
import { logger } from '@idlebox/logger';
|
|
4
|
-
import {
|
|
4
|
+
import { CollectingStream, isShuttingDown, shutdown } from '@idlebox/node';
|
|
5
5
|
import { terminal } from '@idlebox/terminal-control/default';
|
|
6
6
|
import { CompileError } from '@mpis/server';
|
|
7
7
|
import { url } from 'node:inspector';
|
|
8
8
|
import { debugMode } from '../common/args.js';
|
|
9
9
|
import { createMonorepoObject } from '../common/workspace.js';
|
|
10
10
|
|
|
11
|
+
const ciState = new RequiredMap<string, ReturnType<typeof createProjectState>>();
|
|
12
|
+
function createProjectState(displayTitle: string) {
|
|
13
|
+
const buffer = new CollectingStream();
|
|
14
|
+
const timer = new Interval(300);
|
|
15
|
+
timer.onTick(() => {
|
|
16
|
+
if (isShuttingDown()) return;
|
|
17
|
+
flush();
|
|
18
|
+
});
|
|
19
|
+
const r = { timer, buffer, status: false };
|
|
20
|
+
|
|
21
|
+
function flush() {
|
|
22
|
+
const output = buffer.getOutput().trim();
|
|
23
|
+
if (!output) return;
|
|
24
|
+
|
|
25
|
+
console.log(`::group::${r.status ? '✅ 成功' : '❌ 失败'} - ${displayTitle}`);
|
|
26
|
+
if (output) {
|
|
27
|
+
console.log(output);
|
|
28
|
+
}
|
|
29
|
+
console.log(`::endgroup::`);
|
|
30
|
+
|
|
31
|
+
buffer.clear();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
registerGlobalLifecycle(
|
|
35
|
+
functionToDisposable(() => {
|
|
36
|
+
timer.dispose();
|
|
37
|
+
flush();
|
|
38
|
+
}),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return r;
|
|
42
|
+
}
|
|
43
|
+
|
|
11
44
|
export async function runBuild() {
|
|
12
45
|
if (argv.unused().length) {
|
|
13
46
|
logger.error`Unknown arguments: ${argv.unused().join(', ')}`;
|
|
14
47
|
return shutdown(1);
|
|
15
48
|
}
|
|
16
49
|
|
|
17
|
-
const hasCi = process.env.CI;
|
|
50
|
+
const hasCi = !!process.env.CI;
|
|
18
51
|
const activeOutput = !debugMode && !hasCi && !url();
|
|
19
52
|
const repo = await createMonorepoObject();
|
|
20
53
|
|
|
@@ -28,8 +61,10 @@ export async function runBuild() {
|
|
|
28
61
|
repo.printScreen();
|
|
29
62
|
});
|
|
30
63
|
}
|
|
64
|
+
|
|
65
|
+
let cid;
|
|
31
66
|
if (hasCi) {
|
|
32
|
-
repo.onStateChange((project) => {
|
|
67
|
+
cid = repo.onStateChange((project) => {
|
|
33
68
|
if (isShuttingDown()) return;
|
|
34
69
|
|
|
35
70
|
const worker = repo._debugWorker(project);
|
|
@@ -37,13 +72,22 @@ export async function runBuild() {
|
|
|
37
72
|
console.error(`[impossible] Worker for project ${project.name} not found`);
|
|
38
73
|
return;
|
|
39
74
|
}
|
|
75
|
+
|
|
76
|
+
const state = ciState.entry(worker.displayTitle, createProjectState);
|
|
40
77
|
if (worker.isSuccess || worker.isFail) {
|
|
41
78
|
const output = worker.outputStream.toString().trim();
|
|
42
79
|
if (output) {
|
|
43
|
-
|
|
44
|
-
console.log(output);
|
|
45
|
-
console.log(`::endgroup::`);
|
|
80
|
+
state.buffer.write(output);
|
|
46
81
|
}
|
|
82
|
+
state.status = worker.isSuccess;
|
|
83
|
+
state.timer.reset();
|
|
84
|
+
|
|
85
|
+
// console.error(repo.workersManager.finalize().debugFormatSummary());
|
|
86
|
+
} else {
|
|
87
|
+
// start
|
|
88
|
+
state.status = false;
|
|
89
|
+
state.buffer.clear();
|
|
90
|
+
state.timer.pause();
|
|
47
91
|
}
|
|
48
92
|
});
|
|
49
93
|
}
|
|
@@ -56,11 +100,14 @@ export async function runBuild() {
|
|
|
56
100
|
|
|
57
101
|
try {
|
|
58
102
|
await repo.startup();
|
|
103
|
+
cid?.dispose();
|
|
59
104
|
|
|
60
105
|
logger.success('Monorepo started successfully');
|
|
61
106
|
// completed = true;
|
|
62
|
-
setExitCodeIfNot(0);
|
|
63
107
|
} catch (error: any) {
|
|
108
|
+
cid?.dispose();
|
|
109
|
+
|
|
110
|
+
const e = convertCaughtError(error);
|
|
64
111
|
if (activeOutput) {
|
|
65
112
|
terminal.reset();
|
|
66
113
|
} else {
|
|
@@ -68,11 +115,13 @@ export async function runBuild() {
|
|
|
68
115
|
}
|
|
69
116
|
repo.printScreen(false, true);
|
|
70
117
|
|
|
71
|
-
if (!logger.debug.isEnabled &&
|
|
72
|
-
logger.error`编译失败: ${
|
|
118
|
+
if (!logger.debug.isEnabled && e instanceof CompileError) {
|
|
119
|
+
logger.error`编译失败: ${e.message}`;
|
|
73
120
|
} else {
|
|
74
|
-
prettyPrintError('monorepo build',
|
|
121
|
+
prettyPrintError('monorepo build', e);
|
|
75
122
|
}
|
|
76
123
|
shutdown(1);
|
|
77
124
|
}
|
|
125
|
+
|
|
126
|
+
shutdown(0);
|
|
78
127
|
}
|
package/src/tsconfig.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"extends": "@build-script/baseline-rig/package/tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"typeRoots": [
|
|
5
|
+
"../node_modules/@types",
|
|
6
|
+
"../node_modules"
|
|
7
|
+
],
|
|
8
|
+
"outDir": "../lib",
|
|
9
|
+
"rootDir": "./"
|
|
10
|
+
}
|
|
8
11
|
}
|