Skip to content

Commit 4696f7f

Browse files
committed
chore: standardize code formatting and improve documentation - Updated Prettier and ESLint configurations for consistent code style - Added missing newlines in JSON and Markdown files - Enhanced README and documentation for better clarity - Refactored various components for improved readability and maintainability
1 parent 26ff293 commit 4696f7f

93 files changed

Lines changed: 2943 additions & 2726 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.husky/commit-msg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
1+
32

43
# Conventional commit message format
54
# Format: <type>(<scope>): <description>

.husky/pre-commit

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
32

43
echo "🔍 Running pre-commit checks..."
54

.husky/pre-push

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
1+
32

43
echo "🚀 Running pre-push checks..."
54

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
"quoteProps": "as-needed",
1313
"jsxSingleQuote": true,
1414
"proseWrap": "preserve"
15-
}
15+
}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ Thank you for your interest in contributing to Boundless! We welcome contributio
3434
- Be respectful and inclusive in all interactions.
3535
- For questions or discussions, use GitHub Discussions or open an issue.
3636

37-
Thank you for helping make Boundless better!
37+
Thank you for helping make Boundless better!

PRE_COMMIT_SETUP.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Pre-Commit System Setup Complete! 🎉
2+
3+
Your project now has a comprehensive pre-commit system that ensures code quality before any code is committed or pushed.
4+
5+
## ✅ What's Been Set Up
6+
7+
### 1. **Husky Git Hooks**
8+
9+
- **Pre-commit**: Runs all quality checks before commit
10+
- **Commit-msg**: Enforces conventional commit message format
11+
- **Pre-push**: Runs additional checks before pushing
12+
13+
### 2. **Lint-staged Configuration**
14+
15+
- Automatically runs checks only on staged files
16+
- Auto-fixes formatting and linting issues
17+
- Integrates with ESLint and Prettier
18+
19+
### 3. **Code Quality Tools**
20+
21+
- **ESLint**: Code linting with TypeScript support
22+
- **Prettier**: Code formatting
23+
- **TypeScript**: Type checking
24+
- **Build Check**: Ensures project builds successfully
25+
26+
### 4. **Configuration Files**
27+
28+
- `.prettierrc`: Prettier formatting rules
29+
- `.prettierignore`: Files to ignore during formatting
30+
- `eslint.config.mjs`: ESLint configuration
31+
- `package.json`: Scripts and lint-staged config
32+
33+
## 🚀 How It Works
34+
35+
### On Every Commit:
36+
37+
1. **Lint-staged** runs on staged files:
38+
- ESLint with auto-fix
39+
- Prettier formatting
40+
2. **TypeScript** type checking
41+
3. **ESLint** on all files
42+
4. **Prettier** format check
43+
5. **Build** check
44+
45+
### On Every Push:
46+
47+
1. **Security audit** check
48+
2. **Final build** verification
49+
3. **Uncommitted changes** warning
50+
51+
## 📝 Commit Message Format
52+
53+
Your commits must follow this format:
54+
55+
```
56+
<type>(<scope>): <description>
57+
```
58+
59+
**Examples:**
60+
61+
- `feat: add wallet connection feature`
62+
- `fix(wallet): resolve persistence issue`
63+
- `docs: update README with setup instructions`
64+
- `style: format code with prettier`
65+
66+
## 🛠️ Available Commands
67+
68+
```bash
69+
# Development
70+
npm run dev # Start development server
71+
npm run build # Build for production
72+
73+
# Code Quality
74+
npm run lint # Run ESLint
75+
npm run lint:fix # Run ESLint with auto-fix
76+
npm run type-check # Run TypeScript type checking
77+
npm run format # Format code with Prettier
78+
npm run format:check # Check formatting without changing files
79+
80+
# Git Hooks
81+
npm run prepare # Install Husky hooks
82+
```
83+
84+
## 🎯 What This Prevents
85+
86+
### **Before Setup:**
87+
88+
- Inconsistent code formatting
89+
- TypeScript errors in production
90+
- Build failures after commit
91+
- Poor commit messages
92+
- Console.log statements in production code
93+
- Unused variables and imports
94+
95+
### **After Setup:**
96+
97+
- All code is consistently formatted
98+
- No TypeScript errors can be committed
99+
- Build is guaranteed to work
100+
- Clear, conventional commit messages
101+
- Code quality is enforced automatically
102+
- No broken code reaches the repository
103+
104+
## 🔧 Troubleshooting
105+
106+
### If Pre-commit Fails:
107+
108+
1. **TypeScript Errors**: Fix type errors in your code
109+
2. **ESLint Errors**: Run `npm run lint:fix` to auto-fix
110+
3. **Formatting Issues**: Run `npm run format` to fix formatting
111+
4. **Build Errors**: Fix any build errors in your code
112+
113+
### Emergency Bypass (Use Sparingly):
114+
115+
```bash
116+
git commit --no-verify -m "emergency: bypass hooks"
117+
git push --no-verify
118+
```
119+
120+
## 📊 Current Status
121+
122+
**All checks passing:**
123+
124+
- TypeScript: No type errors
125+
- ESLint: No linting issues
126+
- Prettier: All files properly formatted
127+
- Build: Project builds successfully
128+
129+
## 🎉 You're All Set!
130+
131+
Your development workflow is now protected by:
132+
133+
- **Automatic code formatting**
134+
- **Type safety enforcement**
135+
- **Build verification**
136+
- **Commit message standards**
137+
- **Security checks**
138+
139+
Every commit will now be automatically checked and formatted, ensuring your codebase maintains high quality standards! 🚀

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ flowchart TD
8585
## Getting Started
8686

8787
### Prerequisites
88+
8889
- Node.js (v18+)
8990
- npm or yarn
9091
- Docker (for local blockchain and database)
@@ -106,13 +107,15 @@ flowchart TD
106107
- Copy `.env.example` to `.env` and fill in required values.
107108

108109
4. **Run local development server:**
110+
109111
```bash
110112
npm run dev
111113
# or
112114
yarn dev
113115
```
114116

115117
5. **Run tests:**
118+
116119
```bash
117120
npm test
118121
# or

app/components/page.tsx

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
1-
import { PriceDisplay } from "@/components/PriceDisplay";
2-
import EmptyState from "@/components/EmptyState";
3-
import { BoundlessButton } from "@/components/buttons";
4-
import { Coins, History, Plus } from "lucide-react";
5-
import Card from "@/components/card";
6-
import RecentProjects from "@/components/overview/RecentProjects";
7-
import RecentContributions from "@/components/overview/ReecntContributions";
8-
import GrantHistory from "@/components/overview/GrantHistory";
1+
import { PriceDisplay } from '@/components/PriceDisplay';
2+
import EmptyState from '@/components/EmptyState';
3+
import { BoundlessButton } from '@/components/buttons';
4+
import { Coins, History, Plus } from 'lucide-react';
5+
import Card from '@/components/card';
6+
import RecentProjects from '@/components/overview/RecentProjects';
7+
import RecentContributions from '@/components/overview/ReecntContributions';
8+
import GrantHistory from '@/components/overview/GrantHistory';
99

1010
export default function Components() {
1111
return (
12-
<div className="font-sans grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20">
13-
<main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
14-
<div className="bg-[#1C1C1C] rounded-lg p-4 w-full max-w-[550px]">
15-
<PriceDisplay price={100} className="text-2xl font-bold" />
12+
<div className='font-sans grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20'>
13+
<main className='flex flex-col gap-[32px] row-start-2 items-center sm:items-start'>
14+
<div className='bg-[#1C1C1C] rounded-lg p-4 w-full max-w-[550px]'>
15+
<PriceDisplay price={100} className='text-2xl font-bold' />
1616
<EmptyState
17-
title="No comments yet"
18-
description="Start by sharing your first project idea with the Boundless community. Once submitted, your projects will appear here for easy tracking."
19-
type="default"
17+
title='No comments yet'
18+
description='Start by sharing your first project idea with the Boundless community. Once submitted, your projects will appear here for easy tracking.'
19+
type='default'
2020
action={
2121
<BoundlessButton
22-
variant="default"
23-
size="lg"
24-
icon={<Plus className="w-5 h-5" />}
25-
iconPosition="right"
22+
variant='default'
23+
size='lg'
24+
icon={<Plus className='w-5 h-5' />}
25+
iconPosition='right'
2626
>
2727
Add comment
2828
</BoundlessButton>
2929
}
3030
/>
3131
</div>
32-
<div className="flex gap-4">
32+
<div className='flex gap-4'>
3333
<Card
34-
title="Active Campaigns"
35-
value="10"
34+
title='Active Campaigns'
35+
value='10'
3636
bottomText={
37-
<div className="flex items-center gap-2">
38-
<Coins className="w-4 h-4 text-white/60" />
37+
<div className='flex items-center gap-2'>
38+
<Coins className='w-4 h-4 text-white/60' />
3939
<PriceDisplay
4040
price={0}
41-
className="!text-xs !tracking-[-0.06px]"
41+
className='!text-xs !tracking-[-0.06px]'
4242
/>
4343
</div>
4444
}
4545
/>
4646
<Card
47-
title="Pending Submissions"
48-
value="0"
47+
title='Pending Submissions'
48+
value='0'
4949
bottomText={
50-
<div className="flex items-center gap-2">
51-
<History className="w-4 h-4 text-white/60" />
52-
<span className="text-white/60">No recent submissions</span>
50+
<div className='flex items-center gap-2'>
51+
<History className='w-4 h-4 text-white/60' />
52+
<span className='text-white/60'>No recent submissions</span>
5353
</div>
5454
}
5555
/>
5656
<Card
57-
title="Active Projects"
58-
value="0"
57+
title='Active Projects'
58+
value='0'
5959
bottomText={
60-
<div className="flex items-center gap-2">
61-
<span className="text-white/90">0</span>
60+
<div className='flex items-center gap-2'>
61+
<span className='text-white/90'>0</span>
6262
Approved Submissions
6363
</div>
6464
}
6565
/>
6666
<Card
67-
title="Available Grants"
68-
value={<PriceDisplay price={0} className="!tracking-[-0.06px]" />}
67+
title='Available Grants'
68+
value={<PriceDisplay price={0} className='!tracking-[-0.06px]' />}
6969
bottomText={
70-
<div className="flex items-center gap-2 text-white/90">
70+
<div className='flex items-center gap-2 text-white/90'>
7171
6 grants available
7272
</div>
7373
}
7474
/>
7575
</div>
7676
<RecentProjects projects={[]} />
77-
<div className="flex gap-4">
77+
<div className='flex gap-4'>
7878
<RecentContributions projects={[]} />
7979
<GrantHistory projects={[]} />
8080
</div>

0 commit comments

Comments
 (0)