File tree 5 files changed +82
-1
lines changed
bundler-plugin-core/src/plugins 5 files changed +82
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ interface ReleaseManagementPluginOptions {
31
31
createDependencyOnSourcemapFiles : ( ) => ( ) => void ;
32
32
}
33
33
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
+ */
34
39
export function releaseManagementPlugin ( {
35
40
releaseName,
36
41
include,
@@ -47,7 +52,7 @@ export function releaseManagementPlugin({
47
52
} : ReleaseManagementPluginOptions ) : UnpluginOptions {
48
53
const freeGlobalDependencyOnSourcemapFiles = createDependencyOnSourcemapFiles ( ) ;
49
54
return {
50
- name : "sentry-debug-id-upload -plugin" ,
55
+ name : "sentry-release-management -plugin" ,
51
56
async writeBundle ( ) {
52
57
// 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`)
53
58
// Therefore we need to actually register the execution of this hook as dependency on the sourcemap files.
Original file line number Diff line number Diff line change
1
+ import { EsbuildPlugin } from "unplugin" ;
1
2
import { sentryEsbuildPlugin } from "../src" ;
2
3
3
4
test ( "Esbuild plugin should exist" , ( ) => {
4
5
expect ( sentryEsbuildPlugin ) . toBeDefined ( ) ;
5
6
expect ( typeof sentryEsbuildPlugin ) . toBe ( "function" ) ;
6
7
} ) ;
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
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { Plugin } from "rollup" ;
1
2
import { sentryRollupPlugin } from "../src" ;
2
3
3
4
test ( "Rollup plugin should exist" , ( ) => {
4
5
expect ( sentryRollupPlugin ) . toBeDefined ( ) ;
5
6
expect ( typeof sentryRollupPlugin ) . toBe ( "function" ) ;
6
7
} ) ;
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
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { VitePlugin } from "unplugin" ;
1
2
import { sentryVitePlugin } from "../src" ;
2
3
3
4
test ( "Vite plugin should exist" , ( ) => {
4
5
expect ( sentryVitePlugin ) . toBeDefined ( ) ;
5
6
expect ( typeof sentryVitePlugin ) . toBe ( "function" ) ;
6
7
} ) ;
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
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { Plugin } from "webpack" ;
1
2
import { sentryWebpackPlugin } from "../src" ;
2
3
3
4
test ( "Webpack plugin should exist" , ( ) => {
4
5
expect ( sentryWebpackPlugin ) . toBeDefined ( ) ;
5
6
expect ( typeof sentryWebpackPlugin ) . toBe ( "function" ) ;
6
7
} ) ;
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments