Skip to content

Commit d051b07

Browse files
authored
ref(core): Rename release management plugin name (#647)
1 parent b2a0529 commit d051b07

File tree

5 files changed

+82
-1
lines changed

5 files changed

+82
-1
lines changed

packages/bundler-plugin-core/src/plugins/release-management.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ interface ReleaseManagementPluginOptions {
3131
createDependencyOnSourcemapFiles: () => () => void;
3232
}
3333

34+
/**
35+
* Creates a plugin that creates releases, sets commits, deploys and finalizes releases.
36+
*
37+
* Additionally, if legacy upload options are set, it uploads source maps in the legacy (non-debugId) way.
38+
*/
3439
export function releaseManagementPlugin({
3540
releaseName,
3641
include,
@@ -47,7 +52,7 @@ export function releaseManagementPlugin({
4752
}: ReleaseManagementPluginOptions): UnpluginOptions {
4853
const freeGlobalDependencyOnSourcemapFiles = createDependencyOnSourcemapFiles();
4954
return {
50-
name: "sentry-debug-id-upload-plugin",
55+
name: "sentry-release-management-plugin",
5156
async writeBundle() {
5257
// It is possible that this writeBundle hook is called multiple times in one build (for example when reusing the plugin, or when using build tooling like `@vitejs/plugin-legacy`)
5358
// Therefore we need to actually register the execution of this hook as dependency on the sourcemap files.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
import { EsbuildPlugin } from "unplugin";
12
import { sentryEsbuildPlugin } from "../src";
23

34
test("Esbuild plugin should exist", () => {
45
expect(sentryEsbuildPlugin).toBeDefined();
56
expect(typeof sentryEsbuildPlugin).toBe("function");
67
});
8+
9+
describe("sentryEsbuildPlugin", () => {
10+
it("returns an esbuild plugin", () => {
11+
const plugins = sentryEsbuildPlugin({
12+
authToken: "test-token",
13+
org: "test-org",
14+
project: "test-project",
15+
}) as EsbuildPlugin;
16+
17+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
18+
expect(plugins).toEqual({ name: "unplugin-host-0", setup: expect.any(Function) });
19+
});
20+
});
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
1+
import { Plugin } from "rollup";
12
import { sentryRollupPlugin } from "../src";
23

34
test("Rollup plugin should exist", () => {
45
expect(sentryRollupPlugin).toBeDefined();
56
expect(typeof sentryRollupPlugin).toBe("function");
67
});
8+
9+
describe("sentryRollupPlugin", () => {
10+
it("returns an array of rollup plugins", () => {
11+
const plugins = sentryRollupPlugin({
12+
authToken: "test-token",
13+
org: "test-org",
14+
project: "test-project",
15+
}) as Plugin[];
16+
17+
expect(Array.isArray(plugins)).toBe(true);
18+
19+
const pluginNames = plugins.map((plugin) => plugin.name);
20+
21+
expect(pluginNames).toEqual([
22+
"sentry-telemetry-plugin",
23+
"sentry-rollup-release-injection-plugin",
24+
"sentry-release-management-plugin",
25+
"sentry-rollup-debug-id-injection-plugin",
26+
"sentry-rollup-debug-id-upload-plugin",
27+
"sentry-file-deletion-plugin",
28+
]);
29+
});
30+
});
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
1+
import { VitePlugin } from "unplugin";
12
import { sentryVitePlugin } from "../src";
23

34
test("Vite plugin should exist", () => {
45
expect(sentryVitePlugin).toBeDefined();
56
expect(typeof sentryVitePlugin).toBe("function");
67
});
8+
9+
describe("sentryVitePlugin", () => {
10+
it("returns an array of Vite plugins", () => {
11+
const plugins = sentryVitePlugin({
12+
authToken: "test-token",
13+
org: "test-org",
14+
project: "test-project",
15+
}) as VitePlugin[];
16+
17+
expect(Array.isArray(plugins)).toBe(true);
18+
19+
const pluginNames = plugins.map((plugin) => plugin.name);
20+
21+
expect(pluginNames).toEqual([
22+
"sentry-telemetry-plugin",
23+
"sentry-vite-release-injection-plugin",
24+
"sentry-release-management-plugin",
25+
"sentry-vite-debug-id-injection-plugin",
26+
"sentry-vite-debug-id-upload-plugin",
27+
"sentry-file-deletion-plugin",
28+
]);
29+
});
30+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
import { Plugin } from "webpack";
12
import { sentryWebpackPlugin } from "../src";
23

34
test("Webpack plugin should exist", () => {
45
expect(sentryWebpackPlugin).toBeDefined();
56
expect(typeof sentryWebpackPlugin).toBe("function");
67
});
8+
9+
describe("sentryWebpackPlugin", () => {
10+
it("returns a webpack plugin", () => {
11+
const plugin = sentryWebpackPlugin({
12+
authToken: "test-token",
13+
org: "test-org",
14+
project: "test-project",
15+
}) as Plugin;
16+
17+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
18+
expect(plugin).toEqual({ apply: expect.any(Function) });
19+
});
20+
});

0 commit comments

Comments
 (0)