Skip to content

Latest commit

 

History

History
30 lines (17 loc) · 2.23 KB

developing.md

File metadata and controls

30 lines (17 loc) · 2.23 KB

Building Malloy

Building the Malloy repo requires node.js and a Java Runtime Environment (JRE 1.6 or higher, 1.8 recommended) installed on your system in order to build the Malloy project.

Alternatively, you can use nix to install these dependencies. To use nix, install it with curl -L https://nixos.org/nix/install | sh and then run nix-shell from the malloy/ directory. Nix is what CI uses to run builds.

The following will install dependencies for the entire set of packages and compile the Malloy language and associated packages.

npm install
npm run build

Use the VS Code ESLint extension for code formatting, or run npm run lint --fix.

The tests can be run via the VS Code Jest Runner extension. Alternatively, use npm run test, or a specific file, like npm run test test/nomodel.spec.ts.

Some of the Postgres tests depend on static tables (i.e. test/src/nomodel.spec.ts). To set up the database locally for these tests, you can gunzip the test/data/postgres/malloytest-postgres.sql.gz file and run its SQL with a command such as psql -f test/data/postgres/malloytest-postgres.sql.gz.

VS Code tips

We provide a task in VS Code (.vscode/tasks.json) to watch the entire Malloy repo for typescript changes - this allows VS Code to output typescript errors even when files are closed. The default behavior is for errors to only appear in open files. If you want the watcher task to compile all files in the background, you can either run the task manually (Command Palette -> Tasks -> Run Task -> tsc-compile-watch). If you want to enable this task to always start when you open the project, run Command Palette -> Tasks: Manage Automatic Tasks in Folder -> Allow Automatic Tasks in folder.

Running Tests

See test/README.md for information about running tests.

Malloy VSCode Extension

The Malloy VSCode extension's source is now in the malloy-vscode-extension repository.