@mingxy/ocosay 1.1.28 → 1.1.30
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.
|
@@ -20,7 +20,8 @@ export declare function execCapture(cmd: string, cwd?: string): {
|
|
|
20
20
|
stderr: string;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* 从已有的错误输出中检测缺失依赖
|
|
24
|
+
* @param errorOutput 已捕获的错误输出字符串
|
|
24
25
|
*/
|
|
25
|
-
export declare function detectMissingDependencies(
|
|
26
|
+
export declare function detectMissingDependencies(errorOutput: string): DetectResult;
|
|
26
27
|
//# sourceMappingURL=dependency-detector.d.ts.map
|
|
@@ -39,14 +39,14 @@ export function execCapture(cmd, cwd) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* 从已有的错误输出中检测缺失依赖
|
|
43
|
+
* @param errorOutput 已捕获的错误输出字符串
|
|
43
44
|
*/
|
|
44
|
-
export function detectMissingDependencies(
|
|
45
|
-
const
|
|
46
|
-
const missingHeaders = parseMissingHeaders(result.stderr);
|
|
45
|
+
export function detectMissingDependencies(errorOutput) {
|
|
46
|
+
const missingHeaders = parseMissingHeaders(errorOutput);
|
|
47
47
|
return {
|
|
48
48
|
missingHeaders,
|
|
49
|
-
rawOutput:
|
|
49
|
+
rawOutput: errorOutput,
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
//# sourceMappingURL=dependency-detector.js.map
|
package/dist/package.json
CHANGED
package/dist/plugin.js
CHANGED
|
@@ -6774,14 +6774,15 @@ var createFormatStream = () => new Transform({
|
|
|
6774
6774
|
callback();
|
|
6775
6775
|
}
|
|
6776
6776
|
});
|
|
6777
|
-
var stdoutStream = createFormatStream();
|
|
6778
|
-
stdoutStream.pipe(process.stdout);
|
|
6779
6777
|
var fileStream = null;
|
|
6780
6778
|
try {
|
|
6781
6779
|
const fileDest = import_pino.default.destination({ dest: logFile, mkdir: true });
|
|
6782
6780
|
fileStream = createFormatStream();
|
|
6783
6781
|
fileStream.pipe(fileDest);
|
|
6784
6782
|
} catch {
|
|
6783
|
+
const stdoutStream = createFormatStream();
|
|
6784
|
+
stdoutStream.pipe(process.stdout);
|
|
6785
|
+
fileStream = stdoutStream;
|
|
6785
6786
|
}
|
|
6786
6787
|
var logger = (0, import_pino.default)(
|
|
6787
6788
|
{
|
|
@@ -6793,8 +6794,7 @@ var logger = (0, import_pino.default)(
|
|
|
6793
6794
|
}
|
|
6794
6795
|
},
|
|
6795
6796
|
import_pino.default.multistream([
|
|
6796
|
-
{ stream:
|
|
6797
|
-
...fileStream ? [{ stream: fileStream }] : []
|
|
6797
|
+
{ stream: fileStream }
|
|
6798
6798
|
])
|
|
6799
6799
|
);
|
|
6800
6800
|
function createModuleLogger(module) {
|
|
@@ -9933,12 +9933,11 @@ function execCapture(cmd, cwd) {
|
|
|
9933
9933
|
};
|
|
9934
9934
|
}
|
|
9935
9935
|
}
|
|
9936
|
-
function detectMissingDependencies(
|
|
9937
|
-
const
|
|
9938
|
-
const missingHeaders = parseMissingHeaders(result.stderr);
|
|
9936
|
+
function detectMissingDependencies(errorOutput) {
|
|
9937
|
+
const missingHeaders = parseMissingHeaders(errorOutput);
|
|
9939
9938
|
return {
|
|
9940
9939
|
missingHeaders,
|
|
9941
|
-
rawOutput:
|
|
9940
|
+
rawOutput: errorOutput
|
|
9942
9941
|
};
|
|
9943
9942
|
}
|
|
9944
9943
|
|
|
@@ -10482,8 +10481,9 @@ async function tryCompileSpeaker() {
|
|
|
10482
10481
|
}
|
|
10483
10482
|
}
|
|
10484
10483
|
const rebuildResult = await execAsync("npm rebuild speaker", opencodeNodeModules);
|
|
10484
|
+
result.stderr = (rebuildResult.stdout || "") + "\n" + (rebuildResult.stderr || "");
|
|
10485
10485
|
if (rebuildResult.error) {
|
|
10486
|
-
result.stderr
|
|
10486
|
+
result.stderr += "\n" + (rebuildResult.error.message || "");
|
|
10487
10487
|
}
|
|
10488
10488
|
if (await verifyModuleLoad(dep)) {
|
|
10489
10489
|
result.success = true;
|
package/dist/utils/logger.js
CHANGED
|
@@ -33,8 +33,6 @@ const createFormatStream = () => new Transform({
|
|
|
33
33
|
callback();
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
const stdoutStream = createFormatStream();
|
|
37
|
-
stdoutStream.pipe(process.stdout);
|
|
38
36
|
let fileStream = null;
|
|
39
37
|
try {
|
|
40
38
|
const fileDest = pino.destination({ dest: logFile, mkdir: true });
|
|
@@ -42,7 +40,10 @@ try {
|
|
|
42
40
|
fileStream.pipe(fileDest);
|
|
43
41
|
}
|
|
44
42
|
catch {
|
|
45
|
-
// fallback
|
|
43
|
+
// fallback: 如果文件流创建失败,使用 stdout
|
|
44
|
+
const stdoutStream = createFormatStream();
|
|
45
|
+
stdoutStream.pipe(process.stdout);
|
|
46
|
+
fileStream = stdoutStream;
|
|
46
47
|
}
|
|
47
48
|
export const logger = pino({
|
|
48
49
|
level,
|
|
@@ -52,8 +53,7 @@ export const logger = pino({
|
|
|
52
53
|
level: (label) => ({ level: label }),
|
|
53
54
|
},
|
|
54
55
|
}, pino.multistream([
|
|
55
|
-
{ stream:
|
|
56
|
-
...(fileStream ? [{ stream: fileStream }] : [])
|
|
56
|
+
{ stream: fileStream }
|
|
57
57
|
]));
|
|
58
58
|
/**
|
|
59
59
|
* 创建带模块后缀的logger
|