@theia/remote 1.52.0 → 1.53.0-next.55

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 (37) hide show
  1. package/README.md +61 -61
  2. package/lib/electron-node/setup/remote-setup-script-service.js +11 -11
  3. package/package.json +5 -5
  4. package/src/electron-browser/port-forwarding/port-forwading-contribution.ts +33 -33
  5. package/src/electron-browser/port-forwarding/port-forwarding-service.ts +92 -92
  6. package/src/electron-browser/port-forwarding/port-forwarding-widget.tsx +140 -140
  7. package/src/electron-browser/remote-electron-file-dialog-service.ts +47 -47
  8. package/src/electron-browser/remote-frontend-contribution.ts +143 -143
  9. package/src/electron-browser/remote-frontend-module.ts +68 -68
  10. package/src/electron-browser/remote-preferences.ts +62 -62
  11. package/src/electron-browser/remote-registry-contribution.ts +73 -73
  12. package/src/electron-browser/remote-service.ts +31 -31
  13. package/src/electron-browser/remote-ssh-contribution.ts +102 -102
  14. package/src/electron-browser/style/port-forwarding-widget.css +44 -44
  15. package/src/electron-common/remote-port-forwarding-provider.ts +30 -30
  16. package/src/electron-common/remote-ssh-connection-provider.ts +29 -29
  17. package/src/electron-common/remote-status-service.ts +35 -35
  18. package/src/electron-node/backend-remote-service-impl.ts +45 -45
  19. package/src/electron-node/remote-backend-module.ts +87 -87
  20. package/src/electron-node/remote-connection-service.ts +56 -56
  21. package/src/electron-node/remote-connection-socket-provider.ts +34 -34
  22. package/src/electron-node/remote-port-forwarding-provider.ts +66 -66
  23. package/src/electron-node/remote-proxy-server-provider.ts +37 -37
  24. package/src/electron-node/remote-status-service.ts +41 -41
  25. package/src/electron-node/remote-types.ts +64 -64
  26. package/src/electron-node/setup/app-native-dependency-contribution.ts +48 -48
  27. package/src/electron-node/setup/main-copy-contribution.ts +28 -28
  28. package/src/electron-node/setup/remote-copy-contribution.ts +74 -74
  29. package/src/electron-node/setup/remote-copy-service.ts +116 -116
  30. package/src/electron-node/setup/remote-native-dependency-contribution.ts +63 -63
  31. package/src/electron-node/setup/remote-native-dependency-service.ts +111 -111
  32. package/src/electron-node/setup/remote-node-setup-service.ts +123 -123
  33. package/src/electron-node/setup/remote-setup-script-service.ts +146 -146
  34. package/src/electron-node/setup/remote-setup-service.ts +220 -220
  35. package/src/electron-node/ssh/remote-ssh-connection-provider.ts +358 -358
  36. package/src/electron-node/ssh/ssh-identity-file-collector.ts +137 -137
  37. package/src/package.spec.ts +29 -29
@@ -1,146 +1,146 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { OS } from '@theia/core';
18
- import { inject, injectable } from '@theia/core/shared/inversify';
19
- import { RemotePlatform } from '@theia/core/lib/node/remote/remote-cli-contribution';
20
-
21
- export interface RemoteScriptStrategy {
22
- exec(): string;
23
- downloadFile(url: string, output: string): string;
24
- unzip(file: string, directory: string): string;
25
- mkdir(path: string): string;
26
- home(): string;
27
- joinPath(...segments: string[]): string;
28
- joinScript(...segments: string[]): string;
29
- }
30
-
31
- @injectable()
32
- export class RemoteWindowsScriptStrategy implements RemoteScriptStrategy {
33
-
34
- home(): string {
35
- return 'PowerShell -Command $HOME';
36
- }
37
-
38
- exec(): string {
39
- return 'PowerShell -Command';
40
- }
41
-
42
- downloadFile(url: string, output: string): string {
43
- return `PowerShell -Command Invoke-WebRequest -Uri "${url}" -OutFile ${output}`;
44
- }
45
-
46
- unzip(file: string, directory: string): string {
47
- return `tar -xf "${file}" -C "${directory}"`;
48
- }
49
-
50
- mkdir(path: string): string {
51
- return `PowerShell -Command New-Item -Force -itemType Directory -Path "${path}"`;
52
- }
53
-
54
- joinPath(...segments: string[]): string {
55
- return segments.join('\\');
56
- }
57
-
58
- joinScript(...segments: string[]): string {
59
- return segments.join('\r\n');
60
- }
61
- }
62
-
63
- @injectable()
64
- export class RemotePosixScriptStrategy implements RemoteScriptStrategy {
65
-
66
- home(): string {
67
- return 'eval echo ~';
68
- }
69
-
70
- exec(): string {
71
- return 'sh -c';
72
- }
73
-
74
- downloadFile(url: string, output: string): string {
75
- return `
76
- if [ "$(command -v wget)" ]; then
77
- echo "Downloading using wget"
78
- wget -O "${output}" "${url}"
79
- elif [ "$(command -v curl)" ]; then
80
- echo "Downloading using curl"
81
- curl "${url}" --output "${output}"
82
- else
83
- echo "Failed to find wget or curl."
84
- exit 1
85
- fi
86
- `.trim();
87
- }
88
-
89
- unzip(file: string, directory: string): string {
90
- return `tar -xf "${file}" -C "${directory}"`;
91
- }
92
-
93
- mkdir(path: string): string {
94
- return `mkdir -p "${path}"`;
95
- }
96
-
97
- joinPath(...segments: string[]): string {
98
- return segments.join('/');
99
- }
100
-
101
- joinScript(...segments: string[]): string {
102
- return segments.join('\n');
103
- }
104
- }
105
-
106
- @injectable()
107
- export class RemoteSetupScriptService {
108
-
109
- @inject(RemoteWindowsScriptStrategy)
110
- protected windowsStrategy: RemoteWindowsScriptStrategy;
111
-
112
- @inject(RemotePosixScriptStrategy)
113
- protected posixStrategy: RemotePosixScriptStrategy;
114
-
115
- protected getStrategy(platform: RemotePlatform): RemoteScriptStrategy {
116
- return platform.os === OS.Type.Windows ? this.windowsStrategy : this.posixStrategy;
117
- }
118
-
119
- home(platform: RemotePlatform): string {
120
- return this.getStrategy(platform).home();
121
- }
122
-
123
- exec(platform: RemotePlatform): string {
124
- return this.getStrategy(platform).exec();
125
- }
126
-
127
- downloadFile(platform: RemotePlatform, url: string, output: string): string {
128
- return this.getStrategy(platform).downloadFile(url, output);
129
- }
130
-
131
- unzip(platform: RemotePlatform, file: string, directory: string): string {
132
- return this.getStrategy(platform).unzip(file, directory);
133
- }
134
-
135
- mkdir(platform: RemotePlatform, path: string): string {
136
- return this.getStrategy(platform).mkdir(path);
137
- }
138
-
139
- joinPath(platform: RemotePlatform, ...segments: string[]): string {
140
- return this.getStrategy(platform).joinPath(...segments);
141
- }
142
-
143
- joinScript(platform: RemotePlatform, ...segments: string[]): string {
144
- return this.getStrategy(platform).joinScript(...segments);
145
- }
146
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { OS } from '@theia/core';
18
+ import { inject, injectable } from '@theia/core/shared/inversify';
19
+ import { RemotePlatform } from '@theia/core/lib/node/remote/remote-cli-contribution';
20
+
21
+ export interface RemoteScriptStrategy {
22
+ exec(): string;
23
+ downloadFile(url: string, output: string): string;
24
+ unzip(file: string, directory: string): string;
25
+ mkdir(path: string): string;
26
+ home(): string;
27
+ joinPath(...segments: string[]): string;
28
+ joinScript(...segments: string[]): string;
29
+ }
30
+
31
+ @injectable()
32
+ export class RemoteWindowsScriptStrategy implements RemoteScriptStrategy {
33
+
34
+ home(): string {
35
+ return 'PowerShell -Command $HOME';
36
+ }
37
+
38
+ exec(): string {
39
+ return 'PowerShell -Command';
40
+ }
41
+
42
+ downloadFile(url: string, output: string): string {
43
+ return `PowerShell -Command Invoke-WebRequest -Uri "${url}" -OutFile ${output}`;
44
+ }
45
+
46
+ unzip(file: string, directory: string): string {
47
+ return `tar -xf "${file}" -C "${directory}"`;
48
+ }
49
+
50
+ mkdir(path: string): string {
51
+ return `PowerShell -Command New-Item -Force -itemType Directory -Path "${path}"`;
52
+ }
53
+
54
+ joinPath(...segments: string[]): string {
55
+ return segments.join('\\');
56
+ }
57
+
58
+ joinScript(...segments: string[]): string {
59
+ return segments.join('\r\n');
60
+ }
61
+ }
62
+
63
+ @injectable()
64
+ export class RemotePosixScriptStrategy implements RemoteScriptStrategy {
65
+
66
+ home(): string {
67
+ return 'eval echo ~';
68
+ }
69
+
70
+ exec(): string {
71
+ return 'sh -c';
72
+ }
73
+
74
+ downloadFile(url: string, output: string): string {
75
+ return `
76
+ if [ "$(command -v wget)" ]; then
77
+ echo "Downloading using wget"
78
+ wget -O "${output}" "${url}"
79
+ elif [ "$(command -v curl)" ]; then
80
+ echo "Downloading using curl"
81
+ curl "${url}" --output "${output}"
82
+ else
83
+ echo "Failed to find wget or curl."
84
+ exit 1
85
+ fi
86
+ `.trim();
87
+ }
88
+
89
+ unzip(file: string, directory: string): string {
90
+ return `tar -xf "${file}" -C "${directory}"`;
91
+ }
92
+
93
+ mkdir(path: string): string {
94
+ return `mkdir -p "${path}"`;
95
+ }
96
+
97
+ joinPath(...segments: string[]): string {
98
+ return segments.join('/');
99
+ }
100
+
101
+ joinScript(...segments: string[]): string {
102
+ return segments.join('\n');
103
+ }
104
+ }
105
+
106
+ @injectable()
107
+ export class RemoteSetupScriptService {
108
+
109
+ @inject(RemoteWindowsScriptStrategy)
110
+ protected windowsStrategy: RemoteWindowsScriptStrategy;
111
+
112
+ @inject(RemotePosixScriptStrategy)
113
+ protected posixStrategy: RemotePosixScriptStrategy;
114
+
115
+ protected getStrategy(platform: RemotePlatform): RemoteScriptStrategy {
116
+ return platform.os === OS.Type.Windows ? this.windowsStrategy : this.posixStrategy;
117
+ }
118
+
119
+ home(platform: RemotePlatform): string {
120
+ return this.getStrategy(platform).home();
121
+ }
122
+
123
+ exec(platform: RemotePlatform): string {
124
+ return this.getStrategy(platform).exec();
125
+ }
126
+
127
+ downloadFile(platform: RemotePlatform, url: string, output: string): string {
128
+ return this.getStrategy(platform).downloadFile(url, output);
129
+ }
130
+
131
+ unzip(platform: RemotePlatform, file: string, directory: string): string {
132
+ return this.getStrategy(platform).unzip(file, directory);
133
+ }
134
+
135
+ mkdir(platform: RemotePlatform, path: string): string {
136
+ return this.getStrategy(platform).mkdir(path);
137
+ }
138
+
139
+ joinPath(platform: RemotePlatform, ...segments: string[]): string {
140
+ return this.getStrategy(platform).joinPath(...segments);
141
+ }
142
+
143
+ joinScript(platform: RemotePlatform, ...segments: string[]): string {
144
+ return this.getStrategy(platform).joinScript(...segments);
145
+ }
146
+ }