- Use Yarn 4 at repo root (
packageManager: yarn@4.13.0). - Main commands:
yarn dev(Nx run-many dev)yarn build(Nx run-many build)yarn build:packages(packages only)yarn lint(fails on warnings via--max-warnings=0)yarn test(Vitest)
- Node version is pinned to
24.x(seepackage.jsonengines and Volta setup). - For
packages/core, descriptor generation is mandatory before compile (papi generate). The core build script already does this; avoid running rawtscthere without generation.
- Monorepo roles:
packages/core: framework-agnostic reactive runtime overpolkadot-api(RxJS-based)packages/react: React bindings and hooks (Jotai-based)packages/vue: Vue composablespackages/wallet-*: wallet adapters implementing core wallet interfacespackages/utils: shared helpers and utilitiesapps/docs: Docusaurus docs sourceexamples/*: integration examples
- Config-first setup is the default pattern (
defineConfigwith chains/providers/wallets). - Query logic is centered around the query builder API in
packages/core/src/query-builder.ts.
- TypeScript is strict (
@tsconfig/strictestusage across packages). - ESM import paths must use
.jsextensions in TypeScript source files. - Internal package dependencies should use explicit
workspace:^ranges. - Tests are colocated as
*.test.tsnear source. - React bindings assume Suspense boundaries and provider-scoped Jotai stores.
- Prefer Nx/Yarn workspace commands over per-package ad hoc scripts unless task scope is limited.
- Do not duplicate architecture/docs prose already maintained in docs; link to existing sources:
- Repo overview:
README.md - Docs app:
apps/docs/README.md - Package docs:
packages/core/README.md,packages/react/README.md,packages/utils/README.md,packages/test/README.md - Release/versioning notes:
.changeset/README.md
- Repo overview:
- When adding wallet adapters, follow existing
packages/wallet-*structure and interfaces underpackages/core/src/wallets/. - When adding React hooks, mirror patterns from
packages/react/src/hooks/and Jotai helpers inpackages/react/src/utils/jotai/.
- Core query pattern:
packages/core/src/query-builder.ts - Core public API surface:
packages/core/src/index.ts - React hook example:
packages/react/src/hooks/use-balance.ts - React test example:
packages/react/src/hooks/use-balance.test.ts - Example app config:
examples/react/src/config.ts