@opensumi/ide-core-common 3.3.1-next-1725517520.0 → 3.3.1-next-1725521092.0
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.
- package/lib/node/index.d.ts +2 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +5 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/utils.d.ts +13 -0
- package/lib/node/utils.d.ts.map +1 -0
- package/lib/node/utils.js +51 -0
- package/lib/node/utils.js.map +1 -0
- package/package.json +4 -4
- package/src/node/index.ts +1 -0
- package/src/node/utils.ts +51 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* modified from: https://github.com/mhart/epipebomb
|
|
4
|
+
*
|
|
5
|
+
* support EIO
|
|
6
|
+
*/
|
|
7
|
+
export declare function epipeBomb(stream: NodeJS.WriteStream, callback: (code?: number) => void): void;
|
|
8
|
+
/**
|
|
9
|
+
* 参考:https://github.com/camunda/camunda-modeler/pull/3314
|
|
10
|
+
* fix(app): suppress EPIPE errors for app output
|
|
11
|
+
*/
|
|
12
|
+
export declare function suppressNodeJSEpipeError(_process: NodeJS.Process, error: (msg: string) => void): void;
|
|
13
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,QA0BtF;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,QAa9F"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.suppressNodeJSEpipeError = exports.epipeBomb = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* modified from: https://github.com/mhart/epipebomb
|
|
6
|
+
*
|
|
7
|
+
* support EIO
|
|
8
|
+
*/
|
|
9
|
+
function epipeBomb(stream, callback) {
|
|
10
|
+
if (!stream) {
|
|
11
|
+
stream = process.stdout;
|
|
12
|
+
}
|
|
13
|
+
if (!callback) {
|
|
14
|
+
callback = process.exit;
|
|
15
|
+
}
|
|
16
|
+
function epipeFilter(err) {
|
|
17
|
+
if (err.code === 'EPIPE') {
|
|
18
|
+
return callback();
|
|
19
|
+
}
|
|
20
|
+
if (err.code === 'EIO') {
|
|
21
|
+
return callback();
|
|
22
|
+
}
|
|
23
|
+
// If there's more than one error handler (ie, us),
|
|
24
|
+
// then the error won't be bubbled up anyway
|
|
25
|
+
if (stream.listeners('error').length <= 1) {
|
|
26
|
+
stream.removeAllListeners('error'); // Pretend we were never here
|
|
27
|
+
stream.emit('error', err); // Then emit as if we were never here
|
|
28
|
+
stream.on('error', epipeFilter); // Then reattach, ready for the next error!
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
stream.on('error', epipeFilter);
|
|
32
|
+
}
|
|
33
|
+
exports.epipeBomb = epipeBomb;
|
|
34
|
+
/**
|
|
35
|
+
* 参考:https://github.com/camunda/camunda-modeler/pull/3314
|
|
36
|
+
* fix(app): suppress EPIPE errors for app output
|
|
37
|
+
*/
|
|
38
|
+
function suppressNodeJSEpipeError(_process, error) {
|
|
39
|
+
let suppressing = false;
|
|
40
|
+
const logEPIPEErrorOnce = () => {
|
|
41
|
+
if (suppressing) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
suppressing = true;
|
|
45
|
+
error('Detected EPIPE error; suppressing further EPIPE errors');
|
|
46
|
+
};
|
|
47
|
+
_process.stdout && epipeBomb(_process.stdout, logEPIPEErrorOnce);
|
|
48
|
+
_process.stderr && epipeBomb(_process.stderr, logEPIPEErrorOnce);
|
|
49
|
+
}
|
|
50
|
+
exports.suppressNodeJSEpipeError = suppressNodeJSEpipeError;
|
|
51
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,SAAS,CAAC,MAA0B,EAAE,QAAiC;IACrF,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;KACzB;IACD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;KACzB;IAED,SAAS,WAAW,CAAC,GAAQ;QAC3B,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE;YACxB,OAAO,QAAQ,EAAE,CAAC;SACnB;QACD,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,EAAE;YACtB,OAAO,QAAQ,EAAE,CAAC;SACnB;QAED,mDAAmD;QACnD,4CAA4C;QAC5C,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE;YACzC,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,6BAA6B;YACjE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,qCAAqC;YAChE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,2CAA2C;SAC7E;IACH,CAAC;IAED,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAClC,CAAC;AA1BD,8BA0BC;AAED;;;GAGG;AACH,SAAgB,wBAAwB,CAAC,QAAwB,EAAE,KAA4B;IAC7F,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC7B,IAAI,WAAW,EAAE;YACf,OAAO;SACR;QAED,WAAW,GAAG,IAAI,CAAC;QACnB,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAClE,CAAC,CAAC;IAEF,QAAQ,CAAC,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACjE,QAAQ,CAAC,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AACnE,CAAC;AAbD,4DAaC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/ide-core-common",
|
|
3
|
-
"version": "3.3.1-next-
|
|
3
|
+
"version": "3.3.1-next-1725521092.0",
|
|
4
4
|
"description": "@opensumi/ide-core-common",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@opensumi/di": "^1.8.0",
|
|
22
|
-
"@opensumi/ide-utils": "3.3.1-next-
|
|
22
|
+
"@opensumi/ide-utils": "3.3.1-next-1725521092.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@opensumi/ide-dev-tool": "3.3.1-next-
|
|
25
|
+
"@opensumi/ide-dev-tool": "3.3.1-next-1725521092.0"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "68c076414923186ea5f99696d5d23a2fb62a29e1"
|
|
28
28
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utils';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* modified from: https://github.com/mhart/epipebomb
|
|
3
|
+
*
|
|
4
|
+
* support EIO
|
|
5
|
+
*/
|
|
6
|
+
export function epipeBomb(stream: NodeJS.WriteStream, callback: (code?: number) => void) {
|
|
7
|
+
if (!stream) {
|
|
8
|
+
stream = process.stdout;
|
|
9
|
+
}
|
|
10
|
+
if (!callback) {
|
|
11
|
+
callback = process.exit;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function epipeFilter(err: any) {
|
|
15
|
+
if (err.code === 'EPIPE') {
|
|
16
|
+
return callback();
|
|
17
|
+
}
|
|
18
|
+
if (err.code === 'EIO') {
|
|
19
|
+
return callback();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// If there's more than one error handler (ie, us),
|
|
23
|
+
// then the error won't be bubbled up anyway
|
|
24
|
+
if (stream.listeners('error').length <= 1) {
|
|
25
|
+
stream.removeAllListeners('error'); // Pretend we were never here
|
|
26
|
+
stream.emit('error', err); // Then emit as if we were never here
|
|
27
|
+
stream.on('error', epipeFilter); // Then reattach, ready for the next error!
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
stream.on('error', epipeFilter);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 参考:https://github.com/camunda/camunda-modeler/pull/3314
|
|
36
|
+
* fix(app): suppress EPIPE errors for app output
|
|
37
|
+
*/
|
|
38
|
+
export function suppressNodeJSEpipeError(_process: NodeJS.Process, error: (msg: string) => void) {
|
|
39
|
+
let suppressing = false;
|
|
40
|
+
const logEPIPEErrorOnce = () => {
|
|
41
|
+
if (suppressing) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
suppressing = true;
|
|
46
|
+
error('Detected EPIPE error; suppressing further EPIPE errors');
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
_process.stdout && epipeBomb(_process.stdout, logEPIPEErrorOnce);
|
|
50
|
+
_process.stderr && epipeBomb(_process.stderr, logEPIPEErrorOnce);
|
|
51
|
+
}
|