Skip to content
Le blog de Pascal Andy - L'homme et les relations technologiques

Development Workflow

Table of Contents

Development Workflow

Quick reference for all development commands.

Daily Development

# Start dev server (hot reload)
bun run lint && bun run format | tspin && bun run build | tspin && bun run dev | tspin

# Preview production build locally
bun run preview

Quality Checks

Run these before committing:

# Type checking (Astro + TypeScript)
bun astro check

# Linting (ESLint)
bun run lint

# Format check (Prettier)
bun run format:check
# stop on error

# Auto-format all files
bun run format | tspin

Production Build

# Full build pipeline
bun run build

This runs:

  1. astro check — TypeScript validation
  2. astro build — Generate static site in dist/
  3. pagefind --site dist — Build search index
  4. cp -r dist/pagefind public/ — Copy search index to public

Sync Content Collections

# Regenerate TypeScript types for content
bun run sync

Use after modifying src/content.config.ts or adding new content fields.

Command Summary

CommandPurpose
bun run devStart dev server with hot reload
bun run buildFull production build
bun run previewPreview production build
bun run syncSync content collection types
bun astro checkTypeScript type checking
bun run lintESLint code linting
bun run formatAuto-format with Prettier
bun run format:checkCheck formatting without changes

Git Hooks (Automated Quality Checks)

Git hooks are configured via Lefthook to automatically run quality checks.

Pre-commit (runs on every commit)

  1. bun run format:check — Verify formatting
  2. bun run lint — Check for linting errors

Pre-push (runs before pushing)

  1. bun astro check — TypeScript validation
  2. bun run build — Full production build

Setup

Hooks are installed automatically when you run bun install (via the prepare script). To manually reinstall:

bunx lefthook install

Bypassing Hooks (use sparingly)

# Skip pre-commit hooks
git commit --no-verify -m "message"

# Skip pre-push hooks
git push --no-verify

Preview Deployment

Deploy a preview build to Sevalla on demand using PR labels.

How it works

  1. Create a PR — CI runs checks (lint, format, typecheck, build) but no deploy
  2. Add preview label — triggers deployment to Sevalla preview instance
  3. Push more commits — continues deploying (label persists)
  4. Remove label — stops future preview deploys

Commands

# Add preview label to current branch's PR
gh pr edit --add-label "preview"

# Add preview label by PR number
gh pr edit 123 --add-label "preview"

# Create PR with preview label
gh pr create --title "Your title" --label "preview"

# Remove preview label
gh pr edit --remove-label "preview"

AI Assistant Prompt

Add the preview label to this PR

Or if no PR exists:

Create a PR with the preview label

Notes