Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit c05451f

Browse files
committed
Add devfile and doc for developing of Che Theia remote plugin mechanism
Signed-off-by: Mykola Morhun <[email protected]>
1 parent a72bdb8 commit c05451f

File tree

3 files changed

+52
-27
lines changed

3 files changed

+52
-27
lines changed

CONTRIBUTING.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Contribute to Che-Theia
22
================
33

4+
Table of contents
5+
6+
- [Introduction](#introduction)
7+
- [Devfiles](#devfiles)
8+
- [Devfile for contributing to Theia or Che-Theia extensions or Che-plugins](#devfile-for-contributing-to-theia-or-che-theia-extensions-or-che-plugins)
9+
- [Contributing to other parts of Che Theia](#contributing-to-other-parts-of-che-theia)
10+
11+
## Introduction
12+
413
There are 3 contribution points:
514
- Theia
615
- Che-Theia extensions
@@ -129,10 +138,33 @@ To start che-theia in `dev-mode` with yarn (not using the production che-theia g
129138
Running dev theia would be located in the che-dev container and `theia-dev-flow` endpoint:
130139
![Che-Theia-dev-endpoint](https://raw.githubusercontent.com/eclipse/che-theia/assets/theia-dev-flow-endpoint.png)
131140

132-
133-
134141
### Just want to build the plugin and run with the existing Theia image
135142
If you do not have any changes on Theia or Che-theia extension, you could just build the plugins with `build ... containers-plugin` or `build ... factory-plugin`
136143
and run these plugins with the existing che-theia app:
137144
`run ... HOSTED che-theia + container-plugin` or `run ... HOSTED che-theia + factory-plugin`
138145

146+
## Contributing to other parts of Che Theia
147+
148+
### How to develop Che Theia remote plugin mechanism
149+
150+
_Please note, this section provides a flow how to develop remote plugin mechanism in Che Theia, but not a remote plugin._
151+
152+
First, create a workspace from prepared [devfile](https://github.com/eclipse/che-theia/blob/master/extensions/eclipse-che-theia-plugin-remote/devfile.yaml), which could be found in the `eclipse-che-theia-plugin-remote` extension folder.
153+
When workspace is ready:
154+
- Init Che Theia. This could be done with `che:theia init` command in `/projects/theia` folder or run the init command.
155+
Che Theia sources will be awailable at `/projects/theia/che/che-theia`.
156+
- Now one may make changes in Che Theia remote plugin mechanism in both (Che Theia and Remote plugin) sides.
157+
- Build Che Theia from `theia-dev` container by executing `yarn` in `/projects/theia` folder or by running corresponding command.
158+
- Put your remote plugin(s) into `/projects/remote-plugins/` directory.
159+
Note that the plugin(s) shouldn't have any external dependencies.
160+
For example, [this sample plugin](https://github.com/eclipse/che-theia-samples/tree/master/samples/hello-world-backend-plugin) might be used.
161+
- Run dev Che Theia and Remote plugins endpoint in `theia-dev` and `theia-remote-runtime-dev` containers correspondingly.
162+
One may use predefined commands to start them.
163+
- Open `theia-dev` route from `My Workspace` panel and test chenges.
164+
165+
Also it is possible to run watchers for remote plugin mechanism.
166+
In `theia-dev` container run `npx run watch @eclipse-che/theia-remote` from `/projects/theia` folder to recompile the extension on changes made.
167+
Also run `yarn watch` in `/projects/theia/examples/assembly` to bring the changes to Che Theia binaries.
168+
If needed one may start watchers in plugin API extension: `npx run watch @theia/plugin-ext` from `/projects/theia` directory.
169+
The commands for these actions are also available.
170+
But please note, you have to restart server to which changes is made.

extensions/eclipse-che-theia-plugin-remote/README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

extensions/eclipse-che-theia-plugin-remote/devfile.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ components:
1414
id: eclipse/che-machine-exec-plugin/next
1515
- type: chePlugin
1616
id: che-incubator/typescript/latest
17+
memoryLimit: 2Gi
1718
- type: dockerimage
1819
image: eclipse/che-theia-dev:next
1920
alias: theia-dev
@@ -37,25 +38,38 @@ commands:
3738
actions:
3839
- type: exec
3940
component: theia-dev
40-
command: che:theia init
41+
command: 'che:theia init'
4142
workdir: /projects/theia
4243
- name: Clean Che Theia
4344
actions:
4445
- type: exec
4546
component: theia-dev
46-
command: che:theia clean
47+
command: 'che:theia clean'
4748
workdir: /projects/theia
4849
- name: Build Che Theia
4950
actions:
5051
- type: exec
5152
component: theia-dev
52-
command: yarn
53+
command: 'yarn'
5354
workdir: /projects/theia
5455
- name: Watch changes in Theia Remote Extension
5556
actions:
5657
- type: exec
5758
component: theia-dev
58-
command: 'cd /projects/theia && npx run watch @eclipse-che/theia-remote & cd /projects/theia/examples/assembly && yarn watch'
59+
command: 'npx run watch @eclipse-che/theia-remote'
60+
workdir: /projects/theia
61+
- name: Watch changes in Theia Plugin API Extension
62+
actions:
63+
- type: exec
64+
component: theia-dev
65+
command: 'npx run watch @theia/plugin-ext'
66+
workdir: /projects/theia
67+
- name: Watch changes in Theia assembly
68+
actions:
69+
- type: exec
70+
component: theia-dev
71+
command: 'yarn watch'
72+
workdir: /projects/theia/examples/assembly
5973
- name: Run Dev Theia
6074
actions:
6175
- type: exec

0 commit comments

Comments
 (0)