@theia/plugin-dev 1.45.0 → 1.46.0-next.72

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.
Files changed (54) hide show
  1. package/README.md +31 -31
  2. package/lib/browser/hosted-plugin-controller.d.ts +74 -74
  3. package/lib/browser/hosted-plugin-controller.js +352 -352
  4. package/lib/browser/hosted-plugin-frontend-contribution.d.ts +6 -6
  5. package/lib/browser/hosted-plugin-frontend-contribution.js +56 -56
  6. package/lib/browser/hosted-plugin-informer.d.ts +25 -25
  7. package/lib/browser/hosted-plugin-informer.js +102 -102
  8. package/lib/browser/hosted-plugin-log-viewer.d.ts +14 -14
  9. package/lib/browser/hosted-plugin-log-viewer.js +69 -69
  10. package/lib/browser/hosted-plugin-manager-client.d.ts +80 -80
  11. package/lib/browser/hosted-plugin-manager-client.js +410 -410
  12. package/lib/browser/hosted-plugin-preferences.d.ts +13 -13
  13. package/lib/browser/hosted-plugin-preferences.js +60 -60
  14. package/lib/browser/plugin-dev-frontend-module.d.ts +3 -3
  15. package/lib/browser/plugin-dev-frontend-module.js +42 -42
  16. package/lib/common/index.d.ts +2 -2
  17. package/lib/common/index.js +31 -31
  18. package/lib/common/plugin-dev-protocol.d.ts +24 -24
  19. package/lib/common/plugin-dev-protocol.js +20 -20
  20. package/lib/node/hosted-instance-manager.d.ts +104 -104
  21. package/lib/node/hosted-instance-manager.js +320 -320
  22. package/lib/node/hosted-instance-manager.js.map +1 -1
  23. package/lib/node/hosted-plugin-reader.d.ts +11 -11
  24. package/lib/node/hosted-plugin-reader.js +68 -68
  25. package/lib/node/hosted-plugin-reader.js.map +1 -1
  26. package/lib/node/hosted-plugin-uri-postprocessor.d.ts +6 -6
  27. package/lib/node/hosted-plugin-uri-postprocessor.js +27 -27
  28. package/lib/node/hosted-plugins-manager.d.ts +41 -41
  29. package/lib/node/hosted-plugins-manager.js +119 -119
  30. package/lib/node/plugin-dev-backend-module.d.ts +4 -4
  31. package/lib/node/plugin-dev-backend-module.js +53 -53
  32. package/lib/node/plugin-dev-service.d.ts +25 -25
  33. package/lib/node/plugin-dev-service.js +108 -108
  34. package/lib/node-electron/plugin-dev-electron-backend-module.d.ts +3 -3
  35. package/lib/node-electron/plugin-dev-electron-backend-module.js +28 -28
  36. package/lib/package.spec.js +25 -25
  37. package/package.json +9 -9
  38. package/src/browser/hosted-plugin-controller.ts +356 -356
  39. package/src/browser/hosted-plugin-frontend-contribution.ts +45 -45
  40. package/src/browser/hosted-plugin-informer.ts +93 -93
  41. package/src/browser/hosted-plugin-log-viewer.ts +52 -52
  42. package/src/browser/hosted-plugin-manager-client.ts +430 -430
  43. package/src/browser/hosted-plugin-preferences.ts +71 -71
  44. package/src/browser/plugin-dev-frontend-module.ts +45 -45
  45. package/src/common/index.ts +21 -21
  46. package/src/common/plugin-dev-protocol.ts +45 -45
  47. package/src/node/hosted-instance-manager.ts +382 -382
  48. package/src/node/hosted-plugin-reader.ts +58 -58
  49. package/src/node/hosted-plugin-uri-postprocessor.ts +32 -32
  50. package/src/node/hosted-plugins-manager.ts +146 -146
  51. package/src/node/plugin-dev-backend-module.ts +54 -54
  52. package/src/node/plugin-dev-service.ts +107 -107
  53. package/src/node-electron/plugin-dev-electron-backend-module.ts +29 -29
  54. package/src/package.spec.ts +28 -28
@@ -1,107 +1,107 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 Red Hat, Inc. and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { PluginDebugConfiguration, PluginDevServer, PluginDevClient } from '../common/plugin-dev-protocol';
18
- import { injectable, inject } from '@theia/core/shared/inversify';
19
- import { HostedInstanceManager } from './hosted-instance-manager';
20
- import { PluginMetadata } from '@theia/plugin-ext/lib/common/plugin-protocol';
21
- import URI from '@theia/core/lib/common/uri';
22
- import { HostedPluginReader } from './hosted-plugin-reader';
23
- import { HostedPluginsManager } from './hosted-plugins-manager';
24
- import { HostedPluginSupport } from '@theia/plugin-ext/lib/hosted/node/hosted-plugin';
25
-
26
- @injectable()
27
- export class PluginDevServerImpl implements PluginDevServer {
28
-
29
- @inject(HostedPluginsManager)
30
- protected readonly hostedPluginsManager: HostedPluginsManager;
31
-
32
- @inject(HostedInstanceManager)
33
- protected readonly hostedInstanceManager: HostedInstanceManager;
34
-
35
- @inject(HostedPluginReader)
36
- private readonly reader: HostedPluginReader;
37
-
38
- @inject(HostedPluginSupport)
39
- private readonly hostedPlugin: HostedPluginSupport;
40
-
41
- dispose(): void {
42
- // Terminate the hosted instance if it is currently running.
43
- if (this.hostedInstanceManager.isRunning()) {
44
- this.hostedInstanceManager.terminate();
45
- }
46
- }
47
- setClient(client: PluginDevClient): void {
48
-
49
- }
50
-
51
- async getHostedPlugin(): Promise<PluginMetadata | undefined> {
52
- const pluginMetadata = await this.reader.getPlugin();
53
- if (pluginMetadata) {
54
- this.hostedPlugin.runPlugin(pluginMetadata.model);
55
- }
56
- return Promise.resolve(this.reader.getPlugin());
57
- }
58
-
59
- isPluginValid(uri: string): Promise<boolean> {
60
- return Promise.resolve(this.hostedInstanceManager.isPluginValid(new URI(uri)));
61
- }
62
-
63
- runHostedPluginInstance(uri: string): Promise<string> {
64
- return this.uriToStrPromise(this.hostedInstanceManager.run(new URI(uri)));
65
- }
66
-
67
- runDebugHostedPluginInstance(uri: string, debugConfig: PluginDebugConfiguration): Promise<string> {
68
- return this.uriToStrPromise(this.hostedInstanceManager.debug(new URI(uri), debugConfig));
69
- }
70
-
71
- terminateHostedPluginInstance(): Promise<void> {
72
- this.hostedInstanceManager.terminate();
73
- return Promise.resolve();
74
- }
75
-
76
- isHostedPluginInstanceRunning(): Promise<boolean> {
77
- return Promise.resolve(this.hostedInstanceManager.isRunning());
78
- }
79
-
80
- getHostedPluginInstanceURI(): Promise<string> {
81
- return Promise.resolve(this.hostedInstanceManager.getInstanceURI().toString());
82
- }
83
-
84
- getHostedPluginURI(): Promise<string> {
85
- return Promise.resolve(this.hostedInstanceManager.getPluginURI().toString());
86
- }
87
-
88
- protected uriToStrPromise(promise: Promise<URI>): Promise<string> {
89
- return new Promise((resolve, reject) => {
90
- promise.then((uri: URI) => {
91
- resolve(uri.toString());
92
- }).catch(error => reject(error));
93
- });
94
- }
95
-
96
- runWatchCompilation(path: string): Promise<void> {
97
- return this.hostedPluginsManager.runWatchCompilation(path);
98
- }
99
-
100
- stopWatchCompilation(path: string): Promise<void> {
101
- return this.hostedPluginsManager.stopWatchCompilation(path);
102
- }
103
-
104
- isWatchCompilationRunning(path: string): Promise<boolean> {
105
- return this.hostedPluginsManager.isWatchCompilationRunning(path);
106
- }
107
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 Red Hat, Inc. and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { PluginDebugConfiguration, PluginDevServer, PluginDevClient } from '../common/plugin-dev-protocol';
18
+ import { injectable, inject } from '@theia/core/shared/inversify';
19
+ import { HostedInstanceManager } from './hosted-instance-manager';
20
+ import { PluginMetadata } from '@theia/plugin-ext/lib/common/plugin-protocol';
21
+ import URI from '@theia/core/lib/common/uri';
22
+ import { HostedPluginReader } from './hosted-plugin-reader';
23
+ import { HostedPluginsManager } from './hosted-plugins-manager';
24
+ import { HostedPluginSupport } from '@theia/plugin-ext/lib/hosted/node/hosted-plugin';
25
+
26
+ @injectable()
27
+ export class PluginDevServerImpl implements PluginDevServer {
28
+
29
+ @inject(HostedPluginsManager)
30
+ protected readonly hostedPluginsManager: HostedPluginsManager;
31
+
32
+ @inject(HostedInstanceManager)
33
+ protected readonly hostedInstanceManager: HostedInstanceManager;
34
+
35
+ @inject(HostedPluginReader)
36
+ private readonly reader: HostedPluginReader;
37
+
38
+ @inject(HostedPluginSupport)
39
+ private readonly hostedPlugin: HostedPluginSupport;
40
+
41
+ dispose(): void {
42
+ // Terminate the hosted instance if it is currently running.
43
+ if (this.hostedInstanceManager.isRunning()) {
44
+ this.hostedInstanceManager.terminate();
45
+ }
46
+ }
47
+ setClient(client: PluginDevClient): void {
48
+
49
+ }
50
+
51
+ async getHostedPlugin(): Promise<PluginMetadata | undefined> {
52
+ const pluginMetadata = await this.reader.getPlugin();
53
+ if (pluginMetadata) {
54
+ this.hostedPlugin.runPlugin(pluginMetadata.model);
55
+ }
56
+ return Promise.resolve(this.reader.getPlugin());
57
+ }
58
+
59
+ isPluginValid(uri: string): Promise<boolean> {
60
+ return Promise.resolve(this.hostedInstanceManager.isPluginValid(new URI(uri)));
61
+ }
62
+
63
+ runHostedPluginInstance(uri: string): Promise<string> {
64
+ return this.uriToStrPromise(this.hostedInstanceManager.run(new URI(uri)));
65
+ }
66
+
67
+ runDebugHostedPluginInstance(uri: string, debugConfig: PluginDebugConfiguration): Promise<string> {
68
+ return this.uriToStrPromise(this.hostedInstanceManager.debug(new URI(uri), debugConfig));
69
+ }
70
+
71
+ terminateHostedPluginInstance(): Promise<void> {
72
+ this.hostedInstanceManager.terminate();
73
+ return Promise.resolve();
74
+ }
75
+
76
+ isHostedPluginInstanceRunning(): Promise<boolean> {
77
+ return Promise.resolve(this.hostedInstanceManager.isRunning());
78
+ }
79
+
80
+ getHostedPluginInstanceURI(): Promise<string> {
81
+ return Promise.resolve(this.hostedInstanceManager.getInstanceURI().toString());
82
+ }
83
+
84
+ getHostedPluginURI(): Promise<string> {
85
+ return Promise.resolve(this.hostedInstanceManager.getPluginURI().toString());
86
+ }
87
+
88
+ protected uriToStrPromise(promise: Promise<URI>): Promise<string> {
89
+ return new Promise((resolve, reject) => {
90
+ promise.then((uri: URI) => {
91
+ resolve(uri.toString());
92
+ }).catch(error => reject(error));
93
+ });
94
+ }
95
+
96
+ runWatchCompilation(path: string): Promise<void> {
97
+ return this.hostedPluginsManager.runWatchCompilation(path);
98
+ }
99
+
100
+ stopWatchCompilation(path: string): Promise<void> {
101
+ return this.hostedPluginsManager.stopWatchCompilation(path);
102
+ }
103
+
104
+ isWatchCompilationRunning(path: string): Promise<boolean> {
105
+ return this.hostedPluginsManager.isWatchCompilationRunning(path);
106
+ }
107
+ }
@@ -1,29 +1,29 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 Red Hat, Inc. and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { HostedInstanceManager, ElectronNodeHostedPluginRunner } from '../node/hosted-instance-manager';
18
- import { ContainerModule } from '@theia/core/shared/inversify';
19
- import { ConnectionContainerModule } from '@theia/core/lib/node/messaging/connection-container-module';
20
- import { bindCommonHostedBackend } from '../node/plugin-dev-backend-module';
21
-
22
- const hostedBackendConnectionModule = ConnectionContainerModule.create(({ bind }) => {
23
- bind(HostedInstanceManager).to(ElectronNodeHostedPluginRunner);
24
- });
25
-
26
- export default new ContainerModule(bind => {
27
- bindCommonHostedBackend(bind);
28
- bind(ConnectionContainerModule).toConstantValue(hostedBackendConnectionModule);
29
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 Red Hat, Inc. and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { HostedInstanceManager, ElectronNodeHostedPluginRunner } from '../node/hosted-instance-manager';
18
+ import { ContainerModule } from '@theia/core/shared/inversify';
19
+ import { ConnectionContainerModule } from '@theia/core/lib/node/messaging/connection-container-module';
20
+ import { bindCommonHostedBackend } from '../node/plugin-dev-backend-module';
21
+
22
+ const hostedBackendConnectionModule = ConnectionContainerModule.create(({ bind }) => {
23
+ bind(HostedInstanceManager).to(ElectronNodeHostedPluginRunner);
24
+ });
25
+
26
+ export default new ContainerModule(bind => {
27
+ bindCommonHostedBackend(bind);
28
+ bind(ConnectionContainerModule).toConstantValue(hostedBackendConnectionModule);
29
+ });
@@ -1,28 +1,28 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 Red Hat, Inc. and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- /* note: this bogus test file is required so that
18
- we are able to run mocha unit tests on this
19
- package, without having any actual unit tests in it.
20
- This way a coverage report will be generated,
21
- showing 0% coverage, instead of no report.
22
- This file can be removed once we have real unit
23
- tests in place. */
24
-
25
- describe('plugin-dev package', () => {
26
-
27
- it('support code coverage statistics', () => true);
28
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 Red Hat, Inc. and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ /* note: this bogus test file is required so that
18
+ we are able to run mocha unit tests on this
19
+ package, without having any actual unit tests in it.
20
+ This way a coverage report will be generated,
21
+ showing 0% coverage, instead of no report.
22
+ This file can be removed once we have real unit
23
+ tests in place. */
24
+
25
+ describe('plugin-dev package', () => {
26
+
27
+ it('support code coverage statistics', () => true);
28
+ });