@sentry/bundler-plugins 11.18.0 → 11.19.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/build/cjs/core/index.js +1 -2
- package/build/cjs/core/index.js.map +1 -1
- package/build/cjs/core/options-mapping.js.map +1 -1
- package/build/cjs/core/sentry/telemetry.js +1 -1
- package/build/cjs/core/sentry/telemetry.js.map +1 -1
- package/build/cjs/core/sourcemap-settings.js +26 -22
- package/build/cjs/core/sourcemap-settings.js.map +1 -1
- package/build/cjs/core/version.js +1 -1
- package/build/cjs/core/version.js.map +1 -1
- package/build/cjs/vite/source-map-hooks.js +1 -1
- package/build/cjs/vite/source-map-hooks.js.map +1 -1
- package/build/esm/core/index.js +2 -2
- package/build/esm/core/index.js.map +1 -1
- package/build/esm/core/options-mapping.js.map +1 -1
- package/build/esm/core/sentry/telemetry.js +1 -1
- package/build/esm/core/sentry/telemetry.js.map +1 -1
- package/build/esm/core/sourcemap-settings.js +26 -21
- package/build/esm/core/sourcemap-settings.js.map +1 -1
- package/build/esm/core/version.js +1 -1
- package/build/esm/core/version.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/vite/source-map-hooks.js +2 -2
- package/build/esm/vite/source-map-hooks.js.map +1 -1
- package/build/types/core/index.d.ts +1 -1
- package/build/types/core/index.d.ts.map +1 -1
- package/build/types/core/options-mapping.d.ts +2 -2
- 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 +8 -6
- package/build/types/core/sourcemap-settings.d.ts.map +1 -1
- package/build/types/core/types.d.ts +14 -11
- package/build/types/core/types.d.ts.map +1 -1
- package/build/types/core/version.d.ts +1 -1
- package/build/types/vite/source-map-hooks.d.ts.map +1 -1
- package/package.json +4 -4
package/build/cjs/core/index.js
CHANGED
|
@@ -81,8 +81,7 @@ exports.generateReleaseInjectorCode = require_utils.generateReleaseInjectorCode;
|
|
|
81
81
|
exports.getCodeInjectionPosition = require_get_code_injection_position.getCodeInjectionPosition;
|
|
82
82
|
exports.getDebugIdSnippet = getDebugIdSnippet;
|
|
83
83
|
exports.getDeleteOption = require_sourcemap_settings.getDeleteOption;
|
|
84
|
-
exports.
|
|
85
|
-
exports.getSdkEnabledSourceMaps = require_sourcemap_settings.getSdkEnabledSourceMaps;
|
|
84
|
+
exports.getSdkDeleteSourceMaps = require_sourcemap_settings.getSdkDeleteSourceMaps;
|
|
86
85
|
exports.getSourceMapFeatures = require_sourcemap_settings.getSourceMapFeatures;
|
|
87
86
|
exports.globFiles = require_glob.globFiles;
|
|
88
87
|
exports.hasSourceMapUploadCredentials = require_upload_credentials.hasSourceMapUploadCredentials;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["stripQueryAndHashFromPath","containsOnlyImports","CodeInjection"],"sources":["../../../src/core/index.ts"],"sourcesContent":["import { CodeInjection, containsOnlyImports, stripQueryAndHashFromPath } from './utils';\n\n/**\n * Checks if a file is a JavaScript file based on its extension.\n * Handles query strings and hashes in the filename.\n */\nexport function isJsFile(fileName: string): boolean {\n const cleanFileName = stripQueryAndHashFromPath(fileName);\n return ['.js', '.mjs', '.cjs'].some(ext => cleanFileName.endsWith(ext));\n}\n\n/**\n * Checks if a chunk should be skipped for code injection\n *\n * This is necessary to handle Vite's MPA (multi-page application) mode where\n * HTML entry points create \"facade\" chunks that should not contain injected code.\n * See: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/829\n *\n * However, in SPA mode, the main bundle also has an HTML facade but contains\n * substantial application code. We should NOT skip injection for these bundles.\n *\n * @param code - The chunk's code content\n * @param facadeModuleId - The facade module ID (if any) - HTML files create facade chunks\n * @returns true if the chunk should be skipped\n */\nexport function shouldSkipCodeInjection(code: string, facadeModuleId: string | null | undefined): boolean {\n // Skip empty chunks - these are placeholder chunks that should be optimized away\n if (code.trim().length === 0) {\n return true;\n }\n\n // For HTML facade chunks, only skip if they contain only import statements\n if (facadeModuleId && stripQueryAndHashFromPath(facadeModuleId).endsWith('.html')) {\n return containsOnlyImports(code);\n }\n\n return false;\n}\n\nexport interface ChunkGraphNode {\n fileName: string;\n isEntry?: boolean;\n imports?: string[];\n}\n\nconst initialChunksCache = new WeakMap<Record<string, ChunkGraphNode>, Set<string>>();\n\nfunction getInitialChunks(chunks: Record<string, ChunkGraphNode>): Set<string> {\n const cached = initialChunksCache.get(chunks);\n if (cached) {\n return cached;\n }\n\n const initial = new Set<string>();\n const queue = Object.values(chunks).filter(chunk => chunk.isEntry);\n\n for (let chunk = queue.shift(); chunk; chunk = queue.shift()) {\n if (initial.has(chunk.fileName)) {\n continue;\n }\n initial.add(chunk.fileName);\n for (const imported of chunk.imports ?? []) {\n const importedChunk = chunks[imported];\n if (importedChunk) {\n queue.push(importedChunk);\n }\n }\n }\n\n initialChunksCache.set(chunks, initial);\n return initial;\n}\n\n/**\n * Whether a chunk loads at startup: it is an entry chunk, or an entry chunk\n * reaches it through static imports. Chunks that only dynamic imports reach\n * load later, after startup code already ran.\n *\n * Without the chunk graph every chunk counts as initial.\n */\nexport function isInitialChunk(\n chunk: Pick<ChunkGraphNode, 'fileName' | 'isEntry'>,\n chunks: Record<string, ChunkGraphNode> | undefined,\n): boolean {\n if (chunk.isEntry || !chunks) {\n return true;\n }\n\n return getInitialChunks(chunks).has(chunk.fileName);\n}\n\nexport { globFiles } from './glob';\nexport { getCodeInjectionPosition } from './get-code-injection-position';\n\nexport { createComponentNameAnnotateHooks } from './component-annotate-hooks';\n\nexport function getDebugIdSnippet(debugId: string): CodeInjection {\n return new CodeInjection(\n `var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]=\"${debugId}\",e._sentryDebugIdIdentifier=\"sentry-dbid-${debugId}\");`,\n );\n}\n\nexport type { Logger } from './logger';\nexport type { InternalOptions, Options, SentrySDKBuildFlags } from './types';\nexport {\n CodeInjection,\n replaceBooleanFlagsInCode,\n stringToUUID,\n generateReleaseInjectorCode,\n generateModuleMetadataInjectorCode,\n resolveReleaseName,\n} from './utils';\nexport { createSentryBuildPluginManager } from './build-plugin-manager';\nexport type { SentryBuildPluginManager, UploadResult, UploadStaging } from './build-plugin-manager';\nexport { createDebugIdUploadFunction, addDebugIdToEmittedArtifacts, stampDebugId } from './debug-id-upload';\nexport {\n decideSourceMapHandling,\n getDeleteOption,\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["stripQueryAndHashFromPath","containsOnlyImports","CodeInjection"],"sources":["../../../src/core/index.ts"],"sourcesContent":["import { CodeInjection, containsOnlyImports, stripQueryAndHashFromPath } from './utils';\n\n/**\n * Checks if a file is a JavaScript file based on its extension.\n * Handles query strings and hashes in the filename.\n */\nexport function isJsFile(fileName: string): boolean {\n const cleanFileName = stripQueryAndHashFromPath(fileName);\n return ['.js', '.mjs', '.cjs'].some(ext => cleanFileName.endsWith(ext));\n}\n\n/**\n * Checks if a chunk should be skipped for code injection\n *\n * This is necessary to handle Vite's MPA (multi-page application) mode where\n * HTML entry points create \"facade\" chunks that should not contain injected code.\n * See: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/829\n *\n * However, in SPA mode, the main bundle also has an HTML facade but contains\n * substantial application code. We should NOT skip injection for these bundles.\n *\n * @param code - The chunk's code content\n * @param facadeModuleId - The facade module ID (if any) - HTML files create facade chunks\n * @returns true if the chunk should be skipped\n */\nexport function shouldSkipCodeInjection(code: string, facadeModuleId: string | null | undefined): boolean {\n // Skip empty chunks - these are placeholder chunks that should be optimized away\n if (code.trim().length === 0) {\n return true;\n }\n\n // For HTML facade chunks, only skip if they contain only import statements\n if (facadeModuleId && stripQueryAndHashFromPath(facadeModuleId).endsWith('.html')) {\n return containsOnlyImports(code);\n }\n\n return false;\n}\n\nexport interface ChunkGraphNode {\n fileName: string;\n isEntry?: boolean;\n imports?: string[];\n}\n\nconst initialChunksCache = new WeakMap<Record<string, ChunkGraphNode>, Set<string>>();\n\nfunction getInitialChunks(chunks: Record<string, ChunkGraphNode>): Set<string> {\n const cached = initialChunksCache.get(chunks);\n if (cached) {\n return cached;\n }\n\n const initial = new Set<string>();\n const queue = Object.values(chunks).filter(chunk => chunk.isEntry);\n\n for (let chunk = queue.shift(); chunk; chunk = queue.shift()) {\n if (initial.has(chunk.fileName)) {\n continue;\n }\n initial.add(chunk.fileName);\n for (const imported of chunk.imports ?? []) {\n const importedChunk = chunks[imported];\n if (importedChunk) {\n queue.push(importedChunk);\n }\n }\n }\n\n initialChunksCache.set(chunks, initial);\n return initial;\n}\n\n/**\n * Whether a chunk loads at startup: it is an entry chunk, or an entry chunk\n * reaches it through static imports. Chunks that only dynamic imports reach\n * load later, after startup code already ran.\n *\n * Without the chunk graph every chunk counts as initial.\n */\nexport function isInitialChunk(\n chunk: Pick<ChunkGraphNode, 'fileName' | 'isEntry'>,\n chunks: Record<string, ChunkGraphNode> | undefined,\n): boolean {\n if (chunk.isEntry || !chunks) {\n return true;\n }\n\n return getInitialChunks(chunks).has(chunk.fileName);\n}\n\nexport { globFiles } from './glob';\nexport { getCodeInjectionPosition } from './get-code-injection-position';\n\nexport { createComponentNameAnnotateHooks } from './component-annotate-hooks';\n\nexport function getDebugIdSnippet(debugId: string): CodeInjection {\n return new CodeInjection(\n `var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]=\"${debugId}\",e._sentryDebugIdIdentifier=\"sentry-dbid-${debugId}\");`,\n );\n}\n\nexport type { Logger } from './logger';\nexport type { InternalOptions, Options, SentrySDKBuildFlags } from './types';\nexport {\n CodeInjection,\n replaceBooleanFlagsInCode,\n stringToUUID,\n generateReleaseInjectorCode,\n generateModuleMetadataInjectorCode,\n resolveReleaseName,\n} from './utils';\nexport { createSentryBuildPluginManager } from './build-plugin-manager';\nexport type { SentryBuildPluginManager, UploadResult, UploadStaging } from './build-plugin-manager';\nexport { createDebugIdUploadFunction, addDebugIdToEmittedArtifacts, stampDebugId } from './debug-id-upload';\nexport {\n decideSourceMapHandling,\n getDeleteOption,\n getSdkDeleteSourceMaps,\n getSourceMapFeatures,\n} from './sourcemap-settings';\nexport type { SourceMapDecision, SourceMapKind } from './sourcemap-settings';\nexport { hasSourceMapUploadCredentials } from './upload-credentials';\nexport type { UploadFilter } from './upload-filter';\n"],"mappings":";;;;;;;;;;;;;;AAMA,SAAgB,SAAS,UAA2B;CAClD,MAAM,gBAAgBA,cAAAA,0BAA0B,QAAQ;CACxD,OAAO;EAAC;EAAO;EAAQ;CAAM,CAAC,CAAC,MAAK,QAAO,cAAc,SAAS,GAAG,CAAC;AACxE;;;;;;;;;;;;;;;AAgBA,SAAgB,wBAAwB,MAAc,gBAAoD;CAExG,IAAI,KAAK,KAAK,CAAC,CAAC,WAAW,GACzB,OAAO;CAIT,IAAI,kBAAkBA,cAAAA,0BAA0B,cAAc,CAAC,CAAC,SAAS,OAAO,GAC9E,OAAOC,cAAAA,oBAAoB,IAAI;CAGjC,OAAO;AACT;AAQA,MAAM,qCAAqB,IAAI,QAAqD;AAEpF,SAAS,iBAAiB,QAAqD;CAC7E,MAAM,SAAS,mBAAmB,IAAI,MAAM;CAC5C,IAAI,QACF,OAAO;CAGT,MAAM,0BAAU,IAAI,IAAY;CAChC,MAAM,QAAQ,OAAO,OAAO,MAAM,CAAC,CAAC,QAAO,UAAS,MAAM,OAAO;CAEjE,KAAK,IAAI,QAAQ,MAAM,MAAM,GAAG,OAAO,QAAQ,MAAM,MAAM,GAAG;EAC5D,IAAI,QAAQ,IAAI,MAAM,QAAQ,GAC5B;EAEF,QAAQ,IAAI,MAAM,QAAQ;EAC1B,KAAK,MAAM,YAAY,MAAM,WAAW,CAAC,GAAG;GAC1C,MAAM,gBAAgB,OAAO;GAC7B,IAAI,eACF,MAAM,KAAK,aAAa;EAE5B;CACF;CAEA,mBAAmB,IAAI,QAAQ,OAAO;CACtC,OAAO;AACT;;;;;;;;AASA,SAAgB,eACd,OACA,QACS;CACT,IAAI,MAAM,WAAW,CAAC,QACpB,OAAO;CAGT,OAAO,iBAAiB,MAAM,CAAC,CAAC,IAAI,MAAM,QAAQ;AACpD;AAOA,SAAgB,kBAAkB,SAAgC;CAChE,OAAO,IAAIC,cAAAA,cACT,+FAA+F,QAAQ,4CAA4C,QAAQ,IAC7J;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options-mapping.js","names":["parseProjectEnvVar","resolveReleaseName","getVercelEnv","readCommitEnvVar","canAutoDetectRepository","warnOnConflictingSourceMapOptions"],"sources":["../../../src/core/options-mapping.ts"],"sourcesContent":["import { getVercelEnv, warnOnConflictingSourceMapOptions } from '@sentry/core';\nimport type { Logger } from './logger';\nimport type {\n InternalOptions as UserOptions,\n SetCommitsOptions,\n RewriteSourcesHook,\n ResolveSourceMapHook,\n IncludeEntry,\n ModuleMetadata,\n ModuleMetadataCallback,\n} from './types';\nimport { parseProjectEnvVar } from './upload-credentials';\nimport { canAutoDetectRepository, readCommitEnvVar, resolveReleaseName } from './utils';\n\nexport type NormalizedOptions = {\n org: string | undefined;\n project: string | string[] | undefined;\n authToken: string | undefined;\n url: string | undefined;\n headers: Record<string, string> | undefined;\n debug: boolean;\n silent: boolean;\n errorHandler: ((err: Error) => void) | undefined;\n telemetry: boolean;\n disable: boolean;\n sourcemaps:\n | {\n disable?: boolean | 'disable-upload';\n upload?: boolean;\n injectDebugIds?: boolean;\n delete?: boolean;\n assets?: string | string[];\n ignore?: string | string[];\n rewriteSources?: RewriteSourcesHook;\n resolveSourceMap?: ResolveSourceMapHook;\n filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;\n deleteSourcemapsAfterUpload?: boolean | ((environment?: string) => boolean | undefined);\n sdkEnabledSourceMaps?: boolean | ((environment?: string) => boolean | undefined);\n }\n | undefined;\n release: {\n name: string | undefined;\n inject: boolean | 'html';\n create: boolean;\n finalize: boolean;\n vcsRemote: string;\n setCommits:\n | (SetCommitsOptions & {\n shouldNotThrowOnFailure?: boolean;\n })\n | false\n | undefined;\n dist?: string;\n deploy?:\n | {\n env: string;\n started?: number | string;\n finished?: number | string;\n time?: number;\n name?: string;\n url?: string;\n }\n | false;\n uploadLegacySourcemaps?: string | IncludeEntry | Array<string | IncludeEntry>;\n };\n bundleSizeOptimizations:\n | {\n excludeDebugStatements?: boolean;\n excludeTracing?: boolean;\n excludeChannelInjection?: boolean;\n excludeReplayCanvas?: boolean;\n excludeReplayShadowDom?: boolean;\n excludeReplayIframe?: boolean;\n excludeReplayWorker?: boolean;\n }\n | undefined;\n reactComponentAnnotation:\n | {\n enabled?: boolean;\n ignoredComponents?: string[];\n _experimentalInjectIntoHtml?: boolean;\n }\n | undefined;\n _metaOptions: {\n telemetry: {\n metaFramework: string | undefined;\n bundlerMajorVersion: string | undefined;\n };\n };\n applicationKey: string | undefined;\n moduleMetadata: ModuleMetadata | ModuleMetadataCallback | undefined;\n _experiments: {\n injectBuildInformation?: boolean;\n } & Record<string, unknown>;\n};\n\nexport const SENTRY_SAAS_URL = 'https://sentry.io';\n\n// oxlint-disable-next-line complexity\nexport function normalizeUserOptions(userOptions: UserOptions): NormalizedOptions {\n const options = {\n org: userOptions.org ?? process.env['SENTRY_ORG'],\n project: userOptions.project ?? parseProjectEnvVar(process.env['SENTRY_PROJECT']),\n authToken: userOptions.authToken ?? process.env['SENTRY_AUTH_TOKEN'],\n // No sentry.io default: the CLI then uses the server an `sntrys_` org token was issued for, and\n // sentry.io otherwise. A default here would send self-hosted tokens to sentry.io.\n url: userOptions.url ?? process.env['SENTRY_URL'],\n headers: userOptions.headers,\n debug: userOptions.debug ?? false,\n silent: userOptions.silent ?? false,\n errorHandler: userOptions.errorHandler,\n telemetry: userOptions.telemetry ?? true,\n disable: userOptions.disable ?? false,\n sourcemaps: userOptions.sourcemaps,\n release: {\n ...userOptions.release,\n name: resolveReleaseName(userOptions.release?.name),\n inject: userOptions.release?.inject ?? true,\n create: userOptions.release?.create ?? true,\n finalize: userOptions.release?.finalize ?? true,\n vcsRemote: userOptions.release?.vcsRemote ?? process.env['SENTRY_VSC_REMOTE'] ?? 'origin',\n // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- rule false positive: the cast carries the internal `shouldNotThrowOnFailure` field; tsc errors without it\n setCommits: userOptions.release?.setCommits as\n | (SetCommitsOptions & { shouldNotThrowOnFailure?: boolean })\n | false\n | undefined,\n },\n bundleSizeOptimizations: userOptions.bundleSizeOptimizations,\n reactComponentAnnotation: userOptions.reactComponentAnnotation,\n _metaOptions: {\n telemetry: {\n metaFramework: userOptions._metaOptions?.telemetry?.metaFramework,\n bundlerMajorVersion: userOptions._metaOptions?.telemetry?.bundlerMajorVersion,\n },\n },\n applicationKey: userOptions.applicationKey,\n moduleMetadata: userOptions.moduleMetadata,\n _experiments: userOptions._experiments ?? {},\n };\n\n const vercelEnv = getVercelEnv();\n\n if (options.release.setCommits === undefined) {\n const vercelCommitSha = readCommitEnvVar('VERCEL_GIT_COMMIT_SHA');\n if (\n process.env['VERCEL'] &&\n vercelCommitSha &&\n process.env['VERCEL_GIT_REPO_SLUG'] &&\n process.env['VERCEL_GIT_REPO_OWNER'] &&\n // We only want to set commits for the production env because Sentry becomes extremely noisy (eg on slack) for\n // preview environments because the previous commit is always the \"stem\" commit of the preview/PR causing Sentry\n // to notify you for other people creating PRs.\n vercelEnv === 'production'\n ) {\n options.release.setCommits = {\n shouldNotThrowOnFailure: true,\n commit: vercelCommitSha,\n previousCommit: readCommitEnvVar('VERCEL_GIT_PREVIOUS_SHA'),\n repo: `${process.env['VERCEL_GIT_REPO_OWNER']}/${process.env['VERCEL_GIT_REPO_SLUG']}`,\n ignoreEmpty: true,\n ignoreMissing: true,\n };\n } else if (\n process.env['VERCEL'] &&\n vercelEnv !== 'production' &&\n !canAutoDetectRepository(options.release.vcsRemote)\n ) {\n // Vercel's own builders have no git remote and no other CI variables, so commit association can only fail there.\n // Builds that have either, such as `vercel build` in GitHub Actions, keep `auto: true` below.\n options.release.setCommits = false;\n } else {\n options.release.setCommits = {\n shouldNotThrowOnFailure: true,\n auto: true,\n ignoreEmpty: true,\n ignoreMissing: true,\n };\n }\n }\n\n if (options.release.deploy === undefined && process.env['VERCEL'] && vercelEnv) {\n options.release.deploy = {\n env: vercelEnv,\n url: process.env['VERCEL_URL'] ? `https://${process.env['VERCEL_URL']}` : undefined,\n };\n }\n\n return options;\n}\n\n/**\n * Validates a few combinations of options that are not checked by Sentry CLI.\n *\n * For all other options, we can rely on Sentry CLI to validate them. In fact,\n * we can't validate them in the plugin because Sentry CLI might pick up options from\n * its config file.\n *\n * @param options the internal options\n * @param logger the logger\n *\n * @returns `true` if the options are valid, `false` otherwise\n */\nexport function validateOptions(options: NormalizedOptions, logger: Logger): boolean {\n const setCommits = options.release?.setCommits;\n if (setCommits) {\n if (!setCommits.auto && !(setCommits.repo && setCommits.commit)) {\n logger.error(\n 'The `setCommits` option was specified but is missing required properties.',\n 'Please set either `auto` or both, `repo` and `commit`.',\n );\n return false;\n }\n if (setCommits.auto && setCommits.repo && setCommits) {\n logger.warn(\n 'The `setCommits` options includes `auto` but also `repo` and `commit`.',\n 'Ignoring `repo` and `commit`.',\n 'Please only set either `auto` or both, `repo` and `commit`.',\n );\n }\n }\n\n warnOnConflictingSourceMapOptions(options.sourcemaps, message => logger.warn(message));\n\n if (options.release?.deploy && typeof options.release.deploy === 'object' && !options.release.deploy.env) {\n logger.error(\n 'The `deploy` option was specified but is missing the required `env` property.',\n 'Please set the `env` property.',\n );\n return false;\n }\n\n if (options.project && Array.isArray(options.project)) {\n if (options.project.length === 0) {\n logger.error(\n 'The `project` option was specified as an array but is empty.',\n 'Please provide at least one project slug.',\n );\n return false;\n }\n // Check each project is a non-empty string\n const invalidProjects = options.project.filter(p => typeof p !== 'string' || p.trim() === '');\n if (invalidProjects.length > 0) {\n logger.error('The `project` option contains invalid project slugs.', 'All projects must be non-empty strings.');\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":";;;;AAgGA,MAAa,kBAAkB;AAG/B,SAAgB,qBAAqB,aAA6C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1
|
+
{"version":3,"file":"options-mapping.js","names":["parseProjectEnvVar","resolveReleaseName","getVercelEnv","readCommitEnvVar","canAutoDetectRepository","warnOnConflictingSourceMapOptions"],"sources":["../../../src/core/options-mapping.ts"],"sourcesContent":["import { getVercelEnv, warnOnConflictingSourceMapOptions } from '@sentry/core';\nimport type { Logger } from './logger';\nimport type {\n InternalOptions as UserOptions,\n SetCommitsOptions,\n RewriteSourcesHook,\n ResolveSourceMapHook,\n IncludeEntry,\n ModuleMetadata,\n ModuleMetadataCallback,\n} from './types';\nimport { parseProjectEnvVar } from './upload-credentials';\nimport { canAutoDetectRepository, readCommitEnvVar, resolveReleaseName } from './utils';\n\nexport type NormalizedOptions = {\n org: string | undefined;\n project: string | string[] | undefined;\n authToken: string | undefined;\n url: string | undefined;\n headers: Record<string, string> | undefined;\n debug: boolean;\n silent: boolean;\n errorHandler: ((err: Error) => void) | undefined;\n telemetry: boolean;\n disable: boolean;\n sourcemaps:\n | {\n disable?: boolean | 'disable-upload';\n upload?: boolean;\n injectDebugIds?: boolean;\n delete?: boolean;\n assets?: string | string[];\n ignore?: string | string[];\n rewriteSources?: RewriteSourcesHook;\n resolveSourceMap?: ResolveSourceMapHook;\n filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;\n deleteSourcemapsAfterUpload?: boolean;\n sdkDeleteSourceMaps?: boolean | ((environment?: string) => boolean | undefined);\n }\n | undefined;\n release: {\n name: string | undefined;\n inject: boolean | 'html';\n create: boolean;\n finalize: boolean;\n vcsRemote: string;\n setCommits:\n | (SetCommitsOptions & {\n shouldNotThrowOnFailure?: boolean;\n })\n | false\n | undefined;\n dist?: string;\n deploy?:\n | {\n env: string;\n started?: number | string;\n finished?: number | string;\n time?: number;\n name?: string;\n url?: string;\n }\n | false;\n uploadLegacySourcemaps?: string | IncludeEntry | Array<string | IncludeEntry>;\n };\n bundleSizeOptimizations:\n | {\n excludeDebugStatements?: boolean;\n excludeTracing?: boolean;\n excludeChannelInjection?: boolean;\n excludeReplayCanvas?: boolean;\n excludeReplayShadowDom?: boolean;\n excludeReplayIframe?: boolean;\n excludeReplayWorker?: boolean;\n }\n | undefined;\n reactComponentAnnotation:\n | {\n enabled?: boolean;\n ignoredComponents?: string[];\n _experimentalInjectIntoHtml?: boolean;\n }\n | undefined;\n _metaOptions: {\n telemetry: {\n metaFramework: string | undefined;\n bundlerMajorVersion: string | undefined;\n };\n };\n applicationKey: string | undefined;\n moduleMetadata: ModuleMetadata | ModuleMetadataCallback | undefined;\n _experiments: {\n injectBuildInformation?: boolean;\n } & Record<string, unknown>;\n};\n\nexport const SENTRY_SAAS_URL = 'https://sentry.io';\n\n// oxlint-disable-next-line complexity\nexport function normalizeUserOptions(userOptions: UserOptions): NormalizedOptions {\n const options = {\n org: userOptions.org ?? process.env['SENTRY_ORG'],\n project: userOptions.project ?? parseProjectEnvVar(process.env['SENTRY_PROJECT']),\n authToken: userOptions.authToken ?? process.env['SENTRY_AUTH_TOKEN'],\n // No sentry.io default: the CLI then uses the server an `sntrys_` org token was issued for, and\n // sentry.io otherwise. A default here would send self-hosted tokens to sentry.io.\n url: userOptions.url ?? process.env['SENTRY_URL'],\n headers: userOptions.headers,\n debug: userOptions.debug ?? false,\n silent: userOptions.silent ?? false,\n errorHandler: userOptions.errorHandler,\n telemetry: userOptions.telemetry ?? true,\n disable: userOptions.disable ?? false,\n sourcemaps: userOptions.sourcemaps,\n release: {\n ...userOptions.release,\n name: resolveReleaseName(userOptions.release?.name),\n inject: userOptions.release?.inject ?? true,\n create: userOptions.release?.create ?? true,\n finalize: userOptions.release?.finalize ?? true,\n vcsRemote: userOptions.release?.vcsRemote ?? process.env['SENTRY_VSC_REMOTE'] ?? 'origin',\n // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- rule false positive: the cast carries the internal `shouldNotThrowOnFailure` field; tsc errors without it\n setCommits: userOptions.release?.setCommits as\n | (SetCommitsOptions & { shouldNotThrowOnFailure?: boolean })\n | false\n | undefined,\n },\n bundleSizeOptimizations: userOptions.bundleSizeOptimizations,\n reactComponentAnnotation: userOptions.reactComponentAnnotation,\n _metaOptions: {\n telemetry: {\n metaFramework: userOptions._metaOptions?.telemetry?.metaFramework,\n bundlerMajorVersion: userOptions._metaOptions?.telemetry?.bundlerMajorVersion,\n },\n },\n applicationKey: userOptions.applicationKey,\n moduleMetadata: userOptions.moduleMetadata,\n _experiments: userOptions._experiments ?? {},\n };\n\n const vercelEnv = getVercelEnv();\n\n if (options.release.setCommits === undefined) {\n const vercelCommitSha = readCommitEnvVar('VERCEL_GIT_COMMIT_SHA');\n if (\n process.env['VERCEL'] &&\n vercelCommitSha &&\n process.env['VERCEL_GIT_REPO_SLUG'] &&\n process.env['VERCEL_GIT_REPO_OWNER'] &&\n // We only want to set commits for the production env because Sentry becomes extremely noisy (eg on slack) for\n // preview environments because the previous commit is always the \"stem\" commit of the preview/PR causing Sentry\n // to notify you for other people creating PRs.\n vercelEnv === 'production'\n ) {\n options.release.setCommits = {\n shouldNotThrowOnFailure: true,\n commit: vercelCommitSha,\n previousCommit: readCommitEnvVar('VERCEL_GIT_PREVIOUS_SHA'),\n repo: `${process.env['VERCEL_GIT_REPO_OWNER']}/${process.env['VERCEL_GIT_REPO_SLUG']}`,\n ignoreEmpty: true,\n ignoreMissing: true,\n };\n } else if (\n process.env['VERCEL'] &&\n vercelEnv !== 'production' &&\n !canAutoDetectRepository(options.release.vcsRemote)\n ) {\n // Vercel's own builders have no git remote and no other CI variables, so commit association can only fail there.\n // Builds that have either, such as `vercel build` in GitHub Actions, keep `auto: true` below.\n options.release.setCommits = false;\n } else {\n options.release.setCommits = {\n shouldNotThrowOnFailure: true,\n auto: true,\n ignoreEmpty: true,\n ignoreMissing: true,\n };\n }\n }\n\n if (options.release.deploy === undefined && process.env['VERCEL'] && vercelEnv) {\n options.release.deploy = {\n env: vercelEnv,\n url: process.env['VERCEL_URL'] ? `https://${process.env['VERCEL_URL']}` : undefined,\n };\n }\n\n return options;\n}\n\n/**\n * Validates a few combinations of options that are not checked by Sentry CLI.\n *\n * For all other options, we can rely on Sentry CLI to validate them. In fact,\n * we can't validate them in the plugin because Sentry CLI might pick up options from\n * its config file.\n *\n * @param options the internal options\n * @param logger the logger\n *\n * @returns `true` if the options are valid, `false` otherwise\n */\nexport function validateOptions(options: NormalizedOptions, logger: Logger): boolean {\n const setCommits = options.release?.setCommits;\n if (setCommits) {\n if (!setCommits.auto && !(setCommits.repo && setCommits.commit)) {\n logger.error(\n 'The `setCommits` option was specified but is missing required properties.',\n 'Please set either `auto` or both, `repo` and `commit`.',\n );\n return false;\n }\n if (setCommits.auto && setCommits.repo && setCommits) {\n logger.warn(\n 'The `setCommits` options includes `auto` but also `repo` and `commit`.',\n 'Ignoring `repo` and `commit`.',\n 'Please only set either `auto` or both, `repo` and `commit`.',\n );\n }\n }\n\n warnOnConflictingSourceMapOptions(options.sourcemaps, message => logger.warn(message));\n\n if (options.release?.deploy && typeof options.release.deploy === 'object' && !options.release.deploy.env) {\n logger.error(\n 'The `deploy` option was specified but is missing the required `env` property.',\n 'Please set the `env` property.',\n );\n return false;\n }\n\n if (options.project && Array.isArray(options.project)) {\n if (options.project.length === 0) {\n logger.error(\n 'The `project` option was specified as an array but is empty.',\n 'Please provide at least one project slug.',\n );\n return false;\n }\n // Check each project is a non-empty string\n const invalidProjects = options.project.filter(p => typeof p !== 'string' || p.trim() === '');\n if (invalidProjects.length > 0) {\n logger.error('The `project` option contains invalid project slugs.', 'All projects must be non-empty strings.');\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":";;;;AAgGA,MAAa,kBAAkB;AAG/B,SAAgB,qBAAqB,aAA6C;CAChF,MAAM,UAAU;EACd,KAAK,YAAY,OAAO,QAAQ,IAAI;EACpC,SAAS,YAAY,WAAWA,2BAAAA,mBAAmB,QAAQ,IAAI,iBAAiB;EAChF,WAAW,YAAY,aAAa,QAAQ,IAAI;EAGhD,KAAK,YAAY,OAAO,QAAQ,IAAI;EACpC,SAAS,YAAY;EACrB,OAAO,YA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,KAAA,KAAa,QAAQ,IAAI,aAAa,WACnE,QAAQ,QAAQ,SAAS;EACvB,KAAK;EACL,KAAK,QAAQ,IAAI,gBAAgB,WAAW,QAAQ,IAAI,kBAAkB,KAAA;CAC5E;CAGF,OAAO;AACT;;;;;;;;;;;;;AAcA,SAAgB,gBAAgB,SAA4B,QAAyB;CACnF,MAAM,aAAa,QAAQ,SAAS;CACpC,IAAI,YAAY;EACd,IAAI,CAAC,WAAW,QAAQ,EAAE,WAAW,QAAQ,WAAW,SAAS;GAC/D,OAAO,MACL,6EACA,wDACF;GACA,OAAO;EACT;EACA,IAAI,WAAW,QAAQ,WAAW,QAAQ,YACxC,OAAO,KACL,0EACA,iCACA,6DACF;CAEJ;CAEAC,CAAAA,GAAAA,aAAAA,kCAAAA,CAAkC,QAAQ,aAAY,YAAW,OAAO,KAAK,OAAO,CAAC;CAErF,IAAI,QAAQ,SAAS,UAAU,OAAO,QAAQ,QAAQ,WAAW,YAAY,CAAC,QAAQ,QAAQ,OAAO,KAAK;EACxG,OAAO,MACL,iFACA,gCACF;EACA,OAAO;CACT;CAEA,IAAI,QAAQ,WAAW,MAAM,QAAQ,QAAQ,OAAO,GAAG;EACrD,IAAI,QAAQ,QAAQ,WAAW,GAAG;GAChC,OAAO,MACL,gEACA,2CACF;GACA,OAAO;EACT;EAGA,IADwB,QAAQ,QAAQ,QAAO,MAAK,OAAO,MAAM,YAAY,EAAE,KAAK,MAAM,EACxE,CAAC,CAAC,SAAS,GAAG;GAC9B,OAAO,MAAM,wDAAwD,yCAAyC;GAC9G,OAAO;EACT;CACF;CAEA,OAAO;AACT"}
|
|
@@ -62,7 +62,7 @@ function setTelemetryDataOnScope(options, scope, buildTool, buildToolMajorVersio
|
|
|
62
62
|
scope.setTag("custom-error-handler", !!errorHandler);
|
|
63
63
|
scope.setTag("sourcemaps-assets", !!sourcemaps?.assets);
|
|
64
64
|
scope.setTag("delete-after-upload", !!sourcemaps?.filesToDeleteAfterUpload);
|
|
65
|
-
scope.setTag("delete-sourcemaps-after-upload",
|
|
65
|
+
scope.setTag("delete-sourcemaps-after-upload", sourcemaps?.deleteSourcemapsAfterUpload === void 0 ? "auto" : String(sourcemaps.deleteSourcemapsAfterUpload));
|
|
66
66
|
scope.setTag("sourcemaps-disabled", !!sourcemaps?.disable);
|
|
67
67
|
scope.setTag("sourcemaps-upload", sourcemaps?.upload === void 0 ? "auto" : String(sourcemaps.upload));
|
|
68
68
|
scope.setTag("sourcemaps-inject-debug-ids", sourcemaps?.injectDebugIds === void 0 ? "auto" : String(sourcemaps.injectDebugIds));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","names":["createStackParser","nodeStackLineParser","LIB_VERSION","makeOptionallyEnabledNodeTransport","applySdkMetadata","ServerRuntimeClient","Scope","SentryCliAdapter"],"sources":["../../../../src/core/sentry/telemetry.ts"],"sourcesContent":["import type { Client } from '@sentry/core';\nimport type { ServerRuntimeClientOptions } from '@sentry/core/server';\nimport { applySdkMetadata } from '@sentry/core';\nimport { ServerRuntimeClient } from '@sentry/core/server';\nimport type { NormalizedOptions } from '../options-mapping';\nimport { SENTRY_SAAS_URL } from '../options-mapping';\nimport { Scope } from '@sentry/core';\nimport { createStackParser } from '@sentry/core';\nimport { nodeStackLineParser } from '@sentry/core/server';\nimport { makeOptionallyEnabledNodeTransport } from './transports';\nimport { SentryCliAdapter } from '../cli';\nimport { LIB_VERSION } from '../version';\n\nconst SENTRY_SAAS_HOSTNAME = 'sentry.io';\n\nconst stackParser = createStackParser(nodeStackLineParser());\n\nexport function createSentryInstance(\n options: NormalizedOptions,\n shouldSendTelemetry: Promise<boolean>,\n buildTool: string,\n buildToolMajorVersion: string | undefined,\n): { sentryScope: Scope; sentryClient: Client } {\n const clientOptions: ServerRuntimeClientOptions = {\n platform: 'node',\n runtime: { name: 'node', version: global.process.version },\n\n dsn: 'https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737',\n\n tracesSampleRate: 0.3,\n traceLifecycle: 'static',\n sampleRate: 1,\n\n release: LIB_VERSION,\n integrations: [],\n tracePropagationTargets: ['sentry.io/api'],\n\n stackParser,\n\n beforeSend: event => {\n event.exception?.values?.forEach(exception => {\n delete exception.stacktrace;\n });\n\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n // Deprecated, but still applied because this client runs on the static trace lifecycle.\n // oxlint-disable-next-line typescript/no-deprecated\n beforeSendTransaction: event => {\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n // We create a transport that stalls sending events until we know that we're allowed to (i.e. when Sentry CLI told\n // us that the upload URL is the Sentry SaaS URL)\n transport: makeOptionallyEnabledNodeTransport(shouldSendTelemetry),\n };\n\n applySdkMetadata(clientOptions, 'node');\n\n const client = new ServerRuntimeClient(clientOptions);\n const scope = new Scope();\n scope.setClient(client);\n\n // Integration tests snapshot the emitted transaction, so the sampling decision must not depend on chance.\n if (process.env['SENTRY_TEST_OUT_DIR']) {\n scope.setPropagationContext({ ...scope.getPropagationContext(), sampleRand: 0 });\n }\n\n setTelemetryDataOnScope(options, scope, buildTool, buildToolMajorVersion);\n\n return { sentryScope: scope, sentryClient: client };\n}\n\nexport function setTelemetryDataOnScope(\n options: NormalizedOptions,\n scope: Scope,\n buildTool: string,\n buildToolMajorVersion?: string,\n): void {\n const { org, project, release, errorHandler, sourcemaps, reactComponentAnnotation } = options;\n\n scope.setTag('upload-legacy-sourcemaps', !!release.uploadLegacySourcemaps);\n if (release.uploadLegacySourcemaps) {\n scope.setTag(\n 'uploadLegacySourcemapsEntries',\n Array.isArray(release.uploadLegacySourcemaps) ? release.uploadLegacySourcemaps.length : 1,\n );\n }\n\n scope.setTag('module-metadata', !!options.moduleMetadata);\n scope.setTag('inject-build-information', !!options._experiments.injectBuildInformation);\n\n // Optional release pipeline steps\n if (release.setCommits) {\n scope.setTag('set-commits', release.setCommits.auto === true ? 'auto' : 'manual');\n } else {\n scope.setTag('set-commits', 'undefined');\n }\n scope.setTag('finalize-release', release.finalize);\n scope.setTag('deploy-options', !!release.deploy);\n\n // Miscellaneous options\n scope.setTag('custom-error-handler', !!errorHandler);\n scope.setTag('sourcemaps-assets', !!sourcemaps?.assets);\n scope.setTag('delete-after-upload', !!sourcemaps?.filesToDeleteAfterUpload);\n scope.setTag(\n 'delete-sourcemaps-after-upload',\n
|
|
1
|
+
{"version":3,"file":"telemetry.js","names":["createStackParser","nodeStackLineParser","LIB_VERSION","makeOptionallyEnabledNodeTransport","applySdkMetadata","ServerRuntimeClient","Scope","SentryCliAdapter"],"sources":["../../../../src/core/sentry/telemetry.ts"],"sourcesContent":["import type { Client } from '@sentry/core';\nimport type { ServerRuntimeClientOptions } from '@sentry/core/server';\nimport { applySdkMetadata } from '@sentry/core';\nimport { ServerRuntimeClient } from '@sentry/core/server';\nimport type { NormalizedOptions } from '../options-mapping';\nimport { SENTRY_SAAS_URL } from '../options-mapping';\nimport { Scope } from '@sentry/core';\nimport { createStackParser } from '@sentry/core';\nimport { nodeStackLineParser } from '@sentry/core/server';\nimport { makeOptionallyEnabledNodeTransport } from './transports';\nimport { SentryCliAdapter } from '../cli';\nimport { LIB_VERSION } from '../version';\n\nconst SENTRY_SAAS_HOSTNAME = 'sentry.io';\n\nconst stackParser = createStackParser(nodeStackLineParser());\n\nexport function createSentryInstance(\n options: NormalizedOptions,\n shouldSendTelemetry: Promise<boolean>,\n buildTool: string,\n buildToolMajorVersion: string | undefined,\n): { sentryScope: Scope; sentryClient: Client } {\n const clientOptions: ServerRuntimeClientOptions = {\n platform: 'node',\n runtime: { name: 'node', version: global.process.version },\n\n dsn: 'https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737',\n\n tracesSampleRate: 0.3,\n traceLifecycle: 'static',\n sampleRate: 1,\n\n release: LIB_VERSION,\n integrations: [],\n tracePropagationTargets: ['sentry.io/api'],\n\n stackParser,\n\n beforeSend: event => {\n event.exception?.values?.forEach(exception => {\n delete exception.stacktrace;\n });\n\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n // Deprecated, but still applied because this client runs on the static trace lifecycle.\n // oxlint-disable-next-line typescript/no-deprecated\n beforeSendTransaction: event => {\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n // We create a transport that stalls sending events until we know that we're allowed to (i.e. when Sentry CLI told\n // us that the upload URL is the Sentry SaaS URL)\n transport: makeOptionallyEnabledNodeTransport(shouldSendTelemetry),\n };\n\n applySdkMetadata(clientOptions, 'node');\n\n const client = new ServerRuntimeClient(clientOptions);\n const scope = new Scope();\n scope.setClient(client);\n\n // Integration tests snapshot the emitted transaction, so the sampling decision must not depend on chance.\n if (process.env['SENTRY_TEST_OUT_DIR']) {\n scope.setPropagationContext({ ...scope.getPropagationContext(), sampleRand: 0 });\n }\n\n setTelemetryDataOnScope(options, scope, buildTool, buildToolMajorVersion);\n\n return { sentryScope: scope, sentryClient: client };\n}\n\nexport function setTelemetryDataOnScope(\n options: NormalizedOptions,\n scope: Scope,\n buildTool: string,\n buildToolMajorVersion?: string,\n): void {\n const { org, project, release, errorHandler, sourcemaps, reactComponentAnnotation } = options;\n\n scope.setTag('upload-legacy-sourcemaps', !!release.uploadLegacySourcemaps);\n if (release.uploadLegacySourcemaps) {\n scope.setTag(\n 'uploadLegacySourcemapsEntries',\n Array.isArray(release.uploadLegacySourcemaps) ? release.uploadLegacySourcemaps.length : 1,\n );\n }\n\n scope.setTag('module-metadata', !!options.moduleMetadata);\n scope.setTag('inject-build-information', !!options._experiments.injectBuildInformation);\n\n // Optional release pipeline steps\n if (release.setCommits) {\n scope.setTag('set-commits', release.setCommits.auto === true ? 'auto' : 'manual');\n } else {\n scope.setTag('set-commits', 'undefined');\n }\n scope.setTag('finalize-release', release.finalize);\n scope.setTag('deploy-options', !!release.deploy);\n\n // Miscellaneous options\n scope.setTag('custom-error-handler', !!errorHandler);\n scope.setTag('sourcemaps-assets', !!sourcemaps?.assets);\n scope.setTag('delete-after-upload', !!sourcemaps?.filesToDeleteAfterUpload);\n scope.setTag(\n 'delete-sourcemaps-after-upload',\n sourcemaps?.deleteSourcemapsAfterUpload === undefined ? 'auto' : String(sourcemaps.deleteSourcemapsAfterUpload),\n );\n scope.setTag('sourcemaps-disabled', !!sourcemaps?.disable);\n scope.setTag('sourcemaps-upload', sourcemaps?.upload === undefined ? 'auto' : String(sourcemaps.upload));\n scope.setTag(\n 'sourcemaps-inject-debug-ids',\n sourcemaps?.injectDebugIds === undefined ? 'auto' : String(sourcemaps.injectDebugIds),\n );\n scope.setTag('sourcemaps-delete', sourcemaps?.delete === undefined ? 'auto' : String(sourcemaps.delete));\n\n scope.setTag('react-annotate', !!reactComponentAnnotation?.enabled);\n\n scope.setTag('node', process.version);\n scope.setTag('platform', process.platform);\n\n scope.setTag('meta-framework', options._metaOptions.telemetry.metaFramework ?? 'none');\n\n scope.setTag('application-key-set', options.applicationKey !== undefined);\n\n scope.setTag('ci', !!process.env['CI']);\n\n scope.setTags({\n organization: org,\n project: Array.isArray(project) ? project.join(', ') : (project ?? 'undefined'),\n bundler: buildTool,\n });\n\n if (buildToolMajorVersion) {\n scope.setTag('bundler-major-version', buildToolMajorVersion);\n }\n\n scope.setUser({ id: org });\n}\n\nexport async function allowedToSendTelemetry(options: NormalizedOptions): Promise<boolean> {\n const { telemetry } = options;\n const url = options.url ?? SENTRY_SAAS_URL;\n\n // `options.telemetry` defaults to true\n if (telemetry === false) {\n return false;\n }\n\n if (url === SENTRY_SAAS_URL) {\n return true;\n }\n\n // Ask the CLI which Sentry server URL it resolves to. This can differ from the default (or the\n // configured `url`) because the CLI also honors a possibly existing `.sentryclirc` file.\n const cliInfoUrl = await new SentryCliAdapter(options).getServerUrl();\n\n if (cliInfoUrl === undefined) {\n return false;\n }\n\n return new URL(cliInfoUrl).hostname === SENTRY_SAAS_HOSTNAME;\n}\n\n/**\n * Flushing the SDK client can fail. We never want to crash the plugin because of telemetry.\n */\nexport async function safeFlushTelemetry(sentryClient: Client): Promise<void> {\n try {\n await sentryClient.flush(2000);\n } catch {\n // Noop when flushing fails.\n // We don't even need to log anything because there's likely nothing the user can do and they likely will not care.\n }\n}\n"],"mappings":";;;;;;;AAaA,MAAM,uBAAuB;AAE7B,MAAM,eAAA,GAAcA,aAAAA,kBAAAA,EAAAA,GAAkBC,oBAAAA,oBAAAA,CAAoB,CAAC;AAE3D,SAAgB,qBACd,SACA,qBACA,WACA,uBAC8C;CAC9C,MAAM,gBAA4C;EAChD,UAAU;EACV,SAAS;GAAE,MAAM;GAAQ,SAAS,OAAO,QAAQ;EAAQ;EAEzD,KAAK;EAEL,kBAAkB;EAClB,gBAAgB;EAChB,YAAY;EAEZ,SAASC,gBAAAA;EACT,cAAc,CAAC;EACf,yBAAyB,CAAC,eAAe;EAEzC;EAEA,aAAY,UAAS;GACnB,MAAM,WAAW,QAAQ,SAAQ,cAAa;IAC5C,OAAO,UAAU;GACnB,CAAC;GAED,OAAO,MAAM;GACb,OAAO;EACT;EAIA,wBAAuB,UAAS;GAC9B,OAAO,MAAM;GACb,OAAO;EACT;EAIA,WAAWC,mBAAAA,mCAAmC,mBAAmB;CACnE;CAEAC,CAAAA,GAAAA,aAAAA,iBAAAA,CAAiB,eAAe,MAAM;CAEtC,MAAM,SAAS,IAAIC,oBAAAA,oBAAoB,aAAa;CACpD,MAAM,QAAQ,IAAIC,aAAAA,MAAM;CACxB,MAAM,UAAU,MAAM;CAGtB,IAAI,QAAQ,IAAI,wBACd,MAAM,sBAAsB;EAAE,GAAG,MAAM,sBAAsB;EAAG,YAAY;CAAE,CAAC;CAGjF,wBAAwB,SAAS,OAAO,WAAW,qBAAqB;CAExE,OAAO;EAAE,aAAa;EAAO,cAAc;CAAO;AACpD;AAEA,SAAgB,wBACd,SACA,OACA,WACA,uBACM;CACN,MAAM,EAAE,KAAK,SAAS,SAAS,cAAc,YAAY,6BAA6B;CAEtF,MAAM,OAAO,4BAA4B,CAAC,CAAC,QAAQ,sBAAsB;CACzE,IAAI,QAAQ,wBACV,MAAM,OACJ,iCACA,MAAM,QAAQ,QAAQ,sB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M,QAAQ,OAAO,IAAI,QAAQ,KAAK,IAAI,IAAK,WAAW;EACnE,SAAS;CACX,CAAC;CAED,IAAI,uBACF,MAAM,OAAO,yBAAyB,qBAAqB;CAG7D,MAAM,QAAQ,EAAE,IAAI,IAAI,CAAC;AAC3B;AAEA,eAAsB,uBAAuB,SAA8C;CACzF,MAAM,EAAE,cAAc;CACtB,MAAM,MAAM,QAAQ,OAAA;CAGpB,IAAI,cAAc,OAChB,OAAO;CAGT,IAAI,QAAA,qBACF,OAAO;CAKT,MAAM,aAAa,MAAM,IAAIC,YAAAA,iBAAiB,OAAO,CAAC,CAAC,aAAa;CAEpE,IAAI,eAAe,KAAA,GACjB,OAAO;CAGT,OAAO,IAAI,IAAI,UAAU,CAAC,CAAC,aAAa;AAC1C;;;;AAKA,eAAsB,mBAAmB,cAAqC;CAC5E,IAAI;EACF,MAAM,aAAa,MAAM,GAAI;CAC/B,QAAQ,CAGR;AACF"}
|
|
@@ -18,33 +18,35 @@ function getSourceMapFeatures(options) {
|
|
|
18
18
|
stampEmittedFiles: injectDebugIds && !upload
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
/** Reads `sourcemaps.
|
|
22
|
-
function
|
|
23
|
-
const value = options.sourcemaps?.
|
|
21
|
+
/** Reads the internal `sourcemaps.sdkDeleteSourceMaps` option, calling its function form if given. */
|
|
22
|
+
function getSdkDeleteSourceMaps(options, environment) {
|
|
23
|
+
const value = options.sourcemaps?.sdkDeleteSourceMaps;
|
|
24
24
|
return typeof value === "function" ? value(environment) : value;
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Reads `sourcemaps.delete`. When it is unset, `sourcemaps.deleteSourcemapsAfterUpload` decides, and
|
|
28
|
+
* then the SDK.
|
|
29
|
+
*/
|
|
27
30
|
function getDeleteOption(options, environment) {
|
|
28
|
-
return options.sourcemaps?.delete ??
|
|
29
|
-
}
|
|
30
|
-
/** Reads the internal `sourcemaps.sdkEnabledSourceMaps` option, calling its function form if given. */
|
|
31
|
-
function getSdkEnabledSourceMaps(options, environment) {
|
|
32
|
-
const value = options.sourcemaps?.sdkEnabledSourceMaps;
|
|
33
|
-
return (typeof value === "function" ? value(environment) : value) === true;
|
|
31
|
+
return options.sourcemaps?.delete ?? options.sourcemaps?.deleteSourcemapsAfterUpload ?? getSdkDeleteSourceMaps(options, environment);
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
* Decides whether the plugin turns hidden source maps on and whether it removes the maps from the
|
|
37
35
|
* build output after the upload. The plugin only turns maps on when an upload can run, and only
|
|
38
|
-
* removes maps it turned on itself unless `deleteSourcemapsAfterUpload`
|
|
36
|
+
* removes maps it turned on itself unless `deleteSourcemapsAfterUpload` or the SDK's
|
|
37
|
+
* `sdkDeleteSourceMaps` says otherwise. The user's `deleteSourcemapsAfterUpload` wins over the SDK.
|
|
39
38
|
*/
|
|
40
39
|
function decideSourceMapHandling(kind, options, uploadPossible, environment) {
|
|
41
40
|
const features = getSourceMapFeatures(options);
|
|
42
41
|
if (options.sourcemaps?.delete !== void 0) return decideWithDeleteOption(kind, options.sourcemaps.delete, features, uploadPossible);
|
|
43
|
-
const
|
|
44
|
-
const
|
|
42
|
+
const userDeleteOption = options.sourcemaps?.deleteSourcemapsAfterUpload;
|
|
43
|
+
const sdkDeleteOption = getSdkDeleteSourceMaps(options, environment);
|
|
44
|
+
const deleteOption = userDeleteOption ?? sdkDeleteOption;
|
|
45
|
+
const sdkRemovesAll = sdkDeleteOption === true;
|
|
46
|
+
const fromUser = userDeleteOption !== void 0;
|
|
45
47
|
if (!uploadPossible || !features.upload) {
|
|
46
48
|
if (deleteOption !== true || kind !== "hidden" && kind !== "visible") return NO_CHANGE;
|
|
47
|
-
if (!features.upload && !
|
|
49
|
+
if (!features.upload && !sdkRemovesAll) return {
|
|
48
50
|
...NO_CHANGE,
|
|
49
51
|
log: {
|
|
50
52
|
level: "warn",
|
|
@@ -54,10 +56,13 @@ function decideSourceMapHandling(kind, options, uploadPossible, environment) {
|
|
|
54
56
|
return {
|
|
55
57
|
enableHidden: kind === "visible",
|
|
56
58
|
deleteAfterUpload: true,
|
|
57
|
-
removeAllSourceMaps:
|
|
58
|
-
log: {
|
|
59
|
+
removeAllSourceMaps: sdkRemovesAll,
|
|
60
|
+
log: fromUser ? {
|
|
59
61
|
level: "warn",
|
|
60
62
|
message: "Source maps are not uploaded, but they are removed from the build output because `sourcemaps.deleteSourcemapsAfterUpload` is set."
|
|
63
|
+
} : {
|
|
64
|
+
level: "info",
|
|
65
|
+
message: "Source maps are not uploaded, but the Sentry SDK removes them from the build output."
|
|
61
66
|
}
|
|
62
67
|
};
|
|
63
68
|
}
|
|
@@ -91,7 +96,7 @@ function decideSourceMapHandling(kind, options, uploadPossible, environment) {
|
|
|
91
96
|
removeAllSourceMaps: true,
|
|
92
97
|
log: {
|
|
93
98
|
level: "info",
|
|
94
|
-
message: "Enabling hidden source maps. They are uploaded to Sentry and removed from the build output. Set `sourcemaps.
|
|
99
|
+
message: "Enabling hidden source maps. They are uploaded to Sentry and removed from the build output. Set `sourcemaps.delete: false` to keep them."
|
|
95
100
|
}
|
|
96
101
|
};
|
|
97
102
|
case "hidden":
|
|
@@ -99,17 +104,17 @@ function decideSourceMapHandling(kind, options, uploadPossible, environment) {
|
|
|
99
104
|
return {
|
|
100
105
|
enableHidden: false,
|
|
101
106
|
deleteAfterUpload: true,
|
|
102
|
-
removeAllSourceMaps:
|
|
107
|
+
removeAllSourceMaps: sdkRemovesAll
|
|
103
108
|
};
|
|
104
109
|
case "visible":
|
|
105
110
|
if (deleteOption !== true) return NO_CHANGE;
|
|
106
111
|
return {
|
|
107
112
|
enableHidden: true,
|
|
108
113
|
deleteAfterUpload: true,
|
|
109
|
-
removeAllSourceMaps:
|
|
114
|
+
removeAllSourceMaps: sdkRemovesAll,
|
|
110
115
|
log: {
|
|
111
116
|
level: "info",
|
|
112
|
-
message: "Switching to hidden source maps because `sourcemaps.deleteSourcemapsAfterUpload` is set. Without the `sourceMappingURL` comment browsers do not request the removed map files."
|
|
117
|
+
message: fromUser ? "Switching to hidden source maps because `sourcemaps.deleteSourcemapsAfterUpload` is set. Without the `sourceMappingURL` comment browsers do not request the removed map files." : "Switching to hidden source maps, because the Sentry SDK removes them from the build output. Without the `sourceMappingURL` comment browsers do not request the removed map files."
|
|
113
118
|
}
|
|
114
119
|
};
|
|
115
120
|
}
|
|
@@ -173,8 +178,7 @@ function decideWithDeleteOption(kind, deleteSourceMaps, features, uploadPossible
|
|
|
173
178
|
}
|
|
174
179
|
exports.decideSourceMapHandling = decideSourceMapHandling;
|
|
175
180
|
exports.getDeleteOption = getDeleteOption;
|
|
176
|
-
exports.
|
|
177
|
-
exports.getSdkEnabledSourceMaps = getSdkEnabledSourceMaps;
|
|
181
|
+
exports.getSdkDeleteSourceMaps = getSdkDeleteSourceMaps;
|
|
178
182
|
exports.getSourceMapFeatures = getSourceMapFeatures;
|
|
179
183
|
|
|
180
184
|
//# sourceMappingURL=sourcemap-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourcemap-settings.js","names":["resolveSourceMapsFeatures"],"sources":["../../../src/core/sourcemap-settings.ts"],"sourcesContent":["import { resolveSourceMapsFeatures } from '@sentry/core';\nimport type { NormalizedOptions } from './options-mapping';\n\n/**\n * The user's source map setting in the bundler, reduced to what matters for upload and deletion.\n *\n * - `unset`: the user did not configure source maps\n * - `off`: source map generation is turned off\n * - `visible`: separate map files with a `sourceMappingURL` comment\n * - `hidden`: separate map files without the comment\n * - `inline`: the map is embedded into the bundle\n */\nexport type SourceMapKind = 'unset' | 'off' | 'visible' | 'hidden' | 'inline';\n\nexport type SourceMapDecision = {\n /** Switch the bundler to hidden source maps. */\n enableHidden: boolean;\n /** Remove the source maps from the build output once they are uploaded. */\n deleteAfterUpload: boolean;\n /**\n * With `deleteAfterUpload`, remove every source map of the build, also those of CSS and of chunks\n * the upload leaves out. Set when the plugin or the SDK turned the source maps on.\n */\n removeAllSourceMaps?: boolean;\n log?: { level: 'info' | 'warn'; message: string };\n};\n\nconst NO_CHANGE: SourceMapDecision = { enableHidden: false, deleteAfterUpload: false };\n\nconst SOURCE_MAPS_OFF_MESSAGE =\n 'Source map generation is turned off in your bundler, so Sentry cannot un-minify your stack traces. ' +\n 'Remove the setting to let the plugin generate hidden source maps, upload them to Sentry and remove them from the build output.';\n\nconst INLINE_SOURCE_MAPS_MESSAGE =\n 'Source maps are inlined into your bundles. They are uploaded to Sentry, but inline source maps ship your source code to users and cannot be removed after the upload. ' +\n 'Remove the setting to let the plugin generate hidden source maps instead.';\n\nexport type SourceMapFeatures = {\n /** The plugin adds debug IDs to the bundles and their source maps. */\n injectDebugIds: boolean;\n /** The plugin uploads the source maps. Never `true` without `injectDebugIds`. */\n upload: boolean;\n /**\n * The plugin writes the debug IDs into the emitted files and source maps. The upload only stamps\n * temp copies, so without an upload the emitted files get them and a later manual upload needs\n * no inject step.\n */\n stampEmittedFiles: boolean;\n};\n\n/**\n * Reads `sourcemaps.upload` and `sourcemaps.injectDebugIds`. When neither is set,\n * `sourcemaps.disable` decides.\n */\nexport function getSourceMapFeatures(options: NormalizedOptions): SourceMapFeatures {\n const { injectDebugIds, upload } = resolveSourceMapsFeatures(options.sourcemaps);\n\n return { injectDebugIds, upload, stampEmittedFiles: injectDebugIds && !upload };\n}\n\n/** Reads `sourcemaps.deleteSourcemapsAfterUpload`, calling the internal function form if given. */\nexport function getDeleteSourcemapsAfterUpload(options: NormalizedOptions, environment?: string): boolean | undefined {\n const value = options.sourcemaps?.deleteSourcemapsAfterUpload;\n return typeof value === 'function' ? value(environment) : value;\n}\n\n/** Reads `sourcemaps.delete`. When it is unset, `sourcemaps.deleteSourcemapsAfterUpload` decides. */\nexport function getDeleteOption(options: NormalizedOptions, environment?: string): boolean | undefined {\n return options.sourcemaps?.delete ?? getDeleteSourcemapsAfterUpload(options, environment);\n}\n\n/** Reads the internal `sourcemaps.sdkEnabledSourceMaps` option, calling its function form if given. */\nexport function getSdkEnabledSourceMaps(options: NormalizedOptions, environment?: string): boolean {\n const value = options.sourcemaps?.sdkEnabledSourceMaps;\n return (typeof value === 'function' ? value(environment) : value) === true;\n}\n\n/**\n * Decides whether the plugin turns hidden source maps on and whether it removes the maps from the\n * build output after the upload. The plugin only turns maps on when an upload can run, and only\n * removes maps it turned on itself unless `deleteSourcemapsAfterUpload` says otherwise.\n */\nexport function decideSourceMapHandling(\n kind: SourceMapKind,\n options: NormalizedOptions,\n uploadPossible: boolean,\n environment?: string,\n): SourceMapDecision {\n const features = getSourceMapFeatures(options);\n\n if (options.sourcemaps?.delete !== undefined) {\n return decideWithDeleteOption(kind, options.sourcemaps.delete, features, uploadPossible);\n }\n\n const deleteOption = getDeleteSourcemapsAfterUpload(options, environment);\n const sdkEnabledSourceMaps = getSdkEnabledSourceMaps(options, environment);\n\n if (!uploadPossible || !features.upload) {\n if (deleteOption !== true || (kind !== 'hidden' && kind !== 'visible')) {\n return NO_CHANGE;\n }\n // Users switch the upload off to upload the maps themselves. Maps the\n // SDK turned on are still removed, as the SDKs' own globs did.\n if (!features.upload && !sdkEnabledSourceMaps) {\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: `\\`sourcemaps.deleteSourcemapsAfterUpload\\` is set, but source map upload is disabled with ${\n resolveSourceMapsFeatures(options.sourcemaps).legacyDisable\n ? '`sourcemaps.disable`'\n : '`sourcemaps.upload` or `sourcemaps.injectDebugIds`'\n }, so the source maps are not removed.`,\n },\n };\n }\n return {\n enableHidden: kind === 'visible',\n deleteAfterUpload: true,\n removeAllSourceMaps: sdkEnabledSourceMaps,\n log: {\n level: 'warn',\n message:\n 'Source maps are not uploaded, but they are removed from the build output because `sourcemaps.deleteSourcemapsAfterUpload` is set.',\n },\n };\n }\n\n switch (kind) {\n case 'off':\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: SOURCE_MAPS_OFF_MESSAGE,\n },\n };\n\n case 'inline':\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: INLINE_SOURCE_MAPS_MESSAGE,\n },\n };\n\n case 'unset':\n if (deleteOption === false) {\n return {\n enableHidden: true,\n deleteAfterUpload: false,\n log: {\n level: 'info',\n message: 'Enabling hidden source maps. They are uploaded to Sentry and kept in the build output.',\n },\n };\n }\n return {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: {\n level: 'info',\n message:\n 'Enabling hidden source maps. They are uploaded to Sentry and removed from the build output. ' +\n 'Set `sourcemaps.deleteSourcemapsAfterUpload: false` to keep them.',\n },\n };\n\n case 'hidden':\n if (deleteOption !== true) {\n return NO_CHANGE;\n }\n return { enableHidden: false, deleteAfterUpload: true, removeAllSourceMaps: sdkEnabledSourceMaps };\n\n case 'visible':\n if (deleteOption !== true) {\n return NO_CHANGE;\n }\n return {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: sdkEnabledSourceMaps,\n log: {\n level: 'info',\n message:\n 'Switching to hidden source maps because `sourcemaps.deleteSourcemapsAfterUpload` is set. ' +\n 'Without the `sourceMappingURL` comment browsers do not request the removed map files.',\n },\n };\n }\n}\n\n/**\n * The decision when `sourcemaps.delete` is set. Unlike `deleteSourcemapsAfterUpload`, it does not\n * depend on an upload: `true` removes every source map of the build, and `false` keeps the hidden\n * source maps the plugin turns on, also when nothing is uploaded.\n */\nfunction decideWithDeleteOption(\n kind: SourceMapKind,\n deleteSourceMaps: boolean,\n features: SourceMapFeatures,\n uploadPossible: boolean,\n): SourceMapDecision {\n switch (kind) {\n case 'off':\n return uploadPossible ? { ...NO_CHANGE, log: { level: 'warn', message: SOURCE_MAPS_OFF_MESSAGE } } : NO_CHANGE;\n\n case 'inline':\n return uploadPossible ? { ...NO_CHANGE, log: { level: 'warn', message: INLINE_SOURCE_MAPS_MESSAGE } } : NO_CHANGE;\n\n case 'unset':\n if (deleteSourceMaps) {\n // Maps that are only turned on to be removed again are not turned on.\n return uploadPossible\n ? {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: {\n level: 'info',\n message: 'Enabling hidden source maps. They are uploaded to Sentry and removed from the build output.',\n },\n }\n : NO_CHANGE;\n }\n // Without debug IDs the maps are of no use to Sentry.\n if (!features.injectDebugIds) {\n return NO_CHANGE;\n }\n return {\n enableHidden: true,\n deleteAfterUpload: false,\n log: {\n level: 'info',\n message: uploadPossible\n ? 'Enabling hidden source maps. They are uploaded to Sentry and kept in the build output.'\n : 'Enabling hidden source maps. They are not uploaded to Sentry and are kept in the build output, because `sourcemaps.delete` is `false`.',\n },\n };\n\n case 'hidden':\n case 'visible':\n if (!deleteSourceMaps) {\n return NO_CHANGE;\n }\n return {\n enableHidden: kind === 'visible',\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: uploadPossible\n ? kind === 'visible'\n ? {\n level: 'info',\n message:\n 'Switching to hidden source maps because `sourcemaps.delete` is set. ' +\n 'Without the `sourceMappingURL` comment browsers do not request the removed map files.',\n }\n : undefined\n : {\n level: 'warn',\n message:\n 'Source maps are not uploaded, but they are removed from the build output because `sourcemaps.delete` is set.',\n },\n };\n }\n}\n"],"mappings":";;AA2BA,MAAM,YAA+B;CAAE,cAAc;CAAO,mBAAmB;AAAM;AAErF,MAAM,0BACJ;AAGF,MAAM,6BACJ;;;;;AAoBF,SAAgB,qBAAqB,SAA+C;CAClF,MAAM,EAAE,gBAAgB,YAAA,GAAWA,aAAAA,0BAAAA,CAA0B,QAAQ,UAAU;CAE/E,OAAO;EAAE;EAAgB;EAAQ,mBAAmB,kBAAkB,CAAC;CAAO;AAChF;;AAGA,SAAgB,+BAA+B,SAA4B,aAA2C;CACpH,MAAM,QAAQ,QAAQ,YAAY;CAClC,OAAO,OAAO,UAAU,aAAa,MAAM,WAAW,IAAI;AAC5D;;AAGA,SAAgB,gBAAgB,SAA4B,aAA2C;CACrG,OAAO,QAAQ,YAAY,UAAU,+BAA+B,SAAS,WAAW;AAC1F;;AAGA,SAAgB,wBAAwB,SAA4B,aAA+B;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AAK;GACH,IAAI,iBAAiB,MACnB,OAAO;GAET,OAAO;IACL,cAAc;IACd,mBAAmB;IACnB,qBAAqB;IACrB,KAAK;KACH,OAAO;KACP,SACE;IAEJ;GACF;CACJ;AACF;;;;;;AAOA,SAAS,uBACP,MACA,kBACA,UACA,gBACmB;CACnB,QAAQ,MAAR;EACE,KAAK,OACH,OAAO,iBAAiB;GAAE,GAAG;GAAW,KAAK;IAAE,OAAO;IAAQ,SAAS;GAAwB;EAAE,IAAI;EAEvG,KAAK,UACH,OAAO,iBAAiB;GAAE,GAAG;GAAW,KAAK;IAAE,OAAO;IAAQ,SAAS;GAA2B;EAAE,IAAI;EAE1G,KAAK;GACH,IAAI,kBAEF,OAAO,iBACH;IACE,cAAc;IACd,mBAAmB;IACnB,qBAAqB;IACrB,KAAK;KACH,OAAO;KACP,SAAS;IACX;GACF,IACA;GAGN,IAAI,CAAC,SAAS,gBACZ,OAAO;GAET,OAAO;IACL,cAAc;IACd,mBAAmB;IACnB,KAAK;KACH,OAAO;KACP,SAAS,iBACL,2FACA;IACN;GACF;EAEF,KAAK;EACL,KAAK;GACH,IAAI,CAAC,kBACH,OAAO;GAET,OAAO;IACL,cAAc,SAAS;IACvB,mBAAmB;IACnB,qBAAqB;IACrB,KAAK,iBACD,SAAS,YACP;KACE,OAAO;KACP,SACE;IAEJ,IACA,KAAA,IACF;KACE,OAAO;KACP,SACE;IACJ;GACN;CACJ;AACF"}
|
|
1
|
+
{"version":3,"file":"sourcemap-settings.js","names":["resolveSourceMapsFeatures"],"sources":["../../../src/core/sourcemap-settings.ts"],"sourcesContent":["import { resolveSourceMapsFeatures } from '@sentry/core';\nimport type { NormalizedOptions } from './options-mapping';\n\n/**\n * The user's source map setting in the bundler, reduced to what matters for upload and deletion.\n *\n * - `unset`: the user did not configure source maps\n * - `off`: source map generation is turned off\n * - `visible`: separate map files with a `sourceMappingURL` comment\n * - `hidden`: separate map files without the comment\n * - `inline`: the map is embedded into the bundle\n */\nexport type SourceMapKind = 'unset' | 'off' | 'visible' | 'hidden' | 'inline';\n\nexport type SourceMapDecision = {\n /** Switch the bundler to hidden source maps. */\n enableHidden: boolean;\n /** Remove the source maps from the build output once they are uploaded. */\n deleteAfterUpload: boolean;\n /**\n * With `deleteAfterUpload`, remove every source map of the build, also those of CSS and of chunks\n * the upload leaves out. Set when the plugin or the SDK turned the source maps on.\n */\n removeAllSourceMaps?: boolean;\n log?: { level: 'info' | 'warn'; message: string };\n};\n\nconst NO_CHANGE: SourceMapDecision = { enableHidden: false, deleteAfterUpload: false };\n\nconst SOURCE_MAPS_OFF_MESSAGE =\n 'Source map generation is turned off in your bundler, so Sentry cannot un-minify your stack traces. ' +\n 'Remove the setting to let the plugin generate hidden source maps, upload them to Sentry and remove them from the build output.';\n\nconst INLINE_SOURCE_MAPS_MESSAGE =\n 'Source maps are inlined into your bundles. They are uploaded to Sentry, but inline source maps ship your source code to users and cannot be removed after the upload. ' +\n 'Remove the setting to let the plugin generate hidden source maps instead.';\n\nexport type SourceMapFeatures = {\n /** The plugin adds debug IDs to the bundles and their source maps. */\n injectDebugIds: boolean;\n /** The plugin uploads the source maps. Never `true` without `injectDebugIds`. */\n upload: boolean;\n /**\n * The plugin writes the debug IDs into the emitted files and source maps. The upload only stamps\n * temp copies, so without an upload the emitted files get them and a later manual upload needs\n * no inject step.\n */\n stampEmittedFiles: boolean;\n};\n\n/**\n * Reads `sourcemaps.upload` and `sourcemaps.injectDebugIds`. When neither is set,\n * `sourcemaps.disable` decides.\n */\nexport function getSourceMapFeatures(options: NormalizedOptions): SourceMapFeatures {\n const { injectDebugIds, upload } = resolveSourceMapsFeatures(options.sourcemaps);\n\n return { injectDebugIds, upload, stampEmittedFiles: injectDebugIds && !upload };\n}\n\n/** Reads the internal `sourcemaps.sdkDeleteSourceMaps` option, calling its function form if given. */\nexport function getSdkDeleteSourceMaps(options: NormalizedOptions, environment?: string): boolean | undefined {\n const value = options.sourcemaps?.sdkDeleteSourceMaps;\n return typeof value === 'function' ? value(environment) : value;\n}\n\n/**\n * Reads `sourcemaps.delete`. When it is unset, `sourcemaps.deleteSourcemapsAfterUpload` decides, and\n * then the SDK.\n */\nexport function getDeleteOption(options: NormalizedOptions, environment?: string): boolean | undefined {\n return (\n options.sourcemaps?.delete ??\n options.sourcemaps?.deleteSourcemapsAfterUpload ??\n getSdkDeleteSourceMaps(options, environment)\n );\n}\n\n/**\n * Decides whether the plugin turns hidden source maps on and whether it removes the maps from the\n * build output after the upload. The plugin only turns maps on when an upload can run, and only\n * removes maps it turned on itself unless `deleteSourcemapsAfterUpload` or the SDK's\n * `sdkDeleteSourceMaps` says otherwise. The user's `deleteSourcemapsAfterUpload` wins over the SDK.\n */\nexport function decideSourceMapHandling(\n kind: SourceMapKind,\n options: NormalizedOptions,\n uploadPossible: boolean,\n environment?: string,\n): SourceMapDecision {\n const features = getSourceMapFeatures(options);\n\n if (options.sourcemaps?.delete !== undefined) {\n return decideWithDeleteOption(kind, options.sourcemaps.delete, features, uploadPossible);\n }\n\n const userDeleteOption = options.sourcemaps?.deleteSourcemapsAfterUpload;\n const sdkDeleteOption = getSdkDeleteSourceMaps(options, environment);\n const deleteOption = userDeleteOption ?? sdkDeleteOption;\n const sdkRemovesAll = sdkDeleteOption === true;\n const fromUser = userDeleteOption !== undefined;\n\n if (!uploadPossible || !features.upload) {\n if (deleteOption !== true || (kind !== 'hidden' && kind !== 'visible')) {\n return NO_CHANGE;\n }\n // Users switch the upload off to upload the maps themselves. The SDK's\n // deletion still runs, as the SDKs' own globs did.\n if (!features.upload && !sdkRemovesAll) {\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: `\\`sourcemaps.deleteSourcemapsAfterUpload\\` is set, but source map upload is disabled with ${\n resolveSourceMapsFeatures(options.sourcemaps).legacyDisable\n ? '`sourcemaps.disable`'\n : '`sourcemaps.upload` or `sourcemaps.injectDebugIds`'\n }, so the source maps are not removed.`,\n },\n };\n }\n return {\n enableHidden: kind === 'visible',\n deleteAfterUpload: true,\n removeAllSourceMaps: sdkRemovesAll,\n log: fromUser\n ? {\n level: 'warn',\n message:\n 'Source maps are not uploaded, but they are removed from the build output because `sourcemaps.deleteSourcemapsAfterUpload` is set.',\n }\n : {\n level: 'info',\n message: 'Source maps are not uploaded, but the Sentry SDK removes them from the build output.',\n },\n };\n }\n\n switch (kind) {\n case 'off':\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: SOURCE_MAPS_OFF_MESSAGE,\n },\n };\n\n case 'inline':\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: INLINE_SOURCE_MAPS_MESSAGE,\n },\n };\n\n case 'unset':\n if (deleteOption === false) {\n return {\n enableHidden: true,\n deleteAfterUpload: false,\n log: {\n level: 'info',\n message: 'Enabling hidden source maps. They are uploaded to Sentry and kept in the build output.',\n },\n };\n }\n return {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: {\n level: 'info',\n message:\n 'Enabling hidden source maps. They are uploaded to Sentry and removed from the build output. ' +\n 'Set `sourcemaps.delete: false` to keep them.',\n },\n };\n\n case 'hidden':\n if (deleteOption !== true) {\n return NO_CHANGE;\n }\n return { enableHidden: false, deleteAfterUpload: true, removeAllSourceMaps: sdkRemovesAll };\n\n case 'visible':\n if (deleteOption !== true) {\n return NO_CHANGE;\n }\n return {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: sdkRemovesAll,\n log: {\n level: 'info',\n message: fromUser\n ? 'Switching to hidden source maps because `sourcemaps.deleteSourcemapsAfterUpload` is set. ' +\n 'Without the `sourceMappingURL` comment browsers do not request the removed map files.'\n : 'Switching to hidden source maps, because the Sentry SDK removes them from the build output. ' +\n 'Without the `sourceMappingURL` comment browsers do not request the removed map files.',\n },\n };\n }\n}\n\n/**\n * The decision when `sourcemaps.delete` is set. Unlike `deleteSourcemapsAfterUpload`, it does not\n * depend on an upload: `true` removes every source map of the build, and `false` keeps the hidden\n * source maps the plugin turns on, also when nothing is uploaded.\n */\nfunction decideWithDeleteOption(\n kind: SourceMapKind,\n deleteSourceMaps: boolean,\n features: SourceMapFeatures,\n uploadPossible: boolean,\n): SourceMapDecision {\n switch (kind) {\n case 'off':\n return uploadPossible ? { ...NO_CHANGE, log: { level: 'warn', message: SOURCE_MAPS_OFF_MESSAGE } } : NO_CHANGE;\n\n case 'inline':\n return uploadPossible ? { ...NO_CHANGE, log: { level: 'warn', message: INLINE_SOURCE_MAPS_MESSAGE } } : NO_CHANGE;\n\n case 'unset':\n if (deleteSourceMaps) {\n // Maps that are only turned on to be removed again are not turned on.\n return uploadPossible\n ? {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: {\n level: 'info',\n message: 'Enabling hidden source maps. They are uploaded to Sentry and removed from the build output.',\n },\n }\n : NO_CHANGE;\n }\n // Without debug IDs the maps are of no use to Sentry.\n if (!features.injectDebugIds) {\n return NO_CHANGE;\n }\n return {\n enableHidden: true,\n deleteAfterUpload: false,\n log: {\n level: 'info',\n message: uploadPossible\n ? 'Enabling hidden source maps. They are uploaded to Sentry and kept in the build output.'\n : 'Enabling hidden source maps. They are not uploaded to Sentry and are kept in the build output, because `sourcemaps.delete` is `false`.',\n },\n };\n\n case 'hidden':\n case 'visible':\n if (!deleteSourceMaps) {\n return NO_CHANGE;\n }\n return {\n enableHidden: kind === 'visible',\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: uploadPossible\n ? kind === 'visible'\n ? {\n level: 'info',\n message:\n 'Switching to hidden source maps because `sourcemaps.delete` is set. ' +\n 'Without the `sourceMappingURL` comment browsers do not request the removed map files.',\n }\n : undefined\n : {\n level: 'warn',\n message:\n 'Source maps are not uploaded, but they are removed from the build output because `sourcemaps.delete` is set.',\n },\n };\n }\n}\n"],"mappings":";;AA2BA,MAAM,YAA+B;CAAE,cAAc;CAAO,mBAAmB;AAAM;AAErF,MAAM,0BACJ;AAGF,MAAM,6BACJ;;;;;AAoBF,SAAgB,qBAAqB,SAA+C;CAClF,MAAM,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,SACE;IAEJ,IACA,KAAA,IACF;KACE,OAAO;KACP,SACE;IACJ;GACN;CACJ;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../../src/core/version.ts"],"sourcesContent":["export const LIB_VERSION = \"11.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../../src/core/version.ts"],"sourcesContent":["export const LIB_VERSION = \"11.19.0\";\n"],"mappings":";AAAA,MAAa,cAAc"}
|
|
@@ -78,7 +78,7 @@ function createViteSourceMapHooks(sentryBuildPluginManager, sourceMapHandling) {
|
|
|
78
78
|
const environmentName = decisions.has(name) ? name : void 0;
|
|
79
79
|
const { normalizedOptions } = sentryBuildPluginManager;
|
|
80
80
|
const deleteOption = require_sourcemap_settings.getDeleteOption(normalizedOptions, environmentName);
|
|
81
|
-
const removeAll = normalizedOptions.sourcemaps?.delete === true || require_sourcemap_settings.
|
|
81
|
+
const removeAll = normalizedOptions.sourcemaps?.delete === true || require_sourcemap_settings.getSdkDeleteSourceMaps(normalizedOptions, environmentName) === true;
|
|
82
82
|
for (const output of getOutputs(config.root, environment.build)) {
|
|
83
83
|
if (output.ownSetting) {
|
|
84
84
|
const outputKind = require_source_map_handling.sourceMapKindFromRollupSetting(output.sourcemap);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-map-hooks.js","names":["path","getOutputMatch","sourceMapKindFromRollupSetting","getDeleteOption","
|
|
1
|
+
{"version":3,"file":"source-map-hooks.js","names":["path","getOutputMatch","sourceMapKindFromRollupSetting","getDeleteOption","getSdkDeleteSourceMaps"],"sources":["../../../src/vite/source-map-hooks.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { SentryBuildPluginManager, SourceMapDecision, SourceMapKind } from '../core';\nimport { getDeleteOption, getSdkDeleteSourceMaps } from '../core';\nimport type { OutputMatch, RollupSourceMapSetting, SourceMapHandling } from '../rollup/source-map-handling';\nimport { getOutputMatch, sourceMapKindFromRollupSetting } from '../rollup/source-map-handling';\n\ntype BundlerOutput = OutputMatch & { dir?: string; sourcemap?: RollupSourceMapSetting };\ntype BundlerOutputOptions = BundlerOutput | BundlerOutput[] | undefined;\n\ntype ViteBuildOptions = {\n sourcemap?: RollupSourceMapSetting;\n outDir?: string;\n rollupOptions?: { output?: BundlerOutputOptions };\n rolldownOptions?: { output?: BundlerOutputOptions };\n};\n\nexport type ViteUserConfig = {\n build?: ViteBuildOptions;\n environments?: Record<string, { build?: ViteBuildOptions } | undefined>;\n};\n\nexport type ViteResolvedConfig = {\n root: string;\n build: ViteBuildOptions;\n environments?: Record<string, { build: ViteBuildOptions }>;\n};\n\nexport type ViteSourceMapHooks = {\n config: (userConfig: ViteUserConfig, env: { command: string }) => ViteUserConfig | null;\n configResolved: (config: ViteResolvedConfig) => void;\n outputOptions: SourceMapHandling['applyHiddenDecision'];\n};\n\nconst NO_CHANGE: SourceMapDecision = { enableHidden: false, deleteAfterUpload: false };\n\ntype EnvironmentOutput = {\n destination: string;\n match: OutputMatch;\n sourcemap: RollupSourceMapSetting;\n /** The output sets `sourcemap` itself, which overrides `build.sourcemap`. */\n ownSetting: boolean;\n};\n\n/**\n * The outputs an environment writes: one per entry of `rollupOptions.output` or\n * `rolldownOptions.output`. An output writes to `build.outDir` (relative to the root) unless it\n * sets its own `dir`, which the bundler resolves from the working directory. An output's own\n * `sourcemap` overrides `build.sourcemap`.\n */\nfunction getOutputs(root: string, build: ViteBuildOptions): EnvironmentOutput[] {\n const configured = build.rolldownOptions?.output ?? build.rollupOptions?.output;\n const outputs = Array.isArray(configured) ? configured : [configured ?? {}];\n\n return outputs.map(output => {\n const sourcemap = output.sourcemap ?? build.sourcemap;\n return {\n destination: output.dir === undefined ? path.resolve(root, build.outDir ?? 'dist') : path.resolve(output.dir),\n match: getOutputMatch({ ...output, sourcemap }),\n sourcemap,\n ownSetting: output.sourcemap !== undefined,\n };\n });\n}\n\n/**\n * Vite warns about `rollupOptions.output.sourcemap`, so the Vite plugin decides on `build.sourcemap`\n * in a `config` hook. The hook belongs on the post plugin: framework plugins that set\n * `build.sourcemap` themselves run first, and the decision sees the merged setting. The output\n * directories are only known in `configResolved`, which then records the decision for each of them.\n */\nexport function createViteSourceMapHooks(\n sentryBuildPluginManager: SentryBuildPluginManager,\n sourceMapHandling: SourceMapHandling,\n): ViteSourceMapHooks {\n // `'*'` for the top-level setting, otherwise the name of an environment with its own.\n const decisions = new Map<string, { kind: SourceMapKind; decision: SourceMapDecision }>();\n\n return {\n config: (userConfig, env) => {\n if (env.command !== 'build') {\n return null;\n }\n\n // The same plugin instances can serve several builds in a row.\n decisions.clear();\n\n const kind = sourceMapKindFromRollupSetting(userConfig.build?.sourcemap);\n // Logged in `generateBundle`, which knows whether the output is written.\n const decision = sentryBuildPluginManager.sourceMaps.decide(kind, { log: false });\n decisions.set('*', { kind, decision });\n\n const result: ViteUserConfig = decision.enableHidden ? { build: { sourcemap: 'hidden' } } : {};\n\n for (const [name, environment] of Object.entries(userConfig.environments ?? {})) {\n const setting = environment?.build?.sourcemap;\n if (setting === undefined) {\n continue;\n }\n\n const environmentKind = sourceMapKindFromRollupSetting(setting);\n const environmentDecision = sentryBuildPluginManager.sourceMaps.decide(environmentKind, {\n log: false,\n environment: name,\n });\n decisions.set(name, { kind: environmentKind, decision: environmentDecision });\n\n if (environmentDecision.enableHidden) {\n result.environments = { ...result.environments, [name]: { build: { sourcemap: 'hidden' } } };\n }\n }\n\n return result;\n },\n\n configResolved: config => {\n const environments = config.environments ?? { client: { build: config.build } };\n\n for (const [name, environment] of Object.entries(environments)) {\n const { kind, decision } = decisions.get(name) ?? decisions.get('*') ?? { kind: 'unset', decision: NO_CHANGE };\n const environmentName = decisions.has(name) ? name : undefined;\n const { normalizedOptions } = sentryBuildPluginManager;\n const deleteOption = getDeleteOption(normalizedOptions, environmentName);\n // `sourcemaps.delete: true` removes every source map, like for maps the SDK turned on.\n const removeAll =\n normalizedOptions.sourcemaps?.delete === true ||\n getSdkDeleteSourceMaps(normalizedOptions, environmentName) === true;\n\n for (const output of getOutputs(config.root, environment.build)) {\n // Hidden maps of an output's own setting are removed when the user\n // asks for it, visible ones only when every source map is removed.\n // Removed visible maps switch to hidden in `outputOptions`, so no\n // `sourceMappingURL` comment points at a removed file.\n if (output.ownSetting) {\n const outputKind = sourceMapKindFromRollupSetting(output.sourcemap);\n const removeAllSourceMaps = removeAll && (outputKind === 'hidden' || outputKind === 'visible');\n const deleteAfterUpload = deleteOption === true && (outputKind === 'hidden' || removeAllSourceMaps);\n sourceMapHandling.setDecision(output.destination, {\n match: output.match,\n kind: outputKind,\n decision: {\n enableHidden: outputKind === 'visible' && deleteAfterUpload,\n deleteAfterUpload,\n removeAllSourceMaps,\n },\n });\n continue;\n }\n\n // A plugin that ran after ours may have changed the setting again.\n if (decision.deleteAfterUpload && output.sourcemap !== 'hidden') {\n sentryBuildPluginManager.logger.debug(\n `Source maps of the \"${name}\" environment are set to ${JSON.stringify(output.sourcemap)}. Not removing them after upload.`,\n );\n sourceMapHandling.setDecision(output.destination, { match: output.match, kind, decision: NO_CHANGE });\n } else {\n sourceMapHandling.setDecision(output.destination, { match: output.match, kind, decision });\n }\n }\n }\n },\n\n outputOptions: sourceMapHandling.applyHiddenDecision,\n };\n}\n"],"mappings":";;;;;;;AAiCA,MAAM,YAA+B;CAAE,cAAc;CAAO,mBAAmB;AAAM;;;;;;;AAgBrF,SAAS,WAAW,MAAc,OAA8C;CAC9E,MAAM,aAAa,MAAM,iBAAiB,UAAU,MAAM,eAAe;CAGzE,QAFgB,MAAM,QAAQ,UAAU,IAAI,aAAa,CAAC,cAAc,CAAC,CAAC,EAAA,CAE3D,KAAI,WAAU;EAC3B,MAAM,YAAY,OAAO,aAAa,MAAM;EAC5C,OAAO;GACL,aAAa,OAAO,QAAQ,KAAA,IAAYA,UAAK,QAAQ,MAAM,MAAM,UAAU,MAAM,IAAIA,UAAK,QAAQ,OAAO,GAAG;GAC5G,OAAOC,4BAAAA,eAAe;IAAE,GAAG;I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AU;IAC7G,MAAM,kBAAkB,UAAU,IAAI,IAAI,IAAI,OAAO,KAAA;IACrD,MAAM,EAAE,sBAAsB;IAC9B,MAAM,eAAeC,2BAAAA,gBAAgB,mBAAmB,eAAe;IAEvE,MAAM,YACJ,kBAAkB,YAAY,WAAW,QACzCC,2BAAAA,uBAAuB,mBAAmB,eAAe,MAAM;IAEjE,KAAK,MAAM,UAAU,WAAW,OAAO,MAAM,YAAY,KAAK,GAAG;KAK/D,IAAI,OAAO,YAAY;MACrB,MAAM,aAAaF,4BAAAA,+BAA+B,OAAO,SAAS;MAClE,MAAM,sBAAsB,cAAc,eAAe,YAAY,eAAe;MACpF,MAAM,oBAAoB,iBAAiB,SAAS,eAAe,YAAY;MAC/E,kBAAkB,YAAY,OAAO,aAAa;OAChD,OAAO,OAAO;OACd,MAAM;OACN,UAAU;QACR,cAAc,eAAe,aAAa;QAC1C;QACA;OACF;MACF,CAAC;MACD;KACF;KAGA,IAAI,SAAS,qBAAqB,OAAO,cAAc,UAAU;MAC/D,yBAAyB,OAAO,MAC9B,uBAAuB,KAAK,2BAA2B,KAAK,UAAU,OAAO,SAAS,EAAE,kCAC1F;MACA,kBAAkB,YAAY,OAAO,aAAa;OAAE,OAAO,OAAO;OAAO;OAAM,UAAU;MAAU,CAAC;KACtG,OACE,kBAAkB,YAAY,OAAO,aAAa;MAAE,OAAO,OAAO;MAAO;MAAM;KAAS,CAAC;IAE7F;GACF;EACF;EAEA,eAAe,kBAAkB;CACnC;AACF"}
|
package/build/esm/core/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { getCodeInjectionPosition } from "./get-code-injection-position.js";
|
|
|
5
5
|
import { createComponentNameAnnotateHooks } from "./component-annotate-hooks.js";
|
|
6
6
|
import { createSentryBuildPluginManager } from "./build-plugin-manager.js";
|
|
7
7
|
import { addDebugIdToEmittedArtifacts, createDebugIdUploadFunction, stampDebugId } from "./debug-id-upload.js";
|
|
8
|
-
import { decideSourceMapHandling, getDeleteOption,
|
|
8
|
+
import { decideSourceMapHandling, getDeleteOption, getSdkDeleteSourceMaps, getSourceMapFeatures } from "./sourcemap-settings.js";
|
|
9
9
|
import { hasSourceMapUploadCredentials } from "./upload-credentials.js";
|
|
10
10
|
// src/core/index.ts
|
|
11
11
|
/**
|
|
@@ -70,6 +70,6 @@ function isInitialChunk(chunk, chunks) {
|
|
|
70
70
|
function getDebugIdSnippet(debugId) {
|
|
71
71
|
return new CodeInjection(`var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="${debugId}",e._sentryDebugIdIdentifier="sentry-dbid-${debugId}");`);
|
|
72
72
|
}
|
|
73
|
-
export { CodeInjection, addDebugIdToEmittedArtifacts, createComponentNameAnnotateHooks, createDebugIdUploadFunction, createSentryBuildPluginManager, decideSourceMapHandling, generateModuleMetadataInjectorCode, generateReleaseInjectorCode, getCodeInjectionPosition, getDebugIdSnippet, getDeleteOption,
|
|
73
|
+
export { CodeInjection, addDebugIdToEmittedArtifacts, createComponentNameAnnotateHooks, createDebugIdUploadFunction, createSentryBuildPluginManager, decideSourceMapHandling, generateModuleMetadataInjectorCode, generateReleaseInjectorCode, getCodeInjectionPosition, getDebugIdSnippet, getDeleteOption, getSdkDeleteSourceMaps, getSourceMapFeatures, globFiles, hasSourceMapUploadCredentials, isInitialChunk, isJsFile, replaceBooleanFlagsInCode, resolveReleaseName, shouldSkipCodeInjection, stampDebugId, stringToUUID };
|
|
74
74
|
|
|
75
75
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/core/index.ts"],"sourcesContent":["import { CodeInjection, containsOnlyImports, stripQueryAndHashFromPath } from './utils';\n\n/**\n * Checks if a file is a JavaScript file based on its extension.\n * Handles query strings and hashes in the filename.\n */\nexport function isJsFile(fileName: string): boolean {\n const cleanFileName = stripQueryAndHashFromPath(fileName);\n return ['.js', '.mjs', '.cjs'].some(ext => cleanFileName.endsWith(ext));\n}\n\n/**\n * Checks if a chunk should be skipped for code injection\n *\n * This is necessary to handle Vite's MPA (multi-page application) mode where\n * HTML entry points create \"facade\" chunks that should not contain injected code.\n * See: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/829\n *\n * However, in SPA mode, the main bundle also has an HTML facade but contains\n * substantial application code. We should NOT skip injection for these bundles.\n *\n * @param code - The chunk's code content\n * @param facadeModuleId - The facade module ID (if any) - HTML files create facade chunks\n * @returns true if the chunk should be skipped\n */\nexport function shouldSkipCodeInjection(code: string, facadeModuleId: string | null | undefined): boolean {\n // Skip empty chunks - these are placeholder chunks that should be optimized away\n if (code.trim().length === 0) {\n return true;\n }\n\n // For HTML facade chunks, only skip if they contain only import statements\n if (facadeModuleId && stripQueryAndHashFromPath(facadeModuleId).endsWith('.html')) {\n return containsOnlyImports(code);\n }\n\n return false;\n}\n\nexport interface ChunkGraphNode {\n fileName: string;\n isEntry?: boolean;\n imports?: string[];\n}\n\nconst initialChunksCache = new WeakMap<Record<string, ChunkGraphNode>, Set<string>>();\n\nfunction getInitialChunks(chunks: Record<string, ChunkGraphNode>): Set<string> {\n const cached = initialChunksCache.get(chunks);\n if (cached) {\n return cached;\n }\n\n const initial = new Set<string>();\n const queue = Object.values(chunks).filter(chunk => chunk.isEntry);\n\n for (let chunk = queue.shift(); chunk; chunk = queue.shift()) {\n if (initial.has(chunk.fileName)) {\n continue;\n }\n initial.add(chunk.fileName);\n for (const imported of chunk.imports ?? []) {\n const importedChunk = chunks[imported];\n if (importedChunk) {\n queue.push(importedChunk);\n }\n }\n }\n\n initialChunksCache.set(chunks, initial);\n return initial;\n}\n\n/**\n * Whether a chunk loads at startup: it is an entry chunk, or an entry chunk\n * reaches it through static imports. Chunks that only dynamic imports reach\n * load later, after startup code already ran.\n *\n * Without the chunk graph every chunk counts as initial.\n */\nexport function isInitialChunk(\n chunk: Pick<ChunkGraphNode, 'fileName' | 'isEntry'>,\n chunks: Record<string, ChunkGraphNode> | undefined,\n): boolean {\n if (chunk.isEntry || !chunks) {\n return true;\n }\n\n return getInitialChunks(chunks).has(chunk.fileName);\n}\n\nexport { globFiles } from './glob';\nexport { getCodeInjectionPosition } from './get-code-injection-position';\n\nexport { createComponentNameAnnotateHooks } from './component-annotate-hooks';\n\nexport function getDebugIdSnippet(debugId: string): CodeInjection {\n return new CodeInjection(\n `var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]=\"${debugId}\",e._sentryDebugIdIdentifier=\"sentry-dbid-${debugId}\");`,\n );\n}\n\nexport type { Logger } from './logger';\nexport type { InternalOptions, Options, SentrySDKBuildFlags } from './types';\nexport {\n CodeInjection,\n replaceBooleanFlagsInCode,\n stringToUUID,\n generateReleaseInjectorCode,\n generateModuleMetadataInjectorCode,\n resolveReleaseName,\n} from './utils';\nexport { createSentryBuildPluginManager } from './build-plugin-manager';\nexport type { SentryBuildPluginManager, UploadResult, UploadStaging } from './build-plugin-manager';\nexport { createDebugIdUploadFunction, addDebugIdToEmittedArtifacts, stampDebugId } from './debug-id-upload';\nexport {\n decideSourceMapHandling,\n getDeleteOption,\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/core/index.ts"],"sourcesContent":["import { CodeInjection, containsOnlyImports, stripQueryAndHashFromPath } from './utils';\n\n/**\n * Checks if a file is a JavaScript file based on its extension.\n * Handles query strings and hashes in the filename.\n */\nexport function isJsFile(fileName: string): boolean {\n const cleanFileName = stripQueryAndHashFromPath(fileName);\n return ['.js', '.mjs', '.cjs'].some(ext => cleanFileName.endsWith(ext));\n}\n\n/**\n * Checks if a chunk should be skipped for code injection\n *\n * This is necessary to handle Vite's MPA (multi-page application) mode where\n * HTML entry points create \"facade\" chunks that should not contain injected code.\n * See: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/829\n *\n * However, in SPA mode, the main bundle also has an HTML facade but contains\n * substantial application code. We should NOT skip injection for these bundles.\n *\n * @param code - The chunk's code content\n * @param facadeModuleId - The facade module ID (if any) - HTML files create facade chunks\n * @returns true if the chunk should be skipped\n */\nexport function shouldSkipCodeInjection(code: string, facadeModuleId: string | null | undefined): boolean {\n // Skip empty chunks - these are placeholder chunks that should be optimized away\n if (code.trim().length === 0) {\n return true;\n }\n\n // For HTML facade chunks, only skip if they contain only import statements\n if (facadeModuleId && stripQueryAndHashFromPath(facadeModuleId).endsWith('.html')) {\n return containsOnlyImports(code);\n }\n\n return false;\n}\n\nexport interface ChunkGraphNode {\n fileName: string;\n isEntry?: boolean;\n imports?: string[];\n}\n\nconst initialChunksCache = new WeakMap<Record<string, ChunkGraphNode>, Set<string>>();\n\nfunction getInitialChunks(chunks: Record<string, ChunkGraphNode>): Set<string> {\n const cached = initialChunksCache.get(chunks);\n if (cached) {\n return cached;\n }\n\n const initial = new Set<string>();\n const queue = Object.values(chunks).filter(chunk => chunk.isEntry);\n\n for (let chunk = queue.shift(); chunk; chunk = queue.shift()) {\n if (initial.has(chunk.fileName)) {\n continue;\n }\n initial.add(chunk.fileName);\n for (const imported of chunk.imports ?? []) {\n const importedChunk = chunks[imported];\n if (importedChunk) {\n queue.push(importedChunk);\n }\n }\n }\n\n initialChunksCache.set(chunks, initial);\n return initial;\n}\n\n/**\n * Whether a chunk loads at startup: it is an entry chunk, or an entry chunk\n * reaches it through static imports. Chunks that only dynamic imports reach\n * load later, after startup code already ran.\n *\n * Without the chunk graph every chunk counts as initial.\n */\nexport function isInitialChunk(\n chunk: Pick<ChunkGraphNode, 'fileName' | 'isEntry'>,\n chunks: Record<string, ChunkGraphNode> | undefined,\n): boolean {\n if (chunk.isEntry || !chunks) {\n return true;\n }\n\n return getInitialChunks(chunks).has(chunk.fileName);\n}\n\nexport { globFiles } from './glob';\nexport { getCodeInjectionPosition } from './get-code-injection-position';\n\nexport { createComponentNameAnnotateHooks } from './component-annotate-hooks';\n\nexport function getDebugIdSnippet(debugId: string): CodeInjection {\n return new CodeInjection(\n `var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]=\"${debugId}\",e._sentryDebugIdIdentifier=\"sentry-dbid-${debugId}\");`,\n );\n}\n\nexport type { Logger } from './logger';\nexport type { InternalOptions, Options, SentrySDKBuildFlags } from './types';\nexport {\n CodeInjection,\n replaceBooleanFlagsInCode,\n stringToUUID,\n generateReleaseInjectorCode,\n generateModuleMetadataInjectorCode,\n resolveReleaseName,\n} from './utils';\nexport { createSentryBuildPluginManager } from './build-plugin-manager';\nexport type { SentryBuildPluginManager, UploadResult, UploadStaging } from './build-plugin-manager';\nexport { createDebugIdUploadFunction, addDebugIdToEmittedArtifacts, stampDebugId } from './debug-id-upload';\nexport {\n decideSourceMapHandling,\n getDeleteOption,\n getSdkDeleteSourceMaps,\n getSourceMapFeatures,\n} from './sourcemap-settings';\nexport type { SourceMapDecision, SourceMapKind } from './sourcemap-settings';\nexport { hasSourceMapUploadCredentials } from './upload-credentials';\nexport type { UploadFilter } from './upload-filter';\n"],"mappings":";;;;;;;;;;;;;;AAMA,SAAgB,SAAS,UAA2B;CAClD,MAAM,gBAAgB,0BAA0B,QAAQ;CACxD,OAAO;EAAC;EAAO;EAAQ;CAAM,CAAC,CAAC,MAAK,QAAO,cAAc,SAAS,GAAG,CAAC;AACxE;;;;;;;;;;;;;;;AAgBA,SAAgB,wBAAwB,MAAc,gBAAoD;CAExG,IAAI,KAAK,KAAK,CAAC,CAAC,WAAW,GACzB,OAAO;CAIT,IAAI,kBAAkB,0BAA0B,cAAc,CAAC,CAAC,SAAS,OAAO,GAC9E,OAAO,oBAAoB,IAAI;CAGjC,OAAO;AACT;AAQA,MAAM,qCAAqB,IAAI,QAAqD;AAEpF,SAAS,iBAAiB,QAAqD;CAC7E,MAAM,SAAS,mBAAmB,IAAI,MAAM;CAC5C,IAAI,QACF,OAAO;CAGT,MAAM,0BAAU,IAAI,IAAY;CAChC,MAAM,QAAQ,OAAO,OAAO,MAAM,CAAC,CAAC,QAAO,UAAS,MAAM,OAAO;CAEjE,KAAK,IAAI,QAAQ,MAAM,MAAM,GAAG,OAAO,QAAQ,MAAM,MAAM,GAAG;EAC5D,IAAI,QAAQ,IAAI,MAAM,QAAQ,GAC5B;EAEF,QAAQ,IAAI,MAAM,QAAQ;EAC1B,KAAK,MAAM,YAAY,MAAM,WAAW,CAAC,GAAG;GAC1C,MAAM,gBAAgB,OAAO;GAC7B,IAAI,eACF,MAAM,KAAK,aAAa;EAE5B;CACF;CAEA,mBAAmB,IAAI,QAAQ,OAAO;CACtC,OAAO;AACT;;;;;;;;AASA,SAAgB,eACd,OACA,QACS;CACT,IAAI,MAAM,WAAW,CAAC,QACpB,OAAO;CAGT,OAAO,iBAAiB,MAAM,CAAC,CAAC,IAAI,MAAM,QAAQ;AACpD;AAOA,SAAgB,kBAAkB,SAAgC;CAChE,OAAO,IAAI,cACT,+FAA+F,QAAQ,4CAA4C,QAAQ,IAC7J;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options-mapping.js","names":[],"sources":["../../../src/core/options-mapping.ts"],"sourcesContent":["import { getVercelEnv, warnOnConflictingSourceMapOptions } from '@sentry/core';\nimport type { Logger } from './logger';\nimport type {\n InternalOptions as UserOptions,\n SetCommitsOptions,\n RewriteSourcesHook,\n ResolveSourceMapHook,\n IncludeEntry,\n ModuleMetadata,\n ModuleMetadataCallback,\n} from './types';\nimport { parseProjectEnvVar } from './upload-credentials';\nimport { canAutoDetectRepository, readCommitEnvVar, resolveReleaseName } from './utils';\n\nexport type NormalizedOptions = {\n org: string | undefined;\n project: string | string[] | undefined;\n authToken: string | undefined;\n url: string | undefined;\n headers: Record<string, string> | undefined;\n debug: boolean;\n silent: boolean;\n errorHandler: ((err: Error) => void) | undefined;\n telemetry: boolean;\n disable: boolean;\n sourcemaps:\n | {\n disable?: boolean | 'disable-upload';\n upload?: boolean;\n injectDebugIds?: boolean;\n delete?: boolean;\n assets?: string | string[];\n ignore?: string | string[];\n rewriteSources?: RewriteSourcesHook;\n resolveSourceMap?: ResolveSourceMapHook;\n filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;\n deleteSourcemapsAfterUpload?: boolean | ((environment?: string) => boolean | undefined);\n sdkEnabledSourceMaps?: boolean | ((environment?: string) => boolean | undefined);\n }\n | undefined;\n release: {\n name: string | undefined;\n inject: boolean | 'html';\n create: boolean;\n finalize: boolean;\n vcsRemote: string;\n setCommits:\n | (SetCommitsOptions & {\n shouldNotThrowOnFailure?: boolean;\n })\n | false\n | undefined;\n dist?: string;\n deploy?:\n | {\n env: string;\n started?: number | string;\n finished?: number | string;\n time?: number;\n name?: string;\n url?: string;\n }\n | false;\n uploadLegacySourcemaps?: string | IncludeEntry | Array<string | IncludeEntry>;\n };\n bundleSizeOptimizations:\n | {\n excludeDebugStatements?: boolean;\n excludeTracing?: boolean;\n excludeChannelInjection?: boolean;\n excludeReplayCanvas?: boolean;\n excludeReplayShadowDom?: boolean;\n excludeReplayIframe?: boolean;\n excludeReplayWorker?: boolean;\n }\n | undefined;\n reactComponentAnnotation:\n | {\n enabled?: boolean;\n ignoredComponents?: string[];\n _experimentalInjectIntoHtml?: boolean;\n }\n | undefined;\n _metaOptions: {\n telemetry: {\n metaFramework: string | undefined;\n bundlerMajorVersion: string | undefined;\n };\n };\n applicationKey: string | undefined;\n moduleMetadata: ModuleMetadata | ModuleMetadataCallback | undefined;\n _experiments: {\n injectBuildInformation?: boolean;\n } & Record<string, unknown>;\n};\n\nexport const SENTRY_SAAS_URL = 'https://sentry.io';\n\n// oxlint-disable-next-line complexity\nexport function normalizeUserOptions(userOptions: UserOptions): NormalizedOptions {\n const options = {\n org: userOptions.org ?? process.env['SENTRY_ORG'],\n project: userOptions.project ?? parseProjectEnvVar(process.env['SENTRY_PROJECT']),\n authToken: userOptions.authToken ?? process.env['SENTRY_AUTH_TOKEN'],\n // No sentry.io default: the CLI then uses the server an `sntrys_` org token was issued for, and\n // sentry.io otherwise. A default here would send self-hosted tokens to sentry.io.\n url: userOptions.url ?? process.env['SENTRY_URL'],\n headers: userOptions.headers,\n debug: userOptions.debug ?? false,\n silent: userOptions.silent ?? false,\n errorHandler: userOptions.errorHandler,\n telemetry: userOptions.telemetry ?? true,\n disable: userOptions.disable ?? false,\n sourcemaps: userOptions.sourcemaps,\n release: {\n ...userOptions.release,\n name: resolveReleaseName(userOptions.release?.name),\n inject: userOptions.release?.inject ?? true,\n create: userOptions.release?.create ?? true,\n finalize: userOptions.release?.finalize ?? true,\n vcsRemote: userOptions.release?.vcsRemote ?? process.env['SENTRY_VSC_REMOTE'] ?? 'origin',\n // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- rule false positive: the cast carries the internal `shouldNotThrowOnFailure` field; tsc errors without it\n setCommits: userOptions.release?.setCommits as\n | (SetCommitsOptions & { shouldNotThrowOnFailure?: boolean })\n | false\n | undefined,\n },\n bundleSizeOptimizations: userOptions.bundleSizeOptimizations,\n reactComponentAnnotation: userOptions.reactComponentAnnotation,\n _metaOptions: {\n telemetry: {\n metaFramework: userOptions._metaOptions?.telemetry?.metaFramework,\n bundlerMajorVersion: userOptions._metaOptions?.telemetry?.bundlerMajorVersion,\n },\n },\n applicationKey: userOptions.applicationKey,\n moduleMetadata: userOptions.moduleMetadata,\n _experiments: userOptions._experiments ?? {},\n };\n\n const vercelEnv = getVercelEnv();\n\n if (options.release.setCommits === undefined) {\n const vercelCommitSha = readCommitEnvVar('VERCEL_GIT_COMMIT_SHA');\n if (\n process.env['VERCEL'] &&\n vercelCommitSha &&\n process.env['VERCEL_GIT_REPO_SLUG'] &&\n process.env['VERCEL_GIT_REPO_OWNER'] &&\n // We only want to set commits for the production env because Sentry becomes extremely noisy (eg on slack) for\n // preview environments because the previous commit is always the \"stem\" commit of the preview/PR causing Sentry\n // to notify you for other people creating PRs.\n vercelEnv === 'production'\n ) {\n options.release.setCommits = {\n shouldNotThrowOnFailure: true,\n commit: vercelCommitSha,\n previousCommit: readCommitEnvVar('VERCEL_GIT_PREVIOUS_SHA'),\n repo: `${process.env['VERCEL_GIT_REPO_OWNER']}/${process.env['VERCEL_GIT_REPO_SLUG']}`,\n ignoreEmpty: true,\n ignoreMissing: true,\n };\n } else if (\n process.env['VERCEL'] &&\n vercelEnv !== 'production' &&\n !canAutoDetectRepository(options.release.vcsRemote)\n ) {\n // Vercel's own builders have no git remote and no other CI variables, so commit association can only fail there.\n // Builds that have either, such as `vercel build` in GitHub Actions, keep `auto: true` below.\n options.release.setCommits = false;\n } else {\n options.release.setCommits = {\n shouldNotThrowOnFailure: true,\n auto: true,\n ignoreEmpty: true,\n ignoreMissing: true,\n };\n }\n }\n\n if (options.release.deploy === undefined && process.env['VERCEL'] && vercelEnv) {\n options.release.deploy = {\n env: vercelEnv,\n url: process.env['VERCEL_URL'] ? `https://${process.env['VERCEL_URL']}` : undefined,\n };\n }\n\n return options;\n}\n\n/**\n * Validates a few combinations of options that are not checked by Sentry CLI.\n *\n * For all other options, we can rely on Sentry CLI to validate them. In fact,\n * we can't validate them in the plugin because Sentry CLI might pick up options from\n * its config file.\n *\n * @param options the internal options\n * @param logger the logger\n *\n * @returns `true` if the options are valid, `false` otherwise\n */\nexport function validateOptions(options: NormalizedOptions, logger: Logger): boolean {\n const setCommits = options.release?.setCommits;\n if (setCommits) {\n if (!setCommits.auto && !(setCommits.repo && setCommits.commit)) {\n logger.error(\n 'The `setCommits` option was specified but is missing required properties.',\n 'Please set either `auto` or both, `repo` and `commit`.',\n );\n return false;\n }\n if (setCommits.auto && setCommits.repo && setCommits) {\n logger.warn(\n 'The `setCommits` options includes `auto` but also `repo` and `commit`.',\n 'Ignoring `repo` and `commit`.',\n 'Please only set either `auto` or both, `repo` and `commit`.',\n );\n }\n }\n\n warnOnConflictingSourceMapOptions(options.sourcemaps, message => logger.warn(message));\n\n if (options.release?.deploy && typeof options.release.deploy === 'object' && !options.release.deploy.env) {\n logger.error(\n 'The `deploy` option was specified but is missing the required `env` property.',\n 'Please set the `env` property.',\n );\n return false;\n }\n\n if (options.project && Array.isArray(options.project)) {\n if (options.project.length === 0) {\n logger.error(\n 'The `project` option was specified as an array but is empty.',\n 'Please provide at least one project slug.',\n );\n return false;\n }\n // Check each project is a non-empty string\n const invalidProjects = options.project.filter(p => typeof p !== 'string' || p.trim() === '');\n if (invalidProjects.length > 0) {\n logger.error('The `project` option contains invalid project slugs.', 'All projects must be non-empty strings.');\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":";;;;AAgGA,MAAa,kBAAkB;AAG/B,SAAgB,qBAAqB,aAA6C;CAChF,MAAM,UAAU;EACd,KAAK,YAAY,OAAO,QAAQ,IAAI;EACpC,SAAS,YAAY,WAAW,mBAAmB,QAAQ,IAAI,iBAAiB;EAChF,WAAW,YAAY,aAAa,QAAQ,IAAI;EAGhD,KAAK,YAAY,OAAO,QAAQ,IAAI;EACpC,SAAS,YAAY;EACrB,OAAO,YAAY,SAAS;EAC5B,QAAQ,YAAY,UAAU;EAC9B,cAAc,YAAY;EAC1B,WAAW,YAAY,aAAa;EACpC,SAAS,YAAY,WAAW;EAChC,YAAY,YAAY;EACxB,SAAS;GACP,GAAG,YAAY;GACf,MAAM,mBAAmB,YAAY,SAAS,IAAI;GAClD,QAAQ,YAAY,SAAS,UAAU;GACvC,QAAQ,YAAY,SAAS,UAAU;GACvC,UAAU,YAAY,SAAS,YAAY;GAC3C,WAAW,YAAY,SAAS,aAAa,QAAQ,IAAI,wBAAwB;GAEjF,YAAY,YAAY,SAAS;EAInC;EACA,yBAAyB,YAAY;EACrC,0BAA0B,YAAY;EACtC,cAAc,EACZ,WAAW;GACT,eAAe,YAAY,cAAc,WAAW;GACpD,qBAAqB,YAAY,cAAc,WAAW;EAC5D,EACF;EACA,gBAAgB,YAAY;EAC5B,gBAAgB,YAAY;EAC5B,cAAc,YAAY,gBAAgB,CAAC;CAC7C;CAEA,MAAM,YAAY,aAAa;CAE/B,IAAI,QAAQ,QAAQ,eAAe,KAAA,GAAW;EAC5C,MAAM,kBAAkB,iBAAiB,uBAAuB;EAChE,IACE,QAAQ,IAAI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;GACA,OAAO;EACT;EAGA,IADwB,QAAQ,QAAQ,QAAO,MAAK,OAAO,MAAM,YAAY,EAAE,KAAK,MAAM,EACxE,CAAC,CAAC,SAAS,GAAG;GAC9B,OAAO,MAAM,wDAAwD,yCAAyC;GAC9G,OAAO;EACT;CACF;CAEA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"options-mapping.js","names":[],"sources":["../../../src/core/options-mapping.ts"],"sourcesContent":["import { getVercelEnv, warnOnConflictingSourceMapOptions } from '@sentry/core';\nimport type { Logger } from './logger';\nimport type {\n InternalOptions as UserOptions,\n SetCommitsOptions,\n RewriteSourcesHook,\n ResolveSourceMapHook,\n IncludeEntry,\n ModuleMetadata,\n ModuleMetadataCallback,\n} from './types';\nimport { parseProjectEnvVar } from './upload-credentials';\nimport { canAutoDetectRepository, readCommitEnvVar, resolveReleaseName } from './utils';\n\nexport type NormalizedOptions = {\n org: string | undefined;\n project: string | string[] | undefined;\n authToken: string | undefined;\n url: string | undefined;\n headers: Record<string, string> | undefined;\n debug: boolean;\n silent: boolean;\n errorHandler: ((err: Error) => void) | undefined;\n telemetry: boolean;\n disable: boolean;\n sourcemaps:\n | {\n disable?: boolean | 'disable-upload';\n upload?: boolean;\n injectDebugIds?: boolean;\n delete?: boolean;\n assets?: string | string[];\n ignore?: string | string[];\n rewriteSources?: RewriteSourcesHook;\n resolveSourceMap?: ResolveSourceMapHook;\n filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;\n deleteSourcemapsAfterUpload?: boolean;\n sdkDeleteSourceMaps?: boolean | ((environment?: string) => boolean | undefined);\n }\n | undefined;\n release: {\n name: string | undefined;\n inject: boolean | 'html';\n create: boolean;\n finalize: boolean;\n vcsRemote: string;\n setCommits:\n | (SetCommitsOptions & {\n shouldNotThrowOnFailure?: boolean;\n })\n | false\n | undefined;\n dist?: string;\n deploy?:\n | {\n env: string;\n started?: number | string;\n finished?: number | string;\n time?: number;\n name?: string;\n url?: string;\n }\n | false;\n uploadLegacySourcemaps?: string | IncludeEntry | Array<string | IncludeEntry>;\n };\n bundleSizeOptimizations:\n | {\n excludeDebugStatements?: boolean;\n excludeTracing?: boolean;\n excludeChannelInjection?: boolean;\n excludeReplayCanvas?: boolean;\n excludeReplayShadowDom?: boolean;\n excludeReplayIframe?: boolean;\n excludeReplayWorker?: boolean;\n }\n | undefined;\n reactComponentAnnotation:\n | {\n enabled?: boolean;\n ignoredComponents?: string[];\n _experimentalInjectIntoHtml?: boolean;\n }\n | undefined;\n _metaOptions: {\n telemetry: {\n metaFramework: string | undefined;\n bundlerMajorVersion: string | undefined;\n };\n };\n applicationKey: string | undefined;\n moduleMetadata: ModuleMetadata | ModuleMetadataCallback | undefined;\n _experiments: {\n injectBuildInformation?: boolean;\n } & Record<string, unknown>;\n};\n\nexport const SENTRY_SAAS_URL = 'https://sentry.io';\n\n// oxlint-disable-next-line complexity\nexport function normalizeUserOptions(userOptions: UserOptions): NormalizedOptions {\n const options = {\n org: userOptions.org ?? process.env['SENTRY_ORG'],\n project: userOptions.project ?? parseProjectEnvVar(process.env['SENTRY_PROJECT']),\n authToken: userOptions.authToken ?? process.env['SENTRY_AUTH_TOKEN'],\n // No sentry.io default: the CLI then uses the server an `sntrys_` org token was issued for, and\n // sentry.io otherwise. A default here would send self-hosted tokens to sentry.io.\n url: userOptions.url ?? process.env['SENTRY_URL'],\n headers: userOptions.headers,\n debug: userOptions.debug ?? false,\n silent: userOptions.silent ?? false,\n errorHandler: userOptions.errorHandler,\n telemetry: userOptions.telemetry ?? true,\n disable: userOptions.disable ?? false,\n sourcemaps: userOptions.sourcemaps,\n release: {\n ...userOptions.release,\n name: resolveReleaseName(userOptions.release?.name),\n inject: userOptions.release?.inject ?? true,\n create: userOptions.release?.create ?? true,\n finalize: userOptions.release?.finalize ?? true,\n vcsRemote: userOptions.release?.vcsRemote ?? process.env['SENTRY_VSC_REMOTE'] ?? 'origin',\n // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- rule false positive: the cast carries the internal `shouldNotThrowOnFailure` field; tsc errors without it\n setCommits: userOptions.release?.setCommits as\n | (SetCommitsOptions & { shouldNotThrowOnFailure?: boolean })\n | false\n | undefined,\n },\n bundleSizeOptimizations: userOptions.bundleSizeOptimizations,\n reactComponentAnnotation: userOptions.reactComponentAnnotation,\n _metaOptions: {\n telemetry: {\n metaFramework: userOptions._metaOptions?.telemetry?.metaFramework,\n bundlerMajorVersion: userOptions._metaOptions?.telemetry?.bundlerMajorVersion,\n },\n },\n applicationKey: userOptions.applicationKey,\n moduleMetadata: userOptions.moduleMetadata,\n _experiments: userOptions._experiments ?? {},\n };\n\n const vercelEnv = getVercelEnv();\n\n if (options.release.setCommits === undefined) {\n const vercelCommitSha = readCommitEnvVar('VERCEL_GIT_COMMIT_SHA');\n if (\n process.env['VERCEL'] &&\n vercelCommitSha &&\n process.env['VERCEL_GIT_REPO_SLUG'] &&\n process.env['VERCEL_GIT_REPO_OWNER'] &&\n // We only want to set commits for the production env because Sentry becomes extremely noisy (eg on slack) for\n // preview environments because the previous commit is always the \"stem\" commit of the preview/PR causing Sentry\n // to notify you for other people creating PRs.\n vercelEnv === 'production'\n ) {\n options.release.setCommits = {\n shouldNotThrowOnFailure: true,\n commit: vercelCommitSha,\n previousCommit: readCommitEnvVar('VERCEL_GIT_PREVIOUS_SHA'),\n repo: `${process.env['VERCEL_GIT_REPO_OWNER']}/${process.env['VERCEL_GIT_REPO_SLUG']}`,\n ignoreEmpty: true,\n ignoreMissing: true,\n };\n } else if (\n process.env['VERCEL'] &&\n vercelEnv !== 'production' &&\n !canAutoDetectRepository(options.release.vcsRemote)\n ) {\n // Vercel's own builders have no git remote and no other CI variables, so commit association can only fail there.\n // Builds that have either, such as `vercel build` in GitHub Actions, keep `auto: true` below.\n options.release.setCommits = false;\n } else {\n options.release.setCommits = {\n shouldNotThrowOnFailure: true,\n auto: true,\n ignoreEmpty: true,\n ignoreMissing: true,\n };\n }\n }\n\n if (options.release.deploy === undefined && process.env['VERCEL'] && vercelEnv) {\n options.release.deploy = {\n env: vercelEnv,\n url: process.env['VERCEL_URL'] ? `https://${process.env['VERCEL_URL']}` : undefined,\n };\n }\n\n return options;\n}\n\n/**\n * Validates a few combinations of options that are not checked by Sentry CLI.\n *\n * For all other options, we can rely on Sentry CLI to validate them. In fact,\n * we can't validate them in the plugin because Sentry CLI might pick up options from\n * its config file.\n *\n * @param options the internal options\n * @param logger the logger\n *\n * @returns `true` if the options are valid, `false` otherwise\n */\nexport function validateOptions(options: NormalizedOptions, logger: Logger): boolean {\n const setCommits = options.release?.setCommits;\n if (setCommits) {\n if (!setCommits.auto && !(setCommits.repo && setCommits.commit)) {\n logger.error(\n 'The `setCommits` option was specified but is missing required properties.',\n 'Please set either `auto` or both, `repo` and `commit`.',\n );\n return false;\n }\n if (setCommits.auto && setCommits.repo && setCommits) {\n logger.warn(\n 'The `setCommits` options includes `auto` but also `repo` and `commit`.',\n 'Ignoring `repo` and `commit`.',\n 'Please only set either `auto` or both, `repo` and `commit`.',\n );\n }\n }\n\n warnOnConflictingSourceMapOptions(options.sourcemaps, message => logger.warn(message));\n\n if (options.release?.deploy && typeof options.release.deploy === 'object' && !options.release.deploy.env) {\n logger.error(\n 'The `deploy` option was specified but is missing the required `env` property.',\n 'Please set the `env` property.',\n );\n return false;\n }\n\n if (options.project && Array.isArray(options.project)) {\n if (options.project.length === 0) {\n logger.error(\n 'The `project` option was specified as an array but is empty.',\n 'Please provide at least one project slug.',\n );\n return false;\n }\n // Check each project is a non-empty string\n const invalidProjects = options.project.filter(p => typeof p !== 'string' || p.trim() === '');\n if (invalidProjects.length > 0) {\n logger.error('The `project` option contains invalid project slugs.', 'All projects must be non-empty strings.');\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":";;;;AAgGA,MAAa,kBAAkB;AAG/B,SAAgB,qBAAqB,aAA6C;CAChF,MAAM,UAAU;EACd,KAAK,YAAY,OAAO,QAAQ,IAAI;EACpC,SAAS,YAAY,WAAW,mBAAmB,QAAQ,IAAI,i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aAAa;GACb,eAAe;EACjB;CAEJ;CAEA,IAAI,QAAQ,QAAQ,WAAW,KAAA,KAAa,QAAQ,IAAI,aAAa,WACnE,QAAQ,QAAQ,SAAS;EACvB,KAAK;EACL,KAAK,QAAQ,IAAI,gBAAgB,WAAW,QAAQ,IAAI,kBAAkB,KAAA;CAC5E;CAGF,OAAO;AACT;;;;;;;;;;;;;AAcA,SAAgB,gBAAgB,SAA4B,QAAyB;CACnF,MAAM,aAAa,QAAQ,SAAS;CACpC,IAAI,YAAY;EACd,IAAI,CAAC,WAAW,QAAQ,EAAE,WAAW,QAAQ,WAAW,SAAS;GAC/D,OAAO,MACL,6EACA,wDACF;GACA,OAAO;EACT;EACA,IAAI,WAAW,QAAQ,WAAW,QAAQ,YACxC,OAAO,KACL,0EACA,iCACA,6DACF;CAEJ;CAEA,kCAAkC,QAAQ,aAAY,YAAW,OAAO,KAAK,OAAO,CAAC;CAErF,IAAI,QAAQ,SAAS,UAAU,OAAO,QAAQ,QAAQ,WAAW,YAAY,CAAC,QAAQ,QAAQ,OAAO,KAAK;EACxG,OAAO,MACL,iFACA,gCACF;EACA,OAAO;CACT;CAEA,IAAI,QAAQ,WAAW,MAAM,QAAQ,QAAQ,OAAO,GAAG;EACrD,IAAI,QAAQ,QAAQ,WAAW,GAAG;GAChC,OAAO,MACL,gEACA,2CACF;GACA,OAAO;EACT;EAGA,IADwB,QAAQ,QAAQ,QAAO,MAAK,OAAO,MAAM,YAAY,EAAE,KAAK,MAAM,EACxE,CAAC,CAAC,SAAS,GAAG;GAC9B,OAAO,MAAM,wDAAwD,yCAAyC;GAC9G,OAAO;EACT;CACF;CAEA,OAAO;AACT"}
|
|
@@ -62,7 +62,7 @@ function setTelemetryDataOnScope(options, scope, buildTool, buildToolMajorVersio
|
|
|
62
62
|
scope.setTag("custom-error-handler", !!errorHandler);
|
|
63
63
|
scope.setTag("sourcemaps-assets", !!sourcemaps?.assets);
|
|
64
64
|
scope.setTag("delete-after-upload", !!sourcemaps?.filesToDeleteAfterUpload);
|
|
65
|
-
scope.setTag("delete-sourcemaps-after-upload",
|
|
65
|
+
scope.setTag("delete-sourcemaps-after-upload", sourcemaps?.deleteSourcemapsAfterUpload === void 0 ? "auto" : String(sourcemaps.deleteSourcemapsAfterUpload));
|
|
66
66
|
scope.setTag("sourcemaps-disabled", !!sourcemaps?.disable);
|
|
67
67
|
scope.setTag("sourcemaps-upload", sourcemaps?.upload === void 0 ? "auto" : String(sourcemaps.upload));
|
|
68
68
|
scope.setTag("sourcemaps-inject-debug-ids", sourcemaps?.injectDebugIds === void 0 ? "auto" : String(sourcemaps.injectDebugIds));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","names":[],"sources":["../../../../src/core/sentry/telemetry.ts"],"sourcesContent":["import type { Client } from '@sentry/core';\nimport type { ServerRuntimeClientOptions } from '@sentry/core/server';\nimport { applySdkMetadata } from '@sentry/core';\nimport { ServerRuntimeClient } from '@sentry/core/server';\nimport type { NormalizedOptions } from '../options-mapping';\nimport { SENTRY_SAAS_URL } from '../options-mapping';\nimport { Scope } from '@sentry/core';\nimport { createStackParser } from '@sentry/core';\nimport { nodeStackLineParser } from '@sentry/core/server';\nimport { makeOptionallyEnabledNodeTransport } from './transports';\nimport { SentryCliAdapter } from '../cli';\nimport { LIB_VERSION } from '../version';\n\nconst SENTRY_SAAS_HOSTNAME = 'sentry.io';\n\nconst stackParser = createStackParser(nodeStackLineParser());\n\nexport function createSentryInstance(\n options: NormalizedOptions,\n shouldSendTelemetry: Promise<boolean>,\n buildTool: string,\n buildToolMajorVersion: string | undefined,\n): { sentryScope: Scope; sentryClient: Client } {\n const clientOptions: ServerRuntimeClientOptions = {\n platform: 'node',\n runtime: { name: 'node', version: global.process.version },\n\n dsn: 'https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737',\n\n tracesSampleRate: 0.3,\n traceLifecycle: 'static',\n sampleRate: 1,\n\n release: LIB_VERSION,\n integrations: [],\n tracePropagationTargets: ['sentry.io/api'],\n\n stackParser,\n\n beforeSend: event => {\n event.exception?.values?.forEach(exception => {\n delete exception.stacktrace;\n });\n\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n // Deprecated, but still applied because this client runs on the static trace lifecycle.\n // oxlint-disable-next-line typescript/no-deprecated\n beforeSendTransaction: event => {\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n // We create a transport that stalls sending events until we know that we're allowed to (i.e. when Sentry CLI told\n // us that the upload URL is the Sentry SaaS URL)\n transport: makeOptionallyEnabledNodeTransport(shouldSendTelemetry),\n };\n\n applySdkMetadata(clientOptions, 'node');\n\n const client = new ServerRuntimeClient(clientOptions);\n const scope = new Scope();\n scope.setClient(client);\n\n // Integration tests snapshot the emitted transaction, so the sampling decision must not depend on chance.\n if (process.env['SENTRY_TEST_OUT_DIR']) {\n scope.setPropagationContext({ ...scope.getPropagationContext(), sampleRand: 0 });\n }\n\n setTelemetryDataOnScope(options, scope, buildTool, buildToolMajorVersion);\n\n return { sentryScope: scope, sentryClient: client };\n}\n\nexport function setTelemetryDataOnScope(\n options: NormalizedOptions,\n scope: Scope,\n buildTool: string,\n buildToolMajorVersion?: string,\n): void {\n const { org, project, release, errorHandler, sourcemaps, reactComponentAnnotation } = options;\n\n scope.setTag('upload-legacy-sourcemaps', !!release.uploadLegacySourcemaps);\n if (release.uploadLegacySourcemaps) {\n scope.setTag(\n 'uploadLegacySourcemapsEntries',\n Array.isArray(release.uploadLegacySourcemaps) ? release.uploadLegacySourcemaps.length : 1,\n );\n }\n\n scope.setTag('module-metadata', !!options.moduleMetadata);\n scope.setTag('inject-build-information', !!options._experiments.injectBuildInformation);\n\n // Optional release pipeline steps\n if (release.setCommits) {\n scope.setTag('set-commits', release.setCommits.auto === true ? 'auto' : 'manual');\n } else {\n scope.setTag('set-commits', 'undefined');\n }\n scope.setTag('finalize-release', release.finalize);\n scope.setTag('deploy-options', !!release.deploy);\n\n // Miscellaneous options\n scope.setTag('custom-error-handler', !!errorHandler);\n scope.setTag('sourcemaps-assets', !!sourcemaps?.assets);\n scope.setTag('delete-after-upload', !!sourcemaps?.filesToDeleteAfterUpload);\n scope.setTag(\n 'delete-sourcemaps-after-upload',\n
|
|
1
|
+
{"version":3,"file":"telemetry.js","names":[],"sources":["../../../../src/core/sentry/telemetry.ts"],"sourcesContent":["import type { Client } from '@sentry/core';\nimport type { ServerRuntimeClientOptions } from '@sentry/core/server';\nimport { applySdkMetadata } from '@sentry/core';\nimport { ServerRuntimeClient } from '@sentry/core/server';\nimport type { NormalizedOptions } from '../options-mapping';\nimport { SENTRY_SAAS_URL } from '../options-mapping';\nimport { Scope } from '@sentry/core';\nimport { createStackParser } from '@sentry/core';\nimport { nodeStackLineParser } from '@sentry/core/server';\nimport { makeOptionallyEnabledNodeTransport } from './transports';\nimport { SentryCliAdapter } from '../cli';\nimport { LIB_VERSION } from '../version';\n\nconst SENTRY_SAAS_HOSTNAME = 'sentry.io';\n\nconst stackParser = createStackParser(nodeStackLineParser());\n\nexport function createSentryInstance(\n options: NormalizedOptions,\n shouldSendTelemetry: Promise<boolean>,\n buildTool: string,\n buildToolMajorVersion: string | undefined,\n): { sentryScope: Scope; sentryClient: Client } {\n const clientOptions: ServerRuntimeClientOptions = {\n platform: 'node',\n runtime: { name: 'node', version: global.process.version },\n\n dsn: 'https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737',\n\n tracesSampleRate: 0.3,\n traceLifecycle: 'static',\n sampleRate: 1,\n\n release: LIB_VERSION,\n integrations: [],\n tracePropagationTargets: ['sentry.io/api'],\n\n stackParser,\n\n beforeSend: event => {\n event.exception?.values?.forEach(exception => {\n delete exception.stacktrace;\n });\n\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n // Deprecated, but still applied because this client runs on the static trace lifecycle.\n // oxlint-disable-next-line typescript/no-deprecated\n beforeSendTransaction: event => {\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n // We create a transport that stalls sending events until we know that we're allowed to (i.e. when Sentry CLI told\n // us that the upload URL is the Sentry SaaS URL)\n transport: makeOptionallyEnabledNodeTransport(shouldSendTelemetry),\n };\n\n applySdkMetadata(clientOptions, 'node');\n\n const client = new ServerRuntimeClient(clientOptions);\n const scope = new Scope();\n scope.setClient(client);\n\n // Integration tests snapshot the emitted transaction, so the sampling decision must not depend on chance.\n if (process.env['SENTRY_TEST_OUT_DIR']) {\n scope.setPropagationContext({ ...scope.getPropagationContext(), sampleRand: 0 });\n }\n\n setTelemetryDataOnScope(options, scope, buildTool, buildToolMajorVersion);\n\n return { sentryScope: scope, sentryClient: client };\n}\n\nexport function setTelemetryDataOnScope(\n options: NormalizedOptions,\n scope: Scope,\n buildTool: string,\n buildToolMajorVersion?: string,\n): void {\n const { org, project, release, errorHandler, sourcemaps, reactComponentAnnotation } = options;\n\n scope.setTag('upload-legacy-sourcemaps', !!release.uploadLegacySourcemaps);\n if (release.uploadLegacySourcemaps) {\n scope.setTag(\n 'uploadLegacySourcemapsEntries',\n Array.isArray(release.uploadLegacySourcemaps) ? release.uploadLegacySourcemaps.length : 1,\n );\n }\n\n scope.setTag('module-metadata', !!options.moduleMetadata);\n scope.setTag('inject-build-information', !!options._experiments.injectBuildInformation);\n\n // Optional release pipeline steps\n if (release.setCommits) {\n scope.setTag('set-commits', release.setCommits.auto === true ? 'auto' : 'manual');\n } else {\n scope.setTag('set-commits', 'undefined');\n }\n scope.setTag('finalize-release', release.finalize);\n scope.setTag('deploy-options', !!release.deploy);\n\n // Miscellaneous options\n scope.setTag('custom-error-handler', !!errorHandler);\n scope.setTag('sourcemaps-assets', !!sourcemaps?.assets);\n scope.setTag('delete-after-upload', !!sourcemaps?.filesToDeleteAfterUpload);\n scope.setTag(\n 'delete-sourcemaps-after-upload',\n sourcemaps?.deleteSourcemapsAfterUpload === undefined ? 'auto' : String(sourcemaps.deleteSourcemapsAfterUpload),\n );\n scope.setTag('sourcemaps-disabled', !!sourcemaps?.disable);\n scope.setTag('sourcemaps-upload', sourcemaps?.upload === undefined ? 'auto' : String(sourcemaps.upload));\n scope.setTag(\n 'sourcemaps-inject-debug-ids',\n sourcemaps?.injectDebugIds === undefined ? 'auto' : String(sourcemaps.injectDebugIds),\n );\n scope.setTag('sourcemaps-delete', sourcemaps?.delete === undefined ? 'auto' : String(sourcemaps.delete));\n\n scope.setTag('react-annotate', !!reactComponentAnnotation?.enabled);\n\n scope.setTag('node', process.version);\n scope.setTag('platform', process.platform);\n\n scope.setTag('meta-framework', options._metaOptions.telemetry.metaFramework ?? 'none');\n\n scope.setTag('application-key-set', options.applicationKey !== undefined);\n\n scope.setTag('ci', !!process.env['CI']);\n\n scope.setTags({\n organization: org,\n project: Array.isArray(project) ? project.join(', ') : (project ?? 'undefined'),\n bundler: buildTool,\n });\n\n if (buildToolMajorVersion) {\n scope.setTag('bundler-major-version', buildToolMajorVersion);\n }\n\n scope.setUser({ id: org });\n}\n\nexport async function allowedToSendTelemetry(options: NormalizedOptions): Promise<boolean> {\n const { telemetry } = options;\n const url = options.url ?? SENTRY_SAAS_URL;\n\n // `options.telemetry` defaults to true\n if (telemetry === false) {\n return false;\n }\n\n if (url === SENTRY_SAAS_URL) {\n return true;\n }\n\n // Ask the CLI which Sentry server URL it resolves to. This can differ from the default (or the\n // configured `url`) because the CLI also honors a possibly existing `.sentryclirc` file.\n const cliInfoUrl = await new SentryCliAdapter(options).getServerUrl();\n\n if (cliInfoUrl === undefined) {\n return false;\n }\n\n return new URL(cliInfoUrl).hostname === SENTRY_SAAS_HOSTNAME;\n}\n\n/**\n * Flushing the SDK client can fail. We never want to crash the plugin because of telemetry.\n */\nexport async function safeFlushTelemetry(sentryClient: Client): Promise<void> {\n try {\n await sentryClient.flush(2000);\n } catch {\n // Noop when flushing fails.\n // We don't even need to log anything because there's likely nothing the user can do and they likely will not care.\n }\n}\n"],"mappings":";;;;;;;AAaA,MAAM,uBAAuB;AAE7B,MAAM,cAAc,kBAAkB,oBAAoB,CAAC;AAE3D,SAAgB,qBACd,S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AAI,cAAc,OAChB,OAAO;CAGT,IAAI,QAAA,qBACF,OAAO;CAKT,MAAM,aAAa,MAAM,IAAI,iBAAiB,OAAO,CAAC,CAAC,aAAa;CAEpE,IAAI,eAAe,KAAA,GACjB,OAAO;CAGT,OAAO,IAAI,IAAI,UAAU,CAAC,CAAC,aAAa;AAC1C;;;;AAKA,eAAsB,mBAAmB,cAAqC;CAC5E,IAAI;EACF,MAAM,aAAa,MAAM,GAAI;CAC/B,QAAQ,CAGR;AACF"}
|
|
@@ -18,33 +18,35 @@ function getSourceMapFeatures(options) {
|
|
|
18
18
|
stampEmittedFiles: injectDebugIds && !upload
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
/** Reads `sourcemaps.
|
|
22
|
-
function
|
|
23
|
-
const value = options.sourcemaps?.
|
|
21
|
+
/** Reads the internal `sourcemaps.sdkDeleteSourceMaps` option, calling its function form if given. */
|
|
22
|
+
function getSdkDeleteSourceMaps(options, environment) {
|
|
23
|
+
const value = options.sourcemaps?.sdkDeleteSourceMaps;
|
|
24
24
|
return typeof value === "function" ? value(environment) : value;
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Reads `sourcemaps.delete`. When it is unset, `sourcemaps.deleteSourcemapsAfterUpload` decides, and
|
|
28
|
+
* then the SDK.
|
|
29
|
+
*/
|
|
27
30
|
function getDeleteOption(options, environment) {
|
|
28
|
-
return options.sourcemaps?.delete ??
|
|
29
|
-
}
|
|
30
|
-
/** Reads the internal `sourcemaps.sdkEnabledSourceMaps` option, calling its function form if given. */
|
|
31
|
-
function getSdkEnabledSourceMaps(options, environment) {
|
|
32
|
-
const value = options.sourcemaps?.sdkEnabledSourceMaps;
|
|
33
|
-
return (typeof value === "function" ? value(environment) : value) === true;
|
|
31
|
+
return options.sourcemaps?.delete ?? options.sourcemaps?.deleteSourcemapsAfterUpload ?? getSdkDeleteSourceMaps(options, environment);
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
* Decides whether the plugin turns hidden source maps on and whether it removes the maps from the
|
|
37
35
|
* build output after the upload. The plugin only turns maps on when an upload can run, and only
|
|
38
|
-
* removes maps it turned on itself unless `deleteSourcemapsAfterUpload`
|
|
36
|
+
* removes maps it turned on itself unless `deleteSourcemapsAfterUpload` or the SDK's
|
|
37
|
+
* `sdkDeleteSourceMaps` says otherwise. The user's `deleteSourcemapsAfterUpload` wins over the SDK.
|
|
39
38
|
*/
|
|
40
39
|
function decideSourceMapHandling(kind, options, uploadPossible, environment) {
|
|
41
40
|
const features = getSourceMapFeatures(options);
|
|
42
41
|
if (options.sourcemaps?.delete !== void 0) return decideWithDeleteOption(kind, options.sourcemaps.delete, features, uploadPossible);
|
|
43
|
-
const
|
|
44
|
-
const
|
|
42
|
+
const userDeleteOption = options.sourcemaps?.deleteSourcemapsAfterUpload;
|
|
43
|
+
const sdkDeleteOption = getSdkDeleteSourceMaps(options, environment);
|
|
44
|
+
const deleteOption = userDeleteOption ?? sdkDeleteOption;
|
|
45
|
+
const sdkRemovesAll = sdkDeleteOption === true;
|
|
46
|
+
const fromUser = userDeleteOption !== void 0;
|
|
45
47
|
if (!uploadPossible || !features.upload) {
|
|
46
48
|
if (deleteOption !== true || kind !== "hidden" && kind !== "visible") return NO_CHANGE;
|
|
47
|
-
if (!features.upload && !
|
|
49
|
+
if (!features.upload && !sdkRemovesAll) return {
|
|
48
50
|
...NO_CHANGE,
|
|
49
51
|
log: {
|
|
50
52
|
level: "warn",
|
|
@@ -54,10 +56,13 @@ function decideSourceMapHandling(kind, options, uploadPossible, environment) {
|
|
|
54
56
|
return {
|
|
55
57
|
enableHidden: kind === "visible",
|
|
56
58
|
deleteAfterUpload: true,
|
|
57
|
-
removeAllSourceMaps:
|
|
58
|
-
log: {
|
|
59
|
+
removeAllSourceMaps: sdkRemovesAll,
|
|
60
|
+
log: fromUser ? {
|
|
59
61
|
level: "warn",
|
|
60
62
|
message: "Source maps are not uploaded, but they are removed from the build output because `sourcemaps.deleteSourcemapsAfterUpload` is set."
|
|
63
|
+
} : {
|
|
64
|
+
level: "info",
|
|
65
|
+
message: "Source maps are not uploaded, but the Sentry SDK removes them from the build output."
|
|
61
66
|
}
|
|
62
67
|
};
|
|
63
68
|
}
|
|
@@ -91,7 +96,7 @@ function decideSourceMapHandling(kind, options, uploadPossible, environment) {
|
|
|
91
96
|
removeAllSourceMaps: true,
|
|
92
97
|
log: {
|
|
93
98
|
level: "info",
|
|
94
|
-
message: "Enabling hidden source maps. They are uploaded to Sentry and removed from the build output. Set `sourcemaps.
|
|
99
|
+
message: "Enabling hidden source maps. They are uploaded to Sentry and removed from the build output. Set `sourcemaps.delete: false` to keep them."
|
|
95
100
|
}
|
|
96
101
|
};
|
|
97
102
|
case "hidden":
|
|
@@ -99,17 +104,17 @@ function decideSourceMapHandling(kind, options, uploadPossible, environment) {
|
|
|
99
104
|
return {
|
|
100
105
|
enableHidden: false,
|
|
101
106
|
deleteAfterUpload: true,
|
|
102
|
-
removeAllSourceMaps:
|
|
107
|
+
removeAllSourceMaps: sdkRemovesAll
|
|
103
108
|
};
|
|
104
109
|
case "visible":
|
|
105
110
|
if (deleteOption !== true) return NO_CHANGE;
|
|
106
111
|
return {
|
|
107
112
|
enableHidden: true,
|
|
108
113
|
deleteAfterUpload: true,
|
|
109
|
-
removeAllSourceMaps:
|
|
114
|
+
removeAllSourceMaps: sdkRemovesAll,
|
|
110
115
|
log: {
|
|
111
116
|
level: "info",
|
|
112
|
-
message: "Switching to hidden source maps because `sourcemaps.deleteSourcemapsAfterUpload` is set. Without the `sourceMappingURL` comment browsers do not request the removed map files."
|
|
117
|
+
message: fromUser ? "Switching to hidden source maps because `sourcemaps.deleteSourcemapsAfterUpload` is set. Without the `sourceMappingURL` comment browsers do not request the removed map files." : "Switching to hidden source maps, because the Sentry SDK removes them from the build output. Without the `sourceMappingURL` comment browsers do not request the removed map files."
|
|
113
118
|
}
|
|
114
119
|
};
|
|
115
120
|
}
|
|
@@ -171,6 +176,6 @@ function decideWithDeleteOption(kind, deleteSourceMaps, features, uploadPossible
|
|
|
171
176
|
};
|
|
172
177
|
}
|
|
173
178
|
}
|
|
174
|
-
export { decideSourceMapHandling, getDeleteOption,
|
|
179
|
+
export { decideSourceMapHandling, getDeleteOption, getSdkDeleteSourceMaps, getSourceMapFeatures };
|
|
175
180
|
|
|
176
181
|
//# sourceMappingURL=sourcemap-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourcemap-settings.js","names":[],"sources":["../../../src/core/sourcemap-settings.ts"],"sourcesContent":["import { resolveSourceMapsFeatures } from '@sentry/core';\nimport type { NormalizedOptions } from './options-mapping';\n\n/**\n * The user's source map setting in the bundler, reduced to what matters for upload and deletion.\n *\n * - `unset`: the user did not configure source maps\n * - `off`: source map generation is turned off\n * - `visible`: separate map files with a `sourceMappingURL` comment\n * - `hidden`: separate map files without the comment\n * - `inline`: the map is embedded into the bundle\n */\nexport type SourceMapKind = 'unset' | 'off' | 'visible' | 'hidden' | 'inline';\n\nexport type SourceMapDecision = {\n /** Switch the bundler to hidden source maps. */\n enableHidden: boolean;\n /** Remove the source maps from the build output once they are uploaded. */\n deleteAfterUpload: boolean;\n /**\n * With `deleteAfterUpload`, remove every source map of the build, also those of CSS and of chunks\n * the upload leaves out. Set when the plugin or the SDK turned the source maps on.\n */\n removeAllSourceMaps?: boolean;\n log?: { level: 'info' | 'warn'; message: string };\n};\n\nconst NO_CHANGE: SourceMapDecision = { enableHidden: false, deleteAfterUpload: false };\n\nconst SOURCE_MAPS_OFF_MESSAGE =\n 'Source map generation is turned off in your bundler, so Sentry cannot un-minify your stack traces. ' +\n 'Remove the setting to let the plugin generate hidden source maps, upload them to Sentry and remove them from the build output.';\n\nconst INLINE_SOURCE_MAPS_MESSAGE =\n 'Source maps are inlined into your bundles. They are uploaded to Sentry, but inline source maps ship your source code to users and cannot be removed after the upload. ' +\n 'Remove the setting to let the plugin generate hidden source maps instead.';\n\nexport type SourceMapFeatures = {\n /** The plugin adds debug IDs to the bundles and their source maps. */\n injectDebugIds: boolean;\n /** The plugin uploads the source maps. Never `true` without `injectDebugIds`. */\n upload: boolean;\n /**\n * The plugin writes the debug IDs into the emitted files and source maps. The upload only stamps\n * temp copies, so without an upload the emitted files get them and a later manual upload needs\n * no inject step.\n */\n stampEmittedFiles: boolean;\n};\n\n/**\n * Reads `sourcemaps.upload` and `sourcemaps.injectDebugIds`. When neither is set,\n * `sourcemaps.disable` decides.\n */\nexport function getSourceMapFeatures(options: NormalizedOptions): SourceMapFeatures {\n const { injectDebugIds, upload } = resolveSourceMapsFeatures(options.sourcemaps);\n\n return { injectDebugIds, upload, stampEmittedFiles: injectDebugIds && !upload };\n}\n\n/** Reads `sourcemaps.deleteSourcemapsAfterUpload`, calling the internal function form if given. */\nexport function getDeleteSourcemapsAfterUpload(options: NormalizedOptions, environment?: string): boolean | undefined {\n const value = options.sourcemaps?.deleteSourcemapsAfterUpload;\n return typeof value === 'function' ? value(environment) : value;\n}\n\n/** Reads `sourcemaps.delete`. When it is unset, `sourcemaps.deleteSourcemapsAfterUpload` decides. */\nexport function getDeleteOption(options: NormalizedOptions, environment?: string): boolean | undefined {\n return options.sourcemaps?.delete ?? getDeleteSourcemapsAfterUpload(options, environment);\n}\n\n/** Reads the internal `sourcemaps.sdkEnabledSourceMaps` option, calling its function form if given. */\nexport function getSdkEnabledSourceMaps(options: NormalizedOptions, environment?: string): boolean {\n const value = options.sourcemaps?.sdkEnabledSourceMaps;\n return (typeof value === 'function' ? value(environment) : value) === true;\n}\n\n/**\n * Decides whether the plugin turns hidden source maps on and whether it removes the maps from the\n * build output after the upload. The plugin only turns maps on when an upload can run, and only\n * removes maps it turned on itself unless `deleteSourcemapsAfterUpload` says otherwise.\n */\nexport function decideSourceMapHandling(\n kind: SourceMapKind,\n options: NormalizedOptions,\n uploadPossible: boolean,\n environment?: string,\n): SourceMapDecision {\n const features = getSourceMapFeatures(options);\n\n if (options.sourcemaps?.delete !== undefined) {\n return decideWithDeleteOption(kind, options.sourcemaps.delete, features, uploadPossible);\n }\n\n const deleteOption = getDeleteSourcemapsAfterUpload(options, environment);\n const sdkEnabledSourceMaps = getSdkEnabledSourceMaps(options, environment);\n\n if (!uploadPossible || !features.upload) {\n if (deleteOption !== true || (kind !== 'hidden' && kind !== 'visible')) {\n return NO_CHANGE;\n }\n // Users switch the upload off to upload the maps themselves. Maps the\n // SDK turned on are still removed, as the SDKs' own globs did.\n if (!features.upload && !sdkEnabledSourceMaps) {\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: `\\`sourcemaps.deleteSourcemapsAfterUpload\\` is set, but source map upload is disabled with ${\n resolveSourceMapsFeatures(options.sourcemaps).legacyDisable\n ? '`sourcemaps.disable`'\n : '`sourcemaps.upload` or `sourcemaps.injectDebugIds`'\n }, so the source maps are not removed.`,\n },\n };\n }\n return {\n enableHidden: kind === 'visible',\n deleteAfterUpload: true,\n removeAllSourceMaps: sdkEnabledSourceMaps,\n log: {\n level: 'warn',\n message:\n 'Source maps are not uploaded, but they are removed from the build output because `sourcemaps.deleteSourcemapsAfterUpload` is set.',\n },\n };\n }\n\n switch (kind) {\n case 'off':\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: SOURCE_MAPS_OFF_MESSAGE,\n },\n };\n\n case 'inline':\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: INLINE_SOURCE_MAPS_MESSAGE,\n },\n };\n\n case 'unset':\n if (deleteOption === false) {\n return {\n enableHidden: true,\n deleteAfterUpload: false,\n log: {\n level: 'info',\n message: 'Enabling hidden source maps. They are uploaded to Sentry and kept in the build output.',\n },\n };\n }\n return {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: {\n level: 'info',\n message:\n 'Enabling hidden source maps. They are uploaded to Sentry and removed from the build output. ' +\n 'Set `sourcemaps.deleteSourcemapsAfterUpload: false` to keep them.',\n },\n };\n\n case 'hidden':\n if (deleteOption !== true) {\n return NO_CHANGE;\n }\n return { enableHidden: false, deleteAfterUpload: true, removeAllSourceMaps: sdkEnabledSourceMaps };\n\n case 'visible':\n if (deleteOption !== true) {\n return NO_CHANGE;\n }\n return {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: sdkEnabledSourceMaps,\n log: {\n level: 'info',\n message:\n 'Switching to hidden source maps because `sourcemaps.deleteSourcemapsAfterUpload` is set. ' +\n 'Without the `sourceMappingURL` comment browsers do not request the removed map files.',\n },\n };\n }\n}\n\n/**\n * The decision when `sourcemaps.delete` is set. Unlike `deleteSourcemapsAfterUpload`, it does not\n * depend on an upload: `true` removes every source map of the build, and `false` keeps the hidden\n * source maps the plugin turns on, also when nothing is uploaded.\n */\nfunction decideWithDeleteOption(\n kind: SourceMapKind,\n deleteSourceMaps: boolean,\n features: SourceMapFeatures,\n uploadPossible: boolean,\n): SourceMapDecision {\n switch (kind) {\n case 'off':\n return uploadPossible ? { ...NO_CHANGE, log: { level: 'warn', message: SOURCE_MAPS_OFF_MESSAGE } } : NO_CHANGE;\n\n case 'inline':\n return uploadPossible ? { ...NO_CHANGE, log: { level: 'warn', message: INLINE_SOURCE_MAPS_MESSAGE } } : NO_CHANGE;\n\n case 'unset':\n if (deleteSourceMaps) {\n // Maps that are only turned on to be removed again are not turned on.\n return uploadPossible\n ? {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: {\n level: 'info',\n message: 'Enabling hidden source maps. They are uploaded to Sentry and removed from the build output.',\n },\n }\n : NO_CHANGE;\n }\n // Without debug IDs the maps are of no use to Sentry.\n if (!features.injectDebugIds) {\n return NO_CHANGE;\n }\n return {\n enableHidden: true,\n deleteAfterUpload: false,\n log: {\n level: 'info',\n message: uploadPossible\n ? 'Enabling hidden source maps. They are uploaded to Sentry and kept in the build output.'\n : 'Enabling hidden source maps. They are not uploaded to Sentry and are kept in the build output, because `sourcemaps.delete` is `false`.',\n },\n };\n\n case 'hidden':\n case 'visible':\n if (!deleteSourceMaps) {\n return NO_CHANGE;\n }\n return {\n enableHidden: kind === 'visible',\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: uploadPossible\n ? kind === 'visible'\n ? {\n level: 'info',\n message:\n 'Switching to hidden source maps because `sourcemaps.delete` is set. ' +\n 'Without the `sourceMappingURL` comment browsers do not request the removed map files.',\n }\n : undefined\n : {\n level: 'warn',\n message:\n 'Source maps are not uploaded, but they are removed from the build output because `sourcemaps.delete` is set.',\n },\n };\n }\n}\n"],"mappings":";;AA2BA,MAAM,YAA+B;CAAE,cAAc;CAAO,mBAAmB;AAAM;AAErF,MAAM,0BACJ;AAGF,MAAM,6BACJ;;;;;AAoBF,SAAgB,qBAAqB,SAA+C;CAClF,MAAM,EAAE,gBAAgB,WAAW,0BAA0B,QAAQ,UAAU;CAE/E,OAAO;EAAE;EAAgB;EAAQ,mBAAmB,kBAAkB,CAAC;CAAO;AAChF;;AAGA,SAAgB,+BAA+B,SAA4B,aAA2C;CACpH,MAAM,QAAQ,QAAQ,YAAY;CAClC,OAAO,OAAO,UAAU,aAAa,MAAM,WAAW,IAAI;AAC5D;;AAGA,SAAgB,gBAAgB,SAA4B,aAA2C;CACrG,OAAO,QAAQ,YAAY,UAAU,+BAA+B,SAAS,WAAW;AAC1F;;AAGA,SAAgB,wBAAwB,SAA4B,aAA+B;CACjG,MAAM,QAAQ,QAAQ,YAAY;CAClC,QAAQ,OAAO,UAAU,aAAa,MAAM,WAAW,IAAI,WAAW;AACxE;;;;;;AAOA,SAAgB,wBACd,MACA,SACA,gBACA,aACmB;CACnB,MAAM,WAAW,qBAAqB,OAAO;CAE7C,IAAI,QAAQ,YAAY,WAAW,KAAA,GACjC,OAAO,uBAAuB,MAAM,QAAQ,WAAW,QAAQ,UAAU,cAAc;CAGzF,MAAM,eAAe,+BAA+B,SAAS,WAAW;CACxE,MAAM,uBAAuB,wBAAwB,SAAS,WAAW;CAEzE,IAAI,CAAC,kBAAkB,CAAC,SAAS,QAAQ;EACvC,IAAI,iBAAiB,QA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,iBACH;IACE,cAAc;IACd,mBAAmB;IACnB,qBAAqB;IACrB,KAAK;KACH,OAAO;KACP,SAAS;IACX;GACF,IACA;GAGN,IAAI,CAAC,SAAS,gBACZ,OAAO;GAET,OAAO;IACL,cAAc;IACd,mBAAmB;IACnB,KAAK;KACH,OAAO;KACP,SAAS,iBACL,2FACA;IACN;GACF;EAEF,KAAK;EACL,KAAK;GACH,IAAI,CAAC,kBACH,OAAO;GAET,OAAO;IACL,cAAc,SAAS;IACvB,mBAAmB;IACnB,qBAAqB;IACrB,KAAK,iBACD,SAAS,YACP;KACE,OAAO;KACP,SACE;IAEJ,IACA,KAAA,IACF;KACE,OAAO;KACP,SACE;IACJ;GACN;CACJ;AACF"}
|
|
1
|
+
{"version":3,"file":"sourcemap-settings.js","names":[],"sources":["../../../src/core/sourcemap-settings.ts"],"sourcesContent":["import { resolveSourceMapsFeatures } from '@sentry/core';\nimport type { NormalizedOptions } from './options-mapping';\n\n/**\n * The user's source map setting in the bundler, reduced to what matters for upload and deletion.\n *\n * - `unset`: the user did not configure source maps\n * - `off`: source map generation is turned off\n * - `visible`: separate map files with a `sourceMappingURL` comment\n * - `hidden`: separate map files without the comment\n * - `inline`: the map is embedded into the bundle\n */\nexport type SourceMapKind = 'unset' | 'off' | 'visible' | 'hidden' | 'inline';\n\nexport type SourceMapDecision = {\n /** Switch the bundler to hidden source maps. */\n enableHidden: boolean;\n /** Remove the source maps from the build output once they are uploaded. */\n deleteAfterUpload: boolean;\n /**\n * With `deleteAfterUpload`, remove every source map of the build, also those of CSS and of chunks\n * the upload leaves out. Set when the plugin or the SDK turned the source maps on.\n */\n removeAllSourceMaps?: boolean;\n log?: { level: 'info' | 'warn'; message: string };\n};\n\nconst NO_CHANGE: SourceMapDecision = { enableHidden: false, deleteAfterUpload: false };\n\nconst SOURCE_MAPS_OFF_MESSAGE =\n 'Source map generation is turned off in your bundler, so Sentry cannot un-minify your stack traces. ' +\n 'Remove the setting to let the plugin generate hidden source maps, upload them to Sentry and remove them from the build output.';\n\nconst INLINE_SOURCE_MAPS_MESSAGE =\n 'Source maps are inlined into your bundles. They are uploaded to Sentry, but inline source maps ship your source code to users and cannot be removed after the upload. ' +\n 'Remove the setting to let the plugin generate hidden source maps instead.';\n\nexport type SourceMapFeatures = {\n /** The plugin adds debug IDs to the bundles and their source maps. */\n injectDebugIds: boolean;\n /** The plugin uploads the source maps. Never `true` without `injectDebugIds`. */\n upload: boolean;\n /**\n * The plugin writes the debug IDs into the emitted files and source maps. The upload only stamps\n * temp copies, so without an upload the emitted files get them and a later manual upload needs\n * no inject step.\n */\n stampEmittedFiles: boolean;\n};\n\n/**\n * Reads `sourcemaps.upload` and `sourcemaps.injectDebugIds`. When neither is set,\n * `sourcemaps.disable` decides.\n */\nexport function getSourceMapFeatures(options: NormalizedOptions): SourceMapFeatures {\n const { injectDebugIds, upload } = resolveSourceMapsFeatures(options.sourcemaps);\n\n return { injectDebugIds, upload, stampEmittedFiles: injectDebugIds && !upload };\n}\n\n/** Reads the internal `sourcemaps.sdkDeleteSourceMaps` option, calling its function form if given. */\nexport function getSdkDeleteSourceMaps(options: NormalizedOptions, environment?: string): boolean | undefined {\n const value = options.sourcemaps?.sdkDeleteSourceMaps;\n return typeof value === 'function' ? value(environment) : value;\n}\n\n/**\n * Reads `sourcemaps.delete`. When it is unset, `sourcemaps.deleteSourcemapsAfterUpload` decides, and\n * then the SDK.\n */\nexport function getDeleteOption(options: NormalizedOptions, environment?: string): boolean | undefined {\n return (\n options.sourcemaps?.delete ??\n options.sourcemaps?.deleteSourcemapsAfterUpload ??\n getSdkDeleteSourceMaps(options, environment)\n );\n}\n\n/**\n * Decides whether the plugin turns hidden source maps on and whether it removes the maps from the\n * build output after the upload. The plugin only turns maps on when an upload can run, and only\n * removes maps it turned on itself unless `deleteSourcemapsAfterUpload` or the SDK's\n * `sdkDeleteSourceMaps` says otherwise. The user's `deleteSourcemapsAfterUpload` wins over the SDK.\n */\nexport function decideSourceMapHandling(\n kind: SourceMapKind,\n options: NormalizedOptions,\n uploadPossible: boolean,\n environment?: string,\n): SourceMapDecision {\n const features = getSourceMapFeatures(options);\n\n if (options.sourcemaps?.delete !== undefined) {\n return decideWithDeleteOption(kind, options.sourcemaps.delete, features, uploadPossible);\n }\n\n const userDeleteOption = options.sourcemaps?.deleteSourcemapsAfterUpload;\n const sdkDeleteOption = getSdkDeleteSourceMaps(options, environment);\n const deleteOption = userDeleteOption ?? sdkDeleteOption;\n const sdkRemovesAll = sdkDeleteOption === true;\n const fromUser = userDeleteOption !== undefined;\n\n if (!uploadPossible || !features.upload) {\n if (deleteOption !== true || (kind !== 'hidden' && kind !== 'visible')) {\n return NO_CHANGE;\n }\n // Users switch the upload off to upload the maps themselves. The SDK's\n // deletion still runs, as the SDKs' own globs did.\n if (!features.upload && !sdkRemovesAll) {\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: `\\`sourcemaps.deleteSourcemapsAfterUpload\\` is set, but source map upload is disabled with ${\n resolveSourceMapsFeatures(options.sourcemaps).legacyDisable\n ? '`sourcemaps.disable`'\n : '`sourcemaps.upload` or `sourcemaps.injectDebugIds`'\n }, so the source maps are not removed.`,\n },\n };\n }\n return {\n enableHidden: kind === 'visible',\n deleteAfterUpload: true,\n removeAllSourceMaps: sdkRemovesAll,\n log: fromUser\n ? {\n level: 'warn',\n message:\n 'Source maps are not uploaded, but they are removed from the build output because `sourcemaps.deleteSourcemapsAfterUpload` is set.',\n }\n : {\n level: 'info',\n message: 'Source maps are not uploaded, but the Sentry SDK removes them from the build output.',\n },\n };\n }\n\n switch (kind) {\n case 'off':\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: SOURCE_MAPS_OFF_MESSAGE,\n },\n };\n\n case 'inline':\n return {\n ...NO_CHANGE,\n log: {\n level: 'warn',\n message: INLINE_SOURCE_MAPS_MESSAGE,\n },\n };\n\n case 'unset':\n if (deleteOption === false) {\n return {\n enableHidden: true,\n deleteAfterUpload: false,\n log: {\n level: 'info',\n message: 'Enabling hidden source maps. They are uploaded to Sentry and kept in the build output.',\n },\n };\n }\n return {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: {\n level: 'info',\n message:\n 'Enabling hidden source maps. They are uploaded to Sentry and removed from the build output. ' +\n 'Set `sourcemaps.delete: false` to keep them.',\n },\n };\n\n case 'hidden':\n if (deleteOption !== true) {\n return NO_CHANGE;\n }\n return { enableHidden: false, deleteAfterUpload: true, removeAllSourceMaps: sdkRemovesAll };\n\n case 'visible':\n if (deleteOption !== true) {\n return NO_CHANGE;\n }\n return {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: sdkRemovesAll,\n log: {\n level: 'info',\n message: fromUser\n ? 'Switching to hidden source maps because `sourcemaps.deleteSourcemapsAfterUpload` is set. ' +\n 'Without the `sourceMappingURL` comment browsers do not request the removed map files.'\n : 'Switching to hidden source maps, because the Sentry SDK removes them from the build output. ' +\n 'Without the `sourceMappingURL` comment browsers do not request the removed map files.',\n },\n };\n }\n}\n\n/**\n * The decision when `sourcemaps.delete` is set. Unlike `deleteSourcemapsAfterUpload`, it does not\n * depend on an upload: `true` removes every source map of the build, and `false` keeps the hidden\n * source maps the plugin turns on, also when nothing is uploaded.\n */\nfunction decideWithDeleteOption(\n kind: SourceMapKind,\n deleteSourceMaps: boolean,\n features: SourceMapFeatures,\n uploadPossible: boolean,\n): SourceMapDecision {\n switch (kind) {\n case 'off':\n return uploadPossible ? { ...NO_CHANGE, log: { level: 'warn', message: SOURCE_MAPS_OFF_MESSAGE } } : NO_CHANGE;\n\n case 'inline':\n return uploadPossible ? { ...NO_CHANGE, log: { level: 'warn', message: INLINE_SOURCE_MAPS_MESSAGE } } : NO_CHANGE;\n\n case 'unset':\n if (deleteSourceMaps) {\n // Maps that are only turned on to be removed again are not turned on.\n return uploadPossible\n ? {\n enableHidden: true,\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: {\n level: 'info',\n message: 'Enabling hidden source maps. They are uploaded to Sentry and removed from the build output.',\n },\n }\n : NO_CHANGE;\n }\n // Without debug IDs the maps are of no use to Sentry.\n if (!features.injectDebugIds) {\n return NO_CHANGE;\n }\n return {\n enableHidden: true,\n deleteAfterUpload: false,\n log: {\n level: 'info',\n message: uploadPossible\n ? 'Enabling hidden source maps. They are uploaded to Sentry and kept in the build output.'\n : 'Enabling hidden source maps. They are not uploaded to Sentry and are kept in the build output, because `sourcemaps.delete` is `false`.',\n },\n };\n\n case 'hidden':\n case 'visible':\n if (!deleteSourceMaps) {\n return NO_CHANGE;\n }\n return {\n enableHidden: kind === 'visible',\n deleteAfterUpload: true,\n removeAllSourceMaps: true,\n log: uploadPossible\n ? kind === 'visible'\n ? {\n level: 'info',\n message:\n 'Switching to hidden source maps because `sourcemaps.delete` is set. ' +\n 'Without the `sourceMappingURL` comment browsers do not request the removed map files.',\n }\n : undefined\n : {\n level: 'warn',\n message:\n 'Source maps are not uploaded, but they are removed from the build output because `sourcemaps.delete` is set.',\n },\n };\n }\n}\n"],"mappings":";;AA2BA,MAAM,YAA+B;CAAE,cAAc;CAAO,mBAAmB;AAAM;AAErF,MAAM,0BACJ;AAGF,MAAM,6BACJ;;;;;AAoBF,SAAgB,qBAAqB,SAA+C;CAClF,MAAM,EAAE,gBAAgB,WAAW,0BAA0B,QAAQ,UAAU;CAE/E,OAAO;EAAE;EAAgB;EAAQ,mBAAmB,kBAAkB,CAAC;CAAO;AAChF;;AAGA,SAAgB,uBAAuB,SAA4B,aAA2C;CAC5G,MAAM,QAAQ,QAAQ,YAAY;CAClC,OAAO,OAAO,UAAU,aAAa,MAAM,WAAW,IAAI;AAC5D;;;;;AAMA,SAAgB,gBAAgB,SAA4B,aAA2C;CACrG,OACE,QAAQ,YAAY,UACpB,QAAQ,YAAY,+BACpB,uBAAuB,SAAS,WAAW;AAE/C;;;;;;;AAQA,SAAgB,wBACd,MACA,SACA,gBACA,aACmB;CACnB,MAAM,WAAW,qBAAqB,OAAO;CAE7C,IAAI,QAAQ,YA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ACH,OAAO;KACP,SAAS,WACL,mLAEA;IAEN;GACF;CACJ;AACF;;;;;;AAOA,SAAS,uBACP,MACA,kBACA,UACA,gBACmB;CACnB,QAAQ,MAAR;EACE,KAAK,OACH,OAAO,iBAAiB;GAAE,GAAG;GAAW,KAAK;IAAE,OAAO;IAAQ,SAAS;GAAwB;EAAE,IAAI;EAEvG,KAAK,UACH,OAAO,iBAAiB;GAAE,GAAG;GAAW,KAAK;IAAE,OAAO;IAAQ,SAAS;GAA2B;EAAE,IAAI;EAE1G,KAAK;GACH,IAAI,kBAEF,OAAO,iBACH;IACE,cAAc;IACd,mBAAmB;IACnB,qBAAqB;IACrB,KAAK;KACH,OAAO;KACP,SAAS;IACX;GACF,IACA;GAGN,IAAI,CAAC,SAAS,gBACZ,OAAO;GAET,OAAO;IACL,cAAc;IACd,mBAAmB;IACnB,KAAK;KACH,OAAO;KACP,SAAS,iBACL,2FACA;IACN;GACF;EAEF,KAAK;EACL,KAAK;GACH,IAAI,CAAC,kBACH,OAAO;GAET,OAAO;IACL,cAAc,SAAS;IACvB,mBAAmB;IACnB,qBAAqB;IACrB,KAAK,iBACD,SAAS,YACP;KACE,OAAO;KACP,SACE;IAEJ,IACA,KAAA,IACF;KACE,OAAO;KACP,SACE;IACJ;GACN;CACJ;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../../src/core/version.ts"],"sourcesContent":["export const LIB_VERSION = \"11.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../../src/core/version.ts"],"sourcesContent":["export const LIB_VERSION = \"11.19.0\";\n"],"mappings":";AAAA,MAAa,cAAc"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"11.
|
|
1
|
+
{"type":"module","version":"11.19.0","sideEffects":["./sentry-release-injection-file.js","./sentry-esbuild-debugid-injection-file.js"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getDeleteOption,
|
|
1
|
+
import { getDeleteOption, getSdkDeleteSourceMaps } from "../core/sourcemap-settings.js";
|
|
2
2
|
import "../core/index.js";
|
|
3
3
|
import { getOutputMatch, sourceMapKindFromRollupSetting } from "../rollup/source-map-handling.js";
|
|
4
4
|
import * as path from "node:path";
|
|
@@ -76,7 +76,7 @@ function createViteSourceMapHooks(sentryBuildPluginManager, sourceMapHandling) {
|
|
|
76
76
|
const environmentName = decisions.has(name) ? name : void 0;
|
|
77
77
|
const { normalizedOptions } = sentryBuildPluginManager;
|
|
78
78
|
const deleteOption = getDeleteOption(normalizedOptions, environmentName);
|
|
79
|
-
const removeAll = normalizedOptions.sourcemaps?.delete === true ||
|
|
79
|
+
const removeAll = normalizedOptions.sourcemaps?.delete === true || getSdkDeleteSourceMaps(normalizedOptions, environmentName) === true;
|
|
80
80
|
for (const output of getOutputs(config.root, environment.build)) {
|
|
81
81
|
if (output.ownSetting) {
|
|
82
82
|
const outputKind = sourceMapKindFromRollupSetting(output.sourcemap);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-map-hooks.js","names":[],"sources":["../../../src/vite/source-map-hooks.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { SentryBuildPluginManager, SourceMapDecision, SourceMapKind } from '../core';\nimport { getDeleteOption,
|
|
1
|
+
{"version":3,"file":"source-map-hooks.js","names":[],"sources":["../../../src/vite/source-map-hooks.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { SentryBuildPluginManager, SourceMapDecision, SourceMapKind } from '../core';\nimport { getDeleteOption, getSdkDeleteSourceMaps } from '../core';\nimport type { OutputMatch, RollupSourceMapSetting, SourceMapHandling } from '../rollup/source-map-handling';\nimport { getOutputMatch, sourceMapKindFromRollupSetting } from '../rollup/source-map-handling';\n\ntype BundlerOutput = OutputMatch & { dir?: string; sourcemap?: RollupSourceMapSetting };\ntype BundlerOutputOptions = BundlerOutput | BundlerOutput[] | undefined;\n\ntype ViteBuildOptions = {\n sourcemap?: RollupSourceMapSetting;\n outDir?: string;\n rollupOptions?: { output?: BundlerOutputOptions };\n rolldownOptions?: { output?: BundlerOutputOptions };\n};\n\nexport type ViteUserConfig = {\n build?: ViteBuildOptions;\n environments?: Record<string, { build?: ViteBuildOptions } | undefined>;\n};\n\nexport type ViteResolvedConfig = {\n root: string;\n build: ViteBuildOptions;\n environments?: Record<string, { build: ViteBuildOptions }>;\n};\n\nexport type ViteSourceMapHooks = {\n config: (userConfig: ViteUserConfig, env: { command: string }) => ViteUserConfig | null;\n configResolved: (config: ViteResolvedConfig) => void;\n outputOptions: SourceMapHandling['applyHiddenDecision'];\n};\n\nconst NO_CHANGE: SourceMapDecision = { enableHidden: false, deleteAfterUpload: false };\n\ntype EnvironmentOutput = {\n destination: string;\n match: OutputMatch;\n sourcemap: RollupSourceMapSetting;\n /** The output sets `sourcemap` itself, which overrides `build.sourcemap`. */\n ownSetting: boolean;\n};\n\n/**\n * The outputs an environment writes: one per entry of `rollupOptions.output` or\n * `rolldownOptions.output`. An output writes to `build.outDir` (relative to the root) unless it\n * sets its own `dir`, which the bundler resolves from the working directory. An output's own\n * `sourcemap` overrides `build.sourcemap`.\n */\nfunction getOutputs(root: string, build: ViteBuildOptions): EnvironmentOutput[] {\n const configured = build.rolldownOptions?.output ?? build.rollupOptions?.output;\n const outputs = Array.isArray(configured) ? configured : [configured ?? {}];\n\n return outputs.map(output => {\n const sourcemap = output.sourcemap ?? build.sourcemap;\n return {\n destination: output.dir === undefined ? path.resolve(root, build.outDir ?? 'dist') : path.resolve(output.dir),\n match: getOutputMatch({ ...output, sourcemap }),\n sourcemap,\n ownSetting: output.sourcemap !== undefined,\n };\n });\n}\n\n/**\n * Vite warns about `rollupOptions.output.sourcemap`, so the Vite plugin decides on `build.sourcemap`\n * in a `config` hook. The hook belongs on the post plugin: framework plugins that set\n * `build.sourcemap` themselves run first, and the decision sees the merged setting. The output\n * directories are only known in `configResolved`, which then records the decision for each of them.\n */\nexport function createViteSourceMapHooks(\n sentryBuildPluginManager: SentryBuildPluginManager,\n sourceMapHandling: SourceMapHandling,\n): ViteSourceMapHooks {\n // `'*'` for the top-level setting, otherwise the name of an environment with its own.\n const decisions = new Map<string, { kind: SourceMapKind; decision: SourceMapDecision }>();\n\n return {\n config: (userConfig, env) => {\n if (env.command !== 'build') {\n return null;\n }\n\n // The same plugin instances can serve several builds in a row.\n decisions.clear();\n\n const kind = sourceMapKindFromRollupSetting(userConfig.build?.sourcemap);\n // Logged in `generateBundle`, which knows whether the output is written.\n const decision = sentryBuildPluginManager.sourceMaps.decide(kind, { log: false });\n decisions.set('*', { kind, decision });\n\n const result: ViteUserConfig = decision.enableHidden ? { build: { sourcemap: 'hidden' } } : {};\n\n for (const [name, environment] of Object.entries(userConfig.environments ?? {})) {\n const setting = environment?.build?.sourcemap;\n if (setting === undefined) {\n continue;\n }\n\n const environmentKind = sourceMapKindFromRollupSetting(setting);\n const environmentDecision = sentryBuildPluginManager.sourceMaps.decide(environmentKind, {\n log: false,\n environment: name,\n });\n decisions.set(name, { kind: environmentKind, decision: environmentDecision });\n\n if (environmentDecision.enableHidden) {\n result.environments = { ...result.environments, [name]: { build: { sourcemap: 'hidden' } } };\n }\n }\n\n return result;\n },\n\n configResolved: config => {\n const environments = config.environments ?? { client: { build: config.build } };\n\n for (const [name, environment] of Object.entries(environments)) {\n const { kind, decision } = decisions.get(name) ?? decisions.get('*') ?? { kind: 'unset', decision: NO_CHANGE };\n const environmentName = decisions.has(name) ? name : undefined;\n const { normalizedOptions } = sentryBuildPluginManager;\n const deleteOption = getDeleteOption(normalizedOptions, environmentName);\n // `sourcemaps.delete: true` removes every source map, like for maps the SDK turned on.\n const removeAll =\n normalizedOptions.sourcemaps?.delete === true ||\n getSdkDeleteSourceMaps(normalizedOptions, environmentName) === true;\n\n for (const output of getOutputs(config.root, environment.build)) {\n // Hidden maps of an output's own setting are removed when the user\n // asks for it, visible ones only when every source map is removed.\n // Removed visible maps switch to hidden in `outputOptions`, so no\n // `sourceMappingURL` comment points at a removed file.\n if (output.ownSetting) {\n const outputKind = sourceMapKindFromRollupSetting(output.sourcemap);\n const removeAllSourceMaps = removeAll && (outputKind === 'hidden' || outputKind === 'visible');\n const deleteAfterUpload = deleteOption === true && (outputKind === 'hidden' || removeAllSourceMaps);\n sourceMapHandling.setDecision(output.destination, {\n match: output.match,\n kind: outputKind,\n decision: {\n enableHidden: outputKind === 'visible' && deleteAfterUpload,\n deleteAfterUpload,\n removeAllSourceMaps,\n },\n });\n continue;\n }\n\n // A plugin that ran after ours may have changed the setting again.\n if (decision.deleteAfterUpload && output.sourcemap !== 'hidden') {\n sentryBuildPluginManager.logger.debug(\n `Source maps of the \"${name}\" environment are set to ${JSON.stringify(output.sourcemap)}. Not removing them after upload.`,\n );\n sourceMapHandling.setDecision(output.destination, { match: output.match, kind, decision: NO_CHANGE });\n } else {\n sourceMapHandling.setDecision(output.destination, { match: output.match, kind, decision });\n }\n }\n }\n },\n\n outputOptions: sourceMapHandling.applyHiddenDecision,\n };\n}\n"],"mappings":";;;;;AAiCA,MAAM,YAA+B;CAAE,cAAc;CAAO,mBAAmB;AAAM;;;;;;;AAgBrF,SAAS,WAAW,MAAc,OAA8C;CAC9E,MAAM,aAAa,MAAM,iBAAiB,UAAU,MAAM,eAAe;CAGzE,QAFgB,MAAM,QAAQ,UAAU,IAAI,aAAa,CAAC,cAAc,CAAC,CAAC,EAAA,CAE3D,KAAI,WAAU;EAC3B,MAAM,YAAY,OAAO,aAAa,MAAM;EAC5C,OAAO;GACL,aAAa,OAAO,QAAQ,KAAA,IAAY,KAAK,QAAQ,MAAM,MAAM,UAAU,MAAM,IAAI,KAAK,QAAQ,OAAO,GAAG;GAC5G,OAAO,eAAe;IAAE,GAAG;IAAQ;GAAU,CAAC;GAC9C;GACA,YAAY,OAAO,cAAc,KAAA;EACnC;CACF,CAAC;AACH;;;;;;;AAQA,SAAgB,yBACd,0BACA,mBACoB;CAEpB,MAAM,4BAAY,IAAI,IAAkE;CAExF,OAAO;EACL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mBAAmB,eAAe,MAAM;IAEjE,KAAK,MAAM,UAAU,WAAW,OAAO,MAAM,YAAY,KAAK,GAAG;KAK/D,IAAI,OAAO,YAAY;MACrB,MAAM,aAAa,+BAA+B,OAAO,SAAS;MAClE,MAAM,sBAAsB,cAAc,eAAe,YAAY,eAAe;MACpF,MAAM,oBAAoB,iBAAiB,SAAS,eAAe,YAAY;MAC/E,kBAAkB,YAAY,OAAO,aAAa;OAChD,OAAO,OAAO;OACd,MAAM;OACN,UAAU;QACR,cAAc,eAAe,aAAa;QAC1C;QACA;OACF;MACF,CAAC;MACD;KACF;KAGA,IAAI,SAAS,qBAAqB,OAAO,cAAc,UAAU;MAC/D,yBAAyB,OAAO,MAC9B,uBAAuB,KAAK,2BAA2B,KAAK,UAAU,OAAO,SAAS,EAAE,kCAC1F;MACA,kBAAkB,YAAY,OAAO,aAAa;OAAE,OAAO,OAAO;OAAO;OAAM,UAAU;MAAU,CAAC;KACtG,OACE,kBAAkB,YAAY,OAAO,aAAa;MAAE,OAAO,OAAO;MAAO;MAAM;KAAS,CAAC;IAE7F;GACF;EACF;EAEA,eAAe,kBAAkB;CACnC;AACF"}
|
|
@@ -42,7 +42,7 @@ export { CodeInjection, replaceBooleanFlagsInCode, stringToUUID, generateRelease
|
|
|
42
42
|
export { createSentryBuildPluginManager } from './build-plugin-manager';
|
|
43
43
|
export type { SentryBuildPluginManager, UploadResult, UploadStaging } from './build-plugin-manager';
|
|
44
44
|
export { createDebugIdUploadFunction, addDebugIdToEmittedArtifacts, stampDebugId } from './debug-id-upload';
|
|
45
|
-
export { decideSourceMapHandling, getDeleteOption,
|
|
45
|
+
export { decideSourceMapHandling, getDeleteOption, getSdkDeleteSourceMaps, getSourceMapFeatures, } from './sourcemap-settings';
|
|
46
46
|
export type { SourceMapDecision, SourceMapKind } from './sourcemap-settings';
|
|
47
47
|
export { hasSourceMapUploadCredentials } from './upload-credentials';
|
|
48
48
|
export type { UploadFilter } from './upload-filter';
|
|
@@ -1 +1 @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Z,2BAA2B,EAC3B,kCAAkC,EAClC,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,YAAY,EAAE,wBAAwB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -21,8 +21,8 @@ export type NormalizedOptions = {
|
|
|
21
21
|
rewriteSources?: RewriteSourcesHook;
|
|
22
22
|
resolveSourceMap?: ResolveSourceMapHook;
|
|
23
23
|
filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;
|
|
24
|
-
deleteSourcemapsAfterUpload?: boolean
|
|
25
|
-
|
|
24
|
+
deleteSourcemapsAfterUpload?: boolean;
|
|
25
|
+
sdkDeleteSourceMaps?: boolean | ((environment?: string) => boolean | undefined);
|
|
26
26
|
} | undefined;
|
|
27
27
|
release: {
|
|
28
28
|
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,OAAO,KAAK,EACV,eAAe,IAAI,WAAW,EAC9B,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAI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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,CA6DN;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAsBzF;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO5E"}
|
|
@@ -41,16 +41,18 @@ export type SourceMapFeatures = {
|
|
|
41
41
|
* `sourcemaps.disable` decides.
|
|
42
42
|
*/
|
|
43
43
|
export declare function getSourceMapFeatures(options: NormalizedOptions): SourceMapFeatures;
|
|
44
|
-
/** Reads `sourcemaps.
|
|
45
|
-
export declare function
|
|
46
|
-
/**
|
|
44
|
+
/** Reads the internal `sourcemaps.sdkDeleteSourceMaps` option, calling its function form if given. */
|
|
45
|
+
export declare function getSdkDeleteSourceMaps(options: NormalizedOptions, environment?: string): boolean | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Reads `sourcemaps.delete`. When it is unset, `sourcemaps.deleteSourcemapsAfterUpload` decides, and
|
|
48
|
+
* then the SDK.
|
|
49
|
+
*/
|
|
47
50
|
export declare function getDeleteOption(options: NormalizedOptions, environment?: string): boolean | undefined;
|
|
48
|
-
/** Reads the internal `sourcemaps.sdkEnabledSourceMaps` option, calling its function form if given. */
|
|
49
|
-
export declare function getSdkEnabledSourceMaps(options: NormalizedOptions, environment?: string): boolean;
|
|
50
51
|
/**
|
|
51
52
|
* Decides whether the plugin turns hidden source maps on and whether it removes the maps from the
|
|
52
53
|
* build output after the upload. The plugin only turns maps on when an upload can run, and only
|
|
53
|
-
* removes maps it turned on itself unless `deleteSourcemapsAfterUpload`
|
|
54
|
+
* removes maps it turned on itself unless `deleteSourcemapsAfterUpload` or the SDK's
|
|
55
|
+
* `sdkDeleteSourceMaps` says otherwise. The user's `deleteSourcemapsAfterUpload` wins over the SDK.
|
|
54
56
|
*/
|
|
55
57
|
export declare function decideSourceMapHandling(kind: SourceMapKind, options: NormalizedOptions, uploadPossible: boolean, environment?: string): SourceMapDecision;
|
|
56
58
|
//# sourceMappingURL=sourcemap-settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourcemap-settings.d.ts","sourceRoot":"","sources":["../../../src/core/sourcemap-settings.ts"],"names":[],"mappings":"AACA,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;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,GAAG,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD,C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5G;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAMrG;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,iBAAiB,EAC1B,cAAc,EAAE,OAAO,EACvB,WAAW,CAAC,EAAE,MAAM,GACnB,iBAAiB,CAmHnB"}
|
|
@@ -658,21 +658,24 @@ export type HandleRecoverableErrorFn = (error: unknown, throwByDefault: boolean)
|
|
|
658
658
|
/**
|
|
659
659
|
* @internal For Sentry SDK packages only. It can change in any release.
|
|
660
660
|
*
|
|
661
|
-
* Like `Options`, but
|
|
662
|
-
* `sourcemaps.
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
*
|
|
661
|
+
* Like `Options`, but with the SDK's own source map deletion decision in
|
|
662
|
+
* `sourcemaps.sdkDeleteSourceMaps`. The plugin calls its function form when it decides how to treat
|
|
663
|
+
* the bundler's source map setting, so an SDK can give a value that it only knows after it created
|
|
664
|
+
* the plugin. Vite passes the name of an environment with its own `build.sourcemap`, and `undefined`
|
|
665
|
+
* for the top-level `build.sourcemap`.
|
|
666
666
|
*/
|
|
667
667
|
export type InternalOptions = Omit<Options, 'sourcemaps'> & {
|
|
668
|
-
sourcemaps?:
|
|
669
|
-
deleteSourcemapsAfterUpload?: boolean | ((environment?: string) => boolean | undefined);
|
|
668
|
+
sourcemaps?: NonNullable<Options['sourcemaps']> & {
|
|
670
669
|
/**
|
|
671
|
-
*
|
|
672
|
-
*
|
|
673
|
-
*
|
|
670
|
+
* - `true`: the SDK turned the source maps on, so the plugin removes every source map, also those of
|
|
671
|
+
* CSS and of chunks that the upload leaves out.
|
|
672
|
+
* - `false`: the plugin keeps the source maps.
|
|
673
|
+
* - `undefined`: the plugin's own rules apply.
|
|
674
|
+
*
|
|
675
|
+
* The user's `sourcemaps.delete` replaces it. The user's `sourcemaps.deleteSourcemapsAfterUpload`
|
|
676
|
+
* decides whether source maps are removed, and `true` here still makes that all of them.
|
|
674
677
|
*/
|
|
675
|
-
|
|
678
|
+
sdkDeleteSourceMaps?: boolean | ((environment?: string) => boolean | undefined);
|
|
676
679
|
};
|
|
677
680
|
};
|
|
678
681
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;;;;;;;;;WAUG;QACH,MAAM,CAAC,EAAE,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AE,MAAM,CAAC;IACb,KAAK,EAAE,gBAAgB,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,gBAAgB,CAAA;KAAE,CAAC,CAAC;CAC5D,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,cAAc,GAAG,IAAI,CAAC;IACxF,cAAc,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACrD,aAAa,EAAE,iBAAiB,CAAC,qBAAqB,CAAC,CAAC;CACzD,CAAC;AAiCF;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,wBAAwB,EAAE,wBAAwB,EAClD,iBAAiB,EAAE,iBAAiB,GACnC,kBAAkB,CA0FpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/bundler-plugins",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.19.0",
|
|
4
4
|
"description": "Sentry Bundler Plugins",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@sentry/core": "11.
|
|
94
|
+
"@sentry/core": "11.19.0",
|
|
95
95
|
"dotenv": "^17.4.2",
|
|
96
96
|
"glob": "^14.0.3",
|
|
97
97
|
"magic-string": "~0.30.8 || ^1.0.0",
|
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
"@babel/core": "^7.18.5",
|
|
115
115
|
"@babel/parser": "^8.0.10",
|
|
116
116
|
"@babel/preset-react": "^7.23.3",
|
|
117
|
-
"@sentry-internal/rollup-utils": "11.
|
|
118
|
-
"@sentry-internal/test-utils": "11.
|
|
117
|
+
"@sentry-internal/rollup-utils": "11.19.0",
|
|
118
|
+
"@sentry-internal/test-utils": "11.19.0",
|
|
119
119
|
"@types/babel__core": "^7.20.5",
|
|
120
120
|
"@types/node": "^20.19.0",
|
|
121
121
|
"rolldown": "^1.0.0",
|