Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a6ff1e2
Checkpoint
matthewp May 26, 2026
e2f7d7a
Merge main into cloudflare-migration
matthewp May 28, 2026
fdec2d3
Remove Netlify config, use R2 for large assets via site-assets.astro.…
matthewp May 28, 2026
6dcfcab
Add advanced routing to proxy /fonts/* to fonts-cdn.astro.build
matthewp May 28, 2026
dd77cab
Trigger Workers Build
matthewp May 28, 2026
850ca09
Trigger Workers Build (2)
matthewp May 28, 2026
080e4e6
Move IntegrationCategories out of content.config to avoid bundling gl…
matthewp May 28, 2026
df8cac3
Add request logging to app.ts
matthewp May 28, 2026
43c3721
Add verbose request and fetch logging
matthewp May 28, 2026
d91ca95
Log response body on non-ok fetch responses
matthewp May 28, 2026
8d71e9e
Trigger rebuild
matthewp May 28, 2026
4d2e761
Fix: change not_found_handling to none so SSR routes reach the worker
matthewp May 28, 2026
1865960
Strip wrangler.jsonc down to custom config only, let adapter handle t…
matthewp May 28, 2026
02eccd8
Add extensive logging to app.ts
matthewp May 28, 2026
604a55e
Fix: remove env param from fetch signature
matthewp May 28, 2026
514ade4
Enable node compat flag
matthewp May 29, 2026
31dae02
Pre-bundle @iconify/utils for workerd compatibility
matthewp May 29, 2026
d969527
Use prerenderEnvironment: 'node' to avoid CJS/workerd incompatibiliti…
matthewp May 29, 2026
2e54f5f
Remove app.ts and advancedRouting, no longer needed
matthewp May 29, 2026
178477d
Pre-bundle CJS deps for workerd compatibility (expressive-code, iconify)
matthewp May 29, 2026
947d158
Trigger rebuild
matthewp May 29, 2026
937517d
Revert to prerenderEnvironment: node
matthewp May 29, 2026
f3402eb
Merge main into cloudflare-migration
matthewp Jun 5, 2026
251286d
Address review: prerender themes/integrations/agencies, add fonts pro…
matthewp Jun 8, 2026
e26bd79
Revert dynamic routes back to SSR, keep only themes/agencies index pr…
matthewp Jun 8, 2026
f8a8558
Merge main into cloudflare-migration
matthewp Jun 8, 2026
23d26b1
Use fonts-cdn.astro.build directly with preconnect, remove app.ts proxy
matthewp Jun 9, 2026
7f11920
Merge main into cloudflare-migration
matthewp Jun 9, 2026
35c8d3d
Update src/pages/agencies/index.astro
matthewp Jun 10, 2026
f0edf23
Fix preview site URL to use WORKERS_CI_BRANCH env var
matthewp Jun 10, 2026
4aafcb8
Revert themes index to SSR for redirect support
matthewp Jun 10, 2026
0529168
Optimize astro-expressive-code
matthewp Jun 11, 2026
1089ce1
Add non-trailing-slash variants for all redirects
matthewp Jun 11, 2026
8ee6041
Merge remote-tracking branch 'origin/main' into cloudflare-migration
matthewp Jun 11, 2026
cbcea5f
Remove sharp image service patch
matthewp Jun 11, 2026
53fd01d
Remove astro patch from lockfile
matthewp Jun 11, 2026
59536a1
Remove astro patch from pnpm
matthewp Jun 11, 2026
be90647
Remove astro patch from pnpm-workspace.yaml
matthewp Jun 11, 2026
d13a2bd
Fix expressive code: use JS regex engine and add postcss-nested to op…
matthewp Jun 12, 2026
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
18 changes: 18 additions & 0 deletions .github/workflows/worker-build-logs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Worker Build Logs

on:
push:
branches: ["**"]

jobs:
build-logs:
if: github.repository == 'withastro/astro.build'
name: Cloudflare Worker Build
runs-on: ubuntu-latest
steps:
- name: Stream Workers Builds Logs
uses: withastro/workers-builds-log-action@v1
with:
api-token: ${{ secrets.CF_BUILDS_API_TOKEN }}
account-id: ${{ secrets.CF_ACCOUNT_ID }}
worker-tag: ${{ secrets.CF_WORKER_TAG }}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ pnpm-debug.log*
# macOS-specific files
.DS_Store

# Local Netlify folder
.netlify
# Local Wrangler folder
.wrangler

# Local Vercel folder
.vercel
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,27 @@ Integration data is updated weekly by a [GitHub Action](/.github/workflows/weekl
The [blog collection](/src/content/blog/) is setup to support MDX blog posts with all images being pulled from the collection's [\_images directory](/src/content/blog/_images/). Images should be a `webp` format of a reasonable width, something in the 800-1600px range is ideal.

Blog post cover and social images are set as frontmatter properties and should point reference the `_images` directory, ex: `coverImage: "/src/content/blog/_images/post-1/cover.webp"`.

## Contributing

### Large Static Assets

Cloudflare Workers has a 25 MB per-file size limit for static assets. Files that exceed this limit are hosted on an R2 bucket and served via `site-assets.astro.build`.

To upload a new large asset:

1. Install [Wrangler](https://developers.cloudflare.com/workers/wrangler/) if you haven't already:
```sh
pnpm add -g wrangler
```

2. Upload the file to the `site-assets` R2 bucket:
```sh
wrangler r2 object put site-assets/<path> --file <local-file> --content-type <mime-type>
```
For example:
```sh
wrangler r2 object put site-assets/blog/launch-video.mp4 --file ./launch-video.mp4 --content-type video/mp4
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an auth step missing here? I assume not just everyone is able to put stuff in this bucket?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I added a comment about this.


3. Reference the file using `https://site-assets.astro.build/<path>` in your source code.
13 changes: 7 additions & 6 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// @ts-check

import mdx from '@astrojs/mdx';
import netlify from '@astrojs/netlify';
import cloudflare from '@astrojs/cloudflare';
import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import { defineConfig } from 'astro/config';
import { defineConfig, sessionDrivers } from 'astro/config';
import astroExpressiveCode from 'astro-expressive-code';
import icon from 'astro-icon';
import houston from './houston.theme.json';

/* https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables */
const NETLIFY_PREVIEW_SITE = process.env.CONTEXT !== 'production' && process.env.DEPLOY_PRIME_URL;
/* On Cloudflare Workers Builds, CF_PAGES_URL is set to the preview URL for non-production deploys */
const PREVIEW_SITE = process.env.CF_PAGES_URL;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is correct?

In the preview deploy I’m seeing everything using astro.build and not a preview-specific URL, e.g. og:image URLs etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use WORKERS_CI_BRANCH which seems to fix it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — we should check after merging to make sure this is also the value we want in prod (i.e. it should be https://cloudflare-migration.previews.astro.build/ or whatever for previews, but https://astro.build/ for prod).


// https://astro.build/config
export default defineConfig({
site: NETLIFY_PREVIEW_SITE || 'https://astro.build',
site: PREVIEW_SITE || 'https://astro.build',
prefetch: true,
integrations: [
tailwind({
Expand Down Expand Up @@ -57,7 +57,8 @@ export default defineConfig({
noExternal: ['smartypants'],
},
},
adapter: netlify({ imageCDN: false }),
adapter: cloudflare({ imageService: 'compile', prerenderEnvironment: 'node' }),
session: { driver: sessionDrivers.lruCache() },
experimental: {
contentIntellisense: true,
rustCompiler: true,
Expand Down
23 changes: 0 additions & 23 deletions netlify.toml

This file was deleted.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"deploy": "wrangler deploy",
"lint": "biome lint",
"format": "pnpm run format:code && pnpm run format:imports",
"format:code": "biome format --write && prettier -w \"**/*\" \"!**/*.{md,mdx}\" --ignore-unknown --cache",
Expand All @@ -21,14 +22,13 @@
"dependencies": {
"@astro-community/astro-embed-youtube": "^0.5.10",
"@astrojs/check": "0.9.9",
"@astrojs/cloudflare": "^13.5.4",
"@astrojs/compiler-rs": "^0.2.1",
"@astrojs/mdx": "5.0.6",
"@astrojs/netlify": "7.0.10",
"@astrojs/rss": "4.0.18",
"@astrojs/sitemap": "3.7.2",
"@astrojs/compiler-rs": "^0.2.1",
"@astrojs/tailwind": "^6.0.2",
"@biomejs/biome": "2.4.15",
"@netlify/plugin-lighthouse": "^6.0.4",
"@preact/signals-core": "^1.14.2",
"@tailwindcss/container-queries": "^0.1.1",
"@types/node": "^24.12.4",
Expand Down Expand Up @@ -56,6 +56,7 @@
"mdast-util-to-string": "^4.0.0",
"p-limit": "^7.3.0",
"p-retry": "^8.0.0",
"wrangler": "^4.0.0",
"yaml": "^2.9.0"
},
"packageManager": "pnpm@11.3.0"
Expand Down
Loading