Skip to content

Commit 7871141

Browse files
authored
Merge pull request #27 from wwlrc/archey/use-bun
s/npm/bun/
2 parents ec7b315 + e266696 commit 7871141

File tree

6 files changed

+956
-6529
lines changed

6 files changed

+956
-6529
lines changed

.github/workflows/build-deploy.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,22 @@ jobs:
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v4
18-
- name: Setup Node
19-
uses: actions/setup-node@v4
20-
with:
21-
node-version: "24"
22-
cache: npm
18+
- name: Setup Bun
19+
uses: oven-sh/setup-bun@v2
2320
- name: Restore cache
2421
uses: actions/cache@v4
2522
with:
2623
path: |
2724
.next/cache
2825
# Generate a new cache whenever packages or source files change.
29-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
26+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
3027
# If source files changed but packages didn't, rebuild from a prior cache.
3128
restore-keys: |
32-
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
29+
${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-
3330
- name: Install dependencies
34-
run: npm ci
31+
run: bun install --frozen-lockfile
3532
- name: Build with Next.js
36-
run: npx --no-install next build
33+
run: bun run build
3734
- name: Add .htaccess
3835
run: cp deployment/htaccess.txt out/.htaccess
3936
- name: Install lftp

.github/workflows/lint.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ jobs:
1313

1414
steps:
1515
- name: Begin CI...
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717

18-
- name: Set up Node.js
19-
uses: actions/setup-node@v1
20-
with:
21-
node-version: 24
18+
- name: Setup Bun
19+
uses: oven-sh/setup-bun@v2
2220

23-
- name: Install Node.js dependencies
24-
run: npm ci
21+
- name: Install dependencies
22+
run: bun install --frozen-lockfile
2523

2624
- name: Lint
27-
run: npm run lint
25+
run: bun run lint

CLAUDE.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is the Wye & Welsh Land Rover Club (WWLRC) website, a statically exported Next.js site deployed via FTP.
8+
9+
## Commands
10+
11+
```bash
12+
bun run dev # Start development server
13+
bun run build # Build static export (outputs to /out)
14+
bun run lint # Run ESLint
15+
```
16+
17+
Always run `bun run build` before pushing to ensure static export works correctly.
18+
19+
## Architecture
20+
21+
### Static Export
22+
The site uses Next.js with `output: 'export'` (configured in `next.config.mjs`), generating a fully static site in the `/out` directory. This means all data fetching happens at build time.
23+
24+
### Spanner API Integration
25+
The site fetches data from the club's management system at `spanner.wwlrc.co.uk`. The API client is in `src/spanner/`:
26+
- `api.ts` - Base fetch wrapper using `pathcat` for URL construction
27+
- `wwlrc.ts` - Club-specific constants (club ID, Facebook link)
28+
- `events.ts` - Fetches rally/event data
29+
- `blog.ts` - Fetches news posts
30+
31+
Data is fetched at build time in page components (e.g., `getPosts()` in `src/app/page.tsx`).
32+
33+
### Directory Structure
34+
- `src/app/` - Next.js App Router pages (home, about, join, events, sponsors)
35+
- `src/components/` - Shared React components (navbar, footer, calendar, blog)
36+
- `src/spanner/` - API client for Spanner backend
37+
- `deployment/` - Contains htaccess config copied to output during deploy
38+
39+
### Deployment
40+
CI/CD via GitHub Actions (`.github/workflows/build-deploy.yml`) builds and uploads to FTP on push to main.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ This is the repo for the Wye & Welsh Land Rover Club's website.
44

55
## Development Setup
66

7-
1. Install nodejs/npm for your system. See [https://nodejs.org/en/download]
7+
1. Install bun for your system. See [https://bun.sh]
88

9-
2. Run `npm install` to install the dependencies
9+
2. Run `bun install` to install the dependencies
1010

11-
3. Run `npm run dev` to test locally. This will automatically start a web server, and will output a URL that you can visit in a web browser.
11+
3. Run `bun run dev` to test locally. This will automatically start a web server, and will output a URL that you can visit in a web browser.
1212

1313
## Building
1414

15-
Before pushing changes, make sure it builds statically by running `npm run build` (I should really add this in CI).
15+
Before pushing changes, make sure it builds statically by running `bun run build` (I should really add this in CI).

0 commit comments

Comments
 (0)