@theia/dev-container 1.48.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/README.md +43 -0
- package/lib/dev-container-server/dev-container-server.d.ts +2 -0
- package/lib/dev-container-server/dev-container-server.d.ts.map +1 -0
- package/lib/dev-container-server/dev-container-server.js +48 -0
- package/lib/dev-container-server/dev-container-server.js.map +1 -0
- package/lib/electron-browser/container-connection-contribution.d.ts +22 -0
- package/lib/electron-browser/container-connection-contribution.d.ts.map +1 -0
- package/lib/electron-browser/container-connection-contribution.js +106 -0
- package/lib/electron-browser/container-connection-contribution.js.map +1 -0
- package/lib/electron-browser/container-output-provider.d.ts +8 -0
- package/lib/electron-browser/container-output-provider.d.ts.map +1 -0
- package/lib/electron-browser/container-output-provider.js +41 -0
- package/lib/electron-browser/container-output-provider.js.map +1 -0
- package/lib/electron-browser/dev-container-frontend-module.d.ts +4 -0
- package/lib/electron-browser/dev-container-frontend-module.d.ts.map +1 -0
- package/lib/electron-browser/dev-container-frontend-module.js +33 -0
- package/lib/electron-browser/dev-container-frontend-module.js.map +1 -0
- package/lib/electron-common/container-output-provider.d.ts +4 -0
- package/lib/electron-common/container-output-provider.d.ts.map +1 -0
- package/lib/electron-common/container-output-provider.js +18 -0
- package/lib/electron-common/container-output-provider.js.map +1 -0
- package/lib/electron-common/remote-container-connection-provider.d.ts +27 -0
- package/lib/electron-common/remote-container-connection-provider.d.ts.map +1 -0
- package/lib/electron-common/remote-container-connection-provider.js +21 -0
- package/lib/electron-common/remote-container-connection-provider.js.map +1 -0
- package/lib/electron-node/dev-container-backend-module.d.ts +5 -0
- package/lib/electron-node/dev-container-backend-module.d.ts.map +1 -0
- package/lib/electron-node/dev-container-backend-module.js +44 -0
- package/lib/electron-node/dev-container-backend-module.js.map +1 -0
- package/lib/electron-node/dev-container-file-service.d.ts +10 -0
- package/lib/electron-node/dev-container-file-service.d.ts.map +1 -0
- package/lib/electron-node/dev-container-file-service.js +73 -0
- package/lib/electron-node/dev-container-file-service.js.map +1 -0
- package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.d.ts +29 -0
- package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.d.ts.map +1 -0
- package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.js +133 -0
- package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.js.map +1 -0
- package/lib/electron-node/devcontainer-file.d.ts +323 -0
- package/lib/electron-node/devcontainer-file.d.ts.map +1 -0
- package/lib/electron-node/devcontainer-file.js +18 -0
- package/lib/electron-node/devcontainer-file.js.map +1 -0
- package/lib/electron-node/docker-container-service.d.ts +23 -0
- package/lib/electron-node/docker-container-service.d.ts.map +1 -0
- package/lib/electron-node/docker-container-service.js +114 -0
- package/lib/electron-node/docker-container-service.js.map +1 -0
- package/lib/electron-node/remote-container-connection-provider.d.ts +74 -0
- package/lib/electron-node/remote-container-connection-provider.d.ts.map +1 -0
- package/lib/electron-node/remote-container-connection-provider.js +241 -0
- package/lib/electron-node/remote-container-connection-provider.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +26 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +55 -0
- package/src/dev-container-server/dev-container-server.ts +53 -0
- package/src/electron-browser/container-connection-contribution.ts +103 -0
- package/src/electron-browser/container-output-provider.ts +36 -0
- package/src/electron-browser/dev-container-frontend-module.ts +33 -0
- package/src/electron-common/container-output-provider.ts +19 -0
- package/src/electron-common/remote-container-connection-provider.ts +49 -0
- package/src/electron-node/dev-container-backend-module.ts +47 -0
- package/src/electron-node/dev-container-file-service.ts +72 -0
- package/src/electron-node/devcontainer-contributions/main-container-creation-contributions.ts +140 -0
- package/src/electron-node/devcontainer-file.ts +380 -0
- package/src/electron-node/docker-container-service.ts +124 -0
- package/src/electron-node/remote-container-connection-provider.ts +294 -0
- package/src/package.spec.ts +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<div align='center'>
|
|
2
|
+
|
|
3
|
+
<br />
|
|
4
|
+
|
|
5
|
+
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
+
|
|
7
|
+
<h2>ECLIPSE THEIA - DEV-CONTAINER EXTENSION</h2>
|
|
8
|
+
|
|
9
|
+
<hr />
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
The `@theia/dev-container` extension provides functionality to create, start and connect to development containers similiar to the
|
|
16
|
+
[vscode Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
|
|
17
|
+
|
|
18
|
+
The full devcontainer.json Schema can be found [here](https://containers.dev/implementors/json_reference/).
|
|
19
|
+
Currently only a small number of configuration file properties are implemented. Those include the following:
|
|
20
|
+
- name
|
|
21
|
+
- Image
|
|
22
|
+
- dockerfile/build.dockerfile
|
|
23
|
+
- build.context
|
|
24
|
+
- location
|
|
25
|
+
- forwardPorts
|
|
26
|
+
- mounts
|
|
27
|
+
|
|
28
|
+
see `main-container-creation-contributions.ts` for how to implementations or how to implement additional ones.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## Additional Information
|
|
32
|
+
|
|
33
|
+
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
34
|
+
- [Theia - Website](https://theia-ide.org/)
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
39
|
+
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
40
|
+
|
|
41
|
+
## Trademark
|
|
42
|
+
"Theia" is a trademark of the Eclipse Foundation
|
|
43
|
+
https://www.eclipse.org/theia
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-container-server.d.ts","sourceRoot":"","sources":["../../src/dev-container-server/dev-container-server.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2024 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
|
+
const net_1 = require("net");
|
|
19
|
+
const process_1 = require("process");
|
|
20
|
+
/**
|
|
21
|
+
* this node.js Program is supposed to be executed by an docker exec session inside a docker container.
|
|
22
|
+
* It uses a tty session to listen on stdin and send on stdout all communication with the theia backend running inside the container.
|
|
23
|
+
*/
|
|
24
|
+
let backendPort = undefined;
|
|
25
|
+
process_1.argv.slice(2).forEach(arg => {
|
|
26
|
+
if (arg.startsWith('-target-port')) {
|
|
27
|
+
backendPort = parseInt(arg.split('=')[1]);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
if (!backendPort) {
|
|
31
|
+
throw new Error('please start with -target-port={port number}');
|
|
32
|
+
}
|
|
33
|
+
if (process_1.stdin.isTTY) {
|
|
34
|
+
process_1.stdin.setRawMode(true);
|
|
35
|
+
}
|
|
36
|
+
const connection = (0, net_1.createConnection)(backendPort, '0.0.0.0');
|
|
37
|
+
connection.pipe(process_1.stdout);
|
|
38
|
+
process_1.stdin.pipe(connection);
|
|
39
|
+
connection.on('error', error => {
|
|
40
|
+
console.error('connection error', error);
|
|
41
|
+
});
|
|
42
|
+
connection.on('close', () => {
|
|
43
|
+
console.log('connection closed');
|
|
44
|
+
process.exit(0);
|
|
45
|
+
});
|
|
46
|
+
// keep the process running
|
|
47
|
+
setInterval(() => { }, 1 << 30);
|
|
48
|
+
//# sourceMappingURL=dev-container-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-container-server.js","sourceRoot":"","sources":["../../src/dev-container-server/dev-container-server.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,6BAAuC;AACvC,qCAA8C;AAE9C;;;GAGG;AAEH,IAAI,WAAW,GAAuB,SAAS,CAAC;AAChD,cAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;IACxB,IAAI,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE;QAChC,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7C;AACL,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,WAAW,EAAE;IACd,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;CACnE;AACD,IAAI,eAAK,CAAC,KAAK,EAAE;IACb,eAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;CAC1B;AACD,MAAM,UAAU,GAAG,IAAA,sBAAgB,EAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAE5D,UAAU,CAAC,IAAI,CAAC,gBAAM,CAAC,CAAC;AACxB,eAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAEvB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;IAC3B,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;IACxB,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC;AAEH,2BAA2B;AAC3B,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AbstractRemoteRegistryContribution, RemoteRegistry } from '@theia/remote/lib/electron-browser/remote-registry-contribution';
|
|
2
|
+
import { RemoteContainerConnectionProvider } from '../electron-common/remote-container-connection-provider';
|
|
3
|
+
import { RemotePreferences } from '@theia/remote/lib/electron-browser/remote-preferences';
|
|
4
|
+
import { WorkspaceStorageService } from '@theia/workspace/lib/browser/workspace-storage-service';
|
|
5
|
+
import { Command, QuickInputService } from '@theia/core';
|
|
6
|
+
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
|
|
7
|
+
import { ContainerOutputProvider } from './container-output-provider';
|
|
8
|
+
export declare namespace RemoteContainerCommands {
|
|
9
|
+
const REOPEN_IN_CONTAINER: Command;
|
|
10
|
+
}
|
|
11
|
+
export declare class ContainerConnectionContribution extends AbstractRemoteRegistryContribution {
|
|
12
|
+
protected readonly connectionProvider: RemoteContainerConnectionProvider;
|
|
13
|
+
protected readonly remotePreferences: RemotePreferences;
|
|
14
|
+
protected readonly workspaceStorageService: WorkspaceStorageService;
|
|
15
|
+
protected readonly workspaceService: WorkspaceService;
|
|
16
|
+
protected readonly quickInputService: QuickInputService;
|
|
17
|
+
protected readonly containerOutputProvider: ContainerOutputProvider;
|
|
18
|
+
registerRemoteCommands(registry: RemoteRegistry): void;
|
|
19
|
+
openInContainer(): Promise<void>;
|
|
20
|
+
getOrSelectDevcontainerFile(): Promise<string | undefined>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=container-connection-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-connection-contribution.d.ts","sourceRoot":"","sources":["../../src/electron-browser/container-connection-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,kCAAkC,EAAE,cAAc,EAAE,MAAM,iEAAiE,CAAC;AACrI,OAAO,EAAqB,iCAAiC,EAAE,MAAM,yDAAyD,CAAC;AAC/H,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,yBAAiB,uBAAuB,CAAC;IAC9B,MAAM,mBAAmB,SAIC,CAAC;CACrC;AAGD,qBACa,+BAAgC,SAAQ,kCAAkC;IAGnF,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,iCAAiC,CAAC;IAGzE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAGpE,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAGtD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAEpE,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAMhD,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAwBhC,2BAA2B,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAiBnE"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2024 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.ContainerConnectionContribution = exports.RemoteContainerCommands = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const remote_registry_contribution_1 = require("@theia/remote/lib/electron-browser/remote-registry-contribution");
|
|
22
|
+
const remote_container_connection_provider_1 = require("../electron-common/remote-container-connection-provider");
|
|
23
|
+
const remote_preferences_1 = require("@theia/remote/lib/electron-browser/remote-preferences");
|
|
24
|
+
const workspace_storage_service_1 = require("@theia/workspace/lib/browser/workspace-storage-service");
|
|
25
|
+
const core_1 = require("@theia/core");
|
|
26
|
+
const workspace_service_1 = require("@theia/workspace/lib/browser/workspace-service");
|
|
27
|
+
const container_output_provider_1 = require("./container-output-provider");
|
|
28
|
+
var RemoteContainerCommands;
|
|
29
|
+
(function (RemoteContainerCommands) {
|
|
30
|
+
RemoteContainerCommands.REOPEN_IN_CONTAINER = core_1.Command.toLocalizedCommand({
|
|
31
|
+
id: 'dev-container:reopen-in-container',
|
|
32
|
+
label: 'Reopen in Container',
|
|
33
|
+
category: 'Dev Container'
|
|
34
|
+
}, 'theia/dev-container/connect');
|
|
35
|
+
})(RemoteContainerCommands = exports.RemoteContainerCommands || (exports.RemoteContainerCommands = {}));
|
|
36
|
+
const LAST_USED_CONTAINER = 'lastUsedContainer';
|
|
37
|
+
let ContainerConnectionContribution = class ContainerConnectionContribution extends remote_registry_contribution_1.AbstractRemoteRegistryContribution {
|
|
38
|
+
registerRemoteCommands(registry) {
|
|
39
|
+
registry.registerCommand(RemoteContainerCommands.REOPEN_IN_CONTAINER, {
|
|
40
|
+
execute: () => this.openInContainer()
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async openInContainer() {
|
|
44
|
+
const devcontainerFile = await this.getOrSelectDevcontainerFile();
|
|
45
|
+
if (!devcontainerFile) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const lastContainerInfoKey = `${LAST_USED_CONTAINER}:${devcontainerFile}`;
|
|
49
|
+
const lastContainerInfo = await this.workspaceStorageService.getData(lastContainerInfoKey);
|
|
50
|
+
this.containerOutputProvider.openChannel();
|
|
51
|
+
const connectionResult = await this.connectionProvider.connectToContainer({
|
|
52
|
+
nodeDownloadTemplate: this.remotePreferences['remote.nodeDownloadTemplate'],
|
|
53
|
+
lastContainerInfo,
|
|
54
|
+
devcontainerFile
|
|
55
|
+
});
|
|
56
|
+
this.workspaceStorageService.setData(lastContainerInfoKey, {
|
|
57
|
+
id: connectionResult.containerId,
|
|
58
|
+
lastUsed: Date.now()
|
|
59
|
+
});
|
|
60
|
+
this.openRemote(connectionResult.port, false, connectionResult.workspacePath);
|
|
61
|
+
}
|
|
62
|
+
async getOrSelectDevcontainerFile() {
|
|
63
|
+
var _a;
|
|
64
|
+
const devcontainerFiles = await this.connectionProvider.getDevContainerFiles();
|
|
65
|
+
if (devcontainerFiles.length === 1) {
|
|
66
|
+
return devcontainerFiles[0].path;
|
|
67
|
+
}
|
|
68
|
+
return (_a = (await this.quickInputService.pick(devcontainerFiles.map(file => ({
|
|
69
|
+
type: 'item',
|
|
70
|
+
label: file.name,
|
|
71
|
+
description: file.path,
|
|
72
|
+
file: file.path,
|
|
73
|
+
})), {
|
|
74
|
+
title: 'Select a devcontainer.json file'
|
|
75
|
+
}))) === null || _a === void 0 ? void 0 : _a.file;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
(0, tslib_1.__decorate)([
|
|
79
|
+
(0, inversify_1.inject)(remote_container_connection_provider_1.RemoteContainerConnectionProvider),
|
|
80
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
81
|
+
], ContainerConnectionContribution.prototype, "connectionProvider", void 0);
|
|
82
|
+
(0, tslib_1.__decorate)([
|
|
83
|
+
(0, inversify_1.inject)(remote_preferences_1.RemotePreferences),
|
|
84
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
85
|
+
], ContainerConnectionContribution.prototype, "remotePreferences", void 0);
|
|
86
|
+
(0, tslib_1.__decorate)([
|
|
87
|
+
(0, inversify_1.inject)(workspace_storage_service_1.WorkspaceStorageService),
|
|
88
|
+
(0, tslib_1.__metadata)("design:type", workspace_storage_service_1.WorkspaceStorageService)
|
|
89
|
+
], ContainerConnectionContribution.prototype, "workspaceStorageService", void 0);
|
|
90
|
+
(0, tslib_1.__decorate)([
|
|
91
|
+
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
92
|
+
(0, tslib_1.__metadata)("design:type", workspace_service_1.WorkspaceService)
|
|
93
|
+
], ContainerConnectionContribution.prototype, "workspaceService", void 0);
|
|
94
|
+
(0, tslib_1.__decorate)([
|
|
95
|
+
(0, inversify_1.inject)(core_1.QuickInputService),
|
|
96
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
97
|
+
], ContainerConnectionContribution.prototype, "quickInputService", void 0);
|
|
98
|
+
(0, tslib_1.__decorate)([
|
|
99
|
+
(0, inversify_1.inject)(container_output_provider_1.ContainerOutputProvider),
|
|
100
|
+
(0, tslib_1.__metadata)("design:type", container_output_provider_1.ContainerOutputProvider)
|
|
101
|
+
], ContainerConnectionContribution.prototype, "containerOutputProvider", void 0);
|
|
102
|
+
ContainerConnectionContribution = (0, tslib_1.__decorate)([
|
|
103
|
+
(0, inversify_1.injectable)()
|
|
104
|
+
], ContainerConnectionContribution);
|
|
105
|
+
exports.ContainerConnectionContribution = ContainerConnectionContribution;
|
|
106
|
+
//# sourceMappingURL=container-connection-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-connection-contribution.js","sourceRoot":"","sources":["../../src/electron-browser/container-connection-contribution.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OutputChannel, OutputChannelManager } from '@theia/output/lib/browser/output-channel';
|
|
2
|
+
export declare class ContainerOutputProvider implements ContainerOutputProvider {
|
|
3
|
+
protected readonly outputChannelManager: OutputChannelManager;
|
|
4
|
+
protected currentChannel?: OutputChannel;
|
|
5
|
+
openChannel(): void;
|
|
6
|
+
onRemoteOutput(output: string): void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=container-output-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-output-provider.d.ts","sourceRoot":"","sources":["../../src/electron-browser/container-output-provider.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAE/F,qBACa,uBAAwB,YAAW,uBAAuB;IAGnE,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAE9D,SAAS,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC;IAEzC,WAAW,IAAI,IAAI;IAKnB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAGvC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2024 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.ContainerOutputProvider = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const output_channel_1 = require("@theia/output/lib/browser/output-channel");
|
|
22
|
+
let ContainerOutputProvider = class ContainerOutputProvider {
|
|
23
|
+
openChannel() {
|
|
24
|
+
this.currentChannel = this.outputChannelManager.getChannel('Container');
|
|
25
|
+
this.currentChannel.show();
|
|
26
|
+
}
|
|
27
|
+
;
|
|
28
|
+
onRemoteOutput(output) {
|
|
29
|
+
var _a;
|
|
30
|
+
(_a = this.currentChannel) === null || _a === void 0 ? void 0 : _a.appendLine(output);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
(0, tslib_1.__decorate)([
|
|
34
|
+
(0, inversify_1.inject)(output_channel_1.OutputChannelManager),
|
|
35
|
+
(0, tslib_1.__metadata)("design:type", output_channel_1.OutputChannelManager)
|
|
36
|
+
], ContainerOutputProvider.prototype, "outputChannelManager", void 0);
|
|
37
|
+
ContainerOutputProvider = (0, tslib_1.__decorate)([
|
|
38
|
+
(0, inversify_1.injectable)()
|
|
39
|
+
], ContainerOutputProvider);
|
|
40
|
+
exports.ContainerOutputProvider = ContainerOutputProvider;
|
|
41
|
+
//# sourceMappingURL=container-output-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-output-provider.js","sourceRoot":"","sources":["../../src/electron-browser/container-output-provider.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,4DAAkE;AAClE,6EAA+F;AAG/F,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAOhC,WAAW;QACP,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACxE,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAAA,CAAC;IAEF,cAAc,CAAC,MAAc;;QACzB,MAAA,IAAI,CAAC,cAAc,0CAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACJ,CAAA;AAZG;IADC,IAAA,kBAAM,EAAC,qCAAoB,CAAC;2CACY,qCAAoB;qEAAC;AAHrD,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CAenC;AAfY,0DAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-container-frontend-module.d.ts","sourceRoot":"","sources":["../../src/electron-browser/dev-container-frontend-module.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAO/D,wBAUG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// *****************************************************************************
|
|
4
|
+
// Copyright (C) 2024 Typefox and others.
|
|
5
|
+
//
|
|
6
|
+
// This program and the accompanying materials are made available under the
|
|
7
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
+
//
|
|
10
|
+
// This Source Code may also be made available under the following Secondary
|
|
11
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
+
// with the GNU Classpath Exception which is available at
|
|
14
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
15
|
+
//
|
|
16
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
17
|
+
// *****************************************************************************
|
|
18
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
+
const remote_registry_contribution_1 = require("@theia/remote/lib/electron-browser/remote-registry-contribution");
|
|
20
|
+
const remote_container_connection_provider_1 = require("../electron-common/remote-container-connection-provider");
|
|
21
|
+
const container_connection_contribution_1 = require("./container-connection-contribution");
|
|
22
|
+
const service_connection_provider_1 = require("@theia/core/lib/browser/messaging/service-connection-provider");
|
|
23
|
+
const container_output_provider_1 = require("./container-output-provider");
|
|
24
|
+
exports.default = new inversify_1.ContainerModule(bind => {
|
|
25
|
+
bind(container_connection_contribution_1.ContainerConnectionContribution).toSelf().inSingletonScope();
|
|
26
|
+
bind(remote_registry_contribution_1.RemoteRegistryContribution).toService(container_connection_contribution_1.ContainerConnectionContribution);
|
|
27
|
+
bind(container_output_provider_1.ContainerOutputProvider).toSelf().inSingletonScope();
|
|
28
|
+
bind(remote_container_connection_provider_1.RemoteContainerConnectionProvider).toDynamicValue(ctx => {
|
|
29
|
+
const outputProvider = ctx.container.get(container_output_provider_1.ContainerOutputProvider);
|
|
30
|
+
return service_connection_provider_1.ServiceConnectionProvider.createLocalProxy(ctx.container, remote_container_connection_provider_1.RemoteContainerConnectionProviderPath, outputProvider);
|
|
31
|
+
}).inSingletonScope();
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=dev-container-frontend-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-container-frontend-module.js","sourceRoot":"","sources":["../../src/electron-browser/dev-container-frontend-module.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;AAChF,4DAA+D;AAC/D,kHAA6G;AAC7G,kHAAmJ;AACnJ,2FAAsF;AACtF,+GAA0G;AAC1G,2EAAsE;AAEtE,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,mEAA+B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAClE,IAAI,CAAC,yDAA0B,CAAC,CAAC,SAAS,CAAC,mEAA+B,CAAC,CAAC;IAE5E,IAAI,CAAC,mDAAuB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAE1D,IAAI,CAAC,wEAAiC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QACzD,MAAM,cAAc,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mDAAuB,CAAC,CAAC;QAClE,OAAO,uDAAyB,CAAC,gBAAgB,CAAoC,GAAG,CAAC,SAAS,EAAE,4EAAqC,EAAE,cAAc,CAAC,CAAC;IAC/J,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-output-provider.d.ts","sourceRoot":"","sources":["../../src/electron-common/container-output-provider.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,uBAAuB;IACpC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2024 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
|
+
//# sourceMappingURL=container-output-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-output-provider.js","sourceRoot":"","sources":["../../src/electron-common/container-output-provider.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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RpcServer } from '@theia/core';
|
|
2
|
+
import { ContainerOutputProvider } from './container-output-provider';
|
|
3
|
+
export declare const RemoteContainerConnectionProviderPath = "/remote/container";
|
|
4
|
+
export declare const RemoteContainerConnectionProvider: unique symbol;
|
|
5
|
+
export interface ContainerConnectionOptions {
|
|
6
|
+
nodeDownloadTemplate?: string;
|
|
7
|
+
lastContainerInfo?: LastContainerInfo;
|
|
8
|
+
devcontainerFile: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LastContainerInfo {
|
|
11
|
+
id: string;
|
|
12
|
+
lastUsed: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ContainerConnectionResult {
|
|
15
|
+
port: string;
|
|
16
|
+
workspacePath: string;
|
|
17
|
+
containerId: string;
|
|
18
|
+
}
|
|
19
|
+
export interface DevContainerFile {
|
|
20
|
+
name: string;
|
|
21
|
+
path: string;
|
|
22
|
+
}
|
|
23
|
+
export interface RemoteContainerConnectionProvider extends RpcServer<ContainerOutputProvider> {
|
|
24
|
+
connectToContainer(options: ContainerConnectionOptions): Promise<ContainerConnectionResult>;
|
|
25
|
+
getDevContainerFiles(): Promise<DevContainerFile[]>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=remote-container-connection-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-container-connection-provider.d.ts","sourceRoot":"","sources":["../../src/electron-common/remote-container-connection-provider.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,eAAO,MAAM,qCAAqC,sBAAsB,CAAC;AAEzE,eAAO,MAAM,iCAAiC,eAA8C,CAAC;AAE7F,MAAM,WAAW,0BAA0B;IACvC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iCAAkC,SAAQ,SAAS,CAAC,uBAAuB,CAAC;IACzF,kBAAkB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC5F,oBAAoB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;CACvD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2024 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.RemoteContainerConnectionProvider = exports.RemoteContainerConnectionProviderPath = void 0;
|
|
18
|
+
// *****************************************************************************
|
|
19
|
+
exports.RemoteContainerConnectionProviderPath = '/remote/container';
|
|
20
|
+
exports.RemoteContainerConnectionProvider = Symbol('RemoteContainerConnectionProvider');
|
|
21
|
+
//# sourceMappingURL=remote-container-connection-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-container-connection-provider.js","sourceRoot":"","sources":["../../src/electron-common/remote-container-connection-provider.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;;;AAKhF,gFAAgF;AACnE,QAAA,qCAAqC,GAAG,mBAAmB,CAAC;AAE5D,QAAA,iCAAiC,GAAG,MAAM,CAAC,mCAAmC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-container-backend-module.d.ts","sourceRoot":"","sources":["../../src/electron-node/dev-container-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAU/D,eAAO,MAAM,sBAAsB,iBAajC,CAAC;;AAEH,wBAKG"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2024 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.remoteConnectionModule = void 0;
|
|
19
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
20
|
+
const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
|
|
21
|
+
const remote_container_connection_provider_1 = require("./remote-container-connection-provider");
|
|
22
|
+
const remote_container_connection_provider_2 = require("../electron-common/remote-container-connection-provider");
|
|
23
|
+
const docker_container_service_1 = require("./docker-container-service");
|
|
24
|
+
const core_1 = require("@theia/core");
|
|
25
|
+
const main_container_creation_contributions_1 = require("./devcontainer-contributions/main-container-creation-contributions");
|
|
26
|
+
const dev_container_file_service_1 = require("./dev-container-file-service");
|
|
27
|
+
exports.remoteConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind, bindBackendService }) => {
|
|
28
|
+
(0, core_1.bindContributionProvider)(bind, docker_container_service_1.ContainerCreationContribution);
|
|
29
|
+
(0, main_container_creation_contributions_1.registerContainerCreationContributions)(bind);
|
|
30
|
+
bind(remote_container_connection_provider_1.DevContainerConnectionProvider).toSelf().inSingletonScope();
|
|
31
|
+
bind(remote_container_connection_provider_2.RemoteContainerConnectionProvider).toService(remote_container_connection_provider_1.DevContainerConnectionProvider);
|
|
32
|
+
bind(core_1.ConnectionHandler).toDynamicValue(ctx => new core_1.RpcConnectionHandler(remote_container_connection_provider_2.RemoteContainerConnectionProviderPath, client => {
|
|
33
|
+
const server = ctx.container.get(remote_container_connection_provider_2.RemoteContainerConnectionProvider);
|
|
34
|
+
server.setClient(client);
|
|
35
|
+
client.onDidCloseConnection(() => server.dispose());
|
|
36
|
+
return server;
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
39
|
+
exports.default = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
40
|
+
bind(docker_container_service_1.DockerContainerService).toSelf().inSingletonScope();
|
|
41
|
+
bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(exports.remoteConnectionModule);
|
|
42
|
+
bind(dev_container_file_service_1.DevContainerFileService).toSelf().inSingletonScope();
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=dev-container-backend-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-container-backend-module.js","sourceRoot":"","sources":["../../src/electron-node/dev-container-backend-module.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,4DAA+D;AAC/D,4GAAuG;AACvG,iGAAwF;AACxF,kHAAmJ;AACnJ,yEAAmG;AACnG,sCAAgG;AAChG,8HAA4H;AAC5H,6EAAuE;AAG1D,QAAA,sBAAsB,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE;IACpG,IAAA,+BAAwB,EAAC,IAAI,EAAE,wDAA6B,CAAC,CAAC;IAC9D,IAAA,8EAAsC,EAAC,IAAI,CAAC,CAAC;IAE7C,IAAI,CAAC,qEAA8B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACjE,IAAI,CAAC,wEAAiC,CAAC,CAAC,SAAS,CAAC,qEAA8B,CAAC,CAAC;IAClF,IAAI,CAAC,wBAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CACzC,IAAI,2BAAoB,CAA0B,4EAAqC,EAAE,MAAM,CAAC,EAAE;QAC9F,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAoC,wEAAiC,CAAC,CAAC;QACvG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzB,MAAM,CAAC,oBAAoB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC,CAAC,CAAC;AACZ,CAAC,CAAC,CAAC;AAEH,kBAAe,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IACjE,IAAI,CAAC,iDAAsB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACzD,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,8BAAsB,CAAC,CAAC;IAExE,IAAI,CAAC,oDAAuB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;AAC9D,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WorkspaceServer } from '@theia/workspace/lib/common';
|
|
2
|
+
import { DevContainerFile } from '../electron-common/remote-container-connection-provider';
|
|
3
|
+
import { DevContainerConfiguration } from './devcontainer-file';
|
|
4
|
+
export declare class DevContainerFileService {
|
|
5
|
+
protected readonly workspaceServer: WorkspaceServer;
|
|
6
|
+
getConfiguration(path: string): Promise<DevContainerConfiguration>;
|
|
7
|
+
getAvailableFiles(): Promise<DevContainerFile[]>;
|
|
8
|
+
protected searchForDevontainerJsonFiles(directory: string, depth: number): Promise<string[]>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=dev-container-file-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-container-file-service.d.ts","sourceRoot":"","sources":["../../src/electron-node/dev-container-file-service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yDAAyD,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAKhE,qBACa,uBAAuB;IAGhC,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAE9C,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAUlE,iBAAiB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;cAetC,6BAA6B,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAgBrG"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2024 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.DevContainerFileService = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const common_1 = require("@theia/workspace/lib/common");
|
|
22
|
+
const jsonc_parser_1 = require("jsonc-parser");
|
|
23
|
+
const fs = require("@theia/core/shared/fs-extra");
|
|
24
|
+
const core_1 = require("@theia/core");
|
|
25
|
+
let DevContainerFileService = class DevContainerFileService {
|
|
26
|
+
async getConfiguration(path) {
|
|
27
|
+
const configuration = (0, jsonc_parser_1.parse)(await fs.readFile(path, 'utf-8').catch(() => '0'));
|
|
28
|
+
if (!configuration) {
|
|
29
|
+
throw new Error(`devcontainer file ${path} could not be parsed`);
|
|
30
|
+
}
|
|
31
|
+
configuration.location = path;
|
|
32
|
+
return configuration;
|
|
33
|
+
}
|
|
34
|
+
async getAvailableFiles() {
|
|
35
|
+
const workspace = await this.workspaceServer.getMostRecentlyUsedWorkspace();
|
|
36
|
+
if (!workspace) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
const devcontainerPath = new core_1.URI(workspace).path.join('.devcontainer').fsPath();
|
|
40
|
+
return (await this.searchForDevontainerJsonFiles(devcontainerPath, 1)).map(file => {
|
|
41
|
+
var _a;
|
|
42
|
+
return ({
|
|
43
|
+
name: (_a = (0, jsonc_parser_1.parse)(fs.readFileSync(file, 'utf-8')).name) !== null && _a !== void 0 ? _a : 'devcontainer',
|
|
44
|
+
path: file
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
async searchForDevontainerJsonFiles(directory, depth) {
|
|
49
|
+
if (depth < 0) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
const filesPaths = (await fs.readdir(directory)).map(file => new core_1.Path(directory).join(file).fsPath());
|
|
53
|
+
const devcontainerFiles = [];
|
|
54
|
+
for (const file of filesPaths) {
|
|
55
|
+
if (file.endsWith('devcontainer.json')) {
|
|
56
|
+
devcontainerFiles.push(file);
|
|
57
|
+
}
|
|
58
|
+
else if ((await fs.stat(file)).isDirectory()) {
|
|
59
|
+
devcontainerFiles.push(...await this.searchForDevontainerJsonFiles(file, depth - 1));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return devcontainerFiles;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
(0, tslib_1.__decorate)([
|
|
66
|
+
(0, inversify_1.inject)(common_1.WorkspaceServer),
|
|
67
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
68
|
+
], DevContainerFileService.prototype, "workspaceServer", void 0);
|
|
69
|
+
DevContainerFileService = (0, tslib_1.__decorate)([
|
|
70
|
+
(0, inversify_1.injectable)()
|
|
71
|
+
], DevContainerFileService);
|
|
72
|
+
exports.DevContainerFileService = DevContainerFileService;
|
|
73
|
+
//# sourceMappingURL=dev-container-file-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-container-file-service.js","sourceRoot":"","sources":["../../src/electron-node/dev-container-file-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,4DAAkE;AAClE,wDAA8D;AAG9D,+CAAqC;AACrC,kDAAkD;AAClD,sCAAwC;AAGxC,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAKhC,KAAK,CAAC,gBAAgB,CAAC,IAAY;QAC/B,MAAM,aAAa,GAA8B,IAAA,oBAAK,EAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAA8B,CAAC;QACvI,IAAI,CAAC,aAAa,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,sBAAsB,CAAC,CAAC;SACpE;QAED,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC9B,OAAO,aAAa,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,iBAAiB;QACnB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,4BAA4B,EAAE,CAAC;QAC5E,IAAI,CAAC,SAAS,EAAE;YACZ,OAAO,EAAE,CAAC;SACb;QAED,MAAM,gBAAgB,GAAG,IAAI,UAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC;QAEhF,OAAO,CAAC,MAAM,IAAI,CAAC,6BAA6B,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;;YAAC,OAAA,CAAC;gBAChF,IAAI,EAAE,MAAA,IAAA,oBAAK,EAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,mCAAI,cAAc;gBAClE,IAAI,EAAE,IAAI;aACb,CAAC,CAAA;SAAA,CAAC,CAAC;IAER,CAAC;IAES,KAAK,CAAC,6BAA6B,CAAC,SAAiB,EAAE,KAAa;QAC1E,IAAI,KAAK,GAAG,CAAC,EAAE;YACX,OAAO,EAAE,CAAC;SACb;QACD,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,WAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAEtG,MAAM,iBAAiB,GAAG,EAAE,CAAC;QAC7B,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE;YAC3B,IAAI,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;gBACpC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE;gBAC5C,iBAAiB,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,6BAA6B,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;aACxF;SACJ;QACD,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ,CAAA;AA3CG;IADC,IAAA,kBAAM,EAAC,wBAAe,CAAC;;gEAC4B;AAH3C,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CA8CnC;AA9CY,0DAAuB"}
|