Skip to content

Commit 9fb3d31

Browse files
pascalandyclaude
andauthored
refactor(build): migrate from Makefile to Justfile (#55)
* refactor(build): migrate from Makefile to Justfile Replace Makefile with Justfile for simpler command runner syntax. Update lefthook hooks to use just commands for consistency. Add conductor.json for workspace scripts and dev workflow docs. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(readme): simplify quick start commands Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(justfile): use bun astro check for PATH compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f5368b5 commit 9fb3d31

7 files changed

Lines changed: 231 additions & 76 deletions

File tree

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
- resize_page before screenshots
1313
- magick mogrify -resize '1920x1920>' -quality 70 {filename}
1414

15-
## Make Targets
16-
- `make qa` pre-commit | `make ci` fast check | `make build` | `make lint` | `make format`
15+
## Just Recipes
16+
- `just qa` pre-commit | `just ci` fast check | `just build` | `just lint` | `just format`
1717

1818
## To test this app
19-
- Spawn @charlie → tell it: "run: make qa"
19+
- Spawn @charlie → tell it: "run: just qa"
2020

2121
## Git
2222
Atomic commits only. "and" in msg = split it.

Makefile

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

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,34 @@ This is my personal blog built on the AstroPaper theme - a minimal, responsive,
44

55
Source: https://github.com/pascalandy/pascalandy-blog-paper
66

7+
## Prerequisites
8+
9+
- [Bun](https://bun.sh/) - Package manager & runtime
10+
- [Just](https://just.systems/) - Command runner (required for hooks and CI)
11+
12+
```bash
13+
# macOS
14+
brew install bun just
15+
16+
# Verify installation
17+
bun --version && just --version
18+
```
19+
20+
## Quick Start
21+
22+
```bash
23+
just install
24+
just dev
25+
just qa
26+
```
27+
728
## Tech Stack
829

930
- [Astro](https://astro.build/) - Static site generator
1031
- [TypeScript](https://www.typescriptlang.org/) - Type checking
1132
- [Tailwind CSS v4](https://tailwindcss.com/) - Styling
1233
- [Pagefind](https://pagefind.app/) - Static search
13-
- [Bun](https://bun.sh/) - Package manager & runtime
34+
- [Just](https://just.systems/) - Command runner
1435
- [Prettier](https://prettier.io/) + [ESLint](https://eslint.org) - Code quality
1536

1637
## Documentation

conductor.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"setup": "just install",
3+
"run": "just dev",
4+
"archive": "just archive"
5+
}

dev_notes/dev-workflow.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Workflow de Développement
2+
3+
## Vue d'ensemble
4+
5+
Ce projet utilise un workflow en couches pour garantir la qualité du code:
6+
7+
- **Justfile** - Commandes de développement (`just <recipe>`)
8+
- **Lefthook** - Git hooks automatiques
9+
- **Conductor** - Scripts de workspace
10+
11+
## Diagramme
12+
13+
```mermaid
14+
flowchart TB
15+
subgraph SETUP["Setup"]
16+
A[just install] --> B[bun install]
17+
B --> C[lefthook install]
18+
end
19+
20+
subgraph DEV["Development"]
21+
D[just dev] --> E[lint]
22+
E --> F[format]
23+
F --> G[format-check]
24+
G --> H[dev server :4320]
25+
end
26+
27+
subgraph QA["QA / CI"]
28+
I[just qa] --> J[lint + format]
29+
J --> K[check-tags]
30+
K --> L[build]
31+
32+
M[just ci] --> N[lint]
33+
N --> O[format-check]
34+
O --> P[check-tags]
35+
P --> Q[build]
36+
end
37+
38+
subgraph HOOKS["Git Hooks"]
39+
R[git commit] --> S[pre-commit]
40+
S --> T[format + lint + check-tags]
41+
42+
U[git push] --> V[pre-push]
43+
V --> W[astro check + build]
44+
end
45+
46+
subgraph ARCHIVE["Archive"]
47+
X[just archive] --> Y[rm node_modules]
48+
end
49+
50+
SETUP --> DEV
51+
DEV --> QA
52+
QA --> HOOKS
53+
HOOKS --> ARCHIVE
54+
```
55+
56+
## Commandes
57+
58+
| Commande | Usage | Description |
59+
|----------|-------|-------------|
60+
| `just i` | Setup | Installer dépendances |
61+
| `just dev` | Dev | Serveur sur port 4320 |
62+
| `just dev 4321` | Dev | Serveur sur port custom |
63+
| `just qa` | Agents | Validation avec autoformat |
64+
| `just ci` | CI | Validation sans autoformat |
65+
| `just build` | Build | Build production |
66+
| `just clean` | Cleanup | Cache seulement |
67+
| `just archive` | Archive | Supprime node_modules |
68+
69+
## Git Hooks (Lefthook)
70+
71+
### Pre-commit (parallèle)
72+
73+
| Job | Commande | Description |
74+
|-----|----------|-------------|
75+
| format | `just format` | Formatte le code |
76+
| format-check | `just format-check` | Vérifie le format |
77+
| lint | `just lint` | ESLint |
78+
| check-tags | `just check-tags` | Valide les tags |
79+
80+
### Pre-push (parallèle)
81+
82+
| Job | Commande | Description |
83+
|-----|----------|-------------|
84+
| check | `just check` | TypeScript/Astro check |
85+
| build | `just build` | Build complet |
86+
87+
## Conductor Scripts
88+
89+
| Script | Commande | Quand |
90+
|--------|----------|-------|
91+
| Setup | `just install` | Création workspace |
92+
| Run | `just dev` | Bouton Run |
93+
| Archive | `just archive` | Archivage workspace |
94+
95+
## Flux de travail typique
96+
97+
```bash
98+
# 1. Setup initial
99+
just install
100+
101+
# 2. Développement
102+
just dev # ou just dev 4321 pour un autre port
103+
104+
# 3. Avant commit (automatique via lefthook)
105+
# format → format-check → lint → check-tags
106+
107+
# 4. Avant push (automatique via lefthook)
108+
# check → build
109+
110+
# 5. Archivage
111+
just archive
112+
```

justfile

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Justfile for Astro blog
2+
# Run `just` to see available recipes
3+
4+
set shell := ["bash", "-euo", "pipefail", "-c"]
5+
6+
# === Setup ===
7+
8+
# Install dependencies
9+
install:
10+
bun install
11+
12+
alias i := install
13+
14+
# === Code Quality (base recipes) ===
15+
16+
# Run ESLint
17+
lint:
18+
bun run lint | tspin
19+
20+
# Format code with Prettier
21+
format:
22+
bun run format | tspin
23+
24+
# Check formatting without changes
25+
format-check:
26+
bun run format:check | tspin
27+
28+
# Validate tags
29+
check-tags:
30+
./scripts/check-tags.sh
31+
32+
# === Build (base recipes) ===
33+
34+
# Build for production
35+
build:
36+
bun run build | tspin
37+
38+
# Run Astro check
39+
check:
40+
bun run sync && bun astro check | tspin
41+
42+
# Preview production build
43+
preview:
44+
bun run preview | tspin
45+
46+
# === Development (composite recipes) ===
47+
48+
# Full workflow: lint, format, then dev server
49+
dev port="4320":
50+
just lint
51+
just format
52+
just format-check
53+
bun run dev --port {{port}} | tspin
54+
55+
# QA workflow for agents (with autoformat, no server)
56+
qa:
57+
just lint
58+
just format
59+
just format-check
60+
just check-tags
61+
just build
62+
63+
# CI workflow (no autoformat)
64+
ci:
65+
just lint
66+
just format-check
67+
just check-tags
68+
just build
69+
70+
# === Cleanup ===
71+
72+
# Remove build artifacts and cache
73+
clean:
74+
rm -rf dist node_modules/.cache .astro
75+
76+
# Deep clean before archiving workspace (removes node_modules)
77+
archive:
78+
rm -rf dist node_modules .astro

lefthook.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,28 @@ pre-commit:
55
parallel: true
66
jobs:
77
- name: format
8-
run: bun run format
8+
run: just format
99
fail_text: "Error while formatting"
1010

11-
- name: format:check
12-
run: bun run format:check
13-
fail_text: "Formatting issues found. Run 'bun run format' to fix"
11+
- name: format-check
12+
run: just format-check
13+
fail_text: "Formatting issues found. Run 'just format' to fix"
1414

1515
- name: lint
16-
run: bun run lint | tspin
16+
run: just lint
1717
fail_text: "Linting errors found. Fix them before committing"
1818

19+
- name: check-tags
20+
run: just check-tags
21+
fail_text: "Invalid tags found. Check scripts/check-tags.sh"
22+
1923
pre-push:
2024
parallel: true
2125
jobs:
2226
- name: check
23-
run: bun astro check | tspin
27+
run: just check
2428
fail_text: "TypeScript errors found. Fix them before pushing"
2529

2630
- name: build
27-
run: bun astro build | tspin
31+
run: just build
2832
fail_text: "Build failed. Check image paths or content errors"

0 commit comments

Comments
 (0)