This project contains the DApp of the Potion Protocol developed with Vue 3 in Vite.
Before getting started please be sure to have installed the Requirements.
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
TypeScript cannot handle type information for .vue
imports by default, so we replace the tsc
CLI with vue-tsc
for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue
types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensions
from VSCode's command palette - Find
TypeScript and JavaScript Language Features
, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Window
from the command palette.
See Vite Configuration Reference.
yarn install
yarn dev
yarn local-dev
yarn build
yarn build-test
Run End-to-End Tests with Cypress
yarn build-test
yarn test-e2e # or `yarn test-e2e-ci` for headless testing
Lint with ESLint
yarn lint
Execution can be customized by passing the redeploy
flag:
- [DEFAULT] When
true
will instruct docker to always deploy a fresh environment (even if one is already available) - When
false
an existing environment will be used if any. WARNING: currently the script has no way of detecting an healthy enviroment and will only check for running containers
EG:
yarn nx run potion-dapp:local-dev [redeploy=(true/false)]
Used to spin up the development environment.
- Start
docker-compose
containers - Start
vite
dev server by runningyarn nx run potion-dapp:dev
The command runs in foreground
EG:
yarn nx run potion-dapp:local-dev-test [redeploy=(true/false)]
Used to spin up the development environment with mocked Onboard.
- Start
docker-compose
containers - Start
vite
dev server with mocked Onboard by runningyarn nx run potion-dapp:dev-test
The command runs in foreground
EG:
yarn nx run potion-dapp:local-dev-test-e2e [redeploy=(true/false)]
Used as a utility command to run in parallel the dev server and Cypress client
- Start
vite
dev server with mocked Onboard by runningyarn nx run potion-dapp:dev-test
- start
cypress
client by runningyarn nx run potion-dapp:test-e2e-dev
The command runs in foreground, command needs to be terminated manually
EG:
yarn nx run potion-dapp:local-test-e2e
- Start
docker-compose
containers - Run
yarn nx run potion-dapp:local-dev-test-e2e
to spin up the dev server and cypress client simultaneously
The command runs in foreground, command needs to be terminated manually
To build for a testnet, you need to use the command build-testnet
. This command will use oracles to fetch prices instead of getting them from Coingecko.