This file contains tips to help you take (and understand) your first steps in the world of Theia development. Are you in a hurry? See the tl;dr.
Theia is a framework to build IDEs, so you can't really "run" Theia itself. However, you can run the example applications included in its repository. One is a browser-based IDE and the other is the electron-based equivalent.
$ git clone https://github.com/theia-ide/theia
The directory containing the Theia repository will now be referred to as
$THEIA
, so if you want to copy-paste the examples, you can set the THEIA
variable in your shell:
$ THEIA=$PWD/theia
The top-level directory contains the theia
npm, the Theia framework. You can
fetch its dependencies and build it using:
$ cd $THEIA
$ npm install
This command does a few things:
- downloads npm package dependencies
- compiles Typescript files to Javascript
- runs the Typescript linter
- runs the unit tests
Now that the theia
package is built, we can do the same with the browser
example.
$ cd $THEIA/examples/browser
$ npm install
Note that because of the dependency that the example has on file:../.., the
preparestep of
theia` will be called, causing its build process to run
again. This is expected.
Once this is done, we can start the application with:
$ npm start
This command starts the backend application, a small web server and a browser tab with the frontend.
Building the electron-based example is similar:
$ cd $THEIA/examples/electron
$ npm install
It can also be started with:
$ npm start
To build and run the browser example:
$ git clone https://github.com/theia-ide/theia \
&& cd theia \
&& npm install \
&& npm run build \
&& cd examples/browser \
&& npm install \
&& npm run build \
&& npm run start
To build and run the electron example:
$ git clone https://github.com/theia-ide/theia \
&& cd theia \
&& npm install \
&& npm run build \
&& cd examples/electron \
&& npm install \
&& npm run build \
&& npm run start