@sentry/bundler-plugins 10.73.0 → 10.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/build/cjs/core/debug-id-upload.js +80 -2
  2. package/build/cjs/core/debug-id-upload.js.map +1 -1
  3. package/build/cjs/core/index.js +2 -0
  4. package/build/cjs/core/index.js.map +1 -1
  5. package/build/cjs/core/version.js +1 -1
  6. package/build/cjs/core/version.js.map +1 -1
  7. package/build/cjs/esbuild/index.js +17 -2
  8. package/build/cjs/esbuild/index.js.map +1 -1
  9. package/build/cjs/rollup/index.js +23 -13
  10. package/build/cjs/rollup/index.js.map +1 -1
  11. package/build/cjs/webpack/webpack4and5.js +34 -0
  12. package/build/cjs/webpack/webpack4and5.js.map +1 -1
  13. package/build/esm/core/debug-id-upload.js +79 -3
  14. package/build/esm/core/debug-id-upload.js.map +1 -1
  15. package/build/esm/core/index.js +1 -1
  16. package/build/esm/core/index.js.map +1 -1
  17. package/build/esm/core/version.js +1 -1
  18. package/build/esm/core/version.js.map +1 -1
  19. package/build/esm/esbuild/index.js +19 -4
  20. package/build/esm/esbuild/index.js.map +1 -1
  21. package/build/esm/package.json +1 -1
  22. package/build/esm/rollup/index.js +24 -14
  23. package/build/esm/rollup/index.js.map +1 -1
  24. package/build/esm/webpack/webpack4and5.js +36 -2
  25. package/build/esm/webpack/webpack4and5.js.map +1 -1
  26. package/build/types/core/debug-id-upload.d.ts +28 -0
  27. package/build/types/core/debug-id-upload.d.ts.map +1 -1
  28. package/build/types/core/index.d.ts +1 -1
  29. package/build/types/core/index.d.ts.map +1 -1
  30. package/build/types/core/types.d.ts +7 -2
  31. package/build/types/core/types.d.ts.map +1 -1
  32. package/build/types/core/version.d.ts +1 -1
  33. package/build/types/esbuild/index.d.ts.map +1 -1
  34. package/build/types/rollup/index.d.ts +22 -31
  35. package/build/types/rollup/index.d.ts.map +1 -1
  36. package/build/types/webpack/webpack4and5.d.ts +20 -21
  37. package/build/types/webpack/webpack4and5.d.ts.map +1 -1
  38. package/build/types-ts3.8/core/debug-id-upload.d.ts +28 -0
  39. package/build/types-ts3.8/core/index.d.ts +1 -1
  40. package/build/types-ts3.8/core/types.d.ts +7 -2
  41. package/build/types-ts3.8/core/version.d.ts +1 -1
  42. package/build/types-ts3.8/rollup/index.d.ts +22 -31
  43. package/build/types-ts3.8/webpack/webpack4and5.d.ts +20 -21
  44. package/package.json +2 -2
@@ -8,42 +8,32 @@ type TransformResult = {
8
8
  mappings: string;
9
9
  } | null;
10
10
  } | null | undefined;
11
+ type OutputBundle = Record<string, {
12
+ type: 'chunk';
13
+ fileName: string;
14
+ code: string;
15
+ sourcemapFileName?: string | null;
16
+ } | {
17
+ type: 'asset';
18
+ fileName: string;
19
+ source: string | Uint8Array;
20
+ }>;
11
21
  /**
12
22
  * @ignore - this is the internal plugin factory function only used for the Vite plugin!
13
23
  */
14
24
  export declare function _rollupPluginInternal(userOptions: Options | undefined, buildTool: 'rollup' | 'vite', buildToolMajorVersion?: string): {
15
25
  name: string;
16
- buildStart?: undefined;
17
- transform?: undefined;
18
- renderChunk?: undefined;
19
- writeBundle?: undefined;
20
26
  } | {
21
- name: string;
22
- buildStart: () => void;
23
- transform: ((code: string, id: string, meta?: ComponentAnnotationTransformMeta) => Promise<TransformResult>) | {
24
- filter: {
25
- id: RegExp;
26
- };
27
- handler: (code: string, id: string, meta?: ComponentAnnotationTransformMeta) => Promise<TransformResult>;
28
- };
29
- renderChunk: (code: string, chunk: {
30
- fileName: string;
31
- facadeModuleId?: string | null;
32
- }, _?: unknown, meta?: {
33
- magicString?: MagicString;
34
- }) => {
35
- code: string;
36
- map?: SourceMap;
37
- } | null;
38
27
  writeBundle: (outputOptions: {
39
28
  dir?: string;
40
29
  file?: string;
41
30
  }, bundle: {
42
31
  [fileName: string]: unknown;
43
32
  }) => Promise<void>;
44
- } | {
45
- name: string;
46
- buildStart: () => void;
33
+ generateBundle?: {
34
+ order: "pre";
35
+ handler: (_outputOptions: unknown, bundle: OutputBundle) => void;
36
+ } | undefined;
47
37
  renderChunk: (code: string, chunk: {
48
38
  fileName: string;
49
39
  facadeModuleId?: string | null;
@@ -53,13 +43,14 @@ export declare function _rollupPluginInternal(userOptions: Options | undefined,
53
43
  code: string;
54
44
  map?: SourceMap;
55
45
  } | null;
56
- writeBundle: (outputOptions: {
57
- dir?: string;
58
- file?: string;
59
- }, bundle: {
60
- [fileName: string]: unknown;
61
- }) => Promise<void>;
62
- transform?: undefined;
46
+ transform?: ((code: string, id: string, meta?: ComponentAnnotationTransformMeta) => Promise<TransformResult>) | {
47
+ filter: {
48
+ id: RegExp;
49
+ };
50
+ handler: (code: string, id: string, meta?: ComponentAnnotationTransformMeta) => Promise<TransformResult>;
51
+ } | undefined;
52
+ name: string;
53
+ buildStart: () => void;
63
54
  };
64
55
  export declare function sentryRollupPlugin(userOptions?: Options): any;
65
56
  export { Options as SentryRollupPluginOptions } from '../core';
@@ -5,28 +5,18 @@ type UnsafeBannerPlugin = {
5
5
  type UnsafeDefinePlugin = {
6
6
  new (options: any): unknown;
7
7
  };
8
- type WebpackModule = {
9
- resource?: string;
8
+ type WebpackSource = {
9
+ source: () => string | Buffer;
10
10
  };
11
- type WebpackLoaderCallback = (err: Error | null, content?: string, sourceMap?: unknown) => void;
12
- type WebpackLoaderContext = {
13
- callback: WebpackLoaderCallback;
11
+ type WebpackRawSource = {
12
+ new (source: string): WebpackSource;
14
13
  };
15
- type WebpackCompilationContext = {
16
- compiler: {
17
- webpack?: {
18
- NormalModule?: {
19
- getCompilationHooks: (compilation: WebpackCompilationContext) => {
20
- loader: {
21
- tap: (name: string, callback: (loaderContext: WebpackLoaderContext, module: WebpackModule) => void) => void;
22
- };
23
- };
24
- };
25
- };
26
- };
27
- hooks: {
28
- normalModuleLoader?: {
29
- tap: (name: string, callback: (loaderContext: WebpackLoaderContext, module: WebpackModule) => void) => void;
14
+ type WebpackAsset = {
15
+ name: string;
16
+ source: WebpackSource;
17
+ info: {
18
+ related?: {
19
+ sourceMap?: string | string[];
30
20
  };
31
21
  };
32
22
  };
@@ -40,7 +30,7 @@ type WebpackCompiler = {
40
30
  };
41
31
  hooks: {
42
32
  thisCompilation: {
43
- tap: (name: string, callback: (compilation: WebpackCompilationContext) => void) => void;
33
+ tap: (name: string, callback: (compilation: WebpackCompilation) => void) => void;
44
34
  };
45
35
  afterEmit: {
46
36
  tapAsync: (name: string, callback: (compilation: WebpackCompilation, cb: () => void) => void) => void;
@@ -52,6 +42,12 @@ type WebpackCompiler = {
52
42
  webpack?: {
53
43
  BannerPlugin?: UnsafeBannerPlugin;
54
44
  DefinePlugin?: UnsafeDefinePlugin;
45
+ Compilation?: {
46
+ PROCESS_ASSETS_STAGE_DEV_TOOLING?: number;
47
+ };
48
+ sources?: {
49
+ RawSource?: WebpackRawSource;
50
+ };
55
51
  };
56
52
  };
57
53
  type WebpackCompilation = {
@@ -59,6 +55,9 @@ type WebpackCompilation = {
59
55
  path?: string;
60
56
  };
61
57
  assets: Record<string, unknown>;
58
+ getAssets: () => WebpackAsset[];
59
+ getAsset: (name: string) => WebpackAsset | undefined;
60
+ updateAsset: (name: string, source: WebpackSource) => void;
62
61
  hooks: {
63
62
  processAssets: {
64
63
  tap: (options: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/bundler-plugins",
3
- "version": "10.73.0",
3
+ "version": "10.75.0",
4
4
  "description": "Sentry Bundler Plugins",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/main/packages/bundler-plugins",
@@ -112,7 +112,7 @@
112
112
  "dependencies": {
113
113
  "@babel/core": "^7.18.5",
114
114
  "@sentry/cli": "^2.58.6",
115
- "@sentry/core": "10.73.0",
115
+ "@sentry/core": "10.75.0",
116
116
  "dotenv": "^17.4.2",
117
117
  "find-up": "^5.0.0",
118
118
  "glob": "^13.0.6",