Skip to content

YoelSLA/wollok-ts-cli

 
 

Repository files navigation

Wollok-TS-CLI

Wollok Command Line Interface

Available Commands

Wollok Command Line Interface should be run inside a Wollok project folder. This folder is considered as the wollok target project.

This is the list of the currently available commands:

  • --help: Shows the manual with all the options
  • run : Runs a Wollok program on the target project.
  • test [filter]: Runs Wollok tests on the target project.
  • repl : Opens the Wollok REPL on the target project importing the auto-import path (if any).

Contributing

All contributions are welcome! Feel free to report issues on the project's issue tracker, or fork the project and create a Pull Request. If you've never collaborated with an open source project before, you might want to read this guide.

If you plan to contribute with code, here are some hints to help you start:

Working Environment

Before anything else, you will need a TypeScript editor. We recomend Visual Studio Code along with the following plugins:

Node, npm, and dependencies

For Linux, MacOS:

You need to install nvm - Node Version Manager.

Before anything make sure you'll use the right version of node by running this command:

nvm use

Expected output is the node version that will be used, for example:

Found '/home/you/wollok-ts-cli/.nvmrc' with version <lts/gallium>
Now using node v16.15.0 (npm v8.5.5)

For Windows:

You need to install the NVM- for Windows.

Run the installer nvm-setup.exe as Administrator.

Open an elevated Command Prompt or Git Bash in the project folder (with Administrator privileges) and run:

nvm install <<version number>>
nvm use <<version number>>
# The version number is in the .nvmrc file (do not use codename version e.g. lts/gallium, in Windows you have to use the equivalent version number e.g. 16.15.0)

For all:

In the previous step, nvm use also installs NPM. If you are not familiar with dependency manager tools, you can think of this program as the entry point for all the important tasks development-related tasks, like installing dependencies and running tests.

Expected output is the node version that will be used:

node -v

So now you need to use npm to install dependencies:

# This will install all the project dependencies. Give it some time.
npm install

Running and 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.

Releasing

To create a release follow this steps

  1. Create a drafted release.
  2. Tag the commit you wish to release.

This will trigger a pipeline which will upload the binaries to the drafted release.

The package.json version and tag must match, otherwise the upload will be skipped. Taken from the electron-build docs

About

Wollok Command Line Interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 76.9%
  • JavaScript 19.1%
  • HTML 4.0%