- Monorepo managed with
pnpmworkspaces + Turborepo. - Main package is
@stakekit/widgetinpackages/widget(React + TypeScript + Vite). - Widget supports two entry modes:
- React component export (
src/index.package.ts) - Fully bundled renderer (
src/index.bundle.ts)
- React component export (
- Runtime branches between classic widget and dashboard variant in
src/App.tsx.
packages/widget/src/App.tsx— root app, router setup, bundle renderer.packages/widget/src/Widget.tsx— non-dashboard route flow (earn/review/steps/details).packages/widget/src/Dashboard.tsx+pages-dashboard/*— dashboard variant UI.packages/widget/src/providers/*— global provider composition (API, query, wallet, tracking, theme, stores).packages/widget/src/hooks/*— feature and API hooks.packages/widget/src/domain/*— shared domain types/helpers.packages/widget/src/translation/*— i18n resources (English,French).packages/widget/tests/*— Vitest browser tests (MSW-backed).packages/examples/*— integration examples (with-vite,with-vite-bundled,with-nextjs,with-cdn-script).
pnpm build— build all packages.pnpm lint— lint/type-check all packages.pnpm test— run all workspace tests.pnpm format— run formatting checks/tasks.pnpm check-hygiene- check unused deps, unresolved imports, circular deps, etc
pnpm --filter @stakekit/widget {command}
- Keep public API compatibility in
src/index.package.tsandsrc/index.bundle.ts. - When changing user-facing copy, update both:
packages/widget/src/translation/English/translations.jsonpackages/widget/src/translation/French/translations.json
- After changes, confirm nothing is broken with lint command which checks lint/type errors
- API client is configured in
packages/widget/src/providers/api/api-client-provider.tsx. - React Query defaults are in
packages/widget/src/providers/query-client/index.tsx. - App-level config/env mapping is in
packages/widget/src/config/index.ts. - Test bootstrapping + MSW worker setup:
packages/widget/tests/utils/setup.tspackages/widget/tests/mocks/worker.ts
This project vendors external repositories under @repos/
- Use vendored repositories as read-only reference material when working with related libraries
- Prefer examples and patterns from the vendored source code over generated guesses or web search results
- Do not edit files under @repos/ unless explicitly asked
- Do not import from @repos/ - application code should continue importing from normal package dependencies
- Before writing any Effect code, inspect @repos/effect/LLMS.md
- Before writing code that interacts with Effect
HttpClient, inspectagent-patterns/effect-http-client.md