@theia/remote 1.45.0 → 1.46.0-next.72
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/README.md +61 -61
- package/lib/electron-browser/remote-electron-file-dialog-service.d.ts +13 -13
- package/lib/electron-browser/remote-electron-file-dialog-service.js +57 -57
- package/lib/electron-browser/remote-frontend-contribution.d.ts +25 -25
- package/lib/electron-browser/remote-frontend-contribution.js +164 -164
- package/lib/electron-browser/remote-frontend-module.d.ts +3 -3
- package/lib/electron-browser/remote-frontend-module.js +42 -42
- package/lib/electron-browser/remote-preferences.d.ts +10 -10
- package/lib/electron-browser/remote-preferences.js +48 -48
- package/lib/electron-browser/remote-registry-contribution.d.ts +18 -18
- package/lib/electron-browser/remote-registry-contribution.js +74 -74
- package/lib/electron-browser/remote-service.d.ts +5 -5
- package/lib/electron-browser/remote-service.js +37 -37
- package/lib/electron-browser/remote-ssh-contribution.d.ts +17 -17
- package/lib/electron-browser/remote-ssh-contribution.js +117 -117
- package/lib/electron-common/remote-ssh-connection-provider.d.ts +10 -10
- package/lib/electron-common/remote-ssh-connection-provider.js +20 -20
- package/lib/electron-common/remote-status-service.d.ts +14 -14
- package/lib/electron-common/remote-status-service.js +20 -20
- package/lib/electron-node/backend-remote-service-impl.d.ts +11 -11
- package/lib/electron-node/backend-remote-service-impl.js +50 -50
- package/lib/electron-node/remote-backend-module.d.ts +4 -4
- package/lib/electron-node/remote-backend-module.js +74 -74
- package/lib/electron-node/remote-connection-service.d.ts +14 -14
- package/lib/electron-node/remote-connection-service.js +65 -65
- package/lib/electron-node/remote-connection-socket-provider.d.ts +8 -8
- package/lib/electron-node/remote-connection-socket-provider.js +37 -37
- package/lib/electron-node/remote-proxy-server-provider.d.ts +5 -5
- package/lib/electron-node/remote-proxy-server-provider.js +43 -43
- package/lib/electron-node/remote-status-service.d.ts +6 -6
- package/lib/electron-node/remote-status-service.js +54 -54
- package/lib/electron-node/remote-types.d.ts +34 -34
- package/lib/electron-node/remote-types.js +17 -17
- package/lib/electron-node/setup/app-native-dependency-contribution.d.ts +7 -7
- package/lib/electron-node/setup/app-native-dependency-contribution.js +57 -57
- package/lib/electron-node/setup/main-copy-contribution.d.ts +4 -4
- package/lib/electron-node/setup/main-copy-contribution.js +37 -37
- package/lib/electron-node/setup/remote-copy-contribution.d.ts +28 -28
- package/lib/electron-node/setup/remote-copy-contribution.js +78 -78
- package/lib/electron-node/setup/remote-copy-service.d.ts +18 -18
- package/lib/electron-node/setup/remote-copy-service.js +126 -126
- package/lib/electron-node/setup/remote-native-dependency-contribution.d.ts +34 -34
- package/lib/electron-node/setup/remote-native-dependency-contribution.js +34 -34
- package/lib/electron-node/setup/remote-native-dependency-service.d.ts +23 -23
- package/lib/electron-node/setup/remote-native-dependency-service.js +118 -118
- package/lib/electron-node/setup/remote-node-setup-service.d.ts +22 -22
- package/lib/electron-node/setup/remote-node-setup-service.js +132 -132
- package/lib/electron-node/setup/remote-setup-script-service.d.ts +40 -40
- package/lib/electron-node/setup/remote-setup-script-service.js +132 -132
- package/lib/electron-node/setup/remote-setup-service.d.ts +28 -28
- package/lib/electron-node/setup/remote-setup-service.js +198 -198
- package/lib/electron-node/ssh/remote-ssh-connection-provider.d.ts +55 -55
- package/lib/electron-node/ssh/remote-ssh-connection-provider.d.ts.map +1 -1
- package/lib/electron-node/ssh/remote-ssh-connection-provider.js +344 -342
- package/lib/electron-node/ssh/remote-ssh-connection-provider.js.map +1 -1
- package/lib/electron-node/ssh/ssh-identity-file-collector.d.ts +12 -12
- package/lib/electron-node/ssh/ssh-identity-file-collector.js +131 -131
- package/lib/package.spec.js +25 -25
- package/package.json +6 -7
- package/src/electron-browser/remote-electron-file-dialog-service.ts +47 -47
- package/src/electron-browser/remote-frontend-contribution.ts +145 -145
- package/src/electron-browser/remote-frontend-module.ts +49 -49
- package/src/electron-browser/remote-preferences.ts +62 -62
- package/src/electron-browser/remote-registry-contribution.ts +70 -70
- package/src/electron-browser/remote-service.ts +31 -31
- package/src/electron-browser/remote-ssh-contribution.ts +102 -102
- package/src/electron-common/remote-ssh-connection-provider.ts +29 -29
- package/src/electron-common/remote-status-service.ts +35 -35
- package/src/electron-node/backend-remote-service-impl.ts +45 -45
- package/src/electron-node/remote-backend-module.ts +80 -80
- package/src/electron-node/remote-connection-service.ts +55 -55
- package/src/electron-node/remote-connection-socket-provider.ts +34 -34
- package/src/electron-node/remote-proxy-server-provider.ts +37 -37
- package/src/electron-node/remote-status-service.ts +41 -41
- package/src/electron-node/remote-types.ts +56 -56
- package/src/electron-node/setup/app-native-dependency-contribution.ts +48 -48
- package/src/electron-node/setup/main-copy-contribution.ts +28 -28
- package/src/electron-node/setup/remote-copy-contribution.ts +90 -90
- package/src/electron-node/setup/remote-copy-service.ts +114 -114
- package/src/electron-node/setup/remote-native-dependency-contribution.ts +63 -63
- package/src/electron-node/setup/remote-native-dependency-service.ts +111 -111
- package/src/electron-node/setup/remote-node-setup-service.ts +123 -123
- package/src/electron-node/setup/remote-setup-script-service.ts +146 -146
- package/src/electron-node/setup/remote-setup-service.ts +197 -197
- package/src/electron-node/ssh/remote-ssh-connection-provider.ts +358 -356
- package/src/electron-node/ssh/ssh-identity-file-collector.ts +137 -137
- package/src/package.spec.ts +29 -29
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2023 TypeFox 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
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.RemoteCopyRegistry = exports.RemoteCopyContribution = void 0;
|
|
28
|
-
const application_package_1 = require("@theia/core/shared/@theia/application-package");
|
|
29
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
-
const glob_1 = require("glob");
|
|
31
|
-
const util_1 = require("util");
|
|
32
|
-
const path = require("path");
|
|
33
|
-
const promiseGlob = (0, util_1.promisify)(glob_1.glob);
|
|
34
|
-
exports.RemoteCopyContribution = Symbol('RemoteCopyContribution');
|
|
35
|
-
let RemoteCopyRegistry = class RemoteCopyRegistry {
|
|
36
|
-
constructor() {
|
|
37
|
-
this.files = [];
|
|
38
|
-
}
|
|
39
|
-
getFiles() {
|
|
40
|
-
return this.files.slice();
|
|
41
|
-
}
|
|
42
|
-
async glob(pattern, target) {
|
|
43
|
-
const projectPath = this.applicationPackage.projectPath;
|
|
44
|
-
const globResult = await promiseGlob(pattern, {
|
|
45
|
-
cwd: projectPath
|
|
46
|
-
});
|
|
47
|
-
const relativeFiles = globResult.map(file => path.relative(projectPath, file));
|
|
48
|
-
for (const file of relativeFiles) {
|
|
49
|
-
const targetFile = this.withTarget(file, target);
|
|
50
|
-
this.files.push({
|
|
51
|
-
path: file,
|
|
52
|
-
target: targetFile
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
file(file, target, options) {
|
|
57
|
-
const targetFile = this.withTarget(file, target);
|
|
58
|
-
this.files.push({
|
|
59
|
-
path: file,
|
|
60
|
-
target: targetFile,
|
|
61
|
-
options
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
async directory(dir, target) {
|
|
65
|
-
return this.glob(dir + '/**', target);
|
|
66
|
-
}
|
|
67
|
-
withTarget(file, target) {
|
|
68
|
-
return target ? path.join(target, file) : file;
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
__decorate([
|
|
72
|
-
(0, inversify_1.inject)(application_package_1.ApplicationPackage),
|
|
73
|
-
__metadata("design:type", application_package_1.ApplicationPackage)
|
|
74
|
-
], RemoteCopyRegistry.prototype, "applicationPackage", void 0);
|
|
75
|
-
RemoteCopyRegistry = __decorate([
|
|
76
|
-
(0, inversify_1.injectable)()
|
|
77
|
-
], RemoteCopyRegistry);
|
|
78
|
-
exports.RemoteCopyRegistry = RemoteCopyRegistry;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 TypeFox 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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.RemoteCopyRegistry = exports.RemoteCopyContribution = void 0;
|
|
28
|
+
const application_package_1 = require("@theia/core/shared/@theia/application-package");
|
|
29
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
+
const glob_1 = require("glob");
|
|
31
|
+
const util_1 = require("util");
|
|
32
|
+
const path = require("path");
|
|
33
|
+
const promiseGlob = (0, util_1.promisify)(glob_1.glob);
|
|
34
|
+
exports.RemoteCopyContribution = Symbol('RemoteCopyContribution');
|
|
35
|
+
let RemoteCopyRegistry = class RemoteCopyRegistry {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.files = [];
|
|
38
|
+
}
|
|
39
|
+
getFiles() {
|
|
40
|
+
return this.files.slice();
|
|
41
|
+
}
|
|
42
|
+
async glob(pattern, target) {
|
|
43
|
+
const projectPath = this.applicationPackage.projectPath;
|
|
44
|
+
const globResult = await promiseGlob(pattern, {
|
|
45
|
+
cwd: projectPath
|
|
46
|
+
});
|
|
47
|
+
const relativeFiles = globResult.map(file => path.relative(projectPath, file));
|
|
48
|
+
for (const file of relativeFiles) {
|
|
49
|
+
const targetFile = this.withTarget(file, target);
|
|
50
|
+
this.files.push({
|
|
51
|
+
path: file,
|
|
52
|
+
target: targetFile
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
file(file, target, options) {
|
|
57
|
+
const targetFile = this.withTarget(file, target);
|
|
58
|
+
this.files.push({
|
|
59
|
+
path: file,
|
|
60
|
+
target: targetFile,
|
|
61
|
+
options
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async directory(dir, target) {
|
|
65
|
+
return this.glob(dir + '/**', target);
|
|
66
|
+
}
|
|
67
|
+
withTarget(file, target) {
|
|
68
|
+
return target ? path.join(target, file) : file;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, inversify_1.inject)(application_package_1.ApplicationPackage),
|
|
73
|
+
__metadata("design:type", application_package_1.ApplicationPackage)
|
|
74
|
+
], RemoteCopyRegistry.prototype, "applicationPackage", void 0);
|
|
75
|
+
RemoteCopyRegistry = __decorate([
|
|
76
|
+
(0, inversify_1.injectable)()
|
|
77
|
+
], RemoteCopyRegistry);
|
|
78
|
+
exports.RemoteCopyRegistry = RemoteCopyRegistry;
|
|
79
79
|
//# sourceMappingURL=remote-copy-contribution.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ApplicationPackage } from '@theia/core/shared/@theia/application-package';
|
|
2
|
-
import { RemoteConnection, RemotePlatform } from '../remote-types';
|
|
3
|
-
import { RemoteNativeDependencyService } from './remote-native-dependency-service';
|
|
4
|
-
import { ContributionProvider } from '@theia/core';
|
|
5
|
-
import { RemoteCopyContribution, RemoteCopyRegistry, RemoteFile } from './remote-copy-contribution';
|
|
6
|
-
export declare class RemoteCopyService {
|
|
7
|
-
protected readonly applicationPackage: ApplicationPackage;
|
|
8
|
-
protected readonly copyRegistry: RemoteCopyRegistry;
|
|
9
|
-
protected readonly nativeDependencyService: RemoteNativeDependencyService;
|
|
10
|
-
protected readonly copyContributions: ContributionProvider<RemoteCopyContribution>;
|
|
11
|
-
protected initialized: boolean;
|
|
12
|
-
copyToRemote(remote: RemoteConnection, remotePlatform: RemotePlatform, destination: string): Promise<void>;
|
|
13
|
-
protected getFiles(remotePlatform: RemotePlatform, tempDir: string): Promise<RemoteFile[]>;
|
|
14
|
-
protected loadCopyContributions(): Promise<RemoteFile[]>;
|
|
15
|
-
protected loadNativeDependencies(remotePlatform: RemotePlatform, tempDir: string): Promise<RemoteFile[]>;
|
|
16
|
-
protected getTempDir(): Promise<string>;
|
|
17
|
-
protected getRemoteDownloadLocation(): Promise<string | undefined>;
|
|
18
|
-
}
|
|
1
|
+
import { ApplicationPackage } from '@theia/core/shared/@theia/application-package';
|
|
2
|
+
import { RemoteConnection, RemotePlatform } from '../remote-types';
|
|
3
|
+
import { RemoteNativeDependencyService } from './remote-native-dependency-service';
|
|
4
|
+
import { ContributionProvider } from '@theia/core';
|
|
5
|
+
import { RemoteCopyContribution, RemoteCopyRegistry, RemoteFile } from './remote-copy-contribution';
|
|
6
|
+
export declare class RemoteCopyService {
|
|
7
|
+
protected readonly applicationPackage: ApplicationPackage;
|
|
8
|
+
protected readonly copyRegistry: RemoteCopyRegistry;
|
|
9
|
+
protected readonly nativeDependencyService: RemoteNativeDependencyService;
|
|
10
|
+
protected readonly copyContributions: ContributionProvider<RemoteCopyContribution>;
|
|
11
|
+
protected initialized: boolean;
|
|
12
|
+
copyToRemote(remote: RemoteConnection, remotePlatform: RemotePlatform, destination: string): Promise<void>;
|
|
13
|
+
protected getFiles(remotePlatform: RemotePlatform, tempDir: string): Promise<RemoteFile[]>;
|
|
14
|
+
protected loadCopyContributions(): Promise<RemoteFile[]>;
|
|
15
|
+
protected loadNativeDependencies(remotePlatform: RemotePlatform, tempDir: string): Promise<RemoteFile[]>;
|
|
16
|
+
protected getTempDir(): Promise<string>;
|
|
17
|
+
protected getRemoteDownloadLocation(): Promise<string | undefined>;
|
|
18
|
+
}
|
|
19
19
|
//# sourceMappingURL=remote-copy-service.d.ts.map
|
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2023 TypeFox 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
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.RemoteCopyService = void 0;
|
|
28
|
-
const archiver = require("archiver");
|
|
29
|
-
const path = require("path");
|
|
30
|
-
const fs = require("fs");
|
|
31
|
-
const os = require("os");
|
|
32
|
-
const application_package_1 = require("@theia/core/shared/@theia/application-package");
|
|
33
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
34
|
-
const remote_native_dependency_service_1 = require("./remote-native-dependency-service");
|
|
35
|
-
const core_1 = require("@theia/core");
|
|
36
|
-
const remote_copy_contribution_1 = require("./remote-copy-contribution");
|
|
37
|
-
let RemoteCopyService = class RemoteCopyService {
|
|
38
|
-
constructor() {
|
|
39
|
-
this.initialized = false;
|
|
40
|
-
}
|
|
41
|
-
async copyToRemote(remote, remotePlatform, destination) {
|
|
42
|
-
var _a;
|
|
43
|
-
const zipName = path.basename(destination);
|
|
44
|
-
const projectPath = this.applicationPackage.projectPath;
|
|
45
|
-
const tempDir = await this.getTempDir();
|
|
46
|
-
const zipPath = path.join(tempDir, zipName);
|
|
47
|
-
const files = await this.getFiles(remotePlatform, tempDir);
|
|
48
|
-
// We stream to a file here and then copy it because it is faster
|
|
49
|
-
// Copying files via sftp is 4x times faster compared to readable streams
|
|
50
|
-
const stream = fs.createWriteStream(zipPath);
|
|
51
|
-
const archive = archiver('tar', {
|
|
52
|
-
gzip: true
|
|
53
|
-
});
|
|
54
|
-
archive.pipe(stream);
|
|
55
|
-
for (const file of files) {
|
|
56
|
-
const filePath = path.isAbsolute(file.path)
|
|
57
|
-
? file.path
|
|
58
|
-
: path.join(projectPath, file.path);
|
|
59
|
-
archive.file(filePath, {
|
|
60
|
-
name: file.target,
|
|
61
|
-
mode: (_a = file.options) === null || _a === void 0 ? void 0 : _a.mode
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
await archive.finalize();
|
|
65
|
-
await remote.copy(zipPath, destination);
|
|
66
|
-
await fs.promises.rm(tempDir, {
|
|
67
|
-
recursive: true,
|
|
68
|
-
force: true
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
async getFiles(remotePlatform, tempDir) {
|
|
72
|
-
const [localFiles, nativeDependencies] = await Promise.all([
|
|
73
|
-
this.loadCopyContributions(),
|
|
74
|
-
this.loadNativeDependencies(remotePlatform, tempDir)
|
|
75
|
-
]);
|
|
76
|
-
return [...localFiles, ...nativeDependencies];
|
|
77
|
-
}
|
|
78
|
-
async loadCopyContributions() {
|
|
79
|
-
if (this.initialized) {
|
|
80
|
-
return this.copyRegistry.getFiles();
|
|
81
|
-
}
|
|
82
|
-
await Promise.all(this.copyContributions.getContributions()
|
|
83
|
-
.map(copyContribution => copyContribution.copy(this.copyRegistry)));
|
|
84
|
-
this.initialized = true;
|
|
85
|
-
return this.copyRegistry.getFiles();
|
|
86
|
-
}
|
|
87
|
-
async loadNativeDependencies(remotePlatform, tempDir) {
|
|
88
|
-
const dependencyFiles = await this.nativeDependencyService.downloadDependencies(remotePlatform, tempDir);
|
|
89
|
-
return dependencyFiles.map(file => ({
|
|
90
|
-
path: file.path,
|
|
91
|
-
target: file.target,
|
|
92
|
-
options: {
|
|
93
|
-
mode: file.mode
|
|
94
|
-
}
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
|
-
async getTempDir() {
|
|
98
|
-
const dir = path.join(os.tmpdir(), 'theia-remote-');
|
|
99
|
-
const tempDir = await fs.promises.mkdtemp(dir);
|
|
100
|
-
return tempDir;
|
|
101
|
-
}
|
|
102
|
-
async getRemoteDownloadLocation() {
|
|
103
|
-
return undefined;
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
__decorate([
|
|
107
|
-
(0, inversify_1.inject)(application_package_1.ApplicationPackage),
|
|
108
|
-
__metadata("design:type", application_package_1.ApplicationPackage)
|
|
109
|
-
], RemoteCopyService.prototype, "applicationPackage", void 0);
|
|
110
|
-
__decorate([
|
|
111
|
-
(0, inversify_1.inject)(remote_copy_contribution_1.RemoteCopyRegistry),
|
|
112
|
-
__metadata("design:type", remote_copy_contribution_1.RemoteCopyRegistry)
|
|
113
|
-
], RemoteCopyService.prototype, "copyRegistry", void 0);
|
|
114
|
-
__decorate([
|
|
115
|
-
(0, inversify_1.inject)(remote_native_dependency_service_1.RemoteNativeDependencyService),
|
|
116
|
-
__metadata("design:type", remote_native_dependency_service_1.RemoteNativeDependencyService)
|
|
117
|
-
], RemoteCopyService.prototype, "nativeDependencyService", void 0);
|
|
118
|
-
__decorate([
|
|
119
|
-
(0, inversify_1.inject)(core_1.ContributionProvider),
|
|
120
|
-
(0, inversify_1.named)(remote_copy_contribution_1.RemoteCopyContribution),
|
|
121
|
-
__metadata("design:type", Object)
|
|
122
|
-
], RemoteCopyService.prototype, "copyContributions", void 0);
|
|
123
|
-
RemoteCopyService = __decorate([
|
|
124
|
-
(0, inversify_1.injectable)()
|
|
125
|
-
], RemoteCopyService);
|
|
126
|
-
exports.RemoteCopyService = RemoteCopyService;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 TypeFox 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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.RemoteCopyService = void 0;
|
|
28
|
+
const archiver = require("archiver");
|
|
29
|
+
const path = require("path");
|
|
30
|
+
const fs = require("fs");
|
|
31
|
+
const os = require("os");
|
|
32
|
+
const application_package_1 = require("@theia/core/shared/@theia/application-package");
|
|
33
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
34
|
+
const remote_native_dependency_service_1 = require("./remote-native-dependency-service");
|
|
35
|
+
const core_1 = require("@theia/core");
|
|
36
|
+
const remote_copy_contribution_1 = require("./remote-copy-contribution");
|
|
37
|
+
let RemoteCopyService = class RemoteCopyService {
|
|
38
|
+
constructor() {
|
|
39
|
+
this.initialized = false;
|
|
40
|
+
}
|
|
41
|
+
async copyToRemote(remote, remotePlatform, destination) {
|
|
42
|
+
var _a;
|
|
43
|
+
const zipName = path.basename(destination);
|
|
44
|
+
const projectPath = this.applicationPackage.projectPath;
|
|
45
|
+
const tempDir = await this.getTempDir();
|
|
46
|
+
const zipPath = path.join(tempDir, zipName);
|
|
47
|
+
const files = await this.getFiles(remotePlatform, tempDir);
|
|
48
|
+
// We stream to a file here and then copy it because it is faster
|
|
49
|
+
// Copying files via sftp is 4x times faster compared to readable streams
|
|
50
|
+
const stream = fs.createWriteStream(zipPath);
|
|
51
|
+
const archive = archiver('tar', {
|
|
52
|
+
gzip: true
|
|
53
|
+
});
|
|
54
|
+
archive.pipe(stream);
|
|
55
|
+
for (const file of files) {
|
|
56
|
+
const filePath = path.isAbsolute(file.path)
|
|
57
|
+
? file.path
|
|
58
|
+
: path.join(projectPath, file.path);
|
|
59
|
+
archive.file(filePath, {
|
|
60
|
+
name: file.target,
|
|
61
|
+
mode: (_a = file.options) === null || _a === void 0 ? void 0 : _a.mode
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
await archive.finalize();
|
|
65
|
+
await remote.copy(zipPath, destination);
|
|
66
|
+
await fs.promises.rm(tempDir, {
|
|
67
|
+
recursive: true,
|
|
68
|
+
force: true
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
async getFiles(remotePlatform, tempDir) {
|
|
72
|
+
const [localFiles, nativeDependencies] = await Promise.all([
|
|
73
|
+
this.loadCopyContributions(),
|
|
74
|
+
this.loadNativeDependencies(remotePlatform, tempDir)
|
|
75
|
+
]);
|
|
76
|
+
return [...localFiles, ...nativeDependencies];
|
|
77
|
+
}
|
|
78
|
+
async loadCopyContributions() {
|
|
79
|
+
if (this.initialized) {
|
|
80
|
+
return this.copyRegistry.getFiles();
|
|
81
|
+
}
|
|
82
|
+
await Promise.all(this.copyContributions.getContributions()
|
|
83
|
+
.map(copyContribution => copyContribution.copy(this.copyRegistry)));
|
|
84
|
+
this.initialized = true;
|
|
85
|
+
return this.copyRegistry.getFiles();
|
|
86
|
+
}
|
|
87
|
+
async loadNativeDependencies(remotePlatform, tempDir) {
|
|
88
|
+
const dependencyFiles = await this.nativeDependencyService.downloadDependencies(remotePlatform, tempDir);
|
|
89
|
+
return dependencyFiles.map(file => ({
|
|
90
|
+
path: file.path,
|
|
91
|
+
target: file.target,
|
|
92
|
+
options: {
|
|
93
|
+
mode: file.mode
|
|
94
|
+
}
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
async getTempDir() {
|
|
98
|
+
const dir = path.join(os.tmpdir(), 'theia-remote-');
|
|
99
|
+
const tempDir = await fs.promises.mkdtemp(dir);
|
|
100
|
+
return tempDir;
|
|
101
|
+
}
|
|
102
|
+
async getRemoteDownloadLocation() {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, inversify_1.inject)(application_package_1.ApplicationPackage),
|
|
108
|
+
__metadata("design:type", application_package_1.ApplicationPackage)
|
|
109
|
+
], RemoteCopyService.prototype, "applicationPackage", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, inversify_1.inject)(remote_copy_contribution_1.RemoteCopyRegistry),
|
|
112
|
+
__metadata("design:type", remote_copy_contribution_1.RemoteCopyRegistry)
|
|
113
|
+
], RemoteCopyService.prototype, "copyRegistry", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, inversify_1.inject)(remote_native_dependency_service_1.RemoteNativeDependencyService),
|
|
116
|
+
__metadata("design:type", remote_native_dependency_service_1.RemoteNativeDependencyService)
|
|
117
|
+
], RemoteCopyService.prototype, "nativeDependencyService", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, inversify_1.inject)(core_1.ContributionProvider),
|
|
120
|
+
(0, inversify_1.named)(remote_copy_contribution_1.RemoteCopyContribution),
|
|
121
|
+
__metadata("design:type", Object)
|
|
122
|
+
], RemoteCopyService.prototype, "copyContributions", void 0);
|
|
123
|
+
RemoteCopyService = __decorate([
|
|
124
|
+
(0, inversify_1.injectable)()
|
|
125
|
+
], RemoteCopyService);
|
|
126
|
+
exports.RemoteCopyService = RemoteCopyService;
|
|
127
127
|
//# sourceMappingURL=remote-copy-service.js.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { RequestOptions } from '@theia/core/shared/@theia/request';
|
|
3
|
-
import { RemotePlatform } from '../remote-types';
|
|
4
|
-
export interface FileDependencyResult {
|
|
5
|
-
path: string;
|
|
6
|
-
mode?: number;
|
|
7
|
-
}
|
|
8
|
-
export declare type DependencyDownload = FileDependencyDownload | DirectoryDependencyDownload;
|
|
9
|
-
export interface FileDependencyDownload {
|
|
10
|
-
file: FileDependencyResult;
|
|
11
|
-
buffer: Buffer;
|
|
12
|
-
}
|
|
13
|
-
export declare namespace FileDependencyResult {
|
|
14
|
-
function is(item: unknown): item is FileDependencyDownload;
|
|
15
|
-
}
|
|
16
|
-
export interface DirectoryDependencyDownload {
|
|
17
|
-
archive: 'tar' | 'zip' | 'tgz';
|
|
18
|
-
buffer: Buffer;
|
|
19
|
-
}
|
|
20
|
-
export declare namespace DirectoryDependencyDownload {
|
|
21
|
-
function is(item: unknown): item is DirectoryDependencyDownload;
|
|
22
|
-
}
|
|
23
|
-
export interface DownloadOptions {
|
|
24
|
-
remotePlatform: RemotePlatform;
|
|
25
|
-
theiaVersion: string;
|
|
26
|
-
download: (requestInfo: string | RequestOptions) => Promise<Buffer>;
|
|
27
|
-
}
|
|
28
|
-
export declare const RemoteNativeDependencyContribution: unique symbol;
|
|
29
|
-
/**
|
|
30
|
-
* contribution used for downloading prebuild native dependency when connecting to a remote machine with a different system
|
|
31
|
-
*/
|
|
32
|
-
export interface RemoteNativeDependencyContribution {
|
|
33
|
-
download(options: DownloadOptions): Promise<DependencyDownload>;
|
|
34
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { RequestOptions } from '@theia/core/shared/@theia/request';
|
|
3
|
+
import { RemotePlatform } from '../remote-types';
|
|
4
|
+
export interface FileDependencyResult {
|
|
5
|
+
path: string;
|
|
6
|
+
mode?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare type DependencyDownload = FileDependencyDownload | DirectoryDependencyDownload;
|
|
9
|
+
export interface FileDependencyDownload {
|
|
10
|
+
file: FileDependencyResult;
|
|
11
|
+
buffer: Buffer;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace FileDependencyResult {
|
|
14
|
+
function is(item: unknown): item is FileDependencyDownload;
|
|
15
|
+
}
|
|
16
|
+
export interface DirectoryDependencyDownload {
|
|
17
|
+
archive: 'tar' | 'zip' | 'tgz';
|
|
18
|
+
buffer: Buffer;
|
|
19
|
+
}
|
|
20
|
+
export declare namespace DirectoryDependencyDownload {
|
|
21
|
+
function is(item: unknown): item is DirectoryDependencyDownload;
|
|
22
|
+
}
|
|
23
|
+
export interface DownloadOptions {
|
|
24
|
+
remotePlatform: RemotePlatform;
|
|
25
|
+
theiaVersion: string;
|
|
26
|
+
download: (requestInfo: string | RequestOptions) => Promise<Buffer>;
|
|
27
|
+
}
|
|
28
|
+
export declare const RemoteNativeDependencyContribution: unique symbol;
|
|
29
|
+
/**
|
|
30
|
+
* contribution used for downloading prebuild native dependency when connecting to a remote machine with a different system
|
|
31
|
+
*/
|
|
32
|
+
export interface RemoteNativeDependencyContribution {
|
|
33
|
+
download(options: DownloadOptions): Promise<DependencyDownload>;
|
|
34
|
+
}
|
|
35
35
|
//# sourceMappingURL=remote-native-dependency-contribution.d.ts.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2023 TypeFox 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.RemoteNativeDependencyContribution = exports.DirectoryDependencyDownload = exports.FileDependencyResult = void 0;
|
|
19
|
-
const core_1 = require("@theia/core");
|
|
20
|
-
var FileDependencyResult;
|
|
21
|
-
(function (FileDependencyResult) {
|
|
22
|
-
function is(item) {
|
|
23
|
-
return (0, core_1.isObject)(item) && 'buffer' in item && 'file' in item;
|
|
24
|
-
}
|
|
25
|
-
FileDependencyResult.is = is;
|
|
26
|
-
})(FileDependencyResult = exports.FileDependencyResult || (exports.FileDependencyResult = {}));
|
|
27
|
-
var DirectoryDependencyDownload;
|
|
28
|
-
(function (DirectoryDependencyDownload) {
|
|
29
|
-
function is(item) {
|
|
30
|
-
return (0, core_1.isObject)(item) && 'buffer' in item && 'archive' in item;
|
|
31
|
-
}
|
|
32
|
-
DirectoryDependencyDownload.is = is;
|
|
33
|
-
})(DirectoryDependencyDownload = exports.DirectoryDependencyDownload || (exports.DirectoryDependencyDownload = {}));
|
|
34
|
-
exports.RemoteNativeDependencyContribution = Symbol('RemoteNativeDependencyContribution');
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 TypeFox 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.RemoteNativeDependencyContribution = exports.DirectoryDependencyDownload = exports.FileDependencyResult = void 0;
|
|
19
|
+
const core_1 = require("@theia/core");
|
|
20
|
+
var FileDependencyResult;
|
|
21
|
+
(function (FileDependencyResult) {
|
|
22
|
+
function is(item) {
|
|
23
|
+
return (0, core_1.isObject)(item) && 'buffer' in item && 'file' in item;
|
|
24
|
+
}
|
|
25
|
+
FileDependencyResult.is = is;
|
|
26
|
+
})(FileDependencyResult = exports.FileDependencyResult || (exports.FileDependencyResult = {}));
|
|
27
|
+
var DirectoryDependencyDownload;
|
|
28
|
+
(function (DirectoryDependencyDownload) {
|
|
29
|
+
function is(item) {
|
|
30
|
+
return (0, core_1.isObject)(item) && 'buffer' in item && 'archive' in item;
|
|
31
|
+
}
|
|
32
|
+
DirectoryDependencyDownload.is = is;
|
|
33
|
+
})(DirectoryDependencyDownload = exports.DirectoryDependencyDownload || (exports.DirectoryDependencyDownload = {}));
|
|
34
|
+
exports.RemoteNativeDependencyContribution = Symbol('RemoteNativeDependencyContribution');
|
|
35
35
|
//# sourceMappingURL=remote-native-dependency-contribution.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ContributionProvider } from '@theia/core';
|
|
3
|
-
import { RequestService, RequestOptions } from '@theia/core/shared/@theia/request';
|
|
4
|
-
import { DependencyDownload, RemoteNativeDependencyContribution } from './remote-native-dependency-contribution';
|
|
5
|
-
import { RemotePlatform } from '../remote-types';
|
|
6
|
-
export declare const DEFAULT_HTTP_OPTIONS: {
|
|
7
|
-
method: string;
|
|
8
|
-
headers: {
|
|
9
|
-
Accept: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export interface NativeDependencyFile {
|
|
13
|
-
path: string;
|
|
14
|
-
target: string;
|
|
15
|
-
mode?: number;
|
|
16
|
-
}
|
|
17
|
-
export declare class RemoteNativeDependencyService {
|
|
18
|
-
protected nativeDependencyContributions: ContributionProvider<RemoteNativeDependencyContribution>;
|
|
19
|
-
protected requestService: RequestService;
|
|
20
|
-
downloadDependencies(remotePlatform: RemotePlatform, directory: string): Promise<NativeDependencyFile[]>;
|
|
21
|
-
protected downloadDependency(downloadURI: string | RequestOptions): Promise<Buffer>;
|
|
22
|
-
protected storeDependency(dependency: DependencyDownload, directory: string): Promise<NativeDependencyFile[]>;
|
|
23
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ContributionProvider } from '@theia/core';
|
|
3
|
+
import { RequestService, RequestOptions } from '@theia/core/shared/@theia/request';
|
|
4
|
+
import { DependencyDownload, RemoteNativeDependencyContribution } from './remote-native-dependency-contribution';
|
|
5
|
+
import { RemotePlatform } from '../remote-types';
|
|
6
|
+
export declare const DEFAULT_HTTP_OPTIONS: {
|
|
7
|
+
method: string;
|
|
8
|
+
headers: {
|
|
9
|
+
Accept: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export interface NativeDependencyFile {
|
|
13
|
+
path: string;
|
|
14
|
+
target: string;
|
|
15
|
+
mode?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class RemoteNativeDependencyService {
|
|
18
|
+
protected nativeDependencyContributions: ContributionProvider<RemoteNativeDependencyContribution>;
|
|
19
|
+
protected requestService: RequestService;
|
|
20
|
+
downloadDependencies(remotePlatform: RemotePlatform, directory: string): Promise<NativeDependencyFile[]>;
|
|
21
|
+
protected downloadDependency(downloadURI: string | RequestOptions): Promise<Buffer>;
|
|
22
|
+
protected storeDependency(dependency: DependencyDownload, directory: string): Promise<NativeDependencyFile[]>;
|
|
23
|
+
}
|
|
24
24
|
//# sourceMappingURL=remote-native-dependency-service.d.ts.map
|