Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bun-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.4.4
14 changes: 9 additions & 5 deletions .github/workflows/visual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@ jobs:
uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: .bun-version

- name: Install dependencies
run: npm ci
run: bun install --frozen-lockfile

- name: Install Playwright Chromium
run: npx playwright install --with-deps chromium
run: bunx playwright install --with-deps chromium

- name: Build site
run: npm run build
run: bun run build

- name: Run visual snapshot tests
run: npm run test:visual
run: bun run test:visual

- name: Upload failure artifacts
if: failure()
Expand Down
14 changes: 7 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

## Cursor Cloud specific instructions

This repo is a single static **Astro** blog (`austinabbott.dev`, package name `dev-blog`), deployed to Cloudflare Pages. There is no backend, database, or other service — the only "service" is the Astro dev/build process. Commands are the npm scripts in `package.json` (`dev`/`start`, `build`, `preview`, `astro`).
This repo is a single static **Astro** blog (`austinabbott.dev`, package name `dev-blog`), deployed to Cloudflare Pages. There is no backend, database, or other service — the only "service" is the Astro dev/build process. Bun is the package manager and script runner (`bun install`, `bun run <script>`, `bunx`); Astro and Playwright still run on Node. Commands are the scripts in `package.json` (`dev`/`start`, `build`, `preview`, `astro`).

- Node: `.nvmrc` pins Node `24.18.1`, which is installed and set as the nvm default. A login shell (`bash -lc '...'`) picks up Node 24 automatically. Astro 7 also works on newer Node 22, so either is fine.
- Run dev: `npm run dev` serves the site at `http://localhost:4321/` with hot reload. Editing/adding Markdown under `src/content/blog/` is the core "content authoring" flow and hot-reloads into the blog index and post pages.
- Build: `npm run build` runs `astro check` (type check) first, then `astro build` into `dist/`. This is the closest thing to a lint step — there is **no ESLint/Prettier** configured.
- Visual regression: `npm run test:visual` runs Playwright screenshot comparisons against baselines in `tests/visual.spec.ts-snapshots/` (requires a prior Chromium install via `npx playwright install chromium`). Update baselines with `npm run test:visual:update`.
- Preview production build: `npm run preview` serves `dist/` (requires a prior build).
- Non-obvious: `npm install` under npm 11+ prints a benign `allow-scripts` warning that `esbuild` and `sharp` install scripts were skipped. This does **not** break anything — `sharp` image optimization works via prebuilt `@img/sharp-*` platform packages, confirmed by a successful `npm run build`. Do not attempt interactive `npm approve-scripts`.
- Versions: `.nvmrc` pins Node (the runtime for Astro and Playwright) and `.bun-version` pins Bun. Renovate keeps `.bun-version` current, and CI uses it. Cloudflare Pages reads Node from `.nvmrc` but ignores `.bun-version` and uses its build image's default Bun, which Cloudflare keeps up to date. Do not set `BUN_VERSION` in the dashboard, or it will need manual bumps.
- Run dev: `bun run dev` serves the site at `http://localhost:4321/` with hot reload. Editing/adding Markdown under `src/content/blog/` is the core "content authoring" flow and hot-reloads into the blog index and post pages.
- Build: `bun run build` runs `astro check` (type check) first, then `astro build` into `dist/`. This is the closest thing to a lint step — there is **no ESLint/Prettier** configured.
- Visual regression: `bun run test:visual` runs Playwright screenshot comparisons against baselines in `tests/visual.spec.ts-snapshots/` (requires a prior Chromium install via `bunx playwright install chromium`). Update baselines with `bun run test:visual:update`.
- Preview production build: `bun run preview` serves `dist/` (requires a prior build).
- Non-obvious: Bun runs dependency install scripts only for packages it trusts. Its default trusted list covers `esbuild` and `sharp`, and `bun pm untrusted` reports nothing skipped, so no `trustedDependencies` entry is needed.
- Astro 7 notes for this project: no remark/rehype plugins (Sätteri default Markdown processor is fine), no `src/fetch.ts`, and content schemas should import `z` from `astro/zod` (not `astro:content`).
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ Baselines are produced and compared on Linux in CI. Screenshots generated on mac
### First-time setup

```bash
npm ci
npx playwright install chromium
bun install
bunx playwright install chromium
```

Playwright browsers are downloaded separately from npm packages.
You need [Bun](https://bun.com) for packages and scripts, and Node.js (version in `.nvmrc`) because Astro and Playwright still run on Node. Playwright browsers are downloaded separately from packages.

### Run tests

```bash
npm run test:visual
bun run test:visual
```

This builds the site, serves the production build with `astro preview`, and fails if any screenshot differs from the committed baseline.
Expand All @@ -44,7 +44,7 @@ Prefer refreshing baselines from CI so they match Linux rendering:
For a local refresh (may still fail CI if fonts/rendering differ):

```bash
npm run test:visual:update
bun run test:visual:update
```

Review the changed PNGs, commit them with your layout change, and push. If CI still fails, replace baselines from the CI artifact as above.
Expand Down
Loading