diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29fbbaa..de6abb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,31 +1,43 @@ -name: Continuous Integration +name: CI on: pull_request: - types: - - opened - - reopened - - synchronize + +permissions: + contents: read concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + group: ci-${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true jobs: - check: + checks: + name: Lint, build and test runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: jdx/mise-action@v2 + - name: Install mise + run: | + curl https://mise.run | MISE_VERSION=v2026.5.6 sh + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH" + export PATH="$HOME/.local/bin:$HOME/.local/share/mise/shims:$PATH" + mise install - - run: pnpm install --frozen-lockfile + - name: Install dependencies + run: pnpm install --frozen-lockfile - name: Install Playwright Browsers run: pnpm exec playwright install --with-deps - - run: pnpm run lint + - name: Lint + run: pnpm lint - - run: pnpm run build + - name: Build + run: pnpm build - - run: pnpm run test + - name: Test + run: pnpm test diff --git a/.gitignore b/.gitignore index c2283c8..a4df2dc 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ dist-ssr opensrc/ .turbo -*.tsbuildinfo \ No newline at end of file +*.tsbuildinfo +.pnpm-store/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e56fd6d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".external/effect-smol"] + path = .external/effect-smol + url = https://github.com/Effect-TS/effect-smol.git diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..47a9d36 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,25 @@ +# AGENTS.md + +Instructions for AI coding agents working with this codebase. + +## Commands + +After each code change, run these commands to confirm that nothing is broken + +- To lint and typecheck, run: `pnpm turbo lint --filter=@yieldxyz/perps-{package}`, +- For code formatting, run: `pnpm turbo format --filter=@yieldxyz/perps-{package}`, +- If a file is added, removed, or changed in `routes` folder, to generate route tree run: `pnpm turbo generate-routes --filter=@yieldxyz/perps-{package}` + +## General rules + +- Don't mix components/UI and logic - separate those two in hooks and components files +- All state handling should be done with `@effect-atom/atom-react` +- Use `effect` as much as possible. Don't use async/await +- Math/finance calculations and functions are placed in `packages/common/src/lib/math.ts` +- For manipulating array and records use `effect/Array` and `effect/Record` +- Don't use hooks `useMemo` or `useCallback` as we're using react-compiler +- During refactoring, avoid re-exporting functionality. Update imports in file thats importing this functionality + +## Source code references + +- Check `.external/effect-smol` for all references related to effect. Do not look up web for docs. They are not available yet as this is beta version \ No newline at end of file diff --git a/apps/dashboard-react-example/.env.example b/apps/dashboard-react-example/.env.example new file mode 100644 index 0000000..1398a4d --- /dev/null +++ b/apps/dashboard-react-example/.env.example @@ -0,0 +1,4 @@ +VITE_PERPS_BASE_URL= +VITE_PERPS_API_KEY= +VITE_REOWN_PROJECT_ID= +VITE_MORALIS_API_KEY= diff --git a/apps/dashboard-react-example/index.html b/apps/dashboard-react-example/index.html new file mode 100644 index 0000000..7724a0c --- /dev/null +++ b/apps/dashboard-react-example/index.html @@ -0,0 +1,12 @@ + + +
+ + +