@theia/plugin-ext-vscode 1.75.0-next.25 → 1.75.0-next.29
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/node/plugin-vscode-directory-handler.d.ts +5 -2
- package/lib/node/plugin-vscode-directory-handler.d.ts.map +1 -1
- package/lib/node/plugin-vscode-directory-handler.js.map +1 -1
- package/lib/node/scanner-vscode.d.ts.map +1 -1
- package/lib/node/scanner-vscode.js +8 -47
- package/lib/node/scanner-vscode.js.map +1 -1
- package/package.json +17 -16
- package/src/node/plugin-vscode-directory-handler.ts +5 -2
- package/src/node/scanner-vscode.ts +9 -52
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { URI } from '@theia/core';
|
|
2
2
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
3
3
|
import { PluginDeployerDirectoryHandler, PluginDeployerEntry, PluginDeployerDirectoryHandlerContext, PluginPackage } from '@theia/plugin-ext';
|
|
4
4
|
import { PluginCliContribution } from '@theia/plugin-ext/lib/main/node/plugin-cli-contribution';
|
|
5
|
+
/** Fields read while resolving a VS Code extension directory */
|
|
6
|
+
type PluginPackageResolveInput = Partial<Pick<PluginPackage, 'name' | 'version' | 'publisher' | 'engines'>>;
|
|
5
7
|
export declare class PluginVsCodeDirectoryHandler implements PluginDeployerDirectoryHandler {
|
|
6
8
|
protected readonly deploymentDirectory: Deferred<URI>;
|
|
7
9
|
protected readonly pluginCli: PluginCliContribution;
|
|
@@ -14,8 +16,9 @@ export declare class PluginVsCodeDirectoryHandler implements PluginDeployerDirec
|
|
|
14
16
|
protected resolveFromNpmTarball(plugin: PluginDeployerEntry): Promise<boolean>;
|
|
15
17
|
protected resolvePackage(plugin: PluginDeployerEntry, options?: {
|
|
16
18
|
pluginPath: string;
|
|
17
|
-
pck?:
|
|
19
|
+
pck?: PluginPackageResolveInput;
|
|
18
20
|
}): boolean;
|
|
19
21
|
protected requirePackage(pluginPath: string): Promise<PluginPackage | undefined>;
|
|
20
22
|
}
|
|
23
|
+
export {};
|
|
21
24
|
//# sourceMappingURL=plugin-vscode-directory-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-vscode-directory-handler.d.ts","sourceRoot":"","sources":["../../src/node/plugin-vscode-directory-handler.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"plugin-vscode-directory-handler.d.ts","sourceRoot":"","sources":["../../src/node/plugin-vscode-directory-handler.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAa,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EACH,8BAA8B,EAAE,mBAAmB,EAAE,qCAAqC,EACjE,aAAa,EACzC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAGhG,gEAAgE;AAChE,KAAK,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC;AAE5G,qBACa,4BAA6B,YAAW,8BAA8B;IAE/E,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IAEvB,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAC;IAE7E,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;cAS3C,iBAAiB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;cAOhE,cAAc,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAQvE,MAAM,CAAC,OAAO,EAAE,qCAAqC,GAAG,OAAO,CAAC,IAAI,CAAC;cAY3D,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;cAMjE,eAAe,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;cAS9D,qBAAqB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAMpF,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE;QAC5D,UAAU,EAAE,MAAM,CAAA;QAClB,GAAG,CAAC,EAAE,yBAAyB,CAAA;KAClC,GAAG,OAAO;cAkBK,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CASzF"}
|
|
@@ -1 +1 @@
|
|
|
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,6BAA6B;AAC7B,kDAAkD;AAClD,4DAAkE;AAElE,sEAA0E;AAC1E,kDAG2B;AAC3B,qGAAgG;AAChG,+DAAuD;
|
|
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,6BAA6B;AAC7B,kDA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C,+CAAqB,CAAC;sCAA+B,+CAAqB;+DAAC;uCAJ1E,4BAA4B;IADxC,IAAA,sBAAU,GAAE;GACA,4BAA4B,CA6FxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner-vscode.d.ts","sourceRoot":"","sources":["../../src/node/scanner-vscode.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"scanner-vscode.d.ts","sourceRoot":"","sources":["../../src/node/scanner-vscode.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAA6B,MAAM,mBAAmB,CAAC;AACxI,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AAO9F,qBACa,mBAAoB,SAAQ,kBAAmB,YAAW,aAAa;IAEhF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA0B;IAEtD,IAAa,OAAO,IAAI,YAAY,CAEnC;IAEQ,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW;IAYrD;;OAEG;IACM,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;IAavE,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe;CAOhE"}
|
|
@@ -23,6 +23,7 @@ const plugin_ext_1 = require("@theia/plugin-ext");
|
|
|
23
23
|
const scanner_theia_1 = require("@theia/plugin-ext/lib/hosted/node/scanners/scanner-theia");
|
|
24
24
|
const environment_1 = require("@theia/core/shared/@theia/application-package/lib/environment");
|
|
25
25
|
const plugin_vscode_uri_1 = require("../common/plugin-vscode-uri");
|
|
26
|
+
const plugin_model_1 = require("@theia/plugin-utils/lib/common/plugin-model");
|
|
26
27
|
const uiKind = environment_1.environment.electron.is() ? plugin_ext_1.UIKind.Desktop : plugin_ext_1.UIKind.Web;
|
|
27
28
|
let VsCodePluginScanner = class VsCodePluginScanner extends scanner_theia_1.TheiaPluginScanner {
|
|
28
29
|
constructor() {
|
|
@@ -33,46 +34,13 @@ let VsCodePluginScanner = class VsCodePluginScanner extends scanner_theia_1.Thei
|
|
|
33
34
|
return this.VSCODE_TYPE;
|
|
34
35
|
}
|
|
35
36
|
getModel(plugin) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// Mimic choosing frontend (web extension) and backend (local/remote extension) as described here:
|
|
40
|
-
// https://code.visualstudio.com/api/advanced-topics/extension-host#preferred-extension-location
|
|
41
|
-
const entryPoint = {};
|
|
42
|
-
// Act like codespaces when run in the browser (UIKind === 'web' and extensionKind is ['ui'])
|
|
43
|
-
const preferFrontend = uiKind === plugin_ext_1.UIKind.Web && (plugin.extensionKind?.length === 1 && plugin.extensionKind[0] === 'ui');
|
|
44
|
-
if (plugin.browser && (!plugin.main || preferFrontend)) {
|
|
45
|
-
// Use frontend if available and there is no backend or frontend is preferred
|
|
46
|
-
entryPoint.frontend = plugin.browser;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// Default to using backend
|
|
50
|
-
entryPoint.backend = plugin.main;
|
|
51
|
-
}
|
|
52
|
-
if (plugin.theiaPlugin?.headless) {
|
|
53
|
-
// Support the Theia-specific extension for headless plugins
|
|
54
|
-
entryPoint.headless = plugin.theiaPlugin?.headless;
|
|
55
|
-
}
|
|
56
|
-
const result = {
|
|
57
|
-
packagePath: plugin.packagePath,
|
|
37
|
+
const result = (0, plugin_model_1.buildModelForVsCode)({
|
|
38
|
+
...plugin,
|
|
39
|
+
publisher: plugin.publisher ?? plugin_ext_1.PluginIdentifiers.UNPUBLISHED,
|
|
58
40
|
packageUri: this.pluginUriFactory.createUri(plugin).toString(),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
publisher: publisher,
|
|
63
|
-
version: plugin.version,
|
|
64
|
-
displayName: plugin.displayName,
|
|
65
|
-
description: plugin.description,
|
|
66
|
-
engine: {
|
|
67
|
-
type: this.VSCODE_TYPE,
|
|
68
|
-
version: plugin.engines[this.VSCODE_TYPE]
|
|
69
|
-
},
|
|
70
|
-
entryPoint,
|
|
71
|
-
iconUrl: plugin.icon && plugin_ext_1.PluginPackage.toPluginUrl(plugin, plugin.icon),
|
|
72
|
-
l10n: plugin.l10n,
|
|
73
|
-
readmeUrl: this.getReadmeUrl(plugin),
|
|
74
|
-
licenseUrl: this.getLicenseUrl(plugin)
|
|
75
|
-
};
|
|
41
|
+
}, { uiKind: uiKind === plugin_ext_1.UIKind.Web ? 'web' : 'desktop' });
|
|
42
|
+
result.licenseUrl = this.getLicenseUrl(plugin);
|
|
43
|
+
result.readmeUrl = this.getReadmeUrl(plugin);
|
|
76
44
|
this.applyTrustExtraction(plugin, result);
|
|
77
45
|
return result;
|
|
78
46
|
}
|
|
@@ -80,27 +48,20 @@ let VsCodePluginScanner = class VsCodePluginScanner extends scanner_theia_1.Thei
|
|
|
80
48
|
* Maps extension dependencies to deployable extension dependencies.
|
|
81
49
|
*/
|
|
82
50
|
getDependencies(plugin) {
|
|
83
|
-
// Store the list of dependencies.
|
|
84
51
|
const dependencies = new Map();
|
|
85
|
-
// Iterate through the list of dependencies from `extensionDependencies` and `extensionPack`.
|
|
86
52
|
for (const dependency of [plugin.extensionDependencies, plugin.extensionPack]) {
|
|
87
53
|
if (dependency !== undefined) {
|
|
88
|
-
// Iterate over the list of dependencies present, and add them to the collection.
|
|
89
54
|
dependency.forEach((dep) => {
|
|
90
55
|
const dependencyId = dep.toLowerCase();
|
|
91
56
|
dependencies.set(dependencyId, plugin_vscode_uri_1.VSCodeExtensionUri.fromId(dependencyId).toString());
|
|
92
57
|
});
|
|
93
58
|
}
|
|
94
59
|
}
|
|
95
|
-
// Return the map of dependencies if present, else `undefined`.
|
|
96
60
|
return dependencies.size > 0 ? dependencies : undefined;
|
|
97
61
|
}
|
|
98
62
|
getLifecycle(plugin) {
|
|
99
63
|
return {
|
|
100
|
-
|
|
101
|
-
stopMethod: 'deactivate',
|
|
102
|
-
frontendModuleName: (0, plugin_ext_1.buildFrontendModuleName)(plugin),
|
|
103
|
-
frontendInitPath: 'plugin-vscode-init-fe.js',
|
|
64
|
+
...(0, plugin_model_1.buildLifecycle)(plugin, 'vscode'),
|
|
104
65
|
backendInitPath: path.join(__dirname, 'plugin-vscode-init'),
|
|
105
66
|
};
|
|
106
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner-vscode.js","sourceRoot":"","sources":["../../src/node/scanner-vscode.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,6BAA6B;AAC7B,4DAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"scanner-vscode.js","sourceRoot":"","sources":["../../src/node/scanner-vscode.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,6BAA6B;AAC7B,4DAA0D;AAC1D,kDAAwI;AACxI,4FAA8F;AAC9F,+FAA4F;AAC5F,mEAAiE;AACjE,8EAAkG;AAElG,MAAM,MAAM,GAAG,yBAAW,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAM,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAM,CAAC,GAAG,CAAC;AAGhE,IAAM,mBAAmB,GAAzB,MAAM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AC,CAAC,CAAC;YACP,CAAC;QACL,CAAC;QACD,OAAO,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5D,CAAC;IAEQ,YAAY,CAAC,MAAqB;QACvC,OAAO;YACH,GAAG,IAAA,6BAAc,EAAC,MAAM,EAAE,QAAQ,CAAC;YACnC,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC;SAC9D,CAAC;IACN,CAAC;CAEJ,CAAA;AA3CY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;GACA,mBAAmB,CA2C/B"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin-ext-vscode",
|
|
3
|
-
"version": "1.75.0-next.
|
|
3
|
+
"version": "1.75.0-next.29+bf4fe0ced",
|
|
4
4
|
"description": "Theia - Plugin Extension for VsCode",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/callhierarchy": "1.75.0-next.
|
|
7
|
-
"@theia/core": "1.75.0-next.
|
|
8
|
-
"@theia/editor": "1.75.0-next.
|
|
9
|
-
"@theia/filesystem": "1.75.0-next.
|
|
10
|
-
"@theia/monaco": "1.75.0-next.
|
|
6
|
+
"@theia/callhierarchy": "1.75.0-next.29+bf4fe0ced",
|
|
7
|
+
"@theia/core": "1.75.0-next.29+bf4fe0ced",
|
|
8
|
+
"@theia/editor": "1.75.0-next.29+bf4fe0ced",
|
|
9
|
+
"@theia/filesystem": "1.75.0-next.29+bf4fe0ced",
|
|
10
|
+
"@theia/monaco": "1.75.0-next.29+bf4fe0ced",
|
|
11
11
|
"@theia/monaco-editor-core": "1.108.201",
|
|
12
|
-
"@theia/navigator": "1.75.0-next.
|
|
13
|
-
"@theia/outline-view": "1.75.0-next.
|
|
14
|
-
"@theia/plugin": "1.75.0-next.
|
|
15
|
-
"@theia/plugin-ext": "1.75.0-next.
|
|
16
|
-
"@theia/
|
|
17
|
-
"@theia/
|
|
18
|
-
"@theia/
|
|
19
|
-
"@theia/
|
|
20
|
-
"@theia/
|
|
12
|
+
"@theia/navigator": "1.75.0-next.29+bf4fe0ced",
|
|
13
|
+
"@theia/outline-view": "1.75.0-next.29+bf4fe0ced",
|
|
14
|
+
"@theia/plugin": "1.75.0-next.29+bf4fe0ced",
|
|
15
|
+
"@theia/plugin-ext": "1.75.0-next.29+bf4fe0ced",
|
|
16
|
+
"@theia/plugin-utils": "1.75.0-next.29+bf4fe0ced",
|
|
17
|
+
"@theia/scm": "1.75.0-next.29+bf4fe0ced",
|
|
18
|
+
"@theia/terminal": "1.75.0-next.29+bf4fe0ced",
|
|
19
|
+
"@theia/typehierarchy": "1.75.0-next.29+bf4fe0ced",
|
|
20
|
+
"@theia/userstorage": "1.75.0-next.29+bf4fe0ced",
|
|
21
|
+
"@theia/workspace": "1.75.0-next.29+bf4fe0ced",
|
|
21
22
|
"decompress": "^4.2.1",
|
|
22
23
|
"filenamify": "^4.3.0",
|
|
23
24
|
"tslib": "^2.8.1"
|
|
@@ -61,5 +62,5 @@
|
|
|
61
62
|
"nyc": {
|
|
62
63
|
"extends": "../../configs/nyc.json"
|
|
63
64
|
},
|
|
64
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "bf4fe0ced22cae163ed29c86ef1f5b4dac2ae816"
|
|
65
66
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import * as path from 'path';
|
|
18
18
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
19
19
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
20
|
-
import type {
|
|
20
|
+
import type { URI } from '@theia/core';
|
|
21
21
|
import { Deferred, firstTrue } from '@theia/core/lib/common/promise-util';
|
|
22
22
|
import {
|
|
23
23
|
PluginDeployerDirectoryHandler, PluginDeployerEntry, PluginDeployerDirectoryHandlerContext,
|
|
@@ -26,6 +26,9 @@ import {
|
|
|
26
26
|
import { PluginCliContribution } from '@theia/plugin-ext/lib/main/node/plugin-cli-contribution';
|
|
27
27
|
import { TMP_DIR_PREFIX } from './plugin-vscode-utils';
|
|
28
28
|
|
|
29
|
+
/** Fields read while resolving a VS Code extension directory */
|
|
30
|
+
type PluginPackageResolveInput = Partial<Pick<PluginPackage, 'name' | 'version' | 'publisher' | 'engines'>>;
|
|
31
|
+
|
|
29
32
|
@injectable()
|
|
30
33
|
export class PluginVsCodeDirectoryHandler implements PluginDeployerDirectoryHandler {
|
|
31
34
|
|
|
@@ -92,7 +95,7 @@ export class PluginVsCodeDirectoryHandler implements PluginDeployerDirectoryHand
|
|
|
92
95
|
|
|
93
96
|
protected resolvePackage(plugin: PluginDeployerEntry, options?: {
|
|
94
97
|
pluginPath: string
|
|
95
|
-
pck?:
|
|
98
|
+
pck?: PluginPackageResolveInput
|
|
96
99
|
}): boolean {
|
|
97
100
|
const { pluginPath, pck } = options || {
|
|
98
101
|
pluginPath: plugin.path(),
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
import * as path from 'path';
|
|
18
18
|
import { injectable } from '@theia/core/shared/inversify';
|
|
19
|
-
import { PluginScanner, PluginEngine, PluginPackage, PluginModel, PluginLifecycle,
|
|
19
|
+
import { PluginScanner, PluginEngine, PluginPackage, PluginModel, PluginLifecycle, PluginIdentifiers, UIKind } from '@theia/plugin-ext';
|
|
20
20
|
import { TheiaPluginScanner } from '@theia/plugin-ext/lib/hosted/node/scanners/scanner-theia';
|
|
21
21
|
import { environment } from '@theia/core/shared/@theia/application-package/lib/environment';
|
|
22
22
|
import { VSCodeExtensionUri } from '../common/plugin-vscode-uri';
|
|
23
|
+
import { buildLifecycle, buildModelForVsCode } from '@theia/plugin-utils/lib/common/plugin-model';
|
|
23
24
|
|
|
24
25
|
const uiKind = environment.electron.is() ? UIKind.Desktop : UIKind.Web;
|
|
25
26
|
|
|
@@ -33,49 +34,13 @@ export class VsCodePluginScanner extends TheiaPluginScanner implements PluginSca
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
override getModel(plugin: PluginPackage): PluginModel {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// Only one entrypoint is valid in vscode extensions
|
|
40
|
-
// Mimic choosing frontend (web extension) and backend (local/remote extension) as described here:
|
|
41
|
-
// https://code.visualstudio.com/api/advanced-topics/extension-host#preferred-extension-location
|
|
42
|
-
const entryPoint: PluginEntryPoint = {};
|
|
43
|
-
|
|
44
|
-
// Act like codespaces when run in the browser (UIKind === 'web' and extensionKind is ['ui'])
|
|
45
|
-
const preferFrontend = uiKind === UIKind.Web && (plugin.extensionKind?.length === 1 && plugin.extensionKind[0] === 'ui');
|
|
46
|
-
|
|
47
|
-
if (plugin.browser && (!plugin.main || preferFrontend)) {
|
|
48
|
-
// Use frontend if available and there is no backend or frontend is preferred
|
|
49
|
-
entryPoint.frontend = plugin.browser;
|
|
50
|
-
} else {
|
|
51
|
-
// Default to using backend
|
|
52
|
-
entryPoint.backend = plugin.main;
|
|
53
|
-
}
|
|
54
|
-
if (plugin.theiaPlugin?.headless) {
|
|
55
|
-
// Support the Theia-specific extension for headless plugins
|
|
56
|
-
entryPoint.headless = plugin.theiaPlugin?.headless;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const result: PluginModel = {
|
|
60
|
-
packagePath: plugin.packagePath,
|
|
37
|
+
const result = buildModelForVsCode({
|
|
38
|
+
...plugin,
|
|
39
|
+
publisher: plugin.publisher ?? PluginIdentifiers.UNPUBLISHED,
|
|
61
40
|
packageUri: this.pluginUriFactory.createUri(plugin).toString(),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
publisher: publisher,
|
|
66
|
-
version: plugin.version,
|
|
67
|
-
displayName: plugin.displayName,
|
|
68
|
-
description: plugin.description,
|
|
69
|
-
engine: {
|
|
70
|
-
type: this.VSCODE_TYPE,
|
|
71
|
-
version: plugin.engines[this.VSCODE_TYPE]
|
|
72
|
-
},
|
|
73
|
-
entryPoint,
|
|
74
|
-
iconUrl: plugin.icon && PluginPackage.toPluginUrl(plugin, plugin.icon),
|
|
75
|
-
l10n: plugin.l10n,
|
|
76
|
-
readmeUrl: this.getReadmeUrl(plugin),
|
|
77
|
-
licenseUrl: this.getLicenseUrl(plugin)
|
|
78
|
-
};
|
|
41
|
+
}, { uiKind: uiKind === UIKind.Web ? 'web' : 'desktop' });
|
|
42
|
+
result.licenseUrl = this.getLicenseUrl(plugin);
|
|
43
|
+
result.readmeUrl = this.getReadmeUrl(plugin);
|
|
79
44
|
this.applyTrustExtraction(plugin, result);
|
|
80
45
|
return result;
|
|
81
46
|
}
|
|
@@ -84,29 +49,21 @@ export class VsCodePluginScanner extends TheiaPluginScanner implements PluginSca
|
|
|
84
49
|
* Maps extension dependencies to deployable extension dependencies.
|
|
85
50
|
*/
|
|
86
51
|
override getDependencies(plugin: PluginPackage): Map<string, string> | undefined {
|
|
87
|
-
// Store the list of dependencies.
|
|
88
52
|
const dependencies = new Map<string, string>();
|
|
89
|
-
// Iterate through the list of dependencies from `extensionDependencies` and `extensionPack`.
|
|
90
53
|
for (const dependency of [plugin.extensionDependencies, plugin.extensionPack]) {
|
|
91
54
|
if (dependency !== undefined) {
|
|
92
|
-
// Iterate over the list of dependencies present, and add them to the collection.
|
|
93
55
|
dependency.forEach((dep: string) => {
|
|
94
56
|
const dependencyId = dep.toLowerCase();
|
|
95
57
|
dependencies.set(dependencyId, VSCodeExtensionUri.fromId(dependencyId).toString());
|
|
96
58
|
});
|
|
97
59
|
}
|
|
98
60
|
}
|
|
99
|
-
// Return the map of dependencies if present, else `undefined`.
|
|
100
61
|
return dependencies.size > 0 ? dependencies : undefined;
|
|
101
62
|
}
|
|
102
63
|
|
|
103
64
|
override getLifecycle(plugin: PluginPackage): PluginLifecycle {
|
|
104
65
|
return {
|
|
105
|
-
|
|
106
|
-
stopMethod: 'deactivate',
|
|
107
|
-
frontendModuleName: buildFrontendModuleName(plugin),
|
|
108
|
-
|
|
109
|
-
frontendInitPath: 'plugin-vscode-init-fe.js',
|
|
66
|
+
...buildLifecycle(plugin, 'vscode'),
|
|
110
67
|
backendInitPath: path.join(__dirname, 'plugin-vscode-init'),
|
|
111
68
|
};
|
|
112
69
|
}
|