Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-pnpm
- name: Setup vp
uses: voidzero-dev/setup-vp@679fb3bf669a1777bb417e81218c5ab904aa037f # v1
with:
cache: true

- name: Build
run: pnpm build
run: vp run build

- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
Expand Down
56 changes: 28 additions & 28 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,22 @@ A modern frontend dashboard for displaying different metrics using bar charts. B

### Prerequisites and Installation

- Install the global `vp` CLI (see https://staging.viteplus.dev/vite/guide/):

```bash
# Linux / macOS
curl -fsSL https://staging.viteplus.dev/install.sh | bash

# Windows
irm https://staging.viteplus.dev/install.ps1 | iex
```

- Install Node.js v20 or higher (verified working with v20.19.4)
- Install pnpm globally: `npm install -g pnpm` (requires pnpm v10 or higher)
Comment thread
fengmk2 marked this conversation as resolved.
Outdated
- Bootstrap the repository:

```bash
pnpm install
vp install
```

- **Timing**: Takes approximately 10 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
Expand All @@ -23,7 +33,7 @@ A modern frontend dashboard for displaying different metrics using bar charts. B
- Build the project:

```bash
pnpm build
vp run build
```

- **Timing**: Takes approximately 7 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
Expand All @@ -33,37 +43,28 @@ A modern frontend dashboard for displaying different metrics using bar charts. B
- Start development server:

```bash
pnpm dev
vp dev
Comment thread
fengmk2 marked this conversation as resolved.
Outdated
```

- Starts at `http://localhost:5173/`
- **Timing**: Starts in under 1 second (192ms)
- Uses Vite with hot module replacement (HMR)

- Lint the code:

```bash
pnpm lint
```

- **Timing**: Takes approximately 2 seconds
- Runs ESLint across all packages
- **ALWAYS run before committing** to avoid CI failures

- Format the code:
- Check (lint + format):

```bash
pnpm fmt
vp run check
```

- **Timing**: Takes approximately 2 seconds
- Runs vite fmt across all files
- Runs `vp check` (lint + format in one command)
- **ALWAYS run before committing** to avoid CI failures
- Use `vp run check:fix` to auto-fix issues

- Clean build artifacts:

```bash
pnpm clean
vp run clean
```

- **Timing**: Takes under 1 second
Expand All @@ -72,7 +73,7 @@ A modern frontend dashboard for displaying different metrics using bar charts. B
- Test command:

```bash
pnpm test
vp test
```

- **Note**: Currently no tests are configured, command runs but executes nothing
Expand Down Expand Up @@ -109,7 +110,7 @@ vibe-dashboard/
**ALWAYS test these scenarios after making changes:**

1. **Basic functionality**:
- Run `pnpm dev` and navigate to `http://localhost:5173/`
- Run `vp dev` and navigate to `http://localhost:5173/`
- Verify the dashboard loads with "Vibe Dashboard" header
- Confirm Sales chart is displayed by default

Expand All @@ -130,7 +131,7 @@ vibe-dashboard/

- **ALWAYS run before committing**:
```bash
pnpm lint && pnpm build
vp run check && vp run build
```
- Verify build completes without errors
- Check that no TypeScript compilation errors occur
Expand Down Expand Up @@ -170,20 +171,19 @@ vibe-dashboard/

```bash
# Development workflow
pnpm install # Install dependencies (~10s)
pnpm dev # Start dev server (<1s startup)
pnpm build # Production build (~7s)
pnpm lint # Lint all packages (~2s)
pnpm clean # Clean build artifacts (<1s)
vp install # Install dependencies (~10s)
vp dev # Start dev server (<1s startup)
vp run build # Production build (~7s)
vp run check # Check (lint + format) (~2s)
vp run clean # Clean build artifacts (<1s)

# Monorepo-specific
pnpm --filter dashboard dev # Run dev only for dashboard
pnpm -r build # Build all packages recursively
vp run @vibe/dashboard#dev # Run dev only for dashboard
```

### Troubleshooting

- **Build fails**: Check TypeScript errors, run `pnpm lint` first
- **Build fails**: Check TypeScript errors, run `vp run check` first
- **Dev server won't start**: Ensure port 5173 is available
- **Charts not rendering**: Verify Recharts data format matches expected structure
- **Styles broken**: Check CSS imports in `App.tsx` and `main.tsx`
Expand Down
26 changes: 20 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@

React 19 + TypeScript + Vite 7 dashboard. pnpm monorepo.

## Prerequisites

Install the global `vp` CLI first (see https://staging.viteplus.dev/vite/guide/):

```bash
# Linux / macOS
curl -fsSL https://staging.viteplus.dev/install.sh | bash

# Windows
irm https://staging.viteplus.dev/install.ps1 | iex
```

## Commands

```bash
pnpm install # Install deps (~10s, timeout 60s+)
pnpm dev # Dev server at localhost:5173
pnpm build # Production build (~7s)
pnpm lint # Run ESLint
pnpm fmt # Format with vite fmt
vp install # Install deps (~10s, timeout 60s+)
vp dev # Dev server at localhost:5173
vp run build # Production build (~7s)

# Check (lint + format)
vp run check
vp run check:fix
```

## Structure
Expand All @@ -28,6 +42,6 @@ You run in an environment where `ast-grep` is available; whenever a search requi

## Always

- Run `pnpm lint && pnpm build` before commits
- Run `vp run check && vp run build` before commits
- Prefer editing existing files over creating new ones
- Don't create docs unless explicitly requested
8 changes: 4 additions & 4 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"dev": "vp dev",
"build": "vp build",
"preview": "vp preview",
"clean": "rm -rf dist",
"test": "vite test"
"test": "vp test"
},
"dependencies": {
"@vibe/shared": "workspace:*",
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"description": "A frontend dashboard for displaying different metrics",
"type": "module",
"scripts": {
"ready": "vite run check && vite run test && vite run build",
"dev": "vite run @vibe/dashboard#dev",
"build": "vite run @vibe/dashboard#build",
"ready": "vp run check && vp run test && vp run build",
"dev": "vp run @vibe/dashboard#dev",
"build": "vp run @vibe/dashboard#build",
"check": "vp check",
"check:fix": "vp check --fix",
"test": "vite test",
"cache:clean": "vite cache clean",
"test": "vp test",
"cache:clean": "vp cache clean",
"generate": "node tools/override-rolldown.mjs --stats",
"prepare": "husky"
},
Expand Down