You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Production build: `vp run build` (includes GitHub Pages `404.html`)
10
+
- Preview: `vp preview`
11
+
12
+
`vp dev`, `vp test`, `vp check`, `vp lint`, `vp fmt`, `vp build`, and `vp preview` are builtins. Use `vp run <script>` for `package.json` scripts such as `sync`.
13
+
14
+
Do not add ESLint or Prettier. Formatting and linting live in the `fmt` and `lint` blocks in `vite.config.ts`. Import Vite config helpers from `vite-plus` and test APIs from `vite-plus/test`.
Copy file name to clipboardExpand all lines: CLAUDE.md
+31-23Lines changed: 31 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,36 +4,35 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Overview
6
6
7
-
This is a TanStack Router-based React application built with Vite, TypeScript, and Tailwind CSS. The project serves as a code library viewer with Discord theme hosting capabilities, deployed to GitHub Pages.
7
+
This is a TanStack Router-based React application built with Vite+, TypeScript, and Tailwind CSS. The project serves as a code library viewer with Discord theme hosting capabilities, deployed to GitHub Pages.
8
+
9
+
The package manager is Bun. Use the `vp` CLI for day-to-day commands; `vp install` / `vp add` / `vp remove` delegate to Bun via `packageManager`.
8
10
9
11
## Development Commands
10
12
11
13
```bash
12
-
# Install dependencies
13
-
bun install
14
+
# Install dependencies (Bun, through Vite+)
15
+
vp install
14
16
15
17
# Start development server (runs on port 3000)
16
-
bun --bun run dev
17
-
18
-
# Build for production (includes TypeScript compilation and 404.html generation)
19
-
bun run build
18
+
vp dev
20
19
21
-
# Preview production build
22
-
bun run serve
20
+
# Format, lint, and type-check
21
+
vp check
22
+
vp check --fix
23
23
24
24
# Run tests
25
-
bun --bun run test
26
-
27
-
# Lint code
28
-
bun run lint
25
+
vp test
29
26
30
-
#Format code with Prettier
31
-
bun run format
27
+
#Build for production (Vite+ bundle + 404.html for GitHub Pages)
28
+
vp run build
32
29
33
-
#Format and lint with auto-fix
34
-
bun run check
30
+
#Preview production build
31
+
vp preview
35
32
```
36
33
34
+
`vp dev`, `vp test`, `vp check`, `vp lint`, `vp fmt`, `vp build`, and `vp preview` are Vite+ builtins. `vp run <script>` runs `package.json` scripts (`sync`, `build`, and so on).
35
+
37
36
## Project Architecture
38
37
39
38
### Routing System
@@ -46,6 +45,7 @@ bun run check
46
45
### Virtual Module System
47
46
48
47
The project uses a custom Vite plugin (`codeLibraryManifestPlugin`) that:
48
+
49
49
- Scans the `public/` directory at build time
50
50
- Generates a virtual module `virtual:code-library` containing file metadata
51
51
- Provides manifest data including file paths, sizes, and modification times
@@ -62,6 +62,7 @@ This powers the code library viewer functionality by exposing `public/` director
62
62
### Code Viewer Component
63
63
64
64
`src/components/code-file-viewer.tsx`:
65
+
65
66
- Uses Shiki for syntax highlighting with theme support
66
67
- Dynamically imports Shiki to avoid bundle bloat
67
68
- Adapts to light/dark mode from the theme provider
@@ -84,27 +85,31 @@ This powers the code library viewer functionality by exposing `public/` director
84
85
85
86
### Build Process
86
87
87
-
The build script runs three steps sequentially:
88
-
1.`vite build` - Bundles the application
89
-
2.`tsc` - Type checks the codebase
90
-
3.`node scripts/copy-404.mjs` - Copies `dist/index.html` to `dist/404.html` for GitHub Pages client-side routing support
88
+
`vp run build` runs two steps:
89
+
90
+
1.`vp build` - Bundles the application with Vite+
91
+
2.`node scripts/copy-404.mjs` - Copies `dist/index.html` to `dist/404.html` for GitHub Pages client-side routing support
92
+
93
+
Type-checking lives in `vp check` (Oxlint + tsgo), not in the production build.
91
94
92
95
### Deployment
93
96
94
97
- Deploys to GitHub Pages via `.github/workflows/deploy.yml`
95
98
- Triggered on pushes to `master` branch
96
-
- Uses Bun for dependency installation and building
99
+
- Uses `voidzero-dev/setup-vp` and Bun (`packageManager`: `bun@1.4.0`)
97
100
- Artifacts uploaded from `./dist` directory
98
101
99
102
## Working with Routes
100
103
101
104
When adding new routes:
105
+
102
106
1. Create a new `.tsx` file in `src/routes/`
103
107
2. Use `createFileRoute()` to define the route
104
108
3. TanStack Router will auto-generate the route configuration
105
109
4. Add navigation links using `<Link to="/route-path">` from `@tanstack/react-router`
0 commit comments