Skip to content

Latest commit

 

History

History
138 lines (88 loc) · 4.11 KB

README.md

File metadata and controls

138 lines (88 loc) · 4.11 KB

Potion DApp

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.

Recommended IDE Setup

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Type Support for .vue Imports in TS

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:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Customize configuration

See Vite Configuration Reference.

Requirements

Project Setup

yarn install

Compile and Hot-Reload for Development

yarn dev

Spin up Docker, Compile and Hot-Reload for Development

yarn local-dev

Type-Check, Compile and Minify for Production

yarn build

Type-Check, Compile and Minify for Production with mocked web3-onboard

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

NX custom commands

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

local-dev

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 running yarn nx run potion-dapp:dev

The command runs in foreground

local-dev-test

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 running yarn nx run potion-dapp:dev-test

The command runs in foreground

local-dev-test-e2e

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 running yarn nx run potion-dapp:dev-test
  • start cypress client by running yarn nx run potion-dapp:test-e2e-dev

The command runs in foreground, command needs to be terminated manually

local-test-e2e

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

Build for Testnet

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.