@theia/process 1.67.0-next.13 → 1.67.0-next.56
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/README.md +1 -1
- package/package.json +3 -3
- package/lib/common/process-common-module.d.ts +0 -4
- package/lib/common/process-common-module.d.ts.map +0 -1
- package/lib/common/process-common-module.js +0 -23
- package/lib/common/process-common-module.js.map +0 -1
- package/lib/common/process-manager-types.d.ts +0 -36
- package/lib/common/process-manager-types.d.ts.map +0 -1
- package/lib/common/process-manager-types.js +0 -24
- package/lib/common/process-manager-types.js.map +0 -1
- package/lib/common/shell-command-builder.d.ts +0 -50
- package/lib/common/shell-command-builder.d.ts.map +0 -1
- package/lib/common/shell-command-builder.js +0 -170
- package/lib/common/shell-command-builder.js.map +0 -1
- package/lib/common/shell-command-builder.slow-spec.d.ts +0 -10
- package/lib/common/shell-command-builder.slow-spec.d.ts.map +0 -1
- package/lib/common/shell-command-builder.slow-spec.js +0 -405
- package/lib/common/shell-command-builder.slow-spec.js.map +0 -1
- package/lib/common/shell-quoting.d.ts +0 -92
- package/lib/common/shell-quoting.d.ts.map +0 -1
- package/lib/common/shell-quoting.js +0 -146
- package/lib/common/shell-quoting.js.map +0 -1
- package/lib/common/shell-quoting.spec.d.ts +0 -2
- package/lib/common/shell-quoting.spec.d.ts.map +0 -1
- package/lib/common/shell-quoting.spec.js +0 -171
- package/lib/common/shell-quoting.spec.js.map +0 -1
- package/lib/node/dev-null-stream.d.ts +0 -18
- package/lib/node/dev-null-stream.d.ts.map +0 -1
- package/lib/node/dev-null-stream.js +0 -42
- package/lib/node/dev-null-stream.js.map +0 -1
- package/lib/node/index.d.ts +0 -7
- package/lib/node/index.d.ts.map +0 -1
- package/lib/node/index.js +0 -25
- package/lib/node/index.js.map +0 -1
- package/lib/node/multi-ring-buffer.d.ts +0 -71
- package/lib/node/multi-ring-buffer.d.ts.map +0 -1
- package/lib/node/multi-ring-buffer.js +0 -300
- package/lib/node/multi-ring-buffer.js.map +0 -1
- package/lib/node/multi-ring-buffer.spec.d.ts +0 -2
- package/lib/node/multi-ring-buffer.spec.d.ts.map +0 -1
- package/lib/node/multi-ring-buffer.spec.js +0 -423
- package/lib/node/multi-ring-buffer.spec.js.map +0 -1
- package/lib/node/process-backend-module.d.ts +0 -4
- package/lib/node/process-backend-module.d.ts.map +0 -1
- package/lib/node/process-backend-module.js +0 -52
- package/lib/node/process-backend-module.js.map +0 -1
- package/lib/node/process-manager.d.ts +0 -34
- package/lib/node/process-manager.d.ts.map +0 -1
- package/lib/node/process-manager.js +0 -103
- package/lib/node/process-manager.js.map +0 -1
- package/lib/node/process.d.ts +0 -96
- package/lib/node/process.d.ts.map +0 -1
- package/lib/node/process.js +0 -146
- package/lib/node/process.js.map +0 -1
- package/lib/node/pseudo-pty.d.ts +0 -24
- package/lib/node/pseudo-pty.d.ts.map +0 -1
- package/lib/node/pseudo-pty.js +0 -40
- package/lib/node/pseudo-pty.js.map +0 -1
- package/lib/node/raw-process.d.ts +0 -47
- package/lib/node/raw-process.d.ts.map +0 -1
- package/lib/node/raw-process.js +0 -104
- package/lib/node/raw-process.js.map +0 -1
- package/lib/node/raw-process.spec.d.ts +0 -2
- package/lib/node/raw-process.spec.d.ts.map +0 -1
- package/lib/node/raw-process.spec.js +0 -163
- package/lib/node/raw-process.spec.js.map +0 -1
- package/lib/node/task-terminal-process.d.ts +0 -11
- package/lib/node/task-terminal-process.d.ts.map +0 -1
- package/lib/node/task-terminal-process.js +0 -43
- package/lib/node/task-terminal-process.js.map +0 -1
- package/lib/node/terminal-process.d.ts +0 -61
- package/lib/node/terminal-process.d.ts.map +0 -1
- package/lib/node/terminal-process.js +0 -252
- package/lib/node/terminal-process.js.map +0 -1
- package/lib/node/terminal-process.spec.d.ts +0 -2
- package/lib/node/terminal-process.spec.d.ts.map +0 -1
- package/lib/node/terminal-process.spec.js +0 -104
- package/lib/node/terminal-process.spec.js.map +0 -1
- package/lib/node/test/process-test-container.d.ts +0 -3
- package/lib/node/test/process-test-container.d.ts.map +0 -1
- package/lib/node/test/process-test-container.js +0 -29
- package/lib/node/test/process-test-container.js.map +0 -1
- package/lib/node/utils.d.ts +0 -17
- package/lib/node/utils.d.ts.map +0 -1
- package/lib/node/utils.js +0 -78
- package/lib/node/utils.js.map +0 -1
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// *****************************************************************************
|
|
4
|
-
// Copyright (C) 2017 Ericsson and others.
|
|
5
|
-
//
|
|
6
|
-
// This program and the accompanying materials are made available under the
|
|
7
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
-
//
|
|
10
|
-
// This Source Code may also be made available under the following Secondary
|
|
11
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
-
// with the GNU Classpath Exception which is available at
|
|
14
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
15
|
-
//
|
|
16
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
17
|
-
// *****************************************************************************
|
|
18
|
-
const chai = require("chai");
|
|
19
|
-
const process = require("process");
|
|
20
|
-
const stream = require("stream");
|
|
21
|
-
const process_test_container_1 = require("./test/process-test-container");
|
|
22
|
-
const terminal_process_1 = require("./terminal-process");
|
|
23
|
-
const os_1 = require("@theia/core/lib/common/os");
|
|
24
|
-
/**
|
|
25
|
-
* Globals
|
|
26
|
-
*/
|
|
27
|
-
const expect = chai.expect;
|
|
28
|
-
let terminalProcessFactory;
|
|
29
|
-
beforeEach(() => {
|
|
30
|
-
terminalProcessFactory = (0, process_test_container_1.createProcessTestContainer)().get(terminal_process_1.TerminalProcessFactory);
|
|
31
|
-
});
|
|
32
|
-
describe('TerminalProcess', function () {
|
|
33
|
-
this.timeout(20000);
|
|
34
|
-
it('test error on non existent path', async function () {
|
|
35
|
-
const error = await new Promise((resolve, reject) => {
|
|
36
|
-
const proc = terminalProcessFactory({ command: '/non-existent' });
|
|
37
|
-
proc.onError(resolve);
|
|
38
|
-
proc.onExit(resolve);
|
|
39
|
-
});
|
|
40
|
-
if (os_1.isWindows) {
|
|
41
|
-
expect(error.code).eq('ENOENT');
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
expect(error.code).eq(1);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
it('test implicit .exe (Windows only)', async function () {
|
|
48
|
-
const match = /^(.+)\.exe$/.exec(process.execPath);
|
|
49
|
-
if (!os_1.isWindows || !match) {
|
|
50
|
-
this.skip();
|
|
51
|
-
}
|
|
52
|
-
const command = match[1];
|
|
53
|
-
const args = ['--version'];
|
|
54
|
-
const terminal = await new Promise((resolve, reject) => {
|
|
55
|
-
const proc = terminalProcessFactory({ command, args });
|
|
56
|
-
proc.onExit(resolve);
|
|
57
|
-
proc.onError(reject);
|
|
58
|
-
});
|
|
59
|
-
expect(terminal.code).to.exist;
|
|
60
|
-
});
|
|
61
|
-
it('test error on trying to execute a directory', async function () {
|
|
62
|
-
const error = await new Promise((resolve, reject) => {
|
|
63
|
-
const proc = terminalProcessFactory({ command: __dirname });
|
|
64
|
-
proc.onError(resolve);
|
|
65
|
-
proc.onExit(resolve);
|
|
66
|
-
});
|
|
67
|
-
if (os_1.isWindows) {
|
|
68
|
-
expect(error.code).eq('ENOENT');
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
expect(error.code).eq(1);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
it('test exit', async function () {
|
|
75
|
-
const args = ['--version'];
|
|
76
|
-
const exit = await new Promise((resolve, reject) => {
|
|
77
|
-
const proc = terminalProcessFactory({ command: process.execPath, args });
|
|
78
|
-
proc.onExit(resolve);
|
|
79
|
-
proc.onError(reject);
|
|
80
|
-
});
|
|
81
|
-
expect(exit.code).eq(0);
|
|
82
|
-
});
|
|
83
|
-
it('test pipe stream', async function () {
|
|
84
|
-
const v = await new Promise((resolve, reject) => {
|
|
85
|
-
const args = ['--version'];
|
|
86
|
-
const terminalProcess = terminalProcessFactory({ command: process.execPath, args });
|
|
87
|
-
terminalProcess.onError(reject);
|
|
88
|
-
const outStream = new stream.PassThrough();
|
|
89
|
-
terminalProcess.createOutputStream().pipe(outStream);
|
|
90
|
-
let version = '';
|
|
91
|
-
outStream.on('data', data => {
|
|
92
|
-
version += data.toString();
|
|
93
|
-
});
|
|
94
|
-
/* node-pty is not sending 'end' on the stream as it quits
|
|
95
|
-
only 'exit' is sent on the terminal process. */
|
|
96
|
-
terminalProcess.onExit(() => {
|
|
97
|
-
resolve(version.trim());
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
/* Avoid using equal since terminal characters can be inserted at the end. */
|
|
101
|
-
expect(v).to.have.string(process.version);
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
//# sourceMappingURL=terminal-process.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-process.spec.js","sourceRoot":"","sources":["../../src/node/terminal-process.spec.ts"],"names":[],"mappings":";;AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,6BAA6B;AAC7B,mCAAmC;AACnC,iCAAiC;AACjC,0EAA2E;AAC3E,yDAA4D;AAE5D,kDAAsD;AAEtD;;GAEG;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAE3B,IAAI,sBAA8C,CAAC;AAEnD,UAAU,CAAC,GAAG,EAAE;IACZ,sBAAsB,GAAG,IAAA,mDAA0B,GAAE,CAAC,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
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createProcessTestContainer = void 0;
|
|
4
|
-
// *****************************************************************************
|
|
5
|
-
// Copyright (C) 2017 Ericsson and others.
|
|
6
|
-
//
|
|
7
|
-
// This program and the accompanying materials are made available under the
|
|
8
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
9
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
10
|
-
//
|
|
11
|
-
// This Source Code may also be made available under the following Secondary
|
|
12
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
13
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
14
|
-
// with the GNU Classpath Exception which is available at
|
|
15
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
16
|
-
//
|
|
17
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
18
|
-
// *****************************************************************************
|
|
19
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
20
|
-
const logger_backend_module_1 = require("@theia/core/lib/node/logger-backend-module");
|
|
21
|
-
const process_backend_module_1 = require("../process-backend-module");
|
|
22
|
-
function createProcessTestContainer() {
|
|
23
|
-
const testContainer = new inversify_1.Container();
|
|
24
|
-
(0, logger_backend_module_1.bindLogger)(testContainer.bind.bind(testContainer));
|
|
25
|
-
testContainer.load(process_backend_module_1.default);
|
|
26
|
-
return testContainer;
|
|
27
|
-
}
|
|
28
|
-
exports.createProcessTestContainer = createProcessTestContainer;
|
|
29
|
-
//# sourceMappingURL=process-test-container.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"process-test-container.js","sourceRoot":"","sources":["../../../src/node/test/process-test-container.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,4DAAyD;AACzD,sFAAwE;AACxE,sEAA6D;AAE7D,SAAgB,0BAA0B;IACtC,MAAM,aAAa,GAAG,IAAI,qBAAS,EAAE,CAAC;IAEtC,IAAA,kCAAU,EAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACnD,aAAa,CAAC,IAAI,CAAC,gCAAoB,CAAC,CAAC;IAEzC,OAAO,aAAa,CAAC;AACzB,CAAC;AAPD,gEAOC"}
|
package/lib/node/utils.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parses the given line into an array of args respecting escapes and string literals.
|
|
3
|
-
* @param line the given line to parse
|
|
4
|
-
*/
|
|
5
|
-
export declare function parseArgs(line: string | undefined): string[];
|
|
6
|
-
/**
|
|
7
|
-
* Convert a signal number to its short name (using the signal definitions of
|
|
8
|
-
* the current host). Should never be called on Windows. For Linux, this is
|
|
9
|
-
* only valid for the x86 and ARM architectures, since other architectures may
|
|
10
|
-
* use different numbers, see signal(7).
|
|
11
|
-
*/
|
|
12
|
-
export declare function signame(sig: number): string;
|
|
13
|
-
/**
|
|
14
|
-
* Convert a code number to its short name
|
|
15
|
-
*/
|
|
16
|
-
export declare function codename(code: number): string;
|
|
17
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/lib/node/utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAK5D;AAeD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAe3C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ7C"}
|
package/lib/node/utils.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017 TypeFox and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.codename = exports.signame = exports.parseArgs = void 0;
|
|
19
|
-
const core_1 = require("@theia/core");
|
|
20
|
-
const os = require("os");
|
|
21
|
-
const stringArgv = require('string-argv');
|
|
22
|
-
/**
|
|
23
|
-
* Parses the given line into an array of args respecting escapes and string literals.
|
|
24
|
-
* @param line the given line to parse
|
|
25
|
-
*/
|
|
26
|
-
function parseArgs(line) {
|
|
27
|
-
if (line) {
|
|
28
|
-
return stringArgv(line);
|
|
29
|
-
}
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
exports.parseArgs = parseArgs;
|
|
33
|
-
// Polyfill for Object.entries, until we upgrade to ES2017.
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
|
-
function objectEntries(obj) {
|
|
36
|
-
const props = Object.keys(obj);
|
|
37
|
-
const result = new Array(props.length);
|
|
38
|
-
for (let i = 0; i < props.length; i++) {
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
-
result[i] = [props[i], obj[props[i]]];
|
|
41
|
-
}
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Convert a signal number to its short name (using the signal definitions of
|
|
46
|
-
* the current host). Should never be called on Windows. For Linux, this is
|
|
47
|
-
* only valid for the x86 and ARM architectures, since other architectures may
|
|
48
|
-
* use different numbers, see signal(7).
|
|
49
|
-
*/
|
|
50
|
-
function signame(sig) {
|
|
51
|
-
// We should never reach this on Windows, since signals are not a thing
|
|
52
|
-
// there.
|
|
53
|
-
if (core_1.isWindows) {
|
|
54
|
-
throw new Error('Trying to get a signal name on Windows.');
|
|
55
|
-
}
|
|
56
|
-
for (const entry of objectEntries(os.constants.signals)) {
|
|
57
|
-
if (entry[1] === sig) {
|
|
58
|
-
return entry[0];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
// Don't know this signal? Return the number as a string.
|
|
62
|
-
return sig.toString(10);
|
|
63
|
-
}
|
|
64
|
-
exports.signame = signame;
|
|
65
|
-
/**
|
|
66
|
-
* Convert a code number to its short name
|
|
67
|
-
*/
|
|
68
|
-
function codename(code) {
|
|
69
|
-
for (const entry of objectEntries(os.constants.errno)) {
|
|
70
|
-
if (entry[1] === code) {
|
|
71
|
-
return entry[0];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// Return the number as string if we did not find a name for it.
|
|
75
|
-
return code.toString(10);
|
|
76
|
-
}
|
|
77
|
-
exports.codename = codename;
|
|
78
|
-
//# sourceMappingURL=utils.js.map
|
package/lib/node/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;A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