This repository contains the various platforms of Deriv.
In order to work on your own version of the Deriv Javascript and CSS, please fork this project.
You will need to perform the following on your development machine:
- Node.js (10.14.2 or higher is recommended) and NPM (see https://nodejs.org/en/download/package-manager/)
- Run
npm run bootstrap
from the root folder
All packages must contain the following scripts to perform the stated actions:
Command | Description |
---|---|
start |
Runs complete test and build suite and starts the dev server. |
serve |
Runs build suite and starts the dev server. |
build |
Runs build suite and outputs the result into dist . Takes optional base value as argument. |
test |
Runs the test suite with eslint, and stylelint. |
test:eslint |
Runs only eslint. |
test:stylelint |
Runs only stylelint. |
test:mocha |
Runs only the test suite. |
deploy |
Runs build script, then pushes the output to GH Pages. |
deploy:clean |
Runs build script, clears gh-pages branch, then pushes the output to GH Pages. |
deploy:folder |
Runs build script, then pushes the output to the specified folder in GH Pages. |
deploy:staging |
Initiates procedures for deploying to staging. (Package specific) |
deploy:production |
Initiates procedures for deploying to production. (Package specific) |
Please follow the README of each package you intend to work with on how to get set up. However, the above scripts can be run from the root directory in the following manner.
In order to run the start
script for all packages (trader
, bot
, etc.), simply cd
to the root of the repo and run:
npm run start
If you intend to run the script for a specific package, simply run:
npm run start trader
Likewise, to run any of the deploy
scripts such as deploy:folder
or deploy:staging
for a specific package, just run:
npm run deploy:folder trader br_test_folder
You can find the names of packages by first navigating to the packages
folder. Each subfolder is a package, and contains a package.json
file. The value of the name
key in package.json
is the package name.
- Use the
developer 1|developer 2/task_name
format for PR titles. (e.g.:dev1/fixed_emoji_issue
) - Use the appropriate package labels available on the repo to indicate which packages your PR modifies.
- Use Draft PRs if you don't mean to request for reviews yet. Read more here.
If you intend to remove node_modules
folder(s) from the projects, please run lerna clean
and follow the intstructions.
You can read more on the various lerna commands (and the clean
command) over at the Lerna docs.
-
If you have to use
sudo -s
in your environment, please remove any hardcodedsudo
frompackages/*
(eg., removesudo
fromstart
andserve
commands ofpackages/trader
) -
How do I install a package?
A. Run
lerna add
with the--scope
argument as the package you want to install to. (e.g.,lerna add npm-package-name --scope=trader
) -
How do I run
npm ci
or equivalent (to add dependencies based onpackage-lock.json
?A. You have two options:
- use
lerna exec
with the--scope
argument as the package you want to run the command on, as suchlerna exec --scope=trader -- npm ci
. cd
intopackages/PACKAGE-NAME
and runnpm ci
, as suchcd packages/trader && npm ci
- use