@theia/plugin-dev 1.67.0-next.56 → 1.67.0-next.59
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/browser/hosted-plugin-controller.d.ts +75 -0
- package/lib/browser/hosted-plugin-controller.d.ts.map +1 -0
- package/lib/browser/hosted-plugin-controller.js +345 -0
- package/lib/browser/hosted-plugin-controller.js.map +1 -0
- package/lib/browser/hosted-plugin-frontend-contribution.d.ts +7 -0
- package/lib/browser/hosted-plugin-frontend-contribution.d.ts.map +1 -0
- package/lib/browser/hosted-plugin-frontend-contribution.js +49 -0
- package/lib/browser/hosted-plugin-frontend-contribution.js.map +1 -0
- package/lib/browser/hosted-plugin-informer.d.ts +26 -0
- package/lib/browser/hosted-plugin-informer.d.ts.map +1 -0
- package/lib/browser/hosted-plugin-informer.js +95 -0
- package/lib/browser/hosted-plugin-informer.js.map +1 -0
- package/lib/browser/hosted-plugin-log-viewer.d.ts +15 -0
- package/lib/browser/hosted-plugin-log-viewer.d.ts.map +1 -0
- package/lib/browser/hosted-plugin-log-viewer.js +62 -0
- package/lib/browser/hosted-plugin-log-viewer.js.map +1 -0
- package/lib/browser/hosted-plugin-manager-client.d.ts +81 -0
- package/lib/browser/hosted-plugin-manager-client.d.ts.map +1 -0
- package/lib/browser/hosted-plugin-manager-client.js +407 -0
- package/lib/browser/hosted-plugin-manager-client.js.map +1 -0
- package/lib/browser/plugin-dev-frontend-module.d.ts +4 -0
- package/lib/browser/plugin-dev-frontend-module.d.ts.map +1 -0
- package/lib/browser/plugin-dev-frontend-module.js +43 -0
- package/lib/browser/plugin-dev-frontend-module.js.map +1 -0
- package/lib/common/hosted-plugin-preferences.d.ts +16 -0
- package/lib/common/hosted-plugin-preferences.d.ts.map +1 -0
- package/lib/common/hosted-plugin-preferences.js +81 -0
- package/lib/common/hosted-plugin-preferences.js.map +1 -0
- package/lib/common/index.d.ts +3 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +23 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/plugin-dev-protocol.d.ts +29 -0
- package/lib/common/plugin-dev-protocol.d.ts.map +1 -0
- package/lib/common/plugin-dev-protocol.js +21 -0
- package/lib/common/plugin-dev-protocol.js.map +1 -0
- package/lib/node/hosted-instance-manager.d.ts +105 -0
- package/lib/node/hosted-instance-manager.d.ts.map +1 -0
- package/lib/node/hosted-instance-manager.js +329 -0
- package/lib/node/hosted-instance-manager.js.map +1 -0
- package/lib/node/hosted-plugin-reader.d.ts +11 -0
- package/lib/node/hosted-plugin-reader.d.ts.map +1 -0
- package/lib/node/hosted-plugin-reader.js +61 -0
- package/lib/node/hosted-plugin-reader.js.map +1 -0
- package/lib/node/hosted-plugin-uri-postprocessor.d.ts +7 -0
- package/lib/node/hosted-plugin-uri-postprocessor.d.ts.map +1 -0
- package/lib/node/hosted-plugin-uri-postprocessor.js +28 -0
- package/lib/node/hosted-plugin-uri-postprocessor.js.map +1 -0
- package/lib/node/hosted-plugins-manager.d.ts +44 -0
- package/lib/node/hosted-plugins-manager.d.ts.map +1 -0
- package/lib/node/hosted-plugins-manager.js +111 -0
- package/lib/node/hosted-plugins-manager.js.map +1 -0
- package/lib/node/plugin-dev-backend-module.d.ts +5 -0
- package/lib/node/plugin-dev-backend-module.d.ts.map +1 -0
- package/lib/node/plugin-dev-backend-module.js +56 -0
- package/lib/node/plugin-dev-backend-module.js.map +1 -0
- package/lib/node/plugin-dev-service.d.ts +26 -0
- package/lib/node/plugin-dev-service.d.ts.map +1 -0
- package/lib/node/plugin-dev-service.js +101 -0
- package/lib/node/plugin-dev-service.js.map +1 -0
- package/lib/node-electron/plugin-dev-electron-backend-module.d.ts +4 -0
- package/lib/node-electron/plugin-dev-electron-backend-module.d.ts.map +1 -0
- package/lib/node-electron/plugin-dev-electron-backend-module.js +29 -0
- package/lib/node-electron/plugin-dev-electron-backend-module.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +26 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 Red Hat, Inc. 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.ElectronNodeHostedPluginRunner = exports.NodeHostedPluginRunner = exports.AbstractHostedInstanceManager = exports.HostedInstanceManager = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const request_1 = require("@theia/core/shared/@theia/request");
|
|
21
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
+
const cp = require("child_process");
|
|
23
|
+
const fs = require("@theia/core/shared/fs-extra");
|
|
24
|
+
const net = require("net");
|
|
25
|
+
const path = require("path");
|
|
26
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
27
|
+
const contribution_provider_1 = require("@theia/core/lib/common/contribution-provider");
|
|
28
|
+
const hosted_plugin_uri_postprocessor_1 = require("./hosted-plugin-uri-postprocessor");
|
|
29
|
+
const core_1 = require("@theia/core");
|
|
30
|
+
const file_uri_1 = require("@theia/core/lib/common/file-uri");
|
|
31
|
+
const types_1 = require("@theia/plugin-ext/lib/common/types");
|
|
32
|
+
const hosted_plugin_1 = require("@theia/plugin-ext/lib/hosted/node/hosted-plugin");
|
|
33
|
+
const metadata_scanner_1 = require("@theia/plugin-ext/lib/hosted/node/metadata-scanner");
|
|
34
|
+
const hosted_plugin_process_1 = require("@theia/plugin-ext/lib/hosted/node/hosted-plugin-process");
|
|
35
|
+
const errors_1 = require("@theia/plugin-ext/lib/common/errors");
|
|
36
|
+
const DEFAULT_HOSTED_PLUGIN_PORT = 3030;
|
|
37
|
+
exports.HostedInstanceManager = Symbol('HostedInstanceManager');
|
|
38
|
+
const HOSTED_INSTANCE_START_TIMEOUT_MS = 30000;
|
|
39
|
+
const THEIA_INSTANCE_REGEX = /.*Theia app listening on (.*).*\./;
|
|
40
|
+
const PROCESS_OPTIONS = {
|
|
41
|
+
cwd: process.cwd(),
|
|
42
|
+
env: { ...process.env }
|
|
43
|
+
};
|
|
44
|
+
let AbstractHostedInstanceManager = class AbstractHostedInstanceManager {
|
|
45
|
+
constructor() {
|
|
46
|
+
this.isPluginRunning = false;
|
|
47
|
+
}
|
|
48
|
+
isRunning() {
|
|
49
|
+
return this.isPluginRunning;
|
|
50
|
+
}
|
|
51
|
+
async run(pluginUri, port) {
|
|
52
|
+
return this.doRun(pluginUri, port);
|
|
53
|
+
}
|
|
54
|
+
async debug(pluginUri, debugConfig) {
|
|
55
|
+
return this.doRun(pluginUri, undefined, debugConfig);
|
|
56
|
+
}
|
|
57
|
+
async doRun(pluginUri, port, debugConfig) {
|
|
58
|
+
if (this.isPluginRunning) {
|
|
59
|
+
this.hostedPluginSupport.sendLog({ data: 'Hosted plugin instance is already running.', type: types_1.LogType.Info });
|
|
60
|
+
throw new Error('Hosted instance is already running.');
|
|
61
|
+
}
|
|
62
|
+
let command;
|
|
63
|
+
let processOptions;
|
|
64
|
+
if (pluginUri.scheme === 'file') {
|
|
65
|
+
processOptions = { ...PROCESS_OPTIONS };
|
|
66
|
+
// get filesystem path that work cross operating systems
|
|
67
|
+
processOptions.env.HOSTED_PLUGIN = file_uri_1.FileUri.fsPath(pluginUri.toString());
|
|
68
|
+
// Disable all the other plugins on this instance
|
|
69
|
+
processOptions.env.THEIA_PLUGINS = '';
|
|
70
|
+
command = await this.getStartCommand(port, debugConfig);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
throw new Error('Not supported plugin location: ' + pluginUri.toString());
|
|
74
|
+
}
|
|
75
|
+
this.instanceUri = await this.postProcessInstanceUri(await this.runHostedPluginTheiaInstance(command, processOptions));
|
|
76
|
+
this.pluginUri = pluginUri;
|
|
77
|
+
// disable redirect to grab the release
|
|
78
|
+
this.instanceOptions = {
|
|
79
|
+
followRedirects: 0
|
|
80
|
+
};
|
|
81
|
+
this.instanceOptions = await this.postProcessInstanceOptions(this.instanceOptions);
|
|
82
|
+
await this.checkInstanceUriReady();
|
|
83
|
+
return this.instanceUri;
|
|
84
|
+
}
|
|
85
|
+
terminate() {
|
|
86
|
+
if (this.isPluginRunning && !!this.hostedInstanceProcess.pid) {
|
|
87
|
+
this.hostedPluginProcess.killProcessTree(this.hostedInstanceProcess.pid);
|
|
88
|
+
this.hostedPluginSupport.sendLog({ data: 'Hosted instance has been terminated', type: types_1.LogType.Info });
|
|
89
|
+
this.isPluginRunning = false;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
throw new Error('Hosted plugin instance is not running.');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
getInstanceURI() {
|
|
96
|
+
if (this.isPluginRunning) {
|
|
97
|
+
return this.instanceUri;
|
|
98
|
+
}
|
|
99
|
+
throw new Error('Hosted plugin instance is not running.');
|
|
100
|
+
}
|
|
101
|
+
getPluginURI() {
|
|
102
|
+
if (this.isPluginRunning) {
|
|
103
|
+
return this.pluginUri;
|
|
104
|
+
}
|
|
105
|
+
throw new Error('Hosted plugin instance is not running.');
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Checks that the `instanceUri` is responding before exiting method
|
|
109
|
+
*/
|
|
110
|
+
async checkInstanceUriReady() {
|
|
111
|
+
return new Promise((resolve, reject) => this.pingLoop(60, resolve, reject));
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Start a loop to ping, if ping is OK return immediately, else start a new ping after 1second. We iterate for the given amount of loops provided in remainingCount
|
|
115
|
+
* @param remainingCount the number of occurrence to check
|
|
116
|
+
* @param resolve resolve function if ok
|
|
117
|
+
* @param reject reject function if error
|
|
118
|
+
*/
|
|
119
|
+
async pingLoop(remainingCount, resolve, reject) {
|
|
120
|
+
const isOK = await this.ping();
|
|
121
|
+
if (isOK) {
|
|
122
|
+
resolve();
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
if (remainingCount > 0) {
|
|
126
|
+
setTimeout(() => this.pingLoop(--remainingCount, resolve, reject), 1000);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
reject(new Error('Unable to ping the remote server'));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Ping the plugin URI (checking status of the head)
|
|
135
|
+
*/
|
|
136
|
+
async ping() {
|
|
137
|
+
try {
|
|
138
|
+
const url = this.instanceUri.toString();
|
|
139
|
+
// Wait that the status is OK
|
|
140
|
+
const response = await this.request.request({ url, type: 'HEAD', ...this.instanceOptions });
|
|
141
|
+
return response.res.statusCode === 200;
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
async isPluginValid(uri) {
|
|
148
|
+
const pckPath = path.join(file_uri_1.FileUri.fsPath(uri), 'package.json');
|
|
149
|
+
try {
|
|
150
|
+
const pck = await fs.readJSON(pckPath);
|
|
151
|
+
this.metadata.getScanner(pck);
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
if (!(0, errors_1.isENOENT)(err)) {
|
|
156
|
+
console.error(err);
|
|
157
|
+
}
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
async getStartCommand(port, debugConfig) {
|
|
162
|
+
const processArguments = process.argv;
|
|
163
|
+
let command;
|
|
164
|
+
if (core_1.environment.electron.is()) {
|
|
165
|
+
command = ['npm', 'run', 'theia', 'start'];
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
command = processArguments.filter((arg, index, args) => {
|
|
169
|
+
// remove --port=X and --port X arguments if set
|
|
170
|
+
// remove --plugins arguments
|
|
171
|
+
if (arg.startsWith('--port') || args[index - 1] === '--port') {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
return arg;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
if (process.env.HOSTED_PLUGIN_HOSTNAME) {
|
|
180
|
+
command.push('--hostname=' + process.env.HOSTED_PLUGIN_HOSTNAME);
|
|
181
|
+
}
|
|
182
|
+
if (port) {
|
|
183
|
+
await this.validatePort(port);
|
|
184
|
+
command.push('--port=' + port);
|
|
185
|
+
}
|
|
186
|
+
if (debugConfig) {
|
|
187
|
+
if (debugConfig.debugPort === undefined) {
|
|
188
|
+
command.push(`--hosted-plugin-${debugConfig.debugMode || 'inspect'}=0.0.0.0`);
|
|
189
|
+
}
|
|
190
|
+
else if (typeof debugConfig.debugPort === 'string') {
|
|
191
|
+
command.push(`--hosted-plugin-${debugConfig.debugMode || 'inspect'}=0.0.0.0:${debugConfig.debugPort}`);
|
|
192
|
+
}
|
|
193
|
+
else if (Array.isArray(debugConfig.debugPort)) {
|
|
194
|
+
if (debugConfig.debugPort.length === 0) {
|
|
195
|
+
// treat empty array just like undefined
|
|
196
|
+
command.push(`--hosted-plugin-${debugConfig.debugMode || 'inspect'}=0.0.0.0`);
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
for (const serverToPort of debugConfig.debugPort) {
|
|
200
|
+
command.push(`--${serverToPort.serverName}-${debugConfig.debugMode || 'inspect'}=0.0.0.0:${serverToPort.debugPort}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return command;
|
|
206
|
+
}
|
|
207
|
+
async postProcessInstanceUri(uri) {
|
|
208
|
+
return uri;
|
|
209
|
+
}
|
|
210
|
+
async postProcessInstanceOptions(options) {
|
|
211
|
+
return options;
|
|
212
|
+
}
|
|
213
|
+
runHostedPluginTheiaInstance(command, options) {
|
|
214
|
+
this.isPluginRunning = true;
|
|
215
|
+
return new Promise((resolve, reject) => {
|
|
216
|
+
let started = false;
|
|
217
|
+
const outputListener = (data) => {
|
|
218
|
+
const line = data.toString();
|
|
219
|
+
const match = THEIA_INSTANCE_REGEX.exec(line);
|
|
220
|
+
if (match) {
|
|
221
|
+
this.hostedInstanceProcess.stdout.removeListener('data', outputListener);
|
|
222
|
+
started = true;
|
|
223
|
+
resolve(new uri_1.default(match[1]));
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
if (core_1.isWindows) {
|
|
227
|
+
// Has to be set for running on windows (electron).
|
|
228
|
+
// See also: https://github.com/nodejs/node/issues/3675
|
|
229
|
+
options.shell = true;
|
|
230
|
+
}
|
|
231
|
+
this.hostedInstanceProcess = cp.spawn(command.shift(), command, options);
|
|
232
|
+
this.hostedInstanceProcess.on('error', () => { this.isPluginRunning = false; });
|
|
233
|
+
this.hostedInstanceProcess.on('exit', () => { this.isPluginRunning = false; });
|
|
234
|
+
this.hostedInstanceProcess.stdout.addListener('data', outputListener);
|
|
235
|
+
this.hostedInstanceProcess.stdout.addListener('data', data => {
|
|
236
|
+
this.hostedPluginSupport.sendLog({ data: data.toString(), type: types_1.LogType.Info });
|
|
237
|
+
});
|
|
238
|
+
this.hostedInstanceProcess.stderr.addListener('data', data => {
|
|
239
|
+
this.hostedPluginSupport.sendLog({ data: data.toString(), type: types_1.LogType.Error });
|
|
240
|
+
});
|
|
241
|
+
setTimeout(() => {
|
|
242
|
+
if (!started) {
|
|
243
|
+
this.terminate();
|
|
244
|
+
this.isPluginRunning = false;
|
|
245
|
+
reject(new Error('Timeout.'));
|
|
246
|
+
}
|
|
247
|
+
}, HOSTED_INSTANCE_START_TIMEOUT_MS);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
async validatePort(port) {
|
|
251
|
+
if (port < 1 || port > 65535) {
|
|
252
|
+
throw new Error('Port value is incorrect.');
|
|
253
|
+
}
|
|
254
|
+
if (!await this.isPortFree(port)) {
|
|
255
|
+
throw new Error('Port ' + port + ' is already in use.');
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
isPortFree(port) {
|
|
259
|
+
return new Promise(resolve => {
|
|
260
|
+
const server = net.createServer();
|
|
261
|
+
server.listen(port, '0.0.0.0');
|
|
262
|
+
server.on('error', () => {
|
|
263
|
+
resolve(false);
|
|
264
|
+
});
|
|
265
|
+
server.on('listening', () => {
|
|
266
|
+
server.close();
|
|
267
|
+
resolve(true);
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
exports.AbstractHostedInstanceManager = AbstractHostedInstanceManager;
|
|
273
|
+
tslib_1.__decorate([
|
|
274
|
+
(0, inversify_1.inject)(hosted_plugin_1.HostedPluginSupport),
|
|
275
|
+
tslib_1.__metadata("design:type", hosted_plugin_1.HostedPluginSupport)
|
|
276
|
+
], AbstractHostedInstanceManager.prototype, "hostedPluginSupport", void 0);
|
|
277
|
+
tslib_1.__decorate([
|
|
278
|
+
(0, inversify_1.inject)(metadata_scanner_1.MetadataScanner),
|
|
279
|
+
tslib_1.__metadata("design:type", metadata_scanner_1.MetadataScanner)
|
|
280
|
+
], AbstractHostedInstanceManager.prototype, "metadata", void 0);
|
|
281
|
+
tslib_1.__decorate([
|
|
282
|
+
(0, inversify_1.inject)(hosted_plugin_process_1.HostedPluginProcess),
|
|
283
|
+
tslib_1.__metadata("design:type", hosted_plugin_process_1.HostedPluginProcess)
|
|
284
|
+
], AbstractHostedInstanceManager.prototype, "hostedPluginProcess", void 0);
|
|
285
|
+
tslib_1.__decorate([
|
|
286
|
+
(0, inversify_1.inject)(request_1.RequestService),
|
|
287
|
+
tslib_1.__metadata("design:type", Object)
|
|
288
|
+
], AbstractHostedInstanceManager.prototype, "request", void 0);
|
|
289
|
+
exports.AbstractHostedInstanceManager = AbstractHostedInstanceManager = tslib_1.__decorate([
|
|
290
|
+
(0, inversify_1.injectable)()
|
|
291
|
+
], AbstractHostedInstanceManager);
|
|
292
|
+
let NodeHostedPluginRunner = class NodeHostedPluginRunner extends AbstractHostedInstanceManager {
|
|
293
|
+
async postProcessInstanceUri(uri) {
|
|
294
|
+
for (const uriPostProcessor of this.uriPostProcessors.getContributions()) {
|
|
295
|
+
uri = await uriPostProcessor.processUri(uri);
|
|
296
|
+
}
|
|
297
|
+
return uri;
|
|
298
|
+
}
|
|
299
|
+
async postProcessInstanceOptions(options) {
|
|
300
|
+
for (const uriPostProcessor of this.uriPostProcessors.getContributions()) {
|
|
301
|
+
options = await uriPostProcessor.processOptions(options);
|
|
302
|
+
}
|
|
303
|
+
return options;
|
|
304
|
+
}
|
|
305
|
+
async getStartCommand(port, debugConfig) {
|
|
306
|
+
if (!port) {
|
|
307
|
+
port = process.env.HOSTED_PLUGIN_PORT ?
|
|
308
|
+
Number(process.env.HOSTED_PLUGIN_PORT) :
|
|
309
|
+
((debugConfig === null || debugConfig === void 0 ? void 0 : debugConfig.debugPort) ? Number(debugConfig.debugPort) : DEFAULT_HOSTED_PLUGIN_PORT);
|
|
310
|
+
}
|
|
311
|
+
return super.getStartCommand(port, debugConfig);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
exports.NodeHostedPluginRunner = NodeHostedPluginRunner;
|
|
315
|
+
tslib_1.__decorate([
|
|
316
|
+
(0, inversify_1.inject)(contribution_provider_1.ContributionProvider),
|
|
317
|
+
(0, inversify_1.named)(Symbol.for(hosted_plugin_uri_postprocessor_1.HostedPluginUriPostProcessorSymbolName)),
|
|
318
|
+
tslib_1.__metadata("design:type", Object)
|
|
319
|
+
], NodeHostedPluginRunner.prototype, "uriPostProcessors", void 0);
|
|
320
|
+
exports.NodeHostedPluginRunner = NodeHostedPluginRunner = tslib_1.__decorate([
|
|
321
|
+
(0, inversify_1.injectable)()
|
|
322
|
+
], NodeHostedPluginRunner);
|
|
323
|
+
let ElectronNodeHostedPluginRunner = class ElectronNodeHostedPluginRunner extends AbstractHostedInstanceManager {
|
|
324
|
+
};
|
|
325
|
+
exports.ElectronNodeHostedPluginRunner = ElectronNodeHostedPluginRunner;
|
|
326
|
+
exports.ElectronNodeHostedPluginRunner = ElectronNodeHostedPluginRunner = tslib_1.__decorate([
|
|
327
|
+
(0, inversify_1.injectable)()
|
|
328
|
+
], ElectronNodeHostedPluginRunner);
|
|
329
|
+
//# sourceMappingURL=hosted-instance-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-instance-manager.js","sourceRoot":"","sources":["../../src/node/hosted-instance-manager.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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;;;;AAEhF,+DAAmF;AACnF,4DAAyE;AACzE,oCAAoC;AACpC,kDAAkD;AAClD,2BAA2B;AAC3B,6BAA6B;AAC7B,oDAA6C;AAC7C,wFAAoF;AACpF,uFAAyH;AACzH,sCAAqD;AACrD,8DAA0D;AAC1D,8DAA6D;AAC7D,mFAAsF;AACtF,yFAAqF;AAErF,mGAA8F;AAC9F,gEAA+D;AAE/D,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAE3B,QAAA,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAsDrE,MAAM,gCAAgC,GA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CAAC;IAEkB,KAAK,CAAC,0BAA0B,CAAC,OAAe;QAC/D,KAAK,MAAM,gBAAgB,IAAI,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,EAAE,CAAC;YACvE,OAAO,GAAG,MAAM,gBAAgB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IAEkB,KAAK,CAAC,eAAe,CAAC,IAAa,EAAE,WAAsC;QAC1F,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;gBACnC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;gBACxC,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,EAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC;QAC9F,CAAC;QACD,OAAO,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACpD,CAAC;CACJ,CAAA;AA1BY,wDAAsB;AAEZ;IADlB,IAAA,kBAAM,EAAC,4CAAoB,CAAC;IAAE,IAAA,iBAAK,EAAC,MAAM,CAAC,GAAG,CAAC,wEAAsC,CAAC,CAAC;;iEACC;iCAFhF,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CA0BlC;AAGM,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,6BAA6B;CAEhF,CAAA;AAFY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,sBAAU,GAAE;GACA,8BAA8B,CAE1C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
|
|
2
|
+
import { HostedPluginReader as PluginReaderHosted } from '@theia/plugin-ext/lib/hosted/node/plugin-reader';
|
|
3
|
+
import { PluginDeployerHandler, PluginMetadata } from '@theia/plugin-ext/lib/common/plugin-protocol';
|
|
4
|
+
export declare class HostedPluginReader implements BackendApplicationContribution {
|
|
5
|
+
protected pluginReader: PluginReaderHosted;
|
|
6
|
+
private readonly hostedPlugin;
|
|
7
|
+
protected deployerHandler: PluginDeployerHandler;
|
|
8
|
+
initialize(): Promise<void>;
|
|
9
|
+
getPlugin(): Promise<PluginMetadata | undefined>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=hosted-plugin-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-plugin-reader.d.ts","sourceRoot":"","sources":["../../src/node/hosted-plugin-reader.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAE3G,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAGrG,qBACa,kBAAmB,YAAW,8BAA8B;IAGrE,SAAS,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAE3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA8C;IAG3E,SAAS,CAAC,eAAe,EAAE,qBAAqB,CAAC;IAE3C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAmB3B,SAAS,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;CAGzD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 Red Hat, Inc. 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.HostedPluginReader = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const plugin_reader_1 = require("@theia/plugin-ext/lib/hosted/node/plugin-reader");
|
|
22
|
+
const promise_util_1 = require("@theia/core/lib/common/promise-util");
|
|
23
|
+
const plugin_protocol_1 = require("@theia/plugin-ext/lib/common/plugin-protocol");
|
|
24
|
+
const plugin_deployer_entry_impl_1 = require("@theia/plugin-ext/lib/main/node/plugin-deployer-entry-impl");
|
|
25
|
+
let HostedPluginReader = class HostedPluginReader {
|
|
26
|
+
constructor() {
|
|
27
|
+
this.hostedPlugin = new promise_util_1.Deferred();
|
|
28
|
+
}
|
|
29
|
+
async initialize() {
|
|
30
|
+
this.pluginReader.getPluginMetadata(process.env.HOSTED_PLUGIN)
|
|
31
|
+
.then(this.hostedPlugin.resolve.bind(this.hostedPlugin));
|
|
32
|
+
const pluginPath = process.env.HOSTED_PLUGIN;
|
|
33
|
+
if (pluginPath) {
|
|
34
|
+
const hostedPlugin = new plugin_deployer_entry_impl_1.PluginDeployerEntryImpl('Hosted Plugin', pluginPath, pluginPath);
|
|
35
|
+
hostedPlugin.storeValue('isUnderDevelopment', true);
|
|
36
|
+
const hostedMetadata = await this.hostedPlugin.promise;
|
|
37
|
+
if (hostedMetadata.model.entryPoint && (hostedMetadata.model.entryPoint.backend || hostedMetadata.model.entryPoint.headless)) {
|
|
38
|
+
this.deployerHandler.deployBackendPlugins([hostedPlugin]);
|
|
39
|
+
}
|
|
40
|
+
if (hostedMetadata.model.entryPoint && hostedMetadata.model.entryPoint.frontend) {
|
|
41
|
+
this.deployerHandler.deployFrontendPlugins([hostedPlugin]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async getPlugin() {
|
|
46
|
+
return this.hostedPlugin.promise;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.HostedPluginReader = HostedPluginReader;
|
|
50
|
+
tslib_1.__decorate([
|
|
51
|
+
(0, inversify_1.inject)(plugin_reader_1.HostedPluginReader),
|
|
52
|
+
tslib_1.__metadata("design:type", plugin_reader_1.HostedPluginReader)
|
|
53
|
+
], HostedPluginReader.prototype, "pluginReader", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, inversify_1.inject)(plugin_protocol_1.PluginDeployerHandler),
|
|
56
|
+
tslib_1.__metadata("design:type", Object)
|
|
57
|
+
], HostedPluginReader.prototype, "deployerHandler", void 0);
|
|
58
|
+
exports.HostedPluginReader = HostedPluginReader = tslib_1.__decorate([
|
|
59
|
+
(0, inversify_1.injectable)()
|
|
60
|
+
], HostedPluginReader);
|
|
61
|
+
//# sourceMappingURL=hosted-plugin-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-plugin-reader.js","sourceRoot":"","sources":["../../src/node/hosted-plugin-reader.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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;;;;AAEhF,4DAAkE;AAElE,mFAA2G;AAC3G,sEAA+D;AAC/D,kFAAqG;AACrG,2GAAqG;AAG9F,IAAM,kBAAkB,GAAxB,MAA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wDAAC;AAKjC;IADT,IAAA,kBAAM,EAAC,uCAAqB,CAAC;;2DACmB;6BARxC,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;GACA,kBAAkB,CAgC9B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import URI from '@theia/core/lib/common/uri';
|
|
2
|
+
export declare const HostedPluginUriPostProcessorSymbolName = "HostedPluginUriPostProcessor";
|
|
3
|
+
export interface HostedPluginUriPostProcessor {
|
|
4
|
+
processUri(uri: URI): Promise<URI>;
|
|
5
|
+
processOptions(options: object): Promise<object>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=hosted-plugin-uri-postprocessor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-plugin-uri-postprocessor.d.ts","sourceRoot":"","sources":["../../src/node/hosted-plugin-uri-postprocessor.ts"],"names":[],"mappings":"AAgBA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAU7C,eAAO,MAAM,sCAAsC,iCAAiC,CAAC;AAErF,MAAM,WAAW,4BAA4B;IACzC,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACnC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACpD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 Red Hat, Inc. 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.HostedPluginUriPostProcessorSymbolName = void 0;
|
|
19
|
+
// We export symbol name instead of symbol itself here because we need to provide
|
|
20
|
+
// a contribution point to which any extensions could contribute.
|
|
21
|
+
// In case of just symbols, symbol inside an extension won't be the same as here
|
|
22
|
+
// even if the extension imports this module.
|
|
23
|
+
// To solve this problem we should provide global symbol. So right way to use the contribution point is:
|
|
24
|
+
// ...
|
|
25
|
+
// bind(Symbol.for(HostedPluginUriPostProcessorSymbolName)).to(AContribution);
|
|
26
|
+
// ...
|
|
27
|
+
exports.HostedPluginUriPostProcessorSymbolName = 'HostedPluginUriPostProcessor';
|
|
28
|
+
//# sourceMappingURL=hosted-plugin-uri-postprocessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-plugin-uri-postprocessor.js","sourceRoot":"","sources":["../../src/node/hosted-plugin-uri-postprocessor.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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;;;AAIhF,iFAAiF;AACjF,iEAAiE;AACjE,gFAAgF;AAChF,6CAA6C;AAC7C,wGAAwG;AACxG,MAAM;AACN,8EAA8E;AAC9E,MAAM;AACO,QAAA,sCAAsC,GAAG,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as cp from 'child_process';
|
|
3
|
+
import { HostedPluginSupport } from '@theia/plugin-ext/lib/hosted/node/hosted-plugin';
|
|
4
|
+
import { ProcessUtils } from '@theia/core/lib/node/process-utils';
|
|
5
|
+
export declare const HostedPluginsManager: unique symbol;
|
|
6
|
+
export interface HostedPluginsManager {
|
|
7
|
+
/**
|
|
8
|
+
* Runs watcher script to recompile plugin on any changes along given path.
|
|
9
|
+
*
|
|
10
|
+
* @param uri uri to plugin root folder.
|
|
11
|
+
*/
|
|
12
|
+
runWatchCompilation(uri: string): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Stops watcher script.
|
|
15
|
+
*
|
|
16
|
+
* @param uri uri to plugin root folder.
|
|
17
|
+
*/
|
|
18
|
+
stopWatchCompilation(uri: string): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Checks if watcher script to recompile plugin is running.
|
|
21
|
+
*
|
|
22
|
+
* @param uri uri to plugin root folder.
|
|
23
|
+
*/
|
|
24
|
+
isWatchCompilationRunning(uri: string): Promise<boolean>;
|
|
25
|
+
}
|
|
26
|
+
export declare class HostedPluginsManagerImpl implements HostedPluginsManager {
|
|
27
|
+
protected readonly hostedPluginSupport: HostedPluginSupport;
|
|
28
|
+
protected readonly processUtils: ProcessUtils;
|
|
29
|
+
protected watchCompilationRegistry: Map<string, cp.ChildProcess>;
|
|
30
|
+
constructor();
|
|
31
|
+
runWatchCompilation(uri: string): Promise<void>;
|
|
32
|
+
private killProcessTree;
|
|
33
|
+
stopWatchCompilation(uri: string): Promise<void>;
|
|
34
|
+
isWatchCompilationRunning(uri: string): Promise<boolean>;
|
|
35
|
+
protected runWatchScript(pluginRootPath: string): Promise<void>;
|
|
36
|
+
protected unregisterWatchScript(pluginRootPath: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Checks whether watch script is present into package.json by given parent folder.
|
|
39
|
+
*
|
|
40
|
+
* @param pluginPath path to plugin's root directory
|
|
41
|
+
*/
|
|
42
|
+
protected checkWatchScript(pluginPath: string): Promise<boolean>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=hosted-plugins-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-plugins-manager.d.ts","sourceRoot":"","sources":["../../src/node/hosted-plugins-manager.ts"],"names":[],"mappings":";AAiBA,OAAO,KAAK,EAAE,MAAM,eAAe,CAAC;AAIpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AAEnE,MAAM,WAAW,oBAAoB;IAEjC;;;;OAIG;IACH,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;;OAIG;IACH,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjD;;;;OAIG;IACH,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5D;AAED,qBACa,wBAAyB,YAAW,oBAAoB;IAGjE,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAG5D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAE9C,SAAS,CAAC,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC;;IAMjE,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB/C,OAAO,CAAC,eAAe;IAIvB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYhD,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMxD,SAAS,CAAC,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY/D,SAAS,CAAC,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;IAQ7D;;;;OAIG;cACa,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAYzE"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 Red Hat, Inc. 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.HostedPluginsManagerImpl = exports.HostedPluginsManager = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const cp = require("child_process");
|
|
22
|
+
const fs = require("@theia/core/shared/fs-extra");
|
|
23
|
+
const path = require("path");
|
|
24
|
+
const node_1 = require("@theia/core/lib/node");
|
|
25
|
+
const hosted_plugin_1 = require("@theia/plugin-ext/lib/hosted/node/hosted-plugin");
|
|
26
|
+
const types_1 = require("@theia/plugin-ext/lib/common/types");
|
|
27
|
+
const process_utils_1 = require("@theia/core/lib/node/process-utils");
|
|
28
|
+
exports.HostedPluginsManager = Symbol('HostedPluginsManager');
|
|
29
|
+
let HostedPluginsManagerImpl = class HostedPluginsManagerImpl {
|
|
30
|
+
constructor() {
|
|
31
|
+
this.watchCompilationRegistry = new Map();
|
|
32
|
+
}
|
|
33
|
+
runWatchCompilation(uri) {
|
|
34
|
+
const pluginRootPath = node_1.FileUri.fsPath(uri);
|
|
35
|
+
if (this.watchCompilationRegistry.has(pluginRootPath)) {
|
|
36
|
+
throw new Error('Watcher is already running in ' + pluginRootPath);
|
|
37
|
+
}
|
|
38
|
+
if (!this.checkWatchScript(pluginRootPath)) {
|
|
39
|
+
this.hostedPluginSupport.sendLog({
|
|
40
|
+
data: 'Plugin in ' + uri + ' doesn\'t have watch script',
|
|
41
|
+
type: types_1.LogType.Error
|
|
42
|
+
});
|
|
43
|
+
throw new Error('Watch script doesn\'t exist in ' + pluginRootPath + 'package.json');
|
|
44
|
+
}
|
|
45
|
+
return this.runWatchScript(pluginRootPath);
|
|
46
|
+
}
|
|
47
|
+
killProcessTree(parentPid) {
|
|
48
|
+
this.processUtils.terminateProcessTree(parentPid);
|
|
49
|
+
}
|
|
50
|
+
stopWatchCompilation(uri) {
|
|
51
|
+
const pluginPath = node_1.FileUri.fsPath(uri);
|
|
52
|
+
const watchProcess = this.watchCompilationRegistry.get(pluginPath);
|
|
53
|
+
if (!watchProcess) {
|
|
54
|
+
throw new Error('Watcher is not running in ' + pluginPath);
|
|
55
|
+
}
|
|
56
|
+
this.killProcessTree(watchProcess.pid);
|
|
57
|
+
return Promise.resolve();
|
|
58
|
+
}
|
|
59
|
+
isWatchCompilationRunning(uri) {
|
|
60
|
+
const pluginPath = node_1.FileUri.fsPath(uri);
|
|
61
|
+
return new Promise(resolve => resolve(this.watchCompilationRegistry.has(pluginPath)));
|
|
62
|
+
}
|
|
63
|
+
runWatchScript(pluginRootPath) {
|
|
64
|
+
const watchProcess = cp.spawn('npm', ['run', 'watch'], { cwd: pluginRootPath, shell: true });
|
|
65
|
+
watchProcess.on('exit', () => this.unregisterWatchScript(pluginRootPath));
|
|
66
|
+
this.watchCompilationRegistry.set(pluginRootPath, watchProcess);
|
|
67
|
+
this.hostedPluginSupport.sendLog({
|
|
68
|
+
data: 'Compilation watcher has been started in ' + pluginRootPath,
|
|
69
|
+
type: types_1.LogType.Info
|
|
70
|
+
});
|
|
71
|
+
return Promise.resolve();
|
|
72
|
+
}
|
|
73
|
+
unregisterWatchScript(pluginRootPath) {
|
|
74
|
+
this.watchCompilationRegistry.delete(pluginRootPath);
|
|
75
|
+
this.hostedPluginSupport.sendLog({
|
|
76
|
+
data: 'Compilation watcher has been stopped in ' + pluginRootPath,
|
|
77
|
+
type: types_1.LogType.Info
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Checks whether watch script is present into package.json by given parent folder.
|
|
82
|
+
*
|
|
83
|
+
* @param pluginPath path to plugin's root directory
|
|
84
|
+
*/
|
|
85
|
+
async checkWatchScript(pluginPath) {
|
|
86
|
+
const pluginPackageJsonPath = path.join(pluginPath, 'package.json');
|
|
87
|
+
try {
|
|
88
|
+
const packageJson = await fs.readJSON(pluginPackageJsonPath);
|
|
89
|
+
const scripts = packageJson['scripts'];
|
|
90
|
+
if (scripts && scripts['watch']) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch { }
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
exports.HostedPluginsManagerImpl = HostedPluginsManagerImpl;
|
|
99
|
+
tslib_1.__decorate([
|
|
100
|
+
(0, inversify_1.inject)(hosted_plugin_1.HostedPluginSupport),
|
|
101
|
+
tslib_1.__metadata("design:type", hosted_plugin_1.HostedPluginSupport)
|
|
102
|
+
], HostedPluginsManagerImpl.prototype, "hostedPluginSupport", void 0);
|
|
103
|
+
tslib_1.__decorate([
|
|
104
|
+
(0, inversify_1.inject)(process_utils_1.ProcessUtils),
|
|
105
|
+
tslib_1.__metadata("design:type", process_utils_1.ProcessUtils)
|
|
106
|
+
], HostedPluginsManagerImpl.prototype, "processUtils", void 0);
|
|
107
|
+
exports.HostedPluginsManagerImpl = HostedPluginsManagerImpl = tslib_1.__decorate([
|
|
108
|
+
(0, inversify_1.injectable)(),
|
|
109
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
110
|
+
], HostedPluginsManagerImpl);
|
|
111
|
+
//# sourceMappingURL=hosted-plugins-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-plugins-manager.js","sourceRoot":"","sources":["../../src/node/hosted-plugins-manager.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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;;;;AAEhF,4DAAkE;AAClE,oCAAoC;AACpC,kDAAkD;AAClD,6BAA6B;AAC7B,+CAA+C;AAC/C,mFAAsF;AACtF,8DAA6D;AAC7D,sEAAkE;AAErD,QAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AA2B5D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAUjC;QACI,IAAI,CAAC,wBAAwB,GAAG,IAAI,GAAG,EAAE,CAAC;IAC9C,CAAC;IAED,mBAAmB,CAAC,GAAW;QAC3B,MAAM,cAAc,GAAG,cAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAE3C,IAAI,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,gCAAgC,GAAG,cAAc,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,CAAC;YACzC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;gBAC7B,IAAI,EAAE,YAAY,GAAG,GAAG,GAAG,6B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