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
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/head/main'
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
"lint": "eslint .",
"preview": "vite preview",
"predeploy": "vite build",
"deploy": "gh-pages -d build",
"deploy": "gh-pages -d dist",
"prepare": "husky"
},
"dependencies": {
"@sentry/react": "^10.20.0",
"less": "^4.2.0",
"react": "^18.3.1",
"react": "^19.2.0",
"react-colorful": "^5.6.1",
"react-dom": "^18.3.1",
"react-dom": "^19.2.0",
"react-feather": "^2.0.10"
},
"devDependencies": {
Expand All @@ -32,8 +33,8 @@
"@testing-library/react": "^16.3.0",
"@types/feather-icons": "^4.29.4",
"@types/node": "^24.3.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "^19.2.2",
"@types/react-dom": "^19",
"@vitejs/plugin-react": "^4.3.3",
"eslint": "^9.13.0",
"eslint-plugin-react-hooks": "^5.0.0",
Expand Down
168 changes: 116 additions & 52 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@ import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import "./index.css";
import App from "./App";
import { Sentry } from "./quality/sentry/init";

createRoot(document.getElementById("root")!).render(
const container = document.getElementById("root");
const root = createRoot(container, {
onUncaughtError: Sentry.reactErrorHandler((error, errorInfo) => {
console.warn("Uncaught error", error, errorInfo.componentStack);
}),
onCaughtError: Sentry.reactErrorHandler(),
onRecoverableError: Sentry.reactErrorHandler(),
});

root.render(
<StrictMode>
<App />
<Sentry.ErrorBoundary fallback={<p>Something went wrong.</p>}>
<App />
</Sentry.ErrorBoundary>
</StrictMode>
);
21 changes: 21 additions & 0 deletions src/quality/sentry/init.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* sentry is not mandatory to run the app */

import * as Sentry from "@sentry/react";

const SENTRY_DSN = import.meta.env.VITE_SENTRY_DSN || "";
const isSentryEnabled = Boolean(SENTRY_DSN);

if (isSentryEnabled) {
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN,
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 1.0,
tracePropagationTargets: ["localhost", /^\//],
sendDefaultPii: true,
});
console.info("✅ Sentry initialized");
} else {
console.warn("⚠️ Sentry DSN not set — running without error tracking");
}

export { Sentry };