diff --git a/.yarn/cache/@jridgewell-trace-mapping-npm-0.3.31-1ae81d75ac-da0283270e.zip b/.yarn/cache/@jridgewell-trace-mapping-npm-0.3.31-1ae81d75ac-da0283270e.zip new file mode 100644 index 000000000..d61ababcd Binary files /dev/null and b/.yarn/cache/@jridgewell-trace-mapping-npm-0.3.31-1ae81d75ac-da0283270e.zip differ diff --git a/LICENSES-3rdparty.csv b/LICENSES-3rdparty.csv index 4c0ef827d..bf8d6bdf0 100644 --- a/LICENSES-3rdparty.csv +++ b/LICENSES-3rdparty.csv @@ -165,7 +165,7 @@ Component,Origin,Licence,Copyright @jridgewell/set-array,npm,MIT,Justin Ridgewell (https://www.npmjs.com/package/@jridgewell/set-array) @jridgewell/source-map,npm,MIT,Justin Ridgewell (https://www.npmjs.com/package/@jridgewell/source-map) @jridgewell/sourcemap-codec,npm,MIT,Justin Ridgewell (https://github.com/jridgewell/sourcemaps/tree/main/packages/sourcemap-codec) -@jridgewell/trace-mapping,npm,MIT,Justin Ridgewell (https://www.npmjs.com/package/@jridgewell/trace-mapping) +@jridgewell/trace-mapping,npm,MIT,Justin Ridgewell (https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping) @kwsites/file-exists,npm,MIT,Steve King (https://www.npmjs.com/package/@kwsites/file-exists) @kwsites/promise-deferred,npm,MIT,Steve King (https://www.npmjs.com/package/@kwsites/promise-deferred) @module-federation/error-codes,npm,MIT,zhanghang (https://www.npmjs.com/package/@module-federation/error-codes) diff --git a/packages/plugins/live-debugger/package.json b/packages/plugins/live-debugger/package.json index 89344efb0..b1946aebe 100644 --- a/packages/plugins/live-debugger/package.json +++ b/packages/plugins/live-debugger/package.json @@ -24,12 +24,14 @@ }, "dependencies": { "@dd/core": "workspace:*", + "@jridgewell/remapping": "2.3.5", "chalk": "2.3.1" }, "devDependencies": { "@babel/parser": "7.24.5", "@babel/traverse": "7.24.5", "@babel/types": "7.24.5", + "@jridgewell/trace-mapping": "0.3.31", "magic-string": "0.30.21", "typescript": "5.4.3" }, diff --git a/packages/plugins/live-debugger/src/index.test.ts b/packages/plugins/live-debugger/src/index.test.ts index 331427cc4..6c42934db 100644 --- a/packages/plugins/live-debugger/src/index.test.ts +++ b/packages/plugins/live-debugger/src/index.test.ts @@ -212,6 +212,119 @@ describe('getLiveDebuggerPlugin', () => { }); }); + describe('source-map composition', () => { + const LINES_SHIFTED = 4; + + const buildShiftedInputMap = (sourcePath: string, source: string): string => + JSON.stringify({ + version: 3, + sources: [sourcePath], + sourcesContent: [source], + names: [], + mappings: + ';'.repeat(LINES_SHIFTED) + + source + .split('\n') + .map((_, idx) => (idx === 0 ? 'AAAA' : 'AACA')) + .join(';'), + }); + + const makeBuildContext = ( + inputSourceMap?: string | null, + ): UnpluginBuildContext & UnpluginContext => ({ + ...mockBuildContext, + getNativeBuildContext: () => ({ + framework: 'rspack', + compiler: {} as never, + compilation: {} as never, + inputSourceMap, + }), + }); + + const callHandler = ( + ctx: UnpluginBuildContext & UnpluginContext, + code: string, + id: string, + ) => { + const pluginContext = getContextMock({ + buildRoot: '/', + getLogger: jest.fn(() => mockLog), + }); + const plugin = getLiveDebuggerPlugin( + makeOptions({ include: [], exclude: [] }), + pluginContext, + ); + const { handler } = getTransformHook(plugin); + const result = handler.call(ctx, code, id); + if (typeof result !== 'object' || result === null || !('code' in result)) { + throw new Error('Unexpected handler result'); + } + return result; + }; + + it('composes its delta map with the previous loader so positions resolve to original-source lines', async () => { + const original = 'function getDebuggerServicesStatus() { return 0; }'; + const id = '/src/use-debugger-services.hook.ts'; + const postLoader = `// banner\n// banner\n// banner\n// banner\n${original}`; + const inputMap = buildShiftedInputMap(id, original); + + const ctx = makeBuildContext(inputMap); + const result = callHandler(ctx, postLoader, id); + + expect(result.map).toBeDefined(); + + const lines = result.code.split('\n'); + const entryLineIndex = lines.findIndex((line) => line.includes('$dd_entry($dd_p')); + expect(entryLineIndex).toBeGreaterThan(-1); + const entryColumn = lines[entryLineIndex].indexOf('$dd_entry'); + + const { originalPositionFor, TraceMap } = await import('@jridgewell/trace-mapping'); + const traceMap = new TraceMap( + typeof result.map === 'string' ? result.map : JSON.parse(String(result.map)), + ); + const original_pos = originalPositionFor(traceMap, { + line: entryLineIndex + 1, + column: entryColumn, + }); + + expect(original_pos.line).toBe(1); + expect(original_pos.source).toBe(id); + }); + + it('returns the magic-string map verbatim when the previous loader did not provide one', async () => { + const id = '/src/utils.ts'; + const code = 'function f() { return 1; }'; + + // No inputSourceMap, no getNativeBuildContext at all. + const result = callHandler(mockBuildContext, code, id); + expect(result.map).toBeDefined(); + + const map = JSON.parse(String(result.map)); + expect(map.sources).toContain(id); + }); + + it('returns no map when the file has no instrumentable functions', () => { + const result = callHandler(mockBuildContext, 'const x = 42;', '/src/utils.ts'); + expect(result.map).toBeUndefined(); + }); + + it('falls back to the un-composed map and logs an error when composition throws', () => { + const id = '/src/utils.ts'; + const code = 'function f() { return 1; }'; + + const ctx = makeBuildContext('not a valid sourcemap, this should throw'); + const result = callHandler(ctx, code, id); + + expect(result.map).toBeDefined(); + expect(() => JSON.parse(String(result.map))).not.toThrow(); + + expect(mockLog.error).toHaveBeenCalledWith( + expect.stringContaining('Failed to compose source map'), + expect.objectContaining({ forward: true }), + ); + }); + }); + describe('error handling', () => { it('should return original code when transformCode throws', () => { jest.isolateModules(() => { diff --git a/packages/plugins/live-debugger/src/index.ts b/packages/plugins/live-debugger/src/index.ts index c88e5b9da..fd93e5f6b 100644 --- a/packages/plugins/live-debugger/src/index.ts +++ b/packages/plugins/live-debugger/src/index.ts @@ -4,6 +4,10 @@ import type { GetPlugins, GlobalContext, PluginOptions } from '@dd/core/types'; import { InjectPosition } from '@dd/core/types'; +import remapping from '@jridgewell/remapping'; +import type { SourceMapInput } from '@jridgewell/remapping'; +import type { SourceMap } from 'magic-string'; +import type { SourceMapCompact, UnpluginBuildContext } from 'unplugin'; import { CONFIG_KEY, PLUGIN_NAME } from './constants'; import { getRuntimeBootstrap } from './runtime-bootstrap'; @@ -103,9 +107,15 @@ export const getLiveDebuggerPlugin = ( transformedFileCount++; + const inputMap = getInputSourceMap(this); + const composedMap = + result.map && inputMap + ? composeWithInputMap(result.map, inputMap, id, log) + : result.map; + return { code: result.code, - map: result.map, + map: composedMap, }; } catch (e) { log.error(`Instrumentation Error in ${id}: ${e}`, { forward: true }); @@ -158,3 +168,31 @@ export const getPlugins: GetPlugins = ({ options, context }) => { return [getLiveDebuggerPlugin(validatedOptions, context)]; }; + +/** + * Return the source map produced by the previous loader, if any. + */ +function getInputSourceMap(ctx: UnpluginBuildContext): SourceMapInput | undefined { + const native = ctx.getNativeBuildContext?.(); + return (native as { inputSourceMap?: SourceMapInput })?.inputSourceMap; +} + +/** + * Compose a local source map with the previous loader's source map. The result maps instrumented + * output directly back to original source coordinates. + */ +function composeWithInputMap( + instrumentMap: SourceMap, + inputMap: SourceMapInput, + id: string, + log: ReturnType, +): SourceMapCompact | SourceMap { + try { + return remapping(instrumentMap as unknown as SourceMapInput, (_file, ctx) => + ctx.depth === 1 ? inputMap : null, + ) as unknown as SourceMapCompact; + } catch (e) { + log.error(`Failed to compose source map for ${id}: ${e}`, { forward: true }); + return instrumentMap; + } +} diff --git a/packages/plugins/live-debugger/src/sourcemap.integration.test.ts b/packages/plugins/live-debugger/src/sourcemap.integration.test.ts new file mode 100644 index 000000000..111f72638 --- /dev/null +++ b/packages/plugins/live-debugger/src/sourcemap.integration.test.ts @@ -0,0 +1,225 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the MIT License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +import { datadogRspackPlugin } from '@datadog/rspack-plugin'; +import { outputFileSync, readFileSync, rm } from '@dd/core/helpers/fs'; +import { getUniqueId } from '@dd/core/helpers/strings'; +import { prepareWorkingDir } from '@dd/tests/_jest/helpers/env'; +import { defaultPluginOptions } from '@dd/tests/_jest/helpers/mocks'; +import { buildWithRspack } from '@dd/tools/bundlers'; +import { originalPositionFor, TraceMap } from '@jridgewell/trace-mapping'; +import path from 'path'; + +// Tiny rspack/webpack loader that publishes an identity source map for the +// modules it touches. It is required because unplugin's rspack/webpack +// transform loader silently drops `res.map` when the *input* source map is +// null. +const IDENTITY_SHIM_LOADER_SOURCE = ` +module.exports = function (source) { + this.cacheable && this.cacheable(); + const callback = this.async(); + const lines = source.split('\\n'); + const mappings = lines + .map((_, idx) => (idx === 0 ? 'AAAA' : 'AACA')) + .join(';'); + callback(null, source, { + version: 3, + sources: [this.resourcePath], + sourcesContent: [source], + names: [], + mappings: mappings, + }); +}; +`; + +const BANNER_LINES = 4; +const BANNER_SHIFT_SHIM_LOADER_SOURCE = ` +const BANNER = ${JSON.stringify('// banner\n'.repeat(BANNER_LINES))}; +module.exports = function (source) { + this.cacheable && this.cacheable(); + const callback = this.async(); + const lines = source.split('\\n'); + // Identity-by-line mappings for the original source, prefixed with + // ${BANNER_LINES} empty entries for the banner lines (which have no + // original source position). + const sourceMappings = lines + .map((_, idx) => (idx === 0 ? 'AAAA' : 'AACA')) + .join(';'); + const mappings = ';'.repeat(${BANNER_LINES}) + sourceMappings; + callback(null, BANNER + source, { + version: 3, + sources: [this.resourcePath], + sourcesContent: [source], + names: [], + mappings: mappings, + }); +}; +`; + +describe('Live Debugger sourcemaps', () => { + const seed = `${Math.abs(jest.getSeed())}.${getUniqueId()}`; + let workingDir: string; + + beforeAll(async () => { + workingDir = await prepareWorkingDir(seed); + }); + + afterAll(async () => { + if (!process.env.NO_CLEANUP) { + await rm(workingDir); + } + }); + + const ENTRY_SOURCE = [ + 'function helper() {', + " return 'helper';", + '}', + '', + 'function getDebuggerServicesStatus(isLoadingCritical) {', + " return isLoadingCritical ? 'loading' : 'completed';", + '}', + '', + 'getDebuggerServicesStatus(false);', + ].join('\n'); + + /** + * Build the entry through rspack with the live-debugger plugin enabled and + * the given upstream loader, then return the bundle, its source map, and + * a few key positions used by every assertion below. Centralizing this + * keeps the actual test bodies focused on the source-map invariants they + * are checking and avoids re-stating the bundler config in every case. + */ + const buildAndLocate = async (upstreamShimLoaderSource: string, outputSubdir: string) => { + const entry = path.resolve(workingDir, 'live-debugger-entry.js'); + const outDir = path.resolve(workingDir, outputSubdir); + const shimLoader = path.resolve(workingDir, `${outputSubdir}-loader.cjs`); + + outputFileSync(shimLoader, upstreamShimLoaderSource); + outputFileSync(entry, ENTRY_SOURCE); + + const { errors } = await buildWithRspack({ + context: workingDir, + mode: 'none', + devtool: 'source-map', + entry: { main: entry }, + output: { + path: outDir, + filename: '[name].js', + }, + resolve: { + extensions: ['.js'], + }, + module: { + // Stand-in for the source-map-producing loader (swc/babel/ts/...) + // that would normally precede the Datadog plugin in a real build. + rules: [{ test: /\.js$/, use: [{ loader: shimLoader }] }], + }, + plugins: [ + datadogRspackPlugin({ + ...defaultPluginOptions, + liveDebugger: { + enable: true, + }, + metadata: { + version: 'test-version', + }, + }), + ], + }); + + expect(errors).toEqual([]); + + const bundle = readFileSync(path.resolve(outDir, 'main.js')); + const sourceMap = JSON.parse(readFileSync(path.resolve(outDir, 'main.js.map'))); + const lines = bundle.split('\n'); + + const probeDeclLine = lines.findIndex((line) => + line.includes('live-debugger-entry.js;getDebuggerServicesStatus'), + ); + const entryCallLine = lines.findIndex( + (line, idx) => idx > probeDeclLine && line.includes('$dd_entry($dd_p'), + ); + const functionDeclLine = lines.findIndex((line) => + line.includes('function getDebuggerServicesStatus(isLoadingCritical)'), + ); + + expect(probeDeclLine).toBeGreaterThan(-1); + expect(entryCallLine).toBeGreaterThan(-1); + expect(functionDeclLine).toBeGreaterThan(-1); + + return { + traceMap: new TraceMap(sourceMap), + probeDeclLine, + probeDeclColumn: lines[probeDeclLine].indexOf( + 'live-debugger-entry.js;getDebuggerServicesStatus', + ), + entryCallLine, + entryCallColumn: lines[entryCallLine].indexOf('$dd_entry'), + functionDeclLine, + functionDeclColumn: lines[functionDeclLine].indexOf('function '), + }; + }; + + it('produces line- and column-accurate sourcemaps after rspack', async () => { + const located = await buildAndLocate( + IDENTITY_SHIM_LOADER_SOURCE, + 'dist-live-debugger-rspack-identity', + ); + + expect( + originalPositionFor(located.traceMap, { + line: located.probeDeclLine + 1, + column: located.probeDeclColumn, + }), + ).toEqual(expect.objectContaining({ line: 5 })); + + expect( + originalPositionFor(located.traceMap, { + line: located.entryCallLine + 1, + column: located.entryCallColumn, + }), + ).toEqual(expect.objectContaining({ line: 5 })); + + expect( + originalPositionFor(located.traceMap, { + line: located.functionDeclLine + 1, + column: located.functionDeclColumn, + }), + ).toEqual(expect.objectContaining({ line: 5, column: 0 })); + }); + + it('composes its source map with the previous loader so injected positions are reported in original-source coordinates', async () => { + const located = await buildAndLocate( + BANNER_SHIFT_SHIM_LOADER_SOURCE, + 'dist-live-debugger-rspack-shifted', + ); + + const probeDeclResolved = originalPositionFor(located.traceMap, { + line: located.probeDeclLine + 1, + column: located.probeDeclColumn, + }); + const entryCallResolved = originalPositionFor(located.traceMap, { + line: located.entryCallLine + 1, + column: located.entryCallColumn, + }); + const functionDeclResolved = originalPositionFor(located.traceMap, { + line: located.functionDeclLine + 1, + column: located.functionDeclColumn, + }); + + // Every position we care about must point at line 5 of the original + // source, NOT line 5 + BANNER_LINES of the post-loader buffer. + expect(probeDeclResolved).toEqual(expect.objectContaining({ line: 5 })); + expect(entryCallResolved).toEqual(expect.objectContaining({ line: 5 })); + expect(functionDeclResolved).toEqual(expect.objectContaining({ line: 5, column: 0 })); + + // Defensive: explicitly assert that none of the resolved positions + // are pointing at the banner area. Without composition the injected + // probe positions would land on lines 5..(5 + BANNER_LINES) of what + // the bundler thinks is the original source. + for (const resolved of [probeDeclResolved, entryCallResolved, functionDeclResolved]) { + expect(resolved.line).not.toBeGreaterThan(5); + } + }); +}); diff --git a/packages/plugins/live-debugger/src/transform/index.test.ts b/packages/plugins/live-debugger/src/transform/index.test.ts index d2fa18b3d..0e0d757fb 100644 --- a/packages/plugins/live-debugger/src/transform/index.test.ts +++ b/packages/plugins/live-debugger/src/transform/index.test.ts @@ -2,6 +2,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. +import { originalPositionFor, TraceMap } from '@jridgewell/trace-mapping'; + import { transformCode, validateSyntax } from './index'; const BASE_OPTIONS = { @@ -344,6 +346,40 @@ describe('transformCode', () => { expect(result.map).toBeDefined(); expect(result.map?.sources).toContain('/src/utils.ts'); }); + + it('should map the injected entry call back to the original function line', () => { + // Even though the preamble lands on its own generated lines (not on + // the function declaration line) the source map must resolve every + // injected line back to the function it wraps. Magic-string + // populates each injected line with a segment via `s.update()`; + // before that, purely-injected lines had no segments at all and + // resolved to `null`. + const code = [ + "import { isDefined } from '@lib/type-guards';", + '', + 'function getDebuggerServicesStatus(isLoadingCritical) {', + " return isLoadingCritical ? 'loading' : 'completed';", + '}', + ].join('\n'); + const result = transformCode({ ...BASE_OPTIONS, code }); + + expect(result.map).toBeDefined(); + const lines = result.code.split('\n'); + const entryLineIndex = lines.findIndex((line) => line.includes('$dd_entry($dd_p0')); + expect(entryLineIndex).toBeGreaterThan(-1); + + const traceMap = new TraceMap(JSON.parse(result.map!.toString())); + const entryColumn = lines[entryLineIndex].indexOf('$dd_entry'); + const original = originalPositionFor(traceMap, { + line: entryLineIndex + 1, + column: entryColumn, + }); + + // Original function declaration is on line 3 (1-indexed) of the + // source. Mapping any column on the entry-call line back through + // the source map must land on that line, regardless of the column. + expect(original.line).toBe(3); + }); }); describe('functionTypes filtering', () => { diff --git a/packages/plugins/live-debugger/src/transform/index.ts b/packages/plugins/live-debugger/src/transform/index.ts index 82dd11596..c62c7c45e 100644 --- a/packages/plugins/live-debugger/src/transform/index.ts +++ b/packages/plugins/live-debugger/src/transform/index.ts @@ -356,11 +356,7 @@ export function transformCode(options: TransformOptions): TransformResult { return { code: s.toString(), - // Known limitation: hires: false gives line-level source map granularity only. - // Column-level accuracy (hires: true or 'boundary') would be needed for - // minified code or precise debugger positioning, but is not required for - // RUM Error Tracking stack traces which reference lines. - map: s.generateMap({ source: filePath, hires: false }), + map: s.generateMap({ source: filePath, hires: true }), failedCount, instrumentedCount, skippedByCommentCount, @@ -371,10 +367,7 @@ export function transformCode(options: TransformOptions): TransformResult { } /** - * Inject instrumentation for a single function using MagicString. - * - * Uses appendLeft exclusively (no overwrite) to avoid conflicts - * with nested function instrumentation in the same source range. + * Inject instrumentation for a single function. */ function injectInstrumentation(s: MagicStringType, code: string, target: FunctionTarget): void { const { @@ -462,12 +455,20 @@ function injectInstrumentation(s: MagicStringType, code: string, target: Functio '}', ].join('\n'); - s.appendLeft(bodyStart, prefix); - s.appendLeft(bodyEnd, suffix); + // Anchor each injected line to the original expression's location by + // editing the boundary chars of the body. Two updates avoid losing + // per-character mappings of the original expression in between. + // For a single-char body (e.g. `() => 1`) the two ranges would + // collide, so we fall back to one update covering the whole body. + if (bodyEnd - bodyStart >= 2) { + s.update(bodyStart, bodyStart + 1, prefix + code[bodyStart]); + s.update(bodyEnd - 1, bodyEnd, code[bodyEnd - 1] + suffix); + } else { + s.update(bodyStart, bodyEnd, prefix + code.slice(bodyStart, bodyEnd) + suffix); + } } else { // Block body function const preamble = [ - '', probeDecl, entryHelperDecl, 'try {', @@ -478,21 +479,10 @@ function injectInstrumentation(s: MagicStringType, code: string, target: Functio .filter(Boolean) .join('\n'); - const postambleParts = ['']; - if (target.needsTrailingReturn) { - postambleParts.push( - `if (${probeVarName}) $dd_return(${probeVarName}, undefined, this${returnArgsAndLocals});`, - ); - } - postambleParts.push(`} ${catchBlock}`, ''); - const postamble = postambleParts.join('\n'); - - const preambleInsertPos = directivesEnd ?? bodyStart + 1; - s.appendLeft(preambleInsertPos, directivesEnd != null ? `\n${preamble}` : preamble); - - // Wrap return statements BEFORE inserting the postamble so that when + // Wrap return statements BEFORE the boundary updates so that when // a semicolon-free final return shares its argEnd position with - // bodyEnd - 1, appendLeft stacks the return suffix before the postamble. + // bodyEnd - 1, the return suffix is appended to the preceding chunk + // (its outro) and ends up before the postamble in the generated code. for (const ret of returns) { if (ret.argStart != null && ret.argEnd != null) { // return EXPR; → return ($dd_rvN = EXPR, probe ? $dd_return(...) : $dd_rvN); @@ -510,7 +500,32 @@ function injectInstrumentation(s: MagicStringType, code: string, target: Functio } } - s.appendLeft(bodyEnd - 1, postamble); + // Wrap the boundary character (last directive char or the body's + // opening `{`) with ``. Editing through `update()` + // makes magic-string emit a source-map segment for every line of + // the new content, all anchored at that boundary char's location — + // so injected preamble lines map to the function's own line instead + // of to nothing. + // + // For directives, an additional leading newline keeps the preamble + // on its own line (the directive's trailing `;` already ends a + // statement, but its terminator stays on the directive's line). + if (directivesEnd != null) { + const anchor = directivesEnd - 1; + s.update(anchor, directivesEnd, `${code[anchor]}\n${preamble}`); + } else { + s.update(bodyStart, bodyStart + 1, `${code[bodyStart]}${preamble}`); + } + + // Build the postamble. The optional trailing-return helper is + // included here (rather than as a separate appendLeft) so that the + // single boundary update for `}` covers it; this keeps the trailing + // helper's source-map segment anchored to the closing brace too. + const trailingReturn = target.needsTrailingReturn + ? `if (${probeVarName}) $dd_return(${probeVarName}, undefined, this${returnArgsAndLocals});\n` + : ''; + const postamble = `\n${trailingReturn}} ${catchBlock}\n`; + s.update(bodyEnd - 1, bodyEnd, `${postamble}${code[bodyEnd - 1]}`); } } diff --git a/packages/published/esbuild-plugin/package.json b/packages/published/esbuild-plugin/package.json index f2fd247db..f6482225f 100644 --- a/packages/published/esbuild-plugin/package.json +++ b/packages/published/esbuild-plugin/package.json @@ -51,6 +51,7 @@ }, "dependencies": { "@datadog/js-instrumentation-wasm": "1.0.8", + "@jridgewell/remapping": "2.3.5", "async-retry": "1.3.3", "chalk": "2.3.1", "glob": "11.1.0", diff --git a/packages/published/rollup-plugin/package.json b/packages/published/rollup-plugin/package.json index 384b08767..21e3a6783 100644 --- a/packages/published/rollup-plugin/package.json +++ b/packages/published/rollup-plugin/package.json @@ -54,6 +54,7 @@ }, "dependencies": { "@datadog/js-instrumentation-wasm": "1.0.8", + "@jridgewell/remapping": "2.3.5", "async-retry": "1.3.3", "chalk": "2.3.1", "glob": "11.1.0", diff --git a/packages/published/rspack-plugin/package.json b/packages/published/rspack-plugin/package.json index 861025ca5..c89146164 100644 --- a/packages/published/rspack-plugin/package.json +++ b/packages/published/rspack-plugin/package.json @@ -51,6 +51,7 @@ }, "dependencies": { "@datadog/js-instrumentation-wasm": "1.0.8", + "@jridgewell/remapping": "2.3.5", "async-retry": "1.3.3", "chalk": "2.3.1", "glob": "11.1.0", diff --git a/packages/published/vite-plugin/package.json b/packages/published/vite-plugin/package.json index 5c67e58ee..b772a5e96 100644 --- a/packages/published/vite-plugin/package.json +++ b/packages/published/vite-plugin/package.json @@ -51,6 +51,7 @@ }, "dependencies": { "@datadog/js-instrumentation-wasm": "1.0.8", + "@jridgewell/remapping": "2.3.5", "async-retry": "1.3.3", "chalk": "2.3.1", "glob": "11.1.0", diff --git a/packages/published/webpack-plugin/package.json b/packages/published/webpack-plugin/package.json index 6fed55ed7..3df8130e4 100644 --- a/packages/published/webpack-plugin/package.json +++ b/packages/published/webpack-plugin/package.json @@ -51,6 +51,7 @@ }, "dependencies": { "@datadog/js-instrumentation-wasm": "1.0.8", + "@jridgewell/remapping": "2.3.5", "async-retry": "1.3.3", "chalk": "2.3.1", "glob": "11.1.0", diff --git a/yarn.lock b/yarn.lock index 329b10d2e..09d6da4b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1688,6 +1688,7 @@ __metadata: "@datadog/js-instrumentation-wasm": "npm:1.0.8" "@dd/factory": "workspace:*" "@dd/tools": "workspace:*" + "@jridgewell/remapping": "npm:2.3.5" "@rollup/plugin-babel": "npm:6.0.4" "@rollup/plugin-commonjs": "npm:28.0.1" "@rollup/plugin-esm-shim": "npm:0.1.7" @@ -1746,6 +1747,7 @@ __metadata: "@datadog/js-instrumentation-wasm": "npm:1.0.8" "@dd/factory": "workspace:*" "@dd/tools": "workspace:*" + "@jridgewell/remapping": "npm:2.3.5" "@rollup/plugin-babel": "npm:6.0.4" "@rollup/plugin-commonjs": "npm:28.0.1" "@rollup/plugin-esm-shim": "npm:0.1.7" @@ -1797,6 +1799,7 @@ __metadata: "@datadog/js-instrumentation-wasm": "npm:1.0.8" "@dd/factory": "workspace:*" "@dd/tools": "workspace:*" + "@jridgewell/remapping": "npm:2.3.5" "@rollup/plugin-babel": "npm:6.0.4" "@rollup/plugin-commonjs": "npm:28.0.1" "@rollup/plugin-esm-shim": "npm:0.1.7" @@ -1848,6 +1851,7 @@ __metadata: "@datadog/js-instrumentation-wasm": "npm:1.0.8" "@dd/factory": "workspace:*" "@dd/tools": "workspace:*" + "@jridgewell/remapping": "npm:2.3.5" "@rollup/plugin-babel": "npm:6.0.4" "@rollup/plugin-commonjs": "npm:28.0.1" "@rollup/plugin-esm-shim": "npm:0.1.7" @@ -1899,6 +1903,7 @@ __metadata: "@datadog/js-instrumentation-wasm": "npm:1.0.8" "@dd/factory": "workspace:*" "@dd/tools": "workspace:*" + "@jridgewell/remapping": "npm:2.3.5" "@rollup/plugin-babel": "npm:6.0.4" "@rollup/plugin-commonjs": "npm:28.0.1" "@rollup/plugin-esm-shim": "npm:0.1.7" @@ -2099,6 +2104,8 @@ __metadata: "@babel/traverse": "npm:7.24.5" "@babel/types": "npm:7.24.5" "@dd/core": "workspace:*" + "@jridgewell/remapping": "npm:2.3.5" + "@jridgewell/trace-mapping": "npm:0.3.31" chalk: "npm:2.3.1" magic-string: "npm:0.30.21" typescript: "npm:5.4.3" @@ -3155,7 +3162,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/remapping@npm:^2.3.5": +"@jridgewell/remapping@npm:2.3.5, @jridgewell/remapping@npm:^2.3.5": version: 2.3.5 resolution: "@jridgewell/remapping@npm:2.3.5" dependencies: @@ -3196,6 +3203,16 @@ __metadata: languageName: node linkType: hard +"@jridgewell/trace-mapping@npm:0.3.31": + version: 0.3.31 + resolution: "@jridgewell/trace-mapping@npm:0.3.31" + dependencies: + "@jridgewell/resolve-uri": "npm:^3.1.0" + "@jridgewell/sourcemap-codec": "npm:^1.4.14" + checksum: 10/da0283270e691bdb5543806077548532791608e52386cfbbf3b9e8fb00457859d1bd01d512851161c886eb3a2f3ce6fd9bcf25db8edf3bddedd275bd4a88d606 + languageName: node + linkType: hard + "@jridgewell/trace-mapping@npm:0.3.9": version: 0.3.9 resolution: "@jridgewell/trace-mapping@npm:0.3.9"