Skip to content

Commit a5e04cd

Browse files
committed
chore: Migrate project tooling and CI to Vite+
- Replace ESLint and Prettier with Oxlint and Oxfmt - Update local commands and GitHub Actions to use vp - Pin Node.js 24 and refresh dependencies
1 parent 930f8af commit a5e04cd

94 files changed

Lines changed: 1644 additions & 1376 deletions

Some content is hidden

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

.github/workflows/deploy.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,29 @@ jobs:
2828
- name: Checkout
2929
uses: actions/checkout@v5
3030

31-
- name: Set up Node
32-
uses: actions/setup-node@v5
31+
- name: Set up Vite+
32+
uses: voidzero-dev/setup-vp@v1.17.0
3333
with:
34-
node-version: '22'
35-
check-latest: true
36-
37-
- name: Install Bun
38-
uses: oven-sh/setup-bun@v1
39-
with:
40-
bun-version: latest
41-
42-
- name: Install dependencies
43-
run: bun install --frozen-lockfile
34+
node-version-file: '.node-version'
35+
cache: true
36+
run-install: |
37+
args: ['--frozen-lockfile']
4438
4539
- name: Sync catalog
4640
env:
4741
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
run: bun run sync
42+
run: vp run sync
43+
44+
- name: Check
45+
run: vp check
46+
47+
- name: Test
48+
run: vp test
4949

5050
- name: Build
5151
env:
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53-
run: bun run build
53+
run: vp run build
5454

5555
- name: Setup Pages
5656
uses: actions/configure-pages@v5

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ node_modules
22
.DS_Store
33
dist
44
dist-ssr
5+
.vite
56
*.local
67
count.txt
78
.env

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

.prettierignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.vite-hooks/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vp staged

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["VoidZero.vite-plus-extension-pack"]
3+
}

.vscode/settings.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,26 @@
77
},
88
"files.readonlyInclude": {
99
"**/routeTree.gen.ts": true
10-
}
10+
},
11+
"editor.defaultFormatter": "oxc.oxc-vscode",
12+
"[javascript]": {
13+
"editor.defaultFormatter": "oxc.oxc-vscode"
14+
},
15+
"[javascriptreact]": {
16+
"editor.defaultFormatter": "oxc.oxc-vscode"
17+
},
18+
"[typescript]": {
19+
"editor.defaultFormatter": "oxc.oxc-vscode"
20+
},
21+
"[typescriptreact]": {
22+
"editor.defaultFormatter": "oxc.oxc-vscode"
23+
},
24+
"oxc.disableNestedConfig": true,
25+
"oxc.fmt.disableNestedConfig": true,
26+
"editor.formatOnSave": true,
27+
"editor.formatOnSaveMode": "file",
28+
"editor.codeActionsOnSave": {
29+
"source.fixAll.oxc": "explicit"
30+
},
31+
"npm.scriptRunner": "vp"
1132
}

AGENTS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Agent instructions
2+
3+
This project uses [Vite+](https://viteplus.dev) (`vp`) with Bun as the package manager.
4+
5+
- Install: `vp install` (delegates to Bun)
6+
- Dev server: `vp dev` (port 3000)
7+
- Check: `vp check` / `vp check --fix` (Oxfmt + Oxlint + type-check)
8+
- Test: `vp test`
9+
- 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`.
15+
16+
See `CLAUDE.md` for project architecture.

CLAUDE.md

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,35 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Overview
66

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`.
810

911
## Development Commands
1012

1113
```bash
12-
# Install dependencies
13-
bun install
14+
# Install dependencies (Bun, through Vite+)
15+
vp install
1416

1517
# 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
2019

21-
# Preview production build
22-
bun run serve
20+
# Format, lint, and type-check
21+
vp check
22+
vp check --fix
2323

2424
# Run tests
25-
bun --bun run test
26-
27-
# Lint code
28-
bun run lint
25+
vp test
2926

30-
# Format code with Prettier
31-
bun run format
27+
# Build for production (Vite+ bundle + 404.html for GitHub Pages)
28+
vp run build
3229

33-
# Format and lint with auto-fix
34-
bun run check
30+
# Preview production build
31+
vp preview
3532
```
3633

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+
3736
## Project Architecture
3837

3938
### Routing System
@@ -46,6 +45,7 @@ bun run check
4645
### Virtual Module System
4746

4847
The project uses a custom Vite plugin (`codeLibraryManifestPlugin`) that:
48+
4949
- Scans the `public/` directory at build time
5050
- Generates a virtual module `virtual:code-library` containing file metadata
5151
- 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
6262
### Code Viewer Component
6363

6464
`src/components/code-file-viewer.tsx`:
65+
6566
- Uses Shiki for syntax highlighting with theme support
6667
- Dynamically imports Shiki to avoid bundle bloat
6768
- Adapts to light/dark mode from the theme provider
@@ -84,27 +85,31 @@ This powers the code library viewer functionality by exposing `public/` director
8485

8586
### Build Process
8687

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.
9194

9295
### Deployment
9396

9497
- Deploys to GitHub Pages via `.github/workflows/deploy.yml`
9598
- 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`)
97100
- Artifacts uploaded from `./dist` directory
98101

99102
## Working with Routes
100103

101104
When adding new routes:
105+
102106
1. Create a new `.tsx` file in `src/routes/`
103107
2. Use `createFileRoute()` to define the route
104108
3. TanStack Router will auto-generate the route configuration
105109
4. Add navigation links using `<Link to="/route-path">` from `@tanstack/react-router`
106110

107111
Example route structure:
112+
108113
```tsx
109114
import { createFileRoute } from '@tanstack/react-router'
110115

@@ -120,6 +125,7 @@ function YourComponent() {
120125
## Discord Themes
121126

122127
The `/discord-themes` route demonstrates the code library viewer:
128+
123129
- Fetches files from `public/discord/themes/`
124130
- Uses the library system to organize and display theme files
125131
- Renders CSS files with syntax highlighting
@@ -128,13 +134,15 @@ The `/discord-themes` route demonstrates the code library viewer:
128134
## Path Aliases
129135

130136
The `@/` alias resolves to `./src/` for cleaner imports:
137+
131138
```tsx
132139
import { cn } from '@/lib/utils'
133140
import { Button } from '@/components/ui/button'
134141
```
135142

136143
## Testing
137144

138-
- Vitest configured with jsdom environment
145+
- Vitest is bundled with Vite+ (`vp test`) and configured with jsdom
139146
- React Testing Library available for component tests
140147
- Tests run in globals mode (no need to import `describe`, `it`, `expect`)
148+
- Import test APIs from `vite-plus/test` when you need explicit imports

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ That file is copied from the source repo on each deploy, so it stays in sync wit
3030
`install` is optional. When it is set, deploy copies that script to `/install/<name>.sh`.
3131

3232
3. If it should also appear in a homepage group with extra routing, add it to `src/data/projects.ts`.
33-
4. Push this repo (or run `bun run sync` locally). GitHub Pages rebuilds on push, on a daily schedule, and when another repo dispatches `hub-sync`.
33+
4. Push this repo (or run `vp run sync` locally). GitHub Pages rebuilds on push, on a daily schedule, and when another repo dispatches `hub-sync`.
3434

3535
See [catalog.md](catalog.md) for the full notes.
3636

3737
## Local
3838

3939
```bash
40-
bun install
41-
bun run sync
42-
bun run dev
40+
vp install
41+
vp run sync
42+
vp dev
4343
```
4444

4545
`sync` needs network access to GitHub. Deploy runs it automatically.

0 commit comments

Comments
 (0)