I’m currently figuring out what are the best options to build an application with Theia. So we think we want to use plugins as a way to go since they can be loaded on the fly. But if I want to build an application with them, how can I ship them? We found different approaches like creating a “plugins” folder on the root directory (where browser-app and electron-app lies) or a PATH variable. Only the PATH variable works, but if another one wants to use the application he also need to set this path.
In some way this is not convenient to me. Do you have another approach I just missed in my searches?
Thank you in advance!
[original thread by LouBen3010]
hello, AFAIK the current theia example is scanning for plugins folder. So the THEIA_DEFAULT_PLUGINS env variable is set automatically. You also might be interested in https://github.com/theia-ide/theia/pull/4376 where there is a cli option to set the folder for plug-ins
Hi, thanks for the immediate help! This has been done now:
Created a a new extension with yo
Now I have my folder with the subfolders: hello-world-extension, browser-app and electron-app
Added “@theia/plugin-ext” to package.json
Created in this root folder a new one called called “plugins”
Copied the folder containing the plugin sources and the *.theia file into this folder
As this did not work I also just placed the resulting *.theia file into the plugins folder and I also put this plugin folder into the browser-app folder in case that Theia wants us to develop plugins for the browser and electron app separately.
Am I doing something wrong?
@louben3010 you can take the examples/browser of theia. It already contains the plugin extensions. You have to use
yarn @theia/plugin and copy the
.theia file into the root plugins folder of theia and perform
yarn run start
Thanks for the reply. We will test this soon
@florentbenoit I tried this and it didnt work?
preview@daab87987d18:~$ cat package.json | grep plugin "@theia/plugin": "next", "@theia/plugin-ext": "next",
preview@daab87987d18:~$ ls -la plugins/ total 56 drwxrwxrwx 1 root root 4096 Apr 2 07:14 . drwxr-xr-x 1 preview preview 4096 Apr 2 07:11 .. -rwxrwxrwx 1 root root 45989 Apr 1 16:31 welcome_plugin.theia
preview@daab87987d18:~$ npx yarn theia start /home/project --hostname=0.0.0.0
There should be a
Show Welcome Screen action
This works when doing a Hosted instance of course
$ /home/preview/node_modules/.bin/theia --version
hello, is it the examples/browser example ?
how do you run theia ?
in examples/browser when we ran it it is running
$ theia start --plugins=local-dir:../../plugins
else you can do
$ export THEIA_DEFAULT_PLUGINS=local-dir://absolute-path-to-plugins-folder
$ launching theia
Our theia runs from just the package.json in our docker file:
ADD package.json /home/preview/package.json
Let me try with the options you listed above
The option flag worked! Thankyou!