@sentry/bundler-plugins 11.10.0 → 11.12.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/build-plugin-manager.js +184 -33
- package/build/cjs/core/build-plugin-manager.js.map +1 -1
- package/build/cjs/core/debug-id-upload.js +63 -54
- package/build/cjs/core/debug-id-upload.js.map +1 -1
- package/build/cjs/core/index.js +2 -0
- package/build/cjs/core/index.js.map +1 -1
- package/build/cjs/core/options-mapping.js +6 -0
- package/build/cjs/core/options-mapping.js.map +1 -1
- package/build/cjs/core/sentry/telemetry.js +4 -0
- package/build/cjs/core/sentry/telemetry.js.map +1 -1
- package/build/cjs/core/sourcemap-settings.js +63 -0
- package/build/cjs/core/sourcemap-settings.js.map +1 -0
- package/build/cjs/core/upload-filter.js +57 -0
- package/build/cjs/core/upload-filter.js.map +1 -0
- package/build/cjs/core/version.js +1 -1
- package/build/cjs/core/version.js.map +1 -1
- package/build/cjs/esbuild/index.js +3 -2
- package/build/cjs/esbuild/index.js.map +1 -1
- package/build/cjs/rollup/index.js +49 -9
- package/build/cjs/rollup/index.js.map +1 -1
- package/build/cjs/rollup/source-map-handling.js +202 -0
- package/build/cjs/rollup/source-map-handling.js.map +1 -0
- package/build/cjs/vite/index.js +4 -18
- package/build/cjs/vite/index.js.map +1 -1
- package/build/cjs/vite/source-map-hooks.js +93 -0
- package/build/cjs/vite/source-map-hooks.js.map +1 -0
- package/build/cjs/webpack/index.js +113 -1
- package/build/cjs/webpack/index.js.map +1 -1
- package/build/esm/core/build-plugin-manager.js +185 -34
- package/build/esm/core/build-plugin-manager.js.map +1 -1
- package/build/esm/core/debug-id-upload.js +62 -56
- package/build/esm/core/debug-id-upload.js.map +1 -1
- package/build/esm/core/index.js +1 -0
- package/build/esm/core/index.js.map +1 -1
- package/build/esm/core/options-mapping.js +6 -0
- package/build/esm/core/options-mapping.js.map +1 -1
- package/build/esm/core/sentry/telemetry.js +4 -0
- package/build/esm/core/sentry/telemetry.js.map +1 -1
- package/build/esm/core/sourcemap-settings.js +61 -0
- package/build/esm/core/sourcemap-settings.js.map +1 -0
- package/build/esm/core/upload-filter.js +41 -0
- package/build/esm/core/upload-filter.js.map +1 -0
- package/build/esm/core/version.js +1 -1
- package/build/esm/core/version.js.map +1 -1
- package/build/esm/esbuild/index.js +3 -2
- package/build/esm/esbuild/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/rollup/index.js +49 -10
- package/build/esm/rollup/index.js.map +1 -1
- package/build/esm/rollup/source-map-handling.js +183 -0
- package/build/esm/rollup/source-map-handling.js.map +1 -0
- package/build/esm/vite/index.js +5 -19
- package/build/esm/vite/index.js.map +1 -1
- package/build/esm/vite/source-map-hooks.js +77 -0
- package/build/esm/vite/source-map-hooks.js.map +1 -0
- package/build/esm/webpack/index.js +114 -2
- package/build/esm/webpack/index.js.map +1 -1
- package/build/types/core/build-plugin-manager.d.ts +69 -1
- package/build/types/core/build-plugin-manager.d.ts.map +1 -1
- package/build/types/core/debug-id-upload.d.ts +38 -2
- package/build/types/core/debug-id-upload.d.ts.map +1 -1
- package/build/types/core/index.d.ts +4 -0
- package/build/types/core/index.d.ts.map +1 -1
- package/build/types/core/options-mapping.d.ts +1 -0
- package/build/types/core/options-mapping.d.ts.map +1 -1
- package/build/types/core/sentry/telemetry.d.ts.map +1 -1
- package/build/types/core/sourcemap-settings.d.ts +28 -0
- package/build/types/core/sourcemap-settings.d.ts.map +1 -0
- package/build/types/core/types.d.ts +18 -0
- 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/version.d.ts +1 -1
- package/build/types/esbuild/index.d.ts.map +1 -1
- package/build/types/rollup/index.d.ts +106 -6
- 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 +1 -5
- 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.map +1 -1
- package/package.json +43 -41
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { sourceMapKindFromRollupSetting, getOutputMatch } from '../rollup/source-map-handling.js';
|
|
3
|
+
|
|
4
|
+
const NO_CHANGE = { enableHidden: false, deleteAfterUpload: false };
|
|
5
|
+
function getOutputs(root, build) {
|
|
6
|
+
const configured = build.rolldownOptions?.output ?? build.rollupOptions?.output;
|
|
7
|
+
const outputs = Array.isArray(configured) ? configured : [configured ?? {}];
|
|
8
|
+
return outputs.map((output) => {
|
|
9
|
+
const sourcemap = output.sourcemap ?? build.sourcemap;
|
|
10
|
+
return {
|
|
11
|
+
destination: output.dir === void 0 ? path.resolve(root, build.outDir ?? "dist") : path.resolve(output.dir),
|
|
12
|
+
match: getOutputMatch({ ...output, sourcemap }),
|
|
13
|
+
sourcemap,
|
|
14
|
+
ownSetting: output.sourcemap !== void 0
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function createViteSourceMapHooks(sentryBuildPluginManager, sourceMapHandling) {
|
|
19
|
+
const decisions = /* @__PURE__ */ new Map();
|
|
20
|
+
return {
|
|
21
|
+
config: (userConfig, env) => {
|
|
22
|
+
if (env.command !== "build") {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
decisions.clear();
|
|
26
|
+
const kind = sourceMapKindFromRollupSetting(userConfig.build?.sourcemap);
|
|
27
|
+
const decision = sentryBuildPluginManager.sourceMaps.decide(kind, { log: false });
|
|
28
|
+
decisions.set("*", { kind, decision });
|
|
29
|
+
const result = decision.enableHidden ? { build: { sourcemap: "hidden" } } : {};
|
|
30
|
+
for (const [name, environment] of Object.entries(userConfig.environments ?? {})) {
|
|
31
|
+
const setting = environment?.build?.sourcemap;
|
|
32
|
+
if (setting === void 0) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const environmentKind = sourceMapKindFromRollupSetting(setting);
|
|
36
|
+
const environmentDecision = sentryBuildPluginManager.sourceMaps.decide(environmentKind, { log: false });
|
|
37
|
+
decisions.set(name, { kind: environmentKind, decision: environmentDecision });
|
|
38
|
+
if (environmentDecision.enableHidden) {
|
|
39
|
+
result.environments = { ...result.environments, [name]: { build: { sourcemap: "hidden" } } };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
},
|
|
44
|
+
configResolved: (config) => {
|
|
45
|
+
const environments = config.environments ?? { client: { build: config.build } };
|
|
46
|
+
const { uploadPossible } = sentryBuildPluginManager.sourceMaps;
|
|
47
|
+
const deleteOption = sentryBuildPluginManager.normalizedOptions.sourcemaps?.deleteSourcemapsAfterUpload;
|
|
48
|
+
for (const [name, environment] of Object.entries(environments)) {
|
|
49
|
+
const { kind, decision } = decisions.get(name) ?? decisions.get("*") ?? { kind: "unset", decision: NO_CHANGE };
|
|
50
|
+
for (const output of getOutputs(config.root, environment.build)) {
|
|
51
|
+
if (output.ownSetting) {
|
|
52
|
+
sourceMapHandling.setDecision(output.destination, {
|
|
53
|
+
match: output.match,
|
|
54
|
+
kind: sourceMapKindFromRollupSetting(output.sourcemap),
|
|
55
|
+
decision: {
|
|
56
|
+
enableHidden: false,
|
|
57
|
+
deleteAfterUpload: uploadPossible && deleteOption === true && output.sourcemap === "hidden"
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (decision.deleteAfterUpload && output.sourcemap !== "hidden") {
|
|
63
|
+
sentryBuildPluginManager.logger.debug(
|
|
64
|
+
`Source maps of the "${name}" environment are set to ${JSON.stringify(output.sourcemap)}. Not removing them after upload.`
|
|
65
|
+
);
|
|
66
|
+
sourceMapHandling.setDecision(output.destination, { match: output.match, kind, decision: NO_CHANGE });
|
|
67
|
+
} else {
|
|
68
|
+
sourceMapHandling.setDecision(output.destination, { match: output.match, kind, decision });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { createViteSourceMapHooks };
|
|
77
|
+
//# sourceMappingURL=source-map-hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-map-hooks.js","sources":["../../../src/vite/source-map-hooks.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { SentryBuildPluginManager, SourceMapDecision, SourceMapKind } 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};\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, { log: false });\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 const { uploadPossible } = sentryBuildPluginManager.sourceMaps;\n const deleteOption = sentryBuildPluginManager.normalizedOptions.sourcemaps?.deleteSourcemapsAfterUpload;\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\n for (const output of getOutputs(config.root, environment.build)) {\n // The plugin never changes an output's own setting, so the user enabled\n // these maps: only hidden ones the user asked to delete are removed.\n if (output.ownSetting) {\n sourceMapHandling.setDecision(output.destination, {\n match: output.match,\n kind: sourceMapKindFromRollupSetting(output.sourcemap),\n decision: {\n enableHidden: false,\n deleteAfterUpload: uploadPossible && deleteOption === true && output.sourcemap === 'hidden',\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}\n"],"names":[],"mappings":";;;AA+BA,MAAM,SAAA,GAA+B,EAAE,YAAA,EAAc,KAAA,EAAO,mBAAmB,KAAA,EAAM;AAgBrF,SAAS,UAAA,CAAW,MAAc,KAAA,EAA8C;AAC9E,EAAA,MAAM,UAAA,GAAa,KAAA,CAAM,eAAA,EAAiB,MAAA,IAAU,MAAM,aAAA,EAAe,MAAA;AACzE,EAAA,MAAM,OAAA,GAAU,MAAM,OAAA,CAAQ,UAAU,IAAI,UAAA,GAAa,CAAC,UAAA,IAAc,EAAE,CAAA;AAE1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G,QAAA,KAAA,MAAW,UAAU,UAAA,CAAW,MAAA,CAAO,IAAA,EAAM,WAAA,CAAY,KAAK,CAAA,EAAG;AAG/D,UAAA,IAAI,OAAO,UAAA,EAAY;AACrB,YAAA,iBAAA,CAAkB,WAAA,CAAY,OAAO,WAAA,EAAa;AAAA,cAChD,OAAO,MAAA,CAAO,KAAA;AAAA,cACd,IAAA,EAAM,8BAAA,CAA+B,MAAA,CAAO,SAAS,CAAA;AAAA,cACrD,QAAA,EAAU;AAAA,gBACR,YAAA,EAAc,KAAA;AAAA,gBACd,iBAAA,EAAmB,cAAA,IAAkB,YAAA,KAAiB,IAAA,IAAQ,OAAO,SAAA,KAAc;AAAA;AACrF,aACD,CAAA;AACD,YAAA;AAAA,UACF;AAGA,UAAA,IAAI,QAAA,CAAS,iBAAA,IAAqB,MAAA,CAAO,SAAA,KAAc,QAAA,EAAU;AAC/D,YAAA,wBAAA,CAAyB,MAAA,CAAO,KAAA;AAAA,cAC9B,uBAAuB,IAAI,CAAA,yBAAA,EAA4B,KAAK,SAAA,CAAU,MAAA,CAAO,SAAS,CAAC,CAAA,iCAAA;AAAA,aACzF;AACA,YAAA,iBAAA,CAAkB,WAAA,CAAY,MAAA,CAAO,WAAA,EAAa,EAAE,KAAA,EAAO,OAAO,KAAA,EAAO,IAAA,EAAM,QAAA,EAAU,SAAA,EAAW,CAAA;AAAA,UACtG,CAAA,MAAO;AACL,YAAA,iBAAA,CAAkB,WAAA,CAAY,OAAO,WAAA,EAAa,EAAE,OAAO,MAAA,CAAO,KAAA,EAAO,IAAA,EAAM,QAAA,EAAU,CAAA;AAAA,UAC3F;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,GACF;AACF;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isJsFile, getDebugIdSnippet } from '../core/index.js';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
@@ -18,6 +18,28 @@ try {
|
|
|
18
18
|
COMPONENT_ANNOTATION_LOADER = path.resolve(dirname, "component-annotation-transform.js");
|
|
19
19
|
}
|
|
20
20
|
const WEBPACK_JAVASCRIPT_ASSET_REGEX = /\.(?:js|ts|jsx|tsx|mjs|cjs|mts|cts)(?:\?[^?]*)?(?:#[^#]*)?$/;
|
|
21
|
+
function sourceMapKindFromDevtool(compiler) {
|
|
22
|
+
const devtool = compiler.options.devtool;
|
|
23
|
+
if (devtool === void 0) {
|
|
24
|
+
return "unset";
|
|
25
|
+
}
|
|
26
|
+
if (devtool === false) {
|
|
27
|
+
const hasSourceMapPlugin = compiler.options.plugins?.some(
|
|
28
|
+
(plugin) => plugin?.constructor?.name === "SourceMapDevToolPlugin"
|
|
29
|
+
);
|
|
30
|
+
return hasSourceMapPlugin ? void 0 : "off";
|
|
31
|
+
}
|
|
32
|
+
if (!devtool.includes("source-map")) {
|
|
33
|
+
return "off";
|
|
34
|
+
}
|
|
35
|
+
if (devtool.includes("inline") || devtool.includes("eval")) {
|
|
36
|
+
return "inline";
|
|
37
|
+
}
|
|
38
|
+
if (devtool.includes("hidden")) {
|
|
39
|
+
return "hidden";
|
|
40
|
+
}
|
|
41
|
+
return "visible";
|
|
42
|
+
}
|
|
21
43
|
function getWebpackMajorVersion() {
|
|
22
44
|
try {
|
|
23
45
|
const webpack = _req("webpack");
|
|
@@ -46,6 +68,44 @@ function addDebugIdsToAssets(compilation, RawSource) {
|
|
|
46
68
|
}
|
|
47
69
|
}
|
|
48
70
|
}
|
|
71
|
+
function deleteSourceMapAssets(compilation, sourceMapName) {
|
|
72
|
+
for (const candidate of compilation.getAssets()) {
|
|
73
|
+
if (candidate.name === sourceMapName || candidate.name.startsWith(`${sourceMapName}.`)) {
|
|
74
|
+
compilation.deleteAsset(candidate.name);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async function stageSourceMaps(compilation, staging, logger, pluginEnabledMaps) {
|
|
79
|
+
const outputPath = compilation.outputOptions.path ?? path.resolve();
|
|
80
|
+
for (const asset of compilation.getAssets()) {
|
|
81
|
+
const relatedSourceMap = asset.info.related?.sourceMap;
|
|
82
|
+
const sourceMapName = typeof relatedSourceMap === "string" ? relatedSourceMap : `${asset.name}.map`;
|
|
83
|
+
const sourceMapAsset = compilation.getAsset(sourceMapName);
|
|
84
|
+
if (!sourceMapAsset) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (!isJsFile(asset.name)) {
|
|
88
|
+
if (pluginEnabledMaps) {
|
|
89
|
+
deleteSourceMapAssets(compilation, sourceMapName);
|
|
90
|
+
}
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const result = await staging.stage({
|
|
94
|
+
code: asset.source.source().toString(),
|
|
95
|
+
mapSource: sourceMapAsset.source.source().toString(),
|
|
96
|
+
mapDir: path.join(outputPath, path.dirname(sourceMapName)),
|
|
97
|
+
chunkPath: path.join(outputPath, asset.name)
|
|
98
|
+
});
|
|
99
|
+
if (result === "skipped" || result === "failed") {
|
|
100
|
+
logger.warn(
|
|
101
|
+
pluginEnabledMaps ? `Could not prepare ${asset.name} for upload, so it is not uploaded and its source map ${sourceMapName} was removed from the build output.` : `Could not prepare ${asset.name} for upload, so its source map ${sourceMapName} stays in the build output.`
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
if (result === "staged" || pluginEnabledMaps) {
|
|
105
|
+
deleteSourceMapAssets(compilation, sourceMapName);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
49
109
|
function createSentryWebpackPlugin(userOptions = {}) {
|
|
50
110
|
const sentryBuildPluginManager = createSentryBuildPluginManager(userOptions, {
|
|
51
111
|
loggerPrefix: userOptions._metaOptions?.loggerPrefixOverride ?? "[sentry-webpack-plugin]",
|
|
@@ -94,6 +154,17 @@ function createSentryWebpackPlugin(userOptions = {}) {
|
|
|
94
154
|
{ logger }
|
|
95
155
|
) : void 0;
|
|
96
156
|
const transformReplace = Object.keys(replacementValues).length > 0;
|
|
157
|
+
function decideSourceMaps(compiler) {
|
|
158
|
+
const kind = compiler.options.mode === "development" ? void 0 : sourceMapKindFromDevtool(compiler);
|
|
159
|
+
if (kind === void 0) {
|
|
160
|
+
return { decision: { enableHidden: false, deleteAfterUpload: false } };
|
|
161
|
+
}
|
|
162
|
+
const decision = sentryBuildPluginManager.sourceMaps.decide(kind);
|
|
163
|
+
if (decision.enableHidden) {
|
|
164
|
+
compiler.options.devtool = kind === "visible" ? `hidden-${compiler.options.devtool}` : "hidden-source-map";
|
|
165
|
+
}
|
|
166
|
+
return { kind, decision };
|
|
167
|
+
}
|
|
97
168
|
function addCodeInjection(compiler) {
|
|
98
169
|
if (releaseInjectionCode.isEmpty() && chunkInjectionCode.isEmpty() && !sourcemapsEnabled) {
|
|
99
170
|
return;
|
|
@@ -152,6 +223,35 @@ ${codeToInject.code()}` : codeToInject.code();
|
|
|
152
223
|
void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal().catch(() => {
|
|
153
224
|
});
|
|
154
225
|
const { DefinePlugin } = compiler.webpack ?? {};
|
|
226
|
+
const { kind: sourceMapKind, decision: sourceMapDecision } = decideSourceMaps(compiler);
|
|
227
|
+
const pendingStagings = /* @__PURE__ */ new Map();
|
|
228
|
+
if (sourceMapDecision.deleteAfterUpload) {
|
|
229
|
+
const stage = (compiler.webpack?.Compilation?.PROCESS_ASSETS_STAGE_REPORT ?? 5e3) + 1;
|
|
230
|
+
compiler.hooks.thisCompilation.tap("sentry-webpack-plugin", (compilation) => {
|
|
231
|
+
compilation.hooks.processAssets.tapPromise({ name: "sentry-webpack-plugin", stage }, async () => {
|
|
232
|
+
const staging = await sentryBuildPluginManager.createUploadStaging();
|
|
233
|
+
pendingStagings.set(compilation, staging);
|
|
234
|
+
await stageSourceMaps(compilation, staging, logger, sourceMapKind === "unset");
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
const emittedCompilations = /* @__PURE__ */ new Set();
|
|
238
|
+
compiler.hooks.emit.tap("sentry-webpack-plugin", (compilation) => {
|
|
239
|
+
emittedCompilations.add(compilation);
|
|
240
|
+
});
|
|
241
|
+
const settlePendingStagings = () => {
|
|
242
|
+
for (const [compilation, staging] of pendingStagings) {
|
|
243
|
+
if (emittedCompilations.has(compilation)) {
|
|
244
|
+
void staging.keep("The source map upload did not run.");
|
|
245
|
+
} else {
|
|
246
|
+
void staging.discard();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
pendingStagings.clear();
|
|
250
|
+
emittedCompilations.clear();
|
|
251
|
+
};
|
|
252
|
+
compiler.hooks.done.tap("sentry-webpack-plugin", settlePendingStagings);
|
|
253
|
+
compiler.hooks.failed?.tap("sentry-webpack-plugin", settlePendingStagings);
|
|
254
|
+
}
|
|
155
255
|
addCodeInjection(compiler);
|
|
156
256
|
if (sourcemapsEnabled && options.sourcemaps?.disable === "disable-upload") {
|
|
157
257
|
const RawSource = compiler.webpack?.sources?.RawSource;
|
|
@@ -194,14 +294,26 @@ ${codeToInject.code()}` : codeToInject.code();
|
|
|
194
294
|
(compilation, callback) => {
|
|
195
295
|
const freeGlobalDependencyOnBuildArtifacts = createDependencyOnBuildArtifacts();
|
|
196
296
|
const upload = createDebugIdUploadFunction({ sentryBuildPluginManager });
|
|
297
|
+
const staging = pendingStagings.get(compilation);
|
|
298
|
+
pendingStagings.delete(compilation);
|
|
299
|
+
let stagingHandedOver = false;
|
|
197
300
|
const run = async () => {
|
|
198
301
|
try {
|
|
199
302
|
await sentryBuildPluginManager.createRelease();
|
|
200
303
|
if (sourcemapsEnabled && options.sourcemaps?.disable !== "disable-upload") {
|
|
201
304
|
const outputPath = compilation.outputOptions.path ?? path.resolve();
|
|
202
305
|
const buildArtifacts = Object.keys(compilation.assets).map((asset) => path.join(outputPath, asset));
|
|
203
|
-
|
|
306
|
+
stagingHandedOver = true;
|
|
307
|
+
await upload(buildArtifacts, { staging });
|
|
308
|
+
} else {
|
|
309
|
+
stagingHandedOver = true;
|
|
310
|
+
await staging?.discard();
|
|
311
|
+
}
|
|
312
|
+
} catch (e) {
|
|
313
|
+
if (!stagingHandedOver) {
|
|
314
|
+
await staging?.keep("The source map upload did not run.");
|
|
204
315
|
}
|
|
316
|
+
throw e;
|
|
205
317
|
} finally {
|
|
206
318
|
freeGlobalDependencyOnBuildArtifacts();
|
|
207
319
|
await sentryBuildPluginManager.deleteArtifacts();
|
|
@@ -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":[],"mappings":";;;;;;;;;;;AAqBA,MAAM,IAAA,GAAO,aAAA,CAAc,MA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,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","sources":["../../../src/webpack/index.ts"],"sourcesContent":["/* oxlint-disable max-lines */\n\nimport type { Options, SourceMapDecision, SourceMapKind, UploadStaging } 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 * 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 turned on (`pluginEnabledMaps`) never reaches the output, whether or not its\n * asset is uploaded. That covers CSS maps, which `devtool` turns on along with the JS ones. A map\n * 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: 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 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 { kind: sourceMapKind, decision: sourceMapDecision } = decideSourceMaps(compiler);\n const pendingStagings = new Map<WebpackCompilation, UploadStaging>();\n\n if (sourceMapDecision.deleteAfterUpload) {\n // After `RealContentHashPlugin` rewrote the hash placeholders, so the staged\n // JS equals the emitted file and `[contenthash]` names are final.\n const stage = (compiler.webpack?.Compilation?.PROCESS_ASSETS_STAGE_REPORT ?? 5000) + 1;\n\n compiler.hooks.thisCompilation.tap('sentry-webpack-plugin', compilation => {\n compilation.hooks.processAssets.tapPromise({ name: 'sentry-webpack-plugin', stage }, async () => {\n const staging = await sentryBuildPluginManager.createUploadStaging();\n pendingStagings.set(compilation, staging);\n await stageSourceMaps(compilation, staging, logger, sourceMapKind === 'unset');\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?: 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":[],"mappings":";;;;;;;;;;;AAqBA,MAAM,IAAA,GAAO,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAA;AAO1C,IAAI,2BAAA;AACJ,IAAI;AACF,EAAA,2BAAA,GAA8B,IAAA,CAAK,QAAQ,wCAAwC,CAAA;AACrF,CAAA,CAAA,MAAQ;AAIN,EAAA,MAAM,UAAU,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAC,CAAA;AAE3D,EAAA,2BAAA,GAA8B,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAS,mCAAmC,CAAA;AACzF;AAmBA,MAAM,8BAAA,GAAiC,6DAAA;AAqFvC,SAAS,yBAAyB,QAAA,EAAsD;AACtF,EAAA,MAAM,OAAA,GAAU,SAAS,OAAA,CAAQ,OAAA;AAEjC,EAAA,IAAI,YAAY,MAAA,EAAW;AACzB,IAAA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|
|
3
3
|
import type { Options, SentrySDKBuildFlags } from './types';
|
|
4
|
+
import type { SourceMapDecision, SourceMapKind } from './sourcemap-settings';
|
|
5
|
+
import type { UploadFilter } from './upload-filter';
|
|
4
6
|
/** @internal Exported for testing only. */
|
|
5
7
|
export declare function _resetDeployedReleasesForTesting(): void;
|
|
8
|
+
/**
|
|
9
|
+
* A temporary folder that build artifacts are written into straight from the bundler's output,
|
|
10
|
+
* before the bundler writes them to disk. The upload reads from this folder, so the bundler can
|
|
11
|
+
* drop the source map assets from its own output.
|
|
12
|
+
*/
|
|
13
|
+
export type UploadStaging = {
|
|
14
|
+
readonly dir: string;
|
|
15
|
+
/** Number of artifacts written so far. */
|
|
16
|
+
readonly count: number;
|
|
17
|
+
/**
|
|
18
|
+
* Absolute paths of the chunks staged so far (`mapDir` joined with the file name). The upload
|
|
19
|
+
* does not prepare these again from disk, where a stale map of an earlier build could sit
|
|
20
|
+
* next to them.
|
|
21
|
+
*/
|
|
22
|
+
readonly stagedChunkPaths: ReadonlySet<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Stamps the debug ID into the chunk and its source map and writes both into the folder.
|
|
25
|
+
*
|
|
26
|
+
* `mapSource` is `undefined` when the chunk has no separate source map. `mapDir` is the directory
|
|
27
|
+
* the map would be written to and is passed to the `rewriteSources` hook. `chunkPath` is where
|
|
28
|
+
* the chunk is written; `sourcemaps.assets` and `sourcemaps.ignore` are matched against it.
|
|
29
|
+
*/
|
|
30
|
+
stage(input: {
|
|
31
|
+
code: string;
|
|
32
|
+
mapSource: string | undefined;
|
|
33
|
+
mapDir: string;
|
|
34
|
+
chunkPath: string;
|
|
35
|
+
}): Promise<'staged' | 'skipped' | 'excluded' | 'failed'>;
|
|
36
|
+
/** Removes the folder. Call this when no upload will consume it. */
|
|
37
|
+
discard(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Keeps the folder and logs how to upload it by hand. Call this when the bundler already
|
|
40
|
+
* dropped the staged source maps from its output but the upload did not run. Removes the
|
|
41
|
+
* folder instead when nothing was staged.
|
|
42
|
+
*/
|
|
43
|
+
keep(reason: string): Promise<void>;
|
|
44
|
+
};
|
|
6
45
|
export type SentryBuildPluginManager = {
|
|
7
46
|
/**
|
|
8
47
|
* A logger instance that takes the options passed to the build plugin manager into account. (for silencing and log level etc.)
|
|
@@ -53,7 +92,36 @@ export type SentryBuildPluginManager = {
|
|
|
53
92
|
*/
|
|
54
93
|
uploadSourcemaps(buildArtifactPaths: string[], opts?: {
|
|
55
94
|
prepareArtifacts?: boolean;
|
|
56
|
-
|
|
95
|
+
staging?: UploadStaging;
|
|
96
|
+
}): Promise<{
|
|
97
|
+
uploaded: boolean;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Creates a staging folder that `uploadSourcemaps` uploads together with the build artifacts
|
|
101
|
+
* found on disk, in both the prepared and the direct (`prepareArtifacts: false`) mode.
|
|
102
|
+
*/
|
|
103
|
+
createUploadStaging(): Promise<UploadStaging>;
|
|
104
|
+
sourceMaps: {
|
|
105
|
+
/**
|
|
106
|
+
* Whether a source map upload can run with the current options and environment.
|
|
107
|
+
*/
|
|
108
|
+
uploadPossible: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Decides how the plugin treats the user's source map setting (see `decideSourceMapHandling`).
|
|
111
|
+
* Logs the decision's message once per message, unless `log` is `false`.
|
|
112
|
+
*/
|
|
113
|
+
decide(kind: SourceMapKind, options?: {
|
|
114
|
+
log?: boolean;
|
|
115
|
+
}): SourceMapDecision;
|
|
116
|
+
/** Logs the decision's message, once per message. */
|
|
117
|
+
logDecision(decision: SourceMapDecision): void;
|
|
118
|
+
/**
|
|
119
|
+
* Whether a file of the build output is uploaded, for files that are not on disk yet. Mirrors
|
|
120
|
+
* the glob of the upload from disk: it must match `sourcemaps.assets` (all files when unset)
|
|
121
|
+
* and none of `sourcemaps.ignore`.
|
|
122
|
+
*/
|
|
123
|
+
shouldUpload: UploadFilter;
|
|
124
|
+
};
|
|
57
125
|
/**
|
|
58
126
|
* Will delete artifacts based on the passed `sourcemaps.filesToDeleteAfterUpload` option.
|
|
59
127
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-plugin-manager.d.ts","sourceRoot":"","sources":["../../../src/core/build-plugin-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-plugin-manager.d.ts","sourceRoot":"","sources":["../../../src/core/build-plugin-manager.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAS5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AASpD,2CAA2C;AAC3C,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/C;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC,CAAC;IAC1D,oEAAoE;IACpE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB;;;;OAIG;IACH,IAAI,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Ae,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC,gCAAgC,EAAE,MAAM,MAAM,IAAI,CAAC;CACpD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,OAAO,EACpB,wBAAwB,EAAE;IACxB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB,GACA,wBAAwB,CAyyB1B"}
|
|
@@ -1,11 +1,47 @@
|
|
|
1
|
-
import type { SentryBuildPluginManager } from './build-plugin-manager';
|
|
1
|
+
import type { SentryBuildPluginManager, UploadStaging } from './build-plugin-manager';
|
|
2
2
|
import type { Logger } from './logger';
|
|
3
3
|
import type { ResolveSourceMapHook, RewriteSourcesHook } from './types';
|
|
4
4
|
interface DebugIdUploadPluginOptions {
|
|
5
5
|
sentryBuildPluginManager: SentryBuildPluginManager;
|
|
6
6
|
}
|
|
7
|
-
export declare function createDebugIdUploadFunction({ sentryBuildPluginManager }: DebugIdUploadPluginOptions): (buildArtifactPaths: string[]
|
|
7
|
+
export declare function createDebugIdUploadFunction({ sentryBuildPluginManager }: DebugIdUploadPluginOptions): (buildArtifactPaths: string[], opts?: {
|
|
8
|
+
staging?: UploadStaging;
|
|
9
|
+
}) => Promise<{
|
|
10
|
+
uploaded: boolean;
|
|
11
|
+
}>;
|
|
8
12
|
export declare function prepareBundleForDebugIdUpload(bundleFilePath: string, uploadFolder: string, chunkIndex: number, logger: Logger, rewriteSourcesHook: RewriteSourcesHook, resolveSourceMapHook: ResolveSourceMapHook | undefined): Promise<void>;
|
|
13
|
+
export type PreparedUploadArtifact = {
|
|
14
|
+
debugId: string;
|
|
15
|
+
bundleSource: string;
|
|
16
|
+
/** `undefined` when the bundle has no separate source map (i.e. the map is inlined). */
|
|
17
|
+
sourceMapSource: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
export type PrepareArtifactResult = {
|
|
20
|
+
ok: true;
|
|
21
|
+
artifact: PreparedUploadArtifact;
|
|
22
|
+
} | {
|
|
23
|
+
ok: false;
|
|
24
|
+
reason: 'no-debug-id' | 'no-source-map' | 'invalid-source-map';
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Prepares a bundle and its source map for the debug ID upload: stamps the debug ID into both
|
|
28
|
+
* and runs the `rewriteSources` hook over the map's `sources`.
|
|
29
|
+
*
|
|
30
|
+
* Pass `mapSource: undefined` when the bundle has no separate source map. A bundle with an
|
|
31
|
+
* inlined map is still prepared; a bundle without any map is skipped because it cannot be
|
|
32
|
+
* symbolicated.
|
|
33
|
+
*/
|
|
34
|
+
export declare function prepareArtifactForUpload(input: {
|
|
35
|
+
code: string;
|
|
36
|
+
mapSource: string | undefined;
|
|
37
|
+
/** Directory the source map lives in, passed to the `rewriteSources` hook. */
|
|
38
|
+
mapDir: string;
|
|
39
|
+
rewriteSourcesHook: RewriteSourcesHook;
|
|
40
|
+
}): PrepareArtifactResult;
|
|
41
|
+
/**
|
|
42
|
+
* Writes a prepared artifact as `<uniqueUploadName>.js` (and `.js.map`) into the upload folder.
|
|
43
|
+
*/
|
|
44
|
+
export declare function writePreparedArtifact(uploadFolder: string, uniqueUploadName: string, artifact: PreparedUploadArtifact): Promise<void>;
|
|
9
45
|
export type StampedArtifacts = {
|
|
10
46
|
bundleSource: string;
|
|
11
47
|
/** `undefined` when the bundle has no separate source map (i.e. the map is inlined). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-id-upload.d.ts","sourceRoot":"","sources":["../../../src/core/debug-id-upload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debug-id-upload.d.ts","sourceRoot":"","sources":["../../../src/core/debug-id-upload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,M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EAAE,sBAAsB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAYf;AAwCD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC,CAAC;AAaF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAyBpH;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,CAChD,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,oBAAoB,GAAG,SAAS,GACrD,OAAO,CAAC,IAAI,CAAC,CA4Cf;AAYD;;;;GAIG;AACH,wBAAsB,gCAAgC,CACpD,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,oBAAoB,GAAG,SAAS,GACrD,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA2D7B;AAGD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMhE"}
|
|
@@ -40,5 +40,9 @@ export type { Logger } from './logger';
|
|
|
40
40
|
export type { Options, SentrySDKBuildFlags } from './types';
|
|
41
41
|
export { CodeInjection, replaceBooleanFlagsInCode, stringToUUID, generateReleaseInjectorCode, generateModuleMetadataInjectorCode, } from './utils';
|
|
42
42
|
export { createSentryBuildPluginManager } from './build-plugin-manager';
|
|
43
|
+
export type { SentryBuildPluginManager, UploadStaging } from './build-plugin-manager';
|
|
43
44
|
export { createDebugIdUploadFunction, addDebugIdToEmittedArtifacts, stampDebugId } from './debug-id-upload';
|
|
45
|
+
export { decideSourceMapHandling } from './sourcemap-settings';
|
|
46
|
+
export type { SourceMapDecision, SourceMapKind } from './sourcemap-settings';
|
|
47
|
+
export type { UploadFilter } from './upload-filter';
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AACxE,YAAY,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC7E,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -18,6 +18,7 @@ export type NormalizedOptions = {
|
|
|
18
18
|
rewriteSources?: RewriteSourcesHook;
|
|
19
19
|
resolveSourceMap?: ResolveSourceMapHook;
|
|
20
20
|
filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;
|
|
21
|
+
deleteSourcemapsAfterUpload?: boolean;
|
|
21
22
|
} | undefined;
|
|
22
23
|
release: {
|
|
23
24
|
name: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options-mapping.d.ts","sourceRoot":"","sources":["../../../src/core/options-mapping.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EACV,OAAO,IAAI,WAAW,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAGjB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IACvC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC5C,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OA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