Prepare the environment¶
NEST Desktop is written in Vue.js (a web framework written in TypeScript), and also in TypeScript. The Vue code is transpiled to HTML5 and JavaScript Code. There are multiple ways to develop Vue applications, but my preferred way (and probably the most common one) to develop NEST Desktop is to use Node.js (and optionally Yarn). Therefore, if you do not use any of the container systems mentioned below, you will need to install Node.js (for Windows, an easy installation guide can be found here ), which gives you also the possibility to install Yarn.
- Requirements
- Node.js, Yarn
- NEST Simulator 3.0 or higher
You can install these requirements in the host system.
However, we prefer to use an Apptainer container and leave the host system unchanged. For this, we prepared a Apptainer recipe that builds a container with the required packages for the development. |
Build an environment with Apptainer¶
Get an Apptainer recipe:
wget https://raw.githubusercontent.com/nest-desktop/nest-desktop-apptainer/master/recipes/development/dev-node-16-alpine.def
The definition file dev-node-16-alpine.def
contains an adequate environment to develop and build NEST Desktop.
Build an Apptainer image:
apptainer build dev-node-16-alpine.sif dev-node-16-alpine.def
Go to the shell inside the Apptainer container:
apptainer shell dev-node-16-alpine.sif
Commands¶
Install node modules for NEST Desktop:
yarn install
Start a development server:
yarn serve
Note
The command yarn serve
uses the configuration file vue.config.js
. This file controls the threads used for
the linting (the statical-syntactical code checks). With the default configuration, all available threads are used to
minimize the build time. This might slow down other programs. There are cases where you cannot afford that and
prefer a slightly longer execution time. In that cases, you can either adjust the number of threads in that file.This
reduces the CPU load, but some CPU resources might stay unused. Alternatively you can execute the console in which
you want to spawn the yarn
command with a lower priority. On Linux (even on MacOS or Windows using WSL2 and an
available shell command) this can be done using
nice -n 20 bash
This will spawn a new console inside your current console, but with the lowest processing priority possible, i.e. this console and its tasks do not block other tasks (like video conferences, etc.) significantly. Do not be confused that there will be no new window and no major visual cues that you are now in another process. In that console you can now execute the commands mentioned above.
Useful commands¶
Check if any node modules are outdated:
yarn outdated
Upgrade outdated node modules:
yarn upgrade