-
Notifications
You must be signed in to change notification settings - Fork 3
feat(widget): migrate data flows to Yield API #516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "packages/widget": "0.0.270" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| { | ||
| "$schema": "https://github.com/jayu/rev-dep/blob/master/config-schema/1.7.schema.json?raw=true", | ||
| "configVersion": "1.7", | ||
| "rules": [ | ||
| { | ||
| "path": "packages/widget", | ||
| "prodEntryPoints": [ | ||
| "src/index.package.ts", | ||
| "src/index.bundle.ts", | ||
| "src/main.tsx", | ||
| "src/translation/i18next.d.ts", | ||
| "src/types/purify-extend.d.ts", | ||
| "src/types/window.d.ts", | ||
| "src/vite-env.d.ts", | ||
| "postcss.config.js", | ||
| "public/mockServiceWorker.js", | ||
| "vite/*.ts" | ||
| ], | ||
| "devEntryPoints": [ | ||
| "scripts/generate-effect-openapi.ts", | ||
| "tests/utils/setup.ts", | ||
| "tests/**/*.test.ts", | ||
| "tests/**/*.test.tsx" | ||
| ], | ||
| "orphanFilesDetection": { | ||
| "enabled": true | ||
| }, | ||
| "unusedExportsDetection": { | ||
| "enabled": true, | ||
| "ignoreFiles": ["src/types/yield-api-schema.d.ts"] | ||
| }, | ||
| "unusedNodeModulesDetection": { | ||
| "enabled": true, | ||
| "excludeModules": [ | ||
| "@effect/openapi-generator", | ||
| "@effect/platform-node", | ||
| "babel-plugin-react-compiler", | ||
| "playwright", | ||
| "postcss", | ||
| "swagger2openapi", | ||
| "tsx", | ||
| "yaml" | ||
| ], | ||
| "pkgJsonFieldsWithBinaries": ["scripts"] | ||
| }, | ||
| "missingNodeModulesDetection": { | ||
| "enabled": true | ||
| }, | ||
| "unresolvedImportsDetection": { | ||
| "enabled": true | ||
| }, | ||
| "circularImportsDetection": { | ||
| "enabled": true | ||
| } | ||
| // "devDepsUsageOnProdDetection": { | ||
| // "enabled": true | ||
| // } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # StakeKit Widget — Agent Guide | ||
|
|
||
| ## Project Overview | ||
| - Monorepo managed with `pnpm` workspaces + Turborepo. | ||
| - Main package is `@stakekit/widget` in `packages/widget` (React + TypeScript + Vite). | ||
| - Widget supports two entry modes: | ||
| - React component export (`src/index.package.ts`) | ||
| - Fully bundled renderer (`src/index.bundle.ts`) | ||
| - Runtime branches between classic widget and dashboard variant in `src/App.tsx`. | ||
|
|
||
| ## Repo Layout (important paths) | ||
| - `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`). | ||
|
|
||
| ## Commands Agents Should Use | ||
|
|
||
| ### From repo root (all workspaces via Turbo) | ||
| - `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 | ||
|
|
||
| ### Focused widget commands (recommended for most tasks) | ||
| - `pnpm --filter @stakekit/widget {command}` | ||
|
|
||
| ## Agent Working Guidelines (short) | ||
| - Keep public API compatibility in `src/index.package.ts` and `src/index.bundle.ts`. | ||
| - When changing user-facing copy, update both: | ||
| - `packages/widget/src/translation/English/translations.json` | ||
| - `packages/widget/src/translation/French/translations.json` | ||
| - After changes, confirm nothing is broken with lint command which checks lint/type errors | ||
|
|
||
| ## Useful Context for Debugging | ||
| - 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.ts` | ||
| - `packages/widget/tests/mocks/worker.ts` | ||
|
|
||
| ## Vendored Repositories | ||
|
|
||
| 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`, inspect `agent-patterns/effect-http-client.md` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.