mirror of
https://github.com/LukeHagar/openapi-definition-generator.git
synced 2025-12-06 04:20:23 +00:00
Added Sentry
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -8,3 +8,6 @@ node_modules
|
|||||||
!.env.example
|
!.env.example
|
||||||
vite.config.js.timestamp-*
|
vite.config.js.timestamp-*
|
||||||
vite.config.ts.timestamp-*
|
vite.config.ts.timestamp-*
|
||||||
|
|
||||||
|
# Sentry Config File
|
||||||
|
.sentryclirc
|
||||||
|
|||||||
10
package.json
10
package.json
@@ -12,6 +12,7 @@
|
|||||||
"format": "prettier --plugin-search-dir . --write ."
|
"format": "prettier --plugin-search-dir . --write ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@floating-ui/dom": "^1.6.1",
|
||||||
"@skeletonlabs/skeleton": "^2.7.0",
|
"@skeletonlabs/skeleton": "^2.7.0",
|
||||||
"@skeletonlabs/tw-plugin": "^0.3.1",
|
"@skeletonlabs/tw-plugin": "^0.3.1",
|
||||||
"@sveltejs/adapter-auto": "^3.0.0",
|
"@sveltejs/adapter-auto": "^3.0.0",
|
||||||
@@ -32,12 +33,17 @@
|
|||||||
"prettier-plugin-svelte": "^3.1.2",
|
"prettier-plugin-svelte": "^3.1.2",
|
||||||
"svelte": "^4.2.8",
|
"svelte": "^4.2.8",
|
||||||
"svelte-check": "^3.6.3",
|
"svelte-check": "^3.6.3",
|
||||||
"svelte-jsoneditor": "^0.21.2",
|
"svelte-jsoneditor": "^0.21.5",
|
||||||
"tailwindcss": "^3.4.1",
|
"tailwindcss": "^3.4.1",
|
||||||
"tslib": "^2.6.2",
|
"tslib": "^2.6.2",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"vite": "^5.0.0",
|
"vite": "^5.0.0",
|
||||||
|
"vite-plugin-tailwind-purgecss": "^0.2.0",
|
||||||
"yaml": "^2.3.4"
|
"yaml": "^2.3.4"
|
||||||
},
|
},
|
||||||
"type": "module"
|
"type": "module",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/sveltekit": "^7.99.0",
|
||||||
|
"highlight.js": "^11.9.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,3 +8,7 @@ html,
|
|||||||
body {
|
body {
|
||||||
@apply h-full overflow-hidden;
|
@apply h-full overflow-hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.codeblock-pre {
|
||||||
|
@apply overflow-y-auto h-[83vh];
|
||||||
|
}
|
||||||
|
|||||||
21
src/hooks.client.ts
Normal file
21
src/hooks.client.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
|
||||||
|
import * as Sentry from '@sentry/sveltekit';
|
||||||
|
|
||||||
|
Sentry.init({
|
||||||
|
dsn: 'https://6c7cfa3b76b1700cb23c34ae2fcab4ad@sentry.plygrnd.org/3',
|
||||||
|
tracesSampleRate: 1.0,
|
||||||
|
|
||||||
|
// This sets the sample rate to be 10%. You may want this to be 100% while
|
||||||
|
// in development and sample at a lower rate in production
|
||||||
|
replaysSessionSampleRate: 0.1,
|
||||||
|
|
||||||
|
// If the entire session is not sampled, use the below sample rate to sample
|
||||||
|
// sessions when an error occurs.
|
||||||
|
replaysOnErrorSampleRate: 1.0,
|
||||||
|
|
||||||
|
// If you don't want to use Session Replay, just remove the line below:
|
||||||
|
integrations: [replayIntegration()],
|
||||||
|
});
|
||||||
|
|
||||||
|
// If you have a custom error handler, pass it to `handleErrorWithSentry`
|
||||||
|
export const handleError = handleErrorWithSentry();
|
||||||
14
src/hooks.server.ts
Normal file
14
src/hooks.server.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { sequence } from "@sveltejs/kit/hooks";
|
||||||
|
import { handleErrorWithSentry, sentryHandle } from "@sentry/sveltekit";
|
||||||
|
import * as Sentry from '@sentry/sveltekit';
|
||||||
|
|
||||||
|
Sentry.init({
|
||||||
|
dsn: 'https://6c7cfa3b76b1700cb23c34ae2fcab4ad@sentry.plygrnd.org/3',
|
||||||
|
tracesSampleRate: 1.0,
|
||||||
|
});
|
||||||
|
|
||||||
|
// If you have custom handlers, make sure to place them after `sentryHandle()` in the `sequence` function.
|
||||||
|
export const handle = sequence(sentryHandle());
|
||||||
|
|
||||||
|
// If you have a custom error handler, pass it to `handleErrorWithSentry`
|
||||||
|
export const handleError = handleErrorWithSentry();
|
||||||
Reference in New Issue
Block a user