Skip to content

Commit 9ec4206

Browse files
committed
feat: Update Sentry CLI to v3
1 parent 7e76d7c commit 9ec4206

14 files changed

Lines changed: 75 additions & 99 deletions

File tree

packages/bundler-plugin-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"dependencies": {
5757
"@babel/core": "^7.18.5",
5858
"@sentry/babel-plugin-component-annotate": "5.2.1",
59-
"@sentry/cli": "^2.58.5",
59+
"@sentry/cli": "^3.4.1",
6060
"dotenv": "^16.3.1",
6161
"find-up": "^5.0.0",
6262
"glob": "^13.0.6",

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import SentryCli from "@sentry/cli";
1+
import { SentryCli } from "@sentry/cli";
22
import {
33
closeSession,
44
DEFAULT_ENVIRONMENT,
@@ -486,7 +486,9 @@ export function createSentryBuildPluginManager(
486486
const cliInstance = createCliInstance(options);
487487

488488
if (options.release.create) {
489-
const releaseOutput = await cliInstance.releases.new(options.release.name);
489+
const releaseOutput = await cliInstance.releases.new(options.release.name, {
490+
projects: getProjects(options.project),
491+
});
490492
logger.debug("Release created:", releaseOutput);
491493
}
492494

@@ -508,9 +510,6 @@ export function createSentryBuildPluginManager(
508510
include: normalizedInclude,
509511
dist: options.release.dist,
510512
projects: getProjects(options.project),
511-
// We want this promise to throw if the sourcemaps fail to upload so that we know about it.
512-
// see: https://github.com/getsentry/sentry-cli/pull/2605
513-
live: "rejectOnError",
514513
});
515514
}
516515

@@ -576,7 +575,7 @@ export function createSentryBuildPluginManager(
576575
...serializeIgnoreOptions(options.sourcemaps?.ignore),
577576
...buildArtifactPaths,
578577
],
579-
options.debug ? "rejectOnError" : false
578+
options.debug
580579
);
581580
} catch (e) {
582581
sentryScope.captureException('Error in "debugIdInjectionPlugin" writeBundle hook');
@@ -659,7 +658,6 @@ export function createSentryBuildPluginManager(
659658
],
660659
ignore: ignorePaths,
661660
projects: getProjects(options.project),
662-
live: "rejectOnError",
663661
});
664662
});
665663

@@ -765,7 +763,6 @@ export function createSentryBuildPluginManager(
765763
},
766764
],
767765
projects: getProjects(options.project),
768-
live: "rejectOnError",
769766
}
770767
);
771768
});

packages/bundler-plugin-core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { transformAsync } from "@babel/core";
22
import componentNameAnnotatePlugin, {
33
experimentalComponentNameAnnotatePlugin,
44
} from "@sentry/babel-plugin-component-annotate";
5-
import SentryCli from "@sentry/cli";
5+
import { SentryCli } from "@sentry/cli";
66
import { logger } from "@sentry/utils";
77
import * as fs from "fs";
88
import { CodeInjection, containsOnlyImports, stripQueryAndHashFromPath } from "./utils";

packages/bundler-plugin-core/src/sentry/telemetry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import SentryCli from "@sentry/cli";
1+
import { SentryCli } from "@sentry/cli";
22
import { Client } from "@sentry/types";
33
import { applySdkMetadata, ServerRuntimeClient, ServerRuntimeClientOptions } from "@sentry/core";
44
import { NormalizedOptions, SENTRY_SAAS_URL } from "../options-mapping";

packages/integration-tests-next/fixtures/esbuild/basic-cjs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
3232
var basic_default = void 0;
3333
})();
3434
",
35-
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
35+
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA","-p","fake-project"],
3636
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
3737
["releases","finalize","CURRENT_SHA"],
3838
["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"],

packages/integration-tests-next/fixtures/esbuild/basic-sourcemaps.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
3434
//# sourceMappingURL=basic-sourcemaps.js.map
3535
",
3636
"basic-sourcemaps.js.map": "{"version":3,"sources":["../../_sentry-injection-stub","sentry-debug-id-stub:_sentry-debug-id-injection-stub?sentry-module-id=00000000-0000-0000-0000-000000000000","../../src/basic.js","../../src/basic.js"],"sourcesContent":["!function(){try{var e=\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof self?self:{};e.SENTRY_RELEASE={id:\\"CURRENT_SHA\\"};}catch(e){}}();","!function(){try{var e=\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof self?self:{};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]=\\"00000000-0000-0000-0000-000000000000\\",e._sentryDebugIdIdentifier=\\"sentry-dbid-00000000-0000-0000-0000-000000000000\\");}catch(e){}}();","// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n","\\n import \\"_sentry-debug-id-injection-stub\\";\\n import * as OriginalModule from \\"./src/basic.js\\";\\n export default OriginalModule.default;\\n export * from \\"./src/basic.js\\";"],"mappings":";;AAAA,IAAC,WAAU;AAAC,QAAG;AAAC,UAAI,IAAE,eAAa,OAAO,SAAO,SAAO,eAAa,OAAO,SAAO,SAAO,eAAa,OAAO,aAAW,aAAW,eAAa,OAAO,OAAK,OAAK,CAAC;AAAE,QAAE,iBAAe,EAAC,IAAG,2CAA0C;AAAA,IAAE,SAAOA,IAAE;AAAA,IAAC;AAAA,EAAC,GAAE;;;ACAnP,IAAC,WAAU;AAAC,QAAG;AAAC,UAAI,IAAE,eAAa,OAAO,SAAO,SAAO,eAAa,OAAO,SAAO,SAAO,eAAa,OAAO,aAAW,aAAW,eAAa,OAAO,OAAK,OAAK,CAAC;AAAE,UAAI,IAAG,IAAI,EAAE,QAAO;AAAM,YAAI,EAAE,kBAAgB,EAAE,mBAAiB,CAAC,GAAE,EAAE,gBAAgB,CAAC,IAAE,wCAAuC,EAAE,2BAAyB;AAAA,IAAoD,SAAOC,IAAE;AAAA,IAAC;AAAA,EAAC,GAAE;;;ACCnY,UAAQ,IAAI,aAAa;;;ACEX,MAAO,gBAAuB;","names":["e","e"]}",
37-
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
37+
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA","-p","fake-project"],
3838
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
3939
["releases","finalize","CURRENT_SHA"],
4040
["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"],

packages/integration-tests-next/fixtures/esbuild/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
3232
var basic_default = void 0;
3333
})();
3434
",
35-
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
35+
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA","-p","fake-project"],
3636
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
3737
["releases","finalize","CURRENT_SHA"],
3838
["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"],

packages/integration-tests-next/fixtures/rolldown/basic-cjs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
1717
console.log("hello world");
1818
//#endregion
1919
",
20-
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
20+
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA","-p","fake-project"],
2121
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
2222
["releases","finalize","CURRENT_SHA"],
2323
["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"],

packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
1919
2020
//# sourceMappingURL=basic.js.map",
2121
"basic.js.map": "{"version":3,"file":"basic.js","names":[],"sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"mappings":";;;;;;;;;AACA,QAAQ,IAAI,cAAc"}",
22-
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
22+
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA","-p","fake-project"],
2323
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
2424
["releases","finalize","CURRENT_SHA"],
2525
["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"],

packages/integration-tests-next/fixtures/rolldown/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
1717
console.log("hello world");
1818
//#endregion
1919
",
20-
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
20+
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA","-p","fake-project"],
2121
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
2222
["releases","finalize","CURRENT_SHA"],
2323
["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"],

0 commit comments

Comments
 (0)