@sentry/bundler-plugins 10.60.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 (149) hide show
  1. package/LICENSE +29 -0
  2. package/README.md +31 -0
  3. package/build/cjs/babel-plugin/constants.js +126 -0
  4. package/build/cjs/babel-plugin/constants.js.map +1 -0
  5. package/build/cjs/babel-plugin/experimental.js +334 -0
  6. package/build/cjs/babel-plugin/experimental.js.map +1 -0
  7. package/build/cjs/babel-plugin/index.js +508 -0
  8. package/build/cjs/babel-plugin/index.js.map +1 -0
  9. package/build/cjs/core/build-plugin-manager.js +583 -0
  10. package/build/cjs/core/build-plugin-manager.js.map +1 -0
  11. package/build/cjs/core/debug-id-upload.js +184 -0
  12. package/build/cjs/core/debug-id-upload.js.map +1 -0
  13. package/build/cjs/core/glob.js +10 -0
  14. package/build/cjs/core/glob.js.map +1 -0
  15. package/build/cjs/core/index.js +113 -0
  16. package/build/cjs/core/index.js.map +1 -0
  17. package/build/cjs/core/logger.js +29 -0
  18. package/build/cjs/core/logger.js.map +1 -0
  19. package/build/cjs/core/options-mapping.js +115 -0
  20. package/build/cjs/core/options-mapping.js.map +1 -0
  21. package/build/cjs/core/sentry/telemetry.js +127 -0
  22. package/build/cjs/core/sentry/telemetry.js.map +1 -0
  23. package/build/cjs/core/sentry/transports.js +108 -0
  24. package/build/cjs/core/sentry/transports.js.map +1 -0
  25. package/build/cjs/core/utils.js +298 -0
  26. package/build/cjs/core/utils.js.map +1 -0
  27. package/build/cjs/core/version.js +6 -0
  28. package/build/cjs/core/version.js.map +1 -0
  29. package/build/cjs/esbuild/index.js +208 -0
  30. package/build/cjs/esbuild/index.js.map +1 -0
  31. package/build/cjs/rollup/index.js +193 -0
  32. package/build/cjs/rollup/index.js.map +1 -0
  33. package/build/cjs/vite/index.js +28 -0
  34. package/build/cjs/vite/index.js.map +1 -0
  35. package/build/cjs/webpack/component-annotation-transform.js +29 -0
  36. package/build/cjs/webpack/component-annotation-transform.js.map +1 -0
  37. package/build/cjs/webpack/index.js +25 -0
  38. package/build/cjs/webpack/index.js.map +1 -0
  39. package/build/cjs/webpack/webpack4and5.js +185 -0
  40. package/build/cjs/webpack/webpack4and5.js.map +1 -0
  41. package/build/cjs/webpack/webpack5.js +11 -0
  42. package/build/cjs/webpack/webpack5.js.map +1 -0
  43. package/build/esm/babel-plugin/constants.js +123 -0
  44. package/build/esm/babel-plugin/constants.js.map +1 -0
  45. package/build/esm/babel-plugin/experimental.js +332 -0
  46. package/build/esm/babel-plugin/experimental.js.map +1 -0
  47. package/build/esm/babel-plugin/index.js +505 -0
  48. package/build/esm/babel-plugin/index.js.map +1 -0
  49. package/build/esm/core/build-plugin-manager.js +561 -0
  50. package/build/esm/core/build-plugin-manager.js.map +1 -0
  51. package/build/esm/core/debug-id-upload.js +161 -0
  52. package/build/esm/core/debug-id-upload.js.map +1 -0
  53. package/build/esm/core/glob.js +8 -0
  54. package/build/esm/core/glob.js.map +1 -0
  55. package/build/esm/core/index.js +82 -0
  56. package/build/esm/core/index.js.map +1 -0
  57. package/build/esm/core/logger.js +27 -0
  58. package/build/esm/core/logger.js.map +1 -0
  59. package/build/esm/core/options-mapping.js +111 -0
  60. package/build/esm/core/options-mapping.js.map +1 -0
  61. package/build/esm/core/sentry/telemetry.js +118 -0
  62. package/build/esm/core/sentry/telemetry.js.map +1 -0
  63. package/build/esm/core/sentry/transports.js +92 -0
  64. package/build/esm/core/sentry/transports.js.map +1 -0
  65. package/build/esm/core/utils.js +271 -0
  66. package/build/esm/core/utils.js.map +1 -0
  67. package/build/esm/core/version.js +4 -0
  68. package/build/esm/core/version.js.map +1 -0
  69. package/build/esm/esbuild/index.js +190 -0
  70. package/build/esm/esbuild/index.js.map +1 -0
  71. package/build/esm/package.json +1 -0
  72. package/build/esm/rollup/index.js +172 -0
  73. package/build/esm/rollup/index.js.map +1 -0
  74. package/build/esm/vite/index.js +24 -0
  75. package/build/esm/vite/index.js.map +1 -0
  76. package/build/esm/webpack/component-annotation-transform.js +27 -0
  77. package/build/esm/webpack/component-annotation-transform.js.map +1 -0
  78. package/build/esm/webpack/index.js +21 -0
  79. package/build/esm/webpack/index.js.map +1 -0
  80. package/build/esm/webpack/webpack4and5.js +168 -0
  81. package/build/esm/webpack/webpack4and5.js.map +1 -0
  82. package/build/esm/webpack/webpack5.js +8 -0
  83. package/build/esm/webpack/webpack5.js.map +1 -0
  84. package/build/types/babel-plugin/constants.d.ts +27 -0
  85. package/build/types/babel-plugin/constants.d.ts.map +1 -0
  86. package/build/types/babel-plugin/experimental.d.ts +51 -0
  87. package/build/types/babel-plugin/experimental.d.ts.map +1 -0
  88. package/build/types/babel-plugin/index.d.ts +56 -0
  89. package/build/types/babel-plugin/index.d.ts.map +1 -0
  90. package/build/types/core/build-plugin-manager.d.ts +82 -0
  91. package/build/types/core/build-plugin-manager.d.ts.map +1 -0
  92. package/build/types/core/debug-id-upload.d.ts +17 -0
  93. package/build/types/core/debug-id-upload.d.ts.map +1 -0
  94. package/build/types/core/glob.d.ts +5 -0
  95. package/build/types/core/glob.d.ts.map +1 -0
  96. package/build/types/core/index.d.ts +53 -0
  97. package/build/types/core/index.d.ts.map +1 -0
  98. package/build/types/core/logger.d.ts +14 -0
  99. package/build/types/core/logger.d.ts.map +1 -0
  100. package/build/types/core/options-mapping.d.ts +82 -0
  101. package/build/types/core/options-mapping.d.ts.map +1 -0
  102. package/build/types/core/sentry/telemetry.d.ts +14 -0
  103. package/build/types/core/sentry/telemetry.d.ts.map +1 -0
  104. package/build/types/core/sentry/transports.d.ts +5 -0
  105. package/build/types/core/sentry/transports.d.ts.map +1 -0
  106. package/build/types/core/types.d.ts +570 -0
  107. package/build/types/core/types.d.ts.map +1 -0
  108. package/build/types/core/utils.d.ts +87 -0
  109. package/build/types/core/utils.d.ts.map +1 -0
  110. package/build/types/core/version.d.ts +2 -0
  111. package/build/types/core/version.d.ts.map +1 -0
  112. package/build/types/esbuild/index.d.ts +6 -0
  113. package/build/types/esbuild/index.d.ts.map +1 -0
  114. package/build/types/rollup/index.d.ts +56 -0
  115. package/build/types/rollup/index.d.ts.map +1 -0
  116. package/build/types/vite/index.d.ts +9 -0
  117. package/build/types/vite/index.d.ts.map +1 -0
  118. package/build/types/webpack/component-annotation-transform.d.ts +11 -0
  119. package/build/types/webpack/component-annotation-transform.d.ts.map +1 -0
  120. package/build/types/webpack/index.d.ts +5 -0
  121. package/build/types/webpack/index.d.ts.map +1 -0
  122. package/build/types/webpack/webpack4and5.d.ts +99 -0
  123. package/build/types/webpack/webpack4and5.d.ts.map +1 -0
  124. package/build/types/webpack/webpack5.d.ts +5 -0
  125. package/build/types/webpack/webpack5.d.ts.map +1 -0
  126. package/build/types-ts3.8/babel-plugin/constants.d.ts +27 -0
  127. package/build/types-ts3.8/babel-plugin/experimental.d.ts +51 -0
  128. package/build/types-ts3.8/babel-plugin/index.d.ts +56 -0
  129. package/build/types-ts3.8/core/build-plugin-manager.d.ts +82 -0
  130. package/build/types-ts3.8/core/debug-id-upload.d.ts +17 -0
  131. package/build/types-ts3.8/core/glob.d.ts +5 -0
  132. package/build/types-ts3.8/core/index.d.ts +53 -0
  133. package/build/types-ts3.8/core/logger.d.ts +14 -0
  134. package/build/types-ts3.8/core/options-mapping.d.ts +82 -0
  135. package/build/types-ts3.8/core/sentry/telemetry.d.ts +14 -0
  136. package/build/types-ts3.8/core/sentry/transports.d.ts +5 -0
  137. package/build/types-ts3.8/core/types.d.ts +570 -0
  138. package/build/types-ts3.8/core/utils.d.ts +87 -0
  139. package/build/types-ts3.8/core/version.d.ts +2 -0
  140. package/build/types-ts3.8/esbuild/index.d.ts +6 -0
  141. package/build/types-ts3.8/rollup/index.d.ts +56 -0
  142. package/build/types-ts3.8/vite/index.d.ts +9 -0
  143. package/build/types-ts3.8/webpack/component-annotation-transform.d.ts +11 -0
  144. package/build/types-ts3.8/webpack/index.d.ts +5 -0
  145. package/build/types-ts3.8/webpack/webpack4and5.d.ts +99 -0
  146. package/build/types-ts3.8/webpack/webpack5.d.ts +5 -0
  147. package/package.json +153 -0
  148. package/sentry-esbuild-debugid-injection-file.js +20 -0
  149. package/sentry-release-injection-file.js +4 -0
@@ -0,0 +1,87 @@
1
+ import type { SourceMap } from 'magic-string';
2
+ /**
3
+ * Checks whether the given input is already an array, and if it isn't, wraps it in one.
4
+ *
5
+ * @param maybeArray Input to turn into an array, if necessary
6
+ * @returns The input, if already an array, or an array with the input as the only element, if not
7
+ */
8
+ export declare function arrayify<T = unknown>(maybeArray: T | T[]): T[];
9
+ type PackageJson = Record<string, unknown>;
10
+ /**
11
+ * Get the closes package.json from a given starting point upwards.
12
+ * This handles a few edge cases:
13
+ * * Check if a given file package.json appears to be an actual NPM package.json file
14
+ * * Stop at the home dir, to avoid looking too deeply
15
+ */
16
+ export declare function getPackageJson({ cwd, stopAt }?: {
17
+ cwd?: string;
18
+ stopAt?: string;
19
+ }): PackageJson | undefined;
20
+ export declare function parseMajorVersion(ver: string): number | undefined;
21
+ export declare function getDependencies(packageJson: PackageJson): {
22
+ deps: string[];
23
+ depsVersions: Record<string, number>;
24
+ };
25
+ /**
26
+ * Deterministically hashes a string and turns the hash into a uuid.
27
+ */
28
+ export declare function stringToUUID(str: string): string;
29
+ /**
30
+ * Tries to guess a release name based on environmental data.
31
+ */
32
+ export declare function determineReleaseName(): string | undefined;
33
+ /**
34
+ * Generates code for the global injector which is responsible for setting the global
35
+ * `SENTRY_RELEASE` & `SENTRY_BUILD_INFO` variables.
36
+ */
37
+ export declare function generateReleaseInjectorCode({ release, injectBuildInformation, }: {
38
+ release: string;
39
+ injectBuildInformation: boolean;
40
+ }): CodeInjection;
41
+ export declare function generateModuleMetadataInjectorCode(metadata: any): CodeInjection;
42
+ export declare function getBuildInformation(): {
43
+ deps: string[];
44
+ depsVersions: Record<string, number>;
45
+ nodeVersion: number | undefined;
46
+ };
47
+ export declare function stripQueryAndHashFromPath(path: string): string;
48
+ export declare function replaceBooleanFlagsInCode(code: string, replacementValues: Record<string, boolean | undefined>): {
49
+ code: string;
50
+ map: SourceMap;
51
+ } | null;
52
+ export declare function getTurborepoEnvPassthroughWarning(envVarName: string): string;
53
+ /**
54
+ * Gets the projects from the project option. This might be a single project or an array of projects.
55
+ */
56
+ export declare function getProjects(project: string | string[] | undefined): string[] | undefined;
57
+ /**
58
+ * Inlined functionality from @sentry/cli helper code to add `--ignore` options.
59
+ *
60
+ * Temporary workaround until we expose a function for injecting debug IDs. Currently, we directly call `execute` with CLI args to inject them.
61
+ */
62
+ export declare function serializeIgnoreOptions(ignoreValue: string | string[] | undefined): string[];
63
+ /**
64
+ * Checks if a chunk contains only import/export statements and no substantial code.
65
+ *
66
+ * In Vite MPA (multi-page application) mode, HTML entry points create "facade" chunks
67
+ * that only contain import statements to load shared modules. These should not have
68
+ * Sentry code injected. However, in SPA mode, the main bundle also has an HTML facade
69
+ * but contains substantial application code that SHOULD have debug IDs injected.
70
+ *
71
+ * @ref https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/829
72
+ * @ref https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/839
73
+ */
74
+ export declare function containsOnlyImports(code: string): boolean;
75
+ export declare class CodeInjection {
76
+ private body;
77
+ private readonly header;
78
+ private readonly footer;
79
+ constructor(body?: string);
80
+ code(): string;
81
+ isEmpty(): boolean;
82
+ append(code: CodeInjection | string): void;
83
+ clear(): void;
84
+ clone(): CodeInjection;
85
+ }
86
+ export {};
87
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/core/utils.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAE9D;AAED,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,WAAW,GAAG,SAAS,CAE/G;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA4DjE;AAmBD,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG;IACzD,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,CAwBA;AAqCD;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQhD;AAeD;;GAEG;AAEH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,SAAS,CA0FzD;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,OAAO,EACP,sBAAsB,GACvB,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,EAAE,OAAO,CAAC;CACjC,GAAG,aAAa,CAUhB;AAGD,wBAAgB,kCAAkC,CAAC,QAAQ,EAAE,GAAG,GAAG,aAAa,CAQ/E;AAED,wBAAgB,mBAAmB,IAAI;IACrC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,CAUA;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC,GACrD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,SAAS,CAAA;CAAE,GAAG,IAAI,CAmBzC;AAGD,wBAAgB,iCAAiC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI5E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAUxF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAU3F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAkBzD;AAED,qBAAa,aAAa;IAMZ,OAAO,CAAC,IAAI;IAHxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEZ,IAAI,GAAE,MAAW;IAK9B,IAAI,IAAI,MAAM;IAQd,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI;IAQ1C,KAAK,IAAI,IAAI;IAIb,KAAK,IAAI,aAAa;CAG9B"}
@@ -0,0 +1,2 @@
1
+ export declare const LIB_VERSION = "10.60.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/core/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,YAAY,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Options } from '../core';
2
+ export declare function sentryEsbuildPlugin(userOptions?: Options): any;
3
+ export default sentryEsbuildPlugin;
4
+ export type { Options as SentryEsbuildPluginOptions } from '../core';
5
+ export { sentryCliBinaryExists } from '../core';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/esbuild/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAsFvC,wBAAgB,mBAAmB,CAAC,WAAW,GAAE,OAAY,GAAG,GAAG,CAkNlE;AAGD,eAAe,mBAAmB,CAAC;AACnC,YAAY,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,56 @@
1
+ import type { Options } from '../core';
2
+ import type { SourceMap } from 'magic-string';
3
+ import MagicString from 'magic-string';
4
+ import type { TransformResult } from 'rollup';
5
+ /**
6
+ * @ignore - this is the internal plugin factory function only used for the Vite plugin!
7
+ */
8
+ export declare function _rollupPluginInternal(userOptions: Options | undefined, buildTool: 'rollup' | 'vite', buildToolMajorVersion?: string): {
9
+ name: string;
10
+ buildStart?: undefined;
11
+ transform?: undefined;
12
+ renderChunk?: undefined;
13
+ writeBundle?: undefined;
14
+ } | {
15
+ name: string;
16
+ buildStart: () => void;
17
+ transform: (code: string, id: string) => Promise<TransformResult>;
18
+ renderChunk: (code: string, chunk: {
19
+ fileName: string;
20
+ facadeModuleId?: string | null;
21
+ }, _?: unknown, meta?: {
22
+ magicString?: MagicString;
23
+ }) => {
24
+ code: string;
25
+ map?: SourceMap;
26
+ } | null;
27
+ writeBundle: (outputOptions: {
28
+ dir?: string;
29
+ file?: string;
30
+ }, bundle: {
31
+ [fileName: string]: unknown;
32
+ }) => Promise<void>;
33
+ } | {
34
+ name: string;
35
+ buildStart: () => void;
36
+ renderChunk: (code: string, chunk: {
37
+ fileName: string;
38
+ facadeModuleId?: string | null;
39
+ }, _?: unknown, meta?: {
40
+ magicString?: MagicString;
41
+ }) => {
42
+ code: string;
43
+ map?: SourceMap;
44
+ } | null;
45
+ writeBundle: (outputOptions: {
46
+ dir?: string;
47
+ file?: string;
48
+ }, bundle: {
49
+ [fileName: string]: unknown;
50
+ }) => Promise<void>;
51
+ transform?: undefined;
52
+ };
53
+ export declare function sentryRollupPlugin(userOptions?: Options): any;
54
+ export type { Options as SentryRollupPluginOptions } from '../core';
55
+ export { sentryCliBinaryExists } from '../core';
56
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rollup/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAgBvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AA8B9C;;GAEG;AAEH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,OAAO,YAAK,EACzB,SAAS,EAAE,QAAQ,GAAG,MAAM,EAC5B,qBAAqB,CAAC,EAAE,MAAM;;;;;;;;sBA4DP,IAAI;sBAMI,MAAM,MAAM,MAAM,KAAG,OAAO,CAAC,eAAe,CAAC;wBAmBpE,MAAM,SACL;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,MACvD,OAAO,SACJ;QAAE,WAAW,CAAC,EAAE,WAAW,CAAA;KAAE,KACnC;QACD,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,SAAS,CAAC;KACjB,GAAG,IAAI;iCAgDS;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,UACtC;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,KACtC,OAAO,CAAC,IAAI,CAAC;;;sBAlFO,IAAI;wBAyBnB,MAAM,SACL;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,MACvD,OAAO,SACJ;QAAE,WAAW,CAAC,EAAE,WAAW,CAAA;KAAE,KACnC;QACD,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,SAAS,CAAC;KACjB,GAAG,IAAI;iCAgDS;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,UACtC;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,KACtC,OAAO,CAAC,IAAI,CAAC;;EAgDjB;AAGD,wBAAgB,kBAAkB,CAAC,WAAW,GAAE,OAAY,GAAG,GAAG,CAIjE;AAED,YAAY,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { SentryRollupPluginOptions } from '../rollup';
2
+ interface SentryVitePlugin {
3
+ name: string;
4
+ enforce: 'pre';
5
+ }
6
+ export declare const sentryVitePlugin: (options?: SentryRollupPluginOptions) => SentryVitePlugin[];
7
+ export type { Options as SentryVitePluginOptions } from '../core';
8
+ export { sentryCliBinaryExists } from '../core';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAI3D,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC;CAChB;AAgBD,eAAO,MAAM,gBAAgB,GAAI,UAAU,yBAAyB,KAAG,gBAAgB,EAOtF,CAAC;AAEF,YAAY,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ export default function transform(this: {
2
+ async: () => (err: Error | null, content?: string, sourceMap?: unknown) => void;
3
+ resourcePath: string;
4
+ query: {
5
+ transform?: (code: string, id: string) => Promise<{
6
+ code: string;
7
+ map?: unknown;
8
+ } | null | undefined | string>;
9
+ };
10
+ }, source: string, map: unknown): Promise<void>;
11
+ //# sourceMappingURL=component-annotation-transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-annotation-transform.d.ts","sourceRoot":"","sources":["../../../src/webpack/component-annotation-transform.ts"],"names":[],"mappings":"AAGA,wBAA8B,SAAS,CACrC,IAAI,EAAE;IACJ,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAChF,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE;QACL,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,CAAC,EAAE,OAAO,CAAA;SAAE,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,CAAC;KAChH,CAAC;CACH,EACD,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
@@ -0,0 +1,5 @@
1
+ import type { SentryWebpackPluginOptions } from './webpack4and5';
2
+ export declare const sentryWebpackPlugin: (options?: SentryWebpackPluginOptions) => any;
3
+ export { sentryCliBinaryExists } from '../core';
4
+ export type { SentryWebpackPluginOptions };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webpack/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AA+BjE,eAAO,MAAM,mBAAmB,EAAE,CAAC,OAAO,CAAC,EAAE,0BAA0B,KAAK,GAG1E,CAAC;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,YAAY,EAAE,0BAA0B,EAAE,CAAC"}
@@ -0,0 +1,99 @@
1
+ import type { Options } from '../core/index';
2
+ type UnsafeBannerPlugin = {
3
+ new (options: any): unknown;
4
+ };
5
+ type UnsafeDefinePlugin = {
6
+ new (options: any): unknown;
7
+ };
8
+ type WebpackModule = {
9
+ resource?: string;
10
+ };
11
+ type WebpackLoaderCallback = (err: Error | null, content?: string, sourceMap?: unknown) => void;
12
+ type WebpackLoaderContext = {
13
+ callback: WebpackLoaderCallback;
14
+ };
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;
30
+ };
31
+ };
32
+ };
33
+ type WebpackCompiler = {
34
+ options: {
35
+ plugins?: unknown[];
36
+ mode?: string;
37
+ module?: {
38
+ rules?: unknown[];
39
+ };
40
+ };
41
+ hooks: {
42
+ thisCompilation: {
43
+ tap: (name: string, callback: (compilation: WebpackCompilationContext) => void) => void;
44
+ };
45
+ afterEmit: {
46
+ tapAsync: (name: string, callback: (compilation: WebpackCompilation, cb: () => void) => void) => void;
47
+ };
48
+ done: {
49
+ tap: (name: string, callback: () => void) => void;
50
+ };
51
+ };
52
+ webpack?: {
53
+ BannerPlugin?: UnsafeBannerPlugin;
54
+ DefinePlugin?: UnsafeDefinePlugin;
55
+ };
56
+ };
57
+ type WebpackCompilation = {
58
+ outputOptions: {
59
+ path?: string;
60
+ };
61
+ assets: Record<string, unknown>;
62
+ hooks: {
63
+ processAssets: {
64
+ tap: (options: {
65
+ name: string;
66
+ stage: number;
67
+ }, callback: () => void) => void;
68
+ };
69
+ };
70
+ };
71
+ /**
72
+ * The factory function accepts BannerPlugin and DefinePlugin classes in
73
+ * order to avoid direct dependencies on webpack.
74
+ *
75
+ * This allow us to export version of the plugin for webpack 5.1+ and compatible environments.
76
+ *
77
+ * Since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version.
78
+ */
79
+ export declare function sentryWebpackPluginFactory({ BannerPlugin: UnsafeBannerPlugin, DefinePlugin: UnsafeDefinePlugin, }?: {
80
+ BannerPlugin?: UnsafeBannerPlugin;
81
+ DefinePlugin?: UnsafeDefinePlugin;
82
+ }): (userOptions?: SentryWebpackPluginOptions) => {
83
+ apply(compiler: WebpackCompiler): void;
84
+ };
85
+ export type SentryWebpackPluginOptions = Options & {
86
+ _experiments?: Options['_experiments'] & {
87
+ /**
88
+ * If enabled, the webpack plugin will exit the build process after the build completes.
89
+ * Use this with caution, as it will terminate the process.
90
+ *
91
+ * More information: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/345
92
+ *
93
+ * @default false
94
+ */
95
+ forceExitOnBuildCompletion?: boolean;
96
+ };
97
+ };
98
+ export {};
99
+ //# sourceMappingURL=webpack4and5.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack4and5.d.ts","sourceRoot":"","sources":["../../../src/webpack/webpack4and5.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,5 @@
1
+ import type { SentryWebpackPluginOptions } from './webpack4and5';
2
+ export declare const sentryWebpackPlugin: (options?: SentryWebpackPluginOptions) => any;
3
+ export { sentryCliBinaryExists } from '../core';
4
+ export type { SentryWebpackPluginOptions };
5
+ //# sourceMappingURL=webpack5.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack5.d.ts","sourceRoot":"","sources":["../../../src/webpack/webpack5.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAMjE,eAAO,MAAM,mBAAmB,EAAE,CAAC,OAAO,CAAC,EAAE,0BAA0B,KAAK,GAA+B,CAAC;AAE5G,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,YAAY,EAAE,0BAA0B,EAAE,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2020 Engineering at FullStory
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ *
24
+ */
25
+ export declare const KNOWN_INCOMPATIBLE_PLUGINS: string[];
26
+ export declare const DEFAULT_IGNORED_ELEMENTS: string[];
27
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,51 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2020 Engineering at FullStory
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ *
24
+ */
25
+ /**
26
+ * The following code is based on the FullStory Babel plugin, but has been modified to work
27
+ * with Sentry products:
28
+ *
29
+ * - Added `sentry` to data properties, i.e `data-sentry-component`
30
+ * - Converted to TypeScript
31
+ * - Code cleanups
32
+ * - Highly modified to inject the data attributes into the root HTML elements of a component.
33
+ */
34
+ import * as Babel from '@babel/core';
35
+ import { PluginObj, PluginPass } from '@babel/core';
36
+ interface AnnotationOpts {
37
+ native?: boolean;
38
+ ignoredComponents?: string[];
39
+ }
40
+ interface FragmentContext {
41
+ fragmentAliases: Set<string>;
42
+ reactNamespaceAliases: Set<string>;
43
+ }
44
+ interface AnnotationPluginPass extends PluginPass {
45
+ opts: AnnotationOpts;
46
+ sentryFragmentContext?: FragmentContext;
47
+ }
48
+ type AnnotationPlugin = PluginObj<AnnotationPluginPass>;
49
+ export declare function experimentalComponentNameAnnotatePlugin({ types: t }: typeof Babel): AnnotationPlugin;
50
+ export {};
51
+ //# sourceMappingURL=experimental.d.ts.map
@@ -0,0 +1,56 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2020 Engineering at FullStory
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ *
24
+ */
25
+ /**
26
+ * The following code is based on the FullStory Babel plugin, but has been modified to work
27
+ * with Sentry products:
28
+ *
29
+ * - Added `sentry` to data properties, i.e `data-sentry-component`
30
+ * - Converted to TypeScript
31
+ * - Code cleanups
32
+ */
33
+ import * as Babel from '@babel/core';
34
+ import { PluginObj, PluginPass } from '@babel/core';
35
+ interface AutoInjectSentryLabelOpts {
36
+ textComponentNames?: string[];
37
+ }
38
+ interface AnnotationOpts {
39
+ native?: boolean;
40
+ 'annotate-fragments'?: boolean;
41
+ ignoredComponents?: string[];
42
+ /** @hidden */
43
+ autoInjectSentryLabel?: boolean | AutoInjectSentryLabelOpts;
44
+ }
45
+ interface FragmentContext {
46
+ fragmentAliases: Set<string>;
47
+ reactNamespaceAliases: Set<string>;
48
+ }
49
+ interface AnnotationPluginPass extends PluginPass {
50
+ opts: AnnotationOpts;
51
+ sentryFragmentContext?: FragmentContext;
52
+ }
53
+ type AnnotationPlugin = PluginObj<AnnotationPluginPass>;
54
+ export { experimentalComponentNameAnnotatePlugin } from './experimental';
55
+ export default function componentNameAnnotatePlugin({ types: t }: typeof Babel): AnnotationPlugin;
56
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,82 @@
1
+ import { NormalizedOptions } from './options-mapping';
2
+ import { Logger } from './logger';
3
+ import { Options, SentrySDKBuildFlags } from './types';
4
+ /** @internal Exported for testing only. */
5
+ export declare function _resetDeployedReleasesForTesting(): void;
6
+ export type SentryBuildPluginManager = {
7
+ /**
8
+ * A logger instance that takes the options passed to the build plugin manager into account. (for silencing and log level etc.)
9
+ */
10
+ logger: Logger;
11
+ /**
12
+ * Options after normalization. Includes things like the inferred release name.
13
+ */
14
+ normalizedOptions: NormalizedOptions;
15
+ /**
16
+ * Magic strings and their replacement values that can be used for bundle size optimizations. This already takes
17
+ * into account the options passed to the build plugin manager.
18
+ */
19
+ bundleSizeOptimizationReplacementValues: SentrySDKBuildFlags;
20
+ /**
21
+ * Metadata that should be injected into bundles if possible. Takes into account options passed to the build plugin manager.
22
+ */
23
+ bundleMetadata: Record<string, unknown>;
24
+ /**
25
+ * Contains utility functions for emitting telemetry via the build plugin manager.
26
+ */
27
+ telemetry: {
28
+ /**
29
+ * Emits a `Sentry Bundler Plugin execution` signal.
30
+ */
31
+ emitBundlerPluginExecutionSignal(): Promise<void>;
32
+ };
33
+ /**
34
+ * Will potentially create a release based on the build plugin manager options.
35
+ *
36
+ * Also
37
+ * - finalizes the release
38
+ * - sets commits
39
+ * - uploads legacy sourcemaps
40
+ * - adds deploy information
41
+ */
42
+ createRelease(): Promise<void>;
43
+ /**
44
+ * Injects debug IDs into the build artifacts.
45
+ *
46
+ * This is a separate function from `uploadSourcemaps` because that needs to run before the sourcemaps are uploaded.
47
+ * Usually the respective bundler-plugin will take care of this before the sourcemaps are uploaded.
48
+ * Only use this if you need to manually inject debug IDs into the build artifacts.
49
+ */
50
+ injectDebugIds(buildArtifactPaths: string[]): Promise<void>;
51
+ /**
52
+ * Uploads sourcemaps using the "Debug ID" method. This function takes a list of build artifact paths that will be uploaded
53
+ */
54
+ uploadSourcemaps(buildArtifactPaths: string[], opts?: {
55
+ prepareArtifacts?: boolean;
56
+ }): Promise<void>;
57
+ /**
58
+ * Will delete artifacts based on the passed `sourcemaps.filesToDeleteAfterUpload` option.
59
+ */
60
+ deleteArtifacts(): Promise<void>;
61
+ createDependencyOnBuildArtifacts: () => () => void;
62
+ };
63
+ /**
64
+ * Creates a build plugin manager that exposes primitives for everything that a Sentry JavaScript SDK or build tooling may do during a build.
65
+ *
66
+ * The build plugin manager's behavior strongly depends on the options that are passed in.
67
+ */
68
+ export declare function createSentryBuildPluginManager(userOptions: Options, bundlerPluginMetaContext: {
69
+ /**
70
+ * E.g. `webpack` or `nextjs` or `turbopack`
71
+ */
72
+ buildTool: string;
73
+ /**
74
+ * E.g. `5` for webpack v5 or `4` for Rollup v4
75
+ */
76
+ buildToolMajorVersion?: string;
77
+ /**
78
+ * E.g. `[sentry-webpack-plugin]` or `[@sentry/nextjs]`
79
+ */
80
+ loggerPrefix: string;
81
+ }): SentryBuildPluginManager;
82
+ //# sourceMappingURL=build-plugin-manager.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { SentryBuildPluginManager } from './build-plugin-manager';
2
+ import { Logger } from './logger';
3
+ import { ResolveSourceMapHook, RewriteSourcesHook } from './types';
4
+ interface DebugIdUploadPluginOptions {
5
+ sentryBuildPluginManager: SentryBuildPluginManager;
6
+ }
7
+ export declare function createDebugIdUploadFunction({ sentryBuildPluginManager }: DebugIdUploadPluginOptions): (buildArtifactPaths: string[]) => Promise<void>;
8
+ export declare function prepareBundleForDebugIdUpload(bundleFilePath: string, uploadFolder: string, chunkIndex: number, logger: Logger, rewriteSourcesHook: RewriteSourcesHook, resolveSourceMapHook: ResolveSourceMapHook | undefined): Promise<void>;
9
+ /**
10
+ * Applies a set of heuristics to find the source map for a particular bundle.
11
+ *
12
+ * @returns the path to the bundle's source map or `undefined` if none could be found.
13
+ */
14
+ export declare function determineSourceMapPathFromBundle(bundlePath: string, bundleSource: string, logger: Logger, resolveSourceMapHook: ResolveSourceMapHook | undefined): Promise<string | undefined>;
15
+ export declare function defaultRewriteSourcesHook(source: string): string;
16
+ export {};
17
+ //# sourceMappingURL=debug-id-upload.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare function globFiles(patterns: string | string[], options?: {
2
+ root?: string;
3
+ ignore?: string | string[];
4
+ }): Promise<string[]>;
5
+ //# sourceMappingURL=glob.d.ts.map
@@ -0,0 +1,53 @@
1
+ import { CodeInjection } from './utils';
2
+ /**
3
+ * Determines whether the Sentry CLI binary is in its expected location.
4
+ * This function is useful since `@sentry/cli` installs the binary via a post-install
5
+ * script and post-install scripts may not always run. E.g. with `npm i --ignore-scripts`.
6
+ */
7
+ export declare function sentryCliBinaryExists(): boolean;
8
+ export declare const COMMENT_USE_STRICT_REGEX: RegExp;
9
+ /**
10
+ * Checks if a file is a JavaScript file based on its extension.
11
+ * Handles query strings and hashes in the filename.
12
+ */
13
+ export declare function isJsFile(fileName: string): boolean;
14
+ /**
15
+ * Checks if a chunk should be skipped for code injection
16
+ *
17
+ * This is necessary to handle Vite's MPA (multi-page application) mode where
18
+ * HTML entry points create "facade" chunks that should not contain injected code.
19
+ * See: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/829
20
+ *
21
+ * However, in SPA mode, the main bundle also has an HTML facade but contains
22
+ * substantial application code. We should NOT skip injection for these bundles.
23
+ *
24
+ * @param code - The chunk's code content
25
+ * @param facadeModuleId - The facade module ID (if any) - HTML files create facade chunks
26
+ * @returns true if the chunk should be skipped
27
+ */
28
+ export declare function shouldSkipCodeInjection(code: string, facadeModuleId: string | null | undefined): boolean;
29
+ export { globFiles } from './glob';
30
+ export declare function createComponentNameAnnotateHooks(ignoredComponents: string[], injectIntoHtml: boolean): {
31
+ transform(this: void, code: string, id: string): Promise<{
32
+ code: string;
33
+ map: {
34
+ version: number;
35
+ sources: string[];
36
+ names: string[];
37
+ sourceRoot?: string | undefined;
38
+ sourcesContent?: string[] | undefined;
39
+ mappings: string;
40
+ file: string;
41
+ } | null | undefined;
42
+ } | {
43
+ code: string;
44
+ map?: undefined;
45
+ } | null>;
46
+ };
47
+ export declare function getDebugIdSnippet(debugId: string): CodeInjection;
48
+ export { Logger } from './logger';
49
+ export { Options, SentrySDKBuildFlags } from './types';
50
+ export { CodeInjection, replaceBooleanFlagsInCode, stringToUUID, generateReleaseInjectorCode, generateModuleMetadataInjectorCode, } from './utils';
51
+ export { createSentryBuildPluginManager } from './build-plugin-manager';
52
+ export { createDebugIdUploadFunction } from './debug-id-upload';
53
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,14 @@
1
+ interface LoggerOptions {
2
+ silent: boolean;
3
+ debug: boolean;
4
+ prefix: string;
5
+ }
6
+ export type Logger = {
7
+ info(message: string, ...params: unknown[]): void;
8
+ warn(message: string, ...params: unknown[]): void;
9
+ error(message: string, ...params: unknown[]): void;
10
+ debug(message: string, ...params: unknown[]): void;
11
+ };
12
+ export declare function createLogger(options: LoggerOptions): Logger;
13
+ export {};
14
+ //# sourceMappingURL=logger.d.ts.map