Skip to content

Developer Environment

Fernando Dodino edited this page Sep 19, 2024 · 12 revisions

Required skills

  • Typescript: Intermediate
  • NPM: Basic - install, run commands
  • Bash / Git Bash: Basic - run commands

Working Environment

Take a look at this page in order to install the required components for developing Wollok.

Unit tests

You can run the whole test suite by executing

npm test

In case you want to run a single file, type the following command:

npx mocha --parallel -r ts-node/register/transpile-only test/run.test.ts

(this runs only the run.test.ts file)

Running and manual testing

After that, you are ready to start working. You can build the project by running npm run build; this will compile all assets to the /build folder, leaving everything ready to run but, if you are a developer, you will probably want to run npm run watch instead and leave it running in a separate window so it will update the /build folder whenever any code is changed (notice that this only works for TS changes, to update any other kind of file you have to restart the watch).

Once the code has been built, you can run the CLI by running npm start. Remember that, while running through npm, you will need to add a -- before any non npm related flags. For example, to see the application manual you can run

npm start -- --help

Another example, opening the repl on a certain file in a certain wollok project:

npm start -- repl /home/you/myWollokProject/birds.wlk -p /home/you/myWollokProject/

Finally, you can generate wollok-cli executable binaries (a.k.a. the distributable user-ready program) by running:

npm run pack

And checking the /dist folder.

Clone this wiki locally