diff --git a/packages/babel-plugin-component-annotate/package.json b/packages/babel-plugin-component-annotate/package.json index 6db6e9ab..119de3e9 100644 --- a/packages/babel-plugin-component-annotate/package.json +++ b/packages/babel-plugin-component-annotate/package.json @@ -58,7 +58,7 @@ "eslint": "^8.18.0", "vitest": "^4.0.0", "premove": "^4.0.0", - "rolldown": "^1.0.0-rc.6", + "rolldown": "1.0.0-rc.10", "ts-node": "^10.9.1", "typescript": "^4.7.4" }, diff --git a/packages/bundler-plugin-core/package.json b/packages/bundler-plugin-core/package.json index 28359231..e766050f 100644 --- a/packages/bundler-plugin-core/package.json +++ b/packages/bundler-plugin-core/package.json @@ -72,7 +72,7 @@ "eslint": "^8.18.0", "vitest": "^4.0.0", "premove": "^4.0.0", - "rolldown": "^1.0.0-rc.6", + "rolldown": "1.0.0-rc.10", "typescript": "^4.7.4" }, "volta": { diff --git a/packages/esbuild-plugin/package.json b/packages/esbuild-plugin/package.json index 45fbea76..bedf0d04 100644 --- a/packages/esbuild-plugin/package.json +++ b/packages/esbuild-plugin/package.json @@ -57,7 +57,7 @@ "eslint": "^8.18.0", "vitest": "^4.0.0", "premove": "^4.0.0", - "rolldown": "^1.0.0-rc.6", + "rolldown": "1.0.0-rc.10", "ts-node": "^10.9.1", "typescript": "^4.7.4" }, diff --git a/packages/integration-tests-next/.eslintrc.js b/packages/integration-tests-next/.eslintrc.js index 86143395..bb474177 100644 --- a/packages/integration-tests-next/.eslintrc.js +++ b/packages/integration-tests-next/.eslintrc.js @@ -2,7 +2,13 @@ module.exports = { root: true, extends: ["@sentry-internal/eslint-config/base"], - ignorePatterns: [".eslintrc.js", "fixtures/*/out", "fixtures/*/src"], + ignorePatterns: [ + ".eslintrc.js", + "fixtures/*/out", + "fixtures/*/src", + // We ignore Vite fixtures for now because there are a couple of version mismatches. + "fixtures/vite*/**/*", + ], parserOptions: { tsconfigRootDir: __dirname, project: ["./tsconfig.json"], diff --git a/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.test.ts b/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.test.ts index b9900075..98cb45aa 100644 --- a/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.test.ts @@ -6,9 +6,17 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world"); - + (function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54"); + } catch (e) {} + })(); + console.log("hello world"); //#endregion + //# sourceMappingURL=basic.js.map", } `); diff --git a/packages/integration-tests-next/fixtures/rolldown/application-key.test.ts b/packages/integration-tests-next/fixtures/rolldown/application-key.test.ts index 460d301b..edec4127 100644 --- a/packages/integration-tests-next/fixtures/rolldown/application-key.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/application-key.test.ts @@ -4,11 +4,26 @@ import { test } from "./utils"; test(import.meta.url, ({ runBundler, readOutputFiles }) => { runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` - { - "basic.js": "//#region src/basic.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var n=1;n { runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` - { - "basic.js": "//#region src/basic.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world"); - - //#endregion", - } - `); + { + "basic.js": "//#region src/basic.js + (function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54"); + } catch (e) {} + })(); + console.log("hello world"); + //#endregion + ", + } + `); }); diff --git a/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts b/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts index 4f158672..a15fd429 100644 --- a/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts @@ -6,11 +6,19 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world"); - + (function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54"); + } catch (e) {} + })(); + console.log("hello world"); //#endregion + //# sourceMappingURL=basic.js.map", - "basic.js.map": "{"version":3,"file":"basic.js","names":[],"sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"mappings":";scACA,OAAA,CAAQ,GAAA,CAAI,CAAA,KAAA,CAAA,KAAA,CAAA,CAAc"}", + "basic.js.map": "{"version":3,"file":"basic.js","names":[],"sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"mappings":";;;;;;;;;AACA,QAAQ,IAAI,cAAc"}", "sentry-cli-mock.json": "["releases","new","CURRENT_SHA"], ["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], ["releases","finalize","CURRENT_SHA"], diff --git a/packages/integration-tests-next/fixtures/rolldown/basic.test.ts b/packages/integration-tests-next/fixtures/rolldown/basic.test.ts index b3e85d7b..4f2aa09c 100644 --- a/packages/integration-tests-next/fixtures/rolldown/basic.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/basic.test.ts @@ -6,9 +6,17 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world"); - - //#endregion", + (function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54"); + } catch (e) {} + })(); + console.log("hello world"); + //#endregion + ", "sentry-cli-mock.json": "["releases","new","CURRENT_SHA"], ["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], ["releases","finalize","CURRENT_SHA"], diff --git a/packages/integration-tests-next/fixtures/rolldown/build-info.test.ts b/packages/integration-tests-next/fixtures/rolldown/build-info.test.ts index 61aaf800..17f63e44 100644 --- a/packages/integration-tests-next/fixtures/rolldown/build-info.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/build-info.test.ts @@ -6,9 +6,26 @@ test(import.meta.url, ({ runBundler, readOutputFiles }) => { expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"build-information-injection-test"};e.SENTRY_BUILD_INFO={"deps":["@sentry/rollup-plugin","react","rolldown"],"depsVersions":{"react":19},"nodeVersion":"NODE_VERSION"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world"); - - //#endregion", + (function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "build-information-injection-test" }; + e.SENTRY_BUILD_INFO = { + "deps": [ + "@sentry/rollup-plugin", + "react", + "rolldown" + ], + "depsVersions": { "react": 19 }, + "nodeVersion":"NODE_VERSION" + }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54"); + } catch (e) {} + })(); + console.log("hello world"); + //#endregion + ", } `); }); diff --git a/packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.test.ts b/packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.test.ts index 5e4bb51f..63d082bc 100644 --- a/packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.test.ts @@ -6,7 +6,15 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { expect(readOutputFiles()).toMatchInlineSnapshot(` { "bundle.js": "//#region src/bundle.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="92a38845-d1ee-42b4-9812-67a76e42b480",e._sentryDebugIdIdentifier="sentry-dbid-92a38845-d1ee-42b4-9812-67a76e42b480");}catch(e){}}();console.log(JSON.stringify({ + (function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "92a38845-d1ee-42b4-9812-67a76e42b480", e._sentryDebugIdIdentifier = "sentry-dbid-92a38845-d1ee-42b4-9812-67a76e42b480"); + } catch (e) {} + })(); + console.log(JSON.stringify({ debug: "b", trace: "b", replayCanvas: "a", @@ -14,8 +22,8 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { replayShadowDom: "a", replayWorker: "a" })); - - //#endregion", + //#endregion + ", } `); diff --git a/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.test.ts b/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.test.ts index bff61bbf..6cfa24bb 100644 --- a/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.test.ts @@ -5,21 +5,27 @@ test(import.meta.url, ({ runBundler, readOutputFiles }) => { runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { - "app.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="85f51673-9b26-4de9-b6ba-12058e53f08b",e._sentryDebugIdIdentifier="sentry-dbid-85f51673-9b26-4de9-b6ba-12058e53f08b");}catch(e){}}();import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; - + "app.js": "(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "85f51673-9b26-4de9-b6ba-12058e53f08b", e._sentryDebugIdIdentifier = "sentry-dbid-85f51673-9b26-4de9-b6ba-12058e53f08b"); + } catch (e) {} + })(); + import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; //#region src/component-a.jsx function ComponentA() { return /* @__PURE__ */ jsx("span", { children: "Component A" }); } - //#endregion //#region src/app.jsx function App() { return /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx(ComponentA, {}), ";"] }); } - //#endregion - export { App as default };", + export { App as default }; + ", } `); }); diff --git a/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.test.ts b/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.test.ts index 6b782f3a..fc72317d 100644 --- a/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.test.ts @@ -5,8 +5,15 @@ test(import.meta.url, ({ runBundler, readOutputFiles }) => { runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { - "app.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="08d8ea54-706b-4dfc-9e1f-19af2d0fc86e",e._sentryDebugIdIdentifier="sentry-dbid-08d8ea54-706b-4dfc-9e1f-19af2d0fc86e");}catch(e){}}();import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; - + "app.js": "(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "08d8ea54-706b-4dfc-9e1f-19af2d0fc86e", e._sentryDebugIdIdentifier = "sentry-dbid-08d8ea54-706b-4dfc-9e1f-19af2d0fc86e"); + } catch (e) {} + })(); + import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; //#region src/component-a.jsx function ComponentA() { return /* @__PURE__ */ jsx("span", { @@ -14,7 +21,6 @@ test(import.meta.url, ({ runBundler, readOutputFiles }) => { children: "Component A" }); } - //#endregion //#region src/app.jsx function App() { @@ -23,9 +29,9 @@ test(import.meta.url, ({ runBundler, readOutputFiles }) => { children: [/* @__PURE__ */ jsx(ComponentA, {}), ";"] }); } - //#endregion - export { App as default };", + export { App as default }; + ", } `); }); diff --git a/packages/integration-tests-next/fixtures/rolldown/component-annotation.test.ts b/packages/integration-tests-next/fixtures/rolldown/component-annotation.test.ts index 1968819e..3d8a49a3 100644 --- a/packages/integration-tests-next/fixtures/rolldown/component-annotation.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation.test.ts @@ -5,8 +5,15 @@ test(import.meta.url, ({ runBundler, readOutputFiles }) => { runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { - "app.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0ad46712-3fec-46f3-8539-60a50dfc7fc6",e._sentryDebugIdIdentifier="sentry-dbid-0ad46712-3fec-46f3-8539-60a50dfc7fc6");}catch(e){}}();import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; - + "app.js": "(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0ad46712-3fec-46f3-8539-60a50dfc7fc6", e._sentryDebugIdIdentifier = "sentry-dbid-0ad46712-3fec-46f3-8539-60a50dfc7fc6"); + } catch (e) {} + })(); + import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; //#region src/component-a.jsx function ComponentA() { return /* @__PURE__ */ jsx("span", { @@ -15,7 +22,6 @@ test(import.meta.url, ({ runBundler, readOutputFiles }) => { children: "Component A" }); } - //#endregion //#region src/app.jsx function App() { @@ -28,9 +34,9 @@ test(import.meta.url, ({ runBundler, readOutputFiles }) => { }), ";"] }); } - //#endregion - export { App as default };", + export { App as default }; + ", } `); }); diff --git a/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.test.ts b/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.test.ts index 34262984..0502dbb7 100644 --- a/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.test.ts @@ -4,13 +4,13 @@ import { test } from "./utils"; test(import.meta.url, ({ runBundler, readOutputFiles }) => { runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` - { - "basic.js": "//#region src/basic.js - console.log("hello world"); + { + "basic.js": "//#region src/basic.js + console.log("hello world"); + //#endregion - //#endregion - //# sourceMappingURL=basic.js.map", - "basic.js.map": "{"version":3,"file":"basic.js","names":[],"sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"mappings":";AACA,QAAQ,IAAI,cAAc"}", - } - `); + //# sourceMappingURL=basic.js.map", + "basic.js.map": "{"version":3,"file":"basic.js","names":[],"sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"mappings":";AACA,QAAQ,IAAI,cAAc"}", + } + `); }); diff --git a/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.test.ts b/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.test.ts index 398dc71f..1ea310ac 100644 --- a/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.test.ts @@ -8,14 +8,22 @@ test(import.meta.url, ({ runBundler, createTempDir }) => { runBundler({ SENTRY_TEST_OVERRIDE_TEMP_DIR: tempDir }); const files = readAllFiles(tempDir); expect(files).toMatchInlineSnapshot(` - { - "b699d9c1-b033-4536-aa25-233c92609b54-0.js": "//#region src/basic.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world"); + { + "b699d9c1-b033-4536-aa25-233c92609b54-0.js": "//#region src/basic.js + (function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54"); + } catch (e) {} + })(); + console.log("hello world"); + //#endregion - //#endregion - //# debugId=b699d9c1-b033-4536-aa25-233c92609b54 - //# sourceMappingURL=basic.js.map", - "b699d9c1-b033-4536-aa25-233c92609b54-0.js.map": "{"version":3,"file":"basic.js","names":[],"sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"mappings":";scACA,OAAA,CAAQ,GAAA,CAAI,CAAA,KAAA,CAAA,KAAA,CAAA,CAAc","debugId":"b699d9c1-b033-4536-aa25-233c92609b54","debug_id":"b699d9c1-b033-4536-aa25-233c92609b54"}", - } - `); + //# debugId=b699d9c1-b033-4536-aa25-233c92609b54 + //# sourceMappingURL=basic.js.map", + "b699d9c1-b033-4536-aa25-233c92609b54-0.js.map": "{"version":3,"file":"basic.js","names":[],"sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"mappings":";;;;;;;;;AACA,QAAQ,IAAI,cAAc","debugId":"b699d9c1-b033-4536-aa25-233c92609b54","debug_id":"b699d9c1-b033-4536-aa25-233c92609b54"}", + } + `); }); diff --git a/packages/integration-tests-next/fixtures/rolldown/module-metadata.test.ts b/packages/integration-tests-next/fixtures/rolldown/module-metadata.test.ts index ece716eb..02d3c2a8 100644 --- a/packages/integration-tests-next/fixtures/rolldown/module-metadata.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/module-metadata.test.ts @@ -4,13 +4,31 @@ import { test } from "./utils"; test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` - { - "basic.js": "//#region src/basic.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var n=1;n { runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` - { - "common.js": "//#region src/common.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3f33b953-1cf1-4c05-850d-3f5b805fa101",e._sentryDebugIdIdentifier="sentry-dbid-3f33b953-1cf1-4c05-850d-3f5b805fa101");}catch(e){}}();function add(a, b) { - return a + b; - } - - //#endregion - export { add as t };", - "entry1.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cbcd67c2-83a7-44e1-94e6-9a8ab161f162",e._sentryDebugIdIdentifier="sentry-dbid-cbcd67c2-83a7-44e1-94e6-9a8ab161f162");}catch(e){}}();import { t as add } from "./common.js"; - - //#region src/entry1.js - console.log(add(1, 2)); - - //#endregion", - "entry2.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4f71127-2139-4e9f-af54-f35982254569",e._sentryDebugIdIdentifier="sentry-dbid-a4f71127-2139-4e9f-af54-f35982254569");}catch(e){}}();import { t as add } from "./common.js"; - - //#region src/entry2.js - console.log(add(2, 4)); - - //#endregion", - } - `); + { + "common.js": "//#region src/common.js + (function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "3f33b953-1cf1-4c05-850d-3f5b805fa101", e._sentryDebugIdIdentifier = "sentry-dbid-3f33b953-1cf1-4c05-850d-3f5b805fa101"); + } catch (e) {} + })(); + function add(a, b) { + return a + b; + } + //#endregion + export { add as t }; + ", + "entry1.js": "(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "cbcd67c2-83a7-44e1-94e6-9a8ab161f162", e._sentryDebugIdIdentifier = "sentry-dbid-cbcd67c2-83a7-44e1-94e6-9a8ab161f162"); + } catch (e) {} + })(); + import { t as add } from "./common.js"; + //#region src/entry1.js + console.log(add(1, 2)); + //#endregion + ", + "entry2.js": "(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a4f71127-2139-4e9f-af54-f35982254569", e._sentryDebugIdIdentifier = "sentry-dbid-a4f71127-2139-4e9f-af54-f35982254569"); + } catch (e) {} + })(); + import { t as add } from "./common.js"; + //#region src/entry2.js + console.log(add(2, 4)); + //#endregion + ", + } + `); const output1 = runFileInNode("entry1.js"); expect(output1).toMatchInlineSnapshot(` diff --git a/packages/integration-tests-next/fixtures/rolldown/package.json b/packages/integration-tests-next/fixtures/rolldown/package.json index 0ed82951..99414718 100644 --- a/packages/integration-tests-next/fixtures/rolldown/package.json +++ b/packages/integration-tests-next/fixtures/rolldown/package.json @@ -5,8 +5,8 @@ "type": "module", "dependencies": { "@sentry/rollup-plugin": "5.1.1", - "react": "^19.2.4", - "rolldown": "^1.0.0-rc.6" + "react": "19.2.4", + "rolldown": "1.0.0-rc.10" }, "pnpm": { "overrides": { diff --git a/packages/integration-tests-next/fixtures/rolldown/query-param.test.ts b/packages/integration-tests-next/fixtures/rolldown/query-param.test.ts index 5b3a013a..f3e32364 100644 --- a/packages/integration-tests-next/fixtures/rolldown/query-param.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/query-param.test.ts @@ -11,24 +11,46 @@ test(import.meta.url, ({ runBundler, readOutputFiles, ctx }) => { expect(readOutputFiles()).toMatchInlineSnapshot(` { "common.js?seP58q4g": "//#region src/common.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3f33b953-1cf1-4c05-850d-3f5b805fa101",e._sentryDebugIdIdentifier="sentry-dbid-3f33b953-1cf1-4c05-850d-3f5b805fa101");}catch(e){}}();function add(a, b) { + (function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "3f33b953-1cf1-4c05-850d-3f5b805fa101", e._sentryDebugIdIdentifier = "sentry-dbid-3f33b953-1cf1-4c05-850d-3f5b805fa101"); + } catch (e) {} + })(); + function add(a, b) { return a + b; } - //#endregion - export { add as t };", - "entry1.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bf11f932-fe2b-4b54-97e0-45abde2a0d81",e._sentryDebugIdIdentifier="sentry-dbid-bf11f932-fe2b-4b54-97e0-45abde2a0d81");}catch(e){}}();import { t as add } from "./common.js?seP58q4g"; - + export { add as t }; + ", + "entry1.js": "(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "bf11f932-fe2b-4b54-97e0-45abde2a0d81", e._sentryDebugIdIdentifier = "sentry-dbid-bf11f932-fe2b-4b54-97e0-45abde2a0d81"); + } catch (e) {} + })(); + import { t as add } from "./common.js?seP58q4g"; //#region src/entry1.js console.log(add(1, 2)); - - //#endregion", - "entry2.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5aaa817b-a0e4-4c91-a4f4-aa8f3c26e66e",e._sentryDebugIdIdentifier="sentry-dbid-5aaa817b-a0e4-4c91-a4f4-aa8f3c26e66e");}catch(e){}}();import { t as add } from "./common.js?seP58q4g"; - + //#endregion + ", + "entry2.js": "(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5aaa817b-a0e4-4c91-a4f4-aa8f3c26e66e", e._sentryDebugIdIdentifier = "sentry-dbid-5aaa817b-a0e4-4c91-a4f4-aa8f3c26e66e"); + } catch (e) {} + })(); + import { t as add } from "./common.js?seP58q4g"; //#region src/entry2.js console.log(add(2, 4)); - - //#endregion", + //#endregion + ", } `); }); diff --git a/packages/integration-tests-next/fixtures/rolldown/release-disabled.test.ts b/packages/integration-tests-next/fixtures/rolldown/release-disabled.test.ts index 18821086..8003ac69 100644 --- a/packages/integration-tests-next/fixtures/rolldown/release-disabled.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/release-disabled.test.ts @@ -6,9 +6,17 @@ test(import.meta.url, ({ runBundler, readOutputFiles }) => { expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world"); - - //#endregion", + (function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54"); + } catch (e) {} + })(); + console.log("hello world"); + //#endregion + ", "sentry-cli-mock.json": "["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], ["releases","finalize","CURRENT_SHA"], ["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"], diff --git a/packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts b/packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts index 7fe93c65..e89a87db 100644 --- a/packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts @@ -6,9 +6,17 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js - !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world"); - - //#endregion", + (function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54"); + } catch (e) {} + })(); + console.log("hello world"); + //#endregion + ", "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"8.30.0"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], ", } diff --git a/packages/integration-tests-next/fixtures/rolldown/utils.ts b/packages/integration-tests-next/fixtures/rolldown/utils.ts index 3b00ad73..d858292e 100644 --- a/packages/integration-tests-next/fixtures/rolldown/utils.ts +++ b/packages/integration-tests-next/fixtures/rolldown/utils.ts @@ -27,7 +27,7 @@ export function test(url: string, callback: TestCallback) { rmSync(outDir, { recursive: true, force: true }); // Rolldown requires Node 20+ - if (NODE_MAJOR_VERSION <= 18) { + if (NODE_MAJOR_VERSION < 20) { // eslint-disable-next-line @typescript-eslint/no-empty-function vitestTest.skip(testName); } else { diff --git a/packages/integration-tests-next/fixtures/rollup3/package.json b/packages/integration-tests-next/fixtures/rollup3/package.json index 5b3dc181..0317ba75 100644 --- a/packages/integration-tests-next/fixtures/rollup3/package.json +++ b/packages/integration-tests-next/fixtures/rollup3/package.json @@ -4,10 +4,10 @@ "private": true, "type": "module", "dependencies": { - "react": "^19.2.4", - "rollup": "^3.30.0", - "@rollup/plugin-babel": "^6.0.4", - "@rollup/plugin-node-resolve": "^15.2.3", + "react": "19.2.4", + "rollup": "3.30.0", + "@rollup/plugin-babel": "6.0.4", + "@rollup/plugin-node-resolve": "15.2.3", "@sentry/rollup-plugin": "5.1.1" }, "pnpm": { diff --git a/packages/integration-tests-next/fixtures/rollup4/package.json b/packages/integration-tests-next/fixtures/rollup4/package.json index 0914c4c4..a9d649e3 100644 --- a/packages/integration-tests-next/fixtures/rollup4/package.json +++ b/packages/integration-tests-next/fixtures/rollup4/package.json @@ -4,9 +4,9 @@ "private": true, "type": "module", "dependencies": { - "react": "^19.2.4", - "rollup": "^4.59.0", - "@rollup/plugin-babel": "^6.0.4", + "react": "19.2.4", + "rollup": "4.59.0", + "@rollup/plugin-babel": "6.0.4", "@rollup/plugin-node-resolve": "16.0.3", "@sentry/rollup-plugin": "5.1.1" }, diff --git a/packages/integration-tests-next/fixtures/utils.ts b/packages/integration-tests-next/fixtures/utils.ts index d6fd9d31..22fb76b5 100644 --- a/packages/integration-tests-next/fixtures/utils.ts +++ b/packages/integration-tests-next/fixtures/utils.ts @@ -34,7 +34,10 @@ export function readAllFiles(directory: string): Record { // We replace the current SHA with a placeholder to make snapshots deterministic contents = contents .replaceAll(CURRENT_SHA, "CURRENT_SHA") - .replaceAll(/"nodeVersion":\d+/g, `"nodeVersion":"NODE_VERSION"`); + .replaceAll(/"nodeVersion":\d+/g, `"nodeVersion":"NODE_VERSION"`) + .replaceAll(/"nodeVersion": \d+/g, `"nodeVersion":"NODE_VERSION"`) + .replaceAll(/nodeVersion:\d+/g, `nodeVersion:"NODE_VERSION"`) + .replaceAll(/nodeVersion: \d+/g, `nodeVersion:"NODE_VERSION"`); // Normalize Windows stuff in .map paths if (entry.endsWith(".map")) { diff --git a/packages/integration-tests-next/fixtures/vite4/after-upload-deletion.config.ts b/packages/integration-tests-next/fixtures/vite4/after-upload-deletion.config.ts new file mode 100644 index 00000000..674c7e70 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/after-upload-deletion.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/after-upload-deletion.config.js"; + +export default defineConfig({ + build: { + minify: false, + sourcemap: true, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/after-upload-deletion", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/after-upload-deletion.test.ts b/packages/integration-tests-next/fixtures/vite4/after-upload-deletion.test.ts new file mode 100644 index 00000000..ced3602e --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/after-upload-deletion.test.ts @@ -0,0 +1,25 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + //# sourceMappingURL=basic.js.map + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/application-key.config.ts b/packages/integration-tests-next/fixtures/vite4/application-key.config.ts new file mode 100644 index 00000000..ee524c7f --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/application-key.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/application-key.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/application-key", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/application-key.test.ts b/packages/integration-tests-next/fixtures/vite4/application-key.test.ts new file mode 100644 index 00000000..902f8657 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/application-key.test.ts @@ -0,0 +1,28 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + e._sentryModuleMetadata = e._sentryModuleMetadata || {}, e._sentryModuleMetadata[new e.Error().stack] = (function(e2) { + for (var n2 = 1; n2 < arguments.length; n2++) { + var a = arguments[n2]; + if (null != a) for (var t in a) a.hasOwnProperty(t) && (e2[t] = a[t]); + } + return e2; + })({}, e._sentryModuleMetadata[new e.Error().stack], { "_sentryBundlerPluginAppKey:1234567890abcdef": true }); + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/basic-release-disabled.config.ts b/packages/integration-tests-next/fixtures/vite4/basic-release-disabled.config.ts new file mode 100644 index 00000000..86242118 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/basic-release-disabled.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/basic-release-disabled.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/basic-release-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/basic-release-disabled.test.ts b/packages/integration-tests-next/fixtures/vite4/basic-release-disabled.test.ts new file mode 100644 index 00000000..eb87a858 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/basic-release-disabled.test.ts @@ -0,0 +1,20 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/vite4/basic-sourcemaps.config.ts new file mode 100644 index 00000000..312b7da1 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/basic-sourcemaps.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/basic-sourcemaps.config.js"; + +export default defineConfig({ + build: { + minify: false, + sourcemap: true, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/basic-sourcemaps", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/basic-sourcemaps.test.ts b/packages/integration-tests-next/fixtures/vite4/basic-sourcemaps.test.ts new file mode 100644 index 00000000..d99bd4e6 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/basic-sourcemaps.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + //# sourceMappingURL=basic.js.map + ", + "basic.js.map": "{"version":3,"file":"basic.js","sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"names":[],"mappings":";;;;;;;;;AACA,QAAQ,IAAI,aAAa;"}", + "sentry-cli-mock.json": "["releases","new","CURRENT_SHA"], + ["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], + ["releases","finalize","CURRENT_SHA"], + ["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"], + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/basic.config.ts b/packages/integration-tests-next/fixtures/vite4/basic.config.ts new file mode 100644 index 00000000..ec202ecb --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/basic.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/basic.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/basic", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/basic.test.ts b/packages/integration-tests-next/fixtures/vite4/basic.test.ts new file mode 100644 index 00000000..5b79abcf --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/basic.test.ts @@ -0,0 +1,29 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + "sentry-cli-mock.json": "["releases","new","CURRENT_SHA"], + ["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], + ["releases","finalize","CURRENT_SHA"], + ["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"], + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/build-info.config.ts b/packages/integration-tests-next/fixtures/vite4/build-info.config.ts new file mode 100644 index 00000000..3f4081fd --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/build-info.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/build-info.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/build-info", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/build-info.test.ts b/packages/integration-tests-next/fixtures/vite4/build-info.test.ts new file mode 100644 index 00000000..e185858a --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/build-info.test.ts @@ -0,0 +1,22 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "build-information-injection-test" }; + e.SENTRY_BUILD_INFO = { "deps": ["@sentry/vite-plugin", "@vitejs/plugin-react", "react", "vite"], "depsVersions": { "react": 19, "vite": 4 }, "nodeVersion":"NODE_VERSION" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/bundle-size-optimizations.config.ts b/packages/integration-tests-next/fixtures/vite4/bundle-size-optimizations.config.ts new file mode 100644 index 00000000..4feec9f2 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/bundle-size-optimizations.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/bundle-size-optimizations.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/bundle.js", + output: { + dir: "out/bundle-size-optimizations", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/bundle-size-optimizations.test.ts b/packages/integration-tests-next/fixtures/vite4/bundle-size-optimizations.test.ts new file mode 100644 index 00000000..a853e327 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/bundle-size-optimizations.test.ts @@ -0,0 +1,36 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "bundle.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9ba2eb17-5b67-4bb4-bfcf-dca3e3b993b4", e._sentryDebugIdIdentifier = "sentry-dbid-9ba2eb17-5b67-4bb4-bfcf-dca3e3b993b4"); + } catch (e2) { + } + })(); + console.log( + JSON.stringify({ + debug: "b", + trace: "b", + replayCanvas: "a", + replayIframe: "a", + replayShadowDom: "a", + replayWorker: "a" + }) + ); + ", + } + `); + + const output = runFileInNode("bundle.js"); + expect(output).toMatchInlineSnapshot(` + "{"debug":"b","trace":"b","replayCanvas":"a","replayIframe":"a","replayShadowDom":"a","replayWorker":"a"} + " + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/component-annotation-disabled.config.ts b/packages/integration-tests-next/fixtures/vite4/component-annotation-disabled.config.ts new file mode 100644 index 00000000..ae087808 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/component-annotation-disabled.config.ts @@ -0,0 +1,21 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/component-annotation-disabled.config.js"; +import react from "@vitejs/plugin-react"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + dir: "out/component-annotation-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [react({ jsxRuntime: "automatic" }), sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/component-annotation-disabled.test.ts b/packages/integration-tests-next/fixtures/vite4/component-annotation-disabled.test.ts new file mode 100644 index 00000000..3fdf123e --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/component-annotation-disabled.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "app.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5950dfde-7033-4e00-a69c-652e1b5bc157", e._sentryDebugIdIdentifier = "sentry-dbid-5950dfde-7033-4e00-a69c-652e1b5bc157"); + } catch (e2) { + } + })(); + import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; + function ComponentA() { + return /* @__PURE__ */ jsx("span", { children: "Component A" }); + } + function App() { + return /* @__PURE__ */ jsxs("span", { children: [ + /* @__PURE__ */ jsx(ComponentA, {}), + ";" + ] }); + } + console.log(App()); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/component-annotation-next.config.ts b/packages/integration-tests-next/fixtures/vite4/component-annotation-next.config.ts new file mode 100644 index 00000000..fee75871 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/component-annotation-next.config.ts @@ -0,0 +1,21 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/component-annotation-next.config.js"; +import react from "@vitejs/plugin-react"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + dir: "out/component-annotation-next", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [react({ jsxRuntime: "automatic" }), sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/component-annotation-next.test.ts b/packages/integration-tests-next/fixtures/vite4/component-annotation-next.test.ts new file mode 100644 index 00000000..4a616db3 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/component-annotation-next.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "app.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "62a0263b-dddb-4ac5-bb1a-a352edfa415c", e._sentryDebugIdIdentifier = "sentry-dbid-62a0263b-dddb-4ac5-bb1a-a352edfa415c"); + } catch (e2) { + } + })(); + import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; + function ComponentA() { + return /* @__PURE__ */ jsx("span", { "data-sentry-component": "ComponentA", children: "Component A" }); + } + function App() { + return /* @__PURE__ */ jsxs("span", { "data-sentry-component": "App", children: [ + /* @__PURE__ */ jsx(ComponentA, {}), + ";" + ] }); + } + console.log(App()); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/component-annotation.config.ts b/packages/integration-tests-next/fixtures/vite4/component-annotation.config.ts new file mode 100644 index 00000000..f51fcde8 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/component-annotation.config.ts @@ -0,0 +1,21 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/component-annotation.config.js"; +import react from "@vitejs/plugin-react"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + dir: "out/component-annotation", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [react(), sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/component-annotation.test.ts b/packages/integration-tests-next/fixtures/vite4/component-annotation.test.ts new file mode 100644 index 00000000..7f123f0b --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/component-annotation.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "app.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d2aba7de-9acd-4eaf-8153-269a881dd7a6", e._sentryDebugIdIdentifier = "sentry-dbid-d2aba7de-9acd-4eaf-8153-269a881dd7a6"); + } catch (e2) { + } + })(); + import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; + function ComponentA() { + return /* @__PURE__ */ jsx("span", { "data-sentry-component": "ComponentA", "data-sentry-source-file": "component-a.jsx", children: "Component A" }); + } + function App() { + return /* @__PURE__ */ jsxs("span", { "data-sentry-component": "App", "data-sentry-source-file": "app.jsx", children: [ + /* @__PURE__ */ jsx(ComponentA, { "data-sentry-element": "ComponentA", "data-sentry-source-file": "app.jsx" }), + ";" + ] }); + } + console.log(App()); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/debugid-disabled.config.ts b/packages/integration-tests-next/fixtures/vite4/debugid-disabled.config.ts new file mode 100644 index 00000000..c70b0407 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/debugid-disabled.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/debugid-disabled.config.js"; + +export default defineConfig({ + build: { + minify: false, + sourcemap: true, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/debugid-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/debugid-disabled.test.ts b/packages/integration-tests-next/fixtures/vite4/debugid-disabled.test.ts new file mode 100644 index 00000000..1c99d55f --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/debugid-disabled.test.ts @@ -0,0 +1,14 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "console.log("hello world"); + //# sourceMappingURL=basic.js.map + ", + "basic.js.map": "{"version":3,"file":"basic.js","sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"names":[],"mappings":"AACA,QAAQ,IAAI,aAAa;"}", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/module-metadata.config.ts b/packages/integration-tests-next/fixtures/vite4/module-metadata.config.ts new file mode 100644 index 00000000..b3612f98 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/module-metadata.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/module-metadata.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/module-metadata", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/module-metadata.test.ts b/packages/integration-tests-next/fixtures/vite4/module-metadata.test.ts new file mode 100644 index 00000000..66fb3b11 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/module-metadata.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + e._sentryModuleMetadata = e._sentryModuleMetadata || {}, e._sentryModuleMetadata[new e.Error().stack] = (function(e2) { + for (var n2 = 1; n2 < arguments.length; n2++) { + var a = arguments[n2]; + if (null != a) for (var t in a) a.hasOwnProperty(t) && (e2[t] = a[t]); + } + return e2; + })({}, e._sentryModuleMetadata[new e.Error().stack], { "something": "value", "another": 999 }); + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/multiple-entry-points.config.ts b/packages/integration-tests-next/fixtures/vite4/multiple-entry-points.config.ts new file mode 100644 index 00000000..ab300996 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/multiple-entry-points.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/multiple-entry-points.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: ["src/entry1.js", "src/entry2.js"], + output: { + dir: "out/multiple-entry-points", + chunkFileNames: "[name].js", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/multiple-entry-points.test.ts b/packages/integration-tests-next/fixtures/vite4/multiple-entry-points.test.ts new file mode 100644 index 00000000..0ea77c27 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/multiple-entry-points.test.ts @@ -0,0 +1,58 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "common.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d6522b10-3189-4ceb-b9e3-9764b0420211", e._sentryDebugIdIdentifier = "sentry-dbid-d6522b10-3189-4ceb-b9e3-9764b0420211"); + } catch (e2) { + } + })(); + function add(a, b) { + return a + b; + } + export { + add as a + }; + ", + "entry1.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "462efaa9-6efa-471b-94ae-88b2852f0c20", e._sentryDebugIdIdentifier = "sentry-dbid-462efaa9-6efa-471b-94ae-88b2852f0c20"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js"; + console.log(add(1, 2)); + ", + "entry2.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0231818d-9e30-4d5b-94a9-3da56ffd79af", e._sentryDebugIdIdentifier = "sentry-dbid-0231818d-9e30-4d5b-94a9-3da56ffd79af"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js"; + console.log(add(2, 4)); + ", + } + `); + + const output1 = runFileInNode("entry1.js"); + expect(output1).toMatchInlineSnapshot(` + "3 + " + `); + const output2 = runFileInNode("entry2.js"); + expect(output2).toMatchInlineSnapshot(` + "6 + " + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/package.json b/packages/integration-tests-next/fixtures/vite4/package.json new file mode 100644 index 00000000..d57b814e --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/package.json @@ -0,0 +1,23 @@ +{ + "name": "vite4-integration-tests", + "version": "1.0.0", + "private": true, + "type": "module", + "dependencies": { + "react": "19.2.4", + "vite": "4.5.14", + "@vitejs/plugin-react": "5.2.0", + "@sentry/vite-plugin": "5.1.1" + }, + "pnpm": { + "overrides": { + "@sentry/bundler-plugin-core": "file:../../../bundler-plugin-core/sentry-bundler-plugin-core-5.1.1.tgz", + "@sentry/rollup-plugin": "file:../../../rollup-plugin/sentry-rollup-plugin-5.1.1.tgz", + "@sentry/vite-plugin": "file:../../../vite-plugin/sentry-vite-plugin-5.1.1.tgz", + "@sentry/babel-plugin-component-annotate": "file:../../../babel-plugin-component-annotate/sentry-babel-plugin-component-annotate-5.1.1.tgz" + }, + "patchedDependencies": { + "@sentry/cli": "../patches/@sentry__cli.patch" + } + } +} diff --git a/packages/integration-tests-next/fixtures/vite4/query-param.config.ts b/packages/integration-tests-next/fixtures/vite4/query-param.config.ts new file mode 100644 index 00000000..7952c040 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/query-param.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/query-param.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: ["src/entry1.js", "src/entry2.js"], + output: { + dir: "out/query-param", + chunkFileNames: "[name].js?seP58q4g", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/query-param.test.ts b/packages/integration-tests-next/fixtures/vite4/query-param.test.ts new file mode 100644 index 00000000..b7def387 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/query-param.test.ts @@ -0,0 +1,55 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, ctx }) => { + if (process.platform === "win32") { + ctx.skip("Query params do not work in paths on Windows"); + return; + } + + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "common.js?seP58q4g": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d6522b10-3189-4ceb-b9e3-9764b0420211", e._sentryDebugIdIdentifier = "sentry-dbid-d6522b10-3189-4ceb-b9e3-9764b0420211"); + } catch (e2) { + } + })(); + function add(a, b) { + return a + b; + } + export { + add as a + }; + ", + "entry1.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "161db429-4399-479c-9466-6ff8ad3344f9", e._sentryDebugIdIdentifier = "sentry-dbid-161db429-4399-479c-9466-6ff8ad3344f9"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js?seP58q4g"; + console.log(add(1, 2)); + ", + "entry2.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a3bc51c0-20dc-4a52-a69a-6a43acf7cd65", e._sentryDebugIdIdentifier = "sentry-dbid-a3bc51c0-20dc-4a52-a69a-6a43acf7cd65"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js?seP58q4g"; + console.log(add(2, 4)); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/release-disabled.config.ts b/packages/integration-tests-next/fixtures/vite4/release-disabled.config.ts new file mode 100644 index 00000000..cb5c4c06 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/release-disabled.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/release-disabled.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/release-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/release-disabled.test.ts b/packages/integration-tests-next/fixtures/vite4/release-disabled.test.ts new file mode 100644 index 00000000..82038026 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/release-disabled.test.ts @@ -0,0 +1,25 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + "sentry-cli-mock.json": "["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], + ["releases","finalize","CURRENT_SHA"], + ["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"], + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/src/app.jsx b/packages/integration-tests-next/fixtures/vite4/src/app.jsx new file mode 100644 index 00000000..5be821b4 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/src/app.jsx @@ -0,0 +1,11 @@ +import { ComponentA } from "./component-a"; + +export default function App() { + return ( + + ; + + ); +} + +console.log(App()); diff --git a/packages/integration-tests-next/fixtures/vite4/src/basic.js b/packages/integration-tests-next/fixtures/vite4/src/basic.js new file mode 100644 index 00000000..7ef02afb --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/src/basic.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line no-console +console.log("hello world"); diff --git a/packages/integration-tests-next/fixtures/vite4/src/bundle.js b/packages/integration-tests-next/fixtures/vite4/src/bundle.js new file mode 100644 index 00000000..0d62e559 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/src/bundle.js @@ -0,0 +1,10 @@ +console.log( + JSON.stringify({ + debug: __SENTRY_DEBUG__ ? "a" : "b", + trace: __SENTRY_TRACING__ ? "a" : "b", + replayCanvas: __RRWEB_EXCLUDE_CANVAS__ ? "a" : "b", + replayIframe: __RRWEB_EXCLUDE_IFRAME__ ? "a" : "b", + replayShadowDom: __RRWEB_EXCLUDE_SHADOW_DOM__ ? "a" : "b", + replayWorker: __SENTRY_EXCLUDE_REPLAY_WORKER__ ? "a" : "b", + }) +); diff --git a/packages/integration-tests-next/fixtures/vite4/src/common.js b/packages/integration-tests-next/fixtures/vite4/src/common.js new file mode 100644 index 00000000..7d658310 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/src/common.js @@ -0,0 +1,3 @@ +export function add(a, b) { + return a + b; +} diff --git a/packages/integration-tests-next/fixtures/vite4/src/component-a.jsx b/packages/integration-tests-next/fixtures/vite4/src/component-a.jsx new file mode 100644 index 00000000..5d57ab22 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/src/component-a.jsx @@ -0,0 +1,3 @@ +export function ComponentA() { + return Component A; +} diff --git a/packages/integration-tests-next/fixtures/vite4/src/entry1.js b/packages/integration-tests-next/fixtures/vite4/src/entry1.js new file mode 100644 index 00000000..48081666 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/src/entry1.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(1, 2)); diff --git a/packages/integration-tests-next/fixtures/vite4/src/entry2.js b/packages/integration-tests-next/fixtures/vite4/src/entry2.js new file mode 100644 index 00000000..f64af1ea --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/src/entry2.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(2, 4)); diff --git a/packages/integration-tests-next/fixtures/vite4/telemetry.config.ts b/packages/integration-tests-next/fixtures/vite4/telemetry.config.ts new file mode 100644 index 00000000..c02f3a57 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/telemetry.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/telemetry.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/telemetry", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite4/telemetry.test.ts b/packages/integration-tests-next/fixtures/vite4/telemetry.test.ts new file mode 100644 index 00000000..f02b90e0 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/telemetry.test.ts @@ -0,0 +1,26 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"8.30.0"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite4/utils.ts b/packages/integration-tests-next/fixtures/vite4/utils.ts new file mode 100644 index 00000000..89f7a2a6 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite4/utils.ts @@ -0,0 +1,56 @@ +import { basename, dirname, join } from "node:path"; +import { createTempDir, readAllFiles, runBundler } from "../utils"; +import { fileURLToPath } from "node:url"; +import { rmSync } from "node:fs"; +import { TestContext, test as vitestTest } from "vitest"; +import { execSync } from "node:child_process"; + +const cwd = dirname(fileURLToPath(import.meta.url)); + +type TestCallback = (props: { + outDir: string; + runBundler: (env?: Record) => void; + readOutputFiles: () => Record; + runFileInNode: (file: string) => string; + createTempDir: () => string; + ctx: TestContext; +}) => void | Promise; + +export function test(url: string, callback: TestCallback) { + const filePath = fileURLToPath(url); + const filename = basename(filePath); + const testName = filename.replace(/\.test\.ts$/, ""); + const outDir = join(cwd, "out", testName); + + // Clear the output directory before running the test + rmSync(outDir, { recursive: true, force: true }); + + vitestTest(`Vite v4 > ${testName}`, (ctx) => + callback({ + outDir, + runBundler: (env) => + runBundler( + `vite build --config ${testName}.config.ts`, + { + cwd, + env: { + ...process.env, + ...env, + NODE_ENV: "production", + }, + }, + outDir + ), + readOutputFiles: () => readAllFiles(outDir), + runFileInNode: (file) => { + const fullPath = join(outDir, file); + return execSync(`node ${fullPath}`, { + cwd, + env: { ...process.env, NO_COLOR: "1", FORCE_COLOR: "0" }, + }).toString(); + }, + createTempDir: () => createTempDir(), + ctx, + }) + ); +} diff --git a/packages/integration-tests-next/fixtures/vite7/after-upload-deletion.config.ts b/packages/integration-tests-next/fixtures/vite7/after-upload-deletion.config.ts new file mode 100644 index 00000000..674c7e70 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/after-upload-deletion.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/after-upload-deletion.config.js"; + +export default defineConfig({ + build: { + minify: false, + sourcemap: true, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/after-upload-deletion", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/after-upload-deletion.test.ts b/packages/integration-tests-next/fixtures/vite7/after-upload-deletion.test.ts new file mode 100644 index 00000000..ced3602e --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/after-upload-deletion.test.ts @@ -0,0 +1,25 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + //# sourceMappingURL=basic.js.map + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/application-key.config.ts b/packages/integration-tests-next/fixtures/vite7/application-key.config.ts new file mode 100644 index 00000000..ee524c7f --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/application-key.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/application-key.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/application-key", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/application-key.test.ts b/packages/integration-tests-next/fixtures/vite7/application-key.test.ts new file mode 100644 index 00000000..902f8657 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/application-key.test.ts @@ -0,0 +1,28 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + e._sentryModuleMetadata = e._sentryModuleMetadata || {}, e._sentryModuleMetadata[new e.Error().stack] = (function(e2) { + for (var n2 = 1; n2 < arguments.length; n2++) { + var a = arguments[n2]; + if (null != a) for (var t in a) a.hasOwnProperty(t) && (e2[t] = a[t]); + } + return e2; + })({}, e._sentryModuleMetadata[new e.Error().stack], { "_sentryBundlerPluginAppKey:1234567890abcdef": true }); + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/basic-release-disabled.config.ts b/packages/integration-tests-next/fixtures/vite7/basic-release-disabled.config.ts new file mode 100644 index 00000000..86242118 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/basic-release-disabled.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/basic-release-disabled.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/basic-release-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/basic-release-disabled.test.ts b/packages/integration-tests-next/fixtures/vite7/basic-release-disabled.test.ts new file mode 100644 index 00000000..eb87a858 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/basic-release-disabled.test.ts @@ -0,0 +1,20 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/vite7/basic-sourcemaps.config.ts new file mode 100644 index 00000000..312b7da1 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/basic-sourcemaps.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/basic-sourcemaps.config.js"; + +export default defineConfig({ + build: { + minify: false, + sourcemap: true, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/basic-sourcemaps", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/basic-sourcemaps.test.ts b/packages/integration-tests-next/fixtures/vite7/basic-sourcemaps.test.ts new file mode 100644 index 00000000..d99bd4e6 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/basic-sourcemaps.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + //# sourceMappingURL=basic.js.map + ", + "basic.js.map": "{"version":3,"file":"basic.js","sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"names":[],"mappings":";;;;;;;;;AACA,QAAQ,IAAI,aAAa;"}", + "sentry-cli-mock.json": "["releases","new","CURRENT_SHA"], + ["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], + ["releases","finalize","CURRENT_SHA"], + ["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"], + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/basic.config.ts b/packages/integration-tests-next/fixtures/vite7/basic.config.ts new file mode 100644 index 00000000..ec202ecb --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/basic.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/basic.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/basic", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/basic.test.ts b/packages/integration-tests-next/fixtures/vite7/basic.test.ts new file mode 100644 index 00000000..5b79abcf --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/basic.test.ts @@ -0,0 +1,29 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + "sentry-cli-mock.json": "["releases","new","CURRENT_SHA"], + ["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], + ["releases","finalize","CURRENT_SHA"], + ["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"], + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/build-info.config.ts b/packages/integration-tests-next/fixtures/vite7/build-info.config.ts new file mode 100644 index 00000000..3f4081fd --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/build-info.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/build-info.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/build-info", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/build-info.test.ts b/packages/integration-tests-next/fixtures/vite7/build-info.test.ts new file mode 100644 index 00000000..86290fae --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/build-info.test.ts @@ -0,0 +1,22 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "build-information-injection-test" }; + e.SENTRY_BUILD_INFO = { "deps": ["@sentry/vite-plugin", "@vitejs/plugin-react", "react", "vite"], "depsVersions": { "react": 19, "vite": 7 }, "nodeVersion":"NODE_VERSION" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/bundle-size-optimizations.config.ts b/packages/integration-tests-next/fixtures/vite7/bundle-size-optimizations.config.ts new file mode 100644 index 00000000..4feec9f2 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/bundle-size-optimizations.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/bundle-size-optimizations.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/bundle.js", + output: { + dir: "out/bundle-size-optimizations", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/bundle-size-optimizations.test.ts b/packages/integration-tests-next/fixtures/vite7/bundle-size-optimizations.test.ts new file mode 100644 index 00000000..a853e327 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/bundle-size-optimizations.test.ts @@ -0,0 +1,36 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "bundle.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9ba2eb17-5b67-4bb4-bfcf-dca3e3b993b4", e._sentryDebugIdIdentifier = "sentry-dbid-9ba2eb17-5b67-4bb4-bfcf-dca3e3b993b4"); + } catch (e2) { + } + })(); + console.log( + JSON.stringify({ + debug: "b", + trace: "b", + replayCanvas: "a", + replayIframe: "a", + replayShadowDom: "a", + replayWorker: "a" + }) + ); + ", + } + `); + + const output = runFileInNode("bundle.js"); + expect(output).toMatchInlineSnapshot(` + "{"debug":"b","trace":"b","replayCanvas":"a","replayIframe":"a","replayShadowDom":"a","replayWorker":"a"} + " + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/component-annotation-disabled.config.ts b/packages/integration-tests-next/fixtures/vite7/component-annotation-disabled.config.ts new file mode 100644 index 00000000..ae087808 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/component-annotation-disabled.config.ts @@ -0,0 +1,21 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/component-annotation-disabled.config.js"; +import react from "@vitejs/plugin-react"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + dir: "out/component-annotation-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [react({ jsxRuntime: "automatic" }), sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/component-annotation-disabled.test.ts b/packages/integration-tests-next/fixtures/vite7/component-annotation-disabled.test.ts new file mode 100644 index 00000000..3fdf123e --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/component-annotation-disabled.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "app.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5950dfde-7033-4e00-a69c-652e1b5bc157", e._sentryDebugIdIdentifier = "sentry-dbid-5950dfde-7033-4e00-a69c-652e1b5bc157"); + } catch (e2) { + } + })(); + import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; + function ComponentA() { + return /* @__PURE__ */ jsx("span", { children: "Component A" }); + } + function App() { + return /* @__PURE__ */ jsxs("span", { children: [ + /* @__PURE__ */ jsx(ComponentA, {}), + ";" + ] }); + } + console.log(App()); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/component-annotation-next.config.ts b/packages/integration-tests-next/fixtures/vite7/component-annotation-next.config.ts new file mode 100644 index 00000000..fee75871 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/component-annotation-next.config.ts @@ -0,0 +1,21 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/component-annotation-next.config.js"; +import react from "@vitejs/plugin-react"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + dir: "out/component-annotation-next", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [react({ jsxRuntime: "automatic" }), sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/component-annotation-next.test.ts b/packages/integration-tests-next/fixtures/vite7/component-annotation-next.test.ts new file mode 100644 index 00000000..4a616db3 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/component-annotation-next.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "app.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "62a0263b-dddb-4ac5-bb1a-a352edfa415c", e._sentryDebugIdIdentifier = "sentry-dbid-62a0263b-dddb-4ac5-bb1a-a352edfa415c"); + } catch (e2) { + } + })(); + import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; + function ComponentA() { + return /* @__PURE__ */ jsx("span", { "data-sentry-component": "ComponentA", children: "Component A" }); + } + function App() { + return /* @__PURE__ */ jsxs("span", { "data-sentry-component": "App", children: [ + /* @__PURE__ */ jsx(ComponentA, {}), + ";" + ] }); + } + console.log(App()); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/component-annotation.config.ts b/packages/integration-tests-next/fixtures/vite7/component-annotation.config.ts new file mode 100644 index 00000000..f51fcde8 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/component-annotation.config.ts @@ -0,0 +1,21 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/component-annotation.config.js"; +import react from "@vitejs/plugin-react"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + dir: "out/component-annotation", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [react(), sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/component-annotation.test.ts b/packages/integration-tests-next/fixtures/vite7/component-annotation.test.ts new file mode 100644 index 00000000..7f123f0b --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/component-annotation.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "app.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d2aba7de-9acd-4eaf-8153-269a881dd7a6", e._sentryDebugIdIdentifier = "sentry-dbid-d2aba7de-9acd-4eaf-8153-269a881dd7a6"); + } catch (e2) { + } + })(); + import { jsx, jsxs } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"; + function ComponentA() { + return /* @__PURE__ */ jsx("span", { "data-sentry-component": "ComponentA", "data-sentry-source-file": "component-a.jsx", children: "Component A" }); + } + function App() { + return /* @__PURE__ */ jsxs("span", { "data-sentry-component": "App", "data-sentry-source-file": "app.jsx", children: [ + /* @__PURE__ */ jsx(ComponentA, { "data-sentry-element": "ComponentA", "data-sentry-source-file": "app.jsx" }), + ";" + ] }); + } + console.log(App()); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/debugid-disabled.config.ts b/packages/integration-tests-next/fixtures/vite7/debugid-disabled.config.ts new file mode 100644 index 00000000..c70b0407 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/debugid-disabled.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/debugid-disabled.config.js"; + +export default defineConfig({ + build: { + minify: false, + sourcemap: true, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/debugid-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/debugid-disabled.test.ts b/packages/integration-tests-next/fixtures/vite7/debugid-disabled.test.ts new file mode 100644 index 00000000..1c99d55f --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/debugid-disabled.test.ts @@ -0,0 +1,14 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "console.log("hello world"); + //# sourceMappingURL=basic.js.map + ", + "basic.js.map": "{"version":3,"file":"basic.js","sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"names":[],"mappings":"AACA,QAAQ,IAAI,aAAa;"}", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/debugids-already-injected.config.ts b/packages/integration-tests-next/fixtures/vite7/debugids-already-injected.config.ts new file mode 100644 index 00000000..f3dfcb91 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/debugids-already-injected.config.ts @@ -0,0 +1,19 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/debugids-already-injected.config.js"; + +export default defineConfig({ + build: { + minify: false, + sourcemap: true, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/debugids-already-injected", + entryFileNames: "[name].js", + sourcemapDebugIds: true, + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/debugids-already-injected.test.ts b/packages/integration-tests-next/fixtures/vite7/debugids-already-injected.test.ts new file mode 100644 index 00000000..5735e771 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/debugids-already-injected.test.ts @@ -0,0 +1,28 @@ +import { expect } from "vitest"; +import { readAllFiles } from "../utils"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, createTempDir }) => { + const tempDir = createTempDir(); + + runBundler({ SENTRY_TEST_OVERRIDE_TEMP_DIR: tempDir }); + const files = readAllFiles(tempDir); + expect(files).toMatchInlineSnapshot(` + { + "252e0338-8927-4f52-bd57-188131defd0f-0.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + //# debugId=252e0338-8927-4f52-bd57-188131defd0f + //# sourceMappingURL=basic.js.map + ", + "252e0338-8927-4f52-bd57-188131defd0f-0.js.map": "{"version":3,"file":"basic.js","sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"names":[],"mappings":";;;;;;;;;AACA,QAAQ,IAAI,aAAa;","debugId":"252e0338-8927-4f52-bd57-188131defd0f","debug_id":"252e0338-8927-4f52-bd57-188131defd0f"}", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/module-metadata.config.ts b/packages/integration-tests-next/fixtures/vite7/module-metadata.config.ts new file mode 100644 index 00000000..b3612f98 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/module-metadata.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/module-metadata.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/module-metadata", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/module-metadata.test.ts b/packages/integration-tests-next/fixtures/vite7/module-metadata.test.ts new file mode 100644 index 00000000..66fb3b11 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/module-metadata.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + e._sentryModuleMetadata = e._sentryModuleMetadata || {}, e._sentryModuleMetadata[new e.Error().stack] = (function(e2) { + for (var n2 = 1; n2 < arguments.length; n2++) { + var a = arguments[n2]; + if (null != a) for (var t in a) a.hasOwnProperty(t) && (e2[t] = a[t]); + } + return e2; + })({}, e._sentryModuleMetadata[new e.Error().stack], { "something": "value", "another": 999 }); + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/multiple-entry-points.config.ts b/packages/integration-tests-next/fixtures/vite7/multiple-entry-points.config.ts new file mode 100644 index 00000000..ab300996 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/multiple-entry-points.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/multiple-entry-points.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: ["src/entry1.js", "src/entry2.js"], + output: { + dir: "out/multiple-entry-points", + chunkFileNames: "[name].js", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/multiple-entry-points.test.ts b/packages/integration-tests-next/fixtures/vite7/multiple-entry-points.test.ts new file mode 100644 index 00000000..0ea77c27 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/multiple-entry-points.test.ts @@ -0,0 +1,58 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "common.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d6522b10-3189-4ceb-b9e3-9764b0420211", e._sentryDebugIdIdentifier = "sentry-dbid-d6522b10-3189-4ceb-b9e3-9764b0420211"); + } catch (e2) { + } + })(); + function add(a, b) { + return a + b; + } + export { + add as a + }; + ", + "entry1.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "462efaa9-6efa-471b-94ae-88b2852f0c20", e._sentryDebugIdIdentifier = "sentry-dbid-462efaa9-6efa-471b-94ae-88b2852f0c20"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js"; + console.log(add(1, 2)); + ", + "entry2.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0231818d-9e30-4d5b-94a9-3da56ffd79af", e._sentryDebugIdIdentifier = "sentry-dbid-0231818d-9e30-4d5b-94a9-3da56ffd79af"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js"; + console.log(add(2, 4)); + ", + } + `); + + const output1 = runFileInNode("entry1.js"); + expect(output1).toMatchInlineSnapshot(` + "3 + " + `); + const output2 = runFileInNode("entry2.js"); + expect(output2).toMatchInlineSnapshot(` + "6 + " + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/package.json b/packages/integration-tests-next/fixtures/vite7/package.json new file mode 100644 index 00000000..2ff628aa --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/package.json @@ -0,0 +1,23 @@ +{ + "name": "vite7-integration-tests", + "version": "1.0.0", + "private": true, + "type": "module", + "dependencies": { + "react": "19.2.4", + "vite": "7.3.1", + "@vitejs/plugin-react": "5.2.0", + "@sentry/vite-plugin": "5.1.1" + }, + "pnpm": { + "overrides": { + "@sentry/bundler-plugin-core": "file:../../../bundler-plugin-core/sentry-bundler-plugin-core-5.1.1.tgz", + "@sentry/rollup-plugin": "file:../../../rollup-plugin/sentry-rollup-plugin-5.1.1.tgz", + "@sentry/vite-plugin": "file:../../../vite-plugin/sentry-vite-plugin-5.1.1.tgz", + "@sentry/babel-plugin-component-annotate": "file:../../../babel-plugin-component-annotate/sentry-babel-plugin-component-annotate-5.1.1.tgz" + }, + "patchedDependencies": { + "@sentry/cli": "../patches/@sentry__cli.patch" + } + } +} diff --git a/packages/integration-tests-next/fixtures/vite7/query-param.config.ts b/packages/integration-tests-next/fixtures/vite7/query-param.config.ts new file mode 100644 index 00000000..7952c040 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/query-param.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/query-param.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: ["src/entry1.js", "src/entry2.js"], + output: { + dir: "out/query-param", + chunkFileNames: "[name].js?seP58q4g", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/query-param.test.ts b/packages/integration-tests-next/fixtures/vite7/query-param.test.ts new file mode 100644 index 00000000..b7def387 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/query-param.test.ts @@ -0,0 +1,55 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, ctx }) => { + if (process.platform === "win32") { + ctx.skip("Query params do not work in paths on Windows"); + return; + } + + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "common.js?seP58q4g": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d6522b10-3189-4ceb-b9e3-9764b0420211", e._sentryDebugIdIdentifier = "sentry-dbid-d6522b10-3189-4ceb-b9e3-9764b0420211"); + } catch (e2) { + } + })(); + function add(a, b) { + return a + b; + } + export { + add as a + }; + ", + "entry1.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "161db429-4399-479c-9466-6ff8ad3344f9", e._sentryDebugIdIdentifier = "sentry-dbid-161db429-4399-479c-9466-6ff8ad3344f9"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js?seP58q4g"; + console.log(add(1, 2)); + ", + "entry2.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a3bc51c0-20dc-4a52-a69a-6a43acf7cd65", e._sentryDebugIdIdentifier = "sentry-dbid-a3bc51c0-20dc-4a52-a69a-6a43acf7cd65"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js?seP58q4g"; + console.log(add(2, 4)); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/release-disabled.config.ts b/packages/integration-tests-next/fixtures/vite7/release-disabled.config.ts new file mode 100644 index 00000000..cb5c4c06 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/release-disabled.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/release-disabled.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/release-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/release-disabled.test.ts b/packages/integration-tests-next/fixtures/vite7/release-disabled.test.ts new file mode 100644 index 00000000..82038026 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/release-disabled.test.ts @@ -0,0 +1,25 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + "sentry-cli-mock.json": "["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], + ["releases","finalize","CURRENT_SHA"], + ["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"], + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/src/app.jsx b/packages/integration-tests-next/fixtures/vite7/src/app.jsx new file mode 100644 index 00000000..5be821b4 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/src/app.jsx @@ -0,0 +1,11 @@ +import { ComponentA } from "./component-a"; + +export default function App() { + return ( + + ; + + ); +} + +console.log(App()); diff --git a/packages/integration-tests-next/fixtures/vite7/src/basic.js b/packages/integration-tests-next/fixtures/vite7/src/basic.js new file mode 100644 index 00000000..7ef02afb --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/src/basic.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line no-console +console.log("hello world"); diff --git a/packages/integration-tests-next/fixtures/vite7/src/bundle.js b/packages/integration-tests-next/fixtures/vite7/src/bundle.js new file mode 100644 index 00000000..0d62e559 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/src/bundle.js @@ -0,0 +1,10 @@ +console.log( + JSON.stringify({ + debug: __SENTRY_DEBUG__ ? "a" : "b", + trace: __SENTRY_TRACING__ ? "a" : "b", + replayCanvas: __RRWEB_EXCLUDE_CANVAS__ ? "a" : "b", + replayIframe: __RRWEB_EXCLUDE_IFRAME__ ? "a" : "b", + replayShadowDom: __RRWEB_EXCLUDE_SHADOW_DOM__ ? "a" : "b", + replayWorker: __SENTRY_EXCLUDE_REPLAY_WORKER__ ? "a" : "b", + }) +); diff --git a/packages/integration-tests-next/fixtures/vite7/src/common.js b/packages/integration-tests-next/fixtures/vite7/src/common.js new file mode 100644 index 00000000..7d658310 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/src/common.js @@ -0,0 +1,3 @@ +export function add(a, b) { + return a + b; +} diff --git a/packages/integration-tests-next/fixtures/vite7/src/component-a.jsx b/packages/integration-tests-next/fixtures/vite7/src/component-a.jsx new file mode 100644 index 00000000..5d57ab22 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/src/component-a.jsx @@ -0,0 +1,3 @@ +export function ComponentA() { + return Component A; +} diff --git a/packages/integration-tests-next/fixtures/vite7/src/entry1.js b/packages/integration-tests-next/fixtures/vite7/src/entry1.js new file mode 100644 index 00000000..48081666 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/src/entry1.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(1, 2)); diff --git a/packages/integration-tests-next/fixtures/vite7/src/entry2.js b/packages/integration-tests-next/fixtures/vite7/src/entry2.js new file mode 100644 index 00000000..f64af1ea --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/src/entry2.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(2, 4)); diff --git a/packages/integration-tests-next/fixtures/vite7/telemetry.config.ts b/packages/integration-tests-next/fixtures/vite7/telemetry.config.ts new file mode 100644 index 00000000..c02f3a57 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/telemetry.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/telemetry.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/telemetry", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite7/telemetry.test.ts b/packages/integration-tests-next/fixtures/vite7/telemetry.test.ts new file mode 100644 index 00000000..f02b90e0 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/telemetry.test.ts @@ -0,0 +1,26 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"8.30.0"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite7/utils.ts b/packages/integration-tests-next/fixtures/vite7/utils.ts new file mode 100644 index 00000000..0990f400 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite7/utils.ts @@ -0,0 +1,63 @@ +import { basename, dirname, join } from "node:path"; +import { createTempDir, readAllFiles, runBundler } from "../utils"; +import { fileURLToPath } from "node:url"; +import { rmSync } from "node:fs"; +import { TestContext, test as vitestTest } from "vitest"; +import { execSync } from "node:child_process"; + +const cwd = dirname(fileURLToPath(import.meta.url)); +const NODE_MAJOR_VERSION = parseInt(process.versions.node.split(".")[0] || "0", 10); + +type TestCallback = (props: { + outDir: string; + runBundler: (env?: Record) => void; + readOutputFiles: () => Record; + runFileInNode: (file: string) => string; + createTempDir: () => string; + ctx: TestContext; +}) => void | Promise; + +export function test(url: string, callback: TestCallback) { + const filePath = fileURLToPath(url); + const filename = basename(filePath); + const testName = filename.replace(/\.test\.ts$/, ""); + const outDir = join(cwd, "out", testName); + + // Clear the output directory before running the test + rmSync(outDir, { recursive: true, force: true }); + + // Vite v7 requires Node 20+ + if (NODE_MAJOR_VERSION < 20) { + // eslint-disable-next-line @typescript-eslint/no-empty-function + vitestTest.skip(testName); + } else { + vitestTest(`Vite v7 > ${testName}`, (ctx) => + callback({ + outDir, + runBundler: (env) => + runBundler( + `vite build --config ${testName}.config.ts`, + { + cwd, + env: { + ...process.env, + ...env, + NODE_ENV: "production", + }, + }, + outDir + ), + readOutputFiles: () => readAllFiles(outDir), + runFileInNode: (file) => { + const fullPath = join(outDir, file); + return execSync(`node ${fullPath}`, { + cwd, + env: { ...process.env, NO_COLOR: "1", FORCE_COLOR: "0" }, + }).toString(); + }, + createTempDir: () => createTempDir(), + ctx, + }) + ); + } +} diff --git a/packages/integration-tests-next/fixtures/vite8/after-upload-deletion.config.ts b/packages/integration-tests-next/fixtures/vite8/after-upload-deletion.config.ts new file mode 100644 index 00000000..674c7e70 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/after-upload-deletion.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/after-upload-deletion.config.js"; + +export default defineConfig({ + build: { + minify: false, + sourcemap: true, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/after-upload-deletion", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/after-upload-deletion.test.ts b/packages/integration-tests-next/fixtures/vite8/after-upload-deletion.test.ts new file mode 100644 index 00000000..ced3602e --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/after-upload-deletion.test.ts @@ -0,0 +1,25 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + //# sourceMappingURL=basic.js.map + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/application-key.config.ts b/packages/integration-tests-next/fixtures/vite8/application-key.config.ts new file mode 100644 index 00000000..ee524c7f --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/application-key.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/application-key.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/application-key", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/application-key.test.ts b/packages/integration-tests-next/fixtures/vite8/application-key.test.ts new file mode 100644 index 00000000..902f8657 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/application-key.test.ts @@ -0,0 +1,28 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + e._sentryModuleMetadata = e._sentryModuleMetadata || {}, e._sentryModuleMetadata[new e.Error().stack] = (function(e2) { + for (var n2 = 1; n2 < arguments.length; n2++) { + var a = arguments[n2]; + if (null != a) for (var t in a) a.hasOwnProperty(t) && (e2[t] = a[t]); + } + return e2; + })({}, e._sentryModuleMetadata[new e.Error().stack], { "_sentryBundlerPluginAppKey:1234567890abcdef": true }); + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/basic-release-disabled.config.ts b/packages/integration-tests-next/fixtures/vite8/basic-release-disabled.config.ts new file mode 100644 index 00000000..86242118 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/basic-release-disabled.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/basic-release-disabled.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/basic-release-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/basic-release-disabled.test.ts b/packages/integration-tests-next/fixtures/vite8/basic-release-disabled.test.ts new file mode 100644 index 00000000..eb87a858 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/basic-release-disabled.test.ts @@ -0,0 +1,20 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/vite8/basic-sourcemaps.config.ts new file mode 100644 index 00000000..312b7da1 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/basic-sourcemaps.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/basic-sourcemaps.config.js"; + +export default defineConfig({ + build: { + minify: false, + sourcemap: true, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/basic-sourcemaps", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/basic-sourcemaps.test.ts b/packages/integration-tests-next/fixtures/vite8/basic-sourcemaps.test.ts new file mode 100644 index 00000000..d99bd4e6 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/basic-sourcemaps.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + //# sourceMappingURL=basic.js.map + ", + "basic.js.map": "{"version":3,"file":"basic.js","sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"names":[],"mappings":";;;;;;;;;AACA,QAAQ,IAAI,aAAa;"}", + "sentry-cli-mock.json": "["releases","new","CURRENT_SHA"], + ["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], + ["releases","finalize","CURRENT_SHA"], + ["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"], + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/basic.config.ts b/packages/integration-tests-next/fixtures/vite8/basic.config.ts new file mode 100644 index 00000000..ec202ecb --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/basic.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/basic.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/basic", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/basic.test.ts b/packages/integration-tests-next/fixtures/vite8/basic.test.ts new file mode 100644 index 00000000..5b79abcf --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/basic.test.ts @@ -0,0 +1,29 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + "sentry-cli-mock.json": "["releases","new","CURRENT_SHA"], + ["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], + ["releases","finalize","CURRENT_SHA"], + ["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"], + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/build-info.config.ts b/packages/integration-tests-next/fixtures/vite8/build-info.config.ts new file mode 100644 index 00000000..3f4081fd --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/build-info.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/build-info.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/build-info", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/build-info.test.ts b/packages/integration-tests-next/fixtures/vite8/build-info.test.ts new file mode 100644 index 00000000..f4715d4c --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/build-info.test.ts @@ -0,0 +1,22 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "build-information-injection-test" }; + e.SENTRY_BUILD_INFO = { "deps": ["@sentry/vite-plugin", "@vitejs/plugin-react", "react", "vite"], "depsVersions": { "react": 19, "vite": 8 }, "nodeVersion":"NODE_VERSION" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/bundle-size-optimizations.config.ts b/packages/integration-tests-next/fixtures/vite8/bundle-size-optimizations.config.ts new file mode 100644 index 00000000..4feec9f2 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/bundle-size-optimizations.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/bundle-size-optimizations.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/bundle.js", + output: { + dir: "out/bundle-size-optimizations", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/bundle-size-optimizations.test.ts b/packages/integration-tests-next/fixtures/vite8/bundle-size-optimizations.test.ts new file mode 100644 index 00000000..a853e327 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/bundle-size-optimizations.test.ts @@ -0,0 +1,36 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "bundle.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9ba2eb17-5b67-4bb4-bfcf-dca3e3b993b4", e._sentryDebugIdIdentifier = "sentry-dbid-9ba2eb17-5b67-4bb4-bfcf-dca3e3b993b4"); + } catch (e2) { + } + })(); + console.log( + JSON.stringify({ + debug: "b", + trace: "b", + replayCanvas: "a", + replayIframe: "a", + replayShadowDom: "a", + replayWorker: "a" + }) + ); + ", + } + `); + + const output = runFileInNode("bundle.js"); + expect(output).toMatchInlineSnapshot(` + "{"debug":"b","trace":"b","replayCanvas":"a","replayIframe":"a","replayShadowDom":"a","replayWorker":"a"} + " + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/component-annotation-disabled.config.ts b/packages/integration-tests-next/fixtures/vite8/component-annotation-disabled.config.ts new file mode 100644 index 00000000..ae087808 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/component-annotation-disabled.config.ts @@ -0,0 +1,21 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/component-annotation-disabled.config.js"; +import react from "@vitejs/plugin-react"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + dir: "out/component-annotation-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [react({ jsxRuntime: "automatic" }), sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/component-annotation-disabled.test.ts b/packages/integration-tests-next/fixtures/vite8/component-annotation-disabled.test.ts new file mode 100644 index 00000000..6087e1fc --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/component-annotation-disabled.test.ts @@ -0,0 +1,27 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "app.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "fad021a7-2309-4b95-9454-c14eaca9c494", e._sentryDebugIdIdentifier = "sentry-dbid-fad021a7-2309-4b95-9454-c14eaca9c494"); + } catch (e2) { + } + })(); + function ComponentA() { + return /* @__PURE__ */ React.createElement("span", null, "Component A"); + } + function App() { + return /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(ComponentA, null), ";"); + } + console.log(App()); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/component-annotation-next.config.ts b/packages/integration-tests-next/fixtures/vite8/component-annotation-next.config.ts new file mode 100644 index 00000000..fee75871 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/component-annotation-next.config.ts @@ -0,0 +1,21 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/component-annotation-next.config.js"; +import react from "@vitejs/plugin-react"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + dir: "out/component-annotation-next", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [react({ jsxRuntime: "automatic" }), sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/component-annotation-next.test.ts b/packages/integration-tests-next/fixtures/vite8/component-annotation-next.test.ts new file mode 100644 index 00000000..15a8de42 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/component-annotation-next.test.ts @@ -0,0 +1,27 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "app.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "e360fd0a-f174-42e5-a616-ca20792b40f7", e._sentryDebugIdIdentifier = "sentry-dbid-e360fd0a-f174-42e5-a616-ca20792b40f7"); + } catch (e2) { + } + })(); + function ComponentA() { + return /* @__PURE__ */ React.createElement("span", { "data-sentry-component": "ComponentA" }, "Component A"); + } + function App() { + return /* @__PURE__ */ React.createElement("span", { "data-sentry-component": "App" }, /* @__PURE__ */ React.createElement(ComponentA, null), ";"); + } + console.log(App()); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/component-annotation.config.ts b/packages/integration-tests-next/fixtures/vite8/component-annotation.config.ts new file mode 100644 index 00000000..f51fcde8 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/component-annotation.config.ts @@ -0,0 +1,21 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/component-annotation.config.js"; +import react from "@vitejs/plugin-react"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + dir: "out/component-annotation", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [react(), sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/component-annotation.test.ts b/packages/integration-tests-next/fixtures/vite8/component-annotation.test.ts new file mode 100644 index 00000000..c059336c --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/component-annotation.test.ts @@ -0,0 +1,27 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "app.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "7cf1a3cd-d2df-426b-8527-27fd153bf757", e._sentryDebugIdIdentifier = "sentry-dbid-7cf1a3cd-d2df-426b-8527-27fd153bf757"); + } catch (e2) { + } + })(); + function ComponentA() { + return /* @__PURE__ */ React.createElement("span", { "data-sentry-component": "ComponentA", "data-sentry-source-file": "component-a.jsx" }, "Component A"); + } + function App() { + return /* @__PURE__ */ React.createElement("span", { "data-sentry-component": "App", "data-sentry-source-file": "app.jsx" }, /* @__PURE__ */ React.createElement(ComponentA, { "data-sentry-element": "ComponentA", "data-sentry-source-file": "app.jsx" }), ";"); + } + console.log(App()); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/debugid-disabled.config.ts b/packages/integration-tests-next/fixtures/vite8/debugid-disabled.config.ts new file mode 100644 index 00000000..c70b0407 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/debugid-disabled.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/debugid-disabled.config.js"; + +export default defineConfig({ + build: { + minify: false, + sourcemap: true, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/debugid-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/debugid-disabled.test.ts b/packages/integration-tests-next/fixtures/vite8/debugid-disabled.test.ts new file mode 100644 index 00000000..1c99d55f --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/debugid-disabled.test.ts @@ -0,0 +1,14 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "console.log("hello world"); + //# sourceMappingURL=basic.js.map + ", + "basic.js.map": "{"version":3,"file":"basic.js","sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"names":[],"mappings":"AACA,QAAQ,IAAI,aAAa;"}", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/debugids-already-injected.config.ts b/packages/integration-tests-next/fixtures/vite8/debugids-already-injected.config.ts new file mode 100644 index 00000000..f3dfcb91 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/debugids-already-injected.config.ts @@ -0,0 +1,19 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/debugids-already-injected.config.js"; + +export default defineConfig({ + build: { + minify: false, + sourcemap: true, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/debugids-already-injected", + entryFileNames: "[name].js", + sourcemapDebugIds: true, + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/debugids-already-injected.test.ts b/packages/integration-tests-next/fixtures/vite8/debugids-already-injected.test.ts new file mode 100644 index 00000000..5735e771 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/debugids-already-injected.test.ts @@ -0,0 +1,28 @@ +import { expect } from "vitest"; +import { readAllFiles } from "../utils"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, createTempDir }) => { + const tempDir = createTempDir(); + + runBundler({ SENTRY_TEST_OVERRIDE_TEMP_DIR: tempDir }); + const files = readAllFiles(tempDir); + expect(files).toMatchInlineSnapshot(` + { + "252e0338-8927-4f52-bd57-188131defd0f-0.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + //# debugId=252e0338-8927-4f52-bd57-188131defd0f + //# sourceMappingURL=basic.js.map + ", + "252e0338-8927-4f52-bd57-188131defd0f-0.js.map": "{"version":3,"file":"basic.js","sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"names":[],"mappings":";;;;;;;;;AACA,QAAQ,IAAI,aAAa;","debugId":"252e0338-8927-4f52-bd57-188131defd0f","debug_id":"252e0338-8927-4f52-bd57-188131defd0f"}", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/module-metadata.config.ts b/packages/integration-tests-next/fixtures/vite8/module-metadata.config.ts new file mode 100644 index 00000000..b3612f98 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/module-metadata.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/module-metadata.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/module-metadata", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/module-metadata.test.ts b/packages/integration-tests-next/fixtures/vite8/module-metadata.test.ts new file mode 100644 index 00000000..66fb3b11 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/module-metadata.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + e._sentryModuleMetadata = e._sentryModuleMetadata || {}, e._sentryModuleMetadata[new e.Error().stack] = (function(e2) { + for (var n2 = 1; n2 < arguments.length; n2++) { + var a = arguments[n2]; + if (null != a) for (var t in a) a.hasOwnProperty(t) && (e2[t] = a[t]); + } + return e2; + })({}, e._sentryModuleMetadata[new e.Error().stack], { "something": "value", "another": 999 }); + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/multiple-entry-points.config.ts b/packages/integration-tests-next/fixtures/vite8/multiple-entry-points.config.ts new file mode 100644 index 00000000..ab300996 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/multiple-entry-points.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/multiple-entry-points.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: ["src/entry1.js", "src/entry2.js"], + output: { + dir: "out/multiple-entry-points", + chunkFileNames: "[name].js", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/multiple-entry-points.test.ts b/packages/integration-tests-next/fixtures/vite8/multiple-entry-points.test.ts new file mode 100644 index 00000000..0ea77c27 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/multiple-entry-points.test.ts @@ -0,0 +1,58 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "common.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d6522b10-3189-4ceb-b9e3-9764b0420211", e._sentryDebugIdIdentifier = "sentry-dbid-d6522b10-3189-4ceb-b9e3-9764b0420211"); + } catch (e2) { + } + })(); + function add(a, b) { + return a + b; + } + export { + add as a + }; + ", + "entry1.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "462efaa9-6efa-471b-94ae-88b2852f0c20", e._sentryDebugIdIdentifier = "sentry-dbid-462efaa9-6efa-471b-94ae-88b2852f0c20"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js"; + console.log(add(1, 2)); + ", + "entry2.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0231818d-9e30-4d5b-94a9-3da56ffd79af", e._sentryDebugIdIdentifier = "sentry-dbid-0231818d-9e30-4d5b-94a9-3da56ffd79af"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js"; + console.log(add(2, 4)); + ", + } + `); + + const output1 = runFileInNode("entry1.js"); + expect(output1).toMatchInlineSnapshot(` + "3 + " + `); + const output2 = runFileInNode("entry2.js"); + expect(output2).toMatchInlineSnapshot(` + "6 + " + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/package.json b/packages/integration-tests-next/fixtures/vite8/package.json new file mode 100644 index 00000000..0528d663 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/package.json @@ -0,0 +1,23 @@ +{ + "name": "vite8-integration-tests", + "version": "1.0.0", + "private": true, + "type": "module", + "dependencies": { + "react": "19.2.4", + "vite": "8.0.1", + "@vitejs/plugin-react": "6.0.1", + "@sentry/vite-plugin": "5.1.1" + }, + "pnpm": { + "overrides": { + "@sentry/bundler-plugin-core": "file:../../../bundler-plugin-core/sentry-bundler-plugin-core-5.1.1.tgz", + "@sentry/rollup-plugin": "file:../../../rollup-plugin/sentry-rollup-plugin-5.1.1.tgz", + "@sentry/vite-plugin": "file:../../../vite-plugin/sentry-vite-plugin-5.1.1.tgz", + "@sentry/babel-plugin-component-annotate": "file:../../../babel-plugin-component-annotate/sentry-babel-plugin-component-annotate-5.1.1.tgz" + }, + "patchedDependencies": { + "@sentry/cli": "../patches/@sentry__cli.patch" + } + } +} diff --git a/packages/integration-tests-next/fixtures/vite8/query-param.config.ts b/packages/integration-tests-next/fixtures/vite8/query-param.config.ts new file mode 100644 index 00000000..7952c040 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/query-param.config.ts @@ -0,0 +1,18 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/query-param.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: ["src/entry1.js", "src/entry2.js"], + output: { + dir: "out/query-param", + chunkFileNames: "[name].js?seP58q4g", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/query-param.test.ts b/packages/integration-tests-next/fixtures/vite8/query-param.test.ts new file mode 100644 index 00000000..b7def387 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/query-param.test.ts @@ -0,0 +1,55 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, ctx }) => { + if (process.platform === "win32") { + ctx.skip("Query params do not work in paths on Windows"); + return; + } + + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "common.js?seP58q4g": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d6522b10-3189-4ceb-b9e3-9764b0420211", e._sentryDebugIdIdentifier = "sentry-dbid-d6522b10-3189-4ceb-b9e3-9764b0420211"); + } catch (e2) { + } + })(); + function add(a, b) { + return a + b; + } + export { + add as a + }; + ", + "entry1.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "161db429-4399-479c-9466-6ff8ad3344f9", e._sentryDebugIdIdentifier = "sentry-dbid-161db429-4399-479c-9466-6ff8ad3344f9"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js?seP58q4g"; + console.log(add(1, 2)); + ", + "entry2.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a3bc51c0-20dc-4a52-a69a-6a43acf7cd65", e._sentryDebugIdIdentifier = "sentry-dbid-a3bc51c0-20dc-4a52-a69a-6a43acf7cd65"); + } catch (e2) { + } + })(); + import { a as add } from "./common.js?seP58q4g"; + console.log(add(2, 4)); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/release-disabled.config.ts b/packages/integration-tests-next/fixtures/vite8/release-disabled.config.ts new file mode 100644 index 00000000..cb5c4c06 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/release-disabled.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/release-disabled.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/release-disabled", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/release-disabled.test.ts b/packages/integration-tests-next/fixtures/vite8/release-disabled.test.ts new file mode 100644 index 00000000..82038026 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/release-disabled.test.ts @@ -0,0 +1,25 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + "sentry-cli-mock.json": "["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], + ["releases","finalize","CURRENT_SHA"], + ["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"], + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/src/app.jsx b/packages/integration-tests-next/fixtures/vite8/src/app.jsx new file mode 100644 index 00000000..5be821b4 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/src/app.jsx @@ -0,0 +1,11 @@ +import { ComponentA } from "./component-a"; + +export default function App() { + return ( + + ; + + ); +} + +console.log(App()); diff --git a/packages/integration-tests-next/fixtures/vite8/src/basic.js b/packages/integration-tests-next/fixtures/vite8/src/basic.js new file mode 100644 index 00000000..7ef02afb --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/src/basic.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line no-console +console.log("hello world"); diff --git a/packages/integration-tests-next/fixtures/vite8/src/bundle.js b/packages/integration-tests-next/fixtures/vite8/src/bundle.js new file mode 100644 index 00000000..0d62e559 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/src/bundle.js @@ -0,0 +1,10 @@ +console.log( + JSON.stringify({ + debug: __SENTRY_DEBUG__ ? "a" : "b", + trace: __SENTRY_TRACING__ ? "a" : "b", + replayCanvas: __RRWEB_EXCLUDE_CANVAS__ ? "a" : "b", + replayIframe: __RRWEB_EXCLUDE_IFRAME__ ? "a" : "b", + replayShadowDom: __RRWEB_EXCLUDE_SHADOW_DOM__ ? "a" : "b", + replayWorker: __SENTRY_EXCLUDE_REPLAY_WORKER__ ? "a" : "b", + }) +); diff --git a/packages/integration-tests-next/fixtures/vite8/src/common.js b/packages/integration-tests-next/fixtures/vite8/src/common.js new file mode 100644 index 00000000..7d658310 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/src/common.js @@ -0,0 +1,3 @@ +export function add(a, b) { + return a + b; +} diff --git a/packages/integration-tests-next/fixtures/vite8/src/component-a.jsx b/packages/integration-tests-next/fixtures/vite8/src/component-a.jsx new file mode 100644 index 00000000..5d57ab22 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/src/component-a.jsx @@ -0,0 +1,3 @@ +export function ComponentA() { + return Component A; +} diff --git a/packages/integration-tests-next/fixtures/vite8/src/entry1.js b/packages/integration-tests-next/fixtures/vite8/src/entry1.js new file mode 100644 index 00000000..48081666 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/src/entry1.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(1, 2)); diff --git a/packages/integration-tests-next/fixtures/vite8/src/entry2.js b/packages/integration-tests-next/fixtures/vite8/src/entry2.js new file mode 100644 index 00000000..f64af1ea --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/src/entry2.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(2, 4)); diff --git a/packages/integration-tests-next/fixtures/vite8/telemetry.config.ts b/packages/integration-tests-next/fixtures/vite8/telemetry.config.ts new file mode 100644 index 00000000..c02f3a57 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/telemetry.config.ts @@ -0,0 +1,17 @@ +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { defineConfig } from "vite"; +import { sentryConfig } from "../configs/telemetry.config.js"; + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + input: "src/basic.js", + output: { + dir: "out/telemetry", + entryFileNames: "[name].js", + }, + }, + }, + plugins: [sentryVitePlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/vite8/telemetry.test.ts b/packages/integration-tests-next/fixtures/vite8/telemetry.test.ts new file mode 100644 index 00000000..f02b90e0 --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/telemetry.test.ts @@ -0,0 +1,26 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "!(function() { + try { + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; + var n = new e.Error().stack; + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "252e0338-8927-4f52-bd57-188131defd0f", e._sentryDebugIdIdentifier = "sentry-dbid-252e0338-8927-4f52-bd57-188131defd0f"); + } catch (e2) { + } + })(); + console.log("hello world"); + ", + "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"8.30.0"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], + ", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/vite8/utils.ts b/packages/integration-tests-next/fixtures/vite8/utils.ts new file mode 100644 index 00000000..911fc7cc --- /dev/null +++ b/packages/integration-tests-next/fixtures/vite8/utils.ts @@ -0,0 +1,62 @@ +import { basename, dirname, join } from "node:path"; +import { createTempDir, readAllFiles, runBundler } from "../utils"; +import { fileURLToPath } from "node:url"; +import { rmSync } from "node:fs"; +import { TestContext, test as vitestTest } from "vitest"; +import { execSync } from "node:child_process"; + +const cwd = dirname(fileURLToPath(import.meta.url)); +const NODE_MAJOR_VERSION = parseInt(process.versions.node.split(".")[0] || "0", 10); + +type TestCallback = (props: { + outDir: string; + runBundler: (env?: Record) => void; + readOutputFiles: () => Record; + runFileInNode: (file: string) => string; + createTempDir: () => string; + ctx: TestContext; +}) => void | Promise; + +export function test(url: string, callback: TestCallback) { + const filePath = fileURLToPath(url); + const filename = basename(filePath); + const testName = filename.replace(/\.test\.ts$/, ""); + const outDir = join(cwd, "out", testName); + + // Clear the output directory before running the test + rmSync(outDir, { recursive: true, force: true }); + + // Vite v8 requires Node 20+ + if (NODE_MAJOR_VERSION < 20) { + // eslint-disable-next-line @typescript-eslint/no-empty-function + vitestTest.skip(testName); + } else { + vitestTest(`Vite v8 > ${testName}`, (ctx) => + callback({ + outDir, + runBundler: (env) => + runBundler( + `vite build --config ${testName}.config.ts`, + { + cwd, + env: { + ...process.env, + ...env, + }, + }, + outDir + ), + readOutputFiles: () => readAllFiles(outDir), + runFileInNode: (file) => { + const fullPath = join(outDir, file); + return execSync(`node ${fullPath}`, { + cwd, + env: { ...process.env, NO_COLOR: "1", FORCE_COLOR: "0" }, + }).toString(); + }, + createTempDir: () => createTempDir(), + ctx, + }) + ); + } +} diff --git a/packages/integration-tests-next/tsconfig.json b/packages/integration-tests-next/tsconfig.json index 656010c6..1e806fd5 100644 --- a/packages/integration-tests-next/tsconfig.json +++ b/packages/integration-tests-next/tsconfig.json @@ -2,6 +2,10 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "@sentry-internal/sentry-bundler-plugin-tsconfig/base-config.json", "include": ["./**/*"], + // We exclude the Vite files for now. + // Because the Vite plugin 'references" a different `vite` package when devDeps are loaded, it doesn't + // match all the tested Vite versions. This isn't an issue when the plugin is used with end-users Vite versions. + "exclude": ["./fixtures/vite*/**/*"], "compilerOptions": { "types": ["node"], "module": "es2020", diff --git a/packages/rollup-plugin/package.json b/packages/rollup-plugin/package.json index d5cf5d36..7904ff8d 100644 --- a/packages/rollup-plugin/package.json +++ b/packages/rollup-plugin/package.json @@ -62,7 +62,7 @@ "eslint": "^8.18.0", "vitest": "^4.0.0", "premove": "^4.0.0", - "rolldown": "^1.0.0-rc.6", + "rolldown": "1.0.0-rc.10", "ts-node": "^10.9.1", "typescript": "^4.7.4" }, diff --git a/packages/vite-plugin/package.json b/packages/vite-plugin/package.json index c266d193..54f6d009 100644 --- a/packages/vite-plugin/package.json +++ b/packages/vite-plugin/package.json @@ -58,7 +58,7 @@ "eslint": "^8.18.0", "vitest": "^4.0.0", "premove": "^4.0.0", - "rolldown": "^1.0.0-rc.6", + "rolldown": "1.0.0-rc.10", "ts-node": "^10.9.1", "typescript": "^4.7.4" }, diff --git a/packages/webpack-plugin/package.json b/packages/webpack-plugin/package.json index 43af676e..300b37a7 100644 --- a/packages/webpack-plugin/package.json +++ b/packages/webpack-plugin/package.json @@ -63,7 +63,7 @@ "eslint": "^8.18.0", "vitest": "^4.0.0", "premove": "^4.0.0", - "rolldown": "^1.0.0-rc.6", + "rolldown": "1.0.0-rc.10", "ts-node": "^10.9.1", "typescript": "^4.7.4", "webpack": "5.0.0" diff --git a/yarn.lock b/yarn.lock index fd68fd11..4bde7c56 100644 --- a/yarn.lock +++ b/yarn.lock @@ -954,10 +954,10 @@ resolved "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-22.5.2.tgz#0b3867776cd7fdb86068b2dd733e6621ded5165a" integrity sha512-IK9Xd5Gh9ys4oun5ko8Uv8AEi2byN2FPXBsR1BLkt93SJ0bJVTdXGyEA+fWmEclLZIM0PiZj1KbCajVn9NEPtw== -"@oxc-project/types@=0.115.0": - version "0.115.0" - resolved "https://registry.npmjs.org/@oxc-project/types/-/types-0.115.0.tgz#92a599543529bce45f8f2da77f40a124d63349dc" - integrity sha512-4n91DKnebUS4yjUHl2g3/b2T+IUdCfmoZGhmwsovZCDaJSs+QkVAM+0AqqTxHSsHfeiMuueT75cZaZcT/m0pSw== +"@oxc-project/types@=0.120.0": + version "0.120.0" + resolved "https://registry.npmjs.org/@oxc-project/types/-/types-0.120.0.tgz#af521b0e689dd0eaa04fe4feef9b68d98b74783d" + integrity sha512-k1YNu55DuvAip/MGE1FTsIuU3FUCn6v/ujG9V7Nq5Df/kX2CWb13hhwD0lmJGMGqE+bE1MXvv9SZVnMzEXlWcg== "@oxfmt/binding-android-arm-eabi@0.33.0": version "0.33.0" @@ -1054,77 +1054,87 @@ resolved "https://registry.npmjs.org/@oxfmt/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.33.0.tgz#b5d6d19b7889755e6ed43c3dc528e3263856ddf1" integrity sha512-lsBQxbepASwOBUh3chcKAjU+jVAQhLElbPYiagIq26cU8vA9Bttj6t20bMvCQCw31m440IRlNhrK7NpnUI8mzA== -"@rolldown/binding-android-arm64@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.6.tgz#4ee6333152206902aa1beb74a487ec7bc9df20bd" - integrity sha512-kvjTSWGcrv+BaR2vge57rsKiYdVR8V8CoS0vgKrc570qRBfty4bT+1X0z3j2TaVV+kAYzA0PjeB9+mdZyqUZlg== - -"@rolldown/binding-darwin-arm64@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.6.tgz#0c1853b3b07e739087b33919fc388fe3ce314e9e" - integrity sha512-+tJhD21KvGNtUrpLXrZQlT+j5HZKiEwR2qtcZb3vNOUpvoT9QjEykr75ZW/Kr0W89gose/HVXU6351uVZD8Qvw== - -"@rolldown/binding-darwin-x64@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.6.tgz#6e52da0ad87253b9cf04dcadf025dca1928e658d" - integrity sha512-DKNhjMk38FAWaHwUt1dFR3rA/qRAvn2NUvSG2UGvxvlMxSmN/qqww/j4ABAbXhNRXtGQNmrAINMXRuwHl16ZHg== - -"@rolldown/binding-freebsd-x64@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.6.tgz#7e500eff970e39d1307e481b00874ab90af4a183" - integrity sha512-8TThsRkCPAnfyMBShxrGdtoOE6h36QepqRQI97iFaQSCRbHFWHcDHppcojZnzXoruuhPnjMEygzaykvPVJsMRg== - -"@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.6.tgz#247b60365081872f9ef8426e98bafbda7410c23a" - integrity sha512-ZfmFoOwPUZCWtGOVC9/qbQzfc0249FrRUOzV2XabSMUV60Crp211OWLQN1zmQAsRIVWRcEwhJ46Z1mXGo/L/nQ== - -"@rolldown/binding-linux-arm64-gnu@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.6.tgz#504840853e42726c7b9c591792f6422aa93f118c" - integrity sha512-ZsGzbNETxPodGlLTYHaCSGVhNN/rvkMDCJYHdT7PZr5jFJRmBfmDi2awhF64Dt2vxrJqY6VeeYSgOzEbHRsb7Q== - -"@rolldown/binding-linux-arm64-musl@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.6.tgz#f5f260bfa51083c45fcb59f10ba77991d29dbed4" - integrity sha512-elPpdevtCdUOqziemR86C4CSCr/5sUxalzDrf/CJdMT+kZt2C556as++qHikNOz0vuFf52h+GJNXZM08eWgGPQ== - -"@rolldown/binding-linux-x64-gnu@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.6.tgz#c59a835f5f4f5ffd937ea4466862d522c5da4928" - integrity sha512-IBwXsf56o3xhzAyaZxdM1CX8UFiBEUFCjiVUgny67Q8vPIqkjzJj0YKhd3TbBHanuxThgBa59f6Pgutg2OGk5A== - -"@rolldown/binding-linux-x64-musl@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.6.tgz#1ea2a7c58f5ed50b3d35142935f6a0234c1d007b" - integrity sha512-vOk7G8V9Zm+8a6PL6JTpCea61q491oYlGtO6CvnsbhNLlKdf0bbCPytFzGQhYmCKZDKkEbmnkcIprTEGCURnwg== - -"@rolldown/binding-openharmony-arm64@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.6.tgz#8ffe37a43e9218af46770784dfbc1cda9efffd97" - integrity sha512-ASjEDI4MRv7XCQb2JVaBzfEYO98JKCGrAgoW6M03fJzH/ilCnC43Mb3ptB9q/lzsaahoJyIBoAGKAYEjUvpyvQ== - -"@rolldown/binding-wasm32-wasi@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.6.tgz#e822081ac37a98c2f63e8a9f65432361a0ac185a" - integrity sha512-mYa1+h2l6Zc0LvmwUh0oXKKYihnw/1WC73vTqw+IgtfEtv47A+rWzzcWwVDkW73+UDr0d/Ie/HRXoaOY22pQDw== +"@rolldown/binding-android-arm64@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.10.tgz#0bbd3380f49a6d0dc96c9b32fb7dad26ae0dfaa7" + integrity sha512-jOHxwXhxmFKuXztiu1ORieJeTbx5vrTkcOkkkn2d35726+iwhrY1w/+nYY/AGgF12thg33qC3R1LMBF5tHTZHg== + +"@rolldown/binding-darwin-arm64@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.10.tgz#a30b051784fbb13635e652ba4041c6ce7a4ce7ab" + integrity sha512-gED05Teg/vtTZbIJBc4VNMAxAFDUPkuO/rAIyyxZjTj1a1/s6z5TII/5yMGZ0uLRCifEtwUQn8OlYzuYc0m70w== + +"@rolldown/binding-darwin-x64@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.10.tgz#2d9dea982d5be90b95b6d8836ff26a4b0959d94b" + integrity sha512-rI15NcM1mA48lqrIxVkHfAqcyFLcQwyXWThy+BQ5+mkKKPvSO26ir+ZDp36AgYoYVkqvMcdS8zOE6SeBsR9e8A== + +"@rolldown/binding-freebsd-x64@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.10.tgz#4efc3aca43ae4dfb90729eeca6e84ef6e6b38c4a" + integrity sha512-XZRXHdTa+4ME1MuDVp021+doQ+z6Ei4CCFmNc5/sKbqb8YmkiJdj8QKlV3rCI0AJtAeSB5n0WGPuJWNL9p/L2w== + +"@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.10.tgz#4a19a5d24537e925b25e9583b6cd575b2ad9fa27" + integrity sha512-R0SQMRluISSLzFE20sPWYHVmJdDQnRyc/FzSCN72BqQmh2SOZUFG+N3/vBZpR4C6WpEUVYJLrYUXaj43sJsNLA== + +"@rolldown/binding-linux-arm64-gnu@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.10.tgz#01a41e5e905838353ae9a3da10dc8242dcd61453" + integrity sha512-Y1reMrV/o+cwpduYhJuOE3OMKx32RMYCidf14y+HssARRmhDuWXJ4yVguDg2R/8SyyGNo+auzz64LnPK9Hq6jg== + +"@rolldown/binding-linux-arm64-musl@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.10.tgz#bd059e5f83471de29ce35b0ba254995d8091ca40" + integrity sha512-vELN+HNb2IzuzSBUOD4NHmP9yrGwl1DVM29wlQvx1OLSclL0NgVWnVDKl/8tEks79EFek/kebQKnNJkIAA4W2g== + +"@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.10.tgz#fe726a540631015f269a989c0cfb299283190390" + integrity sha512-ZqrufYTgzxbHwpqOjzSsb0UV/aV2TFIY5rP8HdsiPTv/CuAgCRjM6s9cYFwQ4CNH+hf9Y4erHW1GjZuZ7WoI7w== + +"@rolldown/binding-linux-s390x-gnu@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.10.tgz#825ced028bad3f1fa9ce83b1f3dac76e0424367f" + integrity sha512-gSlmVS1FZJSRicA6IyjoRoKAFK7IIHBs7xJuHRSmjImqk3mPPWbR7RhbnfH2G6bcmMEllCt2vQ/7u9e6bBnByg== + +"@rolldown/binding-linux-x64-gnu@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.10.tgz#b700dae69274aa3d54a16ca5e00e30f47a089119" + integrity sha512-eOCKUpluKgfObT2pHjztnaWEIbUabWzk3qPZ5PuacuPmr4+JtQG4k2vGTY0H15edaTnicgU428XW/IH6AimcQw== + +"@rolldown/binding-linux-x64-musl@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.10.tgz#eb875660ad68a2348acab36a7005699e87f6e9dd" + integrity sha512-Xdf2jQbfQowJnLcgYfD/m0Uu0Qj5OdxKallD78/IPPfzaiaI4KRAwZzHcKQ4ig1gtg1SuzC7jovNiM2TzQsBXA== + +"@rolldown/binding-openharmony-arm64@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.10.tgz#72aa24b412f83025087bcf83ce09634b2bd93c5c" + integrity sha512-o1hYe8hLi1EY6jgPFyxQgQ1wcycX+qz8eEbVmot2hFkgUzPxy9+kF0u0NIQBeDq+Mko47AkaFFaChcvZa9UX9Q== + +"@rolldown/binding-wasm32-wasi@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.10.tgz#7f3303a96c5dc01d1f4c539b1dcbc16392c6f17d" + integrity sha512-Ugv9o7qYJudqQO5Y5y2N2SOo6S4WiqiNOpuQyoPInnhVzCY+wi/GHltcLHypG9DEUYMB0iTB/huJrpadiAcNcA== dependencies: "@napi-rs/wasm-runtime" "^1.1.1" -"@rolldown/binding-win32-arm64-msvc@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.6.tgz#f7e8455f618505f28e763c8e73213d61eeba2b7f" - integrity sha512-e2ABskbNH3MRUBMjgxaMjYIw11DSwjLJxBII3UgpF6WClGLIh8A20kamc+FKH5vIaFVnYQInmcLYSUVpqMPLow== +"@rolldown/binding-win32-arm64-msvc@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.10.tgz#3419144a04ad12c69c48536b01fc21ac9d87ecf4" + integrity sha512-7UODQb4fQUNT/vmgDZBl3XOBAIOutP5R3O/rkxg0aLfEGQ4opbCgU5vOw/scPe4xOqBwL9fw7/RP1vAMZ6QlAQ== -"@rolldown/binding-win32-x64-msvc@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.6.tgz#5100c0a269f5a557cab7011951b48709c6216fa9" - integrity sha512-dJVc3ifhaRXxIEh1xowLohzFrlQXkJ66LepHm+CmSprTWgVrPa8Fx3OL57xwIqDEH9hufcKkDX2v65rS3NZyRA== +"@rolldown/binding-win32-x64-msvc@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.10.tgz#09bee46e6a32c6086beeabc3da12e67be714f882" + integrity sha512-PYxKHMVHOb5NJuDL53vBUl1VwUjymDcYI6rzpIni0C9+9mTiJedvUxSk7/RPp7OOAm3v+EjgMu9bIy3N6b408w== -"@rolldown/pluginutils@1.0.0-rc.6": - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.6.tgz#2f729fcf2d68c2d8cc2dcb05a7c3b2eeadfe20e1" - integrity sha512-Y0+JT8Mi1mmW08K6HieG315XNRu4L0rkfCpA364HtytjgiqYnMYRdFPcxRl+BQQqNXzecL2S9nii+RUpO93XIA== +"@rolldown/pluginutils@1.0.0-rc.10": + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.10.tgz#eed997f37f928a3300bbe2161f42687d8a3ae759" + integrity sha512-UkVDEFk1w3mveXeKgaTuYfKWtPbvgck1dT8TUG3bnccrH0XtLTuAyfCoks4Q/M5ZGToSVJTIQYCzy2g/atAOeg== "@rollup/plugin-babel@^6.0.4": version "6.0.4" @@ -5457,27 +5467,29 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rolldown@^1.0.0-rc.6: - version "1.0.0-rc.6" - resolved "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.6.tgz#fc2209fde9a0947fedd78647af50d2262332e977" - integrity sha512-B8vFPV1ADyegoYfhg+E7RAucYKv0xdVlwYYsIJgfPNeiSxZGWNxts9RqhyGzC11ULK/VaeXyKezGCwpMiH8Ktw== +rolldown@1.0.0-rc.10: + version "1.0.0-rc.10" + resolved "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.10.tgz#41c55e52d833c52c90131973047250548e35f2bf" + integrity sha512-q7j6vvarRFmKpgJUT8HCAUljkgzEp4LAhPlJUvQhA5LA1SUL36s5QCysMutErzL3EbNOZOkoziSx9iZC4FddKA== dependencies: - "@oxc-project/types" "=0.115.0" - "@rolldown/pluginutils" "1.0.0-rc.6" + "@oxc-project/types" "=0.120.0" + "@rolldown/pluginutils" "1.0.0-rc.10" optionalDependencies: - "@rolldown/binding-android-arm64" "1.0.0-rc.6" - "@rolldown/binding-darwin-arm64" "1.0.0-rc.6" - "@rolldown/binding-darwin-x64" "1.0.0-rc.6" - "@rolldown/binding-freebsd-x64" "1.0.0-rc.6" - "@rolldown/binding-linux-arm-gnueabihf" "1.0.0-rc.6" - "@rolldown/binding-linux-arm64-gnu" "1.0.0-rc.6" - "@rolldown/binding-linux-arm64-musl" "1.0.0-rc.6" - "@rolldown/binding-linux-x64-gnu" "1.0.0-rc.6" - "@rolldown/binding-linux-x64-musl" "1.0.0-rc.6" - "@rolldown/binding-openharmony-arm64" "1.0.0-rc.6" - "@rolldown/binding-wasm32-wasi" "1.0.0-rc.6" - "@rolldown/binding-win32-arm64-msvc" "1.0.0-rc.6" - "@rolldown/binding-win32-x64-msvc" "1.0.0-rc.6" + "@rolldown/binding-android-arm64" "1.0.0-rc.10" + "@rolldown/binding-darwin-arm64" "1.0.0-rc.10" + "@rolldown/binding-darwin-x64" "1.0.0-rc.10" + "@rolldown/binding-freebsd-x64" "1.0.0-rc.10" + "@rolldown/binding-linux-arm-gnueabihf" "1.0.0-rc.10" + "@rolldown/binding-linux-arm64-gnu" "1.0.0-rc.10" + "@rolldown/binding-linux-arm64-musl" "1.0.0-rc.10" + "@rolldown/binding-linux-ppc64-gnu" "1.0.0-rc.10" + "@rolldown/binding-linux-s390x-gnu" "1.0.0-rc.10" + "@rolldown/binding-linux-x64-gnu" "1.0.0-rc.10" + "@rolldown/binding-linux-x64-musl" "1.0.0-rc.10" + "@rolldown/binding-openharmony-arm64" "1.0.0-rc.10" + "@rolldown/binding-wasm32-wasi" "1.0.0-rc.10" + "@rolldown/binding-win32-arm64-msvc" "1.0.0-rc.10" + "@rolldown/binding-win32-x64-msvc" "1.0.0-rc.10" rollup@3.2.0: version "3.2.0"