Skip to content
Closed
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ deno.lock
/static/open-letter/portraits/original
CLAUDE.md
.claude/

# Sentry Config File
.env.sentry-build-plugin
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"@pagefind/default-ui": "^1.4.0",
"@prgm/sveltekit-progress-bar": "^3.0.2",
"@remix-run/headers": "^0.12.0",
"@sentry/sveltekit": "^10.47.0",
"@sveltejs/enhanced-img": "^0.10.4",
"@turf/distance": "^7.3.4",
"airtable": "^0.12.2",
Expand Down
1,394 changes: 1,374 additions & 20 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions src/hooks.client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { handleErrorWithSentry, replayIntegration } from '@sentry/sveltekit'

Check failure on line 1 in src/hooks.client.ts

View workflow job for this annotation

GitHub Actions / pnpm-check

'replayIntegration' is defined but never used
import * as Sentry from '@sentry/sveltekit'

Sentry.init({
dsn: 'https://279d43fd44c785161db6050176196b5e@o4509753398722560.ingest.de.sentry.io/4511139041050704',

tracesSampleRate: 1.0,

// Enable logs to be sent to Sentry
enableLogs: true,

// Enable sending user PII (Personally Identifiable Information)
// https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
sendDefaultPii: true
})

// If you have a custom error handler, pass it to `handleErrorWithSentry`
export const handleError = handleErrorWithSentry()
7 changes: 5 additions & 2 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { sequence } from '@sveltejs/kit/hooks'
import * as Sentry from '@sentry/sveltekit'
// Fix for Netlify's Deno edge runtime (not standard Deno)
//
// Netlify's Deno 2.3.1 provides a partial window stub (window exists but window.location
Expand All @@ -18,12 +20,13 @@ if (
import { type Handle } from '@sveltejs/kit'
import { paraglideMiddleware } from '$lib/paraglide/server.js'

const handle: Handle = ({ event, resolve }) =>
const paraglideHandle: Handle = ({ event, resolve }) =>
paraglideMiddleware(event.request, ({ request: localizedRequest, locale }) => {
event.request = localizedRequest
return resolve(event, {
transformPageChunk: ({ html }) => html.replace('%lang%', locale)
})
})

export { handle }
export const handleError = Sentry.handleErrorWithSentry()
export const handle = sequence(Sentry.sentryHandle(), paraglideHandle)
13 changes: 13 additions & 0 deletions src/instrumentation.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as Sentry from '@sentry/sveltekit'

Sentry.init({
dsn: 'https://279d43fd44c785161db6050176196b5e@o4509753398722560.ingest.de.sentry.io/4511139041050704',

tracesSampleRate: 1.0,

// Enable logs to be sent to Sentry
enableLogs: true

// uncomment the line below to enable Spotlight (https://spotlightjs.com)
// spotlight: import.meta.env.DEV,
})
12 changes: 12 additions & 0 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,28 @@ const config = {
adapter: adapterNetlify({
edge: USE_EDGE_FUNCTIONS
}),

alias: {
$assets: 'src/assets',
$api: 'src/routes/api'
},

prerender: {
// Allows dead links to be rendered
handleHttpError: 'warn',
// Handle missing anchor IDs by warning instead of failing
handleMissingId: 'warn',
entries: ['*'].concat(settings.locales.map((locale) => '/' + locale))
},

experimental: {
tracing: {
server: true
},

instrumentation: {
server: true
}
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import lucidePreprocess from 'vite-plugin-lucide-preprocess'
import { isDev } from './src/lib/env'
import { MARKDOWN_L10NS } from './src/lib/l10n'
import { locales as compiledLocales } from './src/lib/paraglide/runtime.js'
import { sentrySvelteKit } from '@sentry/sveltekit'

function getLocaleExcludePatterns(): RegExp[] {
const md = path.resolve(MARKDOWN_L10NS)
Expand Down Expand Up @@ -61,6 +62,14 @@ export default defineConfig(() => {
external: getLocaleExcludePatterns()
}
} as const,
plugins: [lucidePreprocess(), enhancedImages(), sveltekit()]
plugins: [
lucidePreprocess(),
enhancedImages(),
sentrySvelteKit({
org: 'pauseai',
project: 'javascript-sveltekit'
}),
sveltekit()
]
}
})
Loading