@theia/remote 1.77.0-next.99 → 1.78.0-next.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/electron-browser/local-backend-services.js +21 -26
- package/lib/electron-browser/local-backend-services.js.map +1 -1
- package/lib/electron-browser/port-forwarding/port-forwading-contribution.d.ts +1 -1
- package/lib/electron-browser/port-forwarding/port-forwading-contribution.d.ts.map +1 -1
- package/lib/electron-browser/port-forwarding/port-forwading-contribution.js +14 -18
- package/lib/electron-browser/port-forwarding/port-forwading-contribution.js.map +1 -1
- package/lib/electron-browser/port-forwarding/port-forwarding-service.d.ts +1 -1
- package/lib/electron-browser/port-forwarding/port-forwarding-service.d.ts.map +1 -1
- package/lib/electron-browser/port-forwarding/port-forwarding-service.js +14 -21
- package/lib/electron-browser/port-forwarding/port-forwarding-service.js.map +1 -1
- package/lib/electron-browser/port-forwarding/port-forwarding-widget.d.ts +1 -1
- package/lib/electron-browser/port-forwarding/port-forwarding-widget.d.ts.map +1 -1
- package/lib/electron-browser/port-forwarding/port-forwarding-widget.js +34 -43
- package/lib/electron-browser/port-forwarding/port-forwarding-widget.js.map +1 -1
- package/lib/electron-browser/remote-cli-args-collector.js +13 -18
- package/lib/electron-browser/remote-cli-args-collector.js.map +1 -1
- package/lib/electron-browser/remote-cli-args-collector.spec.js +5 -7
- package/lib/electron-browser/remote-cli-args-collector.spec.js.map +1 -1
- package/lib/electron-browser/remote-electron-file-dialog-service.d.ts +1 -1
- package/lib/electron-browser/remote-electron-file-dialog-service.d.ts.map +1 -1
- package/lib/electron-browser/remote-electron-file-dialog-service.js +17 -21
- package/lib/electron-browser/remote-electron-file-dialog-service.js.map +1 -1
- package/lib/electron-browser/remote-frontend-contribution.d.ts +3 -3
- package/lib/electron-browser/remote-frontend-contribution.d.ts.map +1 -1
- package/lib/electron-browser/remote-frontend-contribution.js +38 -48
- package/lib/electron-browser/remote-frontend-contribution.js.map +1 -1
- package/lib/electron-browser/remote-frontend-module.js +61 -63
- package/lib/electron-browser/remote-frontend-module.js.map +1 -1
- package/lib/electron-browser/remote-local-workspace-contribution.d.ts +1 -1
- package/lib/electron-browser/remote-local-workspace-contribution.d.ts.map +1 -1
- package/lib/electron-browser/remote-local-workspace-contribution.js +26 -33
- package/lib/electron-browser/remote-local-workspace-contribution.js.map +1 -1
- package/lib/electron-browser/remote-registry-contribution.js +12 -17
- package/lib/electron-browser/remote-registry-contribution.js.map +1 -1
- package/lib/electron-browser/remote-service.js +5 -8
- package/lib/electron-browser/remote-service.js.map +1 -1
- package/lib/electron-browser/remote-ssh-contribution.d.ts +3 -3
- package/lib/electron-browser/remote-ssh-contribution.d.ts.map +1 -1
- package/lib/electron-browser/remote-ssh-contribution.js +41 -47
- package/lib/electron-browser/remote-ssh-contribution.js.map +1 -1
- package/lib/electron-browser/remote-user-storage-provider.d.ts +2 -2
- package/lib/electron-browser/remote-user-storage-provider.d.ts.map +1 -1
- package/lib/electron-browser/remote-user-storage-provider.js +23 -33
- package/lib/electron-browser/remote-user-storage-provider.js.map +1 -1
- package/lib/electron-common/remote-port-forwarding-provider.js +2 -5
- package/lib/electron-common/remote-port-forwarding-provider.js.map +1 -1
- package/lib/electron-common/remote-preferences.js +20 -24
- package/lib/electron-common/remote-preferences.js.map +1 -1
- package/lib/electron-common/remote-ssh-connection-provider.js +2 -5
- package/lib/electron-common/remote-ssh-connection-provider.js.map +1 -1
- package/lib/electron-common/remote-status-service.js +2 -5
- package/lib/electron-common/remote-status-service.js.map +1 -1
- package/lib/electron-node/backend-remote-service-impl.js +10 -13
- package/lib/electron-node/backend-remote-service-impl.js.map +1 -1
- package/lib/electron-node/remote-auto-shutdown-service.js +15 -19
- package/lib/electron-node/remote-auto-shutdown-service.js.map +1 -1
- package/lib/electron-node/remote-auto-shutdown-service.spec.js +28 -30
- package/lib/electron-node/remote-auto-shutdown-service.spec.js.map +1 -1
- package/lib/electron-node/remote-backend-module.js +69 -72
- package/lib/electron-node/remote-backend-module.js.map +1 -1
- package/lib/electron-node/remote-connection-service.d.ts +3 -3
- package/lib/electron-node/remote-connection-service.d.ts.map +1 -1
- package/lib/electron-node/remote-connection-service.js +13 -18
- package/lib/electron-node/remote-connection-service.js.map +1 -1
- package/lib/electron-node/remote-connection-socket-provider.js +7 -10
- package/lib/electron-node/remote-connection-socket-provider.js.map +1 -1
- package/lib/electron-node/remote-port-forwarding-provider.d.ts +3 -3
- package/lib/electron-node/remote-port-forwarding-provider.d.ts.map +1 -1
- package/lib/electron-node/remote-port-forwarding-provider.js +10 -14
- package/lib/electron-node/remote-port-forwarding-provider.js.map +1 -1
- package/lib/electron-node/remote-proxy-server-provider.js +8 -11
- package/lib/electron-node/remote-proxy-server-provider.js.map +1 -1
- package/lib/electron-node/remote-status-service.d.ts +2 -2
- package/lib/electron-node/remote-status-service.d.ts.map +1 -1
- package/lib/electron-node/remote-status-service.js +8 -12
- package/lib/electron-node/remote-status-service.js.map +1 -1
- package/lib/electron-node/remote-types.js +1 -2
- package/lib/electron-node/remote-types.js.map +1 -1
- package/lib/electron-node/setup/app-native-dependency-contribution.d.ts +1 -1
- package/lib/electron-node/setup/app-native-dependency-contribution.d.ts.map +1 -1
- package/lib/electron-node/setup/app-native-dependency-contribution.js +13 -16
- package/lib/electron-node/setup/app-native-dependency-contribution.js.map +1 -1
- package/lib/electron-node/setup/app-native-dependency-contribution.spec.js +14 -16
- package/lib/electron-node/setup/app-native-dependency-contribution.spec.js.map +1 -1
- package/lib/electron-node/setup/main-copy-contribution.d.ts.map +1 -1
- package/lib/electron-node/setup/main-copy-contribution.js +8 -8
- package/lib/electron-node/setup/main-copy-contribution.js.map +1 -1
- package/lib/electron-node/setup/main-copy-contribution.spec.d.ts +2 -0
- package/lib/electron-node/setup/main-copy-contribution.spec.d.ts.map +1 -0
- package/lib/electron-node/setup/main-copy-contribution.spec.js +54 -0
- package/lib/electron-node/setup/main-copy-contribution.spec.js.map +1 -0
- package/lib/electron-node/setup/remote-copy-contribution.d.ts.map +1 -1
- package/lib/electron-node/setup/remote-copy-contribution.js +13 -16
- package/lib/electron-node/setup/remote-copy-contribution.js.map +1 -1
- package/lib/electron-node/setup/remote-copy-service.d.ts +3 -3
- package/lib/electron-node/setup/remote-copy-service.d.ts.map +1 -1
- package/lib/electron-node/setup/remote-copy-service.js +24 -31
- package/lib/electron-node/setup/remote-copy-service.js.map +1 -1
- package/lib/electron-node/setup/remote-native-dependency-contribution.js +8 -11
- package/lib/electron-node/setup/remote-native-dependency-contribution.js.map +1 -1
- package/lib/electron-node/setup/remote-native-dependency-service.d.ts +3 -1
- package/lib/electron-node/setup/remote-native-dependency-service.d.ts.map +1 -1
- package/lib/electron-node/setup/remote-native-dependency-service.js +30 -50
- package/lib/electron-node/setup/remote-native-dependency-service.js.map +1 -1
- package/lib/electron-node/setup/remote-native-dependency-service.spec.d.ts +2 -0
- package/lib/electron-node/setup/remote-native-dependency-service.spec.d.ts.map +1 -0
- package/lib/electron-node/setup/remote-native-dependency-service.spec.js +96 -0
- package/lib/electron-node/setup/remote-native-dependency-service.spec.js.map +1 -0
- package/lib/electron-node/setup/remote-node-setup-service.d.ts +1 -1
- package/lib/electron-node/setup/remote-node-setup-service.d.ts.map +1 -1
- package/lib/electron-node/setup/remote-node-setup-service.js +25 -30
- package/lib/electron-node/setup/remote-node-setup-service.js.map +1 -1
- package/lib/electron-node/setup/remote-setup-script-service.js +17 -22
- package/lib/electron-node/setup/remote-setup-script-service.js.map +1 -1
- package/lib/electron-node/setup/remote-setup-service.d.ts +5 -5
- package/lib/electron-node/setup/remote-setup-service.d.ts.map +1 -1
- package/lib/electron-node/setup/remote-setup-service.js +33 -42
- package/lib/electron-node/setup/remote-setup-service.js.map +1 -1
- package/lib/electron-node/ssh/remote-ssh-connection-provider.d.ts +12 -9
- package/lib/electron-node/ssh/remote-ssh-connection-provider.d.ts.map +1 -1
- package/lib/electron-node/ssh/remote-ssh-connection-provider.js +43 -51
- package/lib/electron-node/ssh/remote-ssh-connection-provider.js.map +1 -1
- package/lib/electron-node/ssh/remote-ssh-connection-provider.spec.js +26 -27
- package/lib/electron-node/ssh/remote-ssh-connection-provider.spec.js.map +1 -1
- package/lib/electron-node/ssh/ssh-identity-file-collector.d.ts.map +1 -1
- package/lib/electron-node/ssh/ssh-identity-file-collector.js +15 -18
- package/lib/electron-node/ssh/ssh-identity-file-collector.js.map +1 -1
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.js +1 -1
- package/lib/package.spec.js.map +1 -1
- package/package.json +16 -13
- package/src/electron-browser/port-forwarding/port-forwading-contribution.ts +1 -1
- package/src/electron-browser/port-forwarding/port-forwarding-service.ts +1 -1
- package/src/electron-browser/port-forwarding/port-forwarding-widget.tsx +1 -1
- package/src/electron-browser/remote-cli-args-collector.spec.ts +1 -1
- package/src/electron-browser/remote-electron-file-dialog-service.ts +2 -2
- package/src/electron-browser/remote-frontend-contribution.ts +3 -3
- package/src/electron-browser/remote-frontend-module.ts +16 -16
- package/src/electron-browser/remote-local-workspace-contribution.ts +2 -2
- package/src/electron-browser/remote-ssh-contribution.ts +7 -4
- package/src/electron-browser/remote-user-storage-provider.ts +2 -2
- package/src/electron-node/remote-auto-shutdown-service.spec.ts +1 -1
- package/src/electron-node/remote-backend-module.ts +22 -22
- package/src/electron-node/remote-connection-service.ts +3 -3
- package/src/electron-node/remote-port-forwarding-provider.ts +3 -3
- package/src/electron-node/remote-status-service.ts +2 -2
- package/src/electron-node/setup/app-native-dependency-contribution.spec.ts +1 -1
- package/src/electron-node/setup/app-native-dependency-contribution.ts +1 -1
- package/src/electron-node/setup/main-copy-contribution.spec.ts +62 -0
- package/src/electron-node/setup/main-copy-contribution.ts +3 -0
- package/src/electron-node/setup/remote-copy-contribution.ts +3 -2
- package/src/electron-node/setup/remote-copy-service.ts +3 -3
- package/src/electron-node/setup/remote-native-dependency-service.spec.ts +106 -0
- package/src/electron-node/setup/remote-native-dependency-service.ts +10 -24
- package/src/electron-node/setup/remote-node-setup-service.ts +1 -1
- package/src/electron-node/setup/remote-setup-service.ts +5 -5
- package/src/electron-node/ssh/remote-ssh-connection-provider.spec.ts +6 -2
- package/src/electron-node/ssh/remote-ssh-connection-provider.ts +14 -9
- package/src/electron-node/ssh/ssh-identity-file-collector.ts +2 -2
- package/src/typings/decompress-plugins.d.ts +30 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ApplicationPackage } from '@theia/core/shared/@theia/application-package';
|
|
2
|
-
import { RemoteConnection } from '../remote-types';
|
|
2
|
+
import { RemoteConnection } from '../remote-types.js';
|
|
3
3
|
import { RemotePlatform } from '@theia/core/lib/node/remote/remote-cli-contribution';
|
|
4
|
-
import { RemoteNativeDependencyService } from './remote-native-dependency-service';
|
|
4
|
+
import { RemoteNativeDependencyService } from './remote-native-dependency-service.js';
|
|
5
5
|
import { ContributionProvider } from '@theia/core';
|
|
6
|
-
import { RemoteCopyRegistryImpl } from './remote-copy-contribution';
|
|
6
|
+
import { RemoteCopyRegistryImpl } from './remote-copy-contribution.js';
|
|
7
7
|
import { RemoteCopyContribution, RemoteFile } from '@theia/core/lib/node/remote/remote-copy-contribution';
|
|
8
8
|
export declare class RemoteCopyService {
|
|
9
9
|
protected readonly applicationPackage: ApplicationPackage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-copy-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-copy-service.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"remote-copy-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-copy-service.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAC;AAE1G,qBACa,iBAAiB;IAG1B,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAG1D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,sBAAsB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,uBAAuB,EAAE,6BAA6B,CAAC;IAG1E,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,CAAC;IAEnF,SAAS,CAAC,WAAW,UAAS;IAExB,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cA+BhG,QAAQ,CAAC,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;cAQhF,qBAAqB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;cAU9C,sBAAsB,CAAC,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;cAW9F,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;cAM7B,yBAAyB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAG3E"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2023 TypeFox and others.
|
|
4
3
|
//
|
|
@@ -14,19 +13,17 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const remote_copy_contribution_1 = require("./remote-copy-contribution");
|
|
29
|
-
const remote_copy_contribution_2 = require("@theia/core/lib/node/remote/remote-copy-contribution");
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import archiver from 'archiver';
|
|
18
|
+
import * as path from 'path';
|
|
19
|
+
import * as fs from 'fs';
|
|
20
|
+
import * as os from 'os';
|
|
21
|
+
import { ApplicationPackage } from '@theia/core/shared/@theia/application-package';
|
|
22
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
23
|
+
import { RemoteNativeDependencyService } from './remote-native-dependency-service.js';
|
|
24
|
+
import { ContributionProvider } from '@theia/core';
|
|
25
|
+
import { RemoteCopyRegistryImpl } from './remote-copy-contribution.js';
|
|
26
|
+
import { RemoteCopyContribution } from '@theia/core/lib/node/remote/remote-copy-contribution';
|
|
30
27
|
let RemoteCopyService = class RemoteCopyService {
|
|
31
28
|
constructor() {
|
|
32
29
|
this.initialized = false;
|
|
@@ -40,7 +37,7 @@ let RemoteCopyService = class RemoteCopyService {
|
|
|
40
37
|
// We stream to a file here and then copy it because it is faster
|
|
41
38
|
// Copying files via sftp is 4x times faster compared to readable streams
|
|
42
39
|
const stream = fs.createWriteStream(zipPath);
|
|
43
|
-
const archive = (
|
|
40
|
+
const archive = archiver('tar', {
|
|
44
41
|
gzip: true
|
|
45
42
|
});
|
|
46
43
|
archive.pipe(stream);
|
|
@@ -95,25 +92,21 @@ let RemoteCopyService = class RemoteCopyService {
|
|
|
95
92
|
return undefined;
|
|
96
93
|
}
|
|
97
94
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
(0, inversify_1.inject)(application_package_1.ApplicationPackage),
|
|
101
|
-
tslib_1.__metadata("design:type", application_package_1.ApplicationPackage)
|
|
95
|
+
__decorate([
|
|
96
|
+
inject(ApplicationPackage)
|
|
102
97
|
], RemoteCopyService.prototype, "applicationPackage", void 0);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
tslib_1.__metadata("design:type", remote_copy_contribution_1.RemoteCopyRegistryImpl)
|
|
98
|
+
__decorate([
|
|
99
|
+
inject(RemoteCopyRegistryImpl)
|
|
106
100
|
], RemoteCopyService.prototype, "copyRegistry", void 0);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
tslib_1.__metadata("design:type", remote_native_dependency_service_1.RemoteNativeDependencyService)
|
|
101
|
+
__decorate([
|
|
102
|
+
inject(RemoteNativeDependencyService)
|
|
110
103
|
], RemoteCopyService.prototype, "nativeDependencyService", void 0);
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
tslib_1.__metadata("design:type", Object)
|
|
104
|
+
__decorate([
|
|
105
|
+
inject(ContributionProvider),
|
|
106
|
+
named(RemoteCopyContribution)
|
|
115
107
|
], RemoteCopyService.prototype, "copyContributions", void 0);
|
|
116
|
-
|
|
117
|
-
|
|
108
|
+
RemoteCopyService = __decorate([
|
|
109
|
+
injectable()
|
|
118
110
|
], RemoteCopyService);
|
|
111
|
+
export { RemoteCopyService };
|
|
119
112
|
//# sourceMappingURL=remote-copy-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-copy-service.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-copy-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-copy-service.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-copy-service.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;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@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2023 TypeFox and others.
|
|
4
3
|
//
|
|
@@ -14,22 +13,20 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const core_1 = require("@theia/core");
|
|
20
|
-
var FileDependencyResult;
|
|
16
|
+
import { isObject } from '@theia/core';
|
|
17
|
+
export var FileDependencyResult;
|
|
21
18
|
(function (FileDependencyResult) {
|
|
22
19
|
function is(item) {
|
|
23
|
-
return
|
|
20
|
+
return isObject(item) && 'buffer' in item && 'file' in item;
|
|
24
21
|
}
|
|
25
22
|
FileDependencyResult.is = is;
|
|
26
|
-
})(FileDependencyResult || (
|
|
27
|
-
var DirectoryDependencyDownload;
|
|
23
|
+
})(FileDependencyResult || (FileDependencyResult = {}));
|
|
24
|
+
export var DirectoryDependencyDownload;
|
|
28
25
|
(function (DirectoryDependencyDownload) {
|
|
29
26
|
function is(item) {
|
|
30
|
-
return
|
|
27
|
+
return isObject(item) && 'buffer' in item && 'archive' in item;
|
|
31
28
|
}
|
|
32
29
|
DirectoryDependencyDownload.is = is;
|
|
33
|
-
})(DirectoryDependencyDownload || (
|
|
34
|
-
|
|
30
|
+
})(DirectoryDependencyDownload || (DirectoryDependencyDownload = {}));
|
|
31
|
+
export const RemoteNativeDependencyContribution = Symbol('RemoteNativeDependencyContribution');
|
|
35
32
|
//# sourceMappingURL=remote-native-dependency-contribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-native-dependency-contribution.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-contribution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-native-dependency-contribution.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-contribution.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,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAgBvC,MAAM,KAAW,oBAAoB,CAIpC;AAJD,WAAiB,oBAAoB;IACjC,SAAgB,EAAE,CAAC,IAAa;QAC5B,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,CAAC;IAChE,CAAC;IAFe,uBAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,oBAAoB,KAApB,oBAAoB,QAIpC;AAOD,MAAM,KAAW,2BAA2B,CAI3C;AAJD,WAAiB,2BAA2B;IACxC,SAAgB,EAAE,CAAC,IAAa;QAC5B,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC;IACnE,CAAC;IAFe,8BAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,2BAA2B,KAA3B,2BAA2B,QAI3C;AAQD,MAAM,CAAC,MAAM,kCAAkC,GAAG,MAAM,CAAC,oCAAoC,CAAC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ContributionProvider } from '@theia/core';
|
|
2
2
|
import { RequestService, RequestOptions } from '@theia/core/shared/@theia/request';
|
|
3
|
-
import { DependencyDownload, RemoteNativeDependencyContribution } from './remote-native-dependency-contribution';
|
|
3
|
+
import { DependencyDownload, RemoteNativeDependencyContribution } from './remote-native-dependency-contribution.js';
|
|
4
4
|
import { RemotePlatform } from '@theia/core/lib/node/remote/remote-cli-contribution';
|
|
5
|
+
import { ArchiveExtractor } from '@theia/filesystem/lib/node/archive/archive-extractor';
|
|
5
6
|
export declare const DEFAULT_HTTP_OPTIONS: {
|
|
6
7
|
method: string;
|
|
7
8
|
headers: {
|
|
@@ -16,6 +17,7 @@ export interface NativeDependencyFile {
|
|
|
16
17
|
export declare class RemoteNativeDependencyService {
|
|
17
18
|
protected nativeDependencyContributions: ContributionProvider<RemoteNativeDependencyContribution>;
|
|
18
19
|
protected requestService: RequestService;
|
|
20
|
+
protected archiveExtractor: ArchiveExtractor;
|
|
19
21
|
downloadDependencies(remotePlatform: RemotePlatform, directory: string): Promise<NativeDependencyFile[]>;
|
|
20
22
|
protected downloadDependency(downloadURI: string | RequestOptions): Promise<Buffer>;
|
|
21
23
|
protected storeDependency(dependency: DependencyDownload, directory: string): Promise<NativeDependencyFile[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-native-dependency-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAiB,MAAM,aAAa,CAAC;AAElE,OAAO,EAAkB,cAAc,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"remote-native-dependency-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAiB,MAAM,aAAa,CAAC;AAElE,OAAO,EAAkB,cAAc,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGnG,OAAO,EAAE,kBAAkB,EAA+B,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AACjJ,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAExF,eAAO,MAAM,oBAAoB;;;;;CAKhC,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBACa,6BAA6B;IAGtC,SAAS,CAAC,6BAA6B,EAAE,oBAAoB,CAAC,kCAAkC,CAAC,CAAC;IAGlG,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAGzC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAEvC,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;cAc9F,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;cAgBzE,eAAe,CAAC,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAoBtH"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2023 TypeFox and others.
|
|
4
3
|
//
|
|
@@ -14,20 +13,15 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
const remote_native_dependency_contribution_1 = require("./remote-native-dependency-contribution");
|
|
27
|
-
const decompressTar = require('decompress-tar');
|
|
28
|
-
const decompressTargz = require('decompress-targz');
|
|
29
|
-
const decompressUnzip = require('decompress-unzip');
|
|
30
|
-
exports.DEFAULT_HTTP_OPTIONS = {
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import { ContributionProvider, THEIA_VERSION } from '@theia/core';
|
|
18
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
19
|
+
import { RequestContext, RequestService } from '@theia/core/shared/@theia/request';
|
|
20
|
+
import * as path from 'path';
|
|
21
|
+
import * as fs from 'fs/promises';
|
|
22
|
+
import { DirectoryDependencyDownload, RemoteNativeDependencyContribution } from './remote-native-dependency-contribution.js';
|
|
23
|
+
import { ArchiveExtractor } from '@theia/filesystem/lib/node/archive/archive-extractor';
|
|
24
|
+
export const DEFAULT_HTTP_OPTIONS = {
|
|
31
25
|
method: 'GET',
|
|
32
26
|
headers: {
|
|
33
27
|
Accept: 'application/octet-stream'
|
|
@@ -39,7 +33,7 @@ let RemoteNativeDependencyService = class RemoteNativeDependencyService {
|
|
|
39
33
|
.map(async (contribution) => {
|
|
40
34
|
const result = await contribution.download({
|
|
41
35
|
remotePlatform,
|
|
42
|
-
theiaVersion:
|
|
36
|
+
theiaVersion: THEIA_VERSION,
|
|
43
37
|
download: requestInfo => this.downloadDependency(requestInfo)
|
|
44
38
|
});
|
|
45
39
|
const dependency = await this.storeDependency(result, directory);
|
|
@@ -49,10 +43,10 @@ let RemoteNativeDependencyService = class RemoteNativeDependencyService {
|
|
|
49
43
|
}
|
|
50
44
|
async downloadDependency(downloadURI) {
|
|
51
45
|
const options = typeof downloadURI === 'string'
|
|
52
|
-
? { url: downloadURI, ...
|
|
53
|
-
: { ...
|
|
46
|
+
? { url: downloadURI, ...DEFAULT_HTTP_OPTIONS }
|
|
47
|
+
: { ...DEFAULT_HTTP_OPTIONS, ...downloadURI };
|
|
54
48
|
const req = await this.requestService.request(options);
|
|
55
|
-
if (
|
|
49
|
+
if (RequestContext.isSuccess(req)) {
|
|
56
50
|
if (typeof req.buffer === 'string') {
|
|
57
51
|
return Buffer.from(req.buffer, 'utf8');
|
|
58
52
|
}
|
|
@@ -65,28 +59,13 @@ let RemoteNativeDependencyService = class RemoteNativeDependencyService {
|
|
|
65
59
|
}
|
|
66
60
|
}
|
|
67
61
|
async storeDependency(dependency, directory) {
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
else if (dependency.archive === 'tgz') {
|
|
75
|
-
plugins.push(decompressTargz());
|
|
76
|
-
}
|
|
77
|
-
else if (dependency.archive === 'zip') {
|
|
78
|
-
plugins.push(decompressUnzip());
|
|
79
|
-
}
|
|
80
|
-
const files = await (0, decompress_1.default)(archiveBuffer, directory, { plugins });
|
|
81
|
-
const result = await Promise.all(files.map(async (file) => {
|
|
82
|
-
const localPath = path.join(directory, file.path);
|
|
83
|
-
return {
|
|
84
|
-
path: localPath,
|
|
85
|
-
target: file.path,
|
|
86
|
-
mode: file.mode
|
|
87
|
-
};
|
|
62
|
+
if (DirectoryDependencyDownload.is(dependency)) {
|
|
63
|
+
const entries = await this.archiveExtractor.extract(dependency.buffer, directory, { format: dependency.archive });
|
|
64
|
+
return entries.map(entry => ({
|
|
65
|
+
path: path.join(directory, entry.path),
|
|
66
|
+
target: entry.path,
|
|
67
|
+
mode: entry.mode
|
|
88
68
|
}));
|
|
89
|
-
return result;
|
|
90
69
|
}
|
|
91
70
|
else {
|
|
92
71
|
const fileName = path.basename(dependency.file.path);
|
|
@@ -100,17 +79,18 @@ let RemoteNativeDependencyService = class RemoteNativeDependencyService {
|
|
|
100
79
|
}
|
|
101
80
|
}
|
|
102
81
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
(
|
|
106
|
-
(0, inversify_1.named)(remote_native_dependency_contribution_1.RemoteNativeDependencyContribution),
|
|
107
|
-
tslib_1.__metadata("design:type", Object)
|
|
82
|
+
__decorate([
|
|
83
|
+
inject(ContributionProvider),
|
|
84
|
+
named(RemoteNativeDependencyContribution)
|
|
108
85
|
], RemoteNativeDependencyService.prototype, "nativeDependencyContributions", void 0);
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
tslib_1.__metadata("design:type", Object)
|
|
86
|
+
__decorate([
|
|
87
|
+
inject(RequestService)
|
|
112
88
|
], RemoteNativeDependencyService.prototype, "requestService", void 0);
|
|
113
|
-
|
|
114
|
-
(
|
|
89
|
+
__decorate([
|
|
90
|
+
inject(ArchiveExtractor)
|
|
91
|
+
], RemoteNativeDependencyService.prototype, "archiveExtractor", void 0);
|
|
92
|
+
RemoteNativeDependencyService = __decorate([
|
|
93
|
+
injectable()
|
|
115
94
|
], RemoteNativeDependencyService);
|
|
95
|
+
export { RemoteNativeDependencyService };
|
|
116
96
|
//# sourceMappingURL=remote-native-dependency-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-native-dependency-service.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-native-dependency-service.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-service.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,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAkB,MAAM,mCAAmC,CAAC;AACnG,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAsB,2BAA2B,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAEjJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAExF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,MAAM,EAAE,KAAK;IACb,OAAO,EAAE;QACL,MAAM,EAAE,0BAA0B;KACrC;CACJ,CAA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AAc,CAAC;qEACkB;AAG/B;IADT,MAAM,CAAC,gBAAgB,CAAC;uEACoB;AATpC,6BAA6B;IADzC,UAAU,EAAE;GACA,6BAA6B,CA6DzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-native-dependency-service.spec.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-service.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 EclipseSource GmbH 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
|
+
import * as fs from 'fs';
|
|
17
|
+
import * as os from 'os';
|
|
18
|
+
import * as path from 'path';
|
|
19
|
+
import { expect } from 'chai';
|
|
20
|
+
import { ArchiveExtractorImpl } from '@theia/filesystem/lib/node/archive/archive-extractor';
|
|
21
|
+
import { createTestTar, createTestZip } from '@theia/filesystem/lib/node/archive/test/test-archives';
|
|
22
|
+
import { RemoteNativeDependencyService } from './remote-native-dependency-service.js';
|
|
23
|
+
class TestableRemoteNativeDependencyService extends RemoteNativeDependencyService {
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
this.archiveExtractor = new ArchiveExtractorImpl();
|
|
27
|
+
}
|
|
28
|
+
publicStoreDependency(dependency, directory) {
|
|
29
|
+
return this.storeDependency(dependency, directory);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
describe('RemoteNativeDependencyService', () => {
|
|
33
|
+
const service = new TestableRemoteNativeDependencyService();
|
|
34
|
+
let directory;
|
|
35
|
+
beforeEach(async () => {
|
|
36
|
+
directory = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'remote-native-dependency-'));
|
|
37
|
+
});
|
|
38
|
+
afterEach(async () => {
|
|
39
|
+
await fs.promises.rm(directory, { recursive: true, force: true });
|
|
40
|
+
});
|
|
41
|
+
it('extracts a zip archive and lists its entries with their target and mode', async () => {
|
|
42
|
+
const files = await service.publicStoreDependency({
|
|
43
|
+
archive: 'zip',
|
|
44
|
+
buffer: createTestZip([
|
|
45
|
+
{ name: 'lib/', mode: 0o040755 },
|
|
46
|
+
{ name: 'lib/native.node', mode: 0o100755, data: 'binary' },
|
|
47
|
+
{ name: 'lib/README.md', mode: 0o100644, data: 'readme' }
|
|
48
|
+
])
|
|
49
|
+
}, directory);
|
|
50
|
+
expect(files).to.deep.equal([
|
|
51
|
+
{ path: path.join(directory, 'lib'), target: 'lib', mode: 0o755 },
|
|
52
|
+
{ path: path.join(directory, 'lib', 'native.node'), target: 'lib/native.node', mode: 0o755 },
|
|
53
|
+
{ path: path.join(directory, 'lib', 'README.md'), target: 'lib/README.md', mode: 0o644 }
|
|
54
|
+
]);
|
|
55
|
+
expect(await fs.promises.readFile(path.join(directory, 'lib', 'native.node'), 'utf8')).to.equal('binary');
|
|
56
|
+
});
|
|
57
|
+
for (const archive of ['tar', 'tgz']) {
|
|
58
|
+
it(`extracts a ${archive} archive`, async () => {
|
|
59
|
+
const files = await service.publicStoreDependency({
|
|
60
|
+
archive,
|
|
61
|
+
buffer: await createTestTar([{ name: 'bin/tool', mode: 0o755, data: 'tool' }], archive === 'tgz')
|
|
62
|
+
}, directory);
|
|
63
|
+
expect(files).to.deep.equal([{ path: path.join(directory, 'bin', 'tool'), target: 'bin/tool', mode: 0o755 }]);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
it('uses the declared archive format', async () => {
|
|
67
|
+
let error;
|
|
68
|
+
try {
|
|
69
|
+
await service.publicStoreDependency({ archive: 'tgz', buffer: createTestZip([{ name: 'file.txt' }]) }, directory);
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
error = e;
|
|
73
|
+
}
|
|
74
|
+
expect(String(error)).to.match(/incorrect header check/);
|
|
75
|
+
});
|
|
76
|
+
it('rejects an archive with an entry that leaves the directory', async () => {
|
|
77
|
+
let error;
|
|
78
|
+
try {
|
|
79
|
+
await service.publicStoreDependency({ archive: 'zip', buffer: createTestZip([{ name: '../evil.txt', data: 'evil' }]) }, directory);
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
error = e;
|
|
83
|
+
}
|
|
84
|
+
expect(String(error)).to.match(/invalid relative path|leaves the extraction directory/);
|
|
85
|
+
expect(fs.existsSync(path.join(path.dirname(directory), 'evil.txt'))).to.be.false;
|
|
86
|
+
});
|
|
87
|
+
it('stores a single file as is', async () => {
|
|
88
|
+
const files = await service.publicStoreDependency({
|
|
89
|
+
file: { path: 'bin/tool', mode: 0o755 },
|
|
90
|
+
buffer: Buffer.from('tool')
|
|
91
|
+
}, directory);
|
|
92
|
+
expect(files).to.deep.equal([{ path: path.join(directory, 'tool'), target: 'bin/tool', mode: 0o755 }]);
|
|
93
|
+
expect(await fs.promises.readFile(path.join(directory, 'tool'), 'utf8')).to.equal('tool');
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=remote-native-dependency-service.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-native-dependency-service.spec.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-service.spec.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;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|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestService } from '@theia/core/shared/@theia/request';
|
|
2
|
-
import { RemoteSetupScriptService } from './remote-setup-script-service';
|
|
2
|
+
import { RemoteSetupScriptService } from './remote-setup-script-service.js';
|
|
3
3
|
import { RemotePlatform } from '@theia/core/lib/node/remote/remote-cli-contribution';
|
|
4
4
|
/**
|
|
5
5
|
* The current node version that Theia recommends.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-node-setup-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-node-setup-service.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"remote-node-setup-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-node-setup-service.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,qBACa,sBAAsB;IAG/B,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,wBAAwB,CAAC;IAE3D,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM;IAItD,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM;IAY3D,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAU1D,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,GAAG,KAAK;IAIpF,SAAS,CAAC,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM;IAYhE,eAAe,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM;IAI3C,YAAY,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAexF,sBAAsB,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM;IAUvG,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM;CASzF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2023 TypeFox and others.
|
|
4
3
|
//
|
|
@@ -14,32 +13,30 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const remote_setup_script_service_1 = require("./remote-setup-script-service");
|
|
26
|
-
const core_1 = require("@theia/core");
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import * as path from 'path';
|
|
18
|
+
import * as fs from '@theia/core/shared/fs-extra';
|
|
19
|
+
import * as os from 'os';
|
|
20
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
21
|
+
import { RequestService } from '@theia/core/shared/@theia/request';
|
|
22
|
+
import { RemoteSetupScriptService } from './remote-setup-script-service.js';
|
|
23
|
+
import { OS } from '@theia/core';
|
|
27
24
|
/**
|
|
28
25
|
* The current node version that Theia recommends.
|
|
29
26
|
*
|
|
30
27
|
* Native dependencies are compiled against this version.
|
|
31
28
|
*/
|
|
32
|
-
|
|
29
|
+
export const REMOTE_NODE_VERSION = '24.21.0';
|
|
33
30
|
let RemoteNodeSetupService = class RemoteNodeSetupService {
|
|
34
31
|
getNodeDirectoryName(platform) {
|
|
35
|
-
return `node-v${
|
|
32
|
+
return `node-v${REMOTE_NODE_VERSION}-${this.getPlatformName(platform)}-${platform.arch}`;
|
|
36
33
|
}
|
|
37
34
|
getPlatformName(platform) {
|
|
38
35
|
let platformId;
|
|
39
|
-
if (platform.os ===
|
|
36
|
+
if (platform.os === OS.Type.Windows) {
|
|
40
37
|
platformId = 'win';
|
|
41
38
|
}
|
|
42
|
-
else if (platform.os ===
|
|
39
|
+
else if (platform.os === OS.Type.OSX) {
|
|
43
40
|
platformId = 'darwin';
|
|
44
41
|
}
|
|
45
42
|
else {
|
|
@@ -48,13 +45,13 @@ let RemoteNodeSetupService = class RemoteNodeSetupService {
|
|
|
48
45
|
return platformId;
|
|
49
46
|
}
|
|
50
47
|
validatePlatform(platform) {
|
|
51
|
-
if (platform.os ===
|
|
48
|
+
if (platform.os === OS.Type.Windows && !platform.arch.match(/^x(64|86)$/)) {
|
|
52
49
|
this.throwPlatformError(platform, 'x64 and x86');
|
|
53
50
|
}
|
|
54
|
-
else if (platform.os ===
|
|
51
|
+
else if (platform.os === OS.Type.Linux && !platform.arch.match(/^(x64|armv7l|arm64)$/)) {
|
|
55
52
|
this.throwPlatformError(platform, 'x64, armv7l and arm64');
|
|
56
53
|
}
|
|
57
|
-
else if (platform.os ===
|
|
54
|
+
else if (platform.os === OS.Type.OSX && !platform.arch.match(/^(x64|arm64)$/)) {
|
|
58
55
|
this.throwPlatformError(platform, 'x64 and arm64');
|
|
59
56
|
}
|
|
60
57
|
}
|
|
@@ -63,10 +60,10 @@ let RemoteNodeSetupService = class RemoteNodeSetupService {
|
|
|
63
60
|
}
|
|
64
61
|
getNodeFileExtension(platform) {
|
|
65
62
|
let fileExtension;
|
|
66
|
-
if (platform.os ===
|
|
63
|
+
if (platform.os === OS.Type.Windows) {
|
|
67
64
|
fileExtension = 'zip';
|
|
68
65
|
}
|
|
69
|
-
else if (platform.os ===
|
|
66
|
+
else if (platform.os === OS.Type.OSX) {
|
|
70
67
|
fileExtension = 'tar.gz';
|
|
71
68
|
}
|
|
72
69
|
else {
|
|
@@ -103,23 +100,21 @@ let RemoteNodeSetupService = class RemoteNodeSetupService {
|
|
|
103
100
|
getDownloadPath(platform, downloadTemplate) {
|
|
104
101
|
const template = downloadTemplate || 'https://nodejs.org/dist/v{version}/node-v{version}-{os}-{arch}.{ext}';
|
|
105
102
|
const downloadPath = template
|
|
106
|
-
.replace(/{version}/g,
|
|
103
|
+
.replace(/{version}/g, REMOTE_NODE_VERSION)
|
|
107
104
|
.replace(/{os}/g, this.getPlatformName(platform))
|
|
108
105
|
.replace(/{arch}/g, platform.arch)
|
|
109
106
|
.replace(/{ext}/g, this.getNodeFileExtension(platform));
|
|
110
107
|
return downloadPath;
|
|
111
108
|
}
|
|
112
109
|
};
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
(0, inversify_1.inject)(request_1.RequestService),
|
|
116
|
-
tslib_1.__metadata("design:type", Object)
|
|
110
|
+
__decorate([
|
|
111
|
+
inject(RequestService)
|
|
117
112
|
], RemoteNodeSetupService.prototype, "requestService", void 0);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
tslib_1.__metadata("design:type", remote_setup_script_service_1.RemoteSetupScriptService)
|
|
113
|
+
__decorate([
|
|
114
|
+
inject(RemoteSetupScriptService)
|
|
121
115
|
], RemoteNodeSetupService.prototype, "scriptService", void 0);
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
RemoteNodeSetupService = __decorate([
|
|
117
|
+
injectable()
|
|
124
118
|
], RemoteNodeSetupService);
|
|
119
|
+
export { RemoteNodeSetupService };
|
|
125
120
|
//# sourceMappingURL=remote-node-setup-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-node-setup-service.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-node-setup-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-node-setup-service.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-node-setup-service.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,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAGtC,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAQ/B,oBAAoB,CAAC,QAAwB;QACzC,OAAO,SAAS,mBAAmB,IAAI,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC7F,CAAC;IAES,eAAe,CAAC,QAAwB;QAC9C,IAAI,UAAkB,CAAC;QACvB,IAAI,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClC,UAAU,GAAG,KAAK,CAAC;QACvB,CAAC;aAAM,IAAI,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACrC,UAAU,GAAG,QAAQ,CAAC;QAC1B,CAAC;aAAM,C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