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 .assetsignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
_worker.js
*.map
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ Turnstile (secret) and Resend values are Worker secrets, set with
`wrangler secret put <NAME>`. The Turnstile *site* key is public and lives in
`src/config.ts`.

## Error monitoring

Client errors report to Sentry (`daniel-workmsn/danielworkmandev`, EU region),
gated to the production hostname the same way as GA4 — localhost and previews
never load the SDK. For readable stack traces, export `SENTRY_AUTH_TOKEN`
(org auth token with `project:releases` scope, created in Sentry → Settings →
Auth Tokens) wherever the deploy build runs — the Cloudflare Workers Builds
build variables for pushes to main, or the local shell for manual
`pnpm deploy`: the build then
uploads the hidden source maps and deletes them from `dist/`. Without the
token the build skips the upload and `.assetsignore` keeps the leftover
`.map` files off the CDN.

## Project Structure

- `src/pages/` - Astro routes, including home, projects, blog, and API routes.
Expand Down
24 changes: 23 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';
import tailwindcss from '@tailwindcss/vite';
import { sentryVitePlugin } from '@sentry/vite-plugin';

// https://astro.build/config
export default defineConfig({
Expand All @@ -12,6 +13,27 @@ export default defineConfig({
'/blog/building-with-astro-5': '/blog/building-with-astro-6',
},
vite: {
plugins: [tailwindcss()],
plugins: [
tailwindcss(),
// Uploads source maps so Sentry stack traces are readable (#17). Only
// active where SENTRY_AUTH_TOKEN is set (the deploying machine) — CI
// and everyday local builds skip the upload entirely.
sentryVitePlugin({
org: 'daniel-workmsn',
project: 'danielworkmandev',
authToken: process.env.SENTRY_AUTH_TOKEN,
disable: !process.env.SENTRY_AUTH_TOKEN,
telemetry: false,
sourcemaps: {
filesToDeleteAfterUpload: ['dist/**/*.map'],
},
}),
],
build: {
// 'hidden' emits maps for the Sentry upload without a sourceMappingURL
// comment in the served files. Builds without SENTRY_AUTH_TOKEN leave
// the .map files in dist — .assetsignore keeps them off the CDN.
sourcemap: 'hidden',
},
},
});
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
},
"dependencies": {
"@astrojs/cloudflare": "^14.1.2",
"@sentry/browser": "^10.69.0",
"@tailwindcss/vite": "4",
"astro": "^7.0.7",
"tailwindcss": "4"
},
"devDependencies": {
"@sentry/vite-plugin": "^5.4.0",
"vitest": "^4.1.10",
"wrangler": "4.107.0"
}
Expand Down
Loading
Loading