@theia/core 1.77.0-next.0 → 1.77.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/lib/browser/catalog.json +206 -5
  2. package/lib/browser/menu/browser-menu-plugin.d.ts +42 -1
  3. package/lib/browser/menu/browser-menu-plugin.d.ts.map +1 -1
  4. package/lib/browser/menu/browser-menu-plugin.js +152 -5
  5. package/lib/browser/menu/browser-menu-plugin.js.map +1 -1
  6. package/lib/browser/shell/application-shell.js +1 -1
  7. package/lib/browser/shell/application-shell.js.map +1 -1
  8. package/lib/common/core-preferences.d.ts +1 -1
  9. package/lib/common/core-preferences.d.ts.map +1 -1
  10. package/lib/common/core-preferences.js +2 -1
  11. package/lib/common/core-preferences.js.map +1 -1
  12. package/lib/electron-browser/menu/electron-main-menu-factory.d.ts +5 -0
  13. package/lib/electron-browser/menu/electron-main-menu-factory.d.ts.map +1 -1
  14. package/lib/electron-browser/menu/electron-main-menu-factory.js +39 -8
  15. package/lib/electron-browser/menu/electron-main-menu-factory.js.map +1 -1
  16. package/lib/electron-browser/menu/electron-menu-contribution.d.ts +8 -1
  17. package/lib/electron-browser/menu/electron-menu-contribution.d.ts.map +1 -1
  18. package/lib/electron-browser/menu/electron-menu-contribution.js +50 -4
  19. package/lib/electron-browser/menu/electron-menu-contribution.js.map +1 -1
  20. package/lib/electron-browser/preload.d.ts.map +1 -1
  21. package/lib/electron-browser/preload.js +1 -0
  22. package/lib/electron-browser/preload.js.map +1 -1
  23. package/lib/electron-common/electron-api.d.ts +2 -0
  24. package/lib/electron-common/electron-api.d.ts.map +1 -1
  25. package/lib/electron-common/electron-api.js +2 -1
  26. package/lib/electron-common/electron-api.js.map +1 -1
  27. package/lib/electron-main/electron-api-main.d.ts.map +1 -1
  28. package/lib/electron-main/electron-api-main.js +15 -0
  29. package/lib/electron-main/electron-api-main.js.map +1 -1
  30. package/lib/node/backend-application-module.d.ts.map +1 -1
  31. package/lib/node/backend-application-module.js +3 -0
  32. package/lib/node/backend-application-module.js.map +1 -1
  33. package/lib/node/bundled-resource-provider.d.ts +86 -0
  34. package/lib/node/bundled-resource-provider.d.ts.map +1 -0
  35. package/lib/node/bundled-resource-provider.js +241 -0
  36. package/lib/node/bundled-resource-provider.js.map +1 -0
  37. package/lib/node/bundled-resource-provider.spec.d.ts +2 -0
  38. package/lib/node/bundled-resource-provider.spec.d.ts.map +1 -0
  39. package/lib/node/bundled-resource-provider.spec.js +160 -0
  40. package/lib/node/bundled-resource-provider.spec.js.map +1 -0
  41. package/lib/node/index.d.ts +1 -0
  42. package/lib/node/index.d.ts.map +1 -1
  43. package/lib/node/index.js +3 -1
  44. package/lib/node/index.js.map +1 -1
  45. package/package.json +4 -4
  46. package/src/browser/menu/browser-menu-plugin.ts +169 -6
  47. package/src/browser/shell/application-shell.ts +1 -1
  48. package/src/common/core-preferences.ts +3 -2
  49. package/src/electron-browser/menu/electron-main-menu-factory.ts +45 -7
  50. package/src/electron-browser/menu/electron-menu-contribution.ts +50 -5
  51. package/src/electron-browser/preload.ts +3 -1
  52. package/src/electron-common/electron-api.ts +2 -0
  53. package/src/electron-main/electron-api-main.ts +16 -1
  54. package/src/node/backend-application-module.ts +4 -0
  55. package/src/node/bundled-resource-provider.spec.ts +196 -0
  56. package/src/node/bundled-resource-provider.ts +266 -0
  57. package/src/node/index.ts +1 -0
@@ -0,0 +1,241 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource GmbH and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.BundledResourceProviderImpl = exports.BundledResourceProvider = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const crypto = require("crypto");
21
+ const fs = require("fs");
22
+ const os = require("os");
23
+ const path = require("path");
24
+ const inversify_1 = require("inversify");
25
+ const env_variables_1 = require("../common/env-variables");
26
+ const file_uri_1 = require("../common/file-uri");
27
+ const logger_1 = require("../common/logger");
28
+ const filesystem_locking_1 = require("./filesystem-locking");
29
+ exports.BundledResourceProvider = Symbol('BundledResourceProvider');
30
+ let BundledResourceProviderImpl = class BundledResourceProviderImpl {
31
+ constructor() {
32
+ /** The folder within the configuration directory into which resources are extracted. */
33
+ this.extractionFolder = 'bundled-resources';
34
+ /** Resources extracted for another application version are removed when they are older than this. */
35
+ this.staleExtractionAge = 7 * 24 * 60 * 60 * 1000;
36
+ this.resolved = new Map();
37
+ }
38
+ async resolveExternalPath(resourcePath) {
39
+ const normalizedPath = path.resolve(resourcePath);
40
+ const pending = this.resolved.get(normalizedPath);
41
+ if (pending) {
42
+ try {
43
+ const resolvedPath = await pending;
44
+ if (await this.exists(resolvedPath)) {
45
+ return resolvedPath;
46
+ }
47
+ }
48
+ catch {
49
+ // the previous attempt failed, so try again below
50
+ }
51
+ this.resolved.delete(normalizedPath);
52
+ }
53
+ const result = this.doResolveExternalPath(normalizedPath);
54
+ this.resolved.set(normalizedPath, result);
55
+ return result;
56
+ }
57
+ async doResolveExternalPath(resourcePath) {
58
+ if (!await this.exists(resourcePath)) {
59
+ throw new Error(`Bundled resource does not exist: ${resourcePath}`);
60
+ }
61
+ const archivePath = this.findArchivePath(resourcePath);
62
+ if (!archivePath) {
63
+ // The resource is not packaged into an archive, so external processes can read it directly.
64
+ return resourcePath;
65
+ }
66
+ const relativePath = path.relative(archivePath, resourcePath);
67
+ const unpackedPath = path.join(`${archivePath}.unpacked`, relativePath);
68
+ if (await this.isExtracted(resourcePath, unpackedPath)) {
69
+ return unpackedPath;
70
+ }
71
+ const extractionPath = path.join(await this.getExtractionPath(archivePath), relativePath);
72
+ await this.fileSystemLocking.lockPath(archivePath, () => this.extract(resourcePath, extractionPath));
73
+ this.logger.info(`Extracted bundled resource '${resourcePath}' to '${extractionPath}'.`);
74
+ return extractionPath;
75
+ }
76
+ /**
77
+ * Find the archive that the given resource is packaged into, if any.
78
+ *
79
+ * @returns the path of the archive, i.e. the shortest prefix of the given path ending in an `.asar` segment,
80
+ * which is also how Electron itself determines the archive that a path refers to.
81
+ */
82
+ findArchivePath(resourcePath) {
83
+ const segments = resourcePath.split(/[\\/]/);
84
+ const archiveIndex = segments.findIndex(segment => segment.toLowerCase().endsWith('.asar'));
85
+ return archiveIndex < 0 ? undefined : segments.slice(0, archiveIndex + 1).join(path.sep);
86
+ }
87
+ /**
88
+ * Whether every file of the given resource is already available at the given target path. Packaging tools
89
+ * only unpack the files that the application configured them to unpack, so a partial copy must be ignored.
90
+ */
91
+ async isExtracted(resourcePath, targetPath) {
92
+ for (const file of await this.collectFiles(resourcePath)) {
93
+ if (!await this.exists(path.join(targetPath, file))) {
94
+ return false;
95
+ }
96
+ }
97
+ return true;
98
+ }
99
+ async extract(resourcePath, targetPath) {
100
+ for (const file of await this.collectFiles(resourcePath)) {
101
+ await this.copyFile(path.join(resourcePath, file), path.join(targetPath, file));
102
+ }
103
+ }
104
+ /**
105
+ * Collect the files of the given resource as paths relative to it. The relative path of a resource that is
106
+ * a plain file is the empty string.
107
+ */
108
+ async collectFiles(resourcePath, relativePath = '') {
109
+ const currentPath = path.join(resourcePath, relativePath);
110
+ if (!(await fs.promises.stat(currentPath)).isDirectory()) {
111
+ return [relativePath];
112
+ }
113
+ const files = [];
114
+ for (const entry of await fs.promises.readdir(currentPath)) {
115
+ files.push(...await this.collectFiles(resourcePath, path.join(relativePath, entry)));
116
+ }
117
+ return files;
118
+ }
119
+ async copyFile(sourcePath, targetPath) {
120
+ const sourceStat = await fs.promises.stat(sourcePath);
121
+ if (await this.isUpToDate(targetPath, sourceStat)) {
122
+ return;
123
+ }
124
+ await fs.promises.mkdir(path.dirname(targetPath), { recursive: true, mode: 0o700 });
125
+ // Write to a temporary file and move it into place, so that a concurrently starting application
126
+ // instance never reads partially written content.
127
+ const temporaryPath = `${targetPath}.${process.pid}.tmp`;
128
+ try {
129
+ // Electron reports the files of an asar archive as not executable, even those that the archive marks as
130
+ // executable, so every extracted file is made executable for the owner to keep bundled executables usable.
131
+ await fs.promises.writeFile(temporaryPath, await fs.promises.readFile(sourcePath), { mode: sourceStat.mode & 0o777 | 0o700 });
132
+ try {
133
+ await fs.promises.rename(temporaryPath, targetPath);
134
+ }
135
+ catch {
136
+ // renaming onto an existing file is not supported on all platforms
137
+ await fs.promises.rm(targetPath, { force: true });
138
+ await fs.promises.rename(temporaryPath, targetPath);
139
+ }
140
+ }
141
+ finally {
142
+ await fs.promises.rm(temporaryPath, { force: true });
143
+ }
144
+ }
145
+ async isUpToDate(targetPath, sourceStat) {
146
+ try {
147
+ return (await fs.promises.stat(targetPath)).size === sourceStat.size;
148
+ }
149
+ catch {
150
+ return false;
151
+ }
152
+ }
153
+ /**
154
+ * The directory into which resources of the given archive are extracted. It is specific to the content of
155
+ * the archive, so that updating the application invalidates previously extracted copies.
156
+ */
157
+ async getExtractionPath(archivePath) {
158
+ const archiveName = path.basename(archivePath, path.extname(archivePath));
159
+ try {
160
+ const extractionRoot = path.join(file_uri_1.FileUri.fsPath(await this.envVariablesServer.getConfigDirUri()), this.extractionFolder);
161
+ const extractionPath = path.join(extractionRoot, `${archiveName}-${this.getArchiveStamp(archivePath)}`);
162
+ await fs.promises.mkdir(extractionPath, { recursive: true, mode: 0o700 });
163
+ this.removeStaleExtractions(extractionRoot, `${archiveName}-`, extractionPath);
164
+ return extractionPath;
165
+ }
166
+ catch (error) {
167
+ this.logger.warn('Could not extract bundled resources into the configuration directory, using a temporary directory instead.', error);
168
+ return this.getTemporaryExtractionPath();
169
+ }
170
+ }
171
+ /**
172
+ * Fallback for applications whose configuration directory cannot be written to. The directory is unique to
173
+ * this run of the application, so that resources are extracted again whenever the application is started.
174
+ */
175
+ getTemporaryExtractionPath() {
176
+ return this.temporaryExtractionPath ??= fs.promises.mkdtemp(path.join(os.tmpdir(), 'theia-bundled-resources-'));
177
+ }
178
+ /**
179
+ * Identify the content of the given archive. `process.noAsar` is toggled around the synchronous `stat` call
180
+ * to get the stats of the archive file itself rather than of the directory that it appears as.
181
+ */
182
+ getArchiveStamp(archivePath) {
183
+ const asarProcess = process;
184
+ const noAsar = asarProcess.noAsar;
185
+ try {
186
+ asarProcess.noAsar = true;
187
+ const stat = fs.statSync(archivePath);
188
+ return crypto.createHash('sha256').update(`${archivePath}:${stat.size}:${stat.mtimeMs}`).digest('hex').substring(0, 12);
189
+ }
190
+ finally {
191
+ asarProcess.noAsar = noAsar;
192
+ }
193
+ }
194
+ /**
195
+ * Remove resources that were extracted from an earlier version of the archive, unless they were used
196
+ * recently, because another application instance may still be running on that version.
197
+ */
198
+ removeStaleExtractions(extractionRoot, prefix, currentPath) {
199
+ const removeStale = async () => {
200
+ for (const entry of await fs.promises.readdir(extractionRoot)) {
201
+ const entryPath = path.join(extractionRoot, entry);
202
+ if (!entry.startsWith(prefix) || entryPath === currentPath) {
203
+ continue;
204
+ }
205
+ const stat = await fs.promises.stat(entryPath);
206
+ if (Date.now() - stat.mtimeMs > this.staleExtractionAge) {
207
+ await fs.promises.rm(entryPath, { recursive: true, force: true });
208
+ this.logger.info(`Removed stale extracted resources: ${entryPath}`);
209
+ }
210
+ }
211
+ };
212
+ removeStale().catch(error => this.logger.warn(`Could not remove stale extracted resources in '${extractionRoot}'.`, error));
213
+ }
214
+ async exists(targetPath) {
215
+ try {
216
+ await fs.promises.stat(targetPath);
217
+ return true;
218
+ }
219
+ catch {
220
+ return false;
221
+ }
222
+ }
223
+ };
224
+ exports.BundledResourceProviderImpl = BundledResourceProviderImpl;
225
+ tslib_1.__decorate([
226
+ (0, inversify_1.inject)(logger_1.ILogger),
227
+ (0, inversify_1.named)('core:BundledResourceProviderImpl'),
228
+ tslib_1.__metadata("design:type", Object)
229
+ ], BundledResourceProviderImpl.prototype, "logger", void 0);
230
+ tslib_1.__decorate([
231
+ (0, inversify_1.inject)(env_variables_1.EnvVariablesServer),
232
+ tslib_1.__metadata("design:type", Object)
233
+ ], BundledResourceProviderImpl.prototype, "envVariablesServer", void 0);
234
+ tslib_1.__decorate([
235
+ (0, inversify_1.inject)(filesystem_locking_1.FileSystemLocking),
236
+ tslib_1.__metadata("design:type", Object)
237
+ ], BundledResourceProviderImpl.prototype, "fileSystemLocking", void 0);
238
+ exports.BundledResourceProviderImpl = BundledResourceProviderImpl = tslib_1.__decorate([
239
+ (0, inversify_1.injectable)()
240
+ ], BundledResourceProviderImpl);
241
+ //# sourceMappingURL=bundled-resource-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundled-resource-provider.js","sourceRoot":"","sources":["../../src/node/bundled-resource-provider.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;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,iCAAiC;AACjC,yBAAyB;AACzB,yBAAyB;AACzB,6BAA6B;AAC7B,yCAAkE;AAClE,2DAA6D;AAC7D,iDAA6C;AAC7C,6CAA2C;AAC3C,6DAAyD;AAE5C,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAA0D,CAAC;AA4B3H,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAAjC;QAWH,wFAAwF;QACrE,qBAAgB,GAAG,mBAAmB,CAAC;QAE1D,qGAAqG;QAClF,uBAAkB,GAAG,CAAC,GAAG,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AAE,CAAC,CAAC;oBAClE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,SAAS,EAAE,CAAC,CAAC;gBACxE,CAAC;YACL,CAAC;QACL,CAAC,CAAC;QACF,WAAW,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kDAAkD,cAAc,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAChI,CAAC;IAES,KAAK,CAAC,MAAM,CAAC,UAAkB;QACrC,IAAI,CAAC;YACD,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC;QAChB,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CAEJ,CAAA;AAnNY,kEAA2B;AAGjB;IADlB,IAAA,kBAAM,EAAC,gBAAO,CAAC;IAAE,IAAA,iBAAK,EAAC,kCAAkC,CAAC;;2DACxB;AAGhB;IADlB,IAAA,kBAAM,EAAC,kCAAkB,CAAC;;uEAC+B;AAGvC;IADlB,IAAA,kBAAM,EAAC,sCAAiB,CAAC;;sEAC8B;sCAT/C,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CAmNvC"}
@@ -0,0 +1,2 @@
1
+ import 'reflect-metadata';
2
+ //# sourceMappingURL=bundled-resource-provider.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundled-resource-provider.spec.d.ts","sourceRoot":"","sources":["../../src/node/bundled-resource-provider.spec.ts"],"names":[],"mappings":"AAgBA,OAAO,kBAAkB,CAAC"}
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource GmbH and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ require("reflect-metadata");
19
+ const chai_1 = require("chai");
20
+ const fs = require("fs");
21
+ const os = require("os");
22
+ const path = require("path");
23
+ const temp = require("temp");
24
+ const inversify_1 = require("inversify");
25
+ const env_variables_1 = require("../common/env-variables");
26
+ const logger_1 = require("../common/logger");
27
+ const mock_logger_1 = require("../common/test/mock-logger");
28
+ const file_uri_1 = require("../common/file-uri");
29
+ const bundled_resource_provider_1 = require("./bundled-resource-provider");
30
+ const filesystem_locking_1 = require("./filesystem-locking");
31
+ /**
32
+ * The provider recognizes archives by their `.asar` path segment and reads them through `fs`, which Electron
33
+ * patches to transparently read from the archive. Plain directories named `*.asar` therefore behave like
34
+ * archives from the point of view of the provider and let us test it outside of Electron.
35
+ */
36
+ describe('BundledResourceProvider', () => {
37
+ const track = temp.track();
38
+ let configDir;
39
+ let appDir;
40
+ let provider;
41
+ beforeEach(() => {
42
+ const root = track.mkdirSync();
43
+ configDir = path.join(root, 'config');
44
+ appDir = path.join(root, 'app');
45
+ fs.mkdirSync(configDir);
46
+ fs.mkdirSync(appDir);
47
+ provider = createProvider();
48
+ });
49
+ /** Each provider instance stands for one run of the application, as resolved paths are cached. */
50
+ function createProvider() {
51
+ const container = new inversify_1.Container();
52
+ container.bind(logger_1.ILogger).toConstantValue(new mock_logger_1.MockLogger());
53
+ container.bind(filesystem_locking_1.FileSystemLocking).to(filesystem_locking_1.FileSystemLockingImpl).inSingletonScope();
54
+ container.bind(env_variables_1.EnvVariablesServer).toConstantValue({
55
+ getConfigDirUri: async () => file_uri_1.FileUri.create(configDir).toString()
56
+ });
57
+ container.bind(bundled_resource_provider_1.BundledResourceProviderImpl).toSelf().inSingletonScope();
58
+ container.bind(bundled_resource_provider_1.BundledResourceProvider).toService(bundled_resource_provider_1.BundledResourceProviderImpl);
59
+ return container.get(bundled_resource_provider_1.BundledResourceProvider);
60
+ }
61
+ afterEach(() => track.cleanupSync());
62
+ /**
63
+ * Assert that the given path is nested in the given directory. The provider derives the configuration
64
+ * directory from a URI, which on Windows yields a lower-case drive letter, so the paths cannot simply be
65
+ * compared by prefix. `path.relative` ignores the case of a path on Windows.
66
+ */
67
+ function expectNestedIn(directoryPath, nestedPath) {
68
+ const relativePath = path.relative(directoryPath, nestedPath);
69
+ (0, chai_1.expect)(relativePath).to.not.be.empty;
70
+ (0, chai_1.expect)(relativePath.split(path.sep)).to.not.contain('..');
71
+ }
72
+ function writeResources(rootPath, files) {
73
+ for (const [relativePath, content] of Object.entries(files)) {
74
+ const filePath = path.join(rootPath, relativePath);
75
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
76
+ fs.writeFileSync(filePath, content);
77
+ }
78
+ return rootPath;
79
+ }
80
+ it('returns the path of a resource that is not packaged into an archive', async () => {
81
+ const resourcePath = path.join(writeResources(appDir, { 'scripts/greet.sh': 'echo hello' }), 'scripts');
82
+ (0, chai_1.expect)(await provider.resolveExternalPath(resourcePath)).to.equal(resourcePath);
83
+ });
84
+ it('rejects for a resource that does not exist', async () => {
85
+ const resourcePath = path.join(appDir, 'scripts');
86
+ await provider.resolveExternalPath(resourcePath).then(() => chai_1.expect.fail('should have been rejected'), error => (0, chai_1.expect)(String(error)).to.contain(resourcePath));
87
+ });
88
+ it('extracts a packaged resource into the configuration directory', async () => {
89
+ const archivePath = path.join(appDir, 'app.asar');
90
+ writeResources(archivePath, { 'scripts/greet.sh': 'echo hello', 'scripts/nested/.hidden': 'secret' });
91
+ const resolvedPath = await provider.resolveExternalPath(path.join(archivePath, 'scripts'));
92
+ (0, chai_1.expect)(resolvedPath).to.not.contain('.asar');
93
+ expectNestedIn(configDir, resolvedPath);
94
+ (0, chai_1.expect)(fs.readFileSync(path.join(resolvedPath, 'greet.sh'), 'utf8')).to.equal('echo hello');
95
+ (0, chai_1.expect)(fs.readFileSync(path.join(resolvedPath, 'nested', '.hidden'), 'utf8')).to.equal('secret');
96
+ });
97
+ it('extracts a packaged resource that is a plain file', async () => {
98
+ const archivePath = path.join(appDir, 'app.asar');
99
+ writeResources(archivePath, { 'scripts/greet.sh': 'echo hello' });
100
+ const resolvedPath = await provider.resolveExternalPath(path.join(archivePath, 'scripts', 'greet.sh'));
101
+ expectNestedIn(configDir, resolvedPath);
102
+ (0, chai_1.expect)(fs.readFileSync(resolvedPath, 'utf8')).to.equal('echo hello');
103
+ });
104
+ it('extracts a packaged file as executable', async function () {
105
+ if (process.platform === 'win32') {
106
+ this.skip();
107
+ }
108
+ // Electron reports the files of an asar archive with this mode, even executables.
109
+ const archivePath = path.join(appDir, 'app.asar');
110
+ writeResources(archivePath, { 'native/tool': 'binary' });
111
+ fs.chmodSync(path.join(archivePath, 'native', 'tool'), 0o644);
112
+ const resolvedPath = await provider.resolveExternalPath(path.join(archivePath, 'native', 'tool'));
113
+ (0, chai_1.expect)(fs.statSync(resolvedPath).mode & 0o700).to.equal(0o700);
114
+ });
115
+ it('prefers the copy that the packaging step has left outside of the archive', async () => {
116
+ const archivePath = path.join(appDir, 'app.asar');
117
+ writeResources(archivePath, { 'scripts/greet.sh': 'echo hello' });
118
+ const unpackedPath = writeResources(`${archivePath}.unpacked`, { 'scripts/greet.sh': 'echo hello' });
119
+ const resolvedPath = await provider.resolveExternalPath(path.join(archivePath, 'scripts'));
120
+ (0, chai_1.expect)(resolvedPath).to.equal(path.join(unpackedPath, 'scripts'));
121
+ });
122
+ it('extracts a packaged resource that was only unpacked partially', async () => {
123
+ const archivePath = path.join(appDir, 'app.asar');
124
+ writeResources(archivePath, { 'scripts/greet.sh': 'echo hello', 'scripts/farewell.sh': 'echo bye' });
125
+ writeResources(`${archivePath}.unpacked`, { 'scripts/greet.sh': 'echo hello' });
126
+ const resolvedPath = await provider.resolveExternalPath(path.join(archivePath, 'scripts'));
127
+ expectNestedIn(configDir, resolvedPath);
128
+ (0, chai_1.expect)(fs.readFileSync(path.join(resolvedPath, 'farewell.sh'), 'utf8')).to.equal('echo bye');
129
+ });
130
+ it('re-extracts a resource that was removed from the configuration directory', async () => {
131
+ const archivePath = path.join(appDir, 'app.asar');
132
+ writeResources(archivePath, { 'scripts/greet.sh': 'echo hello' });
133
+ const resourcePath = path.join(archivePath, 'scripts');
134
+ const resolvedPath = await provider.resolveExternalPath(resourcePath);
135
+ fs.rmSync(resolvedPath, { recursive: true });
136
+ (0, chai_1.expect)(await provider.resolveExternalPath(resourcePath)).to.equal(resolvedPath);
137
+ (0, chai_1.expect)(fs.readFileSync(path.join(resolvedPath, 'greet.sh'), 'utf8')).to.equal('echo hello');
138
+ });
139
+ it('extracts into a temporary directory if the configuration directory cannot be written to', async () => {
140
+ const archivePath = path.join(appDir, 'app.asar');
141
+ writeResources(archivePath, { 'scripts/greet.sh': 'echo hello' });
142
+ // a configuration directory that is a regular file cannot hold the extracted resources
143
+ configDir = path.join(appDir, 'not-a-directory');
144
+ fs.writeFileSync(configDir, '');
145
+ const resolvedPath = await createProvider().resolveExternalPath(path.join(archivePath, 'scripts'));
146
+ expectNestedIn(os.tmpdir(), resolvedPath);
147
+ (0, chai_1.expect)(fs.readFileSync(path.join(resolvedPath, 'greet.sh'), 'utf8')).to.equal('echo hello');
148
+ fs.rmSync(resolvedPath, { recursive: true, force: true });
149
+ });
150
+ it('updates an extracted resource when the application has been updated', async () => {
151
+ const archivePath = path.join(appDir, 'app.asar');
152
+ writeResources(archivePath, { 'scripts/greet.sh': 'echo hello' });
153
+ const resourcePath = path.join(archivePath, 'scripts');
154
+ await provider.resolveExternalPath(resourcePath);
155
+ writeResources(archivePath, { 'scripts/greet.sh': 'echo hello again' });
156
+ const resolvedPath = await createProvider().resolveExternalPath(resourcePath);
157
+ (0, chai_1.expect)(fs.readFileSync(path.join(resolvedPath, 'greet.sh'), 'utf8')).to.equal('echo hello again');
158
+ });
159
+ });
160
+ //# sourceMappingURL=bundled-resource-provider.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundled-resource-provider.spec.js","sourceRoot":"","sources":["../../src/node/bundled-resource-provider.spec.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;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,4BAA0B;AAC1B,+BAA8B;AAC9B,yBAAyB;AACzB,yBAAyB;AACzB,6BAA6B;AAC7B,6BAA6B;AAC7B,yCAAsC;AACtC,2DAA6D;AAC7D,6CAA2C;AAC3C,4DAAwD;AACxD,iDAA6C;AAC7C,2EAAmG;AACnG,6DAAgF;AAEhF;;;;GAIG;AACH,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IAErC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAE3B,IAAI,SAAiB,CAAC;IACtB,IAAI,MAAc,CAAC;IACnB,IAAI,QAAiC,CAAC;IAEtC,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC/B,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACtC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAChC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QACxB,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACrB,QAAQ,GAAG,cAAc,EAAE,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH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E;QACjF,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAClD,cAAc,CAAC,WAAW,EAAE,EAAE,kBAAkB,EAAE,YAAY,EAAE,CAAC,CAAC;QAClE,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QAEvD,MAAM,QAAQ,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACjD,cAAc,CAAC,WAAW,EAAE,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC,CAAC;QACxE,MAAM,YAAY,GAAG,MAAM,cAAc,EAAE,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAE9E,IAAA,aAAM,EAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACtG,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
@@ -6,6 +6,7 @@ export * from './messaging';
6
6
  export * from './cli';
7
7
  export * from './setting-service';
8
8
  export { FileSystemLocking } from './filesystem-locking';
9
+ export { BundledResourceProvider } from './bundled-resource-provider';
9
10
  export { BackendRequestAllowedContribution } from './request/backend-request-facade';
10
11
  export { HttpConnectionValidator } from './hosting/browser-connection-token';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAgBA,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAgBA,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC"}
package/lib/node/index.js CHANGED
@@ -15,7 +15,7 @@
15
15
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
16
  // *****************************************************************************
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.HttpConnectionValidator = exports.BackendRequestAllowedContribution = exports.FileSystemLocking = void 0;
18
+ exports.HttpConnectionValidator = exports.BackendRequestAllowedContribution = exports.BundledResourceProvider = exports.FileSystemLocking = void 0;
19
19
  const tslib_1 = require("tslib");
20
20
  tslib_1.__exportStar(require("./backend-application"), exports);
21
21
  tslib_1.__exportStar(require("./backend-global"), exports);
@@ -26,6 +26,8 @@ tslib_1.__exportStar(require("./cli"), exports);
26
26
  tslib_1.__exportStar(require("./setting-service"), exports);
27
27
  var filesystem_locking_1 = require("./filesystem-locking");
28
28
  Object.defineProperty(exports, "FileSystemLocking", { enumerable: true, get: function () { return filesystem_locking_1.FileSystemLocking; } });
29
+ var bundled_resource_provider_1 = require("./bundled-resource-provider");
30
+ Object.defineProperty(exports, "BundledResourceProvider", { enumerable: true, get: function () { return bundled_resource_provider_1.BundledResourceProvider; } });
29
31
  var backend_request_facade_1 = require("./request/backend-request-facade");
30
32
  Object.defineProperty(exports, "BackendRequestAllowedContribution", { enumerable: true, get: function () { return backend_request_facade_1.BackendRequestAllowedContribution; } });
31
33
  var browser_connection_token_1 = require("./hosting/browser-connection-token");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,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,gEAAsC;AACtC,2DAAiC;AACjC,kDAAwB;AACxB,6DAAmC;AACnC,sDAA4B;AAC5B,gDAAsB;AACtB,4DAAkC;AAClC,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,2EAAqF;AAA5E,2IAAA,iCAAiC,OAAA;AAC1C,+EAA6E;AAApE,mIAAA,uBAAuB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,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,gEAAsC;AACtC,2DAAiC;AACjC,kDAAwB;AACxB,6DAAmC;AACnC,sDAA4B;AAC5B,gDAAsB;AACtB,4DAAkC;AAClC,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,yEAAsE;AAA7D,oIAAA,uBAAuB,OAAA;AAChC,2EAAqF;AAA5E,2IAAA,iCAAiC,OAAA;AAC1C,+EAA6E;AAApE,mIAAA,uBAAuB,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/core",
3
- "version": "1.77.0-next.0+d8106d7ff",
3
+ "version": "1.77.0-next.4+4f24ee401",
4
4
  "description": "Theia is a cloud & desktop IDE framework implemented in TypeScript.",
5
5
  "main": "lib/common/index.js",
6
6
  "typings": "lib/common/index.d.ts",
@@ -17,8 +17,8 @@
17
17
  "@lumino/virtualdom": "^2.0.5",
18
18
  "@lumino/widgets": "2.7.5",
19
19
  "@parcel/watcher": "^2.6.0",
20
- "@theia/application-package": "1.77.0-next.0+d8106d7ff",
21
- "@theia/request": "1.77.0-next.0+d8106d7ff",
20
+ "@theia/application-package": "1.77.0-next.4+4f24ee401",
21
+ "@theia/request": "1.77.0-next.4+4f24ee401",
22
22
  "@types/body-parser": "^1.19.6",
23
23
  "@types/express": "^4.17.25",
24
24
  "@types/fs-extra": "^4.0.15",
@@ -233,5 +233,5 @@
233
233
  "nyc": {
234
234
  "extends": "../../configs/nyc.json"
235
235
  },
236
- "gitHead": "d8106d7ffa62b3413ff1ca5b63a0e6c2fe0b0649"
236
+ "gitHead": "4f24ee40105b8c53808c8293c41387304d15960c"
237
237
  }