How to contribute
Setup
Clone the repository:
git clone [email protected]:coingaming/moon.git
Start local development server by running:
run-locally-dev.sh
If ./run-locally-dev.sh is not working, try the following steps:
Install asdf and plugins:
asdf plugin add erlang
asdf plugin add elixir
asdf plugin add nodejs
Install all the tool versions specified in the .tool_versions file:
asdf install
Install assets dependencies:
cd assets && npm i && cd -
Try running local development server:
iex -S mix phx.server
Stop the command above, then try running:
run-locally-dev.sh
If you do see error in ElixirLS extension "no elixir command found", you'll need to:
cp .tool-versions ~
Install dependencies:
mix deps.get
Assets repository setup
The following script imports Figma assets and icons. You need to set the values in the .env file. Please make sure you have read access to the assets tool repo https://github.com/coingaming/assets .
run-auto-importers.sh
mix assets.setup
cd $root_dir/scripts/typescript/
npm install
Clone the repository:
git clone [email protected]:coingaming/assets.git
cd assets
git reset --hard HEAD
git pull\nnpm install -g pnpm
pnpm install
pnpm run build
export page=$(grep ICON_PAGE_NAME .env | cut -d '=' -f2)
npm run figma --page=$page
Style guide
Moon Design System follows headless design approach - we build smart, functional and reusable UI components.
To format your code, run:
mix format
mix surface.format
Tests
All newly added components must come with tests. In order to run the tests:
mix test