@theia/plugin-ext-vscode 1.40.1 → 1.41.0
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/common/plugin-vscode-types.d.ts +1 -1
- package/lib/node/plugin-vscode-backend-module.d.ts.map +1 -1
- package/lib/node/plugin-vscode-backend-module.js +0 -3
- package/lib/node/plugin-vscode-backend-module.js.map +1 -1
- package/lib/node/plugin-vscode-directory-handler.d.ts +11 -9
- package/lib/node/plugin-vscode-directory-handler.d.ts.map +1 -1
- package/lib/node/plugin-vscode-directory-handler.js +32 -20
- package/lib/node/plugin-vscode-directory-handler.js.map +1 -1
- package/lib/node/plugin-vscode-file-handler.d.ts +2 -1
- package/lib/node/plugin-vscode-file-handler.d.ts.map +1 -1
- package/lib/node/plugin-vscode-file-handler.js +15 -8
- package/lib/node/plugin-vscode-file-handler.js.map +1 -1
- package/package.json +15 -15
- package/src/node/plugin-vscode-backend-module.ts +1 -5
- package/src/node/plugin-vscode-directory-handler.ts +39 -20
- package/src/node/plugin-vscode-file-handler.ts +20 -9
- package/lib/node/plugin-reader.d.ts +0 -7
- package/lib/node/plugin-reader.d.ts.map +0 -1
- package/lib/node/plugin-reader.js +0 -37
- package/lib/node/plugin-reader.js.map +0 -1
- package/src/node/plugin-reader.ts +0 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-vscode-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/plugin-vscode-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;
|
|
1
|
+
{"version":3,"file":"plugin-vscode-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/plugin-vscode-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAc/D,wBAeG"}
|
|
@@ -25,7 +25,6 @@ const node_1 = require("@theia/core/lib/node");
|
|
|
25
25
|
const common_1 = require("@theia/plugin-ext/lib/common");
|
|
26
26
|
const plugin_vscode_environment_1 = require("../common/plugin-vscode-environment");
|
|
27
27
|
const plugin_vscode_deployer_participant_1 = require("./plugin-vscode-deployer-participant");
|
|
28
|
-
const plugin_reader_1 = require("./plugin-reader");
|
|
29
28
|
const local_vsix_file_plugin_deployer_resolver_1 = require("./local-vsix-file-plugin-deployer-resolver");
|
|
30
29
|
exports.default = new inversify_1.ContainerModule(bind => {
|
|
31
30
|
bind(plugin_vscode_environment_1.PluginVSCodeEnvironment).toSelf().inSingletonScope();
|
|
@@ -37,8 +36,6 @@ exports.default = new inversify_1.ContainerModule(bind => {
|
|
|
37
36
|
bind(plugin_vscode_cli_contribution_1.PluginVsCodeCliContribution).toSelf().inSingletonScope();
|
|
38
37
|
bind(node_1.CliContribution).toService(plugin_vscode_cli_contribution_1.PluginVsCodeCliContribution);
|
|
39
38
|
bind(common_1.PluginHostEnvironmentVariable).toService(plugin_vscode_cli_contribution_1.PluginVsCodeCliContribution);
|
|
40
|
-
bind(plugin_reader_1.HostedPluginReader).toSelf().inSingletonScope();
|
|
41
|
-
bind(node_1.BackendApplicationContribution).toService(plugin_reader_1.HostedPluginReader);
|
|
42
39
|
bind(plugin_ext_1.PluginDeployerResolver).to(local_vsix_file_plugin_deployer_resolver_1.LocalVSIXFilePluginDeployerResolver).inSingletonScope();
|
|
43
40
|
});
|
|
44
41
|
//# sourceMappingURL=plugin-vscode-backend-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-vscode-backend-module.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-backend-module.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,4DAA+D;AAC/D,kDAE2B;AAC3B,6EAAuE;AACvE,uFAAiF;AACjF,qDAAuD;AACvD,qFAA+E;AAC/E,+
|
|
1
|
+
{"version":3,"file":"plugin-vscode-backend-module.js","sourceRoot":"","sources":["../../src/node/plugin-vscode-backend-module.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,4DAA+D;AAC/D,kDAE2B;AAC3B,6EAAuE;AACvE,uFAAiF;AACjF,qDAAuD;AACvD,qFAA+E;AAC/E,+CAAuD;AACvD,yDAA6E;AAC7E,mFAA8E;AAC9E,6FAAuF;AACvF,yGAAiG;AAEjG,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,mDAAuB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAE1D,IAAI,CAAC,oEAA+B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAClE,IAAI,CAAC,sCAAyB,CAAC,CAAC,SAAS,CAAC,oEAA+B,CAAC,CAAC;IAE3E,IAAI,CAAC,sCAAyB,CAAC,CAAC,EAAE,CAAC,oDAAuB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC/E,IAAI,CAAC,2CAA8B,CAAC,CAAC,EAAE,CAAC,8DAA4B,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACzF,IAAI,CAAC,0BAAa,CAAC,CAAC,EAAE,CAAC,oCAAmB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAE/D,IAAI,CAAC,4DAA2B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC9D,IAAI,CAAC,sBAAe,CAAC,CAAC,SAAS,CAAC,4DAA2B,CAAC,CAAC;IAC7D,IAAI,CAAC,sCAA6B,CAAC,CAAC,SAAS,CAAC,4DAA2B,CAAC,CAAC;IAE3E,IAAI,CAAC,mCAAsB,CAAC,CAAC,EAAE,CAAC,8EAAmC,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAC5F,CAAC,CAAC,CAAC"}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { RecursivePartial } from '@theia/core';
|
|
1
|
+
import type { RecursivePartial, URI } from '@theia/core';
|
|
2
|
+
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
2
3
|
import { PluginDeployerDirectoryHandler, PluginDeployerEntry, PluginDeployerDirectoryHandlerContext, PluginPackage } from '@theia/plugin-ext';
|
|
3
4
|
import { PluginCliContribution } from '@theia/plugin-ext/lib/main/node/plugin-cli-contribution';
|
|
4
5
|
export declare class PluginVsCodeDirectoryHandler implements PluginDeployerDirectoryHandler {
|
|
5
|
-
protected readonly deploymentDirectory:
|
|
6
|
+
protected readonly deploymentDirectory: Deferred<URI>;
|
|
6
7
|
protected readonly pluginCli: PluginCliContribution;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
protected
|
|
8
|
+
constructor();
|
|
9
|
+
accept(plugin: PluginDeployerEntry): Promise<boolean>;
|
|
10
|
+
protected attemptResolution(plugin: PluginDeployerEntry): Promise<boolean>;
|
|
11
|
+
protected deriveMetadata(plugin: PluginDeployerEntry): Promise<boolean>;
|
|
10
12
|
handle(context: PluginDeployerDirectoryHandlerContext): Promise<void>;
|
|
11
13
|
protected copyDirectory(context: PluginDeployerDirectoryHandlerContext): Promise<void>;
|
|
12
|
-
protected resolveFromSources(plugin: PluginDeployerEntry): boolean
|
|
13
|
-
protected resolveFromVSIX(plugin: PluginDeployerEntry): boolean
|
|
14
|
-
protected resolveFromNpmTarball(plugin: PluginDeployerEntry): boolean
|
|
14
|
+
protected resolveFromSources(plugin: PluginDeployerEntry): Promise<boolean>;
|
|
15
|
+
protected resolveFromVSIX(plugin: PluginDeployerEntry): Promise<boolean>;
|
|
16
|
+
protected resolveFromNpmTarball(plugin: PluginDeployerEntry): Promise<boolean>;
|
|
15
17
|
protected resolvePackage(plugin: PluginDeployerEntry, options?: {
|
|
16
18
|
pluginPath: string;
|
|
17
19
|
pck?: RecursivePartial<PluginPackage>;
|
|
18
20
|
}): boolean;
|
|
19
|
-
protected requirePackage(pluginPath: string): PluginPackage | undefined
|
|
21
|
+
protected requirePackage(pluginPath: string): Promise<PluginPackage | undefined>;
|
|
20
22
|
protected getExtensionDir(context: PluginDeployerDirectoryHandlerContext): Promise<string>;
|
|
21
23
|
}
|
|
22
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":"AAoBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-vscode-directory-handler.d.ts","sourceRoot":"","sources":["../../src/node/plugin-vscode-directory-handler.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAa,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EACH,8BAA8B,EAAE,mBAAmB,EAAE,qCAAqC,EACjE,aAAa,EACzC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAEhG,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;;IAQ7E,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;cAK3C,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;cAa3D,aAAa,CAAC,OAAO,EAAE,qCAAqC,GAAG,OAAO,CAAC,IAAI,CAAC;cA2B5E,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,gBAAgB,CAAC,aAAa,CAAC,CAAA;KACxC,GAAG,OAAO;cAkBK,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;cAUtE,eAAe,CAAC,OAAO,EAAE,qCAAqC,GAAG,OAAO,CAAC,MAAM,CAAC;CAInG"}
|
|
@@ -29,23 +29,29 @@ const path = require("path");
|
|
|
29
29
|
const filenamify = require("filenamify");
|
|
30
30
|
const fs = require("@theia/core/shared/fs-extra");
|
|
31
31
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
32
|
+
const promise_util_1 = require("@theia/core/lib/common/promise-util");
|
|
33
|
+
const temp_dir_util_1 = require("@theia/plugin-ext/lib/main/node/temp-dir-util");
|
|
32
34
|
const plugin_ext_1 = require("@theia/plugin-ext");
|
|
33
35
|
const node_1 = require("@theia/core/lib/node");
|
|
34
|
-
const temp_dir_util_1 = require("@theia/plugin-ext/lib/main/node/temp-dir-util");
|
|
35
36
|
const plugin_cli_contribution_1 = require("@theia/plugin-ext/lib/main/node/plugin-cli-contribution");
|
|
36
37
|
let PluginVsCodeDirectoryHandler = class PluginVsCodeDirectoryHandler {
|
|
37
38
|
constructor() {
|
|
38
|
-
this.deploymentDirectory =
|
|
39
|
+
this.deploymentDirectory = new promise_util_1.Deferred();
|
|
40
|
+
(0, temp_dir_util_1.getTempDirPathAsync)('vscode-copied')
|
|
41
|
+
.then(deploymentDirectoryPath => this.deploymentDirectory.resolve(node_1.FileUri.create(deploymentDirectoryPath)));
|
|
39
42
|
}
|
|
40
|
-
accept(plugin) {
|
|
43
|
+
async accept(plugin) {
|
|
41
44
|
console.debug(`Resolving "${plugin.id()}" as a VS Code extension...`);
|
|
42
45
|
return this.attemptResolution(plugin);
|
|
43
46
|
}
|
|
44
|
-
attemptResolution(plugin) {
|
|
45
|
-
|
|
47
|
+
async attemptResolution(plugin) {
|
|
48
|
+
if (this.resolvePackage(plugin)) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
return this.deriveMetadata(plugin);
|
|
46
52
|
}
|
|
47
|
-
deriveMetadata(plugin) {
|
|
48
|
-
return this.resolveFromSources(plugin)
|
|
53
|
+
async deriveMetadata(plugin) {
|
|
54
|
+
return (0, promise_util_1.firstTrue)(this.resolveFromSources(plugin), this.resolveFromVSIX(plugin), this.resolveFromNpmTarball(plugin));
|
|
49
55
|
}
|
|
50
56
|
async handle(context) {
|
|
51
57
|
await this.copyDirectory(context);
|
|
@@ -67,12 +73,13 @@ let PluginVsCodeDirectoryHandler = class PluginVsCodeDirectoryHandler {
|
|
|
67
73
|
const origin = entry.originalPath();
|
|
68
74
|
const targetDir = await this.getExtensionDir(context);
|
|
69
75
|
try {
|
|
70
|
-
if (fs.
|
|
76
|
+
if (await fs.pathExists(targetDir) || !entry.path().startsWith(origin)) {
|
|
71
77
|
console.log(`[${id}]: already copied.`);
|
|
72
78
|
}
|
|
73
79
|
else {
|
|
74
80
|
console.log(`[${id}]: copying to "${targetDir}"`);
|
|
75
|
-
await
|
|
81
|
+
const deploymentDirectory = await this.deploymentDirectory.promise;
|
|
82
|
+
await fs.mkdirp(node_1.FileUri.fsPath(deploymentDirectory));
|
|
76
83
|
await context.copy(origin, targetDir);
|
|
77
84
|
entry.updatePath(targetDir);
|
|
78
85
|
if (!this.deriveMetadata(entry)) {
|
|
@@ -86,20 +93,23 @@ let PluginVsCodeDirectoryHandler = class PluginVsCodeDirectoryHandler {
|
|
|
86
93
|
}
|
|
87
94
|
}
|
|
88
95
|
}
|
|
89
|
-
resolveFromSources(plugin) {
|
|
96
|
+
async resolveFromSources(plugin) {
|
|
90
97
|
const pluginPath = plugin.path();
|
|
91
|
-
|
|
98
|
+
const pck = await this.requirePackage(pluginPath);
|
|
99
|
+
return this.resolvePackage(plugin, { pluginPath, pck });
|
|
92
100
|
}
|
|
93
|
-
resolveFromVSIX(plugin) {
|
|
94
|
-
if (!fs.
|
|
101
|
+
async resolveFromVSIX(plugin) {
|
|
102
|
+
if (!(await fs.pathExists(path.join(plugin.path(), 'extension.vsixmanifest')))) {
|
|
95
103
|
return false;
|
|
96
104
|
}
|
|
97
105
|
const pluginPath = path.join(plugin.path(), 'extension');
|
|
98
|
-
|
|
106
|
+
const pck = await this.requirePackage(pluginPath);
|
|
107
|
+
return this.resolvePackage(plugin, { pluginPath, pck });
|
|
99
108
|
}
|
|
100
|
-
resolveFromNpmTarball(plugin) {
|
|
109
|
+
async resolveFromNpmTarball(plugin) {
|
|
101
110
|
const pluginPath = path.join(plugin.path(), 'package');
|
|
102
|
-
|
|
111
|
+
const pck = await this.requirePackage(pluginPath);
|
|
112
|
+
return this.resolvePackage(plugin, { pluginPath, pck });
|
|
103
113
|
}
|
|
104
114
|
resolvePackage(plugin, options) {
|
|
105
115
|
var _a;
|
|
@@ -119,10 +129,10 @@ let PluginVsCodeDirectoryHandler = class PluginVsCodeDirectoryHandler {
|
|
|
119
129
|
console.debug(`Resolved "${plugin.id()}" to a VS Code extension "${pck.name}@${pck.version}" with engines:`, pck.engines);
|
|
120
130
|
return true;
|
|
121
131
|
}
|
|
122
|
-
requirePackage(pluginPath) {
|
|
132
|
+
async requirePackage(pluginPath) {
|
|
123
133
|
var _a;
|
|
124
134
|
try {
|
|
125
|
-
const plugin = fs.
|
|
135
|
+
const plugin = await fs.readJSON(path.join(pluginPath, 'package.json'));
|
|
126
136
|
(_a = plugin.publisher) !== null && _a !== void 0 ? _a : (plugin.publisher = plugin_ext_1.PluginIdentifiers.UNPUBLISHED);
|
|
127
137
|
return plugin;
|
|
128
138
|
}
|
|
@@ -131,7 +141,8 @@ let PluginVsCodeDirectoryHandler = class PluginVsCodeDirectoryHandler {
|
|
|
131
141
|
}
|
|
132
142
|
}
|
|
133
143
|
async getExtensionDir(context) {
|
|
134
|
-
|
|
144
|
+
const deploymentDirectory = await this.deploymentDirectory.promise;
|
|
145
|
+
return node_1.FileUri.fsPath(deploymentDirectory.resolve(filenamify(context.pluginEntry().id(), { replacement: '_' })));
|
|
135
146
|
}
|
|
136
147
|
};
|
|
137
148
|
__decorate([
|
|
@@ -139,7 +150,8 @@ __decorate([
|
|
|
139
150
|
__metadata("design:type", plugin_cli_contribution_1.PluginCliContribution)
|
|
140
151
|
], PluginVsCodeDirectoryHandler.prototype, "pluginCli", void 0);
|
|
141
152
|
PluginVsCodeDirectoryHandler = __decorate([
|
|
142
|
-
(0, inversify_1.injectable)()
|
|
153
|
+
(0, inversify_1.injectable)(),
|
|
154
|
+
__metadata("design:paramtypes", [])
|
|
143
155
|
], PluginVsCodeDirectoryHandler);
|
|
144
156
|
exports.PluginVsCodeDirectoryHandler = PluginVsCodeDirectoryHandler;
|
|
145
157
|
//# 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":";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,yCAAyC;AACzC,kDAAkD;AAClD,4DAAkE;AAElE,kDAG2B;AAC3B,+CAA+C;AAC/C,
|
|
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,yCAAyC;AACzC,kDAAkD;AAClD,4DAAkE;AAElE,sEAA0E;AAC1E,iFAAoF;AACpF,kDAG2B;AAC3B,+CAA+C;AAC/C,qGAAgG;AAGhG,IAAa,4BAA4B,GAAzC,MAAa,4BAA4B;IAMrC;QACI,IAAI,CAAC,mBAAmB,GAAG,IAAI,uBAAQ,EAAE,CAAC;QAC1C,IAAA,mCAAmB,EAAC,eAAe,CAAC;aAC/B,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,cAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;IACpH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAA2B;QACpC,OAAO,CAAC,KAAK,CAAC,cAAc,MAAM,CAAC,EAAE,EAAE,6BAA6B,CAAC,CAAC;QACtE,OAAO,IAAI,CAAC,iBA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AAC,+CAAqB,CAAC;8BAA+B,+CAAqB;+DAAC;AAJ1E,4BAA4B;IADxC,IAAA,sBAAU,GAAE;;GACA,4BAA4B,CAgIxC;AAhIY,oEAA4B"}
|
|
@@ -4,7 +4,8 @@ export declare const isVSCodePluginFile: (pluginPath?: string | undefined) => bo
|
|
|
4
4
|
export declare class PluginVsCodeFileHandler implements PluginDeployerFileHandler {
|
|
5
5
|
protected readonly environment: PluginVSCodeEnvironment;
|
|
6
6
|
private readonly systemExtensionsDirUri;
|
|
7
|
-
|
|
7
|
+
constructor();
|
|
8
|
+
accept(resolvedPlugin: PluginDeployerEntry): Promise<boolean>;
|
|
8
9
|
handle(context: PluginDeployerFileHandlerContext): Promise<void>;
|
|
9
10
|
protected getExtensionDir(context: PluginDeployerFileHandlerContext): Promise<string>;
|
|
10
11
|
protected decompress(extensionDir: string, context: PluginDeployerFileHandlerContext): Promise<void>;
|
|
@@ -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,EAAc,MAAM,mBAAmB,CAAC;
|
|
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,EAAc,MAAM,mBAAmB,CAAC;AAQjI,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAG9E,eAAO,MAAM,kBAAkB,8CAAgH,CAAC;AAEhJ,qBACa,uBAAwB,YAAW,yBAAyB;IAGrE,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,uBAAuB,CAAC;IAExD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAgB;;IAQjD,MAAM,CAAC,cAAc,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAS7D,MAAM,CAAC,OAAO,EAAE,gCAAgC,GAAG,OAAO,CAAC,IAAI,CAAC;cActD,eAAe,CAAC,OAAO,EAAE,gCAAgC,GAAG,OAAO,CAAC,MAAM,CAAC;cAK3E,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,gCAAgC,GAAG,OAAO,CAAC,IAAI,CAAC;CAW7G"}
|
|
@@ -30,6 +30,7 @@ const fs = require("@theia/core/shared/fs-extra");
|
|
|
30
30
|
const path = require("path");
|
|
31
31
|
const filenamify = require("filenamify");
|
|
32
32
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
+
const promise_util_1 = require("@theia/core/lib/common/promise-util");
|
|
33
34
|
const temp_dir_util_1 = require("@theia/plugin-ext/lib/main/node/temp-dir-util");
|
|
34
35
|
const plugin_vscode_environment_1 = require("../common/plugin-vscode-environment");
|
|
35
36
|
const file_uri_1 = require("@theia/core/lib/node/file-uri");
|
|
@@ -37,13 +38,17 @@ const isVSCodePluginFile = (pluginPath) => Boolean(pluginPath && (pluginPath.end
|
|
|
37
38
|
exports.isVSCodePluginFile = isVSCodePluginFile;
|
|
38
39
|
let PluginVsCodeFileHandler = class PluginVsCodeFileHandler {
|
|
39
40
|
constructor() {
|
|
40
|
-
this.systemExtensionsDirUri =
|
|
41
|
+
this.systemExtensionsDirUri = new promise_util_1.Deferred();
|
|
42
|
+
(0, temp_dir_util_1.getTempDirPathAsync)('vscode-unpacked')
|
|
43
|
+
.then(systemExtensionsDirPath => this.systemExtensionsDirUri.resolve(file_uri_1.FileUri.create(systemExtensionsDirPath)));
|
|
41
44
|
}
|
|
42
|
-
accept(resolvedPlugin) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
async accept(resolvedPlugin) {
|
|
46
|
+
return resolvedPlugin.isFile().then(file => {
|
|
47
|
+
if (!file) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return (0, exports.isVSCodePluginFile)(resolvedPlugin.path());
|
|
51
|
+
});
|
|
47
52
|
}
|
|
48
53
|
async handle(context) {
|
|
49
54
|
const id = context.pluginEntry().id();
|
|
@@ -59,7 +64,8 @@ let PluginVsCodeFileHandler = class PluginVsCodeFileHandler {
|
|
|
59
64
|
context.pluginEntry().updatePath(extensionDir);
|
|
60
65
|
}
|
|
61
66
|
async getExtensionDir(context) {
|
|
62
|
-
|
|
67
|
+
const systemExtensionsDirUri = await this.systemExtensionsDirUri.promise;
|
|
68
|
+
return file_uri_1.FileUri.fsPath(systemExtensionsDirUri.resolve(filenamify(context.pluginEntry().id(), { replacement: '_' })));
|
|
63
69
|
}
|
|
64
70
|
async decompress(extensionDir, context) {
|
|
65
71
|
await context.unzip(context.pluginEntry().path(), extensionDir);
|
|
@@ -77,7 +83,8 @@ __decorate([
|
|
|
77
83
|
__metadata("design:type", plugin_vscode_environment_1.PluginVSCodeEnvironment)
|
|
78
84
|
], PluginVsCodeFileHandler.prototype, "environment", void 0);
|
|
79
85
|
PluginVsCodeFileHandler = __decorate([
|
|
80
|
-
(0, inversify_1.injectable)()
|
|
86
|
+
(0, inversify_1.injectable)(),
|
|
87
|
+
__metadata("design:paramtypes", [])
|
|
81
88
|
], PluginVsCodeFileHandler);
|
|
82
89
|
exports.PluginVsCodeFileHandler = PluginVsCodeFileHandler;
|
|
83
90
|
//# 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":";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,gFAAg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W,EAAE,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,CAAC;QAChE,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;YAC/C,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;YACzD,MAAM,qBAAqB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,yBAAyB,CAAC,CAAC;YAClF,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC,EAAE;gBAC5C,MAAM,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;aACxF;SACJ;IACL,CAAC;CAEJ,CAAA;AAjDG;IADC,IAAA,kBAAM,EAAC,mDAAuB,CAAC;8BACA,mDAAuB;4DAAC;AAH/C,uBAAuB;IADnC,IAAA,sBAAU,GAAE;;GACA,uBAAuB,CAoDnC;AApDY,0DAAuB"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin-ext-vscode",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.41.0",
|
|
4
4
|
"description": "Theia - Plugin Extension for VsCode",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/callhierarchy": "1.
|
|
7
|
-
"@theia/core": "1.
|
|
8
|
-
"@theia/editor": "1.
|
|
9
|
-
"@theia/filesystem": "1.
|
|
10
|
-
"@theia/monaco": "1.
|
|
6
|
+
"@theia/callhierarchy": "1.41.0",
|
|
7
|
+
"@theia/core": "1.41.0",
|
|
8
|
+
"@theia/editor": "1.41.0",
|
|
9
|
+
"@theia/filesystem": "1.41.0",
|
|
10
|
+
"@theia/monaco": "1.41.0",
|
|
11
11
|
"@theia/monaco-editor-core": "1.72.3",
|
|
12
|
-
"@theia/navigator": "1.
|
|
13
|
-
"@theia/plugin": "1.
|
|
14
|
-
"@theia/plugin-ext": "1.
|
|
15
|
-
"@theia/terminal": "1.
|
|
16
|
-
"@theia/typehierarchy": "1.
|
|
17
|
-
"@theia/userstorage": "1.
|
|
18
|
-
"@theia/workspace": "1.
|
|
12
|
+
"@theia/navigator": "1.41.0",
|
|
13
|
+
"@theia/plugin": "1.41.0",
|
|
14
|
+
"@theia/plugin-ext": "1.41.0",
|
|
15
|
+
"@theia/terminal": "1.41.0",
|
|
16
|
+
"@theia/typehierarchy": "1.41.0",
|
|
17
|
+
"@theia/userstorage": "1.41.0",
|
|
18
|
+
"@theia/workspace": "1.41.0",
|
|
19
19
|
"filenamify": "^4.1.0"
|
|
20
20
|
},
|
|
21
21
|
"publishConfig": {
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"watch": "theiaext watch"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@theia/ext-scripts": "1.
|
|
55
|
+
"@theia/ext-scripts": "1.41.0"
|
|
56
56
|
},
|
|
57
57
|
"nyc": {
|
|
58
58
|
"extends": "../../configs/nyc.json"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "180103ad086fc0a5e4e5fc01b5fcb43f06019eb1"
|
|
61
61
|
}
|
|
@@ -22,11 +22,10 @@ import { PluginVsCodeFileHandler } from './plugin-vscode-file-handler';
|
|
|
22
22
|
import { PluginVsCodeDirectoryHandler } from './plugin-vscode-directory-handler';
|
|
23
23
|
import { VsCodePluginScanner } from './scanner-vscode';
|
|
24
24
|
import { PluginVsCodeCliContribution } from './plugin-vscode-cli-contribution';
|
|
25
|
-
import {
|
|
25
|
+
import { CliContribution } from '@theia/core/lib/node';
|
|
26
26
|
import { PluginHostEnvironmentVariable } from '@theia/plugin-ext/lib/common';
|
|
27
27
|
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
28
28
|
import { PluginVSCodeDeployerParticipant } from './plugin-vscode-deployer-participant';
|
|
29
|
-
import { HostedPluginReader } from './plugin-reader';
|
|
30
29
|
import { LocalVSIXFilePluginDeployerResolver } from './local-vsix-file-plugin-deployer-resolver';
|
|
31
30
|
|
|
32
31
|
export default new ContainerModule(bind => {
|
|
@@ -43,8 +42,5 @@ export default new ContainerModule(bind => {
|
|
|
43
42
|
bind(CliContribution).toService(PluginVsCodeCliContribution);
|
|
44
43
|
bind(PluginHostEnvironmentVariable).toService(PluginVsCodeCliContribution);
|
|
45
44
|
|
|
46
|
-
bind(HostedPluginReader).toSelf().inSingletonScope();
|
|
47
|
-
bind(BackendApplicationContribution).toService(HostedPluginReader);
|
|
48
|
-
|
|
49
45
|
bind(PluginDeployerResolver).to(LocalVSIXFilePluginDeployerResolver).inSingletonScope();
|
|
50
46
|
});
|
|
@@ -18,33 +18,47 @@ import * as path from 'path';
|
|
|
18
18
|
import * as filenamify from 'filenamify';
|
|
19
19
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
20
20
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
21
|
-
import { RecursivePartial } from '@theia/core';
|
|
21
|
+
import type { RecursivePartial, URI } from '@theia/core';
|
|
22
|
+
import { Deferred, firstTrue } from '@theia/core/lib/common/promise-util';
|
|
23
|
+
import { getTempDirPathAsync } from '@theia/plugin-ext/lib/main/node/temp-dir-util';
|
|
22
24
|
import {
|
|
23
25
|
PluginDeployerDirectoryHandler, PluginDeployerEntry, PluginDeployerDirectoryHandlerContext,
|
|
24
26
|
PluginDeployerEntryType, PluginPackage, PluginType, PluginIdentifiers
|
|
25
27
|
} from '@theia/plugin-ext';
|
|
26
28
|
import { FileUri } from '@theia/core/lib/node';
|
|
27
|
-
import { getTempDir } from '@theia/plugin-ext/lib/main/node/temp-dir-util';
|
|
28
29
|
import { PluginCliContribution } from '@theia/plugin-ext/lib/main/node/plugin-cli-contribution';
|
|
29
30
|
|
|
30
31
|
@injectable()
|
|
31
32
|
export class PluginVsCodeDirectoryHandler implements PluginDeployerDirectoryHandler {
|
|
32
33
|
|
|
33
|
-
protected readonly deploymentDirectory
|
|
34
|
+
protected readonly deploymentDirectory: Deferred<URI>;
|
|
34
35
|
|
|
35
36
|
@inject(PluginCliContribution) protected readonly pluginCli: PluginCliContribution;
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
constructor() {
|
|
39
|
+
this.deploymentDirectory = new Deferred();
|
|
40
|
+
getTempDirPathAsync('vscode-copied')
|
|
41
|
+
.then(deploymentDirectoryPath => this.deploymentDirectory.resolve(FileUri.create(deploymentDirectoryPath)));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async accept(plugin: PluginDeployerEntry): Promise<boolean> {
|
|
38
45
|
console.debug(`Resolving "${plugin.id()}" as a VS Code extension...`);
|
|
39
46
|
return this.attemptResolution(plugin);
|
|
40
47
|
}
|
|
41
48
|
|
|
42
|
-
protected attemptResolution(plugin: PluginDeployerEntry): boolean {
|
|
43
|
-
|
|
49
|
+
protected async attemptResolution(plugin: PluginDeployerEntry): Promise<boolean> {
|
|
50
|
+
if (this.resolvePackage(plugin)) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
return this.deriveMetadata(plugin);
|
|
44
54
|
}
|
|
45
55
|
|
|
46
|
-
protected deriveMetadata(plugin: PluginDeployerEntry): boolean {
|
|
47
|
-
return
|
|
56
|
+
protected async deriveMetadata(plugin: PluginDeployerEntry): Promise<boolean> {
|
|
57
|
+
return firstTrue(
|
|
58
|
+
this.resolveFromSources(plugin),
|
|
59
|
+
this.resolveFromVSIX(plugin),
|
|
60
|
+
this.resolveFromNpmTarball(plugin)
|
|
61
|
+
);
|
|
48
62
|
}
|
|
49
63
|
|
|
50
64
|
async handle(context: PluginDeployerDirectoryHandlerContext): Promise<void> {
|
|
@@ -68,11 +82,12 @@ export class PluginVsCodeDirectoryHandler implements PluginDeployerDirectoryHand
|
|
|
68
82
|
const origin = entry.originalPath();
|
|
69
83
|
const targetDir = await this.getExtensionDir(context);
|
|
70
84
|
try {
|
|
71
|
-
if (fs.
|
|
85
|
+
if (await fs.pathExists(targetDir) || !entry.path().startsWith(origin)) {
|
|
72
86
|
console.log(`[${id}]: already copied.`);
|
|
73
87
|
} else {
|
|
74
88
|
console.log(`[${id}]: copying to "${targetDir}"`);
|
|
75
|
-
await
|
|
89
|
+
const deploymentDirectory = await this.deploymentDirectory.promise;
|
|
90
|
+
await fs.mkdirp(FileUri.fsPath(deploymentDirectory));
|
|
76
91
|
await context.copy(origin, targetDir);
|
|
77
92
|
entry.updatePath(targetDir);
|
|
78
93
|
if (!this.deriveMetadata(entry)) {
|
|
@@ -86,22 +101,25 @@ export class PluginVsCodeDirectoryHandler implements PluginDeployerDirectoryHand
|
|
|
86
101
|
}
|
|
87
102
|
}
|
|
88
103
|
|
|
89
|
-
protected resolveFromSources(plugin: PluginDeployerEntry): boolean {
|
|
104
|
+
protected async resolveFromSources(plugin: PluginDeployerEntry): Promise<boolean> {
|
|
90
105
|
const pluginPath = plugin.path();
|
|
91
|
-
|
|
106
|
+
const pck = await this.requirePackage(pluginPath);
|
|
107
|
+
return this.resolvePackage(plugin, { pluginPath, pck });
|
|
92
108
|
}
|
|
93
109
|
|
|
94
|
-
protected resolveFromVSIX(plugin: PluginDeployerEntry): boolean {
|
|
95
|
-
if (!fs.
|
|
110
|
+
protected async resolveFromVSIX(plugin: PluginDeployerEntry): Promise<boolean> {
|
|
111
|
+
if (!(await fs.pathExists(path.join(plugin.path(), 'extension.vsixmanifest')))) {
|
|
96
112
|
return false;
|
|
97
113
|
}
|
|
98
114
|
const pluginPath = path.join(plugin.path(), 'extension');
|
|
99
|
-
|
|
115
|
+
const pck = await this.requirePackage(pluginPath);
|
|
116
|
+
return this.resolvePackage(plugin, { pluginPath, pck });
|
|
100
117
|
}
|
|
101
118
|
|
|
102
|
-
protected resolveFromNpmTarball(plugin: PluginDeployerEntry): boolean {
|
|
119
|
+
protected async resolveFromNpmTarball(plugin: PluginDeployerEntry): Promise<boolean> {
|
|
103
120
|
const pluginPath = path.join(plugin.path(), 'package');
|
|
104
|
-
|
|
121
|
+
const pck = await this.requirePackage(pluginPath);
|
|
122
|
+
return this.resolvePackage(plugin, { pluginPath, pck });
|
|
105
123
|
}
|
|
106
124
|
|
|
107
125
|
protected resolvePackage(plugin: PluginDeployerEntry, options?: {
|
|
@@ -125,9 +143,9 @@ export class PluginVsCodeDirectoryHandler implements PluginDeployerDirectoryHand
|
|
|
125
143
|
return true;
|
|
126
144
|
}
|
|
127
145
|
|
|
128
|
-
protected requirePackage(pluginPath: string): PluginPackage | undefined {
|
|
146
|
+
protected async requirePackage(pluginPath: string): Promise<PluginPackage | undefined> {
|
|
129
147
|
try {
|
|
130
|
-
const plugin = fs.
|
|
148
|
+
const plugin: PluginPackage = await fs.readJSON(path.join(pluginPath, 'package.json'));
|
|
131
149
|
plugin.publisher ??= PluginIdentifiers.UNPUBLISHED;
|
|
132
150
|
return plugin;
|
|
133
151
|
} catch {
|
|
@@ -136,6 +154,7 @@ export class PluginVsCodeDirectoryHandler implements PluginDeployerDirectoryHand
|
|
|
136
154
|
}
|
|
137
155
|
|
|
138
156
|
protected async getExtensionDir(context: PluginDeployerDirectoryHandlerContext): Promise<string> {
|
|
139
|
-
|
|
157
|
+
const deploymentDirectory = await this.deploymentDirectory.promise;
|
|
158
|
+
return FileUri.fsPath(deploymentDirectory.resolve(filenamify(context.pluginEntry().id(), { replacement: '_' })));
|
|
140
159
|
}
|
|
141
160
|
}
|
|
@@ -18,8 +18,10 @@ import { PluginDeployerFileHandler, PluginDeployerEntry, PluginDeployerFileHandl
|
|
|
18
18
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
19
19
|
import * as path from 'path';
|
|
20
20
|
import * as filenamify from 'filenamify';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
21
|
+
import type { URI } from '@theia/core';
|
|
22
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
23
|
+
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
24
|
+
import { getTempDirPathAsync } from '@theia/plugin-ext/lib/main/node/temp-dir-util';
|
|
23
25
|
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
24
26
|
import { FileUri } from '@theia/core/lib/node/file-uri';
|
|
25
27
|
|
|
@@ -31,13 +33,21 @@ export class PluginVsCodeFileHandler implements PluginDeployerFileHandler {
|
|
|
31
33
|
@inject(PluginVSCodeEnvironment)
|
|
32
34
|
protected readonly environment: PluginVSCodeEnvironment;
|
|
33
35
|
|
|
34
|
-
private readonly systemExtensionsDirUri
|
|
36
|
+
private readonly systemExtensionsDirUri: Deferred<URI>;
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
constructor() {
|
|
39
|
+
this.systemExtensionsDirUri = new Deferred();
|
|
40
|
+
getTempDirPathAsync('vscode-unpacked')
|
|
41
|
+
.then(systemExtensionsDirPath => this.systemExtensionsDirUri.resolve(FileUri.create(systemExtensionsDirPath)));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async accept(resolvedPlugin: PluginDeployerEntry): Promise<boolean> {
|
|
45
|
+
return resolvedPlugin.isFile().then(file => {
|
|
46
|
+
if (!file) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
return isVSCodePluginFile(resolvedPlugin.path());
|
|
50
|
+
});
|
|
41
51
|
}
|
|
42
52
|
|
|
43
53
|
async handle(context: PluginDeployerFileHandlerContext): Promise<void> {
|
|
@@ -55,7 +65,8 @@ export class PluginVsCodeFileHandler implements PluginDeployerFileHandler {
|
|
|
55
65
|
}
|
|
56
66
|
|
|
57
67
|
protected async getExtensionDir(context: PluginDeployerFileHandlerContext): Promise<string> {
|
|
58
|
-
|
|
68
|
+
const systemExtensionsDirUri = await this.systemExtensionsDirUri.promise;
|
|
69
|
+
return FileUri.fsPath(systemExtensionsDirUri.resolve(filenamify(context.pluginEntry().id(), { replacement: '_' })));
|
|
59
70
|
}
|
|
60
71
|
|
|
61
72
|
protected async decompress(extensionDir: string, context: PluginDeployerFileHandlerContext): Promise<void> {
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="express" />
|
|
2
|
-
import { Application } from '@theia/core/shared/express';
|
|
3
|
-
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
|
|
4
|
-
export declare class HostedPluginReader implements BackendApplicationContribution {
|
|
5
|
-
configure(app: Application): void;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=plugin-reader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-reader.d.ts","sourceRoot":"","sources":["../../src/node/plugin-reader.ts"],"names":[],"mappings":";AAkBA,OAAO,EAAE,WAAW,EAA2B,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAE1F,qBACa,kBAAmB,YAAW,8BAA8B;IAErE,SAAS,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;CAGpC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2022 Arm 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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.HostedPluginReader = void 0;
|
|
25
|
-
const path = require("path");
|
|
26
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
27
|
-
const express_1 = require("@theia/core/shared/express");
|
|
28
|
-
let HostedPluginReader = class HostedPluginReader {
|
|
29
|
-
configure(app) {
|
|
30
|
-
app.use('/context', (0, express_1.static)(path.join(__dirname, 'context')));
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
HostedPluginReader = __decorate([
|
|
34
|
-
(0, inversify_1.injectable)()
|
|
35
|
-
], HostedPluginReader);
|
|
36
|
-
exports.HostedPluginReader = HostedPluginReader;
|
|
37
|
-
//# sourceMappingURL=plugin-reader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-reader.js","sourceRoot":"","sources":["../../src/node/plugin-reader.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,qCAAqC;AACrC,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,wDAAkF;AAIlF,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAE3B,SAAS,CAAC,GAAgB;QACtB,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,IAAA,gBAAa,EAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC;CACJ,CAAA;AALY,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;GACA,kBAAkB,CAK9B;AALY,gDAAkB"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2022 Arm and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import * as path from 'path';
|
|
18
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
19
|
-
import { Application, static as ExpressStatic } from '@theia/core/shared/express';
|
|
20
|
-
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
|
|
21
|
-
|
|
22
|
-
@injectable()
|
|
23
|
-
export class HostedPluginReader implements BackendApplicationContribution {
|
|
24
|
-
|
|
25
|
-
configure(app: Application): void {
|
|
26
|
-
app.use('/context', ExpressStatic(path.join(__dirname, 'context')));
|
|
27
|
-
}
|
|
28
|
-
}
|