@theia/vsx-registry 1.45.1 → 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.
- package/README.md +45 -45
- package/lib/browser/recommended-extensions/preference-provider-overrides.d.ts +17 -17
- package/lib/browser/recommended-extensions/preference-provider-overrides.js +95 -95
- package/lib/browser/recommended-extensions/recommended-extensions-json-schema.d.ts +14 -14
- package/lib/browser/recommended-extensions/recommended-extensions-json-schema.js +94 -94
- package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.d.ts +11 -11
- package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.js +59 -59
- package/lib/browser/vsx-extension-commands.d.ts +14 -13
- package/lib/browser/vsx-extension-commands.d.ts.map +1 -1
- package/lib/browser/vsx-extension-commands.js +68 -63
- package/lib/browser/vsx-extension-commands.js.map +1 -1
- package/lib/browser/vsx-extension-editor-manager.d.ts +9 -9
- package/lib/browser/vsx-extension-editor-manager.js +49 -49
- package/lib/browser/vsx-extension-editor.d.ts +21 -21
- package/lib/browser/vsx-extension-editor.js +109 -109
- package/lib/browser/vsx-extension.d.ts +146 -143
- package/lib/browser/vsx-extension.d.ts.map +1 -1
- package/lib/browser/vsx-extension.js +616 -596
- package/lib/browser/vsx-extension.js.map +1 -1
- package/lib/browser/vsx-extensions-contribution.d.ts +70 -60
- package/lib/browser/vsx-extensions-contribution.d.ts.map +1 -1
- package/lib/browser/vsx-extensions-contribution.js +375 -344
- package/lib/browser/vsx-extensions-contribution.js.map +1 -1
- package/lib/browser/vsx-extensions-model.d.ts +75 -72
- package/lib/browser/vsx-extensions-model.d.ts.map +1 -1
- package/lib/browser/vsx-extensions-model.js +437 -391
- package/lib/browser/vsx-extensions-model.js.map +1 -1
- package/lib/browser/vsx-extensions-preferences.d.ts +12 -0
- package/lib/browser/vsx-extensions-preferences.d.ts.map +1 -0
- package/lib/browser/vsx-extensions-preferences.js +47 -0
- package/lib/browser/vsx-extensions-preferences.js.map +1 -0
- package/lib/browser/vsx-extensions-search-bar.d.ts +22 -14
- package/lib/browser/vsx-extensions-search-bar.d.ts.map +1 -1
- package/lib/browser/vsx-extensions-search-bar.js +106 -75
- package/lib/browser/vsx-extensions-search-bar.js.map +1 -1
- package/lib/browser/vsx-extensions-search-model.d.ts +21 -21
- package/lib/browser/vsx-extensions-search-model.js +70 -70
- package/lib/browser/vsx-extensions-source.d.ts +19 -19
- package/lib/browser/vsx-extensions-source.js +102 -102
- package/lib/browser/vsx-extensions-view-container.d.ts +49 -49
- package/lib/browser/vsx-extensions-view-container.js +179 -179
- package/lib/browser/vsx-extensions-widget.d.ts +35 -34
- package/lib/browser/vsx-extensions-widget.d.ts.map +1 -1
- package/lib/browser/vsx-extensions-widget.js +164 -156
- package/lib/browser/vsx-extensions-widget.js.map +1 -1
- package/lib/browser/vsx-language-quick-pick-service.d.ts +15 -15
- package/lib/browser/vsx-language-quick-pick-service.js +121 -121
- package/lib/browser/vsx-registry-frontend-module.d.ts +4 -4
- package/lib/browser/vsx-registry-frontend-module.d.ts.map +1 -1
- package/lib/browser/vsx-registry-frontend-module.js +99 -97
- package/lib/browser/vsx-registry-frontend-module.js.map +1 -1
- package/lib/common/index.d.ts +3 -3
- package/lib/common/index.js +25 -25
- package/lib/common/ovsx-client-provider.d.ts +13 -13
- package/lib/common/ovsx-client-provider.js +29 -29
- package/lib/common/vsx-environment.d.ts +9 -9
- package/lib/common/vsx-environment.js +20 -20
- package/lib/common/vsx-extension-uri.d.ts +3 -3
- package/lib/common/vsx-extension-uri.js +20 -20
- package/lib/common/vsx-registry-common-module.d.ts +3 -3
- package/lib/common/vsx-registry-common-module.js +57 -57
- package/lib/node/vsx-cli.d.ts +9 -9
- package/lib/node/vsx-cli.js +41 -41
- package/lib/node/vsx-environment-impl.d.ts +14 -14
- package/lib/node/vsx-environment-impl.js +61 -61
- package/lib/node/vsx-extension-resolver.d.ts +20 -20
- package/lib/node/vsx-extension-resolver.js +154 -154
- package/lib/node/vsx-registry-backend-module.d.ts +3 -3
- package/lib/node/vsx-registry-backend-module.js +35 -35
- package/lib/package.spec.js +25 -25
- package/package.json +12 -12
- package/src/browser/recommended-extensions/preference-provider-overrides.ts +99 -99
- package/src/browser/recommended-extensions/recommended-extensions-json-schema.ts +74 -74
- package/src/browser/recommended-extensions/recommended-extensions-preference-contribution.ts +68 -68
- package/src/browser/style/extensions.svg +4 -4
- package/src/browser/style/index.css +436 -373
- package/src/browser/vsx-extension-commands.ts +68 -63
- package/src/browser/vsx-extension-editor-manager.ts +42 -42
- package/src/browser/vsx-extension-editor.tsx +96 -96
- package/src/browser/vsx-extension.tsx +704 -675
- package/src/browser/vsx-extensions-contribution.ts +361 -327
- package/src/browser/vsx-extensions-model.ts +436 -389
- package/src/browser/vsx-extensions-preferences.ts +58 -0
- package/src/browser/vsx-extensions-search-bar.tsx +107 -69
- package/src/browser/vsx-extensions-search-model.ts +61 -61
- package/src/browser/vsx-extensions-source.ts +83 -83
- package/src/browser/vsx-extensions-view-container.ts +179 -179
- package/src/browser/vsx-extensions-widget.tsx +165 -156
- package/src/browser/vsx-language-quick-pick-service.ts +110 -110
- package/src/browser/vsx-registry-frontend-module.ts +108 -106
- package/src/common/index.ts +19 -19
- package/src/common/ovsx-client-provider.ts +35 -35
- package/src/common/vsx-environment.ts +27 -27
- package/src/common/vsx-extension-uri.ts +20 -20
- package/src/common/vsx-registry-common-module.ts +63 -63
- package/src/node/vsx-cli.ts +38 -38
- package/src/node/vsx-environment-impl.ts +50 -50
- package/src/node/vsx-extension-resolver.ts +125 -125
- package/src/node/vsx-registry-backend-module.ts +35 -35
- package/src/package.spec.ts +29 -29
|
@@ -1,155 +1,155 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2020 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
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
var VSXExtensionResolver_1;
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.VSXExtensionResolver = void 0;
|
|
29
|
-
const path = require("path");
|
|
30
|
-
const semver = require("semver");
|
|
31
|
-
const fs = require("@theia/core/shared/fs-extra");
|
|
32
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
34
|
-
const plugin_protocol_1 = require("@theia/plugin-ext/lib/common/plugin-protocol");
|
|
35
|
-
const node_1 = require("@theia/core/lib/node");
|
|
36
|
-
const plugin_vscode_uri_1 = require("@theia/plugin-ext-vscode/lib/common/plugin-vscode-uri");
|
|
37
|
-
const ovsx_client_provider_1 = require("../common/ovsx-client-provider");
|
|
38
|
-
const ovsx_client_1 = require("@theia/ovsx-client");
|
|
39
|
-
const request_1 = require("@theia/core/shared/@theia/request");
|
|
40
|
-
const plugin_vscode_environment_1 = require("@theia/plugin-ext-vscode/lib/common/plugin-vscode-environment");
|
|
41
|
-
const plugin_uninstallation_manager_1 = require("@theia/plugin-ext/lib/main/node/plugin-uninstallation-manager");
|
|
42
|
-
let VSXExtensionResolver = VSXExtensionResolver_1 = class VSXExtensionResolver {
|
|
43
|
-
accept(pluginId) {
|
|
44
|
-
return !!plugin_vscode_uri_1.VSCodeExtensionUri.toId(new uri_1.default(pluginId));
|
|
45
|
-
}
|
|
46
|
-
async resolve(context, options) {
|
|
47
|
-
const id = plugin_vscode_uri_1.VSCodeExtensionUri.toId(new uri_1.default(context.getOriginId()));
|
|
48
|
-
if (!id) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
let extension;
|
|
52
|
-
const client = await this.clientProvider();
|
|
53
|
-
if (options) {
|
|
54
|
-
console.log(`[${id}]: trying to resolve version ${options.version}...`);
|
|
55
|
-
const { extensions } = await client.query({ extensionId: id, extensionVersion: options.version, includeAllVersions: true });
|
|
56
|
-
extension = extensions[0];
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
console.log(`[${id}]: trying to resolve latest version...`);
|
|
60
|
-
const { extensions } = await client.query({ extensionId: id, includeAllVersions: true });
|
|
61
|
-
extension = this.vsxApiFilter.getLatestCompatibleExtension(extensions);
|
|
62
|
-
}
|
|
63
|
-
if (!extension) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (extension.error) {
|
|
67
|
-
throw new Error(extension.error);
|
|
68
|
-
}
|
|
69
|
-
const resolvedId = id + '-' + extension.version;
|
|
70
|
-
const downloadUrl = extension.files.download;
|
|
71
|
-
console.log(`[${id}]: resolved to '${resolvedId}'`);
|
|
72
|
-
if (!(options === null || options === void 0 ? void 0 : options.ignoreOtherVersions)) {
|
|
73
|
-
const existingVersion = this.hasSameOrNewerVersion(id, extension);
|
|
74
|
-
if (existingVersion) {
|
|
75
|
-
console.log(`[${id}]: is already installed with the same or newer version '${existingVersion}'`);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const downloadDir = await this.getTempDir();
|
|
80
|
-
await fs.ensureDir(downloadDir);
|
|
81
|
-
const downloadedExtensionPath = path.resolve(downloadDir, path.basename(downloadUrl));
|
|
82
|
-
console.log(`[${resolvedId}]: trying to download from "${downloadUrl}"...`, 'to path', downloadDir);
|
|
83
|
-
if (!await this.download(downloadUrl, downloadedExtensionPath)) {
|
|
84
|
-
console.log(`[${resolvedId}]: not found`);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
console.log(`[${resolvedId}]: downloaded to ${downloadedExtensionPath}"`);
|
|
88
|
-
context.addPlugin(resolvedId, downloadedExtensionPath);
|
|
89
|
-
}
|
|
90
|
-
async getTempDir() {
|
|
91
|
-
const tempDir = node_1.FileUri.fsPath(await this.environment.getTempDirUri(VSXExtensionResolver_1.TEMP_DIR_PREFIX));
|
|
92
|
-
if (!await fs.pathExists(tempDir)) {
|
|
93
|
-
await fs.mkdirs(tempDir);
|
|
94
|
-
}
|
|
95
|
-
return tempDir;
|
|
96
|
-
}
|
|
97
|
-
hasSameOrNewerVersion(id, extension) {
|
|
98
|
-
const existingPlugins = this.pluginDeployerHandler.getDeployedPluginsById(id)
|
|
99
|
-
.filter(plugin => !this.uninstallationManager.isUninstalled(plugin_protocol_1.PluginIdentifiers.componentsToVersionedId(plugin.metadata.model)));
|
|
100
|
-
const sufficientVersion = existingPlugins.find(existingPlugin => {
|
|
101
|
-
const existingVersion = semver.clean(existingPlugin.metadata.model.version);
|
|
102
|
-
const desiredVersion = semver.clean(extension.version);
|
|
103
|
-
if (desiredVersion && existingVersion && semver.gte(existingVersion, desiredVersion)) {
|
|
104
|
-
return existingVersion;
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
return sufficientVersion === null || sufficientVersion === void 0 ? void 0 : sufficientVersion.metadata.model.version;
|
|
108
|
-
}
|
|
109
|
-
async download(downloadUrl, downloadPath) {
|
|
110
|
-
if (await fs.pathExists(downloadPath)) {
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
const context = await this.requestService.request({ url: downloadUrl });
|
|
114
|
-
if (context.res.statusCode === 404) {
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
else if (context.res.statusCode !== 200) {
|
|
118
|
-
throw new Error('Request returned status code: ' + context.res.statusCode);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
await fs.writeFile(downloadPath, context.buffer);
|
|
122
|
-
return true;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
VSXExtensionResolver.TEMP_DIR_PREFIX = 'vscode-download';
|
|
127
|
-
__decorate([
|
|
128
|
-
(0, inversify_1.inject)(ovsx_client_provider_1.OVSXClientProvider),
|
|
129
|
-
__metadata("design:type", Function)
|
|
130
|
-
], VSXExtensionResolver.prototype, "clientProvider", void 0);
|
|
131
|
-
__decorate([
|
|
132
|
-
(0, inversify_1.inject)(plugin_protocol_1.PluginDeployerHandler),
|
|
133
|
-
__metadata("design:type", Object)
|
|
134
|
-
], VSXExtensionResolver.prototype, "pluginDeployerHandler", void 0);
|
|
135
|
-
__decorate([
|
|
136
|
-
(0, inversify_1.inject)(request_1.RequestService),
|
|
137
|
-
__metadata("design:type", Object)
|
|
138
|
-
], VSXExtensionResolver.prototype, "requestService", void 0);
|
|
139
|
-
__decorate([
|
|
140
|
-
(0, inversify_1.inject)(plugin_vscode_environment_1.PluginVSCodeEnvironment),
|
|
141
|
-
__metadata("design:type", plugin_vscode_environment_1.PluginVSCodeEnvironment)
|
|
142
|
-
], VSXExtensionResolver.prototype, "environment", void 0);
|
|
143
|
-
__decorate([
|
|
144
|
-
(0, inversify_1.inject)(plugin_uninstallation_manager_1.PluginUninstallationManager),
|
|
145
|
-
__metadata("design:type", plugin_uninstallation_manager_1.PluginUninstallationManager)
|
|
146
|
-
], VSXExtensionResolver.prototype, "uninstallationManager", void 0);
|
|
147
|
-
__decorate([
|
|
148
|
-
(0, inversify_1.inject)(ovsx_client_1.OVSXApiFilter),
|
|
149
|
-
__metadata("design:type", Object)
|
|
150
|
-
], VSXExtensionResolver.prototype, "vsxApiFilter", void 0);
|
|
151
|
-
VSXExtensionResolver = VSXExtensionResolver_1 = __decorate([
|
|
152
|
-
(0, inversify_1.injectable)()
|
|
153
|
-
], VSXExtensionResolver);
|
|
154
|
-
exports.VSXExtensionResolver = VSXExtensionResolver;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2020 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
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
var VSXExtensionResolver_1;
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.VSXExtensionResolver = void 0;
|
|
29
|
+
const path = require("path");
|
|
30
|
+
const semver = require("semver");
|
|
31
|
+
const fs = require("@theia/core/shared/fs-extra");
|
|
32
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
34
|
+
const plugin_protocol_1 = require("@theia/plugin-ext/lib/common/plugin-protocol");
|
|
35
|
+
const node_1 = require("@theia/core/lib/node");
|
|
36
|
+
const plugin_vscode_uri_1 = require("@theia/plugin-ext-vscode/lib/common/plugin-vscode-uri");
|
|
37
|
+
const ovsx_client_provider_1 = require("../common/ovsx-client-provider");
|
|
38
|
+
const ovsx_client_1 = require("@theia/ovsx-client");
|
|
39
|
+
const request_1 = require("@theia/core/shared/@theia/request");
|
|
40
|
+
const plugin_vscode_environment_1 = require("@theia/plugin-ext-vscode/lib/common/plugin-vscode-environment");
|
|
41
|
+
const plugin_uninstallation_manager_1 = require("@theia/plugin-ext/lib/main/node/plugin-uninstallation-manager");
|
|
42
|
+
let VSXExtensionResolver = VSXExtensionResolver_1 = class VSXExtensionResolver {
|
|
43
|
+
accept(pluginId) {
|
|
44
|
+
return !!plugin_vscode_uri_1.VSCodeExtensionUri.toId(new uri_1.default(pluginId));
|
|
45
|
+
}
|
|
46
|
+
async resolve(context, options) {
|
|
47
|
+
const id = plugin_vscode_uri_1.VSCodeExtensionUri.toId(new uri_1.default(context.getOriginId()));
|
|
48
|
+
if (!id) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
let extension;
|
|
52
|
+
const client = await this.clientProvider();
|
|
53
|
+
if (options) {
|
|
54
|
+
console.log(`[${id}]: trying to resolve version ${options.version}...`);
|
|
55
|
+
const { extensions } = await client.query({ extensionId: id, extensionVersion: options.version, includeAllVersions: true });
|
|
56
|
+
extension = extensions[0];
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
console.log(`[${id}]: trying to resolve latest version...`);
|
|
60
|
+
const { extensions } = await client.query({ extensionId: id, includeAllVersions: true });
|
|
61
|
+
extension = this.vsxApiFilter.getLatestCompatibleExtension(extensions);
|
|
62
|
+
}
|
|
63
|
+
if (!extension) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (extension.error) {
|
|
67
|
+
throw new Error(extension.error);
|
|
68
|
+
}
|
|
69
|
+
const resolvedId = id + '-' + extension.version;
|
|
70
|
+
const downloadUrl = extension.files.download;
|
|
71
|
+
console.log(`[${id}]: resolved to '${resolvedId}'`);
|
|
72
|
+
if (!(options === null || options === void 0 ? void 0 : options.ignoreOtherVersions)) {
|
|
73
|
+
const existingVersion = this.hasSameOrNewerVersion(id, extension);
|
|
74
|
+
if (existingVersion) {
|
|
75
|
+
console.log(`[${id}]: is already installed with the same or newer version '${existingVersion}'`);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const downloadDir = await this.getTempDir();
|
|
80
|
+
await fs.ensureDir(downloadDir);
|
|
81
|
+
const downloadedExtensionPath = path.resolve(downloadDir, path.basename(downloadUrl));
|
|
82
|
+
console.log(`[${resolvedId}]: trying to download from "${downloadUrl}"...`, 'to path', downloadDir);
|
|
83
|
+
if (!await this.download(downloadUrl, downloadedExtensionPath)) {
|
|
84
|
+
console.log(`[${resolvedId}]: not found`);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
console.log(`[${resolvedId}]: downloaded to ${downloadedExtensionPath}"`);
|
|
88
|
+
context.addPlugin(resolvedId, downloadedExtensionPath);
|
|
89
|
+
}
|
|
90
|
+
async getTempDir() {
|
|
91
|
+
const tempDir = node_1.FileUri.fsPath(await this.environment.getTempDirUri(VSXExtensionResolver_1.TEMP_DIR_PREFIX));
|
|
92
|
+
if (!await fs.pathExists(tempDir)) {
|
|
93
|
+
await fs.mkdirs(tempDir);
|
|
94
|
+
}
|
|
95
|
+
return tempDir;
|
|
96
|
+
}
|
|
97
|
+
hasSameOrNewerVersion(id, extension) {
|
|
98
|
+
const existingPlugins = this.pluginDeployerHandler.getDeployedPluginsById(id)
|
|
99
|
+
.filter(plugin => !this.uninstallationManager.isUninstalled(plugin_protocol_1.PluginIdentifiers.componentsToVersionedId(plugin.metadata.model)));
|
|
100
|
+
const sufficientVersion = existingPlugins.find(existingPlugin => {
|
|
101
|
+
const existingVersion = semver.clean(existingPlugin.metadata.model.version);
|
|
102
|
+
const desiredVersion = semver.clean(extension.version);
|
|
103
|
+
if (desiredVersion && existingVersion && semver.gte(existingVersion, desiredVersion)) {
|
|
104
|
+
return existingVersion;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return sufficientVersion === null || sufficientVersion === void 0 ? void 0 : sufficientVersion.metadata.model.version;
|
|
108
|
+
}
|
|
109
|
+
async download(downloadUrl, downloadPath) {
|
|
110
|
+
if (await fs.pathExists(downloadPath)) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
const context = await this.requestService.request({ url: downloadUrl });
|
|
114
|
+
if (context.res.statusCode === 404) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
else if (context.res.statusCode !== 200) {
|
|
118
|
+
throw new Error('Request returned status code: ' + context.res.statusCode);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
await fs.writeFile(downloadPath, context.buffer);
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
VSXExtensionResolver.TEMP_DIR_PREFIX = 'vscode-download';
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, inversify_1.inject)(ovsx_client_provider_1.OVSXClientProvider),
|
|
129
|
+
__metadata("design:type", Function)
|
|
130
|
+
], VSXExtensionResolver.prototype, "clientProvider", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, inversify_1.inject)(plugin_protocol_1.PluginDeployerHandler),
|
|
133
|
+
__metadata("design:type", Object)
|
|
134
|
+
], VSXExtensionResolver.prototype, "pluginDeployerHandler", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, inversify_1.inject)(request_1.RequestService),
|
|
137
|
+
__metadata("design:type", Object)
|
|
138
|
+
], VSXExtensionResolver.prototype, "requestService", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, inversify_1.inject)(plugin_vscode_environment_1.PluginVSCodeEnvironment),
|
|
141
|
+
__metadata("design:type", plugin_vscode_environment_1.PluginVSCodeEnvironment)
|
|
142
|
+
], VSXExtensionResolver.prototype, "environment", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, inversify_1.inject)(plugin_uninstallation_manager_1.PluginUninstallationManager),
|
|
145
|
+
__metadata("design:type", plugin_uninstallation_manager_1.PluginUninstallationManager)
|
|
146
|
+
], VSXExtensionResolver.prototype, "uninstallationManager", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, inversify_1.inject)(ovsx_client_1.OVSXApiFilter),
|
|
149
|
+
__metadata("design:type", Object)
|
|
150
|
+
], VSXExtensionResolver.prototype, "vsxApiFilter", void 0);
|
|
151
|
+
VSXExtensionResolver = VSXExtensionResolver_1 = __decorate([
|
|
152
|
+
(0, inversify_1.injectable)()
|
|
153
|
+
], VSXExtensionResolver);
|
|
154
|
+
exports.VSXExtensionResolver = VSXExtensionResolver;
|
|
155
155
|
//# sourceMappingURL=vsx-extension-resolver.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
2
|
-
declare const _default: ContainerModule;
|
|
3
|
-
export default _default;
|
|
1
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
2
|
+
declare const _default: ContainerModule;
|
|
3
|
+
export default _default;
|
|
4
4
|
//# sourceMappingURL=vsx-registry-backend-module.d.ts.map
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2020 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
|
-
const core_1 = require("@theia/core");
|
|
19
|
-
const node_1 = require("@theia/core/lib/node");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const plugin_protocol_1 = require("@theia/plugin-ext/lib/common/plugin-protocol");
|
|
22
|
-
const vsx_environment_1 = require("../common/vsx-environment");
|
|
23
|
-
const vsx_cli_1 = require("./vsx-cli");
|
|
24
|
-
const vsx_environment_impl_1 = require("./vsx-environment-impl");
|
|
25
|
-
const vsx_extension_resolver_1 = require("./vsx-extension-resolver");
|
|
26
|
-
exports.default = new inversify_1.ContainerModule(bind => {
|
|
27
|
-
bind(vsx_environment_1.VSXEnvironment).to(vsx_environment_impl_1.VSXEnvironmentImpl).inSingletonScope();
|
|
28
|
-
bind(vsx_cli_1.VsxCli).toSelf().inSingletonScope();
|
|
29
|
-
bind(node_1.CliContribution).toService(vsx_cli_1.VsxCli);
|
|
30
|
-
bind(core_1.ConnectionHandler)
|
|
31
|
-
.toDynamicValue(ctx => new core_1.JsonRpcConnectionHandler(vsx_environment_1.VSX_ENVIRONMENT_PATH, () => ctx.container.get(vsx_environment_1.VSXEnvironment)))
|
|
32
|
-
.inSingletonScope();
|
|
33
|
-
bind(vsx_extension_resolver_1.VSXExtensionResolver).toSelf().inSingletonScope();
|
|
34
|
-
bind(plugin_protocol_1.PluginDeployerResolver).toService(vsx_extension_resolver_1.VSXExtensionResolver);
|
|
35
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2020 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
|
+
const core_1 = require("@theia/core");
|
|
19
|
+
const node_1 = require("@theia/core/lib/node");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const plugin_protocol_1 = require("@theia/plugin-ext/lib/common/plugin-protocol");
|
|
22
|
+
const vsx_environment_1 = require("../common/vsx-environment");
|
|
23
|
+
const vsx_cli_1 = require("./vsx-cli");
|
|
24
|
+
const vsx_environment_impl_1 = require("./vsx-environment-impl");
|
|
25
|
+
const vsx_extension_resolver_1 = require("./vsx-extension-resolver");
|
|
26
|
+
exports.default = new inversify_1.ContainerModule(bind => {
|
|
27
|
+
bind(vsx_environment_1.VSXEnvironment).to(vsx_environment_impl_1.VSXEnvironmentImpl).inSingletonScope();
|
|
28
|
+
bind(vsx_cli_1.VsxCli).toSelf().inSingletonScope();
|
|
29
|
+
bind(node_1.CliContribution).toService(vsx_cli_1.VsxCli);
|
|
30
|
+
bind(core_1.ConnectionHandler)
|
|
31
|
+
.toDynamicValue(ctx => new core_1.JsonRpcConnectionHandler(vsx_environment_1.VSX_ENVIRONMENT_PATH, () => ctx.container.get(vsx_environment_1.VSXEnvironment)))
|
|
32
|
+
.inSingletonScope();
|
|
33
|
+
bind(vsx_extension_resolver_1.VSXExtensionResolver).toSelf().inSingletonScope();
|
|
34
|
+
bind(plugin_protocol_1.PluginDeployerResolver).toService(vsx_extension_resolver_1.VSXExtensionResolver);
|
|
35
|
+
});
|
|
36
36
|
//# sourceMappingURL=vsx-registry-backend-module.js.map
|
package/lib/package.spec.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
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-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
/* note: this bogus test file is required so that
|
|
17
|
-
we are able to run mocha unit tests on this
|
|
18
|
-
package, without having any actual unit tests in it.
|
|
19
|
-
This way a coverage report will be generated,
|
|
20
|
-
showing 0% coverage, instead of no report.
|
|
21
|
-
This file can be removed once we have real unit
|
|
22
|
-
tests in place. */
|
|
23
|
-
describe('vsx-registry package', () => {
|
|
24
|
-
it('support code coverage statistics', () => true);
|
|
25
|
-
});
|
|
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-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
/* note: this bogus test file is required so that
|
|
17
|
+
we are able to run mocha unit tests on this
|
|
18
|
+
package, without having any actual unit tests in it.
|
|
19
|
+
This way a coverage report will be generated,
|
|
20
|
+
showing 0% coverage, instead of no report.
|
|
21
|
+
This file can be removed once we have real unit
|
|
22
|
+
tests in place. */
|
|
23
|
+
describe('vsx-registry package', () => {
|
|
24
|
+
it('support code coverage statistics', () => true);
|
|
25
|
+
});
|
|
26
26
|
//# sourceMappingURL=package.spec.js.map
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/vsx-registry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.46.0-next.72+4a275b29d",
|
|
4
4
|
"description": "Theia - VSX Registry",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.
|
|
7
|
-
"@theia/filesystem": "1.
|
|
8
|
-
"@theia/
|
|
9
|
-
"@theia/
|
|
10
|
-
"@theia/plugin-ext
|
|
11
|
-
"@theia/
|
|
12
|
-
"@theia/
|
|
6
|
+
"@theia/core": "1.46.0-next.72+4a275b29d",
|
|
7
|
+
"@theia/filesystem": "1.46.0-next.72+4a275b29d",
|
|
8
|
+
"@theia/navigator": "1.46.0-next.72+4a275b29d",
|
|
9
|
+
"@theia/ovsx-client": "1.46.0-next.72+4a275b29d",
|
|
10
|
+
"@theia/plugin-ext": "1.46.0-next.72+4a275b29d",
|
|
11
|
+
"@theia/plugin-ext-vscode": "1.46.0-next.72+4a275b29d",
|
|
12
|
+
"@theia/preferences": "1.46.0-next.72+4a275b29d",
|
|
13
|
+
"@theia/workspace": "1.46.0-next.72+4a275b29d",
|
|
13
14
|
"luxon": "^2.4.0",
|
|
14
15
|
"p-debounce": "^2.1.0",
|
|
15
|
-
"semver": "^7.5.4"
|
|
16
|
-
"uuid": "^8.0.0"
|
|
16
|
+
"semver": "^7.5.4"
|
|
17
17
|
},
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public"
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"watch": "theiaext watch"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@theia/ext-scripts": "1.
|
|
56
|
+
"@theia/ext-scripts": "1.46.0",
|
|
57
57
|
"@types/luxon": "^2.3.2"
|
|
58
58
|
},
|
|
59
59
|
"nyc": {
|
|
60
60
|
"extends": "../../configs/nyc.json"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "4a275b29d0db6c81190488c7f76cb667da05ef19"
|
|
63
63
|
}
|