File tree Expand file tree Collapse file tree 5 files changed +82
-1
lines changed
bundler-plugin-core/src/plugins Expand file tree Collapse file tree 5 files changed +82
-1
lines changed Original file line number Diff line number Diff 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+ */
3439export 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.
Original file line number Diff line number Diff line change 1+ import { EsbuildPlugin } from "unplugin" ;
12import { sentryEsbuildPlugin } from "../src" ;
23
34test ( "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+ } ) ;
Original file line number Diff line number Diff line change 1+ import { Plugin } from "rollup" ;
12import { sentryRollupPlugin } from "../src" ;
23
34test ( "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+ } ) ;
Original file line number Diff line number Diff line change 1+ import { VitePlugin } from "unplugin" ;
12import { sentryVitePlugin } from "../src" ;
23
34test ( "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+ } ) ;
Original file line number Diff line number Diff line change 1+ import { Plugin } from "webpack" ;
12import { sentryWebpackPlugin } from "../src" ;
23
34test ( "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+ } ) ;
You can’t perform that action at this time.
0 commit comments