@theia/vsx-registry 1.34.2 → 1.34.3

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 (73) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +36 -36
  3. package/lib/browser/recommended-extensions/preference-provider-overrides.d.ts +17 -17
  4. package/lib/browser/recommended-extensions/preference-provider-overrides.js +95 -95
  5. package/lib/browser/recommended-extensions/recommended-extensions-json-schema.d.ts +14 -14
  6. package/lib/browser/recommended-extensions/recommended-extensions-json-schema.js +94 -94
  7. package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.d.ts +11 -11
  8. package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.js +59 -59
  9. package/lib/browser/vsx-extension-commands.d.ts +13 -13
  10. package/lib/browser/vsx-extension-commands.js +63 -63
  11. package/lib/browser/vsx-extension-editor-manager.d.ts +9 -9
  12. package/lib/browser/vsx-extension-editor-manager.js +49 -49
  13. package/lib/browser/vsx-extension-editor.d.ts +21 -21
  14. package/lib/browser/vsx-extension-editor.js +109 -109
  15. package/lib/browser/vsx-extension.d.ts +141 -141
  16. package/lib/browser/vsx-extension.js +581 -581
  17. package/lib/browser/vsx-extensions-contribution.d.ts +54 -54
  18. package/lib/browser/vsx-extensions-contribution.js +328 -328
  19. package/lib/browser/vsx-extensions-model.d.ts +67 -67
  20. package/lib/browser/vsx-extensions-model.js +368 -368
  21. package/lib/browser/vsx-extensions-search-bar.d.ts +14 -14
  22. package/lib/browser/vsx-extensions-search-bar.js +75 -75
  23. package/lib/browser/vsx-extensions-search-model.d.ts +21 -21
  24. package/lib/browser/vsx-extensions-search-model.js +70 -70
  25. package/lib/browser/vsx-extensions-source.d.ts +19 -19
  26. package/lib/browser/vsx-extensions-source.js +102 -102
  27. package/lib/browser/vsx-extensions-view-container.d.ts +49 -49
  28. package/lib/browser/vsx-extensions-view-container.js +179 -179
  29. package/lib/browser/vsx-extensions-widget.d.ts +29 -29
  30. package/lib/browser/vsx-extensions-widget.js +143 -143
  31. package/lib/browser/vsx-language-quick-pick-service.d.ts +13 -13
  32. package/lib/browser/vsx-language-quick-pick-service.js +103 -103
  33. package/lib/browser/vsx-registry-frontend-module.d.ts +4 -4
  34. package/lib/browser/vsx-registry-frontend-module.js +101 -101
  35. package/lib/common/ovsx-client-provider.d.ts +6 -6
  36. package/lib/common/ovsx-client-provider.js +28 -28
  37. package/lib/common/vsx-environment.d.ts +7 -7
  38. package/lib/common/vsx-environment.js +20 -20
  39. package/lib/common/vsx-extension-uri.d.ts +3 -3
  40. package/lib/common/vsx-extension-uri.js +20 -20
  41. package/lib/node/vsx-environment-impl.d.ts +10 -10
  42. package/lib/node/vsx-environment-impl.js +53 -53
  43. package/lib/node/vsx-extension-resolver.d.ts +17 -17
  44. package/lib/node/vsx-extension-resolver.js +137 -137
  45. package/lib/node/vsx-registry-backend-module.d.ts +3 -3
  46. package/lib/node/vsx-registry-backend-module.js +35 -35
  47. package/lib/package.spec.js +25 -25
  48. package/package.json +10 -10
  49. package/src/browser/recommended-extensions/preference-provider-overrides.ts +99 -99
  50. package/src/browser/recommended-extensions/recommended-extensions-json-schema.ts +74 -74
  51. package/src/browser/recommended-extensions/recommended-extensions-preference-contribution.ts +68 -68
  52. package/src/browser/style/extensions.svg +4 -4
  53. package/src/browser/style/index.css +354 -354
  54. package/src/browser/vsx-extension-commands.ts +63 -63
  55. package/src/browser/vsx-extension-editor-manager.ts +42 -42
  56. package/src/browser/vsx-extension-editor.tsx +96 -96
  57. package/src/browser/vsx-extension.tsx +662 -662
  58. package/src/browser/vsx-extensions-contribution.ts +315 -315
  59. package/src/browser/vsx-extensions-model.ts +366 -366
  60. package/src/browser/vsx-extensions-search-bar.tsx +69 -69
  61. package/src/browser/vsx-extensions-search-model.ts +61 -61
  62. package/src/browser/vsx-extensions-source.ts +83 -83
  63. package/src/browser/vsx-extensions-view-container.ts +179 -179
  64. package/src/browser/vsx-extensions-widget.tsx +138 -138
  65. package/src/browser/vsx-language-quick-pick-service.ts +97 -97
  66. package/src/browser/vsx-registry-frontend-module.ts +113 -113
  67. package/src/common/ovsx-client-provider.ts +30 -30
  68. package/src/common/vsx-environment.ts +24 -24
  69. package/src/common/vsx-extension-uri.ts +20 -20
  70. package/src/node/vsx-environment-impl.ts +41 -41
  71. package/src/node/vsx-extension-resolver.ts +111 -111
  72. package/src/node/vsx-registry-backend-module.ts +37 -37
  73. package/src/package.spec.ts +29 -29
@@ -1,41 +1,41 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 TypeFox 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 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { injectable, inject } from '@theia/core/shared/inversify';
18
- import URI from '@theia/core/lib/common/uri';
19
- import { PluginVsCodeCliContribution } from '@theia/plugin-ext-vscode/lib/node/plugin-vscode-cli-contribution';
20
- import { VSXEnvironment } from '../common/vsx-environment';
21
-
22
- @injectable()
23
- export class VSXEnvironmentImpl implements VSXEnvironment {
24
-
25
- protected _registryUri = new URI(process.env['VSX_REGISTRY_URL']?.trim() || 'https://open-vsx.org');
26
-
27
- @inject(PluginVsCodeCliContribution)
28
- protected readonly pluginVscodeCli: PluginVsCodeCliContribution;
29
-
30
- async getRegistryUri(): Promise<string> {
31
- return this._registryUri.toString(true);
32
- }
33
-
34
- async getRegistryApiUri(): Promise<string> {
35
- return this._registryUri.resolve('api').toString(true);
36
- }
37
-
38
- async getVscodeApiVersion(): Promise<string> {
39
- return this.pluginVscodeCli.vsCodeApiVersionPromise;
40
- }
41
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 TypeFox 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 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { injectable, inject } from '@theia/core/shared/inversify';
18
+ import URI from '@theia/core/lib/common/uri';
19
+ import { PluginVsCodeCliContribution } from '@theia/plugin-ext-vscode/lib/node/plugin-vscode-cli-contribution';
20
+ import { VSXEnvironment } from '../common/vsx-environment';
21
+
22
+ @injectable()
23
+ export class VSXEnvironmentImpl implements VSXEnvironment {
24
+
25
+ protected _registryUri = new URI(process.env['VSX_REGISTRY_URL']?.trim() || 'https://open-vsx.org');
26
+
27
+ @inject(PluginVsCodeCliContribution)
28
+ protected readonly pluginVscodeCli: PluginVsCodeCliContribution;
29
+
30
+ async getRegistryUri(): Promise<string> {
31
+ return this._registryUri.toString(true);
32
+ }
33
+
34
+ async getRegistryApiUri(): Promise<string> {
35
+ return this._registryUri.resolve('api').toString(true);
36
+ }
37
+
38
+ async getVscodeApiVersion(): Promise<string> {
39
+ return this.pluginVscodeCli.vsCodeApiVersionPromise;
40
+ }
41
+ }
@@ -1,111 +1,111 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 TypeFox 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 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import * as path from 'path';
18
- import * as semver from 'semver';
19
- import * as fs from '@theia/core/shared/fs-extra';
20
- import { injectable, inject } from '@theia/core/shared/inversify';
21
- import URI from '@theia/core/lib/common/uri';
22
- import { PluginDeployerHandler, PluginDeployerResolver, PluginDeployerResolverContext, PluginDeployOptions, PluginIdentifiers } from '@theia/plugin-ext/lib/common/plugin-protocol';
23
- import { VSCodeExtensionUri } from '@theia/plugin-ext-vscode/lib/common/plugin-vscode-uri';
24
- import { OVSXClientProvider } from '../common/ovsx-client-provider';
25
- import { VSXExtensionRaw } from '@theia/ovsx-client';
26
- import { RequestService } from '@theia/core/shared/@theia/request';
27
- import { PluginVSCodeEnvironment } from '@theia/plugin-ext-vscode/lib/common/plugin-vscode-environment';
28
- import { PluginUninstallationManager } from '@theia/plugin-ext/lib/main/node/plugin-uninstallation-manager';
29
-
30
- @injectable()
31
- export class VSXExtensionResolver implements PluginDeployerResolver {
32
-
33
- @inject(OVSXClientProvider) protected clientProvider: OVSXClientProvider;
34
- @inject(PluginDeployerHandler) protected pluginDeployerHandler: PluginDeployerHandler;
35
- @inject(RequestService) protected requestService: RequestService;
36
- @inject(PluginVSCodeEnvironment) protected readonly environment: PluginVSCodeEnvironment;
37
- @inject(PluginUninstallationManager) protected readonly uninstallationManager: PluginUninstallationManager;
38
-
39
- accept(pluginId: string): boolean {
40
- return !!VSCodeExtensionUri.toId(new URI(pluginId));
41
- }
42
-
43
- async resolve(context: PluginDeployerResolverContext, options?: PluginDeployOptions): Promise<void> {
44
- const id = VSCodeExtensionUri.toId(new URI(context.getOriginId()));
45
- if (!id) {
46
- return;
47
- }
48
- let extension: VSXExtensionRaw | undefined;
49
- const client = await this.clientProvider();
50
- if (options) {
51
- console.log(`[${id}]: trying to resolve version ${options.version}...`);
52
- extension = await client.getExtension(id, { extensionVersion: options.version, includeAllVersions: true });
53
- } else {
54
- console.log(`[${id}]: trying to resolve latest version...`);
55
- extension = await client.getLatestCompatibleExtensionVersion(id);
56
- }
57
- if (!extension) {
58
- return;
59
- }
60
- if (extension.error) {
61
- throw new Error(extension.error);
62
- }
63
- const resolvedId = id + '-' + extension.version;
64
- const downloadUrl = extension.files.download;
65
- console.log(`[${id}]: resolved to '${resolvedId}'`);
66
-
67
- if (!options?.ignoreOtherVersions) {
68
- const existingVersion = this.hasSameOrNewerVersion(id, extension);
69
- if (existingVersion) {
70
- console.log(`[${id}]: is already installed with the same or newer version '${existingVersion}'`);
71
- return;
72
- }
73
- }
74
- const downloadPath = (await this.environment.getExtensionsDirUri()).path.fsPath();
75
- await fs.ensureDir(downloadPath);
76
- const extensionPath = path.resolve(downloadPath, path.basename(downloadUrl));
77
- console.log(`[${resolvedId}]: trying to download from "${downloadUrl}"...`, 'to path', downloadPath);
78
- if (!await this.download(downloadUrl, extensionPath)) {
79
- console.log(`[${resolvedId}]: not found`);
80
- return;
81
- }
82
- console.log(`[${resolvedId}]: downloaded to ${extensionPath}"`);
83
- context.addPlugin(resolvedId, extensionPath);
84
- }
85
-
86
- protected hasSameOrNewerVersion(id: string, extension: VSXExtensionRaw): string | undefined {
87
- const existingPlugins = this.pluginDeployerHandler.getDeployedPluginsById(id)
88
- .filter(plugin => !this.uninstallationManager.isUninstalled(PluginIdentifiers.componentsToVersionedId(plugin.metadata.model)));
89
- const sufficientVersion = existingPlugins.find(existingPlugin => {
90
- const existingVersion = semver.clean(existingPlugin.metadata.model.version);
91
- const desiredVersion = semver.clean(extension.version);
92
- if (desiredVersion && existingVersion && semver.gte(existingVersion, desiredVersion)) {
93
- return existingVersion;
94
- }
95
- });
96
- return sufficientVersion?.metadata.model.version;
97
- }
98
-
99
- protected async download(downloadUrl: string, downloadPath: string): Promise<boolean> {
100
- if (await fs.pathExists(downloadPath)) { return true; }
101
- const context = await this.requestService.request({ url: downloadUrl });
102
- if (context.res.statusCode === 404) {
103
- return false;
104
- } else if (context.res.statusCode !== 200) {
105
- throw new Error('Request returned status code: ' + context.res.statusCode);
106
- } else {
107
- await fs.writeFile(downloadPath, context.buffer);
108
- return true;
109
- }
110
- }
111
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 TypeFox 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 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import * as path from 'path';
18
+ import * as semver from 'semver';
19
+ import * as fs from '@theia/core/shared/fs-extra';
20
+ import { injectable, inject } from '@theia/core/shared/inversify';
21
+ import URI from '@theia/core/lib/common/uri';
22
+ import { PluginDeployerHandler, PluginDeployerResolver, PluginDeployerResolverContext, PluginDeployOptions, PluginIdentifiers } from '@theia/plugin-ext/lib/common/plugin-protocol';
23
+ import { VSCodeExtensionUri } from '@theia/plugin-ext-vscode/lib/common/plugin-vscode-uri';
24
+ import { OVSXClientProvider } from '../common/ovsx-client-provider';
25
+ import { VSXExtensionRaw } from '@theia/ovsx-client';
26
+ import { RequestService } from '@theia/core/shared/@theia/request';
27
+ import { PluginVSCodeEnvironment } from '@theia/plugin-ext-vscode/lib/common/plugin-vscode-environment';
28
+ import { PluginUninstallationManager } from '@theia/plugin-ext/lib/main/node/plugin-uninstallation-manager';
29
+
30
+ @injectable()
31
+ export class VSXExtensionResolver implements PluginDeployerResolver {
32
+
33
+ @inject(OVSXClientProvider) protected clientProvider: OVSXClientProvider;
34
+ @inject(PluginDeployerHandler) protected pluginDeployerHandler: PluginDeployerHandler;
35
+ @inject(RequestService) protected requestService: RequestService;
36
+ @inject(PluginVSCodeEnvironment) protected readonly environment: PluginVSCodeEnvironment;
37
+ @inject(PluginUninstallationManager) protected readonly uninstallationManager: PluginUninstallationManager;
38
+
39
+ accept(pluginId: string): boolean {
40
+ return !!VSCodeExtensionUri.toId(new URI(pluginId));
41
+ }
42
+
43
+ async resolve(context: PluginDeployerResolverContext, options?: PluginDeployOptions): Promise<void> {
44
+ const id = VSCodeExtensionUri.toId(new URI(context.getOriginId()));
45
+ if (!id) {
46
+ return;
47
+ }
48
+ let extension: VSXExtensionRaw | undefined;
49
+ const client = await this.clientProvider();
50
+ if (options) {
51
+ console.log(`[${id}]: trying to resolve version ${options.version}...`);
52
+ extension = await client.getExtension(id, { extensionVersion: options.version, includeAllVersions: true });
53
+ } else {
54
+ console.log(`[${id}]: trying to resolve latest version...`);
55
+ extension = await client.getLatestCompatibleExtensionVersion(id);
56
+ }
57
+ if (!extension) {
58
+ return;
59
+ }
60
+ if (extension.error) {
61
+ throw new Error(extension.error);
62
+ }
63
+ const resolvedId = id + '-' + extension.version;
64
+ const downloadUrl = extension.files.download;
65
+ console.log(`[${id}]: resolved to '${resolvedId}'`);
66
+
67
+ if (!options?.ignoreOtherVersions) {
68
+ const existingVersion = this.hasSameOrNewerVersion(id, extension);
69
+ if (existingVersion) {
70
+ console.log(`[${id}]: is already installed with the same or newer version '${existingVersion}'`);
71
+ return;
72
+ }
73
+ }
74
+ const downloadPath = (await this.environment.getExtensionsDirUri()).path.fsPath();
75
+ await fs.ensureDir(downloadPath);
76
+ const extensionPath = path.resolve(downloadPath, path.basename(downloadUrl));
77
+ console.log(`[${resolvedId}]: trying to download from "${downloadUrl}"...`, 'to path', downloadPath);
78
+ if (!await this.download(downloadUrl, extensionPath)) {
79
+ console.log(`[${resolvedId}]: not found`);
80
+ return;
81
+ }
82
+ console.log(`[${resolvedId}]: downloaded to ${extensionPath}"`);
83
+ context.addPlugin(resolvedId, extensionPath);
84
+ }
85
+
86
+ protected hasSameOrNewerVersion(id: string, extension: VSXExtensionRaw): string | undefined {
87
+ const existingPlugins = this.pluginDeployerHandler.getDeployedPluginsById(id)
88
+ .filter(plugin => !this.uninstallationManager.isUninstalled(PluginIdentifiers.componentsToVersionedId(plugin.metadata.model)));
89
+ const sufficientVersion = existingPlugins.find(existingPlugin => {
90
+ const existingVersion = semver.clean(existingPlugin.metadata.model.version);
91
+ const desiredVersion = semver.clean(extension.version);
92
+ if (desiredVersion && existingVersion && semver.gte(existingVersion, desiredVersion)) {
93
+ return existingVersion;
94
+ }
95
+ });
96
+ return sufficientVersion?.metadata.model.version;
97
+ }
98
+
99
+ protected async download(downloadUrl: string, downloadPath: string): Promise<boolean> {
100
+ if (await fs.pathExists(downloadPath)) { return true; }
101
+ const context = await this.requestService.request({ url: downloadUrl });
102
+ if (context.res.statusCode === 404) {
103
+ return false;
104
+ } else if (context.res.statusCode !== 200) {
105
+ throw new Error('Request returned status code: ' + context.res.statusCode);
106
+ } else {
107
+ await fs.writeFile(downloadPath, context.buffer);
108
+ return true;
109
+ }
110
+ }
111
+ }
@@ -1,37 +1,37 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 TypeFox 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 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { ContainerModule } from '@theia/core/shared/inversify';
18
- import { VSXExtensionResolver } from './vsx-extension-resolver';
19
- import { PluginDeployerResolver } from '@theia/plugin-ext/lib/common/plugin-protocol';
20
- import { OVSXClientProvider, createOVSXClient } from '../common/ovsx-client-provider';
21
- import { VSXEnvironment, VSX_ENVIRONMENT_PATH } from '../common/vsx-environment';
22
- import { VSXEnvironmentImpl } from './vsx-environment-impl';
23
- import { ConnectionHandler, JsonRpcConnectionHandler } from '@theia/core';
24
- import { RequestService } from '@theia/core/shared/@theia/request';
25
-
26
- export default new ContainerModule(bind => {
27
- bind<OVSXClientProvider>(OVSXClientProvider).toDynamicValue(ctx => {
28
- const clientPromise = createOVSXClient(ctx.container.get(VSXEnvironment), ctx.container.get(RequestService));
29
- return () => clientPromise;
30
- }).inSingletonScope();
31
- bind(VSXEnvironment).to(VSXEnvironmentImpl).inSingletonScope();
32
- bind(ConnectionHandler).toDynamicValue(
33
- ctx => new JsonRpcConnectionHandler(VSX_ENVIRONMENT_PATH, () => ctx.container.get(VSXEnvironment))
34
- ).inSingletonScope();
35
- bind(VSXExtensionResolver).toSelf().inSingletonScope();
36
- bind(PluginDeployerResolver).toService(VSXExtensionResolver);
37
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 TypeFox 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 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { ContainerModule } from '@theia/core/shared/inversify';
18
+ import { VSXExtensionResolver } from './vsx-extension-resolver';
19
+ import { PluginDeployerResolver } from '@theia/plugin-ext/lib/common/plugin-protocol';
20
+ import { OVSXClientProvider, createOVSXClient } from '../common/ovsx-client-provider';
21
+ import { VSXEnvironment, VSX_ENVIRONMENT_PATH } from '../common/vsx-environment';
22
+ import { VSXEnvironmentImpl } from './vsx-environment-impl';
23
+ import { ConnectionHandler, JsonRpcConnectionHandler } from '@theia/core';
24
+ import { RequestService } from '@theia/core/shared/@theia/request';
25
+
26
+ export default new ContainerModule(bind => {
27
+ bind<OVSXClientProvider>(OVSXClientProvider).toDynamicValue(ctx => {
28
+ const clientPromise = createOVSXClient(ctx.container.get(VSXEnvironment), ctx.container.get(RequestService));
29
+ return () => clientPromise;
30
+ }).inSingletonScope();
31
+ bind(VSXEnvironment).to(VSXEnvironmentImpl).inSingletonScope();
32
+ bind(ConnectionHandler).toDynamicValue(
33
+ ctx => new JsonRpcConnectionHandler(VSX_ENVIRONMENT_PATH, () => ctx.container.get(VSXEnvironment))
34
+ ).inSingletonScope();
35
+ bind(VSXExtensionResolver).toSelf().inSingletonScope();
36
+ bind(PluginDeployerResolver).toService(VSXExtensionResolver);
37
+ });
@@ -1,29 +1,29 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 TypeFox 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 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('vsx-registry package', () => {
26
-
27
- it('support code coverage statistics', () => true);
28
-
29
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 TypeFox 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 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('vsx-registry package', () => {
26
+
27
+ it('support code coverage statistics', () => true);
28
+
29
+ });