@sentry/bundler-plugins 11.9.0 → 11.11.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.
- package/README.md +5 -1
- package/build/cjs/bun/index.js +126 -0
- package/build/cjs/bun/index.js.map +1 -0
- package/build/cjs/core/build-plugin-manager.js +165 -33
- package/build/cjs/core/build-plugin-manager.js.map +1 -1
- package/build/cjs/core/component-annotation-oxc.js +1 -1
- package/build/cjs/core/debug-id-upload.js +64 -55
- package/build/cjs/core/debug-id-upload.js.map +1 -1
- package/build/cjs/core/index.js +2 -0
- package/build/cjs/core/index.js.map +1 -1
- package/build/cjs/core/options-mapping.js +6 -0
- package/build/cjs/core/options-mapping.js.map +1 -1
- package/build/cjs/core/sentry/telemetry.js +4 -0
- package/build/cjs/core/sentry/telemetry.js.map +1 -1
- package/build/cjs/core/sentry/transports.js +3 -3
- package/build/cjs/core/sentry/transports.js.map +1 -1
- package/build/cjs/core/sourcemap-settings.js +63 -0
- package/build/cjs/core/sourcemap-settings.js.map +1 -0
- package/build/cjs/core/utils.js +1 -1
- package/build/cjs/core/version.js +1 -1
- package/build/cjs/core/version.js.map +1 -1
- package/build/cjs/esbuild/index.js +2 -2
- package/build/cjs/esbuild/index.js.map +1 -1
- package/build/cjs/rollup/index.js +1 -1
- package/build/esm/bun/index.js +109 -0
- package/build/esm/bun/index.js.map +1 -0
- package/build/esm/core/build-plugin-manager.js +166 -34
- package/build/esm/core/build-plugin-manager.js.map +1 -1
- package/build/esm/core/debug-id-upload.js +62 -56
- package/build/esm/core/debug-id-upload.js.map +1 -1
- package/build/esm/core/index.js +1 -0
- package/build/esm/core/index.js.map +1 -1
- package/build/esm/core/options-mapping.js +6 -0
- package/build/esm/core/options-mapping.js.map +1 -1
- package/build/esm/core/sentry/telemetry.js +4 -0
- package/build/esm/core/sentry/telemetry.js.map +1 -1
- package/build/esm/core/sourcemap-settings.js +61 -0
- package/build/esm/core/sourcemap-settings.js.map +1 -0
- package/build/esm/core/version.js +1 -1
- package/build/esm/core/version.js.map +1 -1
- package/build/esm/esbuild/index.js +2 -2
- package/build/esm/esbuild/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/types/bun/index.d.ts +25 -0
- package/build/types/bun/index.d.ts.map +1 -0
- package/build/types/core/build-plugin-manager.d.ts +57 -1
- package/build/types/core/build-plugin-manager.d.ts.map +1 -1
- package/build/types/core/debug-id-upload.d.ts +38 -2
- package/build/types/core/debug-id-upload.d.ts.map +1 -1
- package/build/types/core/index.d.ts +3 -0
- package/build/types/core/index.d.ts.map +1 -1
- package/build/types/core/options-mapping.d.ts +1 -0
- package/build/types/core/options-mapping.d.ts.map +1 -1
- package/build/types/core/sentry/telemetry.d.ts.map +1 -1
- package/build/types/core/sourcemap-settings.d.ts +28 -0
- package/build/types/core/sourcemap-settings.d.ts.map +1 -0
- package/build/types/core/types.d.ts +11 -0
- package/build/types/core/types.d.ts.map +1 -1
- package/build/types/core/version.d.ts +1 -1
- package/build/types/core/version.d.ts.map +1 -1
- package/build/types/esbuild/index.d.ts.map +1 -1
- package/package.json +12 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/esbuild/index.ts"],"sourcesContent":["import type { Options } from '../core';\nimport {\n createSentryBuildPluginManager,\n generateReleaseInjectorCode,\n generateModuleMetadataInjectorCode,\n getDebugIdSnippet,\n createDebugIdUploadFunction,\n CodeInjection,\n addDebugIdToEmittedArtifacts,\n isJsFile,\n} from '../core';\nimport * as path from 'node:path';\nimport { createRequire } from 'node:module';\nimport { randomUUID } from 'node:crypto';\n\ninterface EsbuildOnResolveArgs {\n path: string;\n kind: string;\n importer?: string;\n resolveDir: string;\n pluginData?: unknown;\n}\n\ninterface EsbuildOnResolveResult {\n path: string;\n sideEffects?: boolean;\n pluginName?: string;\n namespace?: string;\n suffix?: string;\n pluginData?: unknown;\n}\n\ninterface EsbuildOnLoadArgs {\n path: string;\n pluginData?: unknown;\n}\n\ninterface EsbuildOnLoadResult {\n loader: string;\n pluginName: string;\n contents: string;\n resolveDir?: string;\n}\n\ninterface EsbuildOnEndArgs {\n metafile?: {\n outputs: Record<string, unknown>;\n };\n}\n\ninterface EsbuildInitialOptions {\n bundle?: boolean;\n inject?: string[];\n metafile?: boolean;\n define?: Record<string, string>;\n write?: boolean;\n absWorkingDir?: string;\n}\n\ninterface EsbuildPluginBuild {\n initialOptions: EsbuildInitialOptions;\n onLoad: (\n options: { filter: RegExp; namespace?: string },\n callback: (args: EsbuildOnLoadArgs) => EsbuildOnLoadResult | null,\n ) => void;\n onResolve: (\n options: { filter: RegExp },\n callback: (args: EsbuildOnResolveArgs) => EsbuildOnResolveResult | undefined,\n ) => void;\n onEnd: (callback: (result: EsbuildOnEndArgs) => void | Promise<void>) => void;\n}\n\nfunction getEsbuildMajorVersion(): string | undefined {\n try {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - esbuild transpiles this for us\n const req = createRequire(import.meta.url);\n const esbuild = req('esbuild') as { version?: string };\n // esbuild hasn't released a v1 yet, so we'll return the minor version as the major version\n return esbuild.version?.split('.')[1];\n } catch {\n // do nothing, we'll just not report a version\n }\n\n return undefined;\n}\n\nconst pluginName = 'sentry-esbuild-plugin';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function sentryEsbuildPlugin(userOptions: Options = {}): any {\n const sentryBuildPluginManager = createSentryBuildPluginManager(userOptions, {\n loggerPrefix: userOptions._metaOptions?.loggerPrefixOverride ?? `[${pluginName}]`,\n buildTool: 'esbuild',\n buildToolMajorVersion: getEsbuildMajorVersion(),\n });\n\n const {\n logger,\n normalizedOptions: options,\n bundleSizeOptimizationReplacementValues: replacementValues,\n bundleMetadata,\n createDependencyOnBuildArtifacts,\n } = sentryBuildPluginManager;\n\n if (options.disable) {\n return {\n name: 'sentry-esbuild-noop-plugin',\n setup() {\n // noop plugin\n },\n };\n }\n\n if (process.cwd().match(/\\\\node_modules\\\\|\\/node_modules\\//)) {\n logger.warn('Running Sentry plugin from within a `node_modules` folder. Some features may not work.');\n }\n\n const sourcemapsEnabled = options.sourcemaps?.disable !== true;\n const staticInjectionCode = new CodeInjection();\n\n if (!options.release.inject) {\n logger.debug('Release injection disabled via `release.inject` option. Will not inject release.');\n } else if (!options.release.name) {\n logger.debug(\n 'No release name provided. Will not inject release. Please set the `release.name` option to identify your release.',\n );\n } else {\n staticInjectionCode.append(\n generateReleaseInjectorCode({\n release: options.release.name,\n injectBuildInformation: options._experiments.injectBuildInformation || false,\n }),\n );\n }\n\n if (Object.keys(bundleMetadata).length > 0) {\n staticInjectionCode.append(generateModuleMetadataInjectorCode(bundleMetadata));\n }\n\n // Component annotation warning\n if (options.reactComponentAnnotation?.enabled) {\n logger.warn(\n 'Component name annotation is not supported in esbuild. Please use a separate transform step or consider using a different bundler.',\n );\n }\n\n const transformReplace = Object.keys(replacementValues).length > 0;\n\n // Track entry points wrapped for debug ID injection\n const debugIdWrappedPaths = new Set<string>();\n\n void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal().catch(() => {\n // Telemetry failures are acceptable\n });\n\n return {\n name: pluginName,\n setup({ initialOptions, onLoad, onResolve, onEnd }: EsbuildPluginBuild) {\n // Release and/or metadata injection\n if (!staticInjectionCode.isEmpty()) {\n const virtualInjectionFilePath = path.resolve('_sentry-injection-stub');\n initialOptions.inject = initialOptions.inject || [];\n // esbuild emits injected files after an entry's directive prologue. A banner would precede\n // \"use strict\" and turn it into an ordinary string expression.\n initialOptions.inject.push(virtualInjectionFilePath);\n\n onResolve({ filter: /_sentry-injection-stub/ }, args => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n };\n });\n\n onLoad({ filter: /_sentry-injection-stub/ }, () => {\n return {\n loader: 'js',\n pluginName,\n contents: staticInjectionCode.code(),\n };\n });\n }\n\n // Bundle size optimizations\n if (transformReplace) {\n const replacementStringValues: Record<string, string> = {};\n Object.entries(replacementValues).forEach(([key, value]) => {\n replacementStringValues[key] = JSON.stringify(value);\n });\n\n initialOptions.define = { ...initialOptions.define, ...replacementStringValues };\n }\n\n // Debug ID injection - requires per-entry-point unique IDs\n if (sourcemapsEnabled) {\n // Clear state from previous builds (important for watch mode and test suites)\n debugIdWrappedPaths.clear();\n\n if (!initialOptions.bundle) {\n logger.warn(\n 'The Sentry esbuild plugin only supports esbuild with `bundle: true` being set in the esbuild build options. Esbuild will probably crash now. Sorry about that. If you need to upload sourcemaps without `bundle: true`, it is recommended to use Sentry CLI instead: https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/',\n );\n }\n\n // Wrap entry points to inject debug IDs\n onResolve({ filter: /.*/ }, args => {\n if (args.kind !== 'entry-point') {\n return;\n }\n\n // Skip injecting debug IDs into modules specified in the esbuild `inject` option\n // since they're already part of the entry points\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n const resolvedPath = path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path);\n\n // Skip injecting debug IDs into paths that have already been wrapped\n if (debugIdWrappedPaths.has(resolvedPath)) {\n return;\n }\n debugIdWrappedPaths.add(resolvedPath);\n\n return {\n pluginName,\n path: resolvedPath,\n pluginData: {\n isDebugIdProxy: true,\n originalPath: args.path,\n originalResolveDir: args.resolveDir,\n },\n // We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse\n // the module tree any further down past the proxy module because we're essentially creating a dependency\n // loop back to the proxy module.\n // By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,\n // making it re-resolve the entrypoint when it is imported from the proxy module.\n // Super confusing? Yes. Works? Apparently... Let's see.\n suffix: '?sentryDebugIdProxy=true',\n };\n });\n\n onLoad({ filter: /.*/ }, args => {\n if (!(args.pluginData as { isDebugIdProxy?: boolean })?.isDebugIdProxy) {\n return null;\n }\n\n const originalPath = (args.pluginData as { originalPath: string }).originalPath;\n const originalResolveDir = (args.pluginData as { originalResolveDir: string }).originalResolveDir;\n\n return {\n loader: 'js',\n pluginName,\n contents: `\n import \"_sentry-debug-id-injection-stub\";\n import * as OriginalModule from ${JSON.stringify(originalPath)};\n export default OriginalModule.default;\n export * from ${JSON.stringify(originalPath)};`,\n resolveDir: originalResolveDir,\n };\n });\n\n onResolve({ filter: /_sentry-debug-id-injection-stub/ }, args => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n namespace: 'sentry-debug-id-stub',\n suffix: `?sentry-module-id=${randomUUID()}`,\n };\n });\n\n onLoad({ filter: /_sentry-debug-id-injection-stub/, namespace: 'sentry-debug-id-stub' }, () => {\n return {\n loader: 'js',\n pluginName,\n contents: getDebugIdSnippet(randomUUID()).code(),\n };\n });\n }\n\n // Create release and optionally upload\n const freeGlobalDependencyOnBuildArtifacts = createDependencyOnBuildArtifacts();\n const upload = createDebugIdUploadFunction({ sentryBuildPluginManager });\n\n initialOptions.metafile = true;\n onEnd(async result => {\n try {\n await sentryBuildPluginManager.createRelease();\n\n if (sourcemapsEnabled) {\n const buildArtifacts = result.metafile ? Object.keys(result.metafile.outputs) : [];\n\n if (options.sourcemaps?.disable !== 'disable-upload') {\n await upload(buildArtifacts);\n } else if (initialOptions.write === false) {\n logger.debug('Build output is not written to disk. Skipping debug ID injection into build artifacts.');\n } else {\n // The upload routine (which stamps debug IDs into temp copies of the artifacts) is\n // skipped with `disable-upload`. esbuild has no hook to modify outputs before they are\n // written, so the emitted artifacts get stamped on disk instead.\n const outputDir = initialOptions.absWorkingDir ?? process.cwd();\n await Promise.all(\n buildArtifacts\n .filter(isJsFile)\n .map(bundle =>\n addDebugIdToEmittedArtifacts(\n path.resolve(outputDir, bundle),\n logger,\n options.sourcemaps?.resolveSourceMap,\n ),\n ),\n );\n }\n }\n } finally {\n freeGlobalDependencyOnBuildArtifacts();\n await sentryBuildPluginManager.deleteArtifacts();\n }\n });\n },\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default sentryEsbuildPlugin;\nexport type { Options as SentryEsbuildPluginOptions } from '../core';\n"],"names":[],"mappings":";;;;;;;;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AAA,MAAA,CAAO,MAAM,wFAAwF,CAAA;AAAA,YACvG,CAAA,MAAO;AAIL,cAAA,MAAM,SAAA,GAAY,cAAA,CAAe,aAAA,IAAiB,OAAA,CAAQ,GAAA,EAAI;AAC9D,cAAA,MAAM,OAAA,CAAQ,GAAA;AAAA,gBACZ,cAAA,CACG,MAAA,CAAO,QAAQ,CAAA,CACf,GAAA;AAAA,kBAAI,CAAA,MAAA,KACH,4BAAA;AAAA,oBACE,IAAA,CAAK,OAAA,CAAQ,SAAA,EAAW,MAAM,CAAA;AAAA,oBAC9B,MAAA;AAAA,oBACA,QAAQ,UAAA,EAAY;AAAA;AACtB;AACF,eACJ;AAAA,YACF;AAAA,UACF;AAAA,QACF,CAAA,SAAE;AACA,UAAA,oCAAA,EAAqC;AACrC,UAAA,MAAM,yBAAyB,eAAA,EAAgB;AAAA,QACjD;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/esbuild/index.ts"],"sourcesContent":["import type { Options } from '../core';\nimport {\n createSentryBuildPluginManager,\n generateReleaseInjectorCode,\n generateModuleMetadataInjectorCode,\n getDebugIdSnippet,\n createDebugIdUploadFunction,\n CodeInjection,\n addDebugIdToEmittedArtifacts,\n isJsFile,\n} from '../core';\nimport * as path from 'node:path';\nimport { createRequire } from 'node:module';\nimport { randomUUID } from 'node:crypto';\n\ninterface EsbuildOnResolveArgs {\n path: string;\n kind: string;\n importer?: string;\n resolveDir: string;\n pluginData?: unknown;\n}\n\ninterface EsbuildOnResolveResult {\n path: string;\n sideEffects?: boolean;\n pluginName?: string;\n namespace?: string;\n suffix?: string;\n pluginData?: unknown;\n}\n\ninterface EsbuildOnLoadArgs {\n path: string;\n pluginData?: unknown;\n}\n\ninterface EsbuildOnLoadResult {\n loader: string;\n pluginName: string;\n contents: string;\n resolveDir?: string;\n}\n\ninterface EsbuildOnEndArgs {\n metafile?: {\n outputs: Record<string, unknown>;\n };\n}\n\ninterface EsbuildInitialOptions {\n bundle?: boolean;\n inject?: string[];\n metafile?: boolean;\n define?: Record<string, string>;\n write?: boolean;\n absWorkingDir?: string;\n}\n\ninterface EsbuildPluginBuild {\n initialOptions: EsbuildInitialOptions;\n onLoad: (\n options: { filter: RegExp; namespace?: string },\n callback: (args: EsbuildOnLoadArgs) => EsbuildOnLoadResult | null,\n ) => void;\n onResolve: (\n options: { filter: RegExp },\n callback: (args: EsbuildOnResolveArgs) => EsbuildOnResolveResult | undefined,\n ) => void;\n onStart: (callback: () => void) => void;\n onEnd: (callback: (result: EsbuildOnEndArgs) => void | Promise<void>) => void;\n}\n\nfunction getEsbuildMajorVersion(): string | undefined {\n try {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - esbuild transpiles this for us\n const req = createRequire(import.meta.url);\n const esbuild = req('esbuild') as { version?: string };\n // esbuild hasn't released a v1 yet, so we'll return the minor version as the major version\n return esbuild.version?.split('.')[1];\n } catch {\n // do nothing, we'll just not report a version\n }\n\n return undefined;\n}\n\nconst pluginName = 'sentry-esbuild-plugin';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function sentryEsbuildPlugin(userOptions: Options = {}): any {\n const sentryBuildPluginManager = createSentryBuildPluginManager(userOptions, {\n loggerPrefix: userOptions._metaOptions?.loggerPrefixOverride ?? `[${pluginName}]`,\n buildTool: 'esbuild',\n buildToolMajorVersion: getEsbuildMajorVersion(),\n });\n\n const {\n logger,\n normalizedOptions: options,\n bundleSizeOptimizationReplacementValues: replacementValues,\n bundleMetadata,\n createDependencyOnBuildArtifacts,\n } = sentryBuildPluginManager;\n\n if (options.disable) {\n return {\n name: 'sentry-esbuild-noop-plugin',\n setup() {\n // noop plugin\n },\n };\n }\n\n if (process.cwd().match(/\\\\node_modules\\\\|\\/node_modules\\//)) {\n logger.warn('Running Sentry plugin from within a `node_modules` folder. Some features may not work.');\n }\n\n const sourcemapsEnabled = options.sourcemaps?.disable !== true;\n const staticInjectionCode = new CodeInjection();\n\n if (!options.release.inject) {\n logger.debug('Release injection disabled via `release.inject` option. Will not inject release.');\n } else if (!options.release.name) {\n logger.debug(\n 'No release name provided. Will not inject release. Please set the `release.name` option to identify your release.',\n );\n } else {\n staticInjectionCode.append(\n generateReleaseInjectorCode({\n release: options.release.name,\n injectBuildInformation: options._experiments.injectBuildInformation || false,\n }),\n );\n }\n\n if (Object.keys(bundleMetadata).length > 0) {\n staticInjectionCode.append(generateModuleMetadataInjectorCode(bundleMetadata));\n }\n\n // Component annotation warning\n if (options.reactComponentAnnotation?.enabled) {\n logger.warn(\n 'Component name annotation is not supported in esbuild. Please use a separate transform step or consider using a different bundler.',\n );\n }\n\n const transformReplace = Object.keys(replacementValues).length > 0;\n\n // Track entry points wrapped for debug ID injection\n const debugIdWrappedPaths = new Set<string>();\n\n void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal().catch(() => {\n // Telemetry failures are acceptable\n });\n\n return {\n name: pluginName,\n setup({ initialOptions, onLoad, onResolve, onStart, onEnd }: EsbuildPluginBuild) {\n // Release and/or metadata injection\n if (!staticInjectionCode.isEmpty()) {\n const virtualInjectionFilePath = path.resolve('_sentry-injection-stub');\n initialOptions.inject = initialOptions.inject || [];\n // esbuild emits injected files after an entry's directive prologue. A banner would precede\n // \"use strict\" and turn it into an ordinary string expression.\n initialOptions.inject.push(virtualInjectionFilePath);\n\n onResolve({ filter: /_sentry-injection-stub/ }, args => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n };\n });\n\n onLoad({ filter: /_sentry-injection-stub/ }, () => {\n return {\n loader: 'js',\n pluginName,\n contents: staticInjectionCode.code(),\n };\n });\n }\n\n // Bundle size optimizations\n if (transformReplace) {\n const replacementStringValues: Record<string, string> = {};\n Object.entries(replacementValues).forEach(([key, value]) => {\n replacementStringValues[key] = JSON.stringify(value);\n });\n\n initialOptions.define = { ...initialOptions.define, ...replacementStringValues };\n }\n\n // Debug ID injection - requires per-entry-point unique IDs\n if (sourcemapsEnabled) {\n // `setup` runs once per context, `onStart` once per build, so a\n // rebuild wraps the entry points again.\n onStart(() => debugIdWrappedPaths.clear());\n\n if (!initialOptions.bundle) {\n logger.warn(\n 'The Sentry esbuild plugin only supports esbuild with `bundle: true` being set in the esbuild build options. Esbuild will probably crash now. Sorry about that. If you need to upload sourcemaps without `bundle: true`, it is recommended to use Sentry CLI instead: https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/',\n );\n }\n\n // Wrap entry points to inject debug IDs\n onResolve({ filter: /.*/ }, args => {\n if (args.kind !== 'entry-point') {\n return;\n }\n\n // Skip injecting debug IDs into modules specified in the esbuild `inject` option\n // since they're already part of the entry points\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n const resolvedPath = path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path);\n\n // Skip injecting debug IDs into paths that have already been wrapped\n if (debugIdWrappedPaths.has(resolvedPath)) {\n return;\n }\n debugIdWrappedPaths.add(resolvedPath);\n\n return {\n pluginName,\n path: resolvedPath,\n pluginData: {\n isDebugIdProxy: true,\n originalPath: args.path,\n originalResolveDir: args.resolveDir,\n },\n // We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse\n // the module tree any further down past the proxy module because we're essentially creating a dependency\n // loop back to the proxy module.\n // By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,\n // making it re-resolve the entrypoint when it is imported from the proxy module.\n // Super confusing? Yes. Works? Apparently... Let's see.\n suffix: '?sentryDebugIdProxy=true',\n };\n });\n\n onLoad({ filter: /.*/ }, args => {\n if (!(args.pluginData as { isDebugIdProxy?: boolean })?.isDebugIdProxy) {\n return null;\n }\n\n const originalPath = (args.pluginData as { originalPath: string }).originalPath;\n const originalResolveDir = (args.pluginData as { originalResolveDir: string }).originalResolveDir;\n\n return {\n loader: 'js',\n pluginName,\n contents: `\n import \"_sentry-debug-id-injection-stub\";\n import * as OriginalModule from ${JSON.stringify(originalPath)};\n export default OriginalModule.default;\n export * from ${JSON.stringify(originalPath)};`,\n resolveDir: originalResolveDir,\n };\n });\n\n onResolve({ filter: /_sentry-debug-id-injection-stub/ }, args => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n namespace: 'sentry-debug-id-stub',\n suffix: `?sentry-module-id=${randomUUID()}`,\n };\n });\n\n onLoad({ filter: /_sentry-debug-id-injection-stub/, namespace: 'sentry-debug-id-stub' }, () => {\n return {\n loader: 'js',\n pluginName,\n contents: getDebugIdSnippet(randomUUID()).code(),\n };\n });\n }\n\n // Create release and optionally upload\n const freeGlobalDependencyOnBuildArtifacts = createDependencyOnBuildArtifacts();\n const upload = createDebugIdUploadFunction({ sentryBuildPluginManager });\n\n initialOptions.metafile = true;\n onEnd(async result => {\n try {\n await sentryBuildPluginManager.createRelease();\n\n if (sourcemapsEnabled) {\n const buildArtifacts = result.metafile ? Object.keys(result.metafile.outputs) : [];\n\n if (options.sourcemaps?.disable !== 'disable-upload') {\n await upload(buildArtifacts);\n } else if (initialOptions.write === false) {\n logger.debug('Build output is not written to disk. Skipping debug ID injection into build artifacts.');\n } else {\n // The upload routine (which stamps debug IDs into temp copies of the artifacts) is\n // skipped with `disable-upload`. esbuild has no hook to modify outputs before they are\n // written, so the emitted artifacts get stamped on disk instead.\n const outputDir = initialOptions.absWorkingDir ?? process.cwd();\n await Promise.all(\n buildArtifacts\n .filter(isJsFile)\n .map(bundle =>\n addDebugIdToEmittedArtifacts(\n path.resolve(outputDir, bundle),\n logger,\n options.sourcemaps?.resolveSourceMap,\n ),\n ),\n );\n }\n }\n } finally {\n freeGlobalDependencyOnBuildArtifacts();\n await sentryBuildPluginManager.deleteArtifacts();\n }\n });\n },\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default sentryEsbuildPlugin;\nexport type { Options as SentryEsbuildPluginOptions } from '../core';\n"],"names":[],"mappings":";;;;;;;;AAyEA,SAAS,sBAAA,GAA6C;AACpD,EAAA,IAAI;AAGF,IAAA,MAAM,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CAAA;AAAA,YACvG,CAAA,MAAO;AAIL,cAAA,MAAM,SAAA,GAAY,cAAA,CAAe,aAAA,IAAiB,OAAA,CAAQ,GAAA,EAAI;AAC9D,cAAA,MAAM,OAAA,CAAQ,GAAA;AAAA,gBACZ,cAAA,CACG,MAAA,CAAO,QAAQ,CAAA,CACf,GAAA;AAAA,kBAAI,CAAA,MAAA,KACH,4BAAA;AAAA,oBACE,IAAA,CAAK,OAAA,CAAQ,SAAA,EAAW,MAAM,CAAA;AAAA,oBAC9B,MAAA;AAAA,oBACA,QAAQ,UAAA,EAAY;AAAA;AACtB;AACF,eACJ;AAAA,YACF;AAAA,UACF;AAAA,QACF,CAAA,SAAE;AACA,UAAA,oCAAA,EAAqC;AACrC,UAAA,MAAM,yBAAyB,eAAA,EAAgB;AAAA,QACjD;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"11.
|
|
1
|
+
{"type":"module","version":"11.11.0","sideEffects":["./sentry-release-injection-file.js","./sentry-esbuild-debugid-injection-file.js"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Options } from '../core';
|
|
2
|
+
interface BunBuildArtifact {
|
|
3
|
+
path: string;
|
|
4
|
+
kind: string;
|
|
5
|
+
}
|
|
6
|
+
interface BunBuildConfig {
|
|
7
|
+
banner?: string;
|
|
8
|
+
sourcemap?: 'none' | 'linked' | 'inline' | 'external' | boolean;
|
|
9
|
+
outdir?: string;
|
|
10
|
+
define?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
interface BunPluginBuilder {
|
|
13
|
+
config?: BunBuildConfig;
|
|
14
|
+
onEnd: (callback: (result: {
|
|
15
|
+
outputs: BunBuildArtifact[];
|
|
16
|
+
}) => void | Promise<void>) => void;
|
|
17
|
+
}
|
|
18
|
+
interface BunPlugin {
|
|
19
|
+
name: string;
|
|
20
|
+
setup: (build: BunPluginBuilder) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function sentryBunPlugin(userOptions?: Options): BunPlugin;
|
|
23
|
+
export default sentryBunPlugin;
|
|
24
|
+
export type { Options as SentryBunPluginOptions } from '../core';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bun/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAWvC,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,UAAU,gBAAgB;IAExB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,gBAAgB,EAAE,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CAC9F;AAED,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC1C;AAiBD,wBAAgB,eAAe,CAAC,WAAW,GAAE,OAAY,GAAG,SAAS,CAoHpE;eAEc,eAAe;AAC9B,YAAY,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,8 +1,45 @@
|
|
|
1
1
|
import type { NormalizedOptions } from './options-mapping';
|
|
2
2
|
import type { Logger } from './logger';
|
|
3
3
|
import type { Options, SentrySDKBuildFlags } from './types';
|
|
4
|
+
import type { SourceMapDecision, SourceMapKind } from './sourcemap-settings';
|
|
4
5
|
/** @internal Exported for testing only. */
|
|
5
6
|
export declare function _resetDeployedReleasesForTesting(): void;
|
|
7
|
+
/**
|
|
8
|
+
* A temporary folder that build artifacts are written into straight from the bundler's output,
|
|
9
|
+
* before the bundler writes them to disk. The upload reads from this folder, so the bundler can
|
|
10
|
+
* drop the source map assets from its own output.
|
|
11
|
+
*/
|
|
12
|
+
export type UploadStaging = {
|
|
13
|
+
readonly dir: string;
|
|
14
|
+
/** Number of artifacts written so far. */
|
|
15
|
+
readonly count: number;
|
|
16
|
+
/**
|
|
17
|
+
* Absolute paths of the chunks staged so far (`mapDir` joined with the file name). The upload
|
|
18
|
+
* does not prepare these again from disk, where a stale map of an earlier build could sit
|
|
19
|
+
* next to them.
|
|
20
|
+
*/
|
|
21
|
+
readonly stagedChunkPaths: ReadonlySet<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Stamps the debug ID into the chunk and its source map and writes both into the folder.
|
|
24
|
+
*
|
|
25
|
+
* `mapSource` is `undefined` when the chunk has no separate source map. `mapDir` is the directory
|
|
26
|
+
* the map would be written to and is passed to the `rewriteSources` hook.
|
|
27
|
+
*/
|
|
28
|
+
stage(input: {
|
|
29
|
+
code: string;
|
|
30
|
+
mapSource: string | undefined;
|
|
31
|
+
mapDir: string;
|
|
32
|
+
fileName: string;
|
|
33
|
+
}): Promise<'staged' | 'skipped' | 'failed'>;
|
|
34
|
+
/** Removes the folder. Call this when no upload will consume it. */
|
|
35
|
+
discard(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Keeps the folder and logs how to upload it by hand. Call this when the bundler already
|
|
38
|
+
* dropped the staged source maps from its output but the upload did not run. Removes the
|
|
39
|
+
* folder instead when nothing was staged.
|
|
40
|
+
*/
|
|
41
|
+
keep(reason: string): Promise<void>;
|
|
42
|
+
};
|
|
6
43
|
export type SentryBuildPluginManager = {
|
|
7
44
|
/**
|
|
8
45
|
* A logger instance that takes the options passed to the build plugin manager into account. (for silencing and log level etc.)
|
|
@@ -53,7 +90,26 @@ export type SentryBuildPluginManager = {
|
|
|
53
90
|
*/
|
|
54
91
|
uploadSourcemaps(buildArtifactPaths: string[], opts?: {
|
|
55
92
|
prepareArtifacts?: boolean;
|
|
56
|
-
|
|
93
|
+
staging?: UploadStaging;
|
|
94
|
+
}): Promise<{
|
|
95
|
+
uploaded: boolean;
|
|
96
|
+
}>;
|
|
97
|
+
/**
|
|
98
|
+
* Creates a staging folder that `uploadSourcemaps` uploads together with the build artifacts
|
|
99
|
+
* found on disk, in both the prepared and the direct (`prepareArtifacts: false`) mode.
|
|
100
|
+
*/
|
|
101
|
+
createUploadStaging(): Promise<UploadStaging>;
|
|
102
|
+
sourceMaps: {
|
|
103
|
+
/**
|
|
104
|
+
* Whether a source map upload can run with the current options and environment.
|
|
105
|
+
*/
|
|
106
|
+
uploadPossible: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Decides how the plugin treats the user's source map setting (see `decideSourceMapHandling`).
|
|
109
|
+
* Logs the decision's message once per message.
|
|
110
|
+
*/
|
|
111
|
+
decide(kind: SourceMapKind): SourceMapDecision;
|
|
112
|
+
};
|
|
57
113
|
/**
|
|
58
114
|
* Will delete artifacts based on the passed `sourcemaps.filesToDeleteAfterUpload` option.
|
|
59
115
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-plugin-manager.d.ts","sourceRoot":"","sources":["../../../src/core/build-plugin-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-plugin-manager.d.ts","sourceRoot":"","sources":["../../../src/core/build-plugin-manager.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,KAAK,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AE/B;;;;;;OAMG;IACH,cAAc,CAAC,kBAAkB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D;;OAEG;IACH,gBAAgB,CACd,kBAAkB,EAAE,MAAM,EAAE,EAC5B,IAAI,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,aAAa,CAAA;KAAE,GAC7D,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAElC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IAE9C,UAAU,EAAE;QACV;;WAEG;QACH,cAAc,EAAE,OAAO,CAAC;QACxB;;;WAGG;QACH,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,iBAAiB,CAAC;KAChD,CAAC;IAEF;;OAEG;IACH,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC,gCAAgC,EAAE,MAAM,MAAM,IAAI,CAAC;CACpD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,OAAO,EACpB,wBAAwB,EAAE;IACxB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB,GACA,wBAAwB,CAqxB1B"}
|
|
@@ -1,11 +1,47 @@
|
|
|
1
|
-
import type { SentryBuildPluginManager } from './build-plugin-manager';
|
|
1
|
+
import type { SentryBuildPluginManager, UploadStaging } from './build-plugin-manager';
|
|
2
2
|
import type { Logger } from './logger';
|
|
3
3
|
import type { ResolveSourceMapHook, RewriteSourcesHook } from './types';
|
|
4
4
|
interface DebugIdUploadPluginOptions {
|
|
5
5
|
sentryBuildPluginManager: SentryBuildPluginManager;
|
|
6
6
|
}
|
|
7
|
-
export declare function createDebugIdUploadFunction({ sentryBuildPluginManager }: DebugIdUploadPluginOptions): (buildArtifactPaths: string[]
|
|
7
|
+
export declare function createDebugIdUploadFunction({ sentryBuildPluginManager }: DebugIdUploadPluginOptions): (buildArtifactPaths: string[], opts?: {
|
|
8
|
+
staging?: UploadStaging;
|
|
9
|
+
}) => Promise<{
|
|
10
|
+
uploaded: boolean;
|
|
11
|
+
}>;
|
|
8
12
|
export declare function prepareBundleForDebugIdUpload(bundleFilePath: string, uploadFolder: string, chunkIndex: number, logger: Logger, rewriteSourcesHook: RewriteSourcesHook, resolveSourceMapHook: ResolveSourceMapHook | undefined): Promise<void>;
|
|
13
|
+
export type PreparedUploadArtifact = {
|
|
14
|
+
debugId: string;
|
|
15
|
+
bundleSource: string;
|
|
16
|
+
/** `undefined` when the bundle has no separate source map (i.e. the map is inlined). */
|
|
17
|
+
sourceMapSource: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
export type PrepareArtifactResult = {
|
|
20
|
+
ok: true;
|
|
21
|
+
artifact: PreparedUploadArtifact;
|
|
22
|
+
} | {
|
|
23
|
+
ok: false;
|
|
24
|
+
reason: 'no-debug-id' | 'no-source-map' | 'invalid-source-map';
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Prepares a bundle and its source map for the debug ID upload: stamps the debug ID into both
|
|
28
|
+
* and runs the `rewriteSources` hook over the map's `sources`.
|
|
29
|
+
*
|
|
30
|
+
* Pass `mapSource: undefined` when the bundle has no separate source map. A bundle with an
|
|
31
|
+
* inlined map is still prepared; a bundle without any map is skipped because it cannot be
|
|
32
|
+
* symbolicated.
|
|
33
|
+
*/
|
|
34
|
+
export declare function prepareArtifactForUpload(input: {
|
|
35
|
+
code: string;
|
|
36
|
+
mapSource: string | undefined;
|
|
37
|
+
/** Directory the source map lives in, passed to the `rewriteSources` hook. */
|
|
38
|
+
mapDir: string;
|
|
39
|
+
rewriteSourcesHook: RewriteSourcesHook;
|
|
40
|
+
}): PrepareArtifactResult;
|
|
41
|
+
/**
|
|
42
|
+
* Writes a prepared artifact as `<uniqueUploadName>.js` (and `.js.map`) into the upload folder.
|
|
43
|
+
*/
|
|
44
|
+
export declare function writePreparedArtifact(uploadFolder: string, uniqueUploadName: string, artifact: PreparedUploadArtifact): Promise<void>;
|
|
9
45
|
export type StampedArtifacts = {
|
|
10
46
|
bundleSource: string;
|
|
11
47
|
/** `undefined` when the bundle has no separate source map (i.e. the map is inlined). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-id-upload.d.ts","sourceRoot":"","sources":["../../../src/core/debug-id-upload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debug-id-upload.d.ts","sourceRoot":"","sources":["../../../src/core/debug-id-upload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGxE,UAAU,0BAA0B;IAClC,wBAAwB,EAAE,wBAAwB,CAAC;CACpD;AAED,wBAAgB,2BAA2B,CAAC,EAAE,wBAAwB,EAAE,EAAE,0BAA0B,wBAChE,MAAM,EAAE,SAAS;IAAE,OAAO,CAAC,EAAE,aAAa,CAAA;CAAE;;GAM/E;AAED,wBAAsB,6BAA6B,CACjD,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,kBAAkB,EACtC,oBAAoB,EAAE,oBAAoB,GAAG,SAAS,GACrD,OAAO,CAAC,IAAI,CAAC,CAsDf;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CAC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,CAAC,CA2D7B;AAGD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMhE"}
|
|
@@ -40,5 +40,8 @@ export type { Logger } from './logger';
|
|
|
40
40
|
export type { Options, SentrySDKBuildFlags } from './types';
|
|
41
41
|
export { CodeInjection, replaceBooleanFlagsInCode, stringToUUID, generateReleaseInjectorCode, generateModuleMetadataInjectorCode, } from './utils';
|
|
42
42
|
export { createSentryBuildPluginManager } from './build-plugin-manager';
|
|
43
|
+
export type { SentryBuildPluginManager, UploadStaging } from './build-plugin-manager';
|
|
43
44
|
export { createDebugIdUploadFunction, addDebugIdToEmittedArtifacts, stampDebugId } from './debug-id-upload';
|
|
45
|
+
export { decideSourceMapHandling } from './sourcemap-settings';
|
|
46
|
+
export type { SourceMapDecision, SourceMapKind } from './sourcemap-settings';
|
|
44
47
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkD,MAAM,SAAS,CAAC;AAExF;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGlD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAYxG;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AA8BD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,SAAS,CAAC,EACnD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,SA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AC,GAAG,SAAS,GACjD,OAAO,CAMT;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAE9E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAIhE;AAED,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,YAAY,EACZ,2BAA2B,EAC3B,kCAAkC,GACnC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,YAAY,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -18,6 +18,7 @@ export type NormalizedOptions = {
|
|
|
18
18
|
rewriteSources?: RewriteSourcesHook;
|
|
19
19
|
resolveSourceMap?: ResolveSourceMapHook;
|
|
20
20
|
filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;
|
|
21
|
+
deleteSourcemapsAfterUpload?: boolean;
|
|
21
22
|
} | undefined;
|
|
22
23
|
release: {
|
|
23
24
|
name: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options-mapping.d.ts","sourceRoot":"","sources":["../../../src/core/options-mapping.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OA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AG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,eAAe,sBAAsB,CAAC;AAGnD,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,iBAAiB,CAkFhF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAmDnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../../../src/core/sentry/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAWrC,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,EAC1B,mBAAmB,EAAE,OAAO,CAAC,OAAO,CAAC,EACrC,SAAS,EAAE,MAAM,EACjB,qBAAqB,EAAE,MAAM,GAAG,SAAS,GACxC;IAAE,WAAW,EAAE,KAAK,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAoD9C;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,MAAM,EACjB,qBAAqB,CAAC,EAAE,MAAM,GAC7B,IAAI,
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../../../src/core/sentry/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAWrC,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,EAC1B,mBAAmB,EAAE,OAAO,CAAC,OAAO,CAAC,EACrC,SAAS,EAAE,MAAM,EACjB,qBAAqB,EAAE,MAAM,GAAG,SAAS,GACxC;IAAE,WAAW,EAAE,KAAK,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAoD9C;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,MAAM,EACjB,qBAAqB,CAAC,EAAE,MAAM,GAC7B,IAAI,CAuDN;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAqBzF;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO5E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { NormalizedOptions } from './options-mapping';
|
|
2
|
+
/**
|
|
3
|
+
* The user's source map setting in the bundler, reduced to what matters for upload and deletion.
|
|
4
|
+
*
|
|
5
|
+
* - `unset`: the user did not configure source maps
|
|
6
|
+
* - `off`: source map generation is turned off
|
|
7
|
+
* - `visible`: separate map files with a `sourceMappingURL` comment
|
|
8
|
+
* - `hidden`: separate map files without the comment
|
|
9
|
+
* - `inline`: the map is embedded into the bundle
|
|
10
|
+
*/
|
|
11
|
+
export type SourceMapKind = 'unset' | 'off' | 'visible' | 'hidden' | 'inline';
|
|
12
|
+
export type SourceMapDecision = {
|
|
13
|
+
/** Switch the bundler to hidden source maps. */
|
|
14
|
+
enableHidden: boolean;
|
|
15
|
+
/** Remove the source maps from the build output once they are uploaded. */
|
|
16
|
+
deleteAfterUpload: boolean;
|
|
17
|
+
log?: {
|
|
18
|
+
level: 'info' | 'warn';
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Decides whether the plugin turns hidden source maps on and whether it removes the maps from the
|
|
24
|
+
* build output after the upload. The plugin only turns maps on when an upload can run, and only
|
|
25
|
+
* removes maps it turned on itself unless `deleteSourcemapsAfterUpload` says otherwise.
|
|
26
|
+
*/
|
|
27
|
+
export declare function decideSourceMapHandling(kind: SourceMapKind, options: NormalizedOptions, uploadPossible: boolean): SourceMapDecision;
|
|
28
|
+
//# sourceMappingURL=sourcemap-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourcemap-settings.d.ts","sourceRoot":"","sources":["../../../src/core/sourcemap-settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gDAAgD;IAChD,YAAY,EAAE,OAAO,CAAC;IACtB,2EAA2E;IAC3E,iBAAiB,EAAE,OAAO,CAAC;IAC3B,GAAG,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD,CAAC;AAIF;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,iBAAiB,EAC1B,cAAc,EAAE,OAAO,GACtB,iBAAiB,CAsEnB"}
|
|
@@ -170,6 +170,17 @@ export interface Options {
|
|
|
170
170
|
* Use the `debug` option to print information about which files end up being deleted.
|
|
171
171
|
*/
|
|
172
172
|
filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;
|
|
173
|
+
/**
|
|
174
|
+
* Whether source maps are removed from the build output after they are uploaded to Sentry.
|
|
175
|
+
*
|
|
176
|
+
* When unset, the plugin removes only the source maps it turned on itself, that is, when the bundler's source map
|
|
177
|
+
* setting was not set. `true` also removes source maps you enabled yourself. `false` never removes them; the plugin
|
|
178
|
+
* still turns on hidden source maps when the setting is not set, so they can be uploaded.
|
|
179
|
+
*
|
|
180
|
+
* With Rollup, Vite and webpack the removed source maps are never written to the output directory. With esbuild
|
|
181
|
+
* they are deleted after the upload.
|
|
182
|
+
*/
|
|
183
|
+
deleteSourcemapsAfterUpload?: boolean;
|
|
173
184
|
};
|
|
174
185
|
/**
|
|
175
186
|
* Options related to managing the Sentry releases for a build.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEjG,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,OAAO;IACtB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;OAcG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IAEpC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC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|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/core/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/core/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,YAAY,CAAC"}
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/esbuild/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AA2FvC,wBAAgB,mBAAmB,CAAC,WAAW,GAAE,OAAY,GAAG,GAAG,CA0OlE;eAGc,mBAAmB;AAClC,YAAY,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/bundler-plugins",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.11.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",
|
|
@@ -39,6 +39,11 @@
|
|
|
39
39
|
"import": "./build/esm/esbuild/index.js",
|
|
40
40
|
"require": "./build/cjs/esbuild/index.js"
|
|
41
41
|
},
|
|
42
|
+
"./bun": {
|
|
43
|
+
"types": "./build/types/bun/index.d.ts",
|
|
44
|
+
"import": "./build/esm/bun/index.js",
|
|
45
|
+
"require": "./build/cjs/bun/index.js"
|
|
46
|
+
},
|
|
42
47
|
"./core": {
|
|
43
48
|
"types": "./build/types/core/index.d.ts",
|
|
44
49
|
"import": "./build/esm/core/index.js",
|
|
@@ -110,9 +115,9 @@
|
|
|
110
115
|
}
|
|
111
116
|
},
|
|
112
117
|
"dependencies": {
|
|
113
|
-
"@sentry/core": "11.
|
|
118
|
+
"@sentry/core": "11.11.0",
|
|
114
119
|
"dotenv": "^17.4.2",
|
|
115
|
-
"glob": "^
|
|
120
|
+
"glob": "^14.0.3",
|
|
116
121
|
"magic-string": "~0.30.8 || ^1.0.0",
|
|
117
122
|
"oxc-parser": "^0.152.0",
|
|
118
123
|
"sentry": "^0.45.0",
|
|
@@ -132,16 +137,16 @@
|
|
|
132
137
|
},
|
|
133
138
|
"devDependencies": {
|
|
134
139
|
"@babel/core": "^7.18.5",
|
|
140
|
+
"@babel/parser": "^8.0.10",
|
|
135
141
|
"@babel/preset-react": "^7.23.3",
|
|
142
|
+
"@sentry-internal/rollup-utils": "11.11.0",
|
|
143
|
+
"@sentry-internal/test-utils": "11.11.0",
|
|
136
144
|
"@types/babel__core": "^7.20.5",
|
|
137
145
|
"@types/node": "^20.19.0",
|
|
138
146
|
"premove": "^4.0.0",
|
|
139
147
|
"rolldown": "^1.0.0",
|
|
140
148
|
"vitest": "^4.1.11",
|
|
141
|
-
"webpack": "5.
|
|
142
|
-
},
|
|
143
|
-
"volta": {
|
|
144
|
-
"extends": "../../package.json"
|
|
149
|
+
"webpack": "5.112.2"
|
|
145
150
|
},
|
|
146
151
|
"engines": {
|
|
147
152
|
"node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0"
|