@sentry/bundler-plugins 11.11.0 → 11.13.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/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/assertClassBrand.js +6 -0
- package/build/cjs/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/checkPrivateRedeclaration.js +5 -0
- package/build/cjs/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldGet2.js +6 -0
- package/build/cjs/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldInitSpec.js +6 -0
- package/build/cjs/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldSet2.js +6 -0
- package/build/cjs/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateMethodInitSpec.js +6 -0
- package/build/cjs/_virtual/_rolldown/runtime.js +22 -0
- package/build/cjs/babel-plugin/component-annotation.js +14 -32
- package/build/cjs/babel-plugin/component-annotation.js.map +1 -1
- package/build/cjs/babel-plugin/constants.js +140 -122
- package/build/cjs/babel-plugin/constants.js.map +1 -1
- package/build/cjs/babel-plugin/experimental.js +204 -307
- package/build/cjs/babel-plugin/experimental.js.map +1 -1
- package/build/cjs/babel-plugin/index.js +315 -437
- package/build/cjs/babel-plugin/index.js.map +1 -1
- package/build/cjs/bun/index.js +81 -117
- package/build/cjs/bun/index.js.map +1 -1
- package/build/cjs/core/build-plugin-manager.js +626 -683
- package/build/cjs/core/build-plugin-manager.js.map +1 -1
- package/build/cjs/core/cli.js +134 -129
- package/build/cjs/core/cli.js.map +1 -1
- package/build/cjs/core/component-annotate-hooks.js +16 -27
- package/build/cjs/core/component-annotate-hooks.js.map +1 -1
- package/build/cjs/core/component-annotation-oxc-ast.js +10 -21
- package/build/cjs/core/component-annotation-oxc-ast.js.map +1 -1
- package/build/cjs/core/component-annotation-oxc-fragments.js +45 -74
- package/build/cjs/core/component-annotation-oxc-fragments.js.map +1 -1
- package/build/cjs/core/component-annotation-oxc-jsx.js +116 -156
- package/build/cjs/core/component-annotation-oxc-jsx.js.map +1 -1
- package/build/cjs/core/component-annotation-oxc-walk.js +62 -123
- package/build/cjs/core/component-annotation-oxc-walk.js.map +1 -1
- package/build/cjs/core/component-annotation-oxc.js +68 -103
- package/build/cjs/core/component-annotation-oxc.js.map +1 -1
- package/build/cjs/core/debug-id-upload.js +223 -234
- package/build/cjs/core/debug-id-upload.js.map +1 -1
- package/build/cjs/core/get-code-injection-position.js +59 -74
- package/build/cjs/core/get-code-injection-position.js.map +1 -1
- package/build/cjs/core/glob.js +9 -7
- package/build/cjs/core/glob.js.map +1 -1
- package/build/cjs/core/index.js +77 -61
- package/build/cjs/core/index.js.map +1 -1
- package/build/cjs/core/logger.js +17 -26
- package/build/cjs/core/logger.js.map +1 -1
- package/build/cjs/core/options-mapping.js +95 -117
- package/build/cjs/core/options-mapping.js.map +1 -1
- package/build/cjs/core/sentry/telemetry.js +90 -105
- package/build/cjs/core/sentry/telemetry.js.map +1 -1
- package/build/cjs/core/sentry/transports.js +92 -99
- package/build/cjs/core/sentry/transports.js.map +1 -1
- package/build/cjs/core/sourcemap-settings.js +98 -61
- package/build/cjs/core/sourcemap-settings.js.map +1 -1
- package/build/cjs/core/upload-filter.js +52 -0
- package/build/cjs/core/upload-filter.js.map +1 -0
- package/build/cjs/core/utils.js +228 -219
- package/build/cjs/core/utils.js.map +1 -1
- package/build/cjs/core/version.js +4 -5
- package/build/cjs/core/version.js.map +1 -1
- package/build/cjs/esbuild/index.js +180 -210
- package/build/cjs/esbuild/index.js.map +1 -1
- package/build/cjs/loader-utils/index.js +5 -10
- package/build/cjs/rollup/debug-id-injection.js +22 -38
- package/build/cjs/rollup/debug-id-injection.js.map +1 -1
- package/build/cjs/rollup/debug-id-stamping.js +14 -24
- package/build/cjs/rollup/debug-id-stamping.js.map +1 -1
- package/build/cjs/rollup/index.js +195 -209
- package/build/cjs/rollup/index.js.map +1 -1
- package/build/cjs/rollup/source-map-handling.js +178 -0
- package/build/cjs/rollup/source-map-handling.js.map +1 -0
- package/build/cjs/vite/index.js +19 -35
- package/build/cjs/vite/index.js.map +1 -1
- package/build/cjs/vite/source-map-hooks.js +116 -0
- package/build/cjs/vite/source-map-hooks.js.map +1 -0
- package/build/cjs/webpack/component-annotation-transform.js +20 -26
- package/build/cjs/webpack/component-annotation-transform.js.map +1 -1
- package/build/cjs/webpack/index.js +277 -234
- package/build/cjs/webpack/index.js.map +1 -1
- package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/assertClassBrand.js +6 -0
- package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/checkPrivateRedeclaration.js +5 -0
- package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldGet2.js +6 -0
- package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldInitSpec.js +6 -0
- package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldSet2.js +6 -0
- package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateMethodInitSpec.js +6 -0
- package/build/esm/_virtual/_rolldown/runtime.js +2 -0
- package/build/esm/babel-plugin/component-annotation.js +13 -29
- package/build/esm/babel-plugin/component-annotation.js.map +1 -1
- package/build/esm/babel-plugin/constants.js +140 -120
- package/build/esm/babel-plugin/constants.js.map +1 -1
- package/build/esm/babel-plugin/experimental.js +204 -305
- package/build/esm/babel-plugin/experimental.js.map +1 -1
- package/build/esm/babel-plugin/index.js +311 -434
- package/build/esm/babel-plugin/index.js.map +1 -1
- package/build/esm/bun/index.js +76 -101
- package/build/esm/bun/index.js.map +1 -1
- package/build/esm/core/build-plugin-manager.js +621 -664
- package/build/esm/core/build-plugin-manager.js.map +1 -1
- package/build/esm/core/cli.js +134 -127
- package/build/esm/core/cli.js.map +1 -1
- package/build/esm/core/component-annotate-hooks.js +16 -25
- package/build/esm/core/component-annotate-hooks.js.map +1 -1
- package/build/esm/core/component-annotation-oxc-ast.js +9 -19
- package/build/esm/core/component-annotation-oxc-ast.js.map +1 -1
- package/build/esm/core/component-annotation-oxc-fragments.js +44 -72
- package/build/esm/core/component-annotation-oxc-fragments.js.map +1 -1
- package/build/esm/core/component-annotation-oxc-jsx.js +115 -154
- package/build/esm/core/component-annotation-oxc-jsx.js.map +1 -1
- package/build/esm/core/component-annotation-oxc-walk.js +61 -121
- package/build/esm/core/component-annotation-oxc-walk.js.map +1 -1
- package/build/esm/core/component-annotation-oxc.js +65 -96
- package/build/esm/core/component-annotation-oxc.js.map +1 -1
- package/build/esm/core/debug-id-upload.js +218 -213
- package/build/esm/core/debug-id-upload.js.map +1 -1
- package/build/esm/core/get-code-injection-position.js +59 -72
- package/build/esm/core/get-code-injection-position.js.map +1 -1
- package/build/esm/core/glob.js +9 -5
- package/build/esm/core/glob.js.map +1 -1
- package/build/esm/core/index.js +62 -47
- package/build/esm/core/index.js.map +1 -1
- package/build/esm/core/logger.js +17 -24
- package/build/esm/core/logger.js.map +1 -1
- package/build/esm/core/options-mapping.js +95 -115
- package/build/esm/core/options-mapping.js.map +1 -1
- package/build/esm/core/sentry/telemetry.js +89 -102
- package/build/esm/core/sentry/telemetry.js.map +1 -1
- package/build/esm/core/sentry/transports.js +90 -83
- package/build/esm/core/sentry/transports.js.map +1 -1
- package/build/esm/core/sourcemap-settings.js +96 -59
- package/build/esm/core/sourcemap-settings.js.map +1 -1
- package/build/esm/core/upload-filter.js +50 -0
- package/build/esm/core/upload-filter.js.map +1 -0
- package/build/esm/core/utils.js +221 -209
- package/build/esm/core/utils.js.map +1 -1
- package/build/esm/core/version.js +4 -3
- package/build/esm/core/version.js.map +1 -1
- package/build/esm/esbuild/index.js +176 -194
- package/build/esm/esbuild/index.js.map +1 -1
- package/build/esm/loader-utils/index.js +4 -3
- package/build/esm/package.json +1 -1
- package/build/esm/rollup/debug-id-injection.js +22 -36
- package/build/esm/rollup/debug-id-injection.js.map +1 -1
- package/build/esm/rollup/debug-id-stamping.js +14 -22
- package/build/esm/rollup/debug-id-stamping.js.map +1 -1
- package/build/esm/rollup/index.js +191 -189
- package/build/esm/rollup/index.js.map +1 -1
- package/build/esm/rollup/source-map-handling.js +173 -0
- package/build/esm/rollup/source-map-handling.js.map +1 -0
- package/build/esm/vite/index.js +19 -32
- package/build/esm/vite/index.js.map +1 -1
- package/build/esm/vite/source-map-hooks.js +114 -0
- package/build/esm/vite/source-map-hooks.js.map +1 -0
- package/build/esm/webpack/component-annotation-transform.js +17 -24
- package/build/esm/webpack/component-annotation-transform.js.map +1 -1
- package/build/esm/webpack/index.js +274 -216
- package/build/esm/webpack/index.js.map +1 -1
- package/build/types/core/build-plugin-manager.d.ts +33 -10
- package/build/types/core/build-plugin-manager.d.ts.map +1 -1
- package/build/types/core/cli.d.ts +6 -1
- package/build/types/core/cli.d.ts.map +1 -1
- package/build/types/core/debug-id-upload.d.ts +7 -4
- package/build/types/core/debug-id-upload.d.ts.map +1 -1
- package/build/types/core/index.d.ts +4 -3
- package/build/types/core/index.d.ts.map +1 -1
- package/build/types/core/options-mapping.d.ts +4 -3
- 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 +10 -1
- package/build/types/core/sourcemap-settings.d.ts.map +1 -1
- package/build/types/core/types.d.ts +32 -1
- package/build/types/core/types.d.ts.map +1 -1
- package/build/types/core/upload-filter.d.ts +9 -0
- package/build/types/core/upload-filter.d.ts.map +1 -0
- package/build/types/core/utils.d.ts +4 -0
- package/build/types/core/utils.d.ts.map +1 -1
- package/build/types/core/version.d.ts +1 -1
- package/build/types/esbuild/index.d.ts +2 -2
- package/build/types/esbuild/index.d.ts.map +1 -1
- package/build/types/rollup/index.d.ts +107 -7
- package/build/types/rollup/index.d.ts.map +1 -1
- package/build/types/rollup/source-map-handling.d.ts +59 -0
- package/build/types/rollup/source-map-handling.d.ts.map +1 -0
- package/build/types/vite/index.d.ts +4 -8
- package/build/types/vite/index.d.ts.map +1 -1
- package/build/types/vite/source-map-hooks.d.ts +45 -0
- package/build/types/vite/source-map-hooks.d.ts.map +1 -0
- package/build/types/webpack/index.d.ts +7 -3
- package/build/types/webpack/index.d.ts.map +1 -1
- package/package.json +33 -38
- package/build/cjs/loader-utils/index.js.map +0 -1
- package/build/esm/loader-utils/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/webpack/index.ts"],"sourcesContent":["/* oxlint-disable max-lines */\n\nimport type { Options } from '../core/index';\nimport {\n createSentryBuildPluginManager,\n generateReleaseInjectorCode,\n generateModuleMetadataInjectorCode,\n stringToUUID,\n createComponentNameAnnotateHooks,\n CodeInjection,\n getDebugIdSnippet,\n createDebugIdUploadFunction,\n getCodeInjectionPosition,\n isJsFile,\n stampDebugId,\n} from '../core/index';\nimport * as path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { createRequire } from 'node:module';\nimport { randomUUID } from 'node:crypto';\n\nconst _req = createRequire(import.meta.url);\n\n// Resolve the loader path via the package's own exports.\n// This module may end up in a shared chunk (_chunks/) whose import.meta.url\n// does not point to the webpack/ directory where the transform file lives, so\n// a path-relative lookup would fail. Using require.resolve on the package export\n// always finds the correct installed file regardless of chunk placement.\nlet COMPONENT_ANNOTATION_LOADER: string;\ntry {\n COMPONENT_ANNOTATION_LOADER = _req.resolve('@sentry/bundler-plugins/webpack-loader');\n} catch {\n // Fallback for non-packaged environments (e.g., monorepo source runs without dist)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore Rollup transpiles import.meta for us for CJS\n const dirname = path.dirname(fileURLToPath(import.meta.url));\n // The Rollup build emits `.js` for both CJS and ESM, so the extension is the same in both.\n COMPONENT_ANNOTATION_LOADER = path.resolve(dirname, 'component-annotation-transform.js');\n}\n\ntype PluginClass = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (options: any): unknown;\n};\n\ntype WebpackSource = {\n source: () => string | Buffer;\n};\n\ntype WebpackRawSource = {\n new (source: string): WebpackSource;\n};\n\ntype WebpackReplaceSource = WebpackSource & {\n insert: (position: number, value: string) => void;\n};\n\nconst WEBPACK_JAVASCRIPT_ASSET_REGEX = /\\.(?:js|ts|jsx|tsx|mjs|cjs|mts|cts)(?:\\?[^?]*)?(?:#[^#]*)?$/;\n\ntype WebpackAsset = {\n name: string;\n source: WebpackSource;\n info: {\n related?: {\n sourceMap?: string | string[];\n };\n };\n};\n\ntype WebpackCompiler = {\n options: {\n plugins?: unknown[];\n mode?: string;\n module?: {\n rules?: unknown[];\n };\n };\n hooks: {\n compilation: {\n tap: (name: string, callback: (compilation: WebpackCompilation) => void) => void;\n };\n thisCompilation: {\n tap: (name: string, callback: (compilation: WebpackCompilation) => void) => void;\n };\n afterEmit: {\n tapAsync: (name: string, callback: (compilation: WebpackCompilation, cb: () => void) => void) => void;\n };\n done: {\n tap: (name: string, callback: () => void) => void;\n };\n };\n webpack?: {\n DefinePlugin?: PluginClass;\n Compilation?: {\n PROCESS_ASSETS_STAGE_ADDITIONS?: number;\n PROCESS_ASSETS_STAGE_DEV_TOOLING?: number;\n };\n sources?: {\n RawSource?: WebpackRawSource;\n ReplaceSource?: new (source: WebpackSource) => WebpackReplaceSource;\n };\n };\n};\n\ntype WebpackCompilation = {\n chunks: Iterable<{\n files: Iterable<string>;\n hash?: string;\n contentHash?: { javascript?: string };\n canBeInitial?: () => boolean;\n }>;\n outputOptions: {\n path?: string;\n };\n assets: Record<string, unknown>;\n getAssets: () => WebpackAsset[];\n getAsset: (name: string) => WebpackAsset | undefined;\n updateAsset: (name: string, source: WebpackSource) => void;\n hooks: {\n processAssets: {\n tap: (\n options: { name: string; stage: number },\n callback: (assets: Record<string, WebpackSource>) => void,\n ) => void;\n };\n };\n};\n\ntype WebpackModule = {\n version?: string;\n default?: { version?: string };\n};\n\n// Only used for telemetry; `webpack` is an optional peer dependency and may be absent (e.g. rspack).\nfunction getWebpackMajorVersion(): string | undefined {\n try {\n const webpack = _req('webpack') as WebpackModule;\n const version = webpack.version ?? webpack.default?.version;\n return version?.split('.')[0];\n } catch {\n return undefined;\n }\n}\n\n/**\n * Stamps each JS asset's debug ID into the asset itself and its source map asset.\n *\n * Runs after source maps have been generated, so the JS asset no longer needs to carry\n * source map information and can be replaced with a plain `RawSource`.\n */\nfunction addDebugIdsToAssets(compilation: WebpackCompilation, RawSource: WebpackRawSource): void {\n for (const asset of compilation.getAssets()) {\n if (!isJsFile(asset.name)) {\n continue;\n }\n\n const bundleSource = asset.source.source().toString();\n const relatedSourceMap = asset.info.related?.sourceMap;\n const sourceMapName = typeof relatedSourceMap === 'string' ? relatedSourceMap : `${asset.name}.map`;\n const sourceMapAsset = compilation.getAsset(sourceMapName);\n\n const stamped = stampDebugId(bundleSource, sourceMapAsset?.source.source().toString());\n if (!stamped) {\n continue;\n }\n\n compilation.updateAsset(asset.name, new RawSource(stamped.bundleSource));\n if (stamped.sourceMapSource !== undefined) {\n compilation.updateAsset(sourceMapName, new RawSource(stamped.sourceMapSource));\n }\n }\n}\n\nfunction createSentryWebpackPlugin(userOptions: SentryWebpackPluginOptions = {}) {\n const sentryBuildPluginManager = createSentryBuildPluginManager(userOptions, {\n loggerPrefix: userOptions._metaOptions?.loggerPrefixOverride ?? '[sentry-webpack-plugin]',\n buildTool: 'webpack',\n buildToolMajorVersion: getWebpackMajorVersion(),\n });\n\n const {\n logger,\n normalizedOptions: options,\n bundleSizeOptimizationReplacementValues: replacementValues,\n bundleMetadata,\n createDependencyOnBuildArtifacts,\n } = sentryBuildPluginManager;\n\n if (options.disable) {\n return {\n apply() {\n // noop plugin\n },\n };\n }\n\n if (process.cwd().match(/\\\\node_modules\\\\|\\/node_modules\\//)) {\n logger.warn('Running Sentry plugin from within a `node_modules` folder. Some features may not work.');\n }\n\n const sourcemapsEnabled = options.sourcemaps?.disable !== true;\n const releaseInjectionCode = new CodeInjection();\n const chunkInjectionCode = new CodeInjection();\n\n if (!options.release.inject) {\n logger.debug('Release injection disabled via `release.inject` option. Will not inject release.');\n } else if (!options.release.name) {\n logger.debug(\n 'No release name provided. Will not inject release. Please set the `release.name` option to identify your release.',\n );\n } else {\n releaseInjectionCode.append(\n generateReleaseInjectorCode({\n release: options.release.name,\n injectBuildInformation: options._experiments.injectBuildInformation || false,\n }),\n );\n }\n\n if (Object.keys(bundleMetadata).length > 0) {\n chunkInjectionCode.append(generateModuleMetadataInjectorCode(bundleMetadata));\n }\n\n const transformAnnotations = options.reactComponentAnnotation?.enabled\n ? createComponentNameAnnotateHooks(\n options.reactComponentAnnotation?.ignoredComponents || [],\n !!options.reactComponentAnnotation?._experimentalInjectIntoHtml,\n { logger },\n )\n : undefined;\n\n const transformReplace = Object.keys(replacementValues).length > 0;\n\n function addCodeInjection(compiler: WebpackCompiler): void {\n if (releaseInjectionCode.isEmpty() && chunkInjectionCode.isEmpty() && !sourcemapsEnabled) {\n return;\n }\n\n const ReplaceSource = compiler.webpack?.sources?.ReplaceSource;\n const processAssetsStage = compiler.webpack?.Compilation?.PROCESS_ASSETS_STAGE_ADDITIONS;\n\n if (!ReplaceSource || processAssetsStage === undefined) {\n logger.warn(\n 'Webpack sources are not available. Skipping code injection. This usually means webpack is not properly configured.',\n );\n return;\n }\n\n compiler.hooks.compilation.tap('sentry-webpack-plugin-injection', compilation => {\n compilation.hooks.processAssets.tap(\n {\n name: 'sentry-webpack-plugin-injection',\n stage: processAssetsStage,\n },\n assets => {\n const injectedAssets = new Set<string>();\n\n for (const chunk of compilation.chunks) {\n for (const assetName of chunk.files) {\n if (injectedAssets.has(assetName) || !WEBPACK_JAVASCRIPT_ASSET_REGEX.test(assetName)) {\n continue;\n }\n\n const source = assets[assetName];\n if (!source) {\n continue;\n }\n injectedAssets.add(assetName);\n\n const sourceContents = source.source();\n const code = typeof sourceContents === 'string' ? sourceContents : Buffer.from(sourceContents).toString();\n const codeToInject = new CodeInjection();\n if (chunk.canBeInitial?.() ?? true) {\n codeToInject.append(releaseInjectionCode);\n }\n codeToInject.append(chunkInjectionCode);\n if (sourcemapsEnabled) {\n const hash = chunk.contentHash?.javascript ?? chunk.hash;\n codeToInject.append(getDebugIdSnippet(hash ? stringToUUID(hash) : randomUUID()));\n }\n\n const injectionPosition = getCodeInjectionPosition(code);\n const injection = injectionPosition === code.length ? `\\n${codeToInject.code()}` : codeToInject.code();\n const updatedSource = new ReplaceSource(source);\n updatedSource.insert(injectionPosition, injection);\n compilation.updateAsset(assetName, updatedSource);\n }\n }\n },\n );\n });\n }\n\n return {\n apply(compiler: WebpackCompiler) {\n void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal().catch(() => {\n // Telemetry failures are acceptable\n });\n\n const { DefinePlugin } = compiler.webpack ?? {};\n\n // BannerPlugin prepends executable code before directive prologues.\n addCodeInjection(compiler);\n\n // The upload routine (which stamps debug IDs into temp copies of the artifacts) is skipped\n // with `disable-upload`, so the emitted artifacts get stamped in the asset pipeline instead.\n if (sourcemapsEnabled && options.sourcemaps?.disable === 'disable-upload') {\n const RawSource = compiler.webpack?.sources?.RawSource;\n // Right after source map generation (and thus after minification, which would strip the comment),\n // so later stages (real content hashing, subresource integrity) see the final assets.\n const stage = (compiler.webpack?.Compilation?.PROCESS_ASSETS_STAGE_DEV_TOOLING ?? 500) + 1;\n\n if (!RawSource) {\n logger.warn(\n 'Webpack sources are not available. Skipping debug ID injection into emitted source maps. This usually means webpack is not properly configured.',\n );\n } else {\n compiler.hooks.thisCompilation.tap('sentry-webpack-plugin', compilation => {\n compilation.hooks.processAssets.tap({ name: 'sentry-webpack-plugin', stage }, () => {\n addDebugIdsToAssets(compilation, RawSource);\n });\n });\n }\n }\n\n // Add DefinePlugin for bundle size optimizations\n if (transformReplace && DefinePlugin) {\n compiler.options.plugins = compiler.options.plugins || [];\n compiler.options.plugins.push(new DefinePlugin(replacementValues));\n }\n\n // Add component name annotation transform\n if (transformAnnotations?.transform) {\n compiler.options.module = compiler.options.module || {};\n compiler.options.module.rules = compiler.options.module.rules || [];\n compiler.options.module.rules.unshift({\n test: /\\.[jt]sx$/,\n exclude: /node_modules/,\n enforce: 'pre',\n use: [\n {\n loader: COMPONENT_ANNOTATION_LOADER,\n options: {\n transform: transformAnnotations.transform,\n },\n },\n ],\n });\n }\n\n compiler.hooks.afterEmit.tapAsync(\n 'sentry-webpack-plugin',\n (compilation: WebpackCompilation, callback: (err?: Error) => void) => {\n const freeGlobalDependencyOnBuildArtifacts = createDependencyOnBuildArtifacts();\n const upload = createDebugIdUploadFunction({ sentryBuildPluginManager });\n\n const run = async (): Promise<void> => {\n try {\n await sentryBuildPluginManager.createRelease();\n if (sourcemapsEnabled && options.sourcemaps?.disable !== 'disable-upload') {\n const outputPath = compilation.outputOptions.path ?? path.resolve();\n const buildArtifacts = Object.keys(compilation.assets).map(asset => path.join(outputPath, asset));\n await upload(buildArtifacts);\n }\n } finally {\n freeGlobalDependencyOnBuildArtifacts();\n await sentryBuildPluginManager.deleteArtifacts();\n }\n };\n\n run().then(\n () => callback(),\n (err: Error) => callback(err),\n );\n },\n );\n\n if (userOptions._experiments?.forceExitOnBuildCompletion && compiler.options.mode === 'production') {\n compiler.hooks.done.tap('sentry-webpack-plugin', () => {\n setTimeout(() => {\n logger.debug('Exiting process after debug file upload');\n process.exit(0);\n });\n });\n }\n },\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryWebpackPlugin: (options?: SentryWebpackPluginOptions) => any = createSentryWebpackPlugin;\n\nexport type SentryWebpackPluginOptions = Options & {\n _experiments?: Options['_experiments'] & {\n /**\n * If enabled, the webpack plugin will exit the build process after the build completes.\n * Use this with caution, as it will terminate the process.\n *\n * More information: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/345\n *\n * @default false\n */\n forceExitOnBuildCompletion?: boolean;\n };\n};\n"],"names":["createRequire","path","fileURLToPath","isJsFile","stampDebugId","createSentryBuildPluginManager","CodeInjection","generateReleaseInjectorCode","generateModuleMetad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A,CAAM,IAAA,CAAK,GAAA,CAAI,uBAAA,EAAyB,MAAM;AACrD,UAAA,UAAA,CAAW,MAAM;AACf,YAAA,MAAA,CAAO,MAAM,yCAAyC,CAAA;AACtD,YAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,UAChB,CAAC,CAAA;AAAA,QACH,CAAC,CAAA;AAAA,MACH;AAAA,IACF;AAAA,GACF;AACF;AAGO,MAAM,mBAAA,GAAqE;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["createRequire","path","fileURLToPath","isJsFile","stampDebugId","createSentryBuildPluginManager","CodeInjection","generateReleaseInjectorCode","generateModuleMetadataInjectorCode","createComponentNameAnnotateHooks","getDebugIdSnippet","stringToUUID","randomUUID","getCodeInjectionPosition","createDebugIdUploadFunction"],"sources":["../../../src/webpack/index.ts"],"sourcesContent":["/* oxlint-disable max-lines */\n\nimport type {\n InternalOptions,\n Options,\n SourceMapDecision,\n SourceMapKind,\n UploadFilter,\n UploadStaging,\n} from '../core/index';\nimport {\n createSentryBuildPluginManager,\n generateReleaseInjectorCode,\n generateModuleMetadataInjectorCode,\n stringToUUID,\n createComponentNameAnnotateHooks,\n CodeInjection,\n getDebugIdSnippet,\n createDebugIdUploadFunction,\n getCodeInjectionPosition,\n isJsFile,\n stampDebugId,\n} from '../core/index';\nimport * as path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { createRequire } from 'node:module';\nimport { randomUUID } from 'node:crypto';\n\nconst _req = createRequire(import.meta.url);\n\n// Resolve the loader path via the package's own exports.\n// This module may end up in a shared chunk (_chunks/) whose import.meta.url\n// does not point to the webpack/ directory where the transform file lives, so\n// a path-relative lookup would fail. Using require.resolve on the package export\n// always finds the correct installed file regardless of chunk placement.\nlet COMPONENT_ANNOTATION_LOADER: string;\ntry {\n COMPONENT_ANNOTATION_LOADER = _req.resolve('@sentry/bundler-plugins/webpack-loader');\n} catch {\n // Fallback for non-packaged environments (e.g., monorepo source runs without dist)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore Rollup transpiles import.meta for us for CJS\n const dirname = path.dirname(fileURLToPath(import.meta.url));\n // The Rollup build emits `.js` for both CJS and ESM, so the extension is the same in both.\n COMPONENT_ANNOTATION_LOADER = path.resolve(dirname, 'component-annotation-transform.js');\n}\n\ntype PluginClass = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (options: any): unknown;\n};\n\ntype WebpackSource = {\n source: () => string | Buffer;\n};\n\ntype WebpackRawSource = {\n new (source: string): WebpackSource;\n};\n\ntype WebpackReplaceSource = WebpackSource & {\n insert: (position: number, value: string) => void;\n};\n\nconst WEBPACK_JAVASCRIPT_ASSET_REGEX = /\\.(?:js|ts|jsx|tsx|mjs|cjs|mts|cts)(?:\\?[^?]*)?(?:#[^#]*)?$/;\n\ntype WebpackAsset = {\n name: string;\n source: WebpackSource;\n info: {\n related?: {\n sourceMap?: string | string[];\n };\n };\n};\n\ntype WebpackCompiler = {\n options: {\n plugins?: unknown[];\n mode?: string;\n devtool?: string | false;\n module?: {\n rules?: unknown[];\n };\n };\n hooks: {\n compilation: {\n tap: (name: string, callback: (compilation: WebpackCompilation) => void) => void;\n };\n thisCompilation: {\n tap: (name: string, callback: (compilation: WebpackCompilation) => void) => void;\n };\n emit: {\n tap: (name: string, callback: (compilation: WebpackCompilation) => void) => void;\n };\n afterEmit: {\n tapAsync: (name: string, callback: (compilation: WebpackCompilation, cb: () => void) => void) => void;\n };\n done: {\n tap: (name: string, callback: () => void) => void;\n };\n failed?: {\n tap: (name: string, callback: () => void) => void;\n };\n };\n webpack?: {\n DefinePlugin?: PluginClass;\n Compilation?: {\n PROCESS_ASSETS_STAGE_ADDITIONS?: number;\n PROCESS_ASSETS_STAGE_DEV_TOOLING?: number;\n PROCESS_ASSETS_STAGE_REPORT?: number;\n };\n sources?: {\n RawSource?: WebpackRawSource;\n ReplaceSource?: new (source: WebpackSource) => WebpackReplaceSource;\n };\n };\n};\n\ntype WebpackCompilation = {\n chunks: Iterable<{\n files: Iterable<string>;\n hash?: string;\n contentHash?: { javascript?: string };\n canBeInitial?: () => boolean;\n }>;\n outputOptions: {\n path?: string;\n };\n assets: Record<string, unknown>;\n getAssets: () => WebpackAsset[];\n getAsset: (name: string) => WebpackAsset | undefined;\n updateAsset: (name: string, source: WebpackSource) => void;\n deleteAsset: (name: string) => void;\n hooks: {\n processAssets: {\n tap: (\n options: { name: string; stage: number },\n callback: (assets: Record<string, WebpackSource>) => void,\n ) => void;\n tapPromise: (options: { name: string; stage: number }, callback: () => Promise<void>) => void;\n };\n };\n};\n\n/**\n * Maps webpack's `devtool` onto the plugin's source map kinds. A user who sets `devtool: false`\n * and adds a `SourceMapDevToolPlugin` manages source maps themselves.\n */\nfunction sourceMapKindFromDevtool(compiler: WebpackCompiler): SourceMapKind | undefined {\n const devtool = compiler.options.devtool;\n\n if (devtool === undefined) {\n return 'unset';\n }\n if (devtool === false) {\n const hasSourceMapPlugin = compiler.options.plugins?.some(\n plugin =>\n (plugin as { constructor?: { name?: string } } | undefined)?.constructor?.name === 'SourceMapDevToolPlugin',\n );\n return hasSourceMapPlugin ? undefined : 'off';\n }\n // Plain `eval` has no source maps at all.\n if (!devtool.includes('source-map')) {\n return 'off';\n }\n if (devtool.includes('inline') || devtool.includes('eval')) {\n return 'inline';\n }\n if (devtool.includes('hidden')) {\n return 'hidden';\n }\n return 'visible';\n}\n\ntype WebpackModule = {\n version?: string;\n default?: { version?: string };\n};\n\n// Only used for telemetry; `webpack` is an optional peer dependency and may be absent (e.g. rspack).\nfunction getWebpackMajorVersion(): string | undefined {\n try {\n const webpack = _req('webpack') as WebpackModule;\n const version = webpack.version ?? webpack.default?.version;\n return version?.split('.')[0];\n } catch {\n return undefined;\n }\n}\n\n/**\n * Stamps each JS asset's debug ID into the asset itself and its source map asset.\n *\n * Runs after source maps have been generated, so the JS asset no longer needs to carry\n * source map information and can be replaced with a plain `RawSource`.\n */\nfunction addDebugIdsToAssets(compilation: WebpackCompilation, RawSource: WebpackRawSource): void {\n for (const asset of compilation.getAssets()) {\n if (!isJsFile(asset.name)) {\n continue;\n }\n\n const bundleSource = asset.source.source().toString();\n const relatedSourceMap = asset.info.related?.sourceMap;\n const sourceMapName = typeof relatedSourceMap === 'string' ? relatedSourceMap : `${asset.name}.map`;\n const sourceMapAsset = compilation.getAsset(sourceMapName);\n\n const stamped = stampDebugId(bundleSource, sourceMapAsset?.source.source().toString());\n if (!stamped) {\n continue;\n }\n\n compilation.updateAsset(asset.name, new RawSource(stamped.bundleSource));\n if (stamped.sourceMapSource !== undefined) {\n compilation.updateAsset(sourceMapName, new RawSource(stamped.sourceMapSource));\n }\n }\n}\n\n/** Drops a source map asset and its compressed variants from the compilation. */\nfunction deleteSourceMapAssets(compilation: WebpackCompilation, sourceMapName: string): void {\n for (const candidate of compilation.getAssets()) {\n if (candidate.name === sourceMapName || candidate.name.startsWith(`${sourceMapName}.`)) {\n compilation.deleteAsset(candidate.name);\n }\n }\n}\n\n/**\n * Drops the source maps of the JS assets that an upload would include. With `removeAll` it drops\n * the source maps of all assets, CSS included.\n */\nfunction dropSourceMaps(compilation: WebpackCompilation, shouldUpload: UploadFilter, removeAll: boolean): void {\n const outputPath = compilation.outputOptions.path ?? path.resolve();\n\n for (const asset of compilation.getAssets()) {\n if (!removeAll && (!isJsFile(asset.name) || !shouldUpload(path.join(outputPath, asset.name)))) {\n continue;\n }\n const relatedSourceMap = asset.info.related?.sourceMap;\n const sourceMapName = typeof relatedSourceMap === 'string' ? relatedSourceMap : `${asset.name}.map`;\n if (compilation.getAsset(sourceMapName)) {\n deleteSourceMapAssets(compilation, sourceMapName);\n }\n }\n}\n\n/**\n * Copies each JS asset and its source map into the upload staging folder and drops the source map\n * assets (and their compressed variants) from the compilation, so webpack never emits them.\n *\n * A map the plugin or the SDK turned on (`pluginEnabledMaps`) never reaches the output, whether or\n * not its asset is uploaded. That covers CSS maps, which `devtool` turns on along with the JS ones.\n * A map the user enabled stays unless it was staged.\n */\nasync function stageSourceMaps(\n compilation: WebpackCompilation,\n staging: UploadStaging,\n logger: { warn: (message: string) => void },\n pluginEnabledMaps: boolean,\n): Promise<void> {\n const outputPath = compilation.outputOptions.path ?? path.resolve();\n\n for (const asset of compilation.getAssets()) {\n const relatedSourceMap = asset.info.related?.sourceMap;\n const sourceMapName = typeof relatedSourceMap === 'string' ? relatedSourceMap : `${asset.name}.map`;\n const sourceMapAsset = compilation.getAsset(sourceMapName);\n if (!sourceMapAsset) {\n continue;\n }\n\n if (!isJsFile(asset.name)) {\n if (pluginEnabledMaps) {\n deleteSourceMapAssets(compilation, sourceMapName);\n }\n continue;\n }\n\n const result = await staging.stage({\n code: asset.source.source().toString(),\n mapSource: sourceMapAsset.source.source().toString(),\n mapDir: path.join(outputPath, path.dirname(sourceMapName)),\n chunkPath: path.join(outputPath, asset.name),\n });\n\n if (result === 'skipped' || result === 'failed') {\n logger.warn(\n pluginEnabledMaps\n ? `Could not prepare ${asset.name} for upload, so it is not uploaded and its source map ${sourceMapName} was removed from the build output.`\n : `Could not prepare ${asset.name} for upload, so its source map ${sourceMapName} stays in the build output.`,\n );\n }\n if (result === 'staged' || pluginEnabledMaps) {\n deleteSourceMapAssets(compilation, sourceMapName);\n }\n }\n}\n\nfunction createSentryWebpackPlugin(userOptions: SentryWebpackPluginInternalOptions = {}) {\n const sentryBuildPluginManager = createSentryBuildPluginManager(userOptions, {\n loggerPrefix: userOptions._metaOptions?.loggerPrefixOverride ?? '[sentry-webpack-plugin]',\n buildTool: 'webpack',\n buildToolMajorVersion: getWebpackMajorVersion(),\n });\n\n const {\n logger,\n normalizedOptions: options,\n bundleSizeOptimizationReplacementValues: replacementValues,\n bundleMetadata,\n createDependencyOnBuildArtifacts,\n } = sentryBuildPluginManager;\n\n if (options.disable) {\n return {\n apply() {\n // noop plugin\n },\n };\n }\n\n if (process.cwd().match(/\\\\node_modules\\\\|\\/node_modules\\//)) {\n logger.warn('Running Sentry plugin from within a `node_modules` folder. Some features may not work.');\n }\n\n const sourcemapsEnabled = options.sourcemaps?.disable !== true;\n const releaseInjectionCode = new CodeInjection();\n const chunkInjectionCode = new CodeInjection();\n\n if (!options.release.inject) {\n logger.debug('Release injection disabled via `release.inject` option. Will not inject release.');\n } else if (!options.release.name) {\n logger.debug(\n 'No release name provided. Will not inject release. Please set the `release.name` option to identify your release.',\n );\n } else {\n releaseInjectionCode.append(\n generateReleaseInjectorCode({\n release: options.release.name,\n injectBuildInformation: options._experiments.injectBuildInformation || false,\n }),\n );\n }\n\n if (Object.keys(bundleMetadata).length > 0) {\n chunkInjectionCode.append(generateModuleMetadataInjectorCode(bundleMetadata));\n }\n\n const transformAnnotations = options.reactComponentAnnotation?.enabled\n ? createComponentNameAnnotateHooks(\n options.reactComponentAnnotation?.ignoredComponents || [],\n !!options.reactComponentAnnotation?._experimentalInjectIntoHtml,\n { logger },\n )\n : undefined;\n\n const transformReplace = Object.keys(replacementValues).length > 0;\n\n function decideSourceMaps(compiler: WebpackCompiler): { kind?: SourceMapKind; decision: SourceMapDecision } {\n const kind = compiler.options.mode === 'development' ? undefined : sourceMapKindFromDevtool(compiler);\n if (kind === undefined) {\n return { decision: { enableHidden: false, deleteAfterUpload: false } };\n }\n\n const decision = sentryBuildPluginManager.sourceMaps.decide(kind);\n\n if (decision.enableHidden) {\n compiler.options.devtool = kind === 'visible' ? `hidden-${compiler.options.devtool}` : 'hidden-source-map';\n }\n\n return { kind, decision };\n }\n\n function addCodeInjection(compiler: WebpackCompiler): void {\n if (releaseInjectionCode.isEmpty() && chunkInjectionCode.isEmpty() && !sourcemapsEnabled) {\n return;\n }\n\n const ReplaceSource = compiler.webpack?.sources?.ReplaceSource;\n const processAssetsStage = compiler.webpack?.Compilation?.PROCESS_ASSETS_STAGE_ADDITIONS;\n\n if (!ReplaceSource || processAssetsStage === undefined) {\n logger.warn(\n 'Webpack sources are not available. Skipping code injection. This usually means webpack is not properly configured.',\n );\n return;\n }\n\n compiler.hooks.compilation.tap('sentry-webpack-plugin-injection', compilation => {\n compilation.hooks.processAssets.tap(\n {\n name: 'sentry-webpack-plugin-injection',\n stage: processAssetsStage,\n },\n assets => {\n const injectedAssets = new Set<string>();\n\n for (const chunk of compilation.chunks) {\n for (const assetName of chunk.files) {\n if (injectedAssets.has(assetName) || !WEBPACK_JAVASCRIPT_ASSET_REGEX.test(assetName)) {\n continue;\n }\n\n const source = assets[assetName];\n if (!source) {\n continue;\n }\n injectedAssets.add(assetName);\n\n const sourceContents = source.source();\n const code = typeof sourceContents === 'string' ? sourceContents : Buffer.from(sourceContents).toString();\n const codeToInject = new CodeInjection();\n if (chunk.canBeInitial?.() ?? true) {\n codeToInject.append(releaseInjectionCode);\n }\n codeToInject.append(chunkInjectionCode);\n if (sourcemapsEnabled) {\n const hash = chunk.contentHash?.javascript ?? chunk.hash;\n codeToInject.append(getDebugIdSnippet(hash ? stringToUUID(hash) : randomUUID()));\n }\n\n const injectionPosition = getCodeInjectionPosition(code);\n const injection = injectionPosition === code.length ? `\\n${codeToInject.code()}` : codeToInject.code();\n const updatedSource = new ReplaceSource(source);\n updatedSource.insert(injectionPosition, injection);\n compilation.updateAsset(assetName, updatedSource);\n }\n }\n },\n );\n });\n }\n\n return {\n apply(compiler: WebpackCompiler) {\n void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal().catch(() => {\n // Telemetry failures are acceptable\n });\n\n const { DefinePlugin } = compiler.webpack ?? {};\n\n // One plugin instance can serve several compilers (`MultiCompiler`) and\n // a compiler several compilations (watch mode), so nothing is shared.\n const { decision: sourceMapDecision } = decideSourceMaps(compiler);\n const removeAllSourceMaps = sourceMapDecision.removeAllSourceMaps === true;\n const pendingStagings = new Map<WebpackCompilation, UploadStaging>();\n\n // After `RealContentHashPlugin` rewrote the hash placeholders, so the staged\n // JS equals the emitted file and `[contenthash]` names are final.\n const deleteStage = (compiler.webpack?.Compilation?.PROCESS_ASSETS_STAGE_REPORT ?? 5000) + 1;\n\n if (sourceMapDecision.deleteAfterUpload && !sentryBuildPluginManager.sourceMaps.uploadPossible) {\n compiler.hooks.thisCompilation.tap('sentry-webpack-plugin', compilation => {\n compilation.hooks.processAssets.tap({ name: 'sentry-webpack-plugin', stage: deleteStage }, () => {\n dropSourceMaps(compilation, sentryBuildPluginManager.sourceMaps.shouldUpload, removeAllSourceMaps);\n });\n });\n } else if (sourceMapDecision.deleteAfterUpload) {\n compiler.hooks.thisCompilation.tap('sentry-webpack-plugin', compilation => {\n compilation.hooks.processAssets.tapPromise(\n { name: 'sentry-webpack-plugin', stage: deleteStage },\n async () => {\n const staging = await sentryBuildPluginManager.createUploadStaging();\n pendingStagings.set(compilation, staging);\n await stageSourceMaps(compilation, staging, logger, removeAllSourceMaps);\n },\n );\n });\n\n // A staging that `afterEmit` never took belongs to a compilation that\n // failed before emitting, or to one whose assets were emitted without\n // their maps because an earlier `afterEmit` tap failed. Only the\n // second kind has no other copy of the maps.\n const emittedCompilations = new Set<WebpackCompilation>();\n compiler.hooks.emit.tap('sentry-webpack-plugin', compilation => {\n emittedCompilations.add(compilation);\n });\n const settlePendingStagings = (): void => {\n for (const [compilation, staging] of pendingStagings) {\n if (emittedCompilations.has(compilation)) {\n void staging.keep('The source map upload did not run.');\n } else {\n void staging.discard();\n }\n }\n pendingStagings.clear();\n emittedCompilations.clear();\n };\n compiler.hooks.done.tap('sentry-webpack-plugin', settlePendingStagings);\n compiler.hooks.failed?.tap('sentry-webpack-plugin', settlePendingStagings);\n }\n\n // BannerPlugin prepends executable code before directive prologues.\n addCodeInjection(compiler);\n\n // The upload routine (which stamps debug IDs into temp copies of the artifacts) is skipped\n // with `disable-upload`, so the emitted artifacts get stamped in the asset pipeline instead.\n if (sourcemapsEnabled && options.sourcemaps?.disable === 'disable-upload') {\n const RawSource = compiler.webpack?.sources?.RawSource;\n // Right after source map generation (and thus after minification, which would strip the comment),\n // so later stages (real content hashing, subresource integrity) see the final assets.\n const stage = (compiler.webpack?.Compilation?.PROCESS_ASSETS_STAGE_DEV_TOOLING ?? 500) + 1;\n\n if (!RawSource) {\n logger.warn(\n 'Webpack sources are not available. Skipping debug ID injection into emitted source maps. This usually means webpack is not properly configured.',\n );\n } else {\n compiler.hooks.thisCompilation.tap('sentry-webpack-plugin', compilation => {\n compilation.hooks.processAssets.tap({ name: 'sentry-webpack-plugin', stage }, () => {\n addDebugIdsToAssets(compilation, RawSource);\n });\n });\n }\n }\n\n // Add DefinePlugin for bundle size optimizations\n if (transformReplace && DefinePlugin) {\n compiler.options.plugins = compiler.options.plugins || [];\n compiler.options.plugins.push(new DefinePlugin(replacementValues));\n }\n\n // Add component name annotation transform\n if (transformAnnotations?.transform) {\n compiler.options.module = compiler.options.module || {};\n compiler.options.module.rules = compiler.options.module.rules || [];\n compiler.options.module.rules.unshift({\n test: /\\.[jt]sx$/,\n exclude: /node_modules/,\n enforce: 'pre',\n use: [\n {\n loader: COMPONENT_ANNOTATION_LOADER,\n options: {\n transform: transformAnnotations.transform,\n },\n },\n ],\n });\n }\n\n compiler.hooks.afterEmit.tapAsync(\n 'sentry-webpack-plugin',\n (compilation: WebpackCompilation, callback: (err?: Error) => void) => {\n const freeGlobalDependencyOnBuildArtifacts = createDependencyOnBuildArtifacts();\n const upload = createDebugIdUploadFunction({ sentryBuildPluginManager });\n\n const staging = pendingStagings.get(compilation);\n pendingStagings.delete(compilation);\n let stagingHandedOver = false;\n\n const run = async (): Promise<void> => {\n try {\n await sentryBuildPluginManager.createRelease();\n if (sourcemapsEnabled && options.sourcemaps?.disable !== 'disable-upload') {\n const outputPath = compilation.outputOptions.path ?? path.resolve();\n const buildArtifacts = Object.keys(compilation.assets).map(asset => path.join(outputPath, asset));\n stagingHandedOver = true;\n await upload(buildArtifacts, { staging });\n } else {\n stagingHandedOver = true;\n await staging?.discard();\n }\n } catch (e) {\n if (!stagingHandedOver) {\n await staging?.keep('The source map upload did not run.');\n }\n throw e;\n } finally {\n freeGlobalDependencyOnBuildArtifacts();\n await sentryBuildPluginManager.deleteArtifacts();\n }\n };\n\n run().then(\n () => callback(),\n (err: Error) => callback(err),\n );\n },\n );\n\n if (userOptions._experiments?.forceExitOnBuildCompletion && compiler.options.mode === 'production') {\n compiler.hooks.done.tap('sentry-webpack-plugin', () => {\n setTimeout(() => {\n logger.debug('Exiting process after debug file upload');\n process.exit(0);\n });\n });\n }\n },\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryWebpackPlugin: (options?: SentryWebpackPluginInternalOptions) => any = createSentryWebpackPlugin;\n\n/** @internal For Sentry SDK packages only. See `InternalOptions`. */\nexport type SentryWebpackPluginInternalOptions = InternalOptions & WebpackExperiments;\n\nexport type SentryWebpackPluginOptions = Options & WebpackExperiments;\n\ntype WebpackExperiments = {\n _experiments?: Options['_experiments'] & {\n /**\n * If enabled, the webpack plugin will exit the build process after the build completes.\n * Use this with caution, as it will terminate the process.\n *\n * More information: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/345\n *\n * @default false\n */\n forceExitOnBuildCompletion?: boolean;\n };\n};\n"],"mappings":";;;;;;;;;;;;;;AA4BA,MAAM,QAAA,GAAOA,YAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B;AAO1C,IAAI;AACJ,IAAI;CACF,8BAA8B,KAAK,QAAQ,wCAAwC;AACrF,QAAQ;CAIN,MAAM,UAAUC,UAAK,SAAA,GAAQC,SAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B,CAAC;CAE3D,8BAA8BD,UAAK,QAAQ,SAAS,mCAAmC;AACzF;AAmBA,MAAM,iCAAiC;;;;;AAqFvC,SAAS,yBAAyB,UAAsD;CACtF,MAAM,UAAU,SAAS,QAAQ;CAEjC,IAAI,YAAY,KAAA,GACd,OAAO;CAET,IAAI,YAAY,OAKd,OAJ2B,SAAS,QAAQ,SAAS,MACnD,WACG,QAA4D,aAAa,SAAS,wBACvF,IAC4B,KAAA,IAAY;CA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YAA2B;IACrC,IAAI;KACF,MAAM,yBAAyB,cAAc;KAC7C,IAAI,qBAAqB,QAAQ,YAAY,YAAY,kBAAkB;MACzE,MAAM,aAAa,YAAY,cAAc,QAAQb,UAAK,QAAQ;MAClE,MAAM,iBAAiB,OAAO,KAAK,YAAY,MAAM,CAAC,CAAC,KAAI,UAASA,UAAK,KAAK,YAAY,KAAK,CAAC;MAChG,oBAAoB;MACpB,MAAM,OAAO,gBAAgB,EAAE,QAAQ,CAAC;KAC1C,OAAO;MACL,oBAAoB;MACpB,MAAM,SAAS,QAAQ;KACzB;IACF,SAAS,GAAG;KACV,IAAI,CAAC,mBACH,MAAM,SAAS,KAAK,oCAAoC;KAE1D,MAAM;IACR,UAAU;KACR,qCAAqC;KACrC,MAAM,yBAAyB,gBAAgB;IACjD;GACF;GAEA,IAAI,CAAC,CAAC,WACE,SAAS,IACd,QAAe,SAAS,GAAG,CAC9B;EACF,CACF;EAEA,IAAI,YAAY,cAAc,8BAA8B,SAAS,QAAQ,SAAS,cACpF,SAAS,MAAM,KAAK,IAAI,+BAA+B;GACrD,iBAAiB;IACf,OAAO,MAAM,yCAAyC;IACtD,QAAQ,KAAK,CAAC;GAChB,CAAC;EACH,CAAC;CAEL,EACF;AACF;AAGA,MAAa,sBAA6E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/assertClassBrand.js
|
|
2
|
+
function _assertClassBrand(e, t, n) {
|
|
3
|
+
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
4
|
+
throw new TypeError("Private element is not present on this object");
|
|
5
|
+
}
|
|
6
|
+
export { _assertClassBrand as default };
|
package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/checkPrivateRedeclaration.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/checkPrivateRedeclaration.js
|
|
2
|
+
function _checkPrivateRedeclaration(e, t) {
|
|
3
|
+
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
4
|
+
}
|
|
5
|
+
export { _checkPrivateRedeclaration as default };
|
package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldInitSpec.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import _checkPrivateRedeclaration from "./checkPrivateRedeclaration.js";
|
|
2
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
3
|
+
function _classPrivateFieldInitSpec(e, t, a) {
|
|
4
|
+
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
5
|
+
}
|
|
6
|
+
export { _classPrivateFieldInitSpec as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import _assertClassBrand from "./assertClassBrand.js";
|
|
2
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/classPrivateFieldSet2.js
|
|
3
|
+
function _classPrivateFieldSet2(s, a, r) {
|
|
4
|
+
return s.set(_assertClassBrand(s, a), r), r;
|
|
5
|
+
}
|
|
6
|
+
export { _classPrivateFieldSet2 as default };
|
package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateMethodInitSpec.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import _checkPrivateRedeclaration from "./checkPrivateRedeclaration.js";
|
|
2
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
3
|
+
function _classPrivateMethodInitSpec(e, a) {
|
|
4
|
+
_checkPrivateRedeclaration(e, a), a.add(e);
|
|
5
|
+
}
|
|
6
|
+
export { _classPrivateMethodInitSpec as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_IGNORED_ELEMENTS } from
|
|
2
|
-
|
|
1
|
+
import { DEFAULT_IGNORED_ELEMENTS } from "./constants.js";
|
|
2
|
+
// src/babel-plugin/component-annotation.ts
|
|
3
3
|
const WEB_COMPONENT_NAME = "data-sentry-component";
|
|
4
4
|
const WEB_ELEMENT_NAME = "data-sentry-element";
|
|
5
5
|
const WEB_SOURCE_FILE_NAME = "data-sentry-source-file";
|
|
@@ -7,32 +7,16 @@ const NATIVE_COMPONENT_NAME = "dataSentryComponent";
|
|
|
7
7
|
const NATIVE_ELEMENT_NAME = "dataSentryElement";
|
|
8
8
|
const NATIVE_SOURCE_FILE_NAME = "dataSentrySourceFile";
|
|
9
9
|
const DEFAULT_IGNORED_ELEMENTS_SET = new Set(DEFAULT_IGNORED_ELEMENTS);
|
|
10
|
-
function getComponentAnnotationAttributes({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (isFragment || ignoredComponents.includes(componentName) || ignoredComponents.includes(elementName)) {
|
|
20
|
-
return [];
|
|
21
|
-
}
|
|
22
|
-
const [componentAttributeName, elementAttributeName, sourceFileAttributeName] = attributeNames;
|
|
23
|
-
const isIgnoredElement = DEFAULT_IGNORED_ELEMENTS_SET.has(elementName);
|
|
24
|
-
const attributes = [];
|
|
25
|
-
if (!isIgnoredElement && !existingAttributes.has(elementAttributeName)) {
|
|
26
|
-
attributes.push([elementAttributeName, elementName]);
|
|
27
|
-
}
|
|
28
|
-
if (componentName && !existingAttributes.has(componentAttributeName)) {
|
|
29
|
-
attributes.push([componentAttributeName, componentName]);
|
|
30
|
-
}
|
|
31
|
-
if (sourceFileName && (componentName || !isIgnoredElement) && !existingAttributes.has(sourceFileAttributeName)) {
|
|
32
|
-
attributes.push([sourceFileAttributeName, sourceFileName]);
|
|
33
|
-
}
|
|
34
|
-
return attributes;
|
|
10
|
+
function getComponentAnnotationAttributes({ attributeNames, componentName, elementName, existingAttributes, ignoredComponents, isFragment, sourceFileName }) {
|
|
11
|
+
if (isFragment || ignoredComponents.includes(componentName) || ignoredComponents.includes(elementName)) return [];
|
|
12
|
+
const [componentAttributeName, elementAttributeName, sourceFileAttributeName] = attributeNames;
|
|
13
|
+
const isIgnoredElement = DEFAULT_IGNORED_ELEMENTS_SET.has(elementName);
|
|
14
|
+
const attributes = [];
|
|
15
|
+
if (!isIgnoredElement && !existingAttributes.has(elementAttributeName)) attributes.push([elementAttributeName, elementName]);
|
|
16
|
+
if (componentName && !existingAttributes.has(componentAttributeName)) attributes.push([componentAttributeName, componentName]);
|
|
17
|
+
if (sourceFileName && (componentName || !isIgnoredElement) && !existingAttributes.has(sourceFileAttributeName)) attributes.push([sourceFileAttributeName, sourceFileName]);
|
|
18
|
+
return attributes;
|
|
35
19
|
}
|
|
36
|
-
|
|
37
20
|
export { NATIVE_COMPONENT_NAME, NATIVE_ELEMENT_NAME, NATIVE_SOURCE_FILE_NAME, WEB_COMPONENT_NAME, WEB_ELEMENT_NAME, WEB_SOURCE_FILE_NAME, getComponentAnnotationAttributes };
|
|
38
|
-
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=component-annotation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-annotation.js","sources":["../../../src/babel-plugin/component-annotation.ts"],"sourcesContent":["import { DEFAULT_IGNORED_ELEMENTS } from './constants';\n\nexport const WEB_COMPONENT_NAME = 'data-sentry-component';\nexport const WEB_ELEMENT_NAME = 'data-sentry-element';\nexport const WEB_SOURCE_FILE_NAME = 'data-sentry-source-file';\n\nexport const NATIVE_COMPONENT_NAME = 'dataSentryComponent';\nexport const NATIVE_ELEMENT_NAME = 'dataSentryElement';\nexport const NATIVE_SOURCE_FILE_NAME = 'dataSentrySourceFile';\n\nexport type ComponentAnnotationAttributeNames = readonly [string, string, string];\n\nexport type ComponentAnnotationAttribute = [string, string];\n\ntype ComponentAnnotationAttributesInput = {\n attributeNames: ComponentAnnotationAttributeNames;\n componentName: string;\n elementName: string;\n existingAttributes: ReadonlySet<string>;\n ignoredComponents: readonly string[];\n isFragment: boolean;\n sourceFileName?: string;\n};\n\nconst DEFAULT_IGNORED_ELEMENTS_SET = new Set(DEFAULT_IGNORED_ELEMENTS);\n\nexport function getComponentAnnotationAttributes({\n attributeNames,\n componentName,\n elementName,\n existingAttributes,\n ignoredComponents,\n isFragment,\n sourceFileName,\n}: ComponentAnnotationAttributesInput): ComponentAnnotationAttribute[] {\n if (isFragment || ignoredComponents.includes(componentName) || ignoredComponents.includes(elementName)) {\n return [];\n }\n\n const [componentAttributeName, elementAttributeName, sourceFileAttributeName] = attributeNames;\n const isIgnoredElement = DEFAULT_IGNORED_ELEMENTS_SET.has(elementName);\n const attributes: ComponentAnnotationAttribute[] = [];\n\n if (!isIgnoredElement && !existingAttributes.has(elementAttributeName)) {\n attributes.push([elementAttributeName, elementName]);\n }\n\n if (componentName && !existingAttributes.has(componentAttributeName)) {\n attributes.push([componentAttributeName, componentName]);\n }\n\n if (sourceFileName && (componentName || !isIgnoredElement) && !existingAttributes.has(sourceFileAttributeName)) {\n attributes.push([sourceFileAttributeName, sourceFileName]);\n }\n\n return attributes;\n}\n"],"
|
|
1
|
+
{"version":3,"file":"component-annotation.js","names":[],"sources":["../../../src/babel-plugin/component-annotation.ts"],"sourcesContent":["import { DEFAULT_IGNORED_ELEMENTS } from './constants';\n\nexport const WEB_COMPONENT_NAME = 'data-sentry-component';\nexport const WEB_ELEMENT_NAME = 'data-sentry-element';\nexport const WEB_SOURCE_FILE_NAME = 'data-sentry-source-file';\n\nexport const NATIVE_COMPONENT_NAME = 'dataSentryComponent';\nexport const NATIVE_ELEMENT_NAME = 'dataSentryElement';\nexport const NATIVE_SOURCE_FILE_NAME = 'dataSentrySourceFile';\n\nexport type ComponentAnnotationAttributeNames = readonly [string, string, string];\n\nexport type ComponentAnnotationAttribute = [string, string];\n\ntype ComponentAnnotationAttributesInput = {\n attributeNames: ComponentAnnotationAttributeNames;\n componentName: string;\n elementName: string;\n existingAttributes: ReadonlySet<string>;\n ignoredComponents: readonly string[];\n isFragment: boolean;\n sourceFileName?: string;\n};\n\nconst DEFAULT_IGNORED_ELEMENTS_SET = new Set(DEFAULT_IGNORED_ELEMENTS);\n\nexport function getComponentAnnotationAttributes({\n attributeNames,\n componentName,\n elementName,\n existingAttributes,\n ignoredComponents,\n isFragment,\n sourceFileName,\n}: ComponentAnnotationAttributesInput): ComponentAnnotationAttribute[] {\n if (isFragment || ignoredComponents.includes(componentName) || ignoredComponents.includes(elementName)) {\n return [];\n }\n\n const [componentAttributeName, elementAttributeName, sourceFileAttributeName] = attributeNames;\n const isIgnoredElement = DEFAULT_IGNORED_ELEMENTS_SET.has(elementName);\n const attributes: ComponentAnnotationAttribute[] = [];\n\n if (!isIgnoredElement && !existingAttributes.has(elementAttributeName)) {\n attributes.push([elementAttributeName, elementName]);\n }\n\n if (componentName && !existingAttributes.has(componentAttributeName)) {\n attributes.push([componentAttributeName, componentName]);\n }\n\n if (sourceFileName && (componentName || !isIgnoredElement) && !existingAttributes.has(sourceFileAttributeName)) {\n attributes.push([sourceFileAttributeName, sourceFileName]);\n }\n\n return attributes;\n}\n"],"mappings":";;AAEA,MAAa,qBAAqB;AAClC,MAAa,mBAAmB;AAChC,MAAa,uBAAuB;AAEpC,MAAa,wBAAwB;AACrC,MAAa,sBAAsB;AACnC,MAAa,0BAA0B;AAgBvC,MAAM,+BAA+B,IAAI,IAAI,wBAAwB;AAErE,SAAgB,iCAAiC,EAC/C,gBACA,eACA,aACA,oBACA,mBACA,YACA,kBACqE;CACrE,IAAI,cAAc,kBAAkB,SAAS,aAAa,KAAK,kBAAkB,SAAS,WAAW,GACnG,OAAO,CAAC;CAGV,MAAM,CAAC,wBAAwB,sBAAsB,2BAA2B;CAChF,MAAM,mBAAmB,6BAA6B,IAAI,WAAW;CACrE,MAAM,aAA6C,CAAC;CAEpD,IAAI,CAAC,oBAAoB,CAAC,mBAAmB,IAAI,oBAAoB,GACnE,WAAW,KAAK,CAAC,sBAAsB,WAAW,CAAC;CAGrD,IAAI,iBAAiB,CAAC,mBAAmB,IAAI,sBAAsB,GACjE,WAAW,KAAK,CAAC,wBAAwB,aAAa,CAAC;CAGzD,IAAI,mBAAmB,iBAAiB,CAAC,qBAAqB,CAAC,mBAAmB,IAAI,uBAAuB,GAC3G,WAAW,KAAK,CAAC,yBAAyB,cAAc,CAAC;CAG3D,OAAO;AACT"}
|
|
@@ -1,123 +1,143 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
// src/babel-plugin/constants.ts
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2020 Engineering at FullStory
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
const KNOWN_INCOMPATIBLE_PLUGINS = ["react-native-testfairy", "@react-navigation"];
|
|
7
27
|
const DEFAULT_IGNORED_ELEMENTS = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
28
|
+
"a",
|
|
29
|
+
"abbr",
|
|
30
|
+
"address",
|
|
31
|
+
"area",
|
|
32
|
+
"article",
|
|
33
|
+
"aside",
|
|
34
|
+
"audio",
|
|
35
|
+
"b",
|
|
36
|
+
"base",
|
|
37
|
+
"bdi",
|
|
38
|
+
"bdo",
|
|
39
|
+
"blockquote",
|
|
40
|
+
"body",
|
|
41
|
+
"br",
|
|
42
|
+
"button",
|
|
43
|
+
"canvas",
|
|
44
|
+
"caption",
|
|
45
|
+
"cite",
|
|
46
|
+
"code",
|
|
47
|
+
"col",
|
|
48
|
+
"colgroup",
|
|
49
|
+
"data",
|
|
50
|
+
"datalist",
|
|
51
|
+
"dd",
|
|
52
|
+
"del",
|
|
53
|
+
"details",
|
|
54
|
+
"dfn",
|
|
55
|
+
"dialog",
|
|
56
|
+
"div",
|
|
57
|
+
"dl",
|
|
58
|
+
"dt",
|
|
59
|
+
"em",
|
|
60
|
+
"embed",
|
|
61
|
+
"fieldset",
|
|
62
|
+
"figure",
|
|
63
|
+
"footer",
|
|
64
|
+
"form",
|
|
65
|
+
"h1",
|
|
66
|
+
"h2",
|
|
67
|
+
"h3",
|
|
68
|
+
"h4",
|
|
69
|
+
"h5",
|
|
70
|
+
"h6",
|
|
71
|
+
"head",
|
|
72
|
+
"header",
|
|
73
|
+
"hgroup",
|
|
74
|
+
"hr",
|
|
75
|
+
"html",
|
|
76
|
+
"i",
|
|
77
|
+
"iframe",
|
|
78
|
+
"img",
|
|
79
|
+
"input",
|
|
80
|
+
"ins",
|
|
81
|
+
"kbd",
|
|
82
|
+
"keygen",
|
|
83
|
+
"label",
|
|
84
|
+
"legend",
|
|
85
|
+
"li",
|
|
86
|
+
"link",
|
|
87
|
+
"main",
|
|
88
|
+
"map",
|
|
89
|
+
"mark",
|
|
90
|
+
"menu",
|
|
91
|
+
"menuitem",
|
|
92
|
+
"meter",
|
|
93
|
+
"nav",
|
|
94
|
+
"noscript",
|
|
95
|
+
"object",
|
|
96
|
+
"ol",
|
|
97
|
+
"optgroup",
|
|
98
|
+
"option",
|
|
99
|
+
"output",
|
|
100
|
+
"p",
|
|
101
|
+
"param",
|
|
102
|
+
"pre",
|
|
103
|
+
"progress",
|
|
104
|
+
"q",
|
|
105
|
+
"rb",
|
|
106
|
+
"rp",
|
|
107
|
+
"rt",
|
|
108
|
+
"rtc",
|
|
109
|
+
"ruby",
|
|
110
|
+
"s",
|
|
111
|
+
"samp",
|
|
112
|
+
"script",
|
|
113
|
+
"section",
|
|
114
|
+
"select",
|
|
115
|
+
"small",
|
|
116
|
+
"source",
|
|
117
|
+
"span",
|
|
118
|
+
"strong",
|
|
119
|
+
"style",
|
|
120
|
+
"sub",
|
|
121
|
+
"summary",
|
|
122
|
+
"sup",
|
|
123
|
+
"table",
|
|
124
|
+
"tbody",
|
|
125
|
+
"td",
|
|
126
|
+
"template",
|
|
127
|
+
"textarea",
|
|
128
|
+
"tfoot",
|
|
129
|
+
"th",
|
|
130
|
+
"thead",
|
|
131
|
+
"time",
|
|
132
|
+
"title",
|
|
133
|
+
"tr",
|
|
134
|
+
"track",
|
|
135
|
+
"u",
|
|
136
|
+
"ul",
|
|
137
|
+
"var",
|
|
138
|
+
"video",
|
|
139
|
+
"wbr"
|
|
120
140
|
];
|
|
121
|
-
|
|
122
141
|
export { DEFAULT_IGNORED_ELEMENTS, KNOWN_INCOMPATIBLE_PLUGINS };
|
|
123
|
-
|
|
142
|
+
|
|
143
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../src/babel-plugin/constants.ts"],"sourcesContent":["/**\n * MIT License\n *\n * Copyright (c) 2020 Engineering at FullStory\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n\nexport const KNOWN_INCOMPATIBLE_PLUGINS = [\n // This module might be causing an issue preventing clicks. For safety, we won't run on this module.\n 'react-native-testfairy',\n // This module checks for unexpected property keys and throws an exception.\n '@react-navigation',\n];\n\nexport const DEFAULT_IGNORED_ELEMENTS = [\n 'a',\n 'abbr',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'base',\n 'bdi',\n 'bdo',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'keygen',\n 'label',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'map',\n 'mark',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'param',\n 'pre',\n 'progress',\n 'q',\n 'rb',\n 'rp',\n 'rt',\n 'rtc',\n 'ruby',\n 's',\n 'samp',\n 'script',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'title',\n 'tr',\n 'track',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n];\n"],"
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../../../src/babel-plugin/constants.ts"],"sourcesContent":["/**\n * MIT License\n *\n * Copyright (c) 2020 Engineering at FullStory\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n\nexport const KNOWN_INCOMPATIBLE_PLUGINS = [\n // This module might be causing an issue preventing clicks. For safety, we won't run on this module.\n 'react-native-testfairy',\n // This module checks for unexpected property keys and throws an exception.\n '@react-navigation',\n];\n\nexport const DEFAULT_IGNORED_ELEMENTS = [\n 'a',\n 'abbr',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'base',\n 'bdi',\n 'bdo',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'keygen',\n 'label',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'map',\n 'mark',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'param',\n 'pre',\n 'progress',\n 'q',\n 'rb',\n 'rp',\n 'rt',\n 'rtc',\n 'ruby',\n 's',\n 'samp',\n 'script',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'title',\n 'tr',\n 'track',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,6BAA6B,CAExC,0BAEA,mBACF;AAEA,MAAa,2BAA2B;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|