mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-07-12 21:05:19 +02:00
a4f8340b04
Compiles assets/*.ts via sensiolabs/typescript-bundle (standalone SWC binary) and adds Deno for formatting, linting, type-checking, and tests, keeping the project's no-Node/npm approach intact. Wires all four into CI, the Justfile, and the pre-commit hook.
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
import 'bootstrap-icons/font/bootstrap-icons.min.css';
|
|
import './styles/backoffice.scss';
|
|
import '@hotwired/turbo';
|
|
import './stimulus.ts';
|
|
import './bootstrap.ts';
|
|
import * as Sentry from '@sentry/browser';
|
|
|
|
const dsn = document.querySelector<HTMLMetaElement>('meta[name="sentry-dsn"]')
|
|
?.content ?? '';
|
|
const userEmail =
|
|
document.querySelector<HTMLMetaElement>('meta[name="user-email"]')
|
|
?.content ?? '';
|
|
|
|
// When no real DSN is configured, route to the local Spotlight sidecar so
|
|
// nothing reaches Sentry. A syntactically valid DSN is still required for the
|
|
// SDK to initialise; the tunnel option redirects all transport to Spotlight.
|
|
const useSpotlight = !dsn;
|
|
const effectiveDsn = dsn || 'https://0@o0.ingest.sentry.io/0';
|
|
|
|
const feedbackIntegration = Sentry.feedbackIntegration({
|
|
colorScheme: 'system',
|
|
showName: false,
|
|
showEmail: true,
|
|
isEmailRequired: false,
|
|
autoInject: false,
|
|
triggerLabel: 'Report feedback',
|
|
formTitle: 'Report Feedback',
|
|
submitButtonLabel: 'Send Feedback',
|
|
});
|
|
|
|
Sentry.init({
|
|
dsn: effectiveDsn,
|
|
tunnel: useSpotlight ? 'http://localhost:8969/stream' : undefined,
|
|
integrations: [feedbackIntegration],
|
|
});
|
|
|
|
// autoInject is unreliable in Sentry v10 due to the setupOnce guard; mount manually.
|
|
feedbackIntegration.createWidget();
|
|
|
|
if (userEmail) {
|
|
Sentry.setUser({ email: userEmail });
|
|
}
|