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

Commit

Permalink
Add devfile and doc for developing of Che Theia remote plugin mechanism
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Morhun <[email protected]>
  • Loading branch information
mmorhun committed Aug 28, 2019
1 parent a72bdb8 commit 64789bf
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 27 deletions.
26 changes: 24 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,32 @@ To start che-theia in `dev-mode` with yarn (not using the production che-theia g
Running dev theia would be located in the che-dev container and `theia-dev-flow` endpoint:
![Che-Theia-dev-endpoint](https://raw.githubusercontent.com/eclipse/che-theia/assets/theia-dev-flow-endpoint.png)



### Just want to build the plugin and run with the existing Theia image
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`
and run these plugins with the existing che-theia app:
`run ... HOSTED che-theia + container-plugin` or `run ... HOSTED che-theia + factory-plugin`

## Contributing to other parts of Che Theia

### How to develop Che Theia remote plugin mechanism

_Please note, this section provides a flow how to develop remote plugin mechanism in Che Theia, but not a remote plugin._

First, create a workspace from prepared devfile, which could be found in the `eclipse-che-theia-plugin-remote` extension folder.
When workspace is ready:
- Init Che Theia. This could be done with `che:theia init` command in `/projects/theia` folder or run the init command.
Che Theia sources will be awailable at `/projects/theia/che/che-theia`.
- Now one may make changes in Che Theia remote plugin mechanism in both (Che Theia and Remote plugin) sides.
- Build Che Theia from `theia-dev` container by executing `yarn` in `/projects/theia` folder or by running corresponding command.
- Put your remote plugin(s) into `/projects/remote-plugins/` dorectory.
Note that the plugins shouldn't have any external dependencies.
- Run dev Che Theia and Remote plugins endpoint in `theia-dev` and `theia-remote-runtime-dev` containers correspondingly.
One may use predefined commands to start them.
- Open `theia-dev` route from `My Workspace` panel and test chenges.

Also it is possible to run watchers for remote plugin mechanism.
In `theia-dev` container run `npx run watch @eclipse-che/theia-remote` from `/projects/theia` folder to recompile the extension on changes made.
Also run `yarn watch` in `/projects/theia/examples/assembly` to bring the changes to Che Theia binaries.
If needed one may start watchers in plugin API extension: `npx run watch @theia/plugin-ext` from `/projects/theia` directory.
The commands for these actions are also available.
But please note, you have to restart server to which changes is made.
21 changes: 0 additions & 21 deletions extensions/eclipse-che-theia-plugin-remote/README.md

This file was deleted.

22 changes: 18 additions & 4 deletions extensions/eclipse-che-theia-plugin-remote/devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ components:
id: eclipse/che-machine-exec-plugin/next
- type: chePlugin
id: che-incubator/typescript/latest
memoryLimit: 2Gi
- type: dockerimage
image: eclipse/che-theia-dev:next
alias: theia-dev
Expand All @@ -37,25 +38,38 @@ commands:
actions:
- type: exec
component: theia-dev
command: che:theia init
command: 'che:theia init'
workdir: /projects/theia
- name: Clean Che Theia
actions:
- type: exec
component: theia-dev
command: che:theia clean
command: 'che:theia clean'
workdir: /projects/theia
- name: Build Che Theia
actions:
- type: exec
component: theia-dev
command: yarn
command: 'yarn'
workdir: /projects/theia
- name: Watch changes in Theia Remote Extension
actions:
- type: exec
component: theia-dev
command: 'cd /projects/theia && npx run watch @eclipse-che/theia-remote & cd /projects/theia/examples/assembly && yarn watch'
command: 'npx run watch @eclipse-che/theia-remote'
workdir: /projects/theia
- name: Watch changes in Theia Plugin API Extension
actions:
- type: exec
component: theia-dev
command: 'npx run watch @theia/plugin-ext'
workdir: /projects/theia
- name: Watch changes in Theia assembly
actions:
- type: exec
component: theia-dev
command: 'yarn watch'
workdir: /projects/theia/examples/assembly
- name: Run Dev Theia
actions:
- type: exec
Expand Down

0 comments on commit 64789bf

Please sign in to comment.