Development Environment
This page will guide you through setting up the development environment that your front end engineers will use with Causal.
Software Prequisites
To install and run Causal, you first need to ensure that the following software is installed:
- node.js 14 or better with npm or yarn
- cross-fetch. Causal uses cross-fetch for its network requests. In future versions this will be configurable. Install cross fetch as a peer dependency in your node projects.
To use the TypeScript APIs you will need Typescript 4.6.4 or later.
Installing the Compiler
Causal uses a data definition language called FDL (short for Feature Definition Language). FDL is a compiled, type-safe declarative language that describes the data that you need to make and render data-driven decisions for customer-facing features in your application. FDL is based on GraphQL, so there are many similarities between these two languages.
We use node to distribute the compiler, so you'll need it for both node and non-node projects. If you don't have node already installed, install it.
- Node
- Java
Installing the compiler for a node project is simple. It's shipped as a node package, so you can just use the standard node install command to add it to your package.json
.
## to install to a project (not needed for the example)
$ npm install --save-dev @causal/compiler
When installng the compiler for a non-node project (including java), you'll need to use npm install --global
. Which will install the Causal compiler into /usr/bin
:
## This will install the causal compiler in your path
$ sudo npm install --global @causal/compiler
## If the install is successful, running the following command Will return a help message
$ causalc --help
At this point you should be able to compile an FDL file. There are several example projects on GitHub that illustrate how to use the compiler. If you'd like to jump right into trying to add Causal to your own project, see the User Guides for Typescript or Java.