diff --git a/.github/workflows/build-and-dockerize.yaml b/.github/workflows/build-and-dockerize.yaml index 18b720f16..f573d2e89 100644 --- a/.github/workflows/build-and-dockerize.yaml +++ b/.github/workflows/build-and-dockerize.yaml @@ -45,6 +45,9 @@ jobs: suffix: '-arm64' runs-on: ${{ matrix.builder }} name: dockerize (${{ matrix.platform }}) + env: + SENTRY_ORG: the-guild-z4 + SENTRY_PROJECT: graphql-hive permissions: contents: read packages: write @@ -66,6 +69,8 @@ jobs: run: pnpm build env: NODE_OPTIONS: '--max-old-space-size=14336' # GitHub Actions gives us 16GB, it's ok to use 80% + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + RELEASE: ${{ inputs.imageTag }} - name: test ESM & CJS exports integrity if: ${{ inputs.build }} @@ -191,8 +196,6 @@ jobs: if: ${{ inputs.publishSourceMaps }} env: SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - SENTRY_ORG: the-guild-z4 - SENTRY_PROJECT: graphql-hive SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} SENTRY_RELEASE: ${{ inputs.imageTag }} run: pnpm upload-sourcemaps diff --git a/packages/web/app/package.json b/packages/web/app/package.json index 16a2f07e6..be99eb2d3 100644 --- a/packages/web/app/package.json +++ b/packages/web/app/package.json @@ -3,7 +3,7 @@ "type": "module", "private": true, "scripts": { - "build": "tsx ../../../scripts/runify.ts src/server/index.ts && NODE_OPTIONS='--max-old-space-size=6144' vite build", + "build": "tsx ../../../scripts/runify.ts src/server/index.ts && NODE_OPTIONS='--max-old-space-size=8192' vite build", "dev": "tsx watch --clear-screen=false --exclude \"./**/*.mjs\" src/server/dev.ts", "generate-changelog": "node ../../../scripts/generate-changelog.js", "ladle": "ladle serve", @@ -62,6 +62,7 @@ "@sentry/node": "7.120.2", "@sentry/react": "7.120.2", "@sentry/types": "7.120.2", + "@sentry/vite-plugin": "^5.2.0", "@stepperize/react": "5.1.7", "@stripe/react-stripe-js": "3.1.1", "@stripe/stripe-js": "5.5.0", diff --git a/packages/web/app/vite.config.ts b/packages/web/app/vite.config.ts index a34f99a2f..3892fae4a 100644 --- a/packages/web/app/vite.config.ts +++ b/packages/web/app/vite.config.ts @@ -3,6 +3,7 @@ import type { Plugin, UserConfig } from 'vite'; import monacoEditor from 'vite-plugin-monaco-editor'; import tsconfigPaths from 'vite-tsconfig-paths'; import viteFastify from '@fastify/vite/plugin'; +import { sentryVitePlugin } from '@sentry/vite-plugin'; import tailwindcss from '@tailwindcss/vite'; import react from '@vitejs/plugin-react'; @@ -31,6 +32,11 @@ export default { react(), tailwindcss(), reactScanPlugin, + sentryVitePlugin({ + org: process.env.SENTRY_ORG, + project: process.env.SENTRY_PROJECT, + release: { name: process.env.RELEASE, dist: 'webapp' }, + }), // @ts-expect-error temp monacoEditor.default({ languageWorkers: ['json', 'typescript', 'editorWorkerService'], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3f3d822e5..1acbb0a31 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2216,6 +2216,9 @@ importers: '@sentry/types': specifier: 7.120.2 version: 7.120.2 + '@sentry/vite-plugin': + specifier: ^5.2.0 + version: 5.2.0(encoding@0.1.13)(rollup@4.59.0) '@stepperize/react': specifier: 5.1.7 version: 5.1.7(react@18.3.1)(typescript@5.7.3) @@ -8643,56 +8646,116 @@ packages: resolution: {integrity: sha512-eo2F8cP6X+vr54Mp6vu+NoQEDz0M5O24Tz8jPY0T1CpiWdwCmHb7Sln+oLXeQ3/LlWdVQihBfKDBZfBdUfsBTg==} engines: {node: '>=8'} + '@sentry/babel-plugin-component-annotate@5.2.0': + resolution: {integrity: sha512-8LbOI5Kzb5F0+7LVQPi2+zGz1iPiRRFhM+7uZ/ZQ33L9BmDOYNIy3xWxCfMw2JCuMXXaxF47XCjGmR22/B0WPg==} + engines: {node: '>= 18'} + '@sentry/browser@7.120.2': resolution: {integrity: sha512-o5ll2Yv5MfnblbWxTvMlKK3RVXIbeJ+SPC+uw12b4j/pkrQg+/y7dyTLBXh6t0EgokSOsRUyYosQwSvxG/xs/Q==} engines: {node: '>=8'} + '@sentry/bundler-plugin-core@5.2.0': + resolution: {integrity: sha512-+C0x4gEIJRgoMwyRFGx+TFiJ1Po2BZlT1v61+PnouiaprKL5qtZG8n5PXx/5LPLDsVjSIcXjnDrTz9aSm8SJ3w==} + engines: {node: '>= 18'} + '@sentry/cli-darwin@2.40.0': resolution: {integrity: sha512-GmPGvPU9tjM1Ps/pkUGQa7rImveo4delb2Dc5l8129i1MyD2ugJ5zjeNhIdBHkaObpuude9rUS7sHC4HTU2Wqw==} engines: {node: '>=10'} os: [darwin] + '@sentry/cli-darwin@2.58.5': + resolution: {integrity: sha512-lYrNzenZFJftfwSya7gwrHGxtE+Kob/e1sr9lmHMFOd4utDlmq0XFDllmdZAMf21fxcPRI1GL28ejZ3bId01fQ==} + engines: {node: '>=10'} + os: [darwin] + '@sentry/cli-linux-arm64@2.40.0': resolution: {integrity: sha512-b8gDORhkhP/g1CTYVKzBlbYlmC3BqkgEzAXP8ViFxX1NNS7dK9Hr84cVnDGxhSIfCP8TW1d5V3AGeHwQr5EwEg==} engines: {node: '>=10'} cpu: [arm64] os: [linux, freebsd] + '@sentry/cli-linux-arm64@2.58.5': + resolution: {integrity: sha512-/4gywFeBqRB6tR/iGMRAJ3HRqY6Z7Yp4l8ZCbl0TDLAfHNxu7schEw4tSnm2/Hh9eNMiOVy4z58uzAWlZXAYBQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux, freebsd, android] + '@sentry/cli-linux-arm@2.40.0': resolution: {integrity: sha512-LUdwh3shYXZThkBvmKFUkQvmsCIQu76ZVqU7NXcEWHRF9gITijnSyHKCBPCbcGkb1SqQ92BW/1cJq84Dy0/DRw==} engines: {node: '>=10'} cpu: [arm] os: [linux, freebsd] + '@sentry/cli-linux-arm@2.58.5': + resolution: {integrity: sha512-KtHweSIomYL4WVDrBrYSYJricKAAzxUgX86kc6OnlikbyOhoK6Fy8Vs6vwd52P6dvWPjgrMpUYjW2M5pYXQDUw==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux, freebsd, android] + '@sentry/cli-linux-i686@2.40.0': resolution: {integrity: sha512-sZo3QykQRpMkrz0Eb07ViyK++C6Iir1j7Rpsj/97y5WDncR8TrpGTn6ceuuVRt4clA09/ZIvwuS7amfeKN6jQw==} engines: {node: '>=10'} cpu: [x86, ia32] os: [linux, freebsd] + '@sentry/cli-linux-i686@2.58.5': + resolution: {integrity: sha512-G7261dkmyxqlMdyvyP06b+RTIVzp1gZNgglj5UksxSouSUqRd/46W/2pQeOMPhloDYo9yLtCN2YFb3Mw4aUsWw==} + engines: {node: '>=10'} + cpu: [x86, ia32] + os: [linux, freebsd, android] + '@sentry/cli-linux-x64@2.40.0': resolution: {integrity: sha512-ctpBFuyk2fP97FkxWTD9olI1BM1cy+rUIfnUqmrjXneTaUi3RFIFBB4koYhh1UT6OCWIRvChRIq40Rd9R3Pw8A==} engines: {node: '>=10'} cpu: [x64] os: [linux, freebsd] + '@sentry/cli-linux-x64@2.58.5': + resolution: {integrity: sha512-rP04494RSmt86xChkQ+ecBNRYSPbyXc4u0IA7R7N1pSLCyO74e5w5Al+LnAq35cMfVbZgz5Sm0iGLjyiUu4I1g==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux, freebsd, android] + + '@sentry/cli-win32-arm64@2.58.5': + resolution: {integrity: sha512-AOJ2nCXlQL1KBaCzv38m3i2VmSHNurUpm7xVKd6yAHX+ZoVBI8VT0EgvwmtJR2TY2N2hNCC7UrgRmdUsQ152bA==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + '@sentry/cli-win32-i686@2.40.0': resolution: {integrity: sha512-4SYD40zJS7hVbFzAwXvXcVIoc7xsWa6L1RW1SQlt+Woh5MTPk7FMMSGft8021OSGTljiuqQzx4ecnXMO0K/gOw==} engines: {node: '>=10'} cpu: [x86, ia32] os: [win32] + '@sentry/cli-win32-i686@2.58.5': + resolution: {integrity: sha512-EsuboLSOnlrN7MMPJ1eFvfMDm+BnzOaSWl8eYhNo8W/BIrmNgpRUdBwnWn9Q2UOjJj5ZopukmsiMYtU/D7ml9g==} + engines: {node: '>=10'} + cpu: [x86, ia32] + os: [win32] + '@sentry/cli-win32-x64@2.40.0': resolution: {integrity: sha512-QEW2Ra4Wsr4y6AwcxOk2hL0zMlCK+adTSTaptTMmcm52el8XjdMwsNo7d/416HUYNcND0YZGih7D+KERepyQSw==} engines: {node: '>=10'} cpu: [x64] os: [win32] + '@sentry/cli-win32-x64@2.58.5': + resolution: {integrity: sha512-IZf+XIMiQwj+5NzqbOQfywlOitmCV424Vtf9c+ep61AaVScUFD1TSrQbOcJJv5xGxhlxNOMNgMeZhdexdzrKZg==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + '@sentry/cli@2.40.0': resolution: {integrity: sha512-yo+ZfrrpVyu/2Q9r4XI84VeC6xTNzTharSJB2D0BNkreL+c16I1ykG1uc/GmmFnYVBq+HHAaYqXVfSUV14IdHw==} engines: {node: '>= 10'} hasBin: true + '@sentry/cli@2.58.5': + resolution: {integrity: sha512-tavJ7yGUZV+z3Ct2/ZB6mg339i08sAk6HDkgqmSRuQEu2iLS5sl9HIvuXfM6xjv8fwlgFOSy++WNABNAcGHUbg==} + engines: {node: '>= 10'} + hasBin: true + '@sentry/core@7.114.0': resolution: {integrity: sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==} engines: {node: '>=8'} @@ -8727,6 +8790,15 @@ packages: resolution: {integrity: sha512-UAw0anHwXeej0Rfx+7qZVbRb3rj3mQ0DuHqdpPTSd9WpfRGOvCfthMIKD7rfHX7GjMnPMgdmsaU8K3lpe60h+w==} engines: {node: '>=12'} + '@sentry/rollup-plugin@5.2.0': + resolution: {integrity: sha512-a8LfpvcYMFtFSroro5MpCcOoS528LeLfUHzxWURnpofOnY+Aso9Si4y4dFlna+RKqxCXjmFbn6CLnfI+YrHysQ==} + engines: {node: '>= 18'} + peerDependencies: + rollup: '>=3.2.0' + peerDependenciesMeta: + rollup: + optional: true + '@sentry/tracing@7.114.0': resolution: {integrity: sha512-eldEYGADReZ4jWdN5u35yxLUSTOvjsiZAYd4KBEpf+Ii65n7g/kYOKAjNl7tHbrEG1EsMW4nDPWStUMk1w+tfg==} engines: {node: '>=8'} @@ -8755,6 +8827,10 @@ packages: resolution: {integrity: sha512-A4srR9mEBFdVXwSEKjQ94msUbVkMr8JeFiEj9ouOFORw/Y/ux/WV2bWVD/ZI9wq0TcTNK8L1wBgU8UMS5lIq3A==} engines: {node: '>=14.18'} + '@sentry/vite-plugin@5.2.0': + resolution: {integrity: sha512-4Jo3ixBspso5HY81PDvZdRXkH9wYGVmcw/0a2IX9ejbyKBdHqkYg4IhAtNqGUAyGuHwwRS9Y1S+sCMvrXv6htw==} + engines: {node: '>= 18'} + '@sigstore/bundle@2.2.0': resolution: {integrity: sha512-5VI58qgNs76RDrwXNhpmyN/jKpq9evV/7f1XrcqcAfvxDl5SeVY/I5Rmfe96ULAV7/FK5dge9RBKGBJPhL1WsQ==} engines: {node: ^16.14.0 || >=18.0.0} @@ -29161,6 +29237,8 @@ snapshots: '@sentry/types': 7.120.2 '@sentry/utils': 7.120.2 + '@sentry/babel-plugin-component-annotate@5.2.0': {} + '@sentry/browser@7.120.2': dependencies: '@sentry-internal/feedback': 7.120.2 @@ -29172,27 +29250,64 @@ snapshots: '@sentry/types': 7.120.2 '@sentry/utils': 7.120.2 + '@sentry/bundler-plugin-core@5.2.0(encoding@0.1.13)': + dependencies: + '@babel/core': 7.28.5 + '@sentry/babel-plugin-component-annotate': 5.2.0 + '@sentry/cli': 2.58.5(encoding@0.1.13) + dotenv: 16.4.7 + find-up: 5.0.0 + glob: 13.0.6 + magic-string: 0.30.21 + transitivePeerDependencies: + - encoding + - supports-color + '@sentry/cli-darwin@2.40.0': optional: true + '@sentry/cli-darwin@2.58.5': + optional: true + '@sentry/cli-linux-arm64@2.40.0': optional: true + '@sentry/cli-linux-arm64@2.58.5': + optional: true + '@sentry/cli-linux-arm@2.40.0': optional: true + '@sentry/cli-linux-arm@2.58.5': + optional: true + '@sentry/cli-linux-i686@2.40.0': optional: true + '@sentry/cli-linux-i686@2.58.5': + optional: true + '@sentry/cli-linux-x64@2.40.0': optional: true + '@sentry/cli-linux-x64@2.58.5': + optional: true + + '@sentry/cli-win32-arm64@2.58.5': + optional: true + '@sentry/cli-win32-i686@2.40.0': optional: true + '@sentry/cli-win32-i686@2.58.5': + optional: true + '@sentry/cli-win32-x64@2.40.0': optional: true + '@sentry/cli-win32-x64@2.58.5': + optional: true + '@sentry/cli@2.40.0(encoding@0.1.13)': dependencies: https-proxy-agent: 5.0.1 @@ -29212,6 +29327,26 @@ snapshots: - encoding - supports-color + '@sentry/cli@2.58.5(encoding@0.1.13)': + dependencies: + https-proxy-agent: 5.0.1 + node-fetch: 2.6.12(encoding@0.1.13) + progress: 2.0.3 + proxy-from-env: 1.1.0 + which: 2.0.2 + optionalDependencies: + '@sentry/cli-darwin': 2.58.5 + '@sentry/cli-linux-arm': 2.58.5 + '@sentry/cli-linux-arm64': 2.58.5 + '@sentry/cli-linux-i686': 2.58.5 + '@sentry/cli-linux-x64': 2.58.5 + '@sentry/cli-win32-arm64': 2.58.5 + '@sentry/cli-win32-i686': 2.58.5 + '@sentry/cli-win32-x64': 2.58.5 + transitivePeerDependencies: + - encoding + - supports-color + '@sentry/core@7.114.0': dependencies: '@sentry/types': 7.114.0 @@ -29265,6 +29400,16 @@ snapshots: '@sentry/types': 7.120.2 '@sentry/utils': 7.120.2 + '@sentry/rollup-plugin@5.2.0(encoding@0.1.13)(rollup@4.59.0)': + dependencies: + '@sentry/bundler-plugin-core': 5.2.0(encoding@0.1.13) + magic-string: 0.30.21 + optionalDependencies: + rollup: 4.59.0 + transitivePeerDependencies: + - encoding + - supports-color + '@sentry/tracing@7.114.0': dependencies: '@sentry-internal/tracing': 7.114.0 @@ -29287,6 +29432,15 @@ snapshots: dependencies: '@sentry/types': 8.9.2 + '@sentry/vite-plugin@5.2.0(encoding@0.1.13)(rollup@4.59.0)': + dependencies: + '@sentry/bundler-plugin-core': 5.2.0(encoding@0.1.13) + '@sentry/rollup-plugin': 5.2.0(encoding@0.1.13)(rollup@4.59.0) + transitivePeerDependencies: + - encoding + - rollup + - supports-color + '@sigstore/bundle@2.2.0': dependencies: '@sigstore/protobuf-specs': 0.3.0 diff --git a/scripts/upload-sourcemaps.sh b/scripts/upload-sourcemaps.sh index 0bc324be7..27f18b06e 100755 --- a/scripts/upload-sourcemaps.sh +++ b/scripts/upload-sourcemaps.sh @@ -15,7 +15,9 @@ for dir in packages/services/*/dist; do fi done -pnpm sentry-cli sourcemaps inject packages/web/app/dist -pnpm sentry-cli sourcemaps upload --release=$SENTRY_RELEASE packages/web/app/dist --dist webapp --url-prefix ~/ +# Client sourcemaps handled by @sentry/vite-plugin during build + +# Server sourcemaps (dist: app, matching backend.ts SDK init) +pnpm sentry-cli sourcemaps upload --release=$SENTRY_RELEASE packages/web/app/dist --dist app --url-prefix /usr/src/app/\@hive/app --ignore client pnpm sentry-cli releases finalize "$SENTRY_RELEASE"