kingcons / relox

A Lox implementation in ReasonML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

relox

Actions Status

A lox interpreter in ReasonML

Features

  • Available on all major platform (Windows, Linux and Windows)

Installation

Using Homebrew (macOS)

brew install https://raw.githubusercontent.com/tmattio/relox/master/scripts/tmattio-relox.rb

Using npm

yarn global add @kingcons/relox
# Or
npm -g install @kingcons/relox

Using a script

curl -fsSL https://github.com/kingcons/relox/raw/master/scripts/install.sh | bash

Usage

relox hello NAME

Greets the name given in argument.

Contributing

We would love your help improving relox!

Developing

You need Esy, you can install the latest version from npm:

yarn global add esy@latest
# Or
npm install -g esy@latest

NOTE: Make sure esy --version returns at least 0.5.8 for this project to build.

Then run the esy command from this project root to install and build depenencies.

esy

Now you can run your editor within the environment (which also includes merlin):

esy $EDITOR
esy vim

Alternatively you can try vim-reasonml which loads esy project environments automatically.

After you make some changes to source code, you can re-run project's build again with the same simple esy command.

esy

This project uses Dune as a build system, and Pesy to generate Dune's configuration files. If you change the buildDirs configuration in package.json, you will have to regenerate the configuration files using:

esy pesy

Running Binary

After building the project, you can run the main binary that is produced.

esy start

Running Tests

You can test compiled executable (runs scripts.tests specified in package.json):

esy test

Building documentation

Documentation for the libraries in the project can be generated with:

esy doc
open-cli $(esy doc-path)

This assumes you have a command like open-cli installed on your system.

NOTE: On macOS, you can use the system command open, for instance open $(esy doc-path)

Creating release builds

To release prebuilt binaries to all platforms, we use Github Actions to build each binary individually.

The binaries are then uploaded to a Github Release and NPM automatically.

To trigger the Release workflow, you need to push a git tag to the repository. We provide a script that will bump the version of the project, tag the commit and push it to Github:

./scripts/release.sh

The script uses npm version to bump the project, so you can use the same argument. For instance, to release a new patch version, you can run:

./scripts/release.sh patch

Repository Structure

The following snippet describes relox's repository structure.

.
├── .github/
|   Contains Github specific files such as actions definitions and issue templates.
│
├── bin/
|   Source for relox's binary. This links to the library defined in `lib/`.
│
├── lib/
|   Source for relox's library. Contains relox's core functionnalities.
│
├── test/
|   Unit tests and integration tests for relox.
│
├── test_runner/
|   Source for the test runner's binary.
|
├── dune-project
|   Dune file used to mark the root of the project and define project-wide parameters.
|   For the documentation of the syntax, see https://dune.readthedocs.io/en/stable/dune-files.html#dune-project
│
├── LICENSE
│
├── package.json
|   Esy package definition.
|   To know more about creating Esy packages, see https://esy.sh/docs/en/configuration.html.
│
├── README.md
│
└── relox.opam
    Opam package definition.
    To know more about creating and publishing opam packages, see https://opam.ocaml.org/doc/Packaging.html.

About

A Lox implementation in ReasonML

License:MIT License


Languages

Language:Reason 46.4%Language:JavaScript 28.1%Language:Shell 21.4%Language:Ruby 2.4%Language:Propeller Spin 1.7%