Skip to content

Commit 699d010

Browse files
committed
updating with dev file
1 parent 7e5dd9b commit 699d010

File tree

3 files changed

+106
-12
lines changed

3 files changed

+106
-12
lines changed

devfile.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# A devfile to setup a vscode-teletype extension in Che.
2+
3+
apiVersion: 1.0.0
4+
metadata:
5+
name: vscode-teletype
6+
7+
projects:
8+
9+
- name: vscode-teletype
10+
source:
11+
location: 'https://github.com/Rijul5/vscode-teletype'
12+
type: git
13+
branch: master
14+
15+
components:
16+
17+
- alias: vscode-extension-sidecar
18+
type: dockerimage
19+
image: eclipse/che-theia-endpoint-runtime:7.0.0-next
20+
endpoints:
21+
- name: theia-remote-endpoint
22+
port: 10000
23+
attributes:
24+
protocol: ws
25+
public: 'true'
26+
memoryLimit: 512M
27+
mountSources: true
28+
29+
- alias: git
30+
type: dockerimage
31+
image: sunix/git-devtools
32+
mountSources: true
33+
memoryLimit: 256M
34+
35+
- alias: che-dev
36+
type: dockerimage
37+
image: eclipse/che-theia-dev:nightly
38+
mountSources: true
39+
endpoints:
40+
- name: "theia-dev-flow"
41+
port: 3010
42+
attributes:
43+
protocol: http
44+
public: 'true'
45+
memoryLimit: 1024M
46+
47+
- id: redhat/vscode-yaml/latest
48+
type: chePlugin
49+
50+
- id: che-incubator/typescript/latest
51+
type: chePlugin
52+
memoryLimit: 1024M
53+
54+
- type: cheEditor
55+
alias: theia-editor
56+
id: eclipse/che-theia/7.0.0-next
57+
58+
commands:
59+
60+
- name: build ... vscode ext
61+
actions:
62+
- type: exec
63+
component: che-dev
64+
command: npm install -g vsce && npm install && vsce package
65+
workdir: /projects/vscode-teletype/
66+
67+
- name: run ... remote vscode ext
68+
actions:
69+
- type: exec
70+
component: vscode-extension-sidecar
71+
command: >
72+
export THEIA_PLUGIN_ENDPOINT_DISCOVERY_PORT='2504' &&
73+
export THEIA_PLUGINS='local-dir:///projects/vscode-teletype/' &&
74+
export THEIA_PLUGIN_ENDPOINT_PORT='10000' &&
75+
node /home/theia/lib/node/plugin-remote.js
76+
workdir: /home/theia/
77+
78+
- name: run ... HOSTED che-theia + detect remote vscode ext
79+
actions:
80+
- type: exec
81+
component: theia-editor
82+
command: >
83+
kill `cat /tmp/node_theiadev.pid` &> /dev/null;
84+
mkdir -p /tmp/theiadev_projects &&
85+
export THEIA_PLUGIN_ENDPOINT_DISCOVERY_PORT='2504' &&
86+
export CHE_PROJECTS_ROOT=/tmp/theiadev_projects &&
87+
node src-gen/backend/main.js /tmp/theiadev_projects --hostname=0.0.0.0 --port=3130 & echo $!> /tmp/node_theiadev.pid ; wait `cat /tmp/node_theiadev.pid`
88+
workdir: /home/theia
89+
90+

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
"displayName": "vscode-teletype",
44
"description": "VS Code Teletype extension for Creating CoEditing skeleton for Eclipse Che and Theia",
55
"types": "dist/index.d.ts",
6+
"publisher": "redhat",
67
"version": "0.0.1",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/Rijul5/vscode-teletype.git"
11+
},
712
"engines": {
813
"vscode": "^1.35.0"
914
},
@@ -23,9 +28,9 @@
2328
]
2429
},
2530
"scripts": {
26-
"vscode:prepublish": "webpack --mode production && npm run compile",
27-
"compile": "webpack --mode none && tsc -p ./",
28-
"watch": "webpack --mode none --watch && tsc -watch -p ./",
31+
"vscode:prepublish": "npm run compile",
32+
"compile": "tsc -p ./",
33+
"watch": "tsc -watch -p ./",
2934
"postinstall": "node ./node_modules/vscode/bin/install",
3035
"test": "npm run compile && node ./node_modules/vscode/bin/test"
3136
},

src/extension.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,27 @@ import * as vscode from 'vscode';
55
const fetch = require('node-fetch');
66

77
const constants = require('./constants');
8-
// const adapter = require('electron-webrtc-patched')();
8+
// const adapter = require('electron-webrtc')();
99
// const adapter = require('electron-webrtc')({ headless: true });
1010
const globalAny: any = global;
1111

12-
1312
// const { RTCSessionDescription } = require('wrtc');
1413
globalAny.window = {};
1514
globalAny.window = global;
1615
globalAny.window.fetch = fetch;
17-
18-
globalAny.RTCPeerConnection = require('wrtc').RTCPeerConnection;
16+
// globalAny.events = require('events').EventEmitter;
17+
// globalAny.RTCPeerConnection = require('electron-webrtc')().RTCPeerConnection;
1918
// globalAny.BlobBuilder = require("BlobBuilder");
2019

2120

2221
// globalAny.BinaryPack = require("binary-pack");
2322
// globalAny.XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
24-
// const adapter = require('wrtc');
25-
// // var wrtc = require('@elavoie/electron-webrtc')();
23+
const wrtc = require('wrtc');
24+
2625

27-
// globalAny.RTCPeerConnection = adapter.RTCPeerConnection;
28-
// globalAny.RTCSessionDescription = adapter.RTCSessionDescription;
29-
// globalAny.RTCIceCandidate = adapter.RTCIceCandidate;
26+
globalAny.RTCPeerConnection = wrtc.RTCPeerConnection;
27+
globalAny.RTCSessionDescription = wrtc.RTCSessionDescription;
28+
globalAny.RTCIceCandidate = wrtc.RTCIceCandidate;
3029

3130
// globalAny.WebSocket = require('ws');
3231

0 commit comments

Comments
 (0)