Skip to content

Commit 9176fb0

Browse files
committed
dprint
1 parent aa76c3c commit 9176fb0

25 files changed

+3702
-3087
lines changed

.github/actions/setup-node-pnpm/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ runs:
77

88
- uses: actions/setup-node@v4
99
with:
10-
node-version: 'lts/*'
11-
registry-url: 'https://registry.npmjs.org'
10+
node-version: "lts/*"
11+
registry-url: "https://registry.npmjs.org"
1212
# see pnpm cache setting below
1313
env:
1414
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [main, develop]
66
pull_request:
7-
branches: [ main, develop ]
7+
branches: [main, develop]
88

99
permissions: {}
1010

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: Deploy to GitHub Pages
22

33
on:
44
push:
5-
branches: ['main']
5+
branches: ["main"]
66
workflow_dispatch:
77

88
permissions: {}
99

1010
concurrency:
11-
group: 'pages'
11+
group: "pages"
1212
cancel-in-progress: false
1313

1414
jobs:
@@ -38,7 +38,7 @@ jobs:
3838
- name: Upload artifact
3939
uses: actions/upload-pages-artifact@v3
4040
with:
41-
path: './apps/dashboard/dist'
41+
path: "./apps/dashboard/dist"
4242

4343
deploy:
4444
permissions:

.github/workflows/update-rolldown-stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
push:
55
branches: [main]
66
paths:
7-
- 'apps/dashboard/**'
8-
- 'tool/override-rolldown.js'
7+
- "apps/dashboard/**"
8+
- "tool/override-rolldown.js"
99

1010
permissions:
1111
contents: write

.oxlintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
},
3939
"globals": {},
4040
"ignorePatterns": ["dist"]
41-
}
41+
}

AGENTS.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Vibe Dashboard
2+
23
A modern frontend dashboard for displaying different metrics using bar charts. Built with React 19, TypeScript, Vite 7, and organized as a pnpm monorepo.
34

45
**ALWAYS follow these instructions first. Only fallback to additional search and context gathering if the information provided here is incomplete or found to be in error.**
56

67
## Working Effectively
78

89
### Prerequisites and Installation
10+
911
- Install Node.js v20 or higher (verified working with v20.19.4)
1012
- Install pnpm globally: `npm install -g pnpm` (requires pnpm v10 or higher)
1113
- Bootstrap the repository:
@@ -15,6 +17,7 @@ A modern frontend dashboard for displaying different metrics using bar charts. B
1517
- **Timing**: Takes approximately 10 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
1618

1719
### Build and Development
20+
1821
- Build the project:
1922
```bash
2023
pnpm build
@@ -39,6 +42,14 @@ A modern frontend dashboard for displaying different metrics using bar charts. B
3942
- Runs ESLint across all packages
4043
- **ALWAYS run before committing** to avoid CI failures
4144

45+
- Format the code:
46+
```bash
47+
pnpm fmt
48+
```
49+
- **Timing**: Takes approximately 2 seconds
50+
- Runs dprint across all files
51+
- **ALWAYS run before committing** to avoid CI failures
52+
4253
- Clean build artifacts:
4354
```bash
4455
pnpm clean
@@ -54,6 +65,7 @@ A modern frontend dashboard for displaying different metrics using bar charts. B
5465
- Takes under 1 second
5566

5667
### Repository Structure
68+
5769
```
5870
vibe-dashboard/
5971
├── .github/ # GitHub configuration
@@ -77,6 +89,7 @@ vibe-dashboard/
7789
## Validation
7890

7991
### Manual Testing Scenarios
92+
8093
**ALWAYS test these scenarios after making changes:**
8194

8295
1. **Basic functionality**:
@@ -98,6 +111,7 @@ vibe-dashboard/
98111
- Check that positive/negative change indicators are color-coded correctly
99112

100113
### Build Validation
114+
101115
- **ALWAYS run before committing**:
102116
```bash
103117
pnpm lint && pnpm build
@@ -108,6 +122,7 @@ vibe-dashboard/
108122
## Common Tasks
109123

110124
### Adding New Metrics
125+
111126
1. Edit `apps/dashboard/src/App.tsx`
112127
2. Add data array (follow pattern of `salesData`, `userActivityData`, `revenueData`)
113128
3. Add metric object to `metrics` array with:
@@ -119,21 +134,24 @@ vibe-dashboard/
119134
4. Customize chart rendering in the JSX if needed (current supports single bars and stacked bars)
120135

121136
### Key Files and Their Purpose
137+
122138
- `apps/dashboard/src/App.tsx` - **MOST IMPORTANT**: Contains all metrics data and chart logic
123139
- `apps/dashboard/src/App.css` - Responsive dashboard styles with CSS Grid and Flexbox
124140
- `package.json` (root) - Workspace scripts and shared dependencies
125141
- `apps/dashboard/package.json` - App-specific dependencies (React, Recharts, Lucide icons)
126142
- `pnpm-workspace.yaml` - Monorepo configuration
127143

128144
### Technology Stack
145+
129146
- **Frontend**: React 19 with TypeScript
130-
- **Build Tool**: Vite 7 (fast development and production builds)
147+
- **Build Tool**: Vite 7 (fast development and production builds)
131148
- **Charts**: Recharts library for responsive bar charts
132149
- **Icons**: Lucide React for UI icons
133150
- **Styling**: Pure CSS with CSS Grid, Flexbox, and CSS variables
134151
- **Package Management**: pnpm workspaces for monorepo structure
135152

136153
### Common Commands Reference
154+
137155
```bash
138156
# Development workflow
139157
pnpm install # Install dependencies (~10s)
@@ -148,14 +166,16 @@ pnpm -r build # Build all packages recursively
148166
```
149167

150168
### Troubleshooting
169+
151170
- **Build fails**: Check TypeScript errors, run `pnpm lint` first
152171
- **Dev server won't start**: Ensure port 5173 is available
153172
- **Charts not rendering**: Verify Recharts data format matches expected structure
154173
- **Styles broken**: Check CSS imports in `App.tsx` and `main.tsx`
155174

156175
### Development Notes
176+
157177
- Uses Vite's fast refresh for instant updates during development
158178
- TypeScript strict mode enabled for better code quality
159179
- ESLint configured with React and TypeScript rules
160180
- No test framework currently configured (future enhancement opportunity)
161-
- Responsive design supports mobile and desktop viewports
181+
- Responsive design supports mobile and desktop viewports

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ A modern frontend dashboard for displaying different metrics using bar charts.
2323
## ⚡ Performance
2424

2525
The dashboard uses **rolldown-vite** for significantly faster build times and **oxlint** for ultra-fast linting:
26+
2627
- **Build Performance**: ~13.8x faster builds (309ms vs 4.28s) with Rolldown
2728
- **Linting Performance**: Extremely fast linting (~2ms) with oxlint
2829
- **Development**: Fast startup (306ms) with Rolldown's Rust-based bundler
@@ -55,17 +56,20 @@ vibe-dashboard/
5556
### Installation
5657

5758
1. Clone the repository:
59+
5860
```bash
5961
git clone https://github.com/Boshen/vibe-dashboard.git
6062
cd vibe-dashboard
6163
```
6264

6365
2. Install dependencies:
66+
6467
```bash
6568
pnpm install
6669
```
6770

6871
3. Start the development server:
72+
6973
```bash
7074
pnpm dev
7175
```
@@ -88,6 +92,7 @@ The dashboard is automatically deployed to GitHub Pages when changes are pushed
8892
**Live Demo**: [https://boshen.github.io/vibe-dashboard/](https://boshen.github.io/vibe-dashboard/)
8993

9094
The deployment process:
95+
9196
1. Runs linting and builds the project
9297
2. Deploys the built assets to GitHub Pages
9398
3. The app is served with the correct base path `/vibe-dashboard/`
@@ -127,6 +132,7 @@ pnpm rolldown:use pkg.pr.new/rolldown-rs/vite@1234
127132
```
128133

129134
The tool automatically:
135+
130136
- Updates the package.json with the new version
131137
- Installs dependencies
132138
- Rebuilds the application
@@ -142,6 +148,7 @@ See [`tool/README.md`](tool/README.md) for detailed usage instructions.
142148
### Styling
143149

144150
The dashboard uses modern CSS with:
151+
145152
- CSS Grid for responsive layouts
146153
- Flexbox for component alignment
147154
- Custom CSS variables for consistent theming

apps/dashboard/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ Currently, two official plugins are available:
1414
This project uses [oxlint](https://oxc.rs) for linting, which provides significantly faster performance than ESLint while maintaining compatibility with most ESLint rules.
1515

1616
The configuration is in `.oxlintrc.json` and includes:
17+
1718
- TypeScript plugin for TypeScript-specific rules
1819
- React plugin for React best practices
1920
- Unicorn plugin for additional code quality rules
2021
- OXC plugin for unique optimization rules
2122

2223
To run linting:
24+
2325
```bash
2426
pnpm lint
2527
```
@@ -29,4 +31,3 @@ To customize the configuration, edit `.oxlintrc.json`. Oxlint supports most ESLi
2931
## Rolldown Stats Integration
3032

3133
This dashboard displays build statistics from different rolldown versions, automatically updated via CI when changes are made to the dashboard code.
32-

apps/dashboard/src/App.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import { BrowserRouter, Routes, Route } from 'react-router-dom'
2-
import './App.css'
3-
import Layout from './components/Layout'
4-
import RolldownStatsPage from './pages/RolldownStatsPage'
5-
import MinificationBenchmarksPage from './pages/MinificationBenchmarksPage'
1+
import { BrowserRouter, Route, Routes } from 'react-router-dom';
2+
import './App.css';
3+
import Layout from './components/Layout';
4+
import MinificationBenchmarksPage from './pages/MinificationBenchmarksPage';
5+
import RolldownStatsPage from './pages/RolldownStatsPage';
66

77
function App() {
88
return (
9-
<BrowserRouter basename="/vibe-dashboard">
9+
<BrowserRouter basename='/vibe-dashboard'>
1010
<Routes>
11-
<Route path="/" element={<Layout />}>
11+
<Route path='/' element={<Layout />}>
1212
<Route index element={<RolldownStatsPage />} />
13-
<Route path="minification" element={<MinificationBenchmarksPage />} />
13+
<Route path='minification' element={<MinificationBenchmarksPage />} />
1414
</Route>
1515
</Routes>
1616
</BrowserRouter>
17-
)
17+
);
1818
}
1919

20-
export default App
20+
export default App;

0 commit comments

Comments
 (0)