diff --git a/packages/babel-plugin-component-annotate/package.json b/packages/babel-plugin-component-annotate/package.json index a12c9577..0e76f6d4 100644 --- a/packages/babel-plugin-component-annotate/package.json +++ b/packages/babel-plugin-component-annotate/package.json @@ -58,7 +58,6 @@ "@swc/jest": "^0.2.21", "@types/jest": "^28.1.3", "@types/node": "^18.6.3", - "@types/uuid": "^9.0.1", "eslint": "^8.18.0", "jest": "^28.1.1", "premove": "^4.0.0", diff --git a/packages/esbuild-plugin/jest.config.js b/packages/esbuild-plugin/jest.config.js index a04cbd13..160178bb 100644 --- a/packages/esbuild-plugin/jest.config.js +++ b/packages/esbuild-plugin/jest.config.js @@ -3,7 +3,4 @@ module.exports = { transform: { "^.+\\.(t|j)sx?$": ["@swc/jest"], }, - moduleNameMapper: { - uuid: require.resolve("uuid"), // https://stackoverflow.com/a/73203803 - }, }; diff --git a/packages/esbuild-plugin/package.json b/packages/esbuild-plugin/package.json index 687290b4..ea8bdd6c 100644 --- a/packages/esbuild-plugin/package.json +++ b/packages/esbuild-plugin/package.json @@ -48,8 +48,7 @@ "prepack": "ts-node ./src/prepack.ts" }, "dependencies": { - "@sentry/bundler-plugin-core": "5.1.1", - "uuid": "^9.0.0" + "@sentry/bundler-plugin-core": "5.1.1" }, "devDependencies": { "@sentry-internal/eslint-config": "5.1.1", @@ -58,7 +57,6 @@ "@swc/jest": "^0.2.21", "@types/jest": "^28.1.3", "@types/node": "^18.6.3", - "@types/uuid": "^9.0.1", "eslint": "^8.18.0", "jest": "^28.1.1", "premove": "^4.0.0", diff --git a/packages/esbuild-plugin/src/index.ts b/packages/esbuild-plugin/src/index.ts index d1c73160..965bc904 100644 --- a/packages/esbuild-plugin/src/index.ts +++ b/packages/esbuild-plugin/src/index.ts @@ -9,7 +9,7 @@ import { } from "@sentry/bundler-plugin-core"; import * as path from "node:path"; import { createRequire } from "node:module"; -import { v4 as uuidv4 } from "uuid"; +import { randomUUID } from "node:crypto"; interface EsbuildOnResolveArgs { path: string; @@ -268,7 +268,7 @@ export function sentryEsbuildPlugin(userOptions: Options = {}): any { sideEffects: true, pluginName, namespace: "sentry-debug-id-stub", - suffix: "?sentry-module-id=" + uuidv4(), + suffix: "?sentry-module-id=" + randomUUID(), }; }); @@ -278,7 +278,7 @@ export function sentryEsbuildPlugin(userOptions: Options = {}): any { return { loader: "js", pluginName, - contents: getDebugIdSnippet(uuidv4()).code(), + contents: getDebugIdSnippet(randomUUID()).code(), }; } ); diff --git a/packages/webpack-plugin/jest.config.js b/packages/webpack-plugin/jest.config.js index a04cbd13..160178bb 100644 --- a/packages/webpack-plugin/jest.config.js +++ b/packages/webpack-plugin/jest.config.js @@ -3,7 +3,4 @@ module.exports = { transform: { "^.+\\.(t|j)sx?$": ["@swc/jest"], }, - moduleNameMapper: { - uuid: require.resolve("uuid"), // https://stackoverflow.com/a/73203803 - }, }; diff --git a/packages/webpack-plugin/package.json b/packages/webpack-plugin/package.json index a05762db..407ce5a1 100644 --- a/packages/webpack-plugin/package.json +++ b/packages/webpack-plugin/package.json @@ -53,8 +53,7 @@ "prepack": "ts-node ./src/prepack.ts" }, "dependencies": { - "@sentry/bundler-plugin-core": "5.1.1", - "uuid": "^9.0.0" + "@sentry/bundler-plugin-core": "5.1.1" }, "devDependencies": { "@sentry-internal/eslint-config": "5.1.1", @@ -63,7 +62,6 @@ "@swc/jest": "^0.2.21", "@types/jest": "^28.1.3", "@types/node": "^18.6.3", - "@types/uuid": "^9.0.1", "@types/webpack": "npm:@types/webpack@^4", "eslint": "^8.18.0", "jest": "^28.1.1", diff --git a/packages/webpack-plugin/src/webpack4and5.ts b/packages/webpack-plugin/src/webpack4and5.ts index 4b75a103..cd6ee3c3 100644 --- a/packages/webpack-plugin/src/webpack4and5.ts +++ b/packages/webpack-plugin/src/webpack4and5.ts @@ -12,7 +12,7 @@ import { import * as path from "node:path"; import { fileURLToPath } from "node:url"; import { createRequire } from "node:module"; -import { v4 as uuidv4 } from "uuid"; +import { randomUUID } from "node:crypto"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore Rollup transpiles import.meta for us for CJS @@ -240,7 +240,7 @@ export function sentryWebpackPluginFactory({ const codeToInject = staticInjectionCode.clone(); if (sourcemapsEnabled) { const hash = arg?.chunk?.contentHash?.javascript ?? arg?.chunk?.hash; - const debugId = hash ? stringToUUID(hash) : uuidv4(); + const debugId = hash ? stringToUUID(hash) : randomUUID(); codeToInject.append(getDebugIdSnippet(debugId)); } return codeToInject.code(); diff --git a/yarn.lock b/yarn.lock index 10248ade..4bd0ff4d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2587,11 +2587,6 @@ dependencies: source-map "^0.6.1" -"@types/uuid@^9.0.1": - version "9.0.1" - resolved "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz#98586dc36aee8dacc98cc396dbca8d0429647aa6" - integrity sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA== - "@types/webpack-sources@*": version "3.2.0" resolved "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-3.2.0.tgz#16d759ba096c289034b26553d2df1bf45248d38b" @@ -10584,11 +10579,6 @@ uuid@8.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@^9.0.0: - version "9.0.0" - resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" - integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== - v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf"