React.js components for Sage UIs.
Requires node.js (v18.17.0+ recommended).
Clone this repo, cd
to that directory, and run:
npm install
Start a dev server:
npm start
You can start a dev server for a different app with
npm start -w <app>
. For example,npm start -w project
Before committing code, please configure pre-commit linting and type checking:
git config --local core.hooksPath .githooks
If using vscode, it is also recommended to install vscode-eslint.
npm run build -w sage
or,
npm run build -w <app>
The config for a project page is controlled with the env variable SAGE_UI_PROJECT
. I.e.,
SAGE_UI_PROJECT=crocus npm start -w project
To use Mapbox, you can use a local env variable MAPBOX_TOKEN
:
export MAPBOX_TOKEN=<token_string>
npm start
Run tests using
npm test
Read more about tests here.
Simple build/run example:
docker build -t sage-ui .
docker run -dp 8080:80 sage-ui
Passing a build arg variable:
docker build --build-arg MAPBOX_TOKEN=<token_string> -t sage-ui .
docker run -dp 8080:80 sage-ui
Similarly, for project pages
SAGE_UI_PROJECT=<project>
can be used.