@theia/plugin-ext-vscode 1.77.0-next.0 → 1.77.0-next.101
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/plugin-vscode-commands-contribution.d.ts +6 -0
- package/lib/browser/plugin-vscode-commands-contribution.d.ts.map +1 -1
- package/lib/browser/plugin-vscode-commands-contribution.js +273 -258
- package/lib/browser/plugin-vscode-commands-contribution.js.map +1 -1
- package/lib/browser/plugin-vscode-commands-contribution.spec.js +210 -15
- package/lib/browser/plugin-vscode-commands-contribution.spec.js.map +1 -1
- package/lib/browser/plugin-vscode-contribution.js +11 -14
- package/lib/browser/plugin-vscode-contribution.js.map +1 -1
- package/lib/browser/plugin-vscode-frontend-module.js +12 -14
- package/lib/browser/plugin-vscode-frontend-module.js.map +1 -1
- package/lib/common/plugin-vscode-environment.js +12 -16
- package/lib/common/plugin-vscode-environment.js.map +1 -1
- package/lib/common/plugin-vscode-types.js +3 -6
- package/lib/common/plugin-vscode-types.js.map +1 -1
- package/lib/common/plugin-vscode-uri.js +5 -8
- package/lib/common/plugin-vscode-uri.js.map +1 -1
- package/lib/node/context/plugin-vscode-init-fe.d.ts +1 -2
- package/lib/node/context/plugin-vscode-init-fe.d.ts.map +1 -1
- package/lib/node/context/plugin-vscode-init-fe.js +3 -1
- package/lib/node/context/plugin-vscode-init-fe.js.map +1 -1
- package/lib/node/local-vsix-file-plugin-deployer-resolver.d.ts +1 -1
- package/lib/node/local-vsix-file-plugin-deployer-resolver.d.ts.map +1 -1
- package/lib/node/local-vsix-file-plugin-deployer-resolver.js +27 -34
- package/lib/node/local-vsix-file-plugin-deployer-resolver.js.map +1 -1
- package/lib/node/package.spec.d.ts +1 -0
- package/lib/node/package.spec.js +1 -0
- package/lib/node/plugin-vscode-backend-module.js +22 -24
- package/lib/node/plugin-vscode-backend-module.js.map +1 -1
- package/lib/node/plugin-vscode-cli-contribution.js +10 -13
- package/lib/node/plugin-vscode-cli-contribution.js.map +1 -1
- package/lib/node/plugin-vscode-deployer-participant.d.ts +1 -1
- package/lib/node/plugin-vscode-deployer-participant.d.ts.map +1 -1
- package/lib/node/plugin-vscode-deployer-participant.js +17 -22
- package/lib/node/plugin-vscode-deployer-participant.js.map +1 -1
- package/lib/node/plugin-vscode-directory-handler.js +23 -28
- package/lib/node/plugin-vscode-directory-handler.js.map +1 -1
- package/lib/node/plugin-vscode-file-handler.d.ts +1 -1
- package/lib/node/plugin-vscode-file-handler.d.ts.map +1 -1
- package/lib/node/plugin-vscode-file-handler.js +21 -27
- package/lib/node/plugin-vscode-file-handler.js.map +1 -1
- package/lib/node/plugin-vscode-init.d.ts.map +1 -1
- package/lib/node/plugin-vscode-init.js +12 -16
- package/lib/node/plugin-vscode-init.js.map +1 -1
- package/lib/node/plugin-vscode-init.spec.js +8 -10
- package/lib/node/plugin-vscode-init.spec.js.map +1 -1
- package/lib/node/plugin-vscode-utils.d.ts +1 -1
- package/lib/node/plugin-vscode-utils.d.ts.map +1 -1
- package/lib/node/plugin-vscode-utils.js +15 -24
- package/lib/node/plugin-vscode-utils.js.map +1 -1
- package/lib/node/scanner-vscode.js +19 -22
- package/lib/node/scanner-vscode.js.map +1 -1
- package/lib/node/scanner-vscode.spec.js +12 -14
- package/lib/node/scanner-vscode.spec.js.map +1 -1
- package/package.json +25 -17
- package/src/browser/plugin-vscode-commands-contribution.spec.ts +224 -1
- package/src/browser/plugin-vscode-commands-contribution.ts +97 -45
- package/src/browser/plugin-vscode-frontend-module.ts +3 -3
- package/src/node/context/plugin-vscode-init-fe.ts +2 -1
- package/src/node/local-vsix-file-plugin-deployer-resolver.ts +5 -9
- package/src/node/plugin-vscode-backend-module.ts +7 -7
- package/src/node/plugin-vscode-cli-contribution.ts +1 -1
- package/src/node/plugin-vscode-deployer-participant.ts +2 -2
- package/src/node/plugin-vscode-directory-handler.ts +1 -1
- package/src/node/plugin-vscode-file-handler.ts +3 -3
- package/src/node/plugin-vscode-init.spec.ts +1 -1
- package/src/node/plugin-vscode-init.ts +4 -3
- package/src/node/plugin-vscode-utils.ts +3 -3
- package/src/node/scanner-vscode.spec.ts +1 -1
- package/src/node/scanner-vscode.ts +2 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2018 Red Hat, Inc. and others.
|
|
4
3
|
//
|
|
@@ -14,21 +13,19 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const plugin_cli_contribution_1 = require("@theia/plugin-ext/lib/main/node/plugin-cli-contribution");
|
|
27
|
-
const plugin_vscode_utils_1 = require("./plugin-vscode-utils");
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import * as path from 'path';
|
|
18
|
+
import * as fs from '@theia/core/shared/fs-extra';
|
|
19
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
20
|
+
import { ILogger } from '@theia/core';
|
|
21
|
+
import { firstTrue } from '@theia/core/lib/common/promise-util';
|
|
22
|
+
import { PluginDeployerEntryType, PluginIdentifiers } from '@theia/plugin-ext';
|
|
23
|
+
import { PluginCliContribution } from '@theia/plugin-ext/lib/main/node/plugin-cli-contribution';
|
|
24
|
+
import { TMP_DIR_PREFIX } from './plugin-vscode-utils.js';
|
|
28
25
|
let PluginVsCodeDirectoryHandler = class PluginVsCodeDirectoryHandler {
|
|
29
26
|
async accept(plugin) {
|
|
30
27
|
this.logger.debug(`Resolving "${plugin.id()}" as a VS Code extension...`);
|
|
31
|
-
if (plugin.path().startsWith(
|
|
28
|
+
if (plugin.path().startsWith(TMP_DIR_PREFIX)) {
|
|
32
29
|
// avoid adding corrupted plugins from temporary directories
|
|
33
30
|
return false;
|
|
34
31
|
}
|
|
@@ -41,16 +38,16 @@ let PluginVsCodeDirectoryHandler = class PluginVsCodeDirectoryHandler {
|
|
|
41
38
|
return this.deriveMetadata(plugin);
|
|
42
39
|
}
|
|
43
40
|
async deriveMetadata(plugin) {
|
|
44
|
-
return
|
|
41
|
+
return firstTrue(this.resolveFromSources(plugin), this.resolveFromVSIX(plugin), this.resolveFromNpmTarball(plugin));
|
|
45
42
|
}
|
|
46
43
|
async handle(context) {
|
|
47
44
|
const types = [];
|
|
48
45
|
const packageJson = context.pluginEntry().getValue('package.json');
|
|
49
46
|
if (packageJson.browser) {
|
|
50
|
-
types.push(
|
|
47
|
+
types.push(PluginDeployerEntryType.FRONTEND);
|
|
51
48
|
}
|
|
52
49
|
if (packageJson.main || !packageJson.browser) {
|
|
53
|
-
types.push(
|
|
50
|
+
types.push(PluginDeployerEntryType.BACKEND);
|
|
54
51
|
}
|
|
55
52
|
context.pluginEntry().accept(...types);
|
|
56
53
|
}
|
|
@@ -80,7 +77,7 @@ let PluginVsCodeDirectoryHandler = class PluginVsCodeDirectoryHandler {
|
|
|
80
77
|
if (!pck || !pck.name || !pck.version || !pck.engines || !pck.engines.vscode) {
|
|
81
78
|
return false;
|
|
82
79
|
}
|
|
83
|
-
pck.publisher ??=
|
|
80
|
+
pck.publisher ??= PluginIdentifiers.UNPUBLISHED;
|
|
84
81
|
if (options) {
|
|
85
82
|
plugin.storeValue('package.json', pck);
|
|
86
83
|
plugin.rootPath = plugin.path();
|
|
@@ -92,7 +89,7 @@ let PluginVsCodeDirectoryHandler = class PluginVsCodeDirectoryHandler {
|
|
|
92
89
|
async requirePackage(pluginPath) {
|
|
93
90
|
try {
|
|
94
91
|
const plugin = await fs.readJSON(path.join(pluginPath, 'package.json'));
|
|
95
|
-
plugin.publisher ??=
|
|
92
|
+
plugin.publisher ??= PluginIdentifiers.UNPUBLISHED;
|
|
96
93
|
return plugin;
|
|
97
94
|
}
|
|
98
95
|
catch {
|
|
@@ -100,17 +97,15 @@ let PluginVsCodeDirectoryHandler = class PluginVsCodeDirectoryHandler {
|
|
|
100
97
|
}
|
|
101
98
|
}
|
|
102
99
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
(0, inversify_1.inject)(plugin_cli_contribution_1.PluginCliContribution),
|
|
106
|
-
tslib_1.__metadata("design:type", plugin_cli_contribution_1.PluginCliContribution)
|
|
100
|
+
__decorate([
|
|
101
|
+
inject(PluginCliContribution)
|
|
107
102
|
], PluginVsCodeDirectoryHandler.prototype, "pluginCli", void 0);
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
tslib_1.__metadata("design:type", Object)
|
|
103
|
+
__decorate([
|
|
104
|
+
inject(ILogger),
|
|
105
|
+
named('plugin-ext-vscode:PluginVsCodeDirectoryHandler')
|
|
112
106
|
], PluginVsCodeDirectoryHandler.prototype, "logger", void 0);
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
PluginVsCodeDirectoryHandler = __decorate([
|
|
108
|
+
injectable()
|
|
115
109
|
], PluginVsCodeDirectoryHandler);
|
|
110
|
+
export { PluginVsCodeDirectoryHandler };
|
|
116
111
|
//# sourceMappingURL=plugin-vscode-directory-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-vscode-directory-handler.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-directory-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-vscode-directory-handler.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-directory-handler.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,OAAO,KAAK,IAAI,MAAM,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,IAAI,CAAC;YACD,MAAM,MAAM,GAAkB,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;YACvF,MAAM,CAAC,SAAS,KAAK,iBAAiB,CAAC,WAAW,CAAC;YACnD,OAAO,MAAM,CAAC;QAClB,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;CACJ,CAAA;AA5FqD;IAAjD,MAAM,CAAC,qBAAqB,CAAC;+DAAqD;AAGhE;IADlB,MAAM,CAAC,OAAO,CAAC;IAAE,KAAK,CAAC,gDAAgD,CAAC;4DACtC;AAP1B,4BAA4B;IADxC,UAAU,EAAE;GACA,4BAA4B,CAgGxC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PluginDeployerFileHandler, PluginDeployerEntry, PluginDeployerFileHandlerContext } from '@theia/plugin-ext';
|
|
2
|
-
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
2
|
+
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment.js';
|
|
3
3
|
import { ILogger } from '@theia/core';
|
|
4
4
|
export declare const isVSCodePluginFile: (pluginPath?: string) => boolean;
|
|
5
5
|
export declare class PluginVsCodeFileHandler implements PluginDeployerFileHandler {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-vscode-file-handler.d.ts","sourceRoot":"","sources":["../../src/node/plugin-vscode-file-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAIrH,OAAO,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"plugin-vscode-file-handler.d.ts","sourceRoot":"","sources":["../../src/node/plugin-vscode-file-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAIrH,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGjF,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,eAAO,MAAM,kBAAkB,GAAI,aAAa,MAAM,YAAyF,CAAC;AAEhJ,qBACa,uBAAwB,YAAW,yBAAyB;IAErE,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,uBAAuB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAE7B,MAAM,CAAC,cAAc,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAS7D,MAAM,CAAC,OAAO,EAAE,gCAAgC,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBtE,SAAS,CAAC,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;CAG/D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2018 Red Hat, Inc. and others.
|
|
4
3
|
//
|
|
@@ -14,38 +13,35 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
const core_1 = require("@theia/core");
|
|
27
|
-
const isVSCodePluginFile = (pluginPath) => Boolean(pluginPath && (pluginPath.endsWith('.vsix') || pluginPath.endsWith('.tgz')));
|
|
28
|
-
exports.isVSCodePluginFile = isVSCodePluginFile;
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import filenamify from 'filenamify';
|
|
18
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
19
|
+
import * as fs from '@theia/core/shared/fs-extra';
|
|
20
|
+
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment.js';
|
|
21
|
+
import { FileUri } from '@theia/core/lib/common/file-uri';
|
|
22
|
+
import { unpackToDeploymentDir } from './plugin-vscode-utils.js';
|
|
23
|
+
import { ILogger } from '@theia/core';
|
|
24
|
+
export const isVSCodePluginFile = (pluginPath) => Boolean(pluginPath && (pluginPath.endsWith('.vsix') || pluginPath.endsWith('.tgz')));
|
|
29
25
|
let PluginVsCodeFileHandler = class PluginVsCodeFileHandler {
|
|
30
26
|
async accept(resolvedPlugin) {
|
|
31
27
|
return resolvedPlugin.isFile().then(file => {
|
|
32
28
|
if (!file) {
|
|
33
29
|
return false;
|
|
34
30
|
}
|
|
35
|
-
return
|
|
31
|
+
return isVSCodePluginFile(resolvedPlugin.path());
|
|
36
32
|
});
|
|
37
33
|
}
|
|
38
34
|
async handle(context) {
|
|
39
35
|
const id = this.getNormalizedExtensionId(context.pluginEntry().id());
|
|
40
|
-
const extensionDeploymentDir = await
|
|
36
|
+
const extensionDeploymentDir = await unpackToDeploymentDir(this.environment, context.pluginEntry().path(), id);
|
|
41
37
|
context.pluginEntry().updatePath(extensionDeploymentDir);
|
|
42
38
|
this.logger.info(`root path: ${context.pluginEntry().rootPath}`);
|
|
43
39
|
const originalPath = context.pluginEntry().originalPath();
|
|
44
40
|
if (originalPath && originalPath !== extensionDeploymentDir) {
|
|
45
41
|
const tempDirUri = await this.environment.getTempDirUri();
|
|
46
|
-
if (originalPath.startsWith(
|
|
42
|
+
if (originalPath.startsWith(FileUri.fsPath(tempDirUri))) {
|
|
47
43
|
try {
|
|
48
|
-
await fs.remove(
|
|
44
|
+
await fs.remove(FileUri.fsPath(originalPath));
|
|
49
45
|
}
|
|
50
46
|
catch (e) {
|
|
51
47
|
this.logger.error(`[${id}]: failed to remove temporary files: "${originalPath}"`, e);
|
|
@@ -57,17 +53,15 @@ let PluginVsCodeFileHandler = class PluginVsCodeFileHandler {
|
|
|
57
53
|
return filenamify(pluginId, { replacement: '_' }).replace(/\.vsix$/, '');
|
|
58
54
|
}
|
|
59
55
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
(0, inversify_1.inject)(plugin_vscode_environment_1.PluginVSCodeEnvironment),
|
|
63
|
-
tslib_1.__metadata("design:type", plugin_vscode_environment_1.PluginVSCodeEnvironment)
|
|
56
|
+
__decorate([
|
|
57
|
+
inject(PluginVSCodeEnvironment)
|
|
64
58
|
], PluginVsCodeFileHandler.prototype, "environment", void 0);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
tslib_1.__metadata("design:type", Object)
|
|
59
|
+
__decorate([
|
|
60
|
+
inject(ILogger),
|
|
61
|
+
named('plugin-ext-vscode:PluginVsCodeFileHandler')
|
|
69
62
|
], PluginVsCodeFileHandler.prototype, "logger", void 0);
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
PluginVsCodeFileHandler = __decorate([
|
|
64
|
+
injectable()
|
|
72
65
|
], PluginVsCodeFileHandler);
|
|
66
|
+
export { PluginVsCodeFileHandler };
|
|
73
67
|
//# sourceMappingURL=plugin-vscode-file-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-vscode-file-handler.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-file-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-vscode-file-handler.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-file-handler.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;;AAGhF,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MA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AAC,CAAC;QACjE,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,CAAC;QAC1D,IAAI,YAAY,IAAI,YAAY,KAAK,sBAAsB,EAAE,CAAC;YAC1D,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;YAC1D,IAAI,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;gBACtD,IAAI,CAAC;oBACD,MAAM,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;gBAClD,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACT,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,yCAAyC,YAAY,GAAG,EAAE,CAAC,CAAC,CAAC;gBACzF,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAES,wBAAwB,CAAC,QAAgB;QAC/C,OAAO,UAAU,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC7E,CAAC;CACJ,CAAA;AAnCsB;IADlB,MAAM,CAAC,uBAAuB,CAAC;4DACwB;AAGrC;IADlB,MAAM,CAAC,OAAO,CAAC;IAAE,KAAK,CAAC,2CAA2C,CAAC;uDACjC;AAL1B,uBAAuB;IADnC,UAAU,EAAE;GACA,uBAAuB,CAqCnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-vscode-init.d.ts","sourceRoot":"","sources":["../../src/node/plugin-vscode-init.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,uBAAuB,EAAoB,MAAM,EAAe,MAAM,mBAAmB,CAAC;AAWnG,eAAO,MAAM,gBAAgB,EAAE,uBAS9B,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-vscode-init.d.ts","sourceRoot":"","sources":["../../src/node/plugin-vscode-init.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,uBAAuB,EAAoB,MAAM,EAAe,MAAM,mBAAmB,CAAC;AAWnG,eAAO,MAAM,gBAAgB,EAAE,uBAS9B,CAAC;AAyCF;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAElG"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2018-2019 Red Hat, Inc.
|
|
4
3
|
//
|
|
@@ -14,21 +13,18 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.doInitialization = void 0;
|
|
19
|
-
exports.findPlugin = findPlugin;
|
|
20
16
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
import Module, { register } from 'node:module';
|
|
18
|
+
import { isEqualOrParent } from '@theia/core/lib/common/paths';
|
|
19
|
+
import { emptyPlugin } from '@theia/plugin-ext';
|
|
20
|
+
import { VSCODE_DEFAULT_API_VERSION } from '../common/plugin-vscode-types.js';
|
|
25
21
|
process.env['VSCODE_PID'] = process.env['THEIA_PARENT_PID'];
|
|
26
22
|
const pluginsApiImpl = new Map();
|
|
27
23
|
const plugins = new Array();
|
|
28
24
|
let defaultApi;
|
|
29
25
|
let isLoadOverride = false;
|
|
30
26
|
let pluginApiFactory;
|
|
31
|
-
const doInitialization = (apiFactory, plugin) => {
|
|
27
|
+
export const doInitialization = (apiFactory, plugin) => {
|
|
32
28
|
pluginsApiImpl.set(plugin.model.id, createVSCodeAPI(apiFactory, plugin));
|
|
33
29
|
plugins.push(plugin);
|
|
34
30
|
pluginApiFactory = apiFactory;
|
|
@@ -37,15 +33,15 @@ const doInitialization = (apiFactory, plugin) => {
|
|
|
37
33
|
isLoadOverride = true;
|
|
38
34
|
}
|
|
39
35
|
};
|
|
40
|
-
exports.doInitialization = doInitialization;
|
|
41
36
|
function createVSCodeAPI(apiFactory, plugin) {
|
|
42
37
|
const vscode = apiFactory(plugin);
|
|
43
38
|
// override the version for vscode to be a VSCode version
|
|
44
|
-
vscode.version = process.env['VSCODE_API_VERSION'] ||
|
|
39
|
+
vscode.version = process.env['VSCODE_API_VERSION'] || VSCODE_DEFAULT_API_VERSION;
|
|
45
40
|
return vscode;
|
|
46
41
|
}
|
|
47
42
|
function overrideInternalLoad() {
|
|
48
|
-
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
+
const module = Module;
|
|
49
45
|
const vscodeModuleName = 'vscode';
|
|
50
46
|
// save original load method
|
|
51
47
|
const internalLoad = module._load;
|
|
@@ -62,7 +58,7 @@ function overrideInternalLoad() {
|
|
|
62
58
|
}
|
|
63
59
|
if (!defaultApi) {
|
|
64
60
|
console.warn(`Could not identify plugin for 'Theia' require call from ${parent.filename}`);
|
|
65
|
-
defaultApi = createVSCodeAPI(pluginApiFactory,
|
|
61
|
+
defaultApi = createVSCodeAPI(pluginApiFactory, emptyPlugin);
|
|
66
62
|
}
|
|
67
63
|
return defaultApi;
|
|
68
64
|
};
|
|
@@ -74,8 +70,8 @@ function overrideInternalLoad() {
|
|
|
74
70
|
* Matches on folder boundaries, so sibling plugins whose folder names share
|
|
75
71
|
* a prefix (e.g. `acme.foo` vs. `acme.foo-extras`) are not mismatched.
|
|
76
72
|
*/
|
|
77
|
-
function findPlugin(pluginList, filePath) {
|
|
78
|
-
return pluginList.find(plugin =>
|
|
73
|
+
export function findPlugin(pluginList, filePath) {
|
|
74
|
+
return pluginList.find(plugin => isEqualOrParent(filePath, plugin.pluginFolder));
|
|
79
75
|
}
|
|
80
76
|
/**
|
|
81
77
|
* Register an ESM loader hook so that `import 'vscode'` from an ESM plugin
|
|
@@ -133,7 +129,7 @@ export async function load(url, context, nextLoad) {
|
|
|
133
129
|
`;
|
|
134
130
|
try {
|
|
135
131
|
const dataUrl = 'data:text/javascript;base64,' + Buffer.from(loaderSource, 'utf8').toString('base64');
|
|
136
|
-
|
|
132
|
+
register(dataUrl);
|
|
137
133
|
}
|
|
138
134
|
catch (e) {
|
|
139
135
|
console.error('Failed to register VS Code ESM loader hook; ESM plugins will not load:', e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-vscode-init.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-vscode-init.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-init.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,wCAAwC;AACxC,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,uDAAuD;AAEvD,OAAO,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAqD,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAE5D,MAAM,cAAc,GAAG,IAAI,GAAG,EAAwB,CAAC;AACvD,MAAM,OAAO,GAAG,IAAI,KAAK,EAAU,CAAC;AACpC,IAAI,UAAwB,CAA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AO,CAAC,EAAE,CAAC;QACT,OAAO,CAAC,KAAK,CAAC,wEAAwE,EAAE,CAAC,CAAC,CAAC;IAC/F,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2026 EclipseSource and others.
|
|
4
3
|
//
|
|
@@ -14,11 +13,10 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
16
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
import { expect } from 'chai';
|
|
18
|
+
import * as path from 'path';
|
|
19
|
+
import { findPlugin } from './plugin-vscode-init.js';
|
|
22
20
|
const PLUGIN_A_FOLDER = path.join(path.sep, 'p', 'sample-namespace.plugin-esm');
|
|
23
21
|
const PLUGIN_B_FOLDER = path.join(path.sep, 'p', 'sample-namespace.plugin-esm-mjs');
|
|
24
22
|
const pluginA = { pluginFolder: PLUGIN_A_FOLDER };
|
|
@@ -27,21 +25,21 @@ const plugins = [pluginA, pluginB];
|
|
|
27
25
|
describe('findPlugin', () => {
|
|
28
26
|
it('matches the plugin whose folder directly contains the file', () => {
|
|
29
27
|
const file = path.join(PLUGIN_A_FOLDER, 'extension.js');
|
|
30
|
-
|
|
28
|
+
expect(findPlugin(plugins, file)).to.equal(pluginA);
|
|
31
29
|
});
|
|
32
30
|
it('matches a nested file inside the plugin folder', () => {
|
|
33
31
|
const file = path.join(PLUGIN_B_FOLDER, 'node_modules', 'dep', 'index.js');
|
|
34
|
-
|
|
32
|
+
expect(findPlugin(plugins, file)).to.equal(pluginB);
|
|
35
33
|
});
|
|
36
34
|
it('does not mismatch when one plugin folder name is a prefix of another', () => {
|
|
37
35
|
const file = path.join(PLUGIN_B_FOLDER, 'extension.mjs');
|
|
38
|
-
|
|
36
|
+
expect(findPlugin(plugins, file)).to.equal(pluginB);
|
|
39
37
|
});
|
|
40
38
|
it('returns undefined for a path outside any plugin folder', () => {
|
|
41
|
-
|
|
39
|
+
expect(findPlugin(plugins, path.join(path.sep, 'p', 'some-other', 'file.js'))).to.be.undefined;
|
|
42
40
|
});
|
|
43
41
|
it('returns undefined for an empty plugin list', () => {
|
|
44
|
-
|
|
42
|
+
expect(findPlugin([], path.join(PLUGIN_A_FOLDER, 'extension.js'))).to.be.undefined;
|
|
45
43
|
});
|
|
46
44
|
});
|
|
47
45
|
//# sourceMappingURL=plugin-vscode-init.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-vscode-init.spec.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-init.spec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-vscode-init.spec.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-init.spec.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,uDAAuD;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,6BAA6B,CAAC,CAAC;AAChF,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,iCAAiC,CAAC,CAAC;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C,SAAS,CAAC;IACnG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QAClD,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;IACvF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
1
|
+
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment.js';
|
|
2
2
|
import { PluginIdentifiers } from '@theia/plugin-ext/lib/common/plugin-protocol';
|
|
3
3
|
/**
|
|
4
4
|
* Extracts extension identity from a VSIX file by reading its package.json.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-vscode-utils.d.ts","sourceRoot":"","sources":["../../src/node/plugin-vscode-utils.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"plugin-vscode-utils.d.ts","sourceRoot":"","sources":["../../src/node/plugin-vscode-utils.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAiB,MAAM,8CAA8C,CAAC;AAEhG;;;;;;;;GAQG;AACH,wBAAsB,gCAAgC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,UAAU,GAAG,SAAS,CAAC,CAgC1H;AAED,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAgBhG;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE/G;AAED,eAAO,MAAM,cAAc,yBAAyB,CAAC;AACrD,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiClI;AAED,wBAAsB,yBAAyB,CAAC,GAAG,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKlH;AAED,wBAAsB,UAAU,CAAC,GAAG,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAY9F"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2023 STMicroelectronics and others.
|
|
4
3
|
//
|
|
@@ -14,19 +13,11 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
exports.unpackToDeploymentDir = unpackToDeploymentDir;
|
|
23
|
-
exports.getExtensionDeploymentDir = getExtensionDeploymentDir;
|
|
24
|
-
exports.getTempDir = getTempDir;
|
|
25
|
-
const decompress = require("decompress");
|
|
26
|
-
const path = require("path");
|
|
27
|
-
const filenamify = require("filenamify");
|
|
28
|
-
const node_1 = require("@theia/core/lib/node");
|
|
29
|
-
const fs = require("@theia/core/shared/fs-extra");
|
|
16
|
+
import decompress from 'decompress';
|
|
17
|
+
import * as path from 'path';
|
|
18
|
+
import filenamify from 'filenamify';
|
|
19
|
+
import { FileUri } from '@theia/core/lib/node';
|
|
20
|
+
import * as fs from '@theia/core/shared/fs-extra';
|
|
30
21
|
/**
|
|
31
22
|
* Extracts extension identity from a VSIX file by reading its package.json.
|
|
32
23
|
*
|
|
@@ -36,7 +27,7 @@ const fs = require("@theia/core/shared/fs-extra");
|
|
|
36
27
|
* @param vsixPath Path to the VSIX file
|
|
37
28
|
* @returns PluginIdentifiers.Components (publisher?, name, version), or undefined if the package.json cannot be read or is invalid
|
|
38
29
|
*/
|
|
39
|
-
async function extractExtensionIdentityFromVsix(vsixPath) {
|
|
30
|
+
export async function extractExtensionIdentityFromVsix(vsixPath) {
|
|
40
31
|
try {
|
|
41
32
|
// Extract only the package.json file from the VSIX
|
|
42
33
|
const files = await decompress(vsixPath, {
|
|
@@ -65,7 +56,7 @@ async function extractExtensionIdentityFromVsix(vsixPath) {
|
|
|
65
56
|
return undefined;
|
|
66
57
|
}
|
|
67
58
|
}
|
|
68
|
-
async function decompressExtension(sourcePath, destPath) {
|
|
59
|
+
export async function decompressExtension(sourcePath, destPath) {
|
|
69
60
|
try {
|
|
70
61
|
await decompress(sourcePath, destPath);
|
|
71
62
|
if (sourcePath.endsWith('.tgz')) {
|
|
@@ -83,17 +74,17 @@ async function decompressExtension(sourcePath, destPath) {
|
|
|
83
74
|
throw error;
|
|
84
75
|
}
|
|
85
76
|
}
|
|
86
|
-
async function existsInDeploymentDir(env, extensionId) {
|
|
77
|
+
export async function existsInDeploymentDir(env, extensionId) {
|
|
87
78
|
return fs.pathExists(await getExtensionDeploymentDir(env, extensionId));
|
|
88
79
|
}
|
|
89
|
-
|
|
90
|
-
async function unpackToDeploymentDir(env, sourcePath, extensionId) {
|
|
80
|
+
export const TMP_DIR_PREFIX = 'tmp-vscode-unpacked-';
|
|
81
|
+
export async function unpackToDeploymentDir(env, sourcePath, extensionId) {
|
|
91
82
|
const extensionDeploymentDir = await getExtensionDeploymentDir(env, extensionId);
|
|
92
83
|
if (await fs.pathExists(extensionDeploymentDir)) {
|
|
93
84
|
console.log(`[${extensionId}]: deployment dir "${extensionDeploymentDir}" already exists`);
|
|
94
85
|
return extensionDeploymentDir;
|
|
95
86
|
}
|
|
96
|
-
const tempDir = await getTempDir(env,
|
|
87
|
+
const tempDir = await getTempDir(env, TMP_DIR_PREFIX);
|
|
97
88
|
try {
|
|
98
89
|
console.log(`[${extensionId}]: trying to decompress "${sourcePath}" into "${tempDir}"...`);
|
|
99
90
|
if (!await decompressExtension(sourcePath, tempDir)) {
|
|
@@ -121,14 +112,14 @@ async function unpackToDeploymentDir(env, sourcePath, extensionId) {
|
|
|
121
112
|
throw e;
|
|
122
113
|
}
|
|
123
114
|
}
|
|
124
|
-
async function getExtensionDeploymentDir(env, extensionId) {
|
|
115
|
+
export async function getExtensionDeploymentDir(env, extensionId) {
|
|
125
116
|
const deployedPluginsDirUri = await env.getDeploymentDirUri();
|
|
126
117
|
const normalizedExtensionId = filenamify(extensionId, { replacement: '_' });
|
|
127
|
-
const extensionDeploymentDirPath =
|
|
118
|
+
const extensionDeploymentDirPath = FileUri.fsPath(deployedPluginsDirUri.resolve(normalizedExtensionId));
|
|
128
119
|
return extensionDeploymentDirPath;
|
|
129
120
|
}
|
|
130
|
-
async function getTempDir(env, prefix) {
|
|
131
|
-
const deploymentDirPath =
|
|
121
|
+
export async function getTempDir(env, prefix) {
|
|
122
|
+
const deploymentDirPath = FileUri.fsPath(await env.getDeploymentDirUri());
|
|
132
123
|
try {
|
|
133
124
|
if (!await fs.pathExists(deploymentDirPath)) {
|
|
134
125
|
console.log(`Creating deployment dir ${deploymentDirPath}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-vscode-utils.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-vscode-utils.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-utils.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE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AAK,CAAC;IAChB,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2015-2021 Red Hat, Inc.
|
|
4
3
|
//
|
|
@@ -14,18 +13,16 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const uiKind = environment_1.environment.electron.is() ? plugin_ext_1.UIKind.Desktop : plugin_ext_1.UIKind.Web;
|
|
28
|
-
let VsCodePluginScanner = class VsCodePluginScanner extends scanner_theia_1.TheiaPluginScanner {
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import * as path from 'path';
|
|
18
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
19
|
+
import { PluginIdentifiers, UIKind } from '@theia/plugin-ext';
|
|
20
|
+
import { TheiaPluginScanner } from '@theia/plugin-ext/lib/hosted/node/scanners/scanner-theia';
|
|
21
|
+
import { environment } from '@theia/core/shared/@theia/application-package/lib/environment';
|
|
22
|
+
import { VSCodeExtensionUri } from '../common/plugin-vscode-uri.js';
|
|
23
|
+
import { buildLifecycle, buildModelForVsCode } from '@theia/plugin-utils/lib/common/plugin-model';
|
|
24
|
+
const uiKind = environment.electron.is() ? UIKind.Desktop : UIKind.Web;
|
|
25
|
+
let VsCodePluginScanner = class VsCodePluginScanner extends TheiaPluginScanner {
|
|
29
26
|
constructor() {
|
|
30
27
|
super(...arguments);
|
|
31
28
|
this.VSCODE_TYPE = 'vscode';
|
|
@@ -34,11 +31,11 @@ let VsCodePluginScanner = class VsCodePluginScanner extends scanner_theia_1.Thei
|
|
|
34
31
|
return this.VSCODE_TYPE;
|
|
35
32
|
}
|
|
36
33
|
getModel(plugin) {
|
|
37
|
-
const result =
|
|
34
|
+
const result = buildModelForVsCode({
|
|
38
35
|
...plugin,
|
|
39
|
-
publisher: plugin.publisher ??
|
|
36
|
+
publisher: plugin.publisher ?? PluginIdentifiers.UNPUBLISHED,
|
|
40
37
|
packageUri: this.pluginUriFactory.createUri(plugin).toString(),
|
|
41
|
-
}, { uiKind: uiKind ===
|
|
38
|
+
}, { uiKind: uiKind === UIKind.Web ? 'web' : 'desktop' });
|
|
42
39
|
result.licenseUrl = this.getLicenseUrl(plugin);
|
|
43
40
|
result.readmeUrl = this.getReadmeUrl(plugin);
|
|
44
41
|
this.applyTrustExtraction(plugin, result);
|
|
@@ -53,7 +50,7 @@ let VsCodePluginScanner = class VsCodePluginScanner extends scanner_theia_1.Thei
|
|
|
53
50
|
if (dependency !== undefined) {
|
|
54
51
|
dependency.forEach((dep) => {
|
|
55
52
|
const dependencyId = dep.toLowerCase();
|
|
56
|
-
dependencies.set(dependencyId,
|
|
53
|
+
dependencies.set(dependencyId, VSCodeExtensionUri.fromId(dependencyId).toString());
|
|
57
54
|
});
|
|
58
55
|
}
|
|
59
56
|
}
|
|
@@ -61,13 +58,13 @@ let VsCodePluginScanner = class VsCodePluginScanner extends scanner_theia_1.Thei
|
|
|
61
58
|
}
|
|
62
59
|
getLifecycle(plugin) {
|
|
63
60
|
return {
|
|
64
|
-
...
|
|
65
|
-
backendInitPath: path.join(
|
|
61
|
+
...buildLifecycle(plugin, 'vscode'),
|
|
62
|
+
backendInitPath: path.join(import.meta.dirname, 'plugin-vscode-init'),
|
|
66
63
|
};
|
|
67
64
|
}
|
|
68
65
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
(0, inversify_1.injectable)()
|
|
66
|
+
VsCodePluginScanner = __decorate([
|
|
67
|
+
injectable()
|
|
72
68
|
], VsCodePluginScanner);
|
|
69
|
+
export { VsCodePluginScanner };
|
|
73
70
|
//# sourceMappingURL=scanner-vscode.js.map
|