diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 37f92be72..660b36cc6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -18,7 +18,21 @@ jobs: with: release: true - name: Build - run: npm run build + run: npm run build -- --define "SENTRY_DSN='${SENTRY_DSN}'" + env: + SENTRY_DSN: ${{ secrets.SENTRY_DSN }} + - name: Sentry release + uses: getsentry/action-release@v3 + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} + with: + sourcemaps: ./dist/control-center/browser + environment: ${{ startsWith(github.ref_name, 'epic/') && 'staging' || 'production' }} + set_commits: skip + - name: Remove source maps + run: find dist/control-center/browser -type f -name '*.map' -delete - name: Deploy image uses: valitydev/action-deploy-docker@v2 with: @@ -30,9 +44,9 @@ jobs: uses: valitydev/action-frontend/publish@v3 with: directory: ./dist/matez - - name: Notify Mattermost - uses: valitydev/action-mattermost-notify@v0 - with: - webhook: ${{ secrets.MATTERMOST_WEBHOOK_URL }} - channel: 'control-center' - username: 'Frontend' + # - name: Notify Mattermost + # uses: valitydev/action-mattermost-notify@v0 + # with: + # webhook: ${{ secrets.MATTERMOST_WEBHOOK_URL }} + # channel: 'control-center' + # username: 'Frontend' diff --git a/angular.json b/angular.json index 3147062d0..206e6147e 100644 --- a/angular.json +++ b/angular.json @@ -39,8 +39,8 @@ "budgets": [ { "type": "initial", - "maximumWarning": "2.5MB", - "maximumError": "3MB" + "maximumWarning": "3.1MB", + "maximumError": "3.5MB" }, { "type": "anyComponentStyle", @@ -48,7 +48,8 @@ "maximumError": "8kB" } ], - "outputHashing": "all" + "outputHashing": "all", + "sourceMap": true }, "development": { "optimization": false, diff --git a/package-lock.json b/package-lock.json index 01b77a9bc..f8def5ab8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "@angular/platform-browser": "^22.0.7", "@angular/router": "^22.0.7", "@ngneat/input-mask": "^6.1.0", + "@sentry/angular": "^10.68.0", "@tailwindcss/postcss": "^4.3.1", "@vality/domain-proto": "^2.0.2-239638b.0", "@vality/fistful-proto": "^2.0.1-9864622.0", @@ -4567,6 +4568,116 @@ "yarn": ">= 1.13.0" } }, + "node_modules/@sentry/angular": { + "version": "10.68.0", + "resolved": "https://registry.npmjs.org/@sentry/angular/-/angular-10.68.0.tgz", + "integrity": "sha512-0tGgw9Au2t0gwUh7KiFbNqWTr7mzBMZ7ZyqnxpgJx/2CHzM+cV/mUf7LXbc5GGA1rwx1ErSi3U38pAsPsgE19A==", + "license": "MIT", + "dependencies": { + "@sentry/browser": "10.68.0", + "@sentry/conventions": "^0.16.0", + "@sentry/core": "10.68.0", + "tslib": "^2.4.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@angular/common": ">= 14.x <= 22.x", + "@angular/core": ">= 14.x <= 22.x", + "@angular/router": ">= 14.x <= 22.x", + "rxjs": "^6.5.5 || ^7.x" + } + }, + "node_modules/@sentry/browser": { + "version": "10.68.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-10.68.0.tgz", + "integrity": "sha512-8xVgk7oG2lajXnbXF6a7H1xMZ/U6icqSldHGzQu1+bajfrK8Gan9ULG/Xsj1VM1LlNeK6/7znDJ3u1jgvIwznw==", + "license": "MIT", + "dependencies": { + "@sentry/browser-utils": "10.68.0", + "@sentry/conventions": "^0.16.0", + "@sentry/core": "10.68.0", + "@sentry/feedback": "10.68.0", + "@sentry/replay": "10.68.0", + "@sentry/replay-canvas": "10.68.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/browser-utils": { + "version": "10.68.0", + "resolved": "https://registry.npmjs.org/@sentry/browser-utils/-/browser-utils-10.68.0.tgz", + "integrity": "sha512-be8VtdjCngKc77cstJeV+gO15iH+blyXpBDk8yOehmtX4BkFO33mfTMNCWVR2LA0oOxjIHWRAhf77fIUEhzxPg==", + "license": "MIT", + "dependencies": { + "@sentry/conventions": "^0.16.0", + "@sentry/core": "10.68.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/conventions": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@sentry/conventions/-/conventions-0.16.0.tgz", + "integrity": "sha512-fO9PLmHdVURcSPUpWCItWAtgKiMwGdJHbovoSEyLplX5sxs2ugvI4CBPTrkkgqhObnZOD0CnWBKDzSVQYBKEyQ==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@sentry/core": { + "version": "10.68.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.68.0.tgz", + "integrity": "sha512-5Amhx8ltVz7vb1bRGyf3c4J69/iHW8R/H+SJxTRILHlsSOBrnVVc/IQEYDC6PTRdRdZ3x2u7RVjxZi2Mhe525g==", + "license": "MIT", + "dependencies": { + "@sentry/conventions": "^0.16.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/feedback": { + "version": "10.68.0", + "resolved": "https://registry.npmjs.org/@sentry/feedback/-/feedback-10.68.0.tgz", + "integrity": "sha512-XbdcXiBnpC3vgw46eHOPeD/ZQ+XzluP75ubdUcaPDW02hCh2nsdXiwjZ2DBImbpvIpTbJgjHf/sIlHWvcZJ2Mg==", + "license": "MIT", + "dependencies": { + "@sentry/core": "10.68.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/replay": { + "version": "10.68.0", + "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-10.68.0.tgz", + "integrity": "sha512-ZoG2n16vbkx4GWSCnLIqUUN9xlUmccQFbQ2US2rhruQeHTUnHl/ukr8NHOQXZaEbwKyMkX9bEMwfmZHJm+wSTQ==", + "license": "MIT", + "dependencies": { + "@sentry/browser-utils": "10.68.0", + "@sentry/core": "10.68.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/replay-canvas": { + "version": "10.68.0", + "resolved": "https://registry.npmjs.org/@sentry/replay-canvas/-/replay-canvas-10.68.0.tgz", + "integrity": "sha512-HusYcr+He+ohnUDHunYrc5St6vdDnBXpUAndnT5ReyUMVSCiWKfY3paXowU/0787HwYfxdcpZgwC5u79+XbEIg==", + "license": "MIT", + "dependencies": { + "@sentry/core": "10.68.0", + "@sentry/replay": "10.68.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@sigstore/bundle": { "version": "4.0.0", "dev": true, diff --git a/package.json b/package.json index cd5863d5e..59e10d99b 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@angular/platform-browser": "^22.0.7", "@angular/router": "^22.0.7", "@ngneat/input-mask": "^6.1.0", + "@sentry/angular": "^10.68.0", "@tailwindcss/postcss": "^4.3.1", "@vality/domain-proto": "^2.0.2-239638b.0", "@vality/fistful-proto": "^2.0.1-9864622.0", diff --git a/src/globals.d.ts b/src/globals.d.ts new file mode 100644 index 000000000..8bf64a771 --- /dev/null +++ b/src/globals.d.ts @@ -0,0 +1 @@ +declare const SENTRY_DSN: string; diff --git a/src/main.ts b/src/main.ts index 14afb2d0e..e7a9e0e01 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,18 @@ import { bootstrapApplication } from '@angular/platform-browser'; +import * as Sentry from '@sentry/angular'; import { AppComponent } from './app/app.component'; import { appConfig } from './app/app.config'; +if (SENTRY_DSN) { + Sentry.init({ + dsn: SENTRY_DSN, + integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()], + tracesSampleRate: 1, + replaysSessionSampleRate: 1, + replaysOnErrorSampleRate: 1, + enableLogs: true, + }); +} + bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err));