Skip to content

Commit 2cc250d

Browse files
authored
Merge branch 'main' into cg-vite-type
2 parents aef1bac + b0f22d1 commit 2cc250d

File tree

22 files changed

+190
-129
lines changed

22 files changed

+190
-129
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ yarn-error.log
77
*.tgz
88

99
.nxcache
10-
packages/**/yarn.lock
10+
packages/**/yarn.lock
11+
12+
.DS_Store

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
- "You know what they say ‘Fool me once, strike one, but fool me twice… strike three.’" — Michael Scott
66

7-
Work in this release was contributed by @thecodewarrior. Thank you for your contribution!
7+
## 3.6.1
8+
9+
- fix(core): Observe and handle Sentry CLI sourcemap upload failures ([#763](https://github.com/getsentry/sentry-javascript-bundler-plugins/pull/763))
10+
11+
## 3.6.0
12+
13+
- feat(core): Don't add `debugIdUploadPlugin` when sourcemaps option is disabled ([#753](https://github.com/getsentry/sentry-javascript-bundler-plugins/pull/753))
14+
- fix(core): Avoid showing success message if upload was disabled or nothing was uploaded ([#757](https://github.com/getsentry/sentry-javascript-bundler-plugins/pull/757))
815

916
## 3.5.0
1017

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ _These steps are only relevant to Sentry employees when preparing and publishing
8181
### Updating the Changelog
8282

8383
1. Create a new branch.
84-
2. Run `git log --format="- %s"` and copy everything since the last release.
84+
2. Run `yarn changelog` and copy all commits in the list.
8585
3. Create a new section in the changelog, deciding based on the changes whether it should be a minor bump or a patch release.
86-
4. Paste in the logs you copied earlier.
86+
4. Paste in the commits you copied earlier.
8787
5. Delete any which aren't user-facing changes.
8888
6. Alphabetize the rest.
8989
7. If any of the PRs are from external contributors, include underneath the commits `Work in this release contributed by <list of external contributors' GitHub usernames>. Thank you for your contributions!`. If there's only one external PR, don't forget to remove the final `s`. If there are three or more, use an Oxford comma. (It's in the Sentry styleguide!)
90-
8. Commit, push, and open a PR with the title `meta: Update changelog for <fill in relevant version here>`.
90+
8. Commit, push, and open a PR against `main` with the title `meta: Update changelog for <fill in relevant version here>`.

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3-
"version": "3.5.0",
3+
"version": "3.6.1",
44
"npmClient": "yarn",
55
"useWorkspaces": true
66
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"ts-node": "^10.9.2"
3838
},
3939
"volta": {
40-
"node": "14.21.2",
40+
"node": "18.20.8",
4141
"yarn": "1.22.19"
4242
}
4343
}

packages/babel-plugin-component-annotate/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/babel-plugin-component-annotate",
3-
"version": "3.5.0",
3+
"version": "3.6.1",
44
"description": "A Babel plugin that annotates frontend components with additional data to enrich the experience in Sentry",
55
"repository": "git://github.com/getsentry/sentry-javascript-bundler-plugins.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/babel-plugin-component-annotate",
@@ -56,8 +56,8 @@
5656
"@babel/preset-typescript": "7.17.12",
5757
"@rollup/plugin-babel": "5.3.1",
5858
"@rollup/plugin-node-resolve": "13.3.0",
59-
"@sentry-internal/eslint-config": "3.5.0",
60-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "3.5.0",
59+
"@sentry-internal/eslint-config": "3.6.1",
60+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "3.6.1",
6161
"@swc/core": "^1.2.205",
6262
"@swc/jest": "^0.2.21",
6363
"@types/jest": "^28.1.3",

packages/bundler-plugin-core/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/bundler-plugin-core",
3-
"version": "3.5.0",
3+
"version": "3.6.1",
44
"description": "Sentry Bundler Plugin Core",
55
"repository": "git://github.com/getsentry/sentry-javascript-bundler-plugins.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/bundler-plugin-core",
@@ -53,8 +53,8 @@
5353
},
5454
"dependencies": {
5555
"@babel/core": "^7.18.5",
56-
"@sentry/babel-plugin-component-annotate": "^3.5.0",
57-
"@sentry/cli": "^2.46.0",
56+
"@sentry/babel-plugin-component-annotate": "3.6.1",
57+
"@sentry/cli": "^2.49.0",
5858
"dotenv": "^16.3.1",
5959
"find-up": "^5.0.0",
6060
"glob": "^9.3.2",
@@ -68,8 +68,8 @@
6868
"@rollup/plugin-json": "4.1.0",
6969
"@rollup/plugin-node-resolve": "13.3.0",
7070
"@rollup/plugin-replace": "^4.0.0",
71-
"@sentry-internal/eslint-config": "3.5.0",
72-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "3.5.0",
71+
"@sentry-internal/eslint-config": "3.6.1",
72+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "3.6.1",
7373
"@sentry/core": "8.30.0",
7474
"@sentry/types": "8.30.0",
7575
"@sentry/utils": "8.30.0",

packages/bundler-plugin-core/src/build-plugin-manager.ts

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ export function createSentryBuildPluginManager(
455455
await cliInstance.releases.uploadSourceMaps(options.release.name, {
456456
include: normalizedInclude,
457457
dist: options.release.dist,
458+
// We want this promise to throw if the sourcemaps fail to upload so that we know about it.
459+
// see: https://github.com/getsentry/sentry-cli/pull/2605
460+
live: "rejectOnError",
458461
});
459462
}
460463

@@ -503,27 +506,8 @@ export function createSentryBuildPluginManager(
503506
* Uploads sourcemaps using the "Debug ID" method. This function takes a list of build artifact paths that will be uploaded
504507
*/
505508
async uploadSourcemaps(buildArtifactPaths: string[]) {
506-
if (options.sourcemaps?.disable) {
507-
logger.debug(
508-
"Source map upload was disabled. Will not upload sourcemaps using debug ID process."
509-
);
510-
} else if (isDevMode) {
511-
logger.debug("Running in development mode. Will not upload sourcemaps.");
512-
} else if (!options.authToken) {
513-
logger.warn(
514-
"No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/" +
515-
getTurborepoEnvPassthroughWarning("SENTRY_AUTH_TOKEN")
516-
);
517-
} else if (!options.org && !options.authToken.startsWith("sntrys_")) {
518-
logger.warn(
519-
"No org provided. Will not upload source maps. Please set the `org` option to your Sentry organization slug." +
520-
getTurborepoEnvPassthroughWarning("SENTRY_ORG")
521-
);
522-
} else if (!options.project) {
523-
logger.warn(
524-
"No project provided. Will not upload source maps. Please set the `project` option to your Sentry project slug." +
525-
getTurborepoEnvPassthroughWarning("SENTRY_PROJECT")
526-
);
509+
if (!canUploadSourceMaps(options, logger, isDevMode)) {
510+
return;
527511
}
528512

529513
await startSpan(
@@ -589,7 +573,7 @@ export function createSentryBuildPluginManager(
589573
"Didn't find any matching sources for debug ID upload. Please check the `sourcemaps.assets` option."
590574
);
591575
} else {
592-
await startSpan(
576+
const numUploadedFiles = await startSpan(
593577
{ name: "prepare-bundles", scope: sentryScope },
594578
async (prepBundlesSpan) => {
595579
// Preparing the bundles can be a lot of work and doing it all at once has the potential of nuking the heap so
@@ -661,13 +645,20 @@ export function createSentryBuildPluginManager(
661645
dist: options.release.dist,
662646
},
663647
],
648+
// We want this promise to throw if the sourcemaps fail to upload so that we know about it.
649+
// see: https://github.com/getsentry/sentry-cli/pull/2605
650+
live: "rejectOnError",
664651
}
665652
);
666653
});
654+
655+
return files.length;
667656
}
668657
);
669658

670-
logger.info("Successfully uploaded source maps to Sentry");
659+
if (numUploadedFiles > 0) {
660+
logger.info("Successfully uploaded source maps to Sentry");
661+
}
671662
}
672663
} catch (e) {
673664
sentryScope.captureException('Error in "debugIdUploadPlugin" writeBundle hook');
@@ -732,3 +723,43 @@ export function createSentryBuildPluginManager(
732723
createDependencyOnBuildArtifacts,
733724
};
734725
}
726+
727+
function canUploadSourceMaps(
728+
options: NormalizedOptions,
729+
logger: Logger,
730+
isDevMode: boolean
731+
): boolean {
732+
if (options.sourcemaps?.disable) {
733+
logger.debug(
734+
"Source map upload was disabled. Will not upload sourcemaps using debug ID process."
735+
);
736+
return false;
737+
}
738+
if (isDevMode) {
739+
logger.debug("Running in development mode. Will not upload sourcemaps.");
740+
return false;
741+
}
742+
if (!options.authToken) {
743+
logger.warn(
744+
"No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/" +
745+
getTurborepoEnvPassthroughWarning("SENTRY_AUTH_TOKEN")
746+
);
747+
return false;
748+
}
749+
if (!options.org && !options.authToken.startsWith("sntrys_")) {
750+
logger.warn(
751+
"No org provided. Will not upload source maps. Please set the `org` option to your Sentry organization slug." +
752+
getTurborepoEnvPassthroughWarning("SENTRY_ORG")
753+
);
754+
return false;
755+
}
756+
if (!options.project) {
757+
logger.warn(
758+
"No project provided. Will not upload source maps. Please set the `project` option to your Sentry project slug." +
759+
getTurborepoEnvPassthroughWarning("SENTRY_PROJECT")
760+
);
761+
return false;
762+
}
763+
764+
return true;
765+
}

packages/dev-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/dev-utils",
3-
"version": "3.5.0",
3+
"version": "3.6.1",
44
"license": "MIT",
55
"private": true,
66
"files": [

packages/e2e-tests/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/bundler-plugin-e2e-tests",
3-
"version": "3.5.0",
3+
"version": "3.6.1",
44
"license": "MIT",
55
"private": true,
66
"scripts": {
@@ -15,15 +15,15 @@
1515
"lint": "eslint ."
1616
},
1717
"dependencies": {
18-
"@sentry/esbuild-plugin": "3.5.0",
19-
"@sentry/rollup-plugin": "3.5.0",
20-
"@sentry/vite-plugin": "3.5.0",
21-
"@sentry/webpack-plugin": "3.5.0",
18+
"@sentry/esbuild-plugin": "3.6.1",
19+
"@sentry/rollup-plugin": "3.6.1",
20+
"@sentry/vite-plugin": "3.6.1",
21+
"@sentry/webpack-plugin": "3.6.1",
2222
"axios": "^1.1.3"
2323
},
2424
"devDependencies": {
25-
"@sentry-internal/eslint-config": "3.5.0",
26-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "3.5.0",
25+
"@sentry-internal/eslint-config": "3.6.1",
26+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "3.6.1",
2727
"@swc/jest": "^0.2.21",
2828
"@types/axios": "^0.14.0",
2929
"@types/glob": "8.0.0",

0 commit comments

Comments
 (0)