Skip to content

Commit

Permalink
Split sourcemaps by distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhobbs committed Oct 8, 2024
1 parent f647c4e commit 22b76e8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion node-src/errorMonitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function filterBreadcrumb(breadcrumb: Sentry.Breadcrumb) {
Sentry.init({
dsn: 'https://4fa173db2ef3fb073b8ea153a5466d28@o4504181686599680.ingest.us.sentry.io/4507930289373184',
release: process.env.SENTRY_RELEASE || process.env.npm_package_version,
dist: process.env.SENTRY_DIST,
sampleRate: 1,
environment: process.env.SENTRY_ENVIRONMENT,
enabled:
Expand All @@ -58,7 +59,6 @@ Sentry.init({
integrations: [],
initialScope: {
tags: {
entrypoint: process.env.CI && process.env.GITHUB_RUN_ID ? 'action' : 'cli',
version: process.env.npm_package_version,
index_url: process.env.CHROMATIC_INDEX_URL,
},
Expand Down
9 changes: 6 additions & 3 deletions scripts/versionAndBuildForRelease.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ async function main() {
await $`git reset --hard`;

console.info('🌐 Sending sourcemaps to Sentry');
await $({ stdout: 'inherit', stderr: 'inherit' })`sentry-cli sourcemaps inject dist`;
await $({ stdout: 'inherit', stderr: 'inherit' })`sentry-cli sourcemaps inject action`;
await $({ stdout: 'inherit', stderr: 'inherit' })`sentry-cli sourcemaps inject dist action`;
await $({
stdout: 'inherit',
stderr: 'inherit',
})`sentry-cli sourcemaps upload --release ${nextVersion} dist action`;
})`sentry-cli sourcemaps upload --release=${nextVersion} --dist=cli dist`;
await $({
stdout: 'inherit',
stderr: 'inherit',
})`sentry-cli sourcemaps upload --release=${nextVersion} --dist=action action`;

console.info('🚀 Creating new release in Sentry');
await $({ stdout: 'inherit', stderr: 'inherit' })`sentry-cli releases new ${nextVersion}`;
Expand Down
2 changes: 2 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default defineConfig((options) => [
env: {
SENTRY_ENVIRONMENT: process.env.CI ? 'production' : 'development',
SENTRY_RELEASE: process.env.SENTRY_RELEASE || 'development',
SENTRY_DIST: 'cli',
},
},
{
Expand All @@ -37,6 +38,7 @@ export default defineConfig((options) => [
env: {
SENTRY_ENVIRONMENT: process.env.CI ? 'production' : 'development',
SENTRY_RELEASE: process.env.SENTRY_RELEASE || 'development',
SENTRY_DIST: 'action',
},
},
]);

0 comments on commit 22b76e8

Please sign in to comment.