Skip to content

Commit 41e7541

Browse files
committed
feat: integrate json-loader and update yield data structure
- Added json-loader to handle .jsonc files in webpack configuration. - Updated package.json and bun.lock to include json-loader as a dependency. - Created a new yield_data.jsonc file to store structured yield data for various DeFi protocols. - Refactored API and components to utilize the new yield data format, enhancing data management and retrieval. - Introduced new TypeScript types for better type safety with protocol data.
1 parent 90c3d37 commit 41e7541

30 files changed

+977
-55
lines changed

.cursor/rules/ci-cd.mdc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
description: "YieldMax Ci Cd"
3+
globs: ["*"]
4+
alwaysApply: false
5+
---
6+
ci_cd:
7+
- tool: GitHub Actions
8+
purpose: Automated testing, linting, building, and deployment to production on push to main branch
9+
- tool: Secrets Management
10+
purpose: Sensitive data like server host and credentials are stored as GitHub secrets

.cursor/rules/commands.mdc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
description: "YieldMax Commands"
3+
globs: ["*"]
4+
alwaysApply: false
5+
---
6+
common_commands:
7+
development: bun run dev
8+
testing: bun test
9+
linting: bun run lint
10+
linting_fix: bun run lint:fix
11+
build: bun run build

.cursor/rules/core-rules.mdc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
description: "YieldMax Core Development Rules"
3+
globs: ["*"]
4+
alwaysApply: false
5+
---
6+
project_name: YieldMax
7+
description: A DeFi yield comparison platform built with Next.js, TypeScript, and Bun
8+
purpose: Helps users analyze and compare yield opportunities across various protocols with transparent data and risk assessments
9+
10+
core_rules:
11+
- rule: Use Bun
12+
description: Utilize Bun for package management, testing, and running the app
13+
examples:
14+
- bun install
15+
- bun run dev
16+
- bun test
17+
- rule: Keep Implementation Simple
18+
description: Favor straightforward solutions over complex ones. Avoid over-engineering and prioritize readability and maintainability

.cursor/rules/dependencies.mdc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
description: "YieldMax Dependencies"
3+
globs: ["*"]
4+
alwaysApply: false
5+
---
6+
key_dependencies:
7+
- name: Next.js
8+
purpose: Framework for SSR and static site generation
9+
- name: React & React DOM
10+
purpose: Core UI library
11+
- name: TypeScript
12+
purpose: For type safety
13+
- name: Bun
14+
purpose: JavaScript runtime and package manager for fast development
15+
- name: "@tanstack/react-query"
16+
purpose: For data fetching and state management
17+
- name: wagmi
18+
purpose: For Web3 and Ethereum interactions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: "YieldMax Development Guidelines"
3+
globs: ["*.ts", "*.tsx", "*.js", "*.jsx"]
4+
alwaysApply: false
5+
---
6+
development_guidelines:
7+
- guideline: TypeScript First
8+
description: All code must be written in TypeScript with proper typing
9+
- guideline: CSS Modules
10+
description: Use CSS modules for component-scoped styling (e.g., Component.module.css)
11+
- guideline: Testing
12+
description: Write tests for critical components and API functions using Bun's test runner. Tests should be placed in src/__tests__
13+
- guideline: Static Generation
14+
description: Leverage Next.js static site generation for performance and SEO benefits
15+
- guideline: React Best Practices
16+
description: Follow React best practices, including proper use of hooks and component lifecycle management

.cursor/rules/development.mdc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
description: "YieldMax Development Guidelines"
3+
globs: ["*.ts", "*.tsx", "*.js", "*.jsx"]
4+
alwaysApply: false
5+
---
6+
7+
# YieldMax Development Guidelines
8+
9+
- TypeScript First: All code must be written in TypeScript with proper typing
10+
- CSS Modules: Use CSS modules for component-scoped styling (e.g., Component.module.css)
11+
- Testing: Write tests for critical components and API functions
12+
- Static Generation: Leverage Next.js static site generation
13+
- React Best Practices: Follow React best practices

.cursor/rules/maintenance.mdc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
description: "YieldMax Maintenance"
3+
globs: ["*"]
4+
alwaysApply: false
5+
---
6+
maintenance_priorities:
7+
- priority: Security
8+
description: Address vulnerabilities first, especially in deployment configurations and dependencies
9+
- priority: Test Coverage
10+
description: Ensure critical functionality is tested, especially API interactions and UI components
11+
- priority: Documentation
12+
description: Keep README and inline comments up-to-date with any significant changes

.cursor/rules/style-guide.mdc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
description: "YieldMax Style Guide for React components"
3+
globs: ["*.tsx", "*.jsx", "*.css", "*.scss"]
4+
alwaysApply: false
5+
---
6+
7+
# YieldMax Style Guide
8+
9+
- Use functional components with hooks instead of class components
10+
- Follow TypeScript best practices with proper interface definitions
11+
- Keep components small and focused on a single responsibility
12+
- Use CSS modules for component styling

.cursor/rules/task-prep.mdc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
task_preparation:
7+
- step: Understand the Context
8+
description: Review the specific component or API you're working on. Check related files in /src/components, /src/api, or /app
9+
- step: Check Existing Patterns
10+
description: Look at similar files to match coding style and structure
11+
- step: Verify Dependencies
12+
description: Ensure you're using the correct versions of libraries as specified in package.json
13+
- step: Test Implications
14+
description: Consider how changes affect existing tests or require new ones
15+
- step: Deployment Impact
16+
description: Assess if changes affect the CI/CD pipeline or deployment process

.cursor/rules/troubleshooting.mdc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
troubleshooting:
7+
- issue: Bun Not Found
8+
solution: Ensure Bun is installed and in your PATH. Run curl -fsSL https://bun.sh/install | bash if needed
9+
- issue: Dependency Issues
10+
solution: Clear node_modules and reinstall with bun install
11+
- issue: Test Failures
12+
solution: Check mock implementations in test files and ensure they match the updated code

0 commit comments

Comments
 (0)