From 60ddcf3ec0cc5cfd98f3c8327a39fe91466ddf19 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Sat, 28 Feb 2026 11:52:18 +0000 Subject: [PATCH 01/11] test: New integration tests --- .github/workflows/checks.yml | 37 +++ .vscode/settings.json | 2 +- package.json | 4 +- .../package.json | 2 +- packages/bundler-plugin-core/package.json | 2 +- packages/esbuild-plugin/package.json | 2 +- packages/integration-tests-next/.eslintrc.js | 16 ++ packages/integration-tests-next/.gitignore | 1 + .../rolldown/application-key.config.ts | 10 + .../rolldown/basic-release-disabled.config.ts | 10 + .../rolldown/basic-sourcemaps.config.ts | 11 + .../fixtures/rolldown/basic.config.ts | 10 + .../component-annotation-disabled.config.ts | 13 + .../component-annotation-next.config.ts | 18 ++ .../rolldown/component-annotation.config.ts | 13 + .../rolldown/debugid-disabled.config.ts | 21 ++ .../debugids-already-injected.config.ts | 19 ++ .../rolldown/module-metadata.config.ts | 12 + .../rolldown/multiple-entry-points.config.ts | 11 + .../fixtures/rolldown/package.json | 9 + .../fixtures/rolldown/rolldown.test.ts | 253 ++++++++++++++++++ .../fixtures/rolldown/src/app.jsx | 9 + .../fixtures/rolldown/src/basic.js | 2 + .../fixtures/rolldown/src/common.js | 3 + .../fixtures/rolldown/src/component-a.jsx | 3 + .../fixtures/rolldown/src/entry1.js | 3 + .../fixtures/rolldown/src/entry2.js | 3 + .../integration-tests-next/fixtures/utils.ts | 33 +++ packages/integration-tests-next/package.json | 30 +++ packages/integration-tests-next/tsconfig.json | 9 + packages/rollup-plugin/package.json | 2 +- packages/vite-plugin/package.json | 2 +- packages/webpack-plugin/package.json | 2 +- yarn.lock | 183 +++++++------ 34 files changed, 663 insertions(+), 97 deletions(-) create mode 100644 packages/integration-tests-next/.eslintrc.js create mode 100644 packages/integration-tests-next/.gitignore create mode 100644 packages/integration-tests-next/fixtures/rolldown/application-key.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/basic.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/component-annotation-next.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/component-annotation.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/debugid-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/module-metadata.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/package.json create mode 100644 packages/integration-tests-next/fixtures/rolldown/rolldown.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/src/app.jsx create mode 100644 packages/integration-tests-next/fixtures/rolldown/src/basic.js create mode 100644 packages/integration-tests-next/fixtures/rolldown/src/common.js create mode 100644 packages/integration-tests-next/fixtures/rolldown/src/component-a.jsx create mode 100644 packages/integration-tests-next/fixtures/rolldown/src/entry1.js create mode 100644 packages/integration-tests-next/fixtures/rolldown/src/entry2.js create mode 100644 packages/integration-tests-next/fixtures/utils.ts create mode 100644 packages/integration-tests-next/package.json create mode 100644 packages/integration-tests-next/tsconfig.json diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 5d734ca4..cf6fe299 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -162,6 +162,43 @@ jobs: path: packages - run: yarn test:integration + test-integration-next: + needs: build + name: "Integration Tests Next (Node ${{ matrix.node-version }}, OS ${{ matrix.os }})" + strategy: + fail-fast: false + matrix: + node-version: [18, 20, 22, 24] + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - name: Use dependency cache + uses: actions/cache@v4 + id: dependency-cache + with: + path: "**/node_modules" + key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }} + - name: Use build cache + uses: actions/cache@v4 + with: + path: .nxcache + key: build-cache-key-${{ runner.os }}-${{ github.run_id }} + restore-keys: | + build-cache-key-${{ runner.os }}- + - name: Install dependencies + run: yarn --frozen-lockfile --ignore-engines + if: steps.dependency-cache.outputs.cache-hit != 'true' + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: dist-artifacts-${{ github.run_id }} + path: packages + - run: yarn test:integration-next + test-e2e: # We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks # Dependabot PRs sadly also don't have access to secrets, so we skip them as well diff --git a/.vscode/settings.json b/.vscode/settings.json index e40b7be8..90150e96 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "editor.defaultFormatter": "oxc.oxc-vscode", + "editor.defaultFormatter": "oxc.oxc-vscode" } diff --git a/package.json b/package.json index 5755d369..855d8e0f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins", "private": true, "workspaces": [ - "packages/*" + "packages/*", + "packages/integration-tests-next/fixtures/*" ], "scripts": { "build": "nx run-many --target=build --all", @@ -20,6 +21,7 @@ "test:all": "nx run-many --target=test --all", "test:unit": "nx run-many --target=test --all --exclude=@sentry-internal/integration-tests,@sentry-internal/bundler-plugin-e2e-tests", "test:integration": "nx run @sentry-internal/integration-tests:test", + "test:integration-next": "nx run @sentry-internal/integration-tests-next:test", "test:e2e": "nx run @sentry-internal/bundler-plugin-e2e-tests:test", "lint": "nx run-many --target=lint --all", "check:formatting": "oxfmt --check .", diff --git a/packages/babel-plugin-component-annotate/package.json b/packages/babel-plugin-component-annotate/package.json index e38e2222..01a50abd 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.4", + "rolldown": "^1.0.0-rc.6", "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 db6b7e65..b6ac8a15 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.4", + "rolldown": "^1.0.0-rc.6", "typescript": "^4.7.4" }, "volta": { diff --git a/packages/esbuild-plugin/package.json b/packages/esbuild-plugin/package.json index d48ae29f..d34de376 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.4", + "rolldown": "^1.0.0-rc.6", "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 new file mode 100644 index 00000000..86143395 --- /dev/null +++ b/packages/integration-tests-next/.eslintrc.js @@ -0,0 +1,16 @@ +/** @type {import('eslint').ESLint.Options} */ +module.exports = { + root: true, + extends: ["@sentry-internal/eslint-config/base"], + ignorePatterns: [".eslintrc.js", "fixtures/*/out", "fixtures/*/src"], + parserOptions: { + tsconfigRootDir: __dirname, + project: ["./tsconfig.json"], + }, + env: { + node: true, + }, + rules: { + "@typescript-eslint/explicit-function-return-type": "off", + }, +}; diff --git a/packages/integration-tests-next/.gitignore b/packages/integration-tests-next/.gitignore new file mode 100644 index 00000000..608c2472 --- /dev/null +++ b/packages/integration-tests-next/.gitignore @@ -0,0 +1 @@ +fixtures/*/out/** diff --git a/packages/integration-tests-next/fixtures/rolldown/application-key.config.ts b/packages/integration-tests-next/fixtures/rolldown/application-key.config.ts new file mode 100644 index 00000000..9b6c7fb2 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/application-key.config.ts @@ -0,0 +1,10 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/application-key/basic.js", + }, + plugins: [sentryRollupPlugin({ telemetry: false, applicationKey: "1234567890abcdef" })], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts b/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts new file mode 100644 index 00000000..6cca89b3 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts @@ -0,0 +1,10 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/basic-release-disabled/basic.js", + }, + plugins: [sentryRollupPlugin({ telemetry: false, release: { inject: false } })], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts new file mode 100644 index 00000000..8c1cfb39 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/basic-sourcemaps/basic.js", + sourcemap: true, + }, + plugins: [sentryRollupPlugin({ telemetry: false })], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/basic.config.ts b/packages/integration-tests-next/fixtures/rolldown/basic.config.ts new file mode 100644 index 00000000..83642850 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/basic.config.ts @@ -0,0 +1,10 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/basic/basic.js", + }, + plugins: [sentryRollupPlugin({ telemetry: false })], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.config.ts b/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.config.ts new file mode 100644 index 00000000..6408342c --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.config.ts @@ -0,0 +1,13 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + file: "out/component-annotation-disabled/app.js", + }, + plugins: [sentryRollupPlugin({ telemetry: false })], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.config.ts b/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.config.ts new file mode 100644 index 00000000..6023cb4c --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.config.ts @@ -0,0 +1,18 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + file: "out/component-annotation-next/app.js", + }, + plugins: [ + sentryRollupPlugin({ + telemetry: false, + reactComponentAnnotation: { enabled: true, _experimentalInjectIntoHtml: true }, + }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/component-annotation.config.ts b/packages/integration-tests-next/fixtures/rolldown/component-annotation.config.ts new file mode 100644 index 00000000..aa013df1 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation.config.ts @@ -0,0 +1,13 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + file: "out/component-annotation/app.js", + }, + plugins: [sentryRollupPlugin({ telemetry: false, reactComponentAnnotation: { enabled: true } })], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.config.ts b/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.config.ts new file mode 100644 index 00000000..48a93f32 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.config.ts @@ -0,0 +1,21 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/debugid-disabled/basic.js", + sourcemap: true, + }, + plugins: [ + sentryRollupPlugin({ + telemetry: false, + sourcemaps: { + disable: true, + }, + release: { + inject: false, + }, + }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts b/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts new file mode 100644 index 00000000..426b4449 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts @@ -0,0 +1,19 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/debugids-already-injected/basic.js", + sourcemap: true, + sourcemapDebugIds: true, + }, + plugins: [ + sentryRollupPlugin({ + telemetry: false, + authToken: "fake-auth", + org: "fake-org", + project: "fake-project", + }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/module-metadata.config.ts b/packages/integration-tests-next/fixtures/rolldown/module-metadata.config.ts new file mode 100644 index 00000000..9c867075 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/module-metadata.config.ts @@ -0,0 +1,12 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/module-metadata/basic.js", + }, + plugins: [ + sentryRollupPlugin({ telemetry: false, moduleMetadata: { something: "value", another: 999 } }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.config.ts b/packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.config.ts new file mode 100644 index 00000000..038f7c09 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: ["src/entry1.js", "src/entry2.js"], + output: { + dir: "out/multiple-entry-points", + chunkFileNames: "[name].js", + }, + plugins: [sentryRollupPlugin({ telemetry: false, release: { inject: false } })], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/package.json b/packages/integration-tests-next/fixtures/rolldown/package.json new file mode 100644 index 00000000..1f7c8ed2 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/package.json @@ -0,0 +1,9 @@ +{ + "name": "rolldown-integration-tests", + "version": "1.0.0", + "private": true, + "dependencies": { + "react": "^19.2.4", + "rolldown": "^1.0.0-rc.6" + } +} diff --git a/packages/integration-tests-next/fixtures/rolldown/rolldown.test.ts b/packages/integration-tests-next/fixtures/rolldown/rolldown.test.ts new file mode 100644 index 00000000..0faf3b11 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/rolldown.test.ts @@ -0,0 +1,253 @@ +import { describe, test, expect, beforeAll } from "vitest"; +import { runBundler, readAllFiles } from "../utils"; +import { join } from "node:path"; +import { rmSync, mkdtempSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { randomUUID } from "node:crypto"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const tempDirs: string[] = []; + +function createTempDir(): string { + const tempDir = mkdtempSync(join(tmpdir(), "sentry-bundler-plugin-" + randomUUID())); + tempDirs.push(tempDir); + return tempDir; +} + +process.on("exit", () => { + for (const dir of tempDirs) { + rmSync(dir, { recursive: true, force: true }); + } +}); + +function runRolldown( + config: string, + env: Record = { ...process.env } +): void { + runBundler(`rolldown --config ${config}`, { cwd: __dirname }, { ...process.env, ...env }); +} + +describe("rolldown", () => { + beforeAll(() => { + const outputDir = join(__dirname, "out"); + rmSync(outputDir, { recursive: true, force: true }); + }); + + test("Basic", () => { + runRolldown("basic.config.ts"); + const files = readAllFiles(join(__dirname, "out", "basic")); + expect(files).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", + } + `); + }); + + test("Basic with sourcemaps", () => { + runRolldown("basic-sourcemaps.config.ts"); + const files = readAllFiles(join(__dirname, "out", "basic-sourcemaps")); + expect(files).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 + //# 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"}", + } + `); + }); + + test("Release injection disabled", () => { + runRolldown("basic-release-disabled.config.ts"); + const files = readAllFiles(join(__dirname, "out", "basic-release-disabled")); + expect(files).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", + } + `); + }); + + test("Debug ID injection disabled", () => { + runRolldown("debugid-disabled.config.ts"); + const files = readAllFiles(join(__dirname, "out", "debugid-disabled")); + expect(files).toMatchInlineSnapshot(` + { + "basic.js": "//#region src/basic.js + 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":";AACA,QAAQ,IAAI,cAAc"}", + } + `); + }); + + test("Debug IDs already injected", () => { + const tempDir = createTempDir(); + + runRolldown("debugids-already-injected.config.ts", { 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"); + + //#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"}", + } + `); + }); + + test("Module metadata injection", () => { + runRolldown("module-metadata.config.ts"); + const files = readAllFiles(join(__dirname, "out", "module-metadata")); + expect(files).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 { + runRolldown("application-key.config.ts"); + const files = readAllFiles(join(__dirname, "out", "application-key")); + expect(files).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 { + runRolldown("component-annotation.config.ts"); + const files = readAllFiles(join(__dirname, "out", "component-annotation")); + expect(files).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]="adb3af3a-5b4a-49fd-b8ae-7ea0905020b6",e._sentryDebugIdIdentifier="sentry-dbid-adb3af3a-5b4a-49fd-b8ae-7ea0905020b6");}catch(e){}}();import { jsx, jsxs } from "../node_modules/react/jsx-runtime.js"; + + //#region src/component-a.jsx + function ComponentA() { + return /* @__PURE__ */ jsx("span", { + "data-sentry-component": "ComponentA", + "data-sentry-source-file": "component-a.jsx", + children: "Component A" + }); + } + + //#endregion + //#region src/app.jsx + 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" + }), ";"] + }); + } + + //#endregion + export { App as default };", + } + `); + }); + + test("Component annotation disabled", () => { + runRolldown("component-annotation-disabled.config.ts"); + const files = readAllFiles(join(__dirname, "out", "component-annotation-disabled")); + expect(files).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]="ea5adc74-2664-4c38-8492-6e4971efd2be",e._sentryDebugIdIdentifier="sentry-dbid-ea5adc74-2664-4c38-8492-6e4971efd2be");}catch(e){}}();import { jsx, jsxs } from "../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 };", + } + `); + }); + + test("Component annotation experimental", () => { + runRolldown("component-annotation-next.config.ts"); + const files = readAllFiles(join(__dirname, "out", "component-annotation-next")); + expect(files).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]="aa1666c7-eaca-4b84-8c40-9ac56cc75bfb",e._sentryDebugIdIdentifier="sentry-dbid-aa1666c7-eaca-4b84-8c40-9ac56cc75bfb");}catch(e){}}();import { jsx, jsxs } from "../node_modules/react/jsx-runtime.js"; + + //#region src/component-a.jsx + function ComponentA() { + return /* @__PURE__ */ jsx("span", { + "data-sentry-component": "ComponentA", + children: "Component A" + }); + } + + //#endregion + //#region src/app.jsx + function App() { + return /* @__PURE__ */ jsxs("span", { + "data-sentry-component": "App", + children: [/* @__PURE__ */ jsx(ComponentA, {}), ";"] + }); + } + + //#endregion + export { App as default };", + } + `); + }); + + test("Multiple entry points", () => { + runRolldown("multiple-entry-points.config.ts"); + const files = readAllFiles(join(__dirname, "out", "multiple-entry-points")); + expect(files).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", + } + `); + }); +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/src/app.jsx b/packages/integration-tests-next/fixtures/rolldown/src/app.jsx new file mode 100644 index 00000000..614d38c8 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/src/app.jsx @@ -0,0 +1,9 @@ +import { ComponentA } from "./component-a"; + +export default function App() { + return ( + + ; + + ); +} diff --git a/packages/integration-tests-next/fixtures/rolldown/src/basic.js b/packages/integration-tests-next/fixtures/rolldown/src/basic.js new file mode 100644 index 00000000..7ef02afb --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/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/rolldown/src/common.js b/packages/integration-tests-next/fixtures/rolldown/src/common.js new file mode 100644 index 00000000..7d658310 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/src/common.js @@ -0,0 +1,3 @@ +export function add(a, b) { + return a + b; +} diff --git a/packages/integration-tests-next/fixtures/rolldown/src/component-a.jsx b/packages/integration-tests-next/fixtures/rolldown/src/component-a.jsx new file mode 100644 index 00000000..5d57ab22 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/src/component-a.jsx @@ -0,0 +1,3 @@ +export function ComponentA() { + return Component A; +} diff --git a/packages/integration-tests-next/fixtures/rolldown/src/entry1.js b/packages/integration-tests-next/fixtures/rolldown/src/entry1.js new file mode 100644 index 00000000..48081666 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/src/entry1.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(1, 2)); diff --git a/packages/integration-tests-next/fixtures/rolldown/src/entry2.js b/packages/integration-tests-next/fixtures/rolldown/src/entry2.js new file mode 100644 index 00000000..f64af1ea --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/src/entry2.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(2, 4)); diff --git a/packages/integration-tests-next/fixtures/utils.ts b/packages/integration-tests-next/fixtures/utils.ts new file mode 100644 index 00000000..a8fa649e --- /dev/null +++ b/packages/integration-tests-next/fixtures/utils.ts @@ -0,0 +1,33 @@ +import { execSync } from "node:child_process"; +import { readdirSync, readFileSync, statSync } from "node:fs"; +import { join } from "node:path"; + +const DEBUG = !!process.env["DEBUG"]; +const CURRENT_SHA = execSync("git rev-parse HEAD", { encoding: "utf-8" }).trim(); + +export function runBundler( + command: string, + options: { cwd: string }, + env: Record +): void { + execSync(command, { cwd: options.cwd, stdio: DEBUG ? "inherit" : "ignore", env }); +} + +export function readAllFiles(directory: string): Record { + const files: Record = {}; + const entries = readdirSync(directory); + + for (const entry of entries) { + const fullPath = join(directory, entry); + const stat = statSync(fullPath); + + if (stat.isFile()) { + let contents = readFileSync(fullPath, "utf-8"); + // We replace the current SHA with a placeholder to make snapshots deterministic + contents = contents.replace(CURRENT_SHA, "CURRENT_SHA"); + files[entry] = contents; + } + } + + return files; +} diff --git a/packages/integration-tests-next/package.json b/packages/integration-tests-next/package.json new file mode 100644 index 00000000..2e013b69 --- /dev/null +++ b/packages/integration-tests-next/package.json @@ -0,0 +1,30 @@ +{ + "name": "@sentry-internal/integration-tests-next", + "version": "5.1.1", + "license": "MIT", + "private": true, + "scripts": { + "test": "vitest run", + "lint": "eslint .", + "check:types": "tsc --project ./tsconfig.json --noEmit", + "clean": "run-s clean:build", + "clean:all": "run-p clean clean:deps", + "clean:build": "premove ./fixtures/*/out", + "clean:deps": "premove node_modules" + }, + "dependencies": { + "@babel/preset-react": "^7.23.3", + "@sentry-internal/eslint-config": "5.1.1", + "@sentry-internal/sentry-bundler-plugin-tsconfig": "5.1.1", + "@sentry/esbuild-plugin": "5.1.1", + "@sentry/rollup-plugin": "5.1.1", + "@sentry/vite-plugin": "5.1.1", + "@sentry/webpack-plugin": "5.1.1" + }, + "devDependencies": { + "premove": "^4.0.0" + }, + "volta": { + "extends": "../../package.json" + } +} diff --git a/packages/integration-tests-next/tsconfig.json b/packages/integration-tests-next/tsconfig.json new file mode 100644 index 00000000..b9db0756 --- /dev/null +++ b/packages/integration-tests-next/tsconfig.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@sentry-internal/sentry-bundler-plugin-tsconfig/base-config.json", + "include": ["./**/*"], + "compilerOptions": { + "types": ["node"], + "module": "es2020" + } +} diff --git a/packages/rollup-plugin/package.json b/packages/rollup-plugin/package.json index 87d12eb8..a2b1ffdb 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.4", + "rolldown": "^1.0.0-rc.6", "ts-node": "^10.9.1", "typescript": "^4.7.4" }, diff --git a/packages/vite-plugin/package.json b/packages/vite-plugin/package.json index 4699c649..c08b36d1 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.4", + "rolldown": "^1.0.0-rc.6", "ts-node": "^10.9.1", "typescript": "^4.7.4" }, diff --git a/packages/webpack-plugin/package.json b/packages/webpack-plugin/package.json index 19ab18e7..4b7b643d 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.4", + "rolldown": "^1.0.0-rc.6", "ts-node": "^10.9.1", "typescript": "^4.7.4", "webpack": "5.0.0" diff --git a/yarn.lock b/yarn.lock index ed24fafd..d22d1113 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1697,10 +1697,10 @@ dependencies: "@octokit/openapi-types" "^17.2.0" -"@oxc-project/types@=0.113.0": - version "0.113.0" - resolved "https://registry.npmjs.org/@oxc-project/types/-/types-0.113.0.tgz#e323164a2d0cdc72c3eb980cd2a471e641df8d52" - integrity sha512-Tp3XmgxwNQ9pEN9vxgJBAqdRamHibi76iowQ38O2I4PMpcvNRQNVsU2n1x1nv9yh0XoTrGFzf7cZSGxmixxrhA== +"@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== "@oxfmt/binding-android-arm-eabi@0.33.0": version "0.33.0" @@ -1817,77 +1817,77 @@ resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== -"@rolldown/binding-android-arm64@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.4.tgz#bb275690413cd0109d49ba5dd4491e1c0296ad0e" - integrity sha512-vRq9f4NzvbdZavhQbjkJBx7rRebDKYR9zHfO/Wg486+I7bSecdUapzCm5cyXoK+LHokTxgSq7A5baAXUZkIz0w== - -"@rolldown/binding-darwin-arm64@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.4.tgz#cd59b855ee90e464e8b6e97919089d00d98590e1" - integrity sha512-kFgEvkWLqt3YCgKB5re9RlIrx9bRsvyVUnaTakEpOPuLGzLpLapYxE9BufJNvPg8GjT6mB1alN4yN1NjzoeM8Q== - -"@rolldown/binding-darwin-x64@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.4.tgz#5c1411b969c26ffd88b661b1a38bafcf1519a431" - integrity sha512-JXmaOJGsL/+rsmMfutcDjxWM2fTaVgCHGoXS7nE8Z3c9NAYjGqHvXrAhMUZvMpHS/k7Mg+X7n/MVKb7NYWKKww== - -"@rolldown/binding-freebsd-x64@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.4.tgz#5b06b2792df246bb3fcc64630bd92af9feff3f87" - integrity sha512-ep3Catd6sPnHTM0P4hNEvIv5arnDvk01PfyJIJ+J3wVCG1eEaPo09tvFqdtcaTrkwQy0VWR24uz+cb4IsK53Qw== - -"@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.4.tgz#93d9a3259cc41054425c8134d8ba41c9f92984f1" - integrity sha512-LwA5ayKIpnsgXJEwWc3h8wPiS33NMIHd9BhsV92T8VetVAbGe2qXlJwNVDGHN5cOQ22R9uYvbrQir2AB+ntT2w== - -"@rolldown/binding-linux-arm64-gnu@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.4.tgz#aa9e8f5b3874dc29bf54940eb55cb23274956e32" - integrity sha512-AC1WsGdlV1MtGay/OQ4J9T7GRadVnpYRzTcygV1hKnypbYN20Yh4t6O1Sa2qRBMqv1etulUknqXjc3CTIsBu6A== - -"@rolldown/binding-linux-arm64-musl@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.4.tgz#e3b56288dcb2ba9219c3e3ff62bf0395c0dc9de4" - integrity sha512-lU+6rgXXViO61B4EudxtVMXSOfiZONR29Sys5VGSetUY7X8mg9FCKIIjcPPj8xNDeYzKl+H8F/qSKOBVFJChCQ== - -"@rolldown/binding-linux-x64-gnu@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.4.tgz#003570df20ba503ed71f052d1b201535fd6a217d" - integrity sha512-DZaN1f0PGp/bSvKhtw50pPsnln4T13ycDq1FrDWRiHmWt1JeW+UtYg9touPFf8yt993p8tS2QjybpzKNTxYEwg== - -"@rolldown/binding-linux-x64-musl@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.4.tgz#e1e22ee0b8913e45bf769291a7c7db57aa20b7fe" - integrity sha512-RnGxwZLN7fhMMAItnD6dZ7lvy+TI7ba+2V54UF4dhaWa/p8I/ys1E73KO6HmPmgz92ZkfD8TXS1IMV8+uhbR9g== - -"@rolldown/binding-openharmony-arm64@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.4.tgz#494ee66307a2b1192f24d6876564c1300ec90241" - integrity sha512-6lcI79+X8klGiGd8yHuTgQRjuuJYNggmEml+RsyN596P23l/zf9FVmJ7K0KVKkFAeYEdg0iMUKyIxiV5vebDNQ== - -"@rolldown/binding-wasm32-wasi@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.4.tgz#dc98418ee2e5668f7dcc4bf4155523a079b34a80" - integrity sha512-wz7ohsKCAIWy91blZ/1FlpPdqrsm1xpcEOQVveWoL6+aSPKL4VUcoYmmzuLTssyZxRpEwzuIxL/GDsvpjaBtOw== +"@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== dependencies: "@napi-rs/wasm-runtime" "^1.1.1" -"@rolldown/binding-win32-arm64-msvc@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.4.tgz#a294ee643275bb099c1128ad294bd6101bae1eca" - integrity sha512-cfiMrfuWCIgsFmcVG0IPuO6qTRHvF7NuG3wngX1RZzc6dU8FuBFb+J3MIR5WrdTNozlumfgL4cvz+R4ozBCvsQ== +"@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-x64-msvc@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.4.tgz#b9248d23625f6f59ec1af0b3140706cba6afc36c" - integrity sha512-p6UeR9y7ht82AH57qwGuFYn69S6CZ7LLKdCKy/8T3zS9VTrJei2/CGsTUV45Da4Z9Rbhc7G4gyWQ/Ioamqn09g== +"@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/pluginutils@1.0.0-rc.4": - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.4.tgz#267b477af268a082861c861e47f6a787dff59cc4" - integrity sha512-1BrrmTu0TWfOP1riA8uakjFc9bpIUGzVKETsOtzY39pPga8zELGDl8eu1Dx7/gjM5CAz14UknsUMpBO8L+YntQ== +"@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== "@rollup/plugin-babel@^6.0.4": version "6.0.4" @@ -8874,6 +8874,11 @@ react@^18.2.0: dependencies: loose-envify "^1.1.0" +react@^19.2.4: + version "19.2.4" + resolved "https://registry.npmjs.org/react/-/react-19.2.4.tgz#438e57baa19b77cb23aab516cf635cd0579ee09a" + integrity sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ== + read-cmd-shim@3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-3.0.0.tgz#62b8c638225c61e6cc607f8f4b779f3b8238f155" @@ -9116,27 +9121,27 @@ rimraf@^4.4.1: dependencies: glob "^9.2.0" -rolldown@^1.0.0-rc.4: - version "1.0.0-rc.4" - resolved "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.4.tgz#c22246260ab3da62caa209556e26d81fe516cf10" - integrity sha512-V2tPDUrY3WSevrvU2E41ijZlpF+5PbZu4giH+VpNraaadsJGHa4fR6IFwsocVwEXDoAdIv5qgPPxgrvKAOIPtA== +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== dependencies: - "@oxc-project/types" "=0.113.0" - "@rolldown/pluginutils" "1.0.0-rc.4" + "@oxc-project/types" "=0.115.0" + "@rolldown/pluginutils" "1.0.0-rc.6" optionalDependencies: - "@rolldown/binding-android-arm64" "1.0.0-rc.4" - "@rolldown/binding-darwin-arm64" "1.0.0-rc.4" - "@rolldown/binding-darwin-x64" "1.0.0-rc.4" - "@rolldown/binding-freebsd-x64" "1.0.0-rc.4" - "@rolldown/binding-linux-arm-gnueabihf" "1.0.0-rc.4" - "@rolldown/binding-linux-arm64-gnu" "1.0.0-rc.4" - "@rolldown/binding-linux-arm64-musl" "1.0.0-rc.4" - "@rolldown/binding-linux-x64-gnu" "1.0.0-rc.4" - "@rolldown/binding-linux-x64-musl" "1.0.0-rc.4" - "@rolldown/binding-openharmony-arm64" "1.0.0-rc.4" - "@rolldown/binding-wasm32-wasi" "1.0.0-rc.4" - "@rolldown/binding-win32-arm64-msvc" "1.0.0-rc.4" - "@rolldown/binding-win32-x64-msvc" "1.0.0-rc.4" + "@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" rollup@3.2.0: version "3.2.0" From e93d58631857750ac2cffe3b25272238d51a62a1 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Sat, 28 Feb 2026 11:55:32 +0000 Subject: [PATCH 02/11] make it faster and better --- .github/workflows/checks.yml | 14 - nx.json | 19 +- package.json | 5 +- .../fixtures/rolldown/application-key.test.ts | 14 + .../rolldown/basic-release-disabled.test.ts | 14 + .../rolldown/basic-sourcemaps.config.ts | 9 +- .../rolldown/basic-sourcemaps.test.ts | 24 ++ .../fixtures/rolldown/basic.config.ts | 9 +- .../fixtures/rolldown/basic.test.ts | 22 ++ .../fixtures/rolldown/build-info.config.ts | 18 ++ .../fixtures/rolldown/build-info.test.ts | 14 + .../bundle-size-optimizations.config.ts | 22 ++ .../bundle-size-optimizations.test.ts | 27 ++ .../component-annotation-disabled.test.ts | 25 ++ .../component-annotation-next.test.ts | 31 +++ .../rolldown/component-annotation.test.ts | 36 +++ .../rolldown/debugid-disabled.test.ts | 16 ++ .../debugids-already-injected.config.ts | 1 + .../debugids-already-injected.test.ts | 21 ++ .../fixtures/rolldown/module-metadata.test.ts | 17 ++ .../rolldown/multiple-entry-points.test.ts | 40 +++ .../fixtures/rolldown/package.json | 1 + .../fixtures/rolldown/query-param.config.ts | 11 + .../fixtures/rolldown/query-param.test.ts | 29 ++ .../rolldown/release-disabled.config.ts | 18 ++ .../rolldown/release-disabled.test.ts | 18 ++ .../fixtures/rolldown/rolldown.test.ts | 253 ------------------ .../fixtures/rolldown/src/bundle.js | 10 + .../fixtures/rolldown/utils.ts | 60 +++++ .../integration-tests-next/fixtures/utils.ts | 58 +++- packages/integration-tests-next/package.json | 6 +- packages/integration-tests-next/tsconfig.json | 3 +- patches/@sentry+cli+2.58.5.patch | 17 ++ yarn.lock | 192 ++++++++++++- 34 files changed, 775 insertions(+), 299 deletions(-) create mode 100644 packages/integration-tests-next/fixtures/rolldown/application-key.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/basic.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/build-info.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/build-info.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/component-annotation-next.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/component-annotation.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/debugid-disabled.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/module-metadata.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/query-param.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/query-param.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/release-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/release-disabled.test.ts delete mode 100644 packages/integration-tests-next/fixtures/rolldown/rolldown.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/src/bundle.js create mode 100644 packages/integration-tests-next/fixtures/rolldown/utils.ts create mode 100644 patches/@sentry+cli+2.58.5.patch diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index cf6fe299..ee7da062 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -145,13 +145,6 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }} - - name: Use build cache - uses: actions/cache@v4 - with: - path: .nxcache - key: build-cache-key-${{ runner.os }}-${{ github.run_id }} - restore-keys: | - build-cache-key-${{ runner.os }}- - name: Install dependencies run: yarn --frozen-lockfile --ignore-engines if: steps.dependency-cache.outputs.cache-hit != 'true' @@ -182,13 +175,6 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }} - - name: Use build cache - uses: actions/cache@v4 - with: - path: .nxcache - key: build-cache-key-${{ runner.os }}-${{ github.run_id }} - restore-keys: | - build-cache-key-${{ runner.os }}- - name: Install dependencies run: yarn --frozen-lockfile --ignore-engines if: steps.dependency-cache.outputs.cache-hit != 'true' diff --git a/nx.json b/nx.json index b3f81064..3370dbfa 100644 --- a/nx.json +++ b/nx.json @@ -1,30 +1,28 @@ { "$schema": "./node_modules/nx/schemas/nx-schema.json", "namedInputs": { + "default": ["{projectRoot}/**/*", "sharedGlobals"], "sharedGlobals": ["{workspaceRoot}/*.js", "{workspaceRoot}/*.json", "{workspaceRoot}/yarn.lock"] }, "targetDefaults": { "build": { - "inputs": ["sharedGlobals"], + "inputs": ["default"], "dependsOn": ["^build"], "outputs": ["{projectRoot}/dist"], "cache": true }, "lint": { - "inputs": ["sharedGlobals"], + "inputs": ["default"], "dependsOn": ["^build", "build"], - "outputs": [], "cache": true }, "test": { - "inputs": ["sharedGlobals"], - "outputs": [], - "cache": true + "inputs": ["default"], + "cache": false }, "check:types": { - "inputs": ["sharedGlobals"], - "dependsOn": ["^build"], - "outputs": [] + "inputs": ["default"], + "dependsOn": ["^build"] }, "build:npm": { "dependsOn": ["build", "^build"] @@ -33,5 +31,8 @@ "cacheDirectory": ".nxcache", "tui": { "autoExit": true + }, + "nxCloudOptions": { + "detectFlakyTasks": false } } diff --git a/package.json b/package.json index 130ba83a..6c4439aa 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,11 @@ "packages/tsconfigs", "packages/vite-plugin", "packages/webpack-plugin", + "packages/integration-tests-next", "packages/integration-tests-next/fixtures/rolldown" ], "scripts": { + "postinstall": "patch-package", "build": "nx run-many --target=build --all", "build:watch": "nx run-many --target=build:watch --all", "build:graph": "nx graph", @@ -43,7 +45,8 @@ "npm-run-all": "^4.1.5", "nx": "22.5.2", "oxfmt": "^0.33.0", - "ts-node": "^10.9.2" + "ts-node": "^10.9.2", + "patch-package": "^8.0.1" }, "volta": { "node": "22.22.0", diff --git a/packages/integration-tests-next/fixtures/rolldown/application-key.test.ts b/packages/integration-tests-next/fixtures/rolldown/application-key.test.ts new file mode 100644 index 00000000..99e7f1fd --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/application-key.test.ts @@ -0,0 +1,14 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles }) => { + runRolldown(); + 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 { + runRolldown(); + 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", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts index 8c1cfb39..56b5a6f5 100644 --- a/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts @@ -7,5 +7,12 @@ export default defineConfig({ file: "out/basic-sourcemaps/basic.js", sourcemap: true, }, - plugins: [sentryRollupPlugin({ telemetry: false })], + plugins: [ + sentryRollupPlugin({ + telemetry: false, + authToken: "fake-auth", + org: "fake-org", + project: "fake-project", + }), + ], }); diff --git a/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts b/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts new file mode 100644 index 00000000..390d99bb --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts @@ -0,0 +1,24 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { + runRolldown(); + 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 + //# 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"}", + "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/rolldown/basic.config.ts b/packages/integration-tests-next/fixtures/rolldown/basic.config.ts index 83642850..689db6b9 100644 --- a/packages/integration-tests-next/fixtures/rolldown/basic.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/basic.config.ts @@ -6,5 +6,12 @@ export default defineConfig({ output: { file: "out/basic/basic.js", }, - plugins: [sentryRollupPlugin({ telemetry: false })], + plugins: [ + sentryRollupPlugin({ + telemetry: false, + authToken: "fake-auth", + org: "fake-org", + project: "fake-project", + }), + ], }); diff --git a/packages/integration-tests-next/fixtures/rolldown/basic.test.ts b/packages/integration-tests-next/fixtures/rolldown/basic.test.ts new file mode 100644 index 00000000..e8754b21 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/basic.test.ts @@ -0,0 +1,22 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { + runRolldown(); + 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", + "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/rolldown/build-info.config.ts b/packages/integration-tests-next/fixtures/rolldown/build-info.config.ts new file mode 100644 index 00000000..6d059dae --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/build-info.config.ts @@ -0,0 +1,18 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/build-info/basic.js", + }, + plugins: [ + sentryRollupPlugin({ + telemetry: false, + release: { + name: "build-information-injection-test", + }, + _experiments: { injectBuildInformation: true }, + }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/build-info.test.ts b/packages/integration-tests-next/fixtures/rolldown/build-info.test.ts new file mode 100644 index 00000000..57c07363 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/build-info.test.ts @@ -0,0 +1,14 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles }) => { + runRolldown(); + 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":["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.config.ts b/packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.config.ts new file mode 100644 index 00000000..c7cbbd24 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.config.ts @@ -0,0 +1,22 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/bundle.js", + output: { + file: "out/bundle-size-optimizations/bundle.js", + }, + plugins: [ + sentryRollupPlugin({ + telemetry: false, + bundleSizeOptimizations: { + excludeDebugStatements: true, + excludeTracing: true, + excludeReplayCanvas: true, + excludeReplayIframe: true, + excludeReplayShadowDom: true, + excludeReplayWorker: true, + }, + }), + ], +}); 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 new file mode 100644 index 00000000..7f7c1b6a --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.test.ts @@ -0,0 +1,27 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { + runRolldown(); + 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({ + debug: "b", + trace: "b", + replayCanvas: "a", + replayIframe: "a", + replayShadowDom: "a", + replayWorker: "a" + })); + + //#endregion", + } + `); + + 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/rolldown/component-annotation-disabled.test.ts b/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.test.ts new file mode 100644 index 00000000..f6579e7a --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.test.ts @@ -0,0 +1,25 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles }) => { + runRolldown(); + 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]="ea5adc74-2664-4c38-8492-6e4971efd2be",e._sentryDebugIdIdentifier="sentry-dbid-ea5adc74-2664-4c38-8492-6e4971efd2be");}catch(e){}}();import { jsx, jsxs } from "../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 };", + } + `); +}); 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 new file mode 100644 index 00000000..22d0fb42 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.test.ts @@ -0,0 +1,31 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles }) => { + runRolldown(); + 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]="aa1666c7-eaca-4b84-8c40-9ac56cc75bfb",e._sentryDebugIdIdentifier="sentry-dbid-aa1666c7-eaca-4b84-8c40-9ac56cc75bfb");}catch(e){}}();import { jsx, jsxs } from "../node_modules/react/jsx-runtime.js"; + + //#region src/component-a.jsx + function ComponentA() { + return /* @__PURE__ */ jsx("span", { + "data-sentry-component": "ComponentA", + children: "Component A" + }); + } + + //#endregion + //#region src/app.jsx + function App() { + return /* @__PURE__ */ jsxs("span", { + "data-sentry-component": "App", + children: [/* @__PURE__ */ jsx(ComponentA, {}), ";"] + }); + } + + //#endregion + 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 new file mode 100644 index 00000000..cf57acfb --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation.test.ts @@ -0,0 +1,36 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles }) => { + runRolldown(); + 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]="adb3af3a-5b4a-49fd-b8ae-7ea0905020b6",e._sentryDebugIdIdentifier="sentry-dbid-adb3af3a-5b4a-49fd-b8ae-7ea0905020b6");}catch(e){}}();import { jsx, jsxs } from "../node_modules/react/jsx-runtime.js"; + + //#region src/component-a.jsx + function ComponentA() { + return /* @__PURE__ */ jsx("span", { + "data-sentry-component": "ComponentA", + "data-sentry-source-file": "component-a.jsx", + children: "Component A" + }); + } + + //#endregion + //#region src/app.jsx + 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" + }), ";"] + }); + } + + //#endregion + 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 new file mode 100644 index 00000000..37f9debd --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.test.ts @@ -0,0 +1,16 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles }) => { + runRolldown(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "//#region src/basic.js + 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":";AACA,QAAQ,IAAI,cAAc"}", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts b/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts index 426b4449..4a31b424 100644 --- a/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts @@ -11,6 +11,7 @@ export default defineConfig({ plugins: [ sentryRollupPlugin({ telemetry: false, + // We need to specify these so that upload is attempted. Debug IDs will be injected before then... authToken: "fake-auth", org: "fake-org", project: "fake-project", 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 new file mode 100644 index 00000000..19d68f7a --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.test.ts @@ -0,0 +1,21 @@ +import { expect } from "vitest"; +import { readAllFiles } from "../utils"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, createTempDir }) => { + const tempDir = createTempDir(); + + runRolldown({ 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"); + + //#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"}", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/module-metadata.test.ts b/packages/integration-tests-next/fixtures/rolldown/module-metadata.test.ts new file mode 100644 index 00000000..74ef2b31 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/module-metadata.test.ts @@ -0,0 +1,17 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { + runRolldown(); + 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 { + runRolldown(); + 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", + } + `); + + 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/rolldown/package.json b/packages/integration-tests-next/fixtures/rolldown/package.json index 1f7c8ed2..7ac86b51 100644 --- a/packages/integration-tests-next/fixtures/rolldown/package.json +++ b/packages/integration-tests-next/fixtures/rolldown/package.json @@ -2,6 +2,7 @@ "name": "rolldown-integration-tests", "version": "1.0.0", "private": true, + "type": "module", "dependencies": { "react": "^19.2.4", "rolldown": "^1.0.0-rc.6" diff --git a/packages/integration-tests-next/fixtures/rolldown/query-param.config.ts b/packages/integration-tests-next/fixtures/rolldown/query-param.config.ts new file mode 100644 index 00000000..d7697c48 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/query-param.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: ["src/entry1.js", "src/entry2.js"], + output: { + dir: "out/query-param", + chunkFileNames: "[name].js?seP58q4g", + }, + plugins: [sentryRollupPlugin({ telemetry: false })], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/query-param.test.ts b/packages/integration-tests-next/fixtures/rolldown/query-param.test.ts new file mode 100644 index 00000000..33920620 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/query-param.test.ts @@ -0,0 +1,29 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles }) => { + runRolldown(); + 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) { + 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"; + + //#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"; + + //#region src/entry2.js + console.log(add(2, 4)); + + //#endregion", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/release-disabled.config.ts b/packages/integration-tests-next/fixtures/rolldown/release-disabled.config.ts new file mode 100644 index 00000000..ac3468c0 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/release-disabled.config.ts @@ -0,0 +1,18 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/release-disabled/basic.js", + }, + plugins: [ + sentryRollupPlugin({ + telemetry: false, + authToken: "fake-auth", + org: "fake-org", + project: "fake-project", + release: { create: false }, + }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/release-disabled.test.ts b/packages/integration-tests-next/fixtures/rolldown/release-disabled.test.ts new file mode 100644 index 00000000..dfb0642d --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/release-disabled.test.ts @@ -0,0 +1,18 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles }) => { + runRolldown(); + 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", + "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/rolldown.test.ts b/packages/integration-tests-next/fixtures/rolldown/rolldown.test.ts deleted file mode 100644 index 0faf3b11..00000000 --- a/packages/integration-tests-next/fixtures/rolldown/rolldown.test.ts +++ /dev/null @@ -1,253 +0,0 @@ -import { describe, test, expect, beforeAll } from "vitest"; -import { runBundler, readAllFiles } from "../utils"; -import { join } from "node:path"; -import { rmSync, mkdtempSync } from "node:fs"; -import { tmpdir } from "node:os"; -import { randomUUID } from "node:crypto"; - -const __dirname = new URL(".", import.meta.url).pathname; - -const tempDirs: string[] = []; - -function createTempDir(): string { - const tempDir = mkdtempSync(join(tmpdir(), "sentry-bundler-plugin-" + randomUUID())); - tempDirs.push(tempDir); - return tempDir; -} - -process.on("exit", () => { - for (const dir of tempDirs) { - rmSync(dir, { recursive: true, force: true }); - } -}); - -function runRolldown( - config: string, - env: Record = { ...process.env } -): void { - runBundler(`rolldown --config ${config}`, { cwd: __dirname }, { ...process.env, ...env }); -} - -describe("rolldown", () => { - beforeAll(() => { - const outputDir = join(__dirname, "out"); - rmSync(outputDir, { recursive: true, force: true }); - }); - - test("Basic", () => { - runRolldown("basic.config.ts"); - const files = readAllFiles(join(__dirname, "out", "basic")); - expect(files).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", - } - `); - }); - - test("Basic with sourcemaps", () => { - runRolldown("basic-sourcemaps.config.ts"); - const files = readAllFiles(join(__dirname, "out", "basic-sourcemaps")); - expect(files).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 - //# 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"}", - } - `); - }); - - test("Release injection disabled", () => { - runRolldown("basic-release-disabled.config.ts"); - const files = readAllFiles(join(__dirname, "out", "basic-release-disabled")); - expect(files).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", - } - `); - }); - - test("Debug ID injection disabled", () => { - runRolldown("debugid-disabled.config.ts"); - const files = readAllFiles(join(__dirname, "out", "debugid-disabled")); - expect(files).toMatchInlineSnapshot(` - { - "basic.js": "//#region src/basic.js - 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":";AACA,QAAQ,IAAI,cAAc"}", - } - `); - }); - - test("Debug IDs already injected", () => { - const tempDir = createTempDir(); - - runRolldown("debugids-already-injected.config.ts", { 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"); - - //#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"}", - } - `); - }); - - test("Module metadata injection", () => { - runRolldown("module-metadata.config.ts"); - const files = readAllFiles(join(__dirname, "out", "module-metadata")); - expect(files).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 { - runRolldown("application-key.config.ts"); - const files = readAllFiles(join(__dirname, "out", "application-key")); - expect(files).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 { - runRolldown("component-annotation.config.ts"); - const files = readAllFiles(join(__dirname, "out", "component-annotation")); - expect(files).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]="adb3af3a-5b4a-49fd-b8ae-7ea0905020b6",e._sentryDebugIdIdentifier="sentry-dbid-adb3af3a-5b4a-49fd-b8ae-7ea0905020b6");}catch(e){}}();import { jsx, jsxs } from "../node_modules/react/jsx-runtime.js"; - - //#region src/component-a.jsx - function ComponentA() { - return /* @__PURE__ */ jsx("span", { - "data-sentry-component": "ComponentA", - "data-sentry-source-file": "component-a.jsx", - children: "Component A" - }); - } - - //#endregion - //#region src/app.jsx - 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" - }), ";"] - }); - } - - //#endregion - export { App as default };", - } - `); - }); - - test("Component annotation disabled", () => { - runRolldown("component-annotation-disabled.config.ts"); - const files = readAllFiles(join(__dirname, "out", "component-annotation-disabled")); - expect(files).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]="ea5adc74-2664-4c38-8492-6e4971efd2be",e._sentryDebugIdIdentifier="sentry-dbid-ea5adc74-2664-4c38-8492-6e4971efd2be");}catch(e){}}();import { jsx, jsxs } from "../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 };", - } - `); - }); - - test("Component annotation experimental", () => { - runRolldown("component-annotation-next.config.ts"); - const files = readAllFiles(join(__dirname, "out", "component-annotation-next")); - expect(files).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]="aa1666c7-eaca-4b84-8c40-9ac56cc75bfb",e._sentryDebugIdIdentifier="sentry-dbid-aa1666c7-eaca-4b84-8c40-9ac56cc75bfb");}catch(e){}}();import { jsx, jsxs } from "../node_modules/react/jsx-runtime.js"; - - //#region src/component-a.jsx - function ComponentA() { - return /* @__PURE__ */ jsx("span", { - "data-sentry-component": "ComponentA", - children: "Component A" - }); - } - - //#endregion - //#region src/app.jsx - function App() { - return /* @__PURE__ */ jsxs("span", { - "data-sentry-component": "App", - children: [/* @__PURE__ */ jsx(ComponentA, {}), ";"] - }); - } - - //#endregion - export { App as default };", - } - `); - }); - - test("Multiple entry points", () => { - runRolldown("multiple-entry-points.config.ts"); - const files = readAllFiles(join(__dirname, "out", "multiple-entry-points")); - expect(files).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", - } - `); - }); -}); diff --git a/packages/integration-tests-next/fixtures/rolldown/src/bundle.js b/packages/integration-tests-next/fixtures/rolldown/src/bundle.js new file mode 100644 index 00000000..0d62e559 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/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/rolldown/utils.ts b/packages/integration-tests-next/fixtures/rolldown/utils.ts new file mode 100644 index 00000000..e6a1590c --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/utils.ts @@ -0,0 +1,60 @@ +import { basename, dirname, join } from "node:path"; +import { createTempDir, readAllFiles, runBundler } from "../utils"; +import { fileURLToPath } from "node:url"; +import { rmSync } from "node:fs"; +import { 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; + runRolldown: (env?: Record) => void; + readOutputFiles: () => Record; + runFileInNode: (file: string) => string; + createTempDir: () => string; +}) => void; + +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 }); + + // Rolldown requires Node 20+ + if (NODE_MAJOR_VERSION <= 18) { + // eslint-disable-next-line @typescript-eslint/no-empty-function + vitestTest.skip(testName); + } else { + vitestTest(`rolldown > ${testName}`, () => + callback({ + outDir, + runRolldown: (env) => + runBundler( + `rolldown --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(), + }) + ); + } +} diff --git a/packages/integration-tests-next/fixtures/utils.ts b/packages/integration-tests-next/fixtures/utils.ts index a8fa649e..998dc4b0 100644 --- a/packages/integration-tests-next/fixtures/utils.ts +++ b/packages/integration-tests-next/fixtures/utils.ts @@ -1,16 +1,24 @@ -import { execSync } from "node:child_process"; -import { readdirSync, readFileSync, statSync } from "node:fs"; +import { execSync, ExecSyncOptions } from "node:child_process"; +import { randomUUID } from "node:crypto"; +import { mkdtempSync, readdirSync, readFileSync, rmSync, statSync } from "node:fs"; +import { tmpdir } from "node:os"; import { join } from "node:path"; const DEBUG = !!process.env["DEBUG"]; const CURRENT_SHA = execSync("git rev-parse HEAD", { encoding: "utf-8" }).trim(); -export function runBundler( - command: string, - options: { cwd: string }, - env: Record -): void { - execSync(command, { cwd: options.cwd, stdio: DEBUG ? "inherit" : "ignore", env }); +type SourceMap = { + sources: string[]; + sourcesContent: string[]; +}; + +export function runBundler(command: string, opt: ExecSyncOptions, outDir?: string): void { + if (outDir) { + // We've patched the sentry-cli helper to write the args to a file instead of actually executing the command + opt.env = { ...opt.env, SENTRY_CLI_FILE_APPEND: join(outDir, "sentry-cli-mock.json") }; + } + + execSync(command, { stdio: DEBUG ? "inherit" : "ignore", ...opt }); } export function readAllFiles(directory: string): Record { @@ -24,10 +32,42 @@ export function readAllFiles(directory: string): Record { if (stat.isFile()) { let contents = readFileSync(fullPath, "utf-8"); // We replace the current SHA with a placeholder to make snapshots deterministic - contents = contents.replace(CURRENT_SHA, "CURRENT_SHA"); + contents = contents.replaceAll(CURRENT_SHA, "CURRENT_SHA"); + contents = contents.replaceAll(/"nodeVersion":\d+/g, `"nodeVersion":"NODE_VERSION"`); + + // Normalize Windows stuff in .map paths + if (entry.endsWith(".map")) { + const map = JSON.parse(contents) as SourceMap; + map.sources = map.sources.map((c) => c.replace(/\\/g, "/")); + map.sourcesContent = map.sourcesContent.map((c) => c.replace(/\r\n/g, "\n")); + contents = JSON.stringify(map); + } else if (entry === "sentry-cli-mock.json") { + // Remove the temporary directory path too + contents = contents.replace( + /"[^"]+sentry-bundler-plugin-upload.+?",/g, + '"sentry-bundler-plugin-upload-path",' + ); + } else { + // Normalize Windows line endings for cross-platform snapshots + contents = contents.replace(/\r\n/g, "\n"); + } files[entry] = contents; } } return files; } + +const tempDirs: string[] = []; + +export function createTempDir(): string { + const tempDir = mkdtempSync(join(tmpdir(), "sentry-bundler-plugin-" + randomUUID())); + tempDirs.push(tempDir); + return tempDir; +} + +process.on("exit", () => { + for (const dir of tempDirs) { + rmSync(dir, { recursive: true, force: true }); + } +}); diff --git a/packages/integration-tests-next/package.json b/packages/integration-tests-next/package.json index 2e013b69..3942ef13 100644 --- a/packages/integration-tests-next/package.json +++ b/packages/integration-tests-next/package.json @@ -4,7 +4,7 @@ "license": "MIT", "private": true, "scripts": { - "test": "vitest run", + "test": "vitest run --pool threads", "lint": "eslint .", "check:types": "tsc --project ./tsconfig.json --noEmit", "clean": "run-s clean:build", @@ -13,7 +13,6 @@ "clean:deps": "premove node_modules" }, "dependencies": { - "@babel/preset-react": "^7.23.3", "@sentry-internal/eslint-config": "5.1.1", "@sentry-internal/sentry-bundler-plugin-tsconfig": "5.1.1", "@sentry/esbuild-plugin": "5.1.1", @@ -22,7 +21,8 @@ "@sentry/webpack-plugin": "5.1.1" }, "devDependencies": { - "premove": "^4.0.0" + "premove": "^4.0.0", + "vitest": "^4.0.0" }, "volta": { "extends": "../../package.json" diff --git a/packages/integration-tests-next/tsconfig.json b/packages/integration-tests-next/tsconfig.json index b9db0756..656010c6 100644 --- a/packages/integration-tests-next/tsconfig.json +++ b/packages/integration-tests-next/tsconfig.json @@ -4,6 +4,7 @@ "include": ["./**/*"], "compilerOptions": { "types": ["node"], - "module": "es2020" + "module": "es2020", + "lib": ["ES2021"] } } diff --git a/patches/@sentry+cli+2.58.5.patch b/patches/@sentry+cli+2.58.5.patch new file mode 100644 index 00000000..ea1f6fbe --- /dev/null +++ b/patches/@sentry+cli+2.58.5.patch @@ -0,0 +1,17 @@ +diff --git a/node_modules/@sentry/cli/js/helper.js b/node_modules/@sentry/cli/js/helper.js +index 56f95c9..c70f216 100644 +--- a/node_modules/@sentry/cli/js/helper.js ++++ b/node_modules/@sentry/cli/js/helper.js +@@ -298,6 +298,12 @@ function execute(args_1, live_1, silent_1, configFile_1) { + if (config.customHeader) { + env.CUSTOM_HEADER = config.customHeader; + } ++ ++ if (process.env['SENTRY_CLI_FILE_APPEND']) { ++ fs.appendFileSync(process.env['SENTRY_CLI_FILE_APPEND'], JSON.stringify(args) + ',\n'); ++ return Promise.resolve(); ++ } ++ + else if (config.headers) { + const headers = Object.entries(config.headers).flatMap(([key, value]) => [ + '--header', diff --git a/yarn.lock b/yarn.lock index bed257c1..1e085e00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2493,6 +2493,13 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" +braces@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + browserslist@^4.14.3: version "4.28.1" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" @@ -2561,7 +2568,7 @@ cacache@^15.0.5: tar "^6.0.2" unique-filename "^1.1.1" -call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: +call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== @@ -2577,6 +2584,24 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" +call-bind@^1.0.8: + version "1.0.8" + resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" + integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== + dependencies: + call-bind-apply-helpers "^1.0.0" + es-define-property "^1.0.0" + get-intrinsic "^1.2.4" + set-function-length "^1.2.2" + +call-bound@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" + integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== + dependencies: + call-bind-apply-helpers "^1.0.2" + get-intrinsic "^1.3.0" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -2624,6 +2649,11 @@ chrome-trace-event@^1.0.2: resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== +ci-info@^3.7.0: + version "3.9.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== + clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" @@ -2768,6 +2798,15 @@ cross-spawn@^7.0.2: shebang-command "^2.0.0" which "^2.0.1" +cross-spawn@^7.0.3: + version "7.0.6" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + csstype@^3.0.2: version "3.1.3" resolved "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" @@ -2804,6 +2843,15 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" +define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" @@ -3003,7 +3051,7 @@ es-abstract@^1.19.0, es-abstract@^1.20.4: unbox-primitive "^1.0.2" which-typed-array "^1.1.9" -es-define-property@^1.0.1: +es-define-property@^1.0.0, es-define-property@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== @@ -3706,6 +3754,13 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + finalhandler@1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" @@ -3744,6 +3799,13 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" +find-yarn-workspace-root@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" + integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== + dependencies: + micromatch "^4.0.2" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -3821,6 +3883,15 @@ fs-constants@^1.0.0: resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== +fs-extra@^10.0.0: + version "10.1.0" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-minipass@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -3888,7 +3959,7 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@ has-proto "^1.0.1" has-symbols "^1.0.3" -get-intrinsic@^1.2.6: +get-intrinsic@^1.2.4, get-intrinsic@^1.2.6, get-intrinsic@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== @@ -4014,7 +4085,7 @@ gopd@^1.2.0: resolved "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== -graceful-fs@^4.1.2, graceful-fs@^4.2.4, graceful-fs@^4.2.9: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -4051,6 +4122,13 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.1.1" +has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + has-proto@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" @@ -4372,13 +4450,18 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" -is-wsl@^2.2.0: +is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== dependencies: is-docker "^2.0.0" +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isexe@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -4467,6 +4550,17 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== +json-stable-stringify@^1.0.2: + version "1.3.0" + resolved "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz#8903cfac42ea1a0f97f35d63a4ce0518f0cc6a70" + integrity sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.4" + isarray "^2.0.5" + jsonify "^0.0.1" + object-keys "^1.1.1" + json5@^2.1.2, json5@^2.2.1, json5@^2.2.2, json5@^2.2.3: version "2.2.3" resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" @@ -4477,6 +4571,20 @@ jsonc-parser@3.2.0: resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== +jsonfile@^6.0.1: + version "6.2.0" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz#7c265bd1b65de6977478300087c99f1c84383f62" + integrity sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonify@^0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978" + integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg== + "jsx-ast-utils@^2.4.1 || ^3.0.0": version "3.3.3" resolved "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz#76b3e6e6cece5c69d49a5792c3d01bd1a0cdc7ea" @@ -4485,6 +4593,13 @@ jsonc-parser@3.2.0: array-includes "^3.1.5" object.assign "^4.1.3" +klaw-sync@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" + integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== + dependencies: + graceful-fs "^4.1.11" + levn@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -4653,6 +4768,14 @@ methods@~1.1.2: resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== +micromatch@^4.0.2: + version "4.0.8" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== + dependencies: + braces "^3.0.3" + picomatch "^2.3.1" + micromatch@^4.0.4: version "4.0.5" resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" @@ -5020,6 +5143,14 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" +open@^7.4.2: + version "7.4.2" + resolved "https://registry.npmjs.org/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" + integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" + open@^8.4.0: version "8.4.2" resolved "https://registry.npmjs.org/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9" @@ -5142,6 +5273,26 @@ parseurl@~1.3.3: resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== +patch-package@^8.0.1: + version "8.0.1" + resolved "https://registry.npmjs.org/patch-package/-/patch-package-8.0.1.tgz#79d02f953f711e06d1f8949c8a13e5d3d7ba1a60" + integrity sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw== + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + chalk "^4.1.2" + ci-info "^3.7.0" + cross-spawn "^7.0.3" + find-yarn-workspace-root "^2.0.0" + fs-extra "^10.0.0" + json-stable-stringify "^1.0.2" + klaw-sync "^6.0.0" + minimist "^1.2.6" + open "^7.4.2" + semver "^7.5.3" + slash "^2.0.0" + tmp "^0.2.4" + yaml "^2.2.2" + path-exists@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -5609,7 +5760,7 @@ semver@^7.3.5, semver@^7.3.7: dependencies: lru-cache "^6.0.0" -semver@^7.6.3: +semver@^7.5.3, semver@^7.6.3: version "7.7.4" resolved "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz#28464e36060e991fa7a11d0279d2d3f3b57a7e8a" integrity sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA== @@ -5657,6 +5808,18 @@ serve-static@1.15.0: parseurl "~1.3.3" send "0.18.0" +set-function-length@^1.2.2: + version "1.2.2" + resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + setprototypeof@1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" @@ -5710,6 +5873,11 @@ signal-exit@^3.0.2: resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + slash@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -6022,6 +6190,11 @@ tinyrainbow@^3.0.3: resolved "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.0.3.tgz#984a5b1c1b25854a9b6bccbe77964d0593d1ea42" integrity sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q== +tmp@^0.2.4: + version "0.2.5" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz#b06bcd23f0f3c8357b426891726d16015abfd8f8" + integrity sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow== + tmp@~0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" @@ -6169,6 +6342,11 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" +universalify@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" + integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== + unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -6473,7 +6651,7 @@ yallist@^4.0.0: resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^2.6.0: +yaml@^2.2.2, yaml@^2.6.0: version "2.8.2" resolved "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz#5694f25eca0ce9c3e7a9d9e00ce0ddabbd9e35c5" integrity sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A== From 61b1a3602d1d0d6a257298d55ebe324dcedd0c70 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Sun, 1 Mar 2026 21:42:37 +0100 Subject: [PATCH 03/11] disable query param test on Windows --- .../fixtures/rolldown/query-param.test.ts | 7 ++++++- packages/integration-tests-next/fixtures/rolldown/utils.ts | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) 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 33920620..76cf7baf 100644 --- a/packages/integration-tests-next/fixtures/rolldown/query-param.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/query-param.test.ts @@ -1,7 +1,12 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles }) => { +test(import.meta.url, ({ runRolldown, readOutputFiles, ctx }) => { + if (process.platform === "win32") { + ctx.skip("Query params do not work in paths on Windows"); + return; + } + runRolldown(); expect(readOutputFiles()).toMatchInlineSnapshot(` { diff --git a/packages/integration-tests-next/fixtures/rolldown/utils.ts b/packages/integration-tests-next/fixtures/rolldown/utils.ts index e6a1590c..b23c6f16 100644 --- a/packages/integration-tests-next/fixtures/rolldown/utils.ts +++ b/packages/integration-tests-next/fixtures/rolldown/utils.ts @@ -2,7 +2,7 @@ import { basename, dirname, join } from "node:path"; import { createTempDir, readAllFiles, runBundler } from "../utils"; import { fileURLToPath } from "node:url"; import { rmSync } from "node:fs"; -import { test as vitestTest } from "vitest"; +import { TestContext, test as vitestTest } from "vitest"; import { execSync } from "node:child_process"; const cwd = dirname(fileURLToPath(import.meta.url)); @@ -14,6 +14,7 @@ type TestCallback = (props: { readOutputFiles: () => Record; runFileInNode: (file: string) => string; createTempDir: () => string; + ctx: TestContext; }) => void; export function test(url: string, callback: TestCallback) { @@ -30,7 +31,7 @@ export function test(url: string, callback: TestCallback) { // eslint-disable-next-line @typescript-eslint/no-empty-function vitestTest.skip(testName); } else { - vitestTest(`rolldown > ${testName}`, () => + vitestTest(`rolldown > ${testName}`, (ctx) => callback({ outDir, runRolldown: (env) => @@ -54,6 +55,7 @@ export function test(url: string, callback: TestCallback) { }).toString(); }, createTempDir: () => createTempDir(), + ctx, }) ); } From c182d2680e8b9025a6a4f34622190d9a483a0baa Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 3 Mar 2026 15:44:28 +0100 Subject: [PATCH 04/11] more tests --- .../src/sentry/transports.ts | 8 ++++++++ .../rolldown/after-upload-deletion.config.ts | 18 ++++++++++++++++++ .../rolldown/after-upload-deletion.test.ts | 18 ++++++++++++++++++ .../fixtures/rolldown/telemetry.config.ts | 10 ++++++++++ .../fixtures/rolldown/telemetry.test.ts | 19 +++++++++++++++++++ .../fixtures/rolldown/utils.ts | 2 +- .../integration-tests-next/fixtures/utils.ts | 17 ++++++++++++++--- patches/@sentry+cli+2.58.5.patch | 9 +++++---- 8 files changed, 93 insertions(+), 8 deletions(-) create mode 100644 packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.test.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/telemetry.config.ts create mode 100644 packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts diff --git a/packages/bundler-plugin-core/src/sentry/transports.ts b/packages/bundler-plugin-core/src/sentry/transports.ts index 49169d81..ba4112af 100644 --- a/packages/bundler-plugin-core/src/sentry/transports.ts +++ b/packages/bundler-plugin-core/src/sentry/transports.ts @@ -12,6 +12,8 @@ import type { TransportRequest, TransportRequestExecutor, } from "@sentry/types"; +import { join } from "node:path"; +import { appendFileSync } from "node:fs"; // Estimated maximum size for reasonable standalone event const GZIP_THRESHOLD = 1024 * 32; @@ -119,6 +121,12 @@ export function makeOptionallyEnabledNodeTransport( } if (await shouldSendTelemetry) { + if (process.env["SENTRY_TEST_OUT_DIR"]) { + const path = join(process.env["SENTRY_TEST_OUT_DIR"], "sentry-telemetry.json"); + appendFileSync(path, JSON.stringify(request) + ",\n"); + return { statusCode: 200 }; + } + return nodeTransport.send(request); } diff --git a/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.config.ts b/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.config.ts new file mode 100644 index 00000000..dd228f17 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.config.ts @@ -0,0 +1,18 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/after-upload-deletion/basic.js", + sourcemap: true, + }, + plugins: [ + sentryRollupPlugin({ + telemetry: false, + sourcemaps: { + filesToDeleteAfterUpload: ["out/after-upload-deletion/basic.js.map"], + }, + }), + ], +}); 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 new file mode 100644 index 00000000..2adae022 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.test.ts @@ -0,0 +1,18 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { + runRolldown(); + 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 + //# sourceMappingURL=basic.js.map", + } + `); + + const output = runFileInNode("basic.js"); + expect(output).toBe("hello world\n"); +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/telemetry.config.ts b/packages/integration-tests-next/fixtures/rolldown/telemetry.config.ts new file mode 100644 index 00000000..c6781218 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/telemetry.config.ts @@ -0,0 +1,10 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/telemetry/basic.js", + }, + plugins: [sentryRollupPlugin()], +}); diff --git a/packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts b/packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts new file mode 100644 index 00000000..59bddafa --- /dev/null +++ b/packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts @@ -0,0 +1,19 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { + runRolldown(); + 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", + "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/rolldown/utils.ts b/packages/integration-tests-next/fixtures/rolldown/utils.ts index e6a1590c..e01c6243 100644 --- a/packages/integration-tests-next/fixtures/rolldown/utils.ts +++ b/packages/integration-tests-next/fixtures/rolldown/utils.ts @@ -14,7 +14,7 @@ type TestCallback = (props: { readOutputFiles: () => Record; runFileInNode: (file: string) => string; createTempDir: () => string; -}) => void; +}) => void | Promise; export function test(url: string, callback: TestCallback) { const filePath = fileURLToPath(url); diff --git a/packages/integration-tests-next/fixtures/utils.ts b/packages/integration-tests-next/fixtures/utils.ts index 998dc4b0..d6fd9d31 100644 --- a/packages/integration-tests-next/fixtures/utils.ts +++ b/packages/integration-tests-next/fixtures/utils.ts @@ -15,7 +15,7 @@ type SourceMap = { export function runBundler(command: string, opt: ExecSyncOptions, outDir?: string): void { if (outDir) { // We've patched the sentry-cli helper to write the args to a file instead of actually executing the command - opt.env = { ...opt.env, SENTRY_CLI_FILE_APPEND: join(outDir, "sentry-cli-mock.json") }; + opt.env = { ...opt.env, SENTRY_TEST_OUT_DIR: outDir }; } execSync(command, { stdio: DEBUG ? "inherit" : "ignore", ...opt }); @@ -32,8 +32,9 @@ export function readAllFiles(directory: string): Record { if (stat.isFile()) { let contents = readFileSync(fullPath, "utf-8"); // We replace the current SHA with a placeholder to make snapshots deterministic - contents = contents.replaceAll(CURRENT_SHA, "CURRENT_SHA"); - contents = contents.replaceAll(/"nodeVersion":\d+/g, `"nodeVersion":"NODE_VERSION"`); + contents = contents + .replaceAll(CURRENT_SHA, "CURRENT_SHA") + .replaceAll(/"nodeVersion":\d+/g, `"nodeVersion":"NODE_VERSION"`); // Normalize Windows stuff in .map paths if (entry.endsWith(".map")) { @@ -47,6 +48,16 @@ export function readAllFiles(directory: string): Record { /"[^"]+sentry-bundler-plugin-upload.+?",/g, '"sentry-bundler-plugin-upload-path",' ); + } else if (entry === "sentry-telemetry.json") { + // Remove the temporary directory path too + contents = contents + .replace( + /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/g, + "TIMESTAMP" + ) + .replace(/[a-f0-9]{32}/g, "UUID") + .replace(/"duration":[\d.]+/g, '"duration":DURATION') + .replace(/"release":"[\d.]+"/g, '"release":"PLUGIN_VERSION"'); } else { // Normalize Windows line endings for cross-platform snapshots contents = contents.replace(/\r\n/g, "\n"); diff --git a/patches/@sentry+cli+2.58.5.patch b/patches/@sentry+cli+2.58.5.patch index ea1f6fbe..c8588ccf 100644 --- a/patches/@sentry+cli+2.58.5.patch +++ b/patches/@sentry+cli+2.58.5.patch @@ -1,14 +1,15 @@ diff --git a/node_modules/@sentry/cli/js/helper.js b/node_modules/@sentry/cli/js/helper.js -index 56f95c9..c70f216 100644 +index 56f95c9..b397122 100644 --- a/node_modules/@sentry/cli/js/helper.js +++ b/node_modules/@sentry/cli/js/helper.js -@@ -298,6 +298,12 @@ function execute(args_1, live_1, silent_1, configFile_1) { +@@ -298,6 +298,13 @@ function execute(args_1, live_1, silent_1, configFile_1) { if (config.customHeader) { env.CUSTOM_HEADER = config.customHeader; } + -+ if (process.env['SENTRY_CLI_FILE_APPEND']) { -+ fs.appendFileSync(process.env['SENTRY_CLI_FILE_APPEND'], JSON.stringify(args) + ',\n'); ++ if (process.env['SENTRY_TEST_OUT_DIR']) { ++ const out = path.join(process.env['SENTRY_TEST_OUT_DIR'], 'sentry-cli-mock.json'); ++ fs.appendFileSync(out, JSON.stringify(args) + ',\n'); + return Promise.resolve(); + } + From 5eea904f237a76b1582851122e93577cba111baa Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 3 Mar 2026 15:48:59 +0100 Subject: [PATCH 05/11] Exclude integration from unit tests --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c4439aa..faec26e2 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "clean:all": "nx run-many --target=clean:all --all && yarn", "test": "nx run-many --target=test --all --exclude=@sentry-internal/bundler-plugin-e2e-tests", "test:all": "nx run-many --target=test --all", - "test:unit": "nx run-many --target=test --all --exclude=@sentry-internal/integration-tests,@sentry-internal/bundler-plugin-e2e-tests", + "test:unit": "nx run-many --target=test --all --exclude=@sentry-internal/integration-tests,@sentry-internal/integration-tests-next,@sentry-internal/bundler-plugin-e2e-tests", "test:integration": "nx run @sentry-internal/integration-tests:test", "test:integration-next": "nx run @sentry-internal/integration-tests-next:test", "test:e2e": "nx run @sentry-internal/bundler-plugin-e2e-tests:test", From 22d4fe6ee18828d1b30485d71e237f3e126697df Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 3 Mar 2026 16:10:26 +0100 Subject: [PATCH 06/11] fix CI --- .../fixtures/rolldown/basic-release-disabled.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts b/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts index 6cca89b3..ea1a1453 100644 --- a/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts @@ -6,5 +6,5 @@ export default defineConfig({ output: { file: "out/basic-release-disabled/basic.js", }, - plugins: [sentryRollupPlugin({ telemetry: false, release: { inject: false } })], + plugins: [sentryRollupPlugin({ telemetry: false, release: { create: false, inject: false } })], }); From 457e22a1c2bcac0db83a29c5c567fa1cae2572dc Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Tue, 3 Mar 2026 16:39:18 +0100 Subject: [PATCH 07/11] Fixes from cursor PR review --- .../bundler-plugin-core/src/sentry/transports.ts | 5 +++-- patches/@sentry+cli+2.58.5.patch | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/bundler-plugin-core/src/sentry/transports.ts b/packages/bundler-plugin-core/src/sentry/transports.ts index ba4112af..0bcccee5 100644 --- a/packages/bundler-plugin-core/src/sentry/transports.ts +++ b/packages/bundler-plugin-core/src/sentry/transports.ts @@ -12,8 +12,6 @@ import type { TransportRequest, TransportRequestExecutor, } from "@sentry/types"; -import { join } from "node:path"; -import { appendFileSync } from "node:fs"; // Estimated maximum size for reasonable standalone event const GZIP_THRESHOLD = 1024 * 32; @@ -122,6 +120,9 @@ export function makeOptionallyEnabledNodeTransport( if (await shouldSendTelemetry) { if (process.env["SENTRY_TEST_OUT_DIR"]) { + // eslint-disable-next-line @typescript-eslint/unbound-method + const { join } = await import("node:path"); + const { appendFileSync } = await import("node:fs"); const path = join(process.env["SENTRY_TEST_OUT_DIR"], "sentry-telemetry.json"); appendFileSync(path, JSON.stringify(request) + ",\n"); return { statusCode: 200 }; diff --git a/patches/@sentry+cli+2.58.5.patch b/patches/@sentry+cli+2.58.5.patch index c8588ccf..975845ad 100644 --- a/patches/@sentry+cli+2.58.5.patch +++ b/patches/@sentry+cli+2.58.5.patch @@ -1,10 +1,10 @@ diff --git a/node_modules/@sentry/cli/js/helper.js b/node_modules/@sentry/cli/js/helper.js -index 56f95c9..b397122 100644 +index 56f95c9..b97e41b 100644 --- a/node_modules/@sentry/cli/js/helper.js +++ b/node_modules/@sentry/cli/js/helper.js -@@ -298,6 +298,13 @@ function execute(args_1, live_1, silent_1, configFile_1) { - if (config.customHeader) { - env.CUSTOM_HEADER = config.customHeader; +@@ -295,6 +295,13 @@ function execute(args_1, live_1, silent_1, configFile_1) { + if (config.vcsRemote) { + env.SENTRY_VCS_REMOTE = config.vcsRemote; } + + if (process.env['SENTRY_TEST_OUT_DIR']) { @@ -13,6 +13,6 @@ index 56f95c9..b397122 100644 + return Promise.resolve(); + } + - else if (config.headers) { - const headers = Object.entries(config.headers).flatMap(([key, value]) => [ - '--header', + if (config.customHeader) { + env.CUSTOM_HEADER = config.customHeader; + } From 246321a71caabad64801aa835cc7bb6c90c8a525 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Fri, 6 Mar 2026 12:49:07 +0100 Subject: [PATCH 08/11] test: Rollup integration tests --- package.json | 4 +- .../configs/after-upload-deletion.config.d.ts | 2 + .../configs/after-upload-deletion.config.js | 6 ++ .../configs/application-key.config.d.ts | 2 + .../configs/application-key.config.js | 4 ++ .../basic-release-disabled.config.d.ts | 2 + .../configs/basic-release-disabled.config.js | 4 ++ .../configs/basic-sourcemaps.config.d.ts | 2 + .../configs/basic-sourcemaps.config.js | 6 ++ .../fixtures/configs/basic.config.d.ts | 2 + .../fixtures/configs/basic.config.js | 6 ++ .../fixtures/configs/build-info.config.d.ts | 2 + .../fixtures/configs/build-info.config.js | 7 +++ .../bundle-size-optimizations.config.d.ts | 2 + .../bundle-size-optimizations.config.js | 11 ++++ .../component-annotation-disabled.config.d.ts | 2 + .../component-annotation-disabled.config.js | 3 + .../component-annotation-next.config.d.ts | 2 + .../component-annotation-next.config.js | 4 ++ .../configs/component-annotation.config.d.ts | 2 + .../configs/component-annotation.config.js | 4 ++ .../configs/debugid-disabled.config.d.ts | 2 + .../configs/debugid-disabled.config.js | 9 +++ .../debugids-already-injected.config.d.ts | 2 + .../debugids-already-injected.config.js | 7 +++ .../configs/module-metadata.config.d.ts | 2 + .../configs/module-metadata.config.js | 4 ++ .../configs/multiple-entry-points.config.d.ts | 2 + .../configs/multiple-entry-points.config.js | 4 ++ .../fixtures/configs/package.json | 3 + .../fixtures/configs/query-param.config.d.ts | 2 + .../fixtures/configs/query-param.config.js | 3 + .../configs/release-disabled.config.d.ts | 2 + .../configs/release-disabled.config.js | 7 +++ .../fixtures/configs/telemetry.config.d.ts | 2 + .../fixtures/configs/telemetry.config.js | 1 + .../rolldown/after-upload-deletion.config.ts | 10 +--- .../rolldown/after-upload-deletion.test.ts | 4 +- .../rolldown/application-key.config.ts | 3 +- .../fixtures/rolldown/application-key.test.ts | 4 +- .../rolldown/basic-release-disabled.config.ts | 3 +- .../rolldown/basic-release-disabled.test.ts | 4 +- .../rolldown/basic-sourcemaps.config.ts | 10 +--- .../rolldown/basic-sourcemaps.test.ts | 4 +- .../fixtures/rolldown/basic.config.ts | 10 +--- .../fixtures/rolldown/basic.test.ts | 4 +- .../fixtures/rolldown/build-info.config.ts | 11 +--- .../fixtures/rolldown/build-info.test.ts | 4 +- .../bundle-size-optimizations.config.ts | 15 +---- .../bundle-size-optimizations.test.ts | 4 +- .../component-annotation-disabled.config.ts | 3 +- .../component-annotation-disabled.test.ts | 34 +++++------ .../component-annotation-next.config.ts | 8 +-- .../component-annotation-next.test.ts | 46 +++++++-------- .../rolldown/component-annotation.config.ts | 3 +- .../rolldown/component-annotation.test.ts | 56 +++++++++---------- .../rolldown/debugid-disabled.config.ts | 13 +---- .../rolldown/debugid-disabled.test.ts | 4 +- .../debugids-already-injected.config.ts | 11 +--- .../debugids-already-injected.test.ts | 4 +- .../rolldown/module-metadata.config.ts | 5 +- .../fixtures/rolldown/module-metadata.test.ts | 4 +- .../rolldown/multiple-entry-points.config.ts | 3 +- .../rolldown/multiple-entry-points.test.ts | 4 +- .../fixtures/rolldown/query-param.config.ts | 3 +- .../fixtures/rolldown/query-param.test.ts | 4 +- .../rolldown/release-disabled.config.ts | 11 +--- .../rolldown/release-disabled.test.ts | 4 +- .../fixtures/rolldown/telemetry.config.ts | 3 +- .../fixtures/rolldown/telemetry.test.ts | 4 +- .../fixtures/rolldown/utils.ts | 4 +- .../rollup3/after-upload-deletion.config.ts | 12 ++++ .../rollup3/after-upload-deletion.test.ts | 17 ++++++ .../rollup3/application-key.config.ts | 11 ++++ .../fixtures/rollup3/application-key.test.ts | 13 +++++ .../rollup3/basic-release-disabled.config.ts | 11 ++++ .../rollup3/basic-release-disabled.test.ts | 13 +++++ .../rollup3/basic-sourcemaps.config.ts | 12 ++++ .../fixtures/rollup3/basic-sourcemaps.test.ts | 23 ++++++++ .../fixtures/rollup3/basic.config.ts | 11 ++++ .../fixtures/rollup3/basic.test.ts | 21 +++++++ .../fixtures/rollup3/build-info.config.ts | 11 ++++ .../fixtures/rollup3/build-info.test.ts | 13 +++++ .../bundle-size-optimizations.config.ts | 11 ++++ .../rollup3/bundle-size-optimizations.test.ts | 27 +++++++++ .../component-annotation-disabled.config.ts | 28 ++++++++++ .../component-annotation-disabled.test.ts | 26 +++++++++ .../component-annotation-next.config.ts | 28 ++++++++++ .../rollup3/component-annotation-next.test.ts | 28 ++++++++++ .../rollup3/component-annotation.config.ts | 28 ++++++++++ .../rollup3/component-annotation.test.ts | 33 +++++++++++ .../rollup3/debugid-disabled.config.ts | 12 ++++ .../fixtures/rollup3/debugid-disabled.test.ts | 15 +++++ .../debugids-already-injected.config.ts | 13 +++++ .../rollup3/debugids-already-injected.test.ts | 20 +++++++ .../rollup3/module-metadata.config.ts | 11 ++++ .../fixtures/rollup3/module-metadata.test.ts | 16 ++++++ .../rollup3/multiple-entry-points.config.ts | 12 ++++ .../rollup3/multiple-entry-points.test.ts | 35 ++++++++++++ .../fixtures/rollup3/package.json | 12 ++++ .../fixtures/rollup3/query-param.config.ts | 12 ++++ .../fixtures/rollup3/query-param.test.ts | 29 ++++++++++ .../rollup3/release-disabled.config.ts | 11 ++++ .../fixtures/rollup3/release-disabled.test.ts | 17 ++++++ .../fixtures/rollup3/src/app.jsx | 9 +++ .../fixtures/rollup3/src/basic.js | 2 + .../fixtures/rollup3/src/bundle.js | 10 ++++ .../fixtures/rollup3/src/common.js | 3 + .../fixtures/rollup3/src/component-a.jsx | 3 + .../fixtures/rollup3/src/entry1.js | 3 + .../fixtures/rollup3/src/entry2.js | 3 + .../fixtures/rollup3/telemetry.config.ts | 11 ++++ .../fixtures/rollup3/telemetry.test.ts | 18 ++++++ .../fixtures/rollup3/utils.ts | 55 ++++++++++++++++++ .../rollup4/after-upload-deletion.config.ts | 12 ++++ .../rollup4/after-upload-deletion.test.ts | 17 ++++++ .../rollup4/application-key.config.ts | 11 ++++ .../fixtures/rollup4/application-key.test.ts | 13 +++++ .../rollup4/basic-release-disabled.config.ts | 11 ++++ .../rollup4/basic-release-disabled.test.ts | 13 +++++ .../rollup4/basic-sourcemaps.config.ts | 12 ++++ .../fixtures/rollup4/basic-sourcemaps.test.ts | 23 ++++++++ .../fixtures/rollup4/basic.config.ts | 11 ++++ .../fixtures/rollup4/basic.test.ts | 21 +++++++ .../fixtures/rollup4/build-info.config.ts | 11 ++++ .../fixtures/rollup4/build-info.test.ts | 13 +++++ .../bundle-size-optimizations.config.ts | 11 ++++ .../rollup4/bundle-size-optimizations.test.ts | 27 +++++++++ .../component-annotation-disabled.config.ts | 28 ++++++++++ .../component-annotation-disabled.test.ts | 26 +++++++++ .../component-annotation-next.config.ts | 28 ++++++++++ .../rollup4/component-annotation-next.test.ts | 28 ++++++++++ .../rollup4/component-annotation.config.ts | 28 ++++++++++ .../rollup4/component-annotation.test.ts | 33 +++++++++++ .../rollup4/debugid-disabled.config.ts | 12 ++++ .../fixtures/rollup4/debugid-disabled.test.ts | 15 +++++ .../debugids-already-injected.config.ts | 13 +++++ .../rollup4/debugids-already-injected.test.ts | 20 +++++++ .../rollup4/module-metadata.config.ts | 11 ++++ .../fixtures/rollup4/module-metadata.test.ts | 16 ++++++ .../rollup4/multiple-entry-points.config.ts | 12 ++++ .../rollup4/multiple-entry-points.test.ts | 35 ++++++++++++ .../fixtures/rollup4/package.json | 12 ++++ .../fixtures/rollup4/query-param.config.ts | 12 ++++ .../fixtures/rollup4/query-param.test.ts | 29 ++++++++++ .../rollup4/release-disabled.config.ts | 11 ++++ .../fixtures/rollup4/release-disabled.test.ts | 17 ++++++ .../fixtures/rollup4/src/app.jsx | 9 +++ .../fixtures/rollup4/src/basic.js | 2 + .../fixtures/rollup4/src/bundle.js | 10 ++++ .../fixtures/rollup4/src/common.js | 3 + .../fixtures/rollup4/src/component-a.jsx | 3 + .../fixtures/rollup4/src/entry1.js | 3 + .../fixtures/rollup4/src/entry2.js | 3 + .../fixtures/rollup4/telemetry.config.ts | 11 ++++ .../fixtures/rollup4/telemetry.test.ts | 18 ++++++ .../fixtures/rollup4/utils.ts | 55 ++++++++++++++++++ yarn.lock | 20 ++++++- 158 files changed, 1699 insertions(+), 191 deletions(-) create mode 100644 packages/integration-tests-next/fixtures/configs/after-upload-deletion.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/after-upload-deletion.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/application-key.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/application-key.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/basic-release-disabled.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/basic-release-disabled.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/basic-sourcemaps.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/basic-sourcemaps.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/basic.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/basic.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/build-info.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/build-info.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/bundle-size-optimizations.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/bundle-size-optimizations.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/component-annotation-disabled.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/component-annotation-disabled.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/component-annotation-next.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/component-annotation-next.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/component-annotation.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/component-annotation.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/debugid-disabled.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/debugid-disabled.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/debugids-already-injected.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/debugids-already-injected.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/module-metadata.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/module-metadata.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/multiple-entry-points.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/multiple-entry-points.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/package.json create mode 100644 packages/integration-tests-next/fixtures/configs/query-param.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/query-param.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/release-disabled.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/release-disabled.config.js create mode 100644 packages/integration-tests-next/fixtures/configs/telemetry.config.d.ts create mode 100644 packages/integration-tests-next/fixtures/configs/telemetry.config.js create mode 100644 packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/application-key.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/application-key.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/basic-release-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/basic-release-disabled.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/basic.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/basic.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/build-info.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/build-info.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/component-annotation-next.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/component-annotation.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/component-annotation.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/debugid-disabled.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/module-metadata.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/module-metadata.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/multiple-entry-points.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/multiple-entry-points.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/package.json create mode 100644 packages/integration-tests-next/fixtures/rollup3/query-param.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/query-param.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/release-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/release-disabled.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/src/app.jsx create mode 100644 packages/integration-tests-next/fixtures/rollup3/src/basic.js create mode 100644 packages/integration-tests-next/fixtures/rollup3/src/bundle.js create mode 100644 packages/integration-tests-next/fixtures/rollup3/src/common.js create mode 100644 packages/integration-tests-next/fixtures/rollup3/src/component-a.jsx create mode 100644 packages/integration-tests-next/fixtures/rollup3/src/entry1.js create mode 100644 packages/integration-tests-next/fixtures/rollup3/src/entry2.js create mode 100644 packages/integration-tests-next/fixtures/rollup3/telemetry.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/telemetry.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup3/utils.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/application-key.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/application-key.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/basic-release-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/basic-release-disabled.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/basic.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/basic.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/build-info.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/build-info.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/component-annotation-next.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/component-annotation.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/component-annotation.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/debugid-disabled.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/module-metadata.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/module-metadata.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/multiple-entry-points.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/multiple-entry-points.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/package.json create mode 100644 packages/integration-tests-next/fixtures/rollup4/query-param.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/query-param.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/release-disabled.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/release-disabled.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/src/app.jsx create mode 100644 packages/integration-tests-next/fixtures/rollup4/src/basic.js create mode 100644 packages/integration-tests-next/fixtures/rollup4/src/bundle.js create mode 100644 packages/integration-tests-next/fixtures/rollup4/src/common.js create mode 100644 packages/integration-tests-next/fixtures/rollup4/src/component-a.jsx create mode 100644 packages/integration-tests-next/fixtures/rollup4/src/entry1.js create mode 100644 packages/integration-tests-next/fixtures/rollup4/src/entry2.js create mode 100644 packages/integration-tests-next/fixtures/rollup4/telemetry.config.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/telemetry.test.ts create mode 100644 packages/integration-tests-next/fixtures/rollup4/utils.ts diff --git a/package.json b/package.json index faec26e2..f7d9d9b3 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,9 @@ "packages/vite-plugin", "packages/webpack-plugin", "packages/integration-tests-next", - "packages/integration-tests-next/fixtures/rolldown" + "packages/integration-tests-next/fixtures/rolldown", + "packages/integration-tests-next/fixtures/rollup3", + "packages/integration-tests-next/fixtures/rollup4" ], "scripts": { "postinstall": "patch-package", diff --git a/packages/integration-tests-next/fixtures/configs/after-upload-deletion.config.d.ts b/packages/integration-tests-next/fixtures/configs/after-upload-deletion.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/after-upload-deletion.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/after-upload-deletion.config.js b/packages/integration-tests-next/fixtures/configs/after-upload-deletion.config.js new file mode 100644 index 00000000..ae8efaa2 --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/after-upload-deletion.config.js @@ -0,0 +1,6 @@ +export const sentryConfig = { + telemetry: false, + sourcemaps: { + filesToDeleteAfterUpload: ["out/after-upload-deletion/basic.js.map"], + }, +}; diff --git a/packages/integration-tests-next/fixtures/configs/application-key.config.d.ts b/packages/integration-tests-next/fixtures/configs/application-key.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/application-key.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/application-key.config.js b/packages/integration-tests-next/fixtures/configs/application-key.config.js new file mode 100644 index 00000000..26041ce4 --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/application-key.config.js @@ -0,0 +1,4 @@ +export const sentryConfig = { + telemetry: false, + applicationKey: "1234567890abcdef", +}; diff --git a/packages/integration-tests-next/fixtures/configs/basic-release-disabled.config.d.ts b/packages/integration-tests-next/fixtures/configs/basic-release-disabled.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/basic-release-disabled.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/basic-release-disabled.config.js b/packages/integration-tests-next/fixtures/configs/basic-release-disabled.config.js new file mode 100644 index 00000000..9d6c407e --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/basic-release-disabled.config.js @@ -0,0 +1,4 @@ +export const sentryConfig = { + telemetry: false, + release: { create: false, inject: false }, +}; diff --git a/packages/integration-tests-next/fixtures/configs/basic-sourcemaps.config.d.ts b/packages/integration-tests-next/fixtures/configs/basic-sourcemaps.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/basic-sourcemaps.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/basic-sourcemaps.config.js b/packages/integration-tests-next/fixtures/configs/basic-sourcemaps.config.js new file mode 100644 index 00000000..d96d240d --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/basic-sourcemaps.config.js @@ -0,0 +1,6 @@ +export const sentryConfig = { + telemetry: false, + authToken: "fake-auth", + org: "fake-org", + project: "fake-project", +}; diff --git a/packages/integration-tests-next/fixtures/configs/basic.config.d.ts b/packages/integration-tests-next/fixtures/configs/basic.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/basic.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/basic.config.js b/packages/integration-tests-next/fixtures/configs/basic.config.js new file mode 100644 index 00000000..d96d240d --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/basic.config.js @@ -0,0 +1,6 @@ +export const sentryConfig = { + telemetry: false, + authToken: "fake-auth", + org: "fake-org", + project: "fake-project", +}; diff --git a/packages/integration-tests-next/fixtures/configs/build-info.config.d.ts b/packages/integration-tests-next/fixtures/configs/build-info.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/build-info.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/build-info.config.js b/packages/integration-tests-next/fixtures/configs/build-info.config.js new file mode 100644 index 00000000..5eaff477 --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/build-info.config.js @@ -0,0 +1,7 @@ +export const sentryConfig = { + telemetry: false, + release: { + name: "build-information-injection-test", + }, + _experiments: { injectBuildInformation: true }, +}; diff --git a/packages/integration-tests-next/fixtures/configs/bundle-size-optimizations.config.d.ts b/packages/integration-tests-next/fixtures/configs/bundle-size-optimizations.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/bundle-size-optimizations.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/bundle-size-optimizations.config.js b/packages/integration-tests-next/fixtures/configs/bundle-size-optimizations.config.js new file mode 100644 index 00000000..6e7f6b72 --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/bundle-size-optimizations.config.js @@ -0,0 +1,11 @@ +export const sentryConfig = { + telemetry: false, + bundleSizeOptimizations: { + excludeDebugStatements: true, + excludeTracing: true, + excludeReplayCanvas: true, + excludeReplayIframe: true, + excludeReplayShadowDom: true, + excludeReplayWorker: true, + }, +}; diff --git a/packages/integration-tests-next/fixtures/configs/component-annotation-disabled.config.d.ts b/packages/integration-tests-next/fixtures/configs/component-annotation-disabled.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/component-annotation-disabled.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/component-annotation-disabled.config.js b/packages/integration-tests-next/fixtures/configs/component-annotation-disabled.config.js new file mode 100644 index 00000000..8891d92b --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/component-annotation-disabled.config.js @@ -0,0 +1,3 @@ +export const sentryConfig = { + telemetry: false, +}; diff --git a/packages/integration-tests-next/fixtures/configs/component-annotation-next.config.d.ts b/packages/integration-tests-next/fixtures/configs/component-annotation-next.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/component-annotation-next.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/component-annotation-next.config.js b/packages/integration-tests-next/fixtures/configs/component-annotation-next.config.js new file mode 100644 index 00000000..6ef1a7fe --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/component-annotation-next.config.js @@ -0,0 +1,4 @@ +export const sentryConfig = { + telemetry: false, + reactComponentAnnotation: { enabled: true, _experimentalInjectIntoHtml: true }, +}; diff --git a/packages/integration-tests-next/fixtures/configs/component-annotation.config.d.ts b/packages/integration-tests-next/fixtures/configs/component-annotation.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/component-annotation.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/component-annotation.config.js b/packages/integration-tests-next/fixtures/configs/component-annotation.config.js new file mode 100644 index 00000000..484acf9d --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/component-annotation.config.js @@ -0,0 +1,4 @@ +export const sentryConfig = { + telemetry: false, + reactComponentAnnotation: { enabled: true }, +}; diff --git a/packages/integration-tests-next/fixtures/configs/debugid-disabled.config.d.ts b/packages/integration-tests-next/fixtures/configs/debugid-disabled.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/debugid-disabled.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/debugid-disabled.config.js b/packages/integration-tests-next/fixtures/configs/debugid-disabled.config.js new file mode 100644 index 00000000..471befe9 --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/debugid-disabled.config.js @@ -0,0 +1,9 @@ +export const sentryConfig = { + telemetry: false, + sourcemaps: { + disable: true, + }, + release: { + inject: false, + }, +}; diff --git a/packages/integration-tests-next/fixtures/configs/debugids-already-injected.config.d.ts b/packages/integration-tests-next/fixtures/configs/debugids-already-injected.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/debugids-already-injected.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/debugids-already-injected.config.js b/packages/integration-tests-next/fixtures/configs/debugids-already-injected.config.js new file mode 100644 index 00000000..e9dc3f97 --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/debugids-already-injected.config.js @@ -0,0 +1,7 @@ +export const sentryConfig = { + telemetry: false, + // We need to specify these so that upload is attempted. Debug IDs will be injected before then... + authToken: "fake-auth", + org: "fake-org", + project: "fake-project", +}; diff --git a/packages/integration-tests-next/fixtures/configs/module-metadata.config.d.ts b/packages/integration-tests-next/fixtures/configs/module-metadata.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/module-metadata.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/module-metadata.config.js b/packages/integration-tests-next/fixtures/configs/module-metadata.config.js new file mode 100644 index 00000000..e0a7cb1f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/module-metadata.config.js @@ -0,0 +1,4 @@ +export const sentryConfig = { + telemetry: false, + moduleMetadata: { something: "value", another: 999 }, +}; diff --git a/packages/integration-tests-next/fixtures/configs/multiple-entry-points.config.d.ts b/packages/integration-tests-next/fixtures/configs/multiple-entry-points.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/multiple-entry-points.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/multiple-entry-points.config.js b/packages/integration-tests-next/fixtures/configs/multiple-entry-points.config.js new file mode 100644 index 00000000..9e60b27e --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/multiple-entry-points.config.js @@ -0,0 +1,4 @@ +export const sentryConfig = { + telemetry: false, + release: { inject: false }, +}; diff --git a/packages/integration-tests-next/fixtures/configs/package.json b/packages/integration-tests-next/fixtures/configs/package.json new file mode 100644 index 00000000..3dbc1ca5 --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/packages/integration-tests-next/fixtures/configs/query-param.config.d.ts b/packages/integration-tests-next/fixtures/configs/query-param.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/query-param.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/query-param.config.js b/packages/integration-tests-next/fixtures/configs/query-param.config.js new file mode 100644 index 00000000..8891d92b --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/query-param.config.js @@ -0,0 +1,3 @@ +export const sentryConfig = { + telemetry: false, +}; diff --git a/packages/integration-tests-next/fixtures/configs/release-disabled.config.d.ts b/packages/integration-tests-next/fixtures/configs/release-disabled.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/release-disabled.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/release-disabled.config.js b/packages/integration-tests-next/fixtures/configs/release-disabled.config.js new file mode 100644 index 00000000..b0c5a5fb --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/release-disabled.config.js @@ -0,0 +1,7 @@ +export const sentryConfig = { + telemetry: false, + authToken: "fake-auth", + org: "fake-org", + project: "fake-project", + release: { create: false }, +}; diff --git a/packages/integration-tests-next/fixtures/configs/telemetry.config.d.ts b/packages/integration-tests-next/fixtures/configs/telemetry.config.d.ts new file mode 100644 index 00000000..f739482f --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/telemetry.config.d.ts @@ -0,0 +1,2 @@ +import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin"; +export declare const sentryConfig: SentryRollupPluginOptions; diff --git a/packages/integration-tests-next/fixtures/configs/telemetry.config.js b/packages/integration-tests-next/fixtures/configs/telemetry.config.js new file mode 100644 index 00000000..789aad8b --- /dev/null +++ b/packages/integration-tests-next/fixtures/configs/telemetry.config.js @@ -0,0 +1 @@ +export const sentryConfig = {}; diff --git a/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.config.ts b/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.config.ts index dd228f17..5a95ed13 100644 --- a/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.config.ts @@ -1,5 +1,6 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/after-upload-deletion.config.js"; export default defineConfig({ input: "src/basic.js", @@ -7,12 +8,5 @@ export default defineConfig({ file: "out/after-upload-deletion/basic.js", sourcemap: true, }, - plugins: [ - sentryRollupPlugin({ - telemetry: false, - sourcemaps: { - filesToDeleteAfterUpload: ["out/after-upload-deletion/basic.js.map"], - }, - }), - ], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 2adae022..b9900075 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 @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js diff --git a/packages/integration-tests-next/fixtures/rolldown/application-key.config.ts b/packages/integration-tests-next/fixtures/rolldown/application-key.config.ts index 9b6c7fb2..2c64afa1 100644 --- a/packages/integration-tests-next/fixtures/rolldown/application-key.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/application-key.config.ts @@ -1,10 +1,11 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/application-key.config.js"; export default defineConfig({ input: "src/basic.js", output: { file: "out/application-key/basic.js", }, - plugins: [sentryRollupPlugin({ telemetry: false, applicationKey: "1234567890abcdef" })], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 99e7f1fd..460d301b 100644 --- a/packages/integration-tests-next/fixtures/rolldown/application-key.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/application-key.test.ts @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js diff --git a/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts b/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts index ea1a1453..dd8d811d 100644 --- a/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.config.ts @@ -1,10 +1,11 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/basic-release-disabled.config.js"; export default defineConfig({ input: "src/basic.js", output: { file: "out/basic-release-disabled/basic.js", }, - plugins: [sentryRollupPlugin({ telemetry: false, release: { create: false, inject: false } })], + plugins: [sentryRollupPlugin(sentryConfig)], }); diff --git a/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.test.ts b/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.test.ts index 4d5038b2..76252834 100644 --- a/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.test.ts @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js diff --git a/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts index 56b5a6f5..0109e892 100644 --- a/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts @@ -1,5 +1,6 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/basic-sourcemaps.config.js"; export default defineConfig({ input: "src/basic.js", @@ -7,12 +8,5 @@ export default defineConfig({ file: "out/basic-sourcemaps/basic.js", sourcemap: true, }, - plugins: [ - sentryRollupPlugin({ - telemetry: false, - authToken: "fake-auth", - org: "fake-org", - project: "fake-project", - }), - ], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 390d99bb..4f158672 100644 --- a/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js diff --git a/packages/integration-tests-next/fixtures/rolldown/basic.config.ts b/packages/integration-tests-next/fixtures/rolldown/basic.config.ts index 689db6b9..b026f594 100644 --- a/packages/integration-tests-next/fixtures/rolldown/basic.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/basic.config.ts @@ -1,17 +1,11 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/basic.config.js"; export default defineConfig({ input: "src/basic.js", output: { file: "out/basic/basic.js", }, - plugins: [ - sentryRollupPlugin({ - telemetry: false, - authToken: "fake-auth", - org: "fake-org", - project: "fake-project", - }), - ], + plugins: [sentryRollupPlugin(sentryConfig)], }); diff --git a/packages/integration-tests-next/fixtures/rolldown/basic.test.ts b/packages/integration-tests-next/fixtures/rolldown/basic.test.ts index e8754b21..b3e85d7b 100644 --- a/packages/integration-tests-next/fixtures/rolldown/basic.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/basic.test.ts @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js diff --git a/packages/integration-tests-next/fixtures/rolldown/build-info.config.ts b/packages/integration-tests-next/fixtures/rolldown/build-info.config.ts index 6d059dae..b1bd49d7 100644 --- a/packages/integration-tests-next/fixtures/rolldown/build-info.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/build-info.config.ts @@ -1,18 +1,11 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/build-info.config.js"; export default defineConfig({ input: "src/basic.js", output: { file: "out/build-info/basic.js", }, - plugins: [ - sentryRollupPlugin({ - telemetry: false, - release: { - name: "build-information-injection-test", - }, - _experiments: { injectBuildInformation: true }, - }), - ], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 57c07363..127e8c17 100644 --- a/packages/integration-tests-next/fixtures/rolldown/build-info.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/build-info.test.ts @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js diff --git a/packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.config.ts b/packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.config.ts index c7cbbd24..bb5adc2e 100644 --- a/packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/bundle-size-optimizations.config.ts @@ -1,22 +1,11 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/bundle-size-optimizations.config.js"; export default defineConfig({ input: "src/bundle.js", output: { file: "out/bundle-size-optimizations/bundle.js", }, - plugins: [ - sentryRollupPlugin({ - telemetry: false, - bundleSizeOptimizations: { - excludeDebugStatements: true, - excludeTracing: true, - excludeReplayCanvas: true, - excludeReplayIframe: true, - excludeReplayShadowDom: true, - excludeReplayWorker: true, - }, - }), - ], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 7f7c1b6a..5e4bb51f 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 @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "bundle.js": "//#region src/bundle.js diff --git a/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.config.ts b/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.config.ts index 6408342c..9d9258fd 100644 --- a/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation-disabled.config.ts @@ -1,5 +1,6 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/component-annotation-disabled.config.js"; export default defineConfig({ input: "src/app.jsx", @@ -9,5 +10,5 @@ export default defineConfig({ output: { file: "out/component-annotation-disabled/app.js", }, - plugins: [sentryRollupPlugin({ telemetry: false })], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 f6579e7a..3f98e67c 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 @@ -1,25 +1,25 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles }) => { - runRolldown(); +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]="ea5adc74-2664-4c38-8492-6e4971efd2be",e._sentryDebugIdIdentifier="sentry-dbid-ea5adc74-2664-4c38-8492-6e4971efd2be");}catch(e){}}();import { jsx, jsxs } from "../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]="b0a43d00-208c-4b0e-b024-c0951a1c11f8",e._sentryDebugIdIdentifier="sentry-dbid-b0a43d00-208c-4b0e-b024-c0951a1c11f8");}catch(e){}}();import { jsx, jsxs } from "../../../../../node_modules/react/jsx-runtime.js"; - //#region src/component-a.jsx - function ComponentA() { - return /* @__PURE__ */ jsx("span", { children: "Component A" }); - } + //#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 + //#region src/app.jsx + function App() { + return /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx(ComponentA, {}), ";"] }); + } - //#endregion - export { App as default };", - } - `); + //#endregion + export { App as default };", + } + `); }); diff --git a/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.config.ts b/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.config.ts index 6023cb4c..09fc2874 100644 --- a/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation-next.config.ts @@ -1,5 +1,6 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/component-annotation-next.config.js"; export default defineConfig({ input: "src/app.jsx", @@ -9,10 +10,5 @@ export default defineConfig({ output: { file: "out/component-annotation-next/app.js", }, - plugins: [ - sentryRollupPlugin({ - telemetry: false, - reactComponentAnnotation: { enabled: true, _experimentalInjectIntoHtml: true }, - }), - ], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 22d0fb42..e3795304 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 @@ -1,31 +1,31 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles }) => { - runRolldown(); +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]="aa1666c7-eaca-4b84-8c40-9ac56cc75bfb",e._sentryDebugIdIdentifier="sentry-dbid-aa1666c7-eaca-4b84-8c40-9ac56cc75bfb");}catch(e){}}();import { jsx, jsxs } from "../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]="4bdf6d53-8b4d-4766-b048-143c5e6d2cbd",e._sentryDebugIdIdentifier="sentry-dbid-4bdf6d53-8b4d-4766-b048-143c5e6d2cbd");}catch(e){}}();import { jsx, jsxs } from "../../../../../node_modules/react/jsx-runtime.js"; - //#region src/component-a.jsx - function ComponentA() { - return /* @__PURE__ */ jsx("span", { - "data-sentry-component": "ComponentA", - children: "Component A" - }); - } + //#region src/component-a.jsx + function ComponentA() { + return /* @__PURE__ */ jsx("span", { + "data-sentry-component": "ComponentA", + children: "Component A" + }); + } - //#endregion - //#region src/app.jsx - function App() { - return /* @__PURE__ */ jsxs("span", { - "data-sentry-component": "App", - children: [/* @__PURE__ */ jsx(ComponentA, {}), ";"] - }); - } + //#endregion + //#region src/app.jsx + function App() { + return /* @__PURE__ */ jsxs("span", { + "data-sentry-component": "App", + children: [/* @__PURE__ */ jsx(ComponentA, {}), ";"] + }); + } - //#endregion - export { App as default };", - } - `); + //#endregion + export { App as default };", + } + `); }); diff --git a/packages/integration-tests-next/fixtures/rolldown/component-annotation.config.ts b/packages/integration-tests-next/fixtures/rolldown/component-annotation.config.ts index aa013df1..6c7f330a 100644 --- a/packages/integration-tests-next/fixtures/rolldown/component-annotation.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation.config.ts @@ -1,5 +1,6 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/component-annotation.config.js"; export default defineConfig({ input: "src/app.jsx", @@ -9,5 +10,5 @@ export default defineConfig({ output: { file: "out/component-annotation/app.js", }, - plugins: [sentryRollupPlugin({ telemetry: false, reactComponentAnnotation: { enabled: true } })], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 cf57acfb..fc9c8203 100644 --- a/packages/integration-tests-next/fixtures/rolldown/component-annotation.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/component-annotation.test.ts @@ -1,36 +1,36 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles }) => { - runRolldown(); +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]="adb3af3a-5b4a-49fd-b8ae-7ea0905020b6",e._sentryDebugIdIdentifier="sentry-dbid-adb3af3a-5b4a-49fd-b8ae-7ea0905020b6");}catch(e){}}();import { jsx, jsxs } from "../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]="0880f8a4-f072-4b80-b577-4bb7d5be4841",e._sentryDebugIdIdentifier="sentry-dbid-0880f8a4-f072-4b80-b577-4bb7d5be4841");}catch(e){}}();import { jsx, jsxs } from "../../../../../node_modules/react/jsx-runtime.js"; - //#region src/component-a.jsx - function ComponentA() { - return /* @__PURE__ */ jsx("span", { - "data-sentry-component": "ComponentA", - "data-sentry-source-file": "component-a.jsx", - children: "Component A" - }); - } + //#region src/component-a.jsx + function ComponentA() { + return /* @__PURE__ */ jsx("span", { + "data-sentry-component": "ComponentA", + "data-sentry-source-file": "component-a.jsx", + children: "Component A" + }); + } - //#endregion - //#region src/app.jsx - 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" - }), ";"] - }); - } + //#endregion + //#region src/app.jsx + 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" + }), ";"] + }); + } - //#endregion - export { App as default };", - } - `); + //#endregion + export { App as default };", + } + `); }); diff --git a/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.config.ts b/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.config.ts index 48a93f32..1edff6ab 100644 --- a/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.config.ts @@ -1,5 +1,6 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/debugid-disabled.config.js"; export default defineConfig({ input: "src/basic.js", @@ -7,15 +8,5 @@ export default defineConfig({ file: "out/debugid-disabled/basic.js", sourcemap: true, }, - plugins: [ - sentryRollupPlugin({ - telemetry: false, - sourcemaps: { - disable: true, - }, - release: { - inject: false, - }, - }), - ], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 37f9debd..34262984 100644 --- a/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/debugid-disabled.test.ts @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js diff --git a/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts b/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts index 4a31b424..01ad08fe 100644 --- a/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/debugids-already-injected.config.ts @@ -1,5 +1,6 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/debugids-already-injected.config.js"; export default defineConfig({ input: "src/basic.js", @@ -8,13 +9,5 @@ export default defineConfig({ sourcemap: true, sourcemapDebugIds: true, }, - plugins: [ - sentryRollupPlugin({ - telemetry: false, - // We need to specify these so that upload is attempted. Debug IDs will be injected before then... - authToken: "fake-auth", - org: "fake-org", - project: "fake-project", - }), - ], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 19d68f7a..398dc71f 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 @@ -2,10 +2,10 @@ import { expect } from "vitest"; import { readAllFiles } from "../utils"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, createTempDir }) => { +test(import.meta.url, ({ runBundler, createTempDir }) => { const tempDir = createTempDir(); - runRolldown({ SENTRY_TEST_OVERRIDE_TEMP_DIR: tempDir }); + runBundler({ SENTRY_TEST_OVERRIDE_TEMP_DIR: tempDir }); const files = readAllFiles(tempDir); expect(files).toMatchInlineSnapshot(` { diff --git a/packages/integration-tests-next/fixtures/rolldown/module-metadata.config.ts b/packages/integration-tests-next/fixtures/rolldown/module-metadata.config.ts index 9c867075..48999991 100644 --- a/packages/integration-tests-next/fixtures/rolldown/module-metadata.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/module-metadata.config.ts @@ -1,12 +1,11 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/module-metadata.config.js"; export default defineConfig({ input: "src/basic.js", output: { file: "out/module-metadata/basic.js", }, - plugins: [ - sentryRollupPlugin({ telemetry: false, moduleMetadata: { something: "value", another: 999 } }), - ], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 74ef2b31..ece716eb 100644 --- a/packages/integration-tests-next/fixtures/rolldown/module-metadata.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/module-metadata.test.ts @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js diff --git a/packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.config.ts b/packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.config.ts index 038f7c09..59cf33a0 100644 --- a/packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.config.ts @@ -1,5 +1,6 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/multiple-entry-points.config.js"; export default defineConfig({ input: ["src/entry1.js", "src/entry2.js"], @@ -7,5 +8,5 @@ export default defineConfig({ dir: "out/multiple-entry-points", chunkFileNames: "[name].js", }, - plugins: [sentryRollupPlugin({ telemetry: false, release: { inject: false } })], + plugins: [sentryRollupPlugin(sentryConfig)], }); diff --git a/packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.test.ts b/packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.test.ts index 11fcadbb..7659f27b 100644 --- a/packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/multiple-entry-points.test.ts @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "common.js": "//#region src/common.js diff --git a/packages/integration-tests-next/fixtures/rolldown/query-param.config.ts b/packages/integration-tests-next/fixtures/rolldown/query-param.config.ts index d7697c48..81e15c2e 100644 --- a/packages/integration-tests-next/fixtures/rolldown/query-param.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/query-param.config.ts @@ -1,5 +1,6 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/query-param.config.js"; export default defineConfig({ input: ["src/entry1.js", "src/entry2.js"], @@ -7,5 +8,5 @@ export default defineConfig({ dir: "out/query-param", chunkFileNames: "[name].js?seP58q4g", }, - plugins: [sentryRollupPlugin({ telemetry: false })], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 76cf7baf..5b3a013a 100644 --- a/packages/integration-tests-next/fixtures/rolldown/query-param.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/query-param.test.ts @@ -1,13 +1,13 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles, ctx }) => { +test(import.meta.url, ({ runBundler, readOutputFiles, ctx }) => { if (process.platform === "win32") { ctx.skip("Query params do not work in paths on Windows"); return; } - runRolldown(); + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "common.js?seP58q4g": "//#region src/common.js diff --git a/packages/integration-tests-next/fixtures/rolldown/release-disabled.config.ts b/packages/integration-tests-next/fixtures/rolldown/release-disabled.config.ts index ac3468c0..549c2298 100644 --- a/packages/integration-tests-next/fixtures/rolldown/release-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/release-disabled.config.ts @@ -1,18 +1,11 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/release-disabled.config.js"; export default defineConfig({ input: "src/basic.js", output: { file: "out/release-disabled/basic.js", }, - plugins: [ - sentryRollupPlugin({ - telemetry: false, - authToken: "fake-auth", - org: "fake-org", - project: "fake-project", - release: { create: false }, - }), - ], + plugins: [sentryRollupPlugin(sentryConfig)], }); 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 dfb0642d..18821086 100644 --- a/packages/integration-tests-next/fixtures/rolldown/release-disabled.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/release-disabled.test.ts @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js diff --git a/packages/integration-tests-next/fixtures/rolldown/telemetry.config.ts b/packages/integration-tests-next/fixtures/rolldown/telemetry.config.ts index c6781218..15a329ca 100644 --- a/packages/integration-tests-next/fixtures/rolldown/telemetry.config.ts +++ b/packages/integration-tests-next/fixtures/rolldown/telemetry.config.ts @@ -1,10 +1,11 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/telemetry.config.js"; export default defineConfig({ input: "src/basic.js", output: { file: "out/telemetry/basic.js", }, - plugins: [sentryRollupPlugin()], + plugins: [sentryRollupPlugin(sentryConfig)], }); diff --git a/packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts b/packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts index 59bddafa..7fe93c65 100644 --- a/packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts +++ b/packages/integration-tests-next/fixtures/rolldown/telemetry.test.ts @@ -1,8 +1,8 @@ import { expect } from "vitest"; import { test } from "./utils"; -test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => { - runRolldown(); +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); expect(readOutputFiles()).toMatchInlineSnapshot(` { "basic.js": "//#region src/basic.js diff --git a/packages/integration-tests-next/fixtures/rolldown/utils.ts b/packages/integration-tests-next/fixtures/rolldown/utils.ts index 7fae183f..3b00ad73 100644 --- a/packages/integration-tests-next/fixtures/rolldown/utils.ts +++ b/packages/integration-tests-next/fixtures/rolldown/utils.ts @@ -10,7 +10,7 @@ const NODE_MAJOR_VERSION = parseInt(process.versions.node.split(".")[0] || "0", type TestCallback = (props: { outDir: string; - runRolldown: (env?: Record) => void; + runBundler: (env?: Record) => void; readOutputFiles: () => Record; runFileInNode: (file: string) => string; createTempDir: () => string; @@ -34,7 +34,7 @@ export function test(url: string, callback: TestCallback) { vitestTest(`rolldown > ${testName}`, (ctx) => callback({ outDir, - runRolldown: (env) => + runBundler: (env) => runBundler( `rolldown --config ${testName}.config.ts`, { diff --git a/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.ts b/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.ts new file mode 100644 index 00000000..5a95ed13 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.ts @@ -0,0 +1,12 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/after-upload-deletion.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/after-upload-deletion/basic.js", + sourcemap: true, + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.test.ts b/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.test.ts new file mode 100644 index 00000000..10892756 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.test.ts @@ -0,0 +1,17 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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(e){}}();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/rollup3/application-key.config.ts b/packages/integration-tests-next/fixtures/rollup3/application-key.config.ts new file mode 100644 index 00000000..2c64afa1 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/application-key.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/application-key.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/application-key/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/application-key.test.ts b/packages/integration-tests-next/fixtures/rollup3/application-key.test.ts new file mode 100644 index 00000000..eb1bfb06 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/application-key.test.ts @@ -0,0 +1,13 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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": "// eslint-disable-next-line no-console + !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(e){}}();console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.ts new file mode 100644 index 00000000..0109e892 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.ts @@ -0,0 +1,12 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/basic-sourcemaps.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/basic-sourcemaps/basic.js", + sourcemap: true, + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.test.ts b/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.test.ts new file mode 100644 index 00000000..e6c86989 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.test.ts @@ -0,0 +1,23 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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(e){}}();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":"AAAA,CAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,CAAA;scACA,OAAO,CAAC,GAAG,CAAC,CAAA,KAAA,CAAA,KAAA,CAAa,CAAC"}", + "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/rollup3/basic.config.ts b/packages/integration-tests-next/fixtures/rollup3/basic.config.ts new file mode 100644 index 00000000..b026f594 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/basic.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/basic.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/basic/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/basic.test.ts b/packages/integration-tests-next/fixtures/rollup3/basic.test.ts new file mode 100644 index 00000000..47d05666 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/basic.test.ts @@ -0,0 +1,21 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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(e){}}();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/rollup3/build-info.config.ts b/packages/integration-tests-next/fixtures/rollup3/build-info.config.ts new file mode 100644 index 00000000..b1bd49d7 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/build-info.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/build-info.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/build-info/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/build-info.test.ts b/packages/integration-tests-next/fixtures/rollup3/build-info.test.ts new file mode 100644 index 00000000..a6c895dc --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/build-info.test.ts @@ -0,0 +1,13 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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":["@rollup/plugin-babel","@rollup/plugin-node-resolve","react","rollup"],"depsVersions":{"react":19,"rollup":3},"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(e){}}();console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.ts b/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.ts new file mode 100644 index 00000000..bb5adc2e --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/bundle-size-optimizations.config.js"; + +export default defineConfig({ + input: "src/bundle.js", + output: { + file: "out/bundle-size-optimizations/bundle.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.test.ts b/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.test.ts new file mode 100644 index 00000000..f7ddff94 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.test.ts @@ -0,0 +1,27 @@ +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(e){}}();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/rollup3/component-annotation-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.config.ts new file mode 100644 index 00000000..61486e09 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.config.ts @@ -0,0 +1,28 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/component-annotation-disabled.config.js"; +import { babel } from "@rollup/plugin-babel"; +import resolve from "@rollup/plugin-node-resolve"; + +const RESOLVABLE_EXTENSIONS = [".js", ".jsx", ".ts", ".tsx"]; + +export default defineConfig({ + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + file: "out/component-annotation-disabled/app.js", + }, + plugins: [ + resolve({ + extensions: RESOLVABLE_EXTENSIONS, + }), + sentryRollupPlugin(sentryConfig), + babel({ + babelHelpers: "bundled", + presets: [["@babel/preset-react", { runtime: "automatic" }]], + extensions: RESOLVABLE_EXTENSIONS, + }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.test.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.test.ts new file mode 100644 index 00000000..d61c1290 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.test.ts @@ -0,0 +1,26 @@ +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]="e0d3404a-8cd2-4497-8ac0-7d0973080851",e._sentryDebugIdIdentifier="sentry-dbid-e0d3404a-8cd2-4497-8ac0-7d0973080851");}catch(e){}}();import { jsx, jsxs } from 'react/jsx-runtime'; + + function ComponentA() { + return /*#__PURE__*/jsx("span", { + children: "Component A" + }); + } + + function App() { + return /*#__PURE__*/jsxs("span", { + children: [/*#__PURE__*/jsx(ComponentA, {}), ";"] + }); + } + + export { App as default }; + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.ts new file mode 100644 index 00000000..c8ae8de2 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.ts @@ -0,0 +1,28 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/component-annotation-next.config.js"; +import { babel } from "@rollup/plugin-babel"; +import resolve from "@rollup/plugin-node-resolve"; + +const RESOLVABLE_EXTENSIONS = [".js", ".jsx", ".ts", ".tsx"]; + +export default defineConfig({ + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + file: "out/component-annotation-next/app.js", + }, + plugins: [ + resolve({ + extensions: RESOLVABLE_EXTENSIONS, + }), + sentryRollupPlugin(sentryConfig), + babel({ + babelHelpers: "bundled", + presets: [["@babel/preset-react", { runtime: "automatic" }]], + extensions: RESOLVABLE_EXTENSIONS, + }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.test.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.test.ts new file mode 100644 index 00000000..0bc86e7f --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.test.ts @@ -0,0 +1,28 @@ +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]="92286409-18f3-4cfe-8a2d-8e7ee88697ef",e._sentryDebugIdIdentifier="sentry-dbid-92286409-18f3-4cfe-8a2d-8e7ee88697ef");}catch(e){}}();import { jsx, jsxs } from 'react/jsx-runtime'; + + 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, {}), ";"] + }); + } + + export { App as default }; + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/component-annotation.config.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation.config.ts new file mode 100644 index 00000000..15b3a85e --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/component-annotation.config.ts @@ -0,0 +1,28 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/component-annotation.config.js"; +import { babel } from "@rollup/plugin-babel"; +import resolve from "@rollup/plugin-node-resolve"; + +const RESOLVABLE_EXTENSIONS = [".js", ".jsx", ".ts", ".tsx"]; + +export default defineConfig({ + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + file: "out/component-annotation/app.js", + }, + plugins: [ + resolve({ + extensions: RESOLVABLE_EXTENSIONS, + }), + sentryRollupPlugin(sentryConfig), + babel({ + babelHelpers: "bundled", + presets: [["@babel/preset-react", { runtime: "automatic" }]], + extensions: RESOLVABLE_EXTENSIONS, + }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/component-annotation.test.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation.test.ts new file mode 100644 index 00000000..90d896e2 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/component-annotation.test.ts @@ -0,0 +1,33 @@ +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]="0b640794-e3e7-486c-b3b4-52d37c4fbae1",e._sentryDebugIdIdentifier="sentry-dbid-0b640794-e3e7-486c-b3b4-52d37c4fbae1");}catch(e){}}();import { jsx, jsxs } from 'react/jsx-runtime'; + + 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" + }), ";"] + }); + } + + export { App as default }; + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.ts new file mode 100644 index 00000000..1edff6ab --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.ts @@ -0,0 +1,12 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/debugid-disabled.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/debugid-disabled/basic.js", + sourcemap: true, + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.test.ts b/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.test.ts new file mode 100644 index 00000000..4385c076 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.test.ts @@ -0,0 +1,15 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + 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":"AAAA;AACA,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC"}", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.config.ts b/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.config.ts new file mode 100644 index 00000000..01ad08fe --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.config.ts @@ -0,0 +1,13 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/debugids-already-injected.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/debugids-already-injected/basic.js", + sourcemap: true, + sourcemapDebugIds: true, + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.test.ts b/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.test.ts new file mode 100644 index 00000000..fad6713f --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.test.ts @@ -0,0 +1,20 @@ +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": "// eslint-disable-next-line no-console + !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(e){}}();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":"AAAA,CAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,CAAA;scACA,OAAO,CAAC,GAAG,CAAC,CAAA,KAAA,CAAA,KAAA,CAAa,CAAC","debugId":"252e0338-8927-4f52-bd57-188131defd0f","debug_id":"252e0338-8927-4f52-bd57-188131defd0f"}", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/module-metadata.config.ts b/packages/integration-tests-next/fixtures/rollup3/module-metadata.config.ts new file mode 100644 index 00000000..48999991 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/module-metadata.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/module-metadata.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/module-metadata/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/module-metadata.test.ts b/packages/integration-tests-next/fixtures/rollup3/module-metadata.test.ts new file mode 100644 index 00000000..59d819cf --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/module-metadata.test.ts @@ -0,0 +1,16 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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": "!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(e){}}();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(e){}}();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(e){}}();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/rollup3/package.json b/packages/integration-tests-next/fixtures/rollup3/package.json new file mode 100644 index 00000000..22b9c9ca --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/package.json @@ -0,0 +1,12 @@ +{ + "name": "rollup3-integration-tests", + "version": "1.0.0", + "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" + } +} diff --git a/packages/integration-tests-next/fixtures/rollup3/query-param.config.ts b/packages/integration-tests-next/fixtures/rollup3/query-param.config.ts new file mode 100644 index 00000000..81e15c2e --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/query-param.config.ts @@ -0,0 +1,12 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/query-param.config.js"; + +export default defineConfig({ + input: ["src/entry1.js", "src/entry2.js"], + output: { + dir: "out/query-param", + chunkFileNames: "[name].js?seP58q4g", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/query-param.test.ts b/packages/integration-tests-next/fixtures/rollup3/query-param.test.ts new file mode 100644 index 00000000..d6560ec4 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/query-param.test.ts @@ -0,0 +1,29 @@ +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(e){}}();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(e){}}();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(e){}}();import { a as add } from './common.js?seP58q4g'; + + console.log(add(2, 4)); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/release-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup3/release-disabled.config.ts new file mode 100644 index 00000000..549c2298 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/release-disabled.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/release-disabled.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/release-disabled/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/release-disabled.test.ts b/packages/integration-tests-next/fixtures/rollup3/release-disabled.test.ts new file mode 100644 index 00000000..d8239cf3 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/release-disabled.test.ts @@ -0,0 +1,17 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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(e){}}();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/rollup3/src/app.jsx b/packages/integration-tests-next/fixtures/rollup3/src/app.jsx new file mode 100644 index 00000000..614d38c8 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/src/app.jsx @@ -0,0 +1,9 @@ +import { ComponentA } from "./component-a"; + +export default function App() { + return ( + + ; + + ); +} diff --git a/packages/integration-tests-next/fixtures/rollup3/src/basic.js b/packages/integration-tests-next/fixtures/rollup3/src/basic.js new file mode 100644 index 00000000..7ef02afb --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/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/rollup3/src/bundle.js b/packages/integration-tests-next/fixtures/rollup3/src/bundle.js new file mode 100644 index 00000000..0d62e559 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/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/rollup3/src/common.js b/packages/integration-tests-next/fixtures/rollup3/src/common.js new file mode 100644 index 00000000..7d658310 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/src/common.js @@ -0,0 +1,3 @@ +export function add(a, b) { + return a + b; +} diff --git a/packages/integration-tests-next/fixtures/rollup3/src/component-a.jsx b/packages/integration-tests-next/fixtures/rollup3/src/component-a.jsx new file mode 100644 index 00000000..5d57ab22 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/src/component-a.jsx @@ -0,0 +1,3 @@ +export function ComponentA() { + return Component A; +} diff --git a/packages/integration-tests-next/fixtures/rollup3/src/entry1.js b/packages/integration-tests-next/fixtures/rollup3/src/entry1.js new file mode 100644 index 00000000..48081666 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/src/entry1.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(1, 2)); diff --git a/packages/integration-tests-next/fixtures/rollup3/src/entry2.js b/packages/integration-tests-next/fixtures/rollup3/src/entry2.js new file mode 100644 index 00000000..f64af1ea --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/src/entry2.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(2, 4)); diff --git a/packages/integration-tests-next/fixtures/rollup3/telemetry.config.ts b/packages/integration-tests-next/fixtures/rollup3/telemetry.config.ts new file mode 100644 index 00000000..15a329ca --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/telemetry.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/telemetry.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/telemetry/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup3/telemetry.test.ts b/packages/integration-tests-next/fixtures/rollup3/telemetry.test.ts new file mode 100644 index 00000000..b688c918 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/telemetry.test.ts @@ -0,0 +1,18 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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(e){}}();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/rollup3/utils.ts b/packages/integration-tests-next/fixtures/rollup3/utils.ts new file mode 100644 index 00000000..c0848124 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup3/utils.ts @@ -0,0 +1,55 @@ +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(`rollup v3 > ${testName}`, (ctx) => + callback({ + outDir, + runBundler: (env) => + runBundler( + `rollup --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/fixtures/rollup4/after-upload-deletion.config.ts b/packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.config.ts new file mode 100644 index 00000000..5a95ed13 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.config.ts @@ -0,0 +1,12 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/after-upload-deletion.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/after-upload-deletion/basic.js", + sourcemap: true, + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.test.ts b/packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.test.ts new file mode 100644 index 00000000..10892756 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.test.ts @@ -0,0 +1,17 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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(e){}}();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/rollup4/application-key.config.ts b/packages/integration-tests-next/fixtures/rollup4/application-key.config.ts new file mode 100644 index 00000000..2c64afa1 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/application-key.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/application-key.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/application-key/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/application-key.test.ts b/packages/integration-tests-next/fixtures/rollup4/application-key.test.ts new file mode 100644 index 00000000..eb1bfb06 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/application-key.test.ts @@ -0,0 +1,13 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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": "// eslint-disable-next-line no-console + !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(e){}}();console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.ts new file mode 100644 index 00000000..0109e892 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.ts @@ -0,0 +1,12 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/basic-sourcemaps.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/basic-sourcemaps/basic.js", + sourcemap: true, + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.test.ts b/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.test.ts new file mode 100644 index 00000000..e6c86989 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.test.ts @@ -0,0 +1,23 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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(e){}}();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":"AAAA,CAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,CAAA;scACA,OAAO,CAAC,GAAG,CAAC,CAAA,KAAA,CAAA,KAAA,CAAa,CAAC"}", + "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/rollup4/basic.config.ts b/packages/integration-tests-next/fixtures/rollup4/basic.config.ts new file mode 100644 index 00000000..b026f594 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/basic.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/basic.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/basic/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/basic.test.ts b/packages/integration-tests-next/fixtures/rollup4/basic.test.ts new file mode 100644 index 00000000..47d05666 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/basic.test.ts @@ -0,0 +1,21 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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(e){}}();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/rollup4/build-info.config.ts b/packages/integration-tests-next/fixtures/rollup4/build-info.config.ts new file mode 100644 index 00000000..b1bd49d7 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/build-info.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/build-info.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/build-info/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/build-info.test.ts b/packages/integration-tests-next/fixtures/rollup4/build-info.test.ts new file mode 100644 index 00000000..e0a8029d --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/build-info.test.ts @@ -0,0 +1,13 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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":["@rollup/plugin-babel","@rollup/plugin-node-resolve","react","rollup"],"depsVersions":{"react":19,"rollup":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(e){}}();console.log("hello world"); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.ts b/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.ts new file mode 100644 index 00000000..bb5adc2e --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/bundle-size-optimizations.config.js"; + +export default defineConfig({ + input: "src/bundle.js", + output: { + file: "out/bundle-size-optimizations/bundle.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.test.ts b/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.test.ts new file mode 100644 index 00000000..f7ddff94 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.test.ts @@ -0,0 +1,27 @@ +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(e){}}();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/rollup4/component-annotation-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.config.ts new file mode 100644 index 00000000..61486e09 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.config.ts @@ -0,0 +1,28 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/component-annotation-disabled.config.js"; +import { babel } from "@rollup/plugin-babel"; +import resolve from "@rollup/plugin-node-resolve"; + +const RESOLVABLE_EXTENSIONS = [".js", ".jsx", ".ts", ".tsx"]; + +export default defineConfig({ + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + file: "out/component-annotation-disabled/app.js", + }, + plugins: [ + resolve({ + extensions: RESOLVABLE_EXTENSIONS, + }), + sentryRollupPlugin(sentryConfig), + babel({ + babelHelpers: "bundled", + presets: [["@babel/preset-react", { runtime: "automatic" }]], + extensions: RESOLVABLE_EXTENSIONS, + }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.test.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.test.ts new file mode 100644 index 00000000..d61c1290 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.test.ts @@ -0,0 +1,26 @@ +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]="e0d3404a-8cd2-4497-8ac0-7d0973080851",e._sentryDebugIdIdentifier="sentry-dbid-e0d3404a-8cd2-4497-8ac0-7d0973080851");}catch(e){}}();import { jsx, jsxs } from 'react/jsx-runtime'; + + function ComponentA() { + return /*#__PURE__*/jsx("span", { + children: "Component A" + }); + } + + function App() { + return /*#__PURE__*/jsxs("span", { + children: [/*#__PURE__*/jsx(ComponentA, {}), ";"] + }); + } + + export { App as default }; + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.ts new file mode 100644 index 00000000..c8ae8de2 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.ts @@ -0,0 +1,28 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/component-annotation-next.config.js"; +import { babel } from "@rollup/plugin-babel"; +import resolve from "@rollup/plugin-node-resolve"; + +const RESOLVABLE_EXTENSIONS = [".js", ".jsx", ".ts", ".tsx"]; + +export default defineConfig({ + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + file: "out/component-annotation-next/app.js", + }, + plugins: [ + resolve({ + extensions: RESOLVABLE_EXTENSIONS, + }), + sentryRollupPlugin(sentryConfig), + babel({ + babelHelpers: "bundled", + presets: [["@babel/preset-react", { runtime: "automatic" }]], + extensions: RESOLVABLE_EXTENSIONS, + }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.test.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.test.ts new file mode 100644 index 00000000..0bc86e7f --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.test.ts @@ -0,0 +1,28 @@ +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]="92286409-18f3-4cfe-8a2d-8e7ee88697ef",e._sentryDebugIdIdentifier="sentry-dbid-92286409-18f3-4cfe-8a2d-8e7ee88697ef");}catch(e){}}();import { jsx, jsxs } from 'react/jsx-runtime'; + + 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, {}), ";"] + }); + } + + export { App as default }; + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/component-annotation.config.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation.config.ts new file mode 100644 index 00000000..15b3a85e --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/component-annotation.config.ts @@ -0,0 +1,28 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/component-annotation.config.js"; +import { babel } from "@rollup/plugin-babel"; +import resolve from "@rollup/plugin-node-resolve"; + +const RESOLVABLE_EXTENSIONS = [".js", ".jsx", ".ts", ".tsx"]; + +export default defineConfig({ + input: "src/app.jsx", + // We exclude these to keep the snapshot small + external: [/node_modules/], + makeAbsoluteExternalsRelative: true, + output: { + file: "out/component-annotation/app.js", + }, + plugins: [ + resolve({ + extensions: RESOLVABLE_EXTENSIONS, + }), + sentryRollupPlugin(sentryConfig), + babel({ + babelHelpers: "bundled", + presets: [["@babel/preset-react", { runtime: "automatic" }]], + extensions: RESOLVABLE_EXTENSIONS, + }), + ], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/component-annotation.test.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation.test.ts new file mode 100644 index 00000000..90d896e2 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/component-annotation.test.ts @@ -0,0 +1,33 @@ +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]="0b640794-e3e7-486c-b3b4-52d37c4fbae1",e._sentryDebugIdIdentifier="sentry-dbid-0b640794-e3e7-486c-b3b4-52d37c4fbae1");}catch(e){}}();import { jsx, jsxs } from 'react/jsx-runtime'; + + 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" + }), ";"] + }); + } + + export { App as default }; + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.ts new file mode 100644 index 00000000..1edff6ab --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.ts @@ -0,0 +1,12 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/debugid-disabled.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/debugid-disabled/basic.js", + sourcemap: true, + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.test.ts b/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.test.ts new file mode 100644 index 00000000..4385c076 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.test.ts @@ -0,0 +1,15 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + 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":"AAAA;AACA,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC"}", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts b/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts new file mode 100644 index 00000000..01ad08fe --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts @@ -0,0 +1,13 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/debugids-already-injected.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/debugids-already-injected/basic.js", + sourcemap: true, + sourcemapDebugIds: true, + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.test.ts b/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.test.ts new file mode 100644 index 00000000..fad6713f --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.test.ts @@ -0,0 +1,20 @@ +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": "// eslint-disable-next-line no-console + !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(e){}}();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":"AAAA,CAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,CAAA;scACA,OAAO,CAAC,GAAG,CAAC,CAAA,KAAA,CAAA,KAAA,CAAa,CAAC","debugId":"252e0338-8927-4f52-bd57-188131defd0f","debug_id":"252e0338-8927-4f52-bd57-188131defd0f"}", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/module-metadata.config.ts b/packages/integration-tests-next/fixtures/rollup4/module-metadata.config.ts new file mode 100644 index 00000000..48999991 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/module-metadata.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/module-metadata.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/module-metadata/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/module-metadata.test.ts b/packages/integration-tests-next/fixtures/rollup4/module-metadata.test.ts new file mode 100644 index 00000000..59d819cf --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/module-metadata.test.ts @@ -0,0 +1,16 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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": "!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(e){}}();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(e){}}();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(e){}}();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/rollup4/package.json b/packages/integration-tests-next/fixtures/rollup4/package.json new file mode 100644 index 00000000..f1e28cea --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/package.json @@ -0,0 +1,12 @@ +{ + "name": "rollup4-integration-tests", + "version": "1.0.0", + "private": true, + "type": "module", + "dependencies": { + "react": "^19.2.4", + "rollup": "^4.59.0", + "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-node-resolve": "16.0.3" + } +} diff --git a/packages/integration-tests-next/fixtures/rollup4/query-param.config.ts b/packages/integration-tests-next/fixtures/rollup4/query-param.config.ts new file mode 100644 index 00000000..81e15c2e --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/query-param.config.ts @@ -0,0 +1,12 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/query-param.config.js"; + +export default defineConfig({ + input: ["src/entry1.js", "src/entry2.js"], + output: { + dir: "out/query-param", + chunkFileNames: "[name].js?seP58q4g", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/query-param.test.ts b/packages/integration-tests-next/fixtures/rollup4/query-param.test.ts new file mode 100644 index 00000000..d6560ec4 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/query-param.test.ts @@ -0,0 +1,29 @@ +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(e){}}();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(e){}}();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(e){}}();import { a as add } from './common.js?seP58q4g'; + + console.log(add(2, 4)); + ", + } + `); +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/release-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup4/release-disabled.config.ts new file mode 100644 index 00000000..549c2298 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/release-disabled.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/release-disabled.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/release-disabled/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/release-disabled.test.ts b/packages/integration-tests-next/fixtures/rollup4/release-disabled.test.ts new file mode 100644 index 00000000..d8239cf3 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/release-disabled.test.ts @@ -0,0 +1,17 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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(e){}}();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/rollup4/src/app.jsx b/packages/integration-tests-next/fixtures/rollup4/src/app.jsx new file mode 100644 index 00000000..614d38c8 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/src/app.jsx @@ -0,0 +1,9 @@ +import { ComponentA } from "./component-a"; + +export default function App() { + return ( + + ; + + ); +} diff --git a/packages/integration-tests-next/fixtures/rollup4/src/basic.js b/packages/integration-tests-next/fixtures/rollup4/src/basic.js new file mode 100644 index 00000000..7ef02afb --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/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/rollup4/src/bundle.js b/packages/integration-tests-next/fixtures/rollup4/src/bundle.js new file mode 100644 index 00000000..0d62e559 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/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/rollup4/src/common.js b/packages/integration-tests-next/fixtures/rollup4/src/common.js new file mode 100644 index 00000000..7d658310 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/src/common.js @@ -0,0 +1,3 @@ +export function add(a, b) { + return a + b; +} diff --git a/packages/integration-tests-next/fixtures/rollup4/src/component-a.jsx b/packages/integration-tests-next/fixtures/rollup4/src/component-a.jsx new file mode 100644 index 00000000..5d57ab22 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/src/component-a.jsx @@ -0,0 +1,3 @@ +export function ComponentA() { + return Component A; +} diff --git a/packages/integration-tests-next/fixtures/rollup4/src/entry1.js b/packages/integration-tests-next/fixtures/rollup4/src/entry1.js new file mode 100644 index 00000000..48081666 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/src/entry1.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(1, 2)); diff --git a/packages/integration-tests-next/fixtures/rollup4/src/entry2.js b/packages/integration-tests-next/fixtures/rollup4/src/entry2.js new file mode 100644 index 00000000..f64af1ea --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/src/entry2.js @@ -0,0 +1,3 @@ +import { add } from "./common"; + +console.log(add(2, 4)); diff --git a/packages/integration-tests-next/fixtures/rollup4/telemetry.config.ts b/packages/integration-tests-next/fixtures/rollup4/telemetry.config.ts new file mode 100644 index 00000000..15a329ca --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/telemetry.config.ts @@ -0,0 +1,11 @@ +import { sentryRollupPlugin } from "@sentry/rollup-plugin"; +import { defineConfig } from "rolldown"; +import { sentryConfig } from "../configs/telemetry.config.js"; + +export default defineConfig({ + input: "src/basic.js", + output: { + file: "out/telemetry/basic.js", + }, + plugins: [sentryRollupPlugin(sentryConfig)], +}); diff --git a/packages/integration-tests-next/fixtures/rollup4/telemetry.test.ts b/packages/integration-tests-next/fixtures/rollup4/telemetry.test.ts new file mode 100644 index 00000000..b688c918 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/telemetry.test.ts @@ -0,0 +1,18 @@ +import { expect } from "vitest"; +import { test } from "./utils"; + +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { + runBundler(); + expect(readOutputFiles()).toMatchInlineSnapshot(` + { + "basic.js": "// eslint-disable-next-line no-console + !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(e){}}();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/rollup4/utils.ts b/packages/integration-tests-next/fixtures/rollup4/utils.ts new file mode 100644 index 00000000..ee3f4bb6 --- /dev/null +++ b/packages/integration-tests-next/fixtures/rollup4/utils.ts @@ -0,0 +1,55 @@ +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(`rollup v4 > ${testName}`, (ctx) => + callback({ + outDir, + runBundler: (env) => + runBundler( + `rollup --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/yarn.lock b/yarn.lock index 1e085e00..cfe932c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1146,6 +1146,17 @@ is-reference "1.2.1" magic-string "^0.30.3" +"@rollup/plugin-node-resolve@16.0.3": + version "16.0.3" + resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz#0988e6f2cbb13316b0f5e7213f757bc9ed44928f" + integrity sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg== + dependencies: + "@rollup/pluginutils" "^5.0.1" + "@types/resolve" "1.20.2" + deepmerge "^4.2.2" + is-module "^1.0.0" + resolve "^1.22.1" + "@rollup/plugin-node-resolve@^15.2.3": version "15.2.3" resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz#e5e0b059bd85ca57489492f295ce88c2d4b0daf9" @@ -5649,7 +5660,14 @@ rollup@^2.75.6: optionalDependencies: fsevents "~2.3.2" -rollup@^4.43.0: +rollup@^3.30.0: + version "3.30.0" + resolved "https://registry.npmjs.org/rollup/-/rollup-3.30.0.tgz#3fa506fee2c5ba9d540a38da87067376cd55966d" + integrity sha512-kQvGasUgN+AlWGliFn2POSajRQEsULVYFGTvOZmK06d7vCD+YhZztt70kGk3qaeAXeWYL5eO7zx+rAubBc55eA== + optionalDependencies: + fsevents "~2.3.2" + +rollup@^4.43.0, rollup@^4.59.0: version "4.59.0" resolved "https://registry.npmjs.org/rollup/-/rollup-4.59.0.tgz#cf74edac17c1486f562d728a4d923a694abdf06f" integrity sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg== From dc76419deeaa9522d484857ac93c8a1ee8d6755d Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Fri, 6 Mar 2026 12:54:07 +0100 Subject: [PATCH 09/11] Use the correct `defineConfig` --- .../fixtures/rollup3/after-upload-deletion.config.ts | 2 +- .../fixtures/rollup3/application-key.config.ts | 2 +- .../fixtures/rollup3/basic-release-disabled.config.ts | 2 +- .../fixtures/rollup3/basic-sourcemaps.config.ts | 2 +- .../integration-tests-next/fixtures/rollup3/basic.config.ts | 2 +- .../fixtures/rollup3/build-info.config.ts | 2 +- .../fixtures/rollup3/bundle-size-optimizations.config.ts | 2 +- .../fixtures/rollup3/component-annotation-disabled.config.ts | 2 +- .../fixtures/rollup3/component-annotation-next.config.ts | 2 +- .../fixtures/rollup3/component-annotation.config.ts | 2 +- .../fixtures/rollup3/debugid-disabled.config.ts | 2 +- .../fixtures/rollup3/debugids-already-injected.config.ts | 2 +- .../fixtures/rollup3/module-metadata.config.ts | 2 +- .../fixtures/rollup3/multiple-entry-points.config.ts | 2 +- .../fixtures/rollup3/query-param.config.ts | 2 +- .../fixtures/rollup3/release-disabled.config.ts | 2 +- .../integration-tests-next/fixtures/rollup3/telemetry.config.ts | 2 +- .../fixtures/rollup4/after-upload-deletion.config.ts | 2 +- .../fixtures/rollup4/application-key.config.ts | 2 +- .../fixtures/rollup4/basic-release-disabled.config.ts | 2 +- .../fixtures/rollup4/basic-sourcemaps.config.ts | 2 +- .../integration-tests-next/fixtures/rollup4/basic.config.ts | 2 +- .../fixtures/rollup4/build-info.config.ts | 2 +- .../fixtures/rollup4/bundle-size-optimizations.config.ts | 2 +- .../fixtures/rollup4/component-annotation-disabled.config.ts | 2 +- .../fixtures/rollup4/component-annotation-next.config.ts | 2 +- .../fixtures/rollup4/component-annotation.config.ts | 2 +- .../fixtures/rollup4/debugid-disabled.config.ts | 2 +- .../fixtures/rollup4/debugids-already-injected.config.ts | 2 +- .../fixtures/rollup4/module-metadata.config.ts | 2 +- .../fixtures/rollup4/multiple-entry-points.config.ts | 2 +- .../fixtures/rollup4/query-param.config.ts | 2 +- .../fixtures/rollup4/release-disabled.config.ts | 2 +- .../integration-tests-next/fixtures/rollup4/telemetry.config.ts | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.ts b/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.ts index 5a95ed13..36abdcfc 100644 --- a/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/after-upload-deletion.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/application-key.config.ts b/packages/integration-tests-next/fixtures/rollup3/application-key.config.ts index 2c64afa1..fed66578 100644 --- a/packages/integration-tests-next/fixtures/rollup3/application-key.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/application-key.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/application-key.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/basic-release-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup3/basic-release-disabled.config.ts index dd8d811d..8a7c8d91 100644 --- a/packages/integration-tests-next/fixtures/rollup3/basic-release-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/basic-release-disabled.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/basic-release-disabled.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.ts index 0109e892..4d708921 100644 --- a/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/basic-sourcemaps.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/basic.config.ts b/packages/integration-tests-next/fixtures/rollup3/basic.config.ts index b026f594..8f36cde5 100644 --- a/packages/integration-tests-next/fixtures/rollup3/basic.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/basic.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/basic.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/build-info.config.ts b/packages/integration-tests-next/fixtures/rollup3/build-info.config.ts index b1bd49d7..984f33b2 100644 --- a/packages/integration-tests-next/fixtures/rollup3/build-info.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/build-info.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/build-info.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.ts b/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.ts index bb5adc2e..6b37e5cc 100644 --- a/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/bundle-size-optimizations.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.config.ts index 61486e09..aaa7dfec 100644 --- a/packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/component-annotation-disabled.config.js"; import { babel } from "@rollup/plugin-babel"; import resolve from "@rollup/plugin-node-resolve"; diff --git a/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.ts index c8ae8de2..3282ce2b 100644 --- a/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/component-annotation-next.config.js"; import { babel } from "@rollup/plugin-babel"; import resolve from "@rollup/plugin-node-resolve"; diff --git a/packages/integration-tests-next/fixtures/rollup3/component-annotation.config.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation.config.ts index 15b3a85e..dd3cb534 100644 --- a/packages/integration-tests-next/fixtures/rollup3/component-annotation.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/component-annotation.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/component-annotation.config.js"; import { babel } from "@rollup/plugin-babel"; import resolve from "@rollup/plugin-node-resolve"; diff --git a/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.ts index 1edff6ab..2ac8dc76 100644 --- a/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/debugid-disabled.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.config.ts b/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.config.ts index 01ad08fe..2726d0b1 100644 --- a/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/debugids-already-injected.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/module-metadata.config.ts b/packages/integration-tests-next/fixtures/rollup3/module-metadata.config.ts index 48999991..9c758ad9 100644 --- a/packages/integration-tests-next/fixtures/rollup3/module-metadata.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/module-metadata.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/module-metadata.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/multiple-entry-points.config.ts b/packages/integration-tests-next/fixtures/rollup3/multiple-entry-points.config.ts index 59cf33a0..2f0a77af 100644 --- a/packages/integration-tests-next/fixtures/rollup3/multiple-entry-points.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/multiple-entry-points.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/multiple-entry-points.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/query-param.config.ts b/packages/integration-tests-next/fixtures/rollup3/query-param.config.ts index 81e15c2e..5c06653f 100644 --- a/packages/integration-tests-next/fixtures/rollup3/query-param.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/query-param.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/query-param.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/release-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup3/release-disabled.config.ts index 549c2298..99c580cc 100644 --- a/packages/integration-tests-next/fixtures/rollup3/release-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/release-disabled.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/release-disabled.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup3/telemetry.config.ts b/packages/integration-tests-next/fixtures/rollup3/telemetry.config.ts index 15a329ca..c5e38e83 100644 --- a/packages/integration-tests-next/fixtures/rollup3/telemetry.config.ts +++ b/packages/integration-tests-next/fixtures/rollup3/telemetry.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/telemetry.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.config.ts b/packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.config.ts index 5a95ed13..36abdcfc 100644 --- a/packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/after-upload-deletion.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/application-key.config.ts b/packages/integration-tests-next/fixtures/rollup4/application-key.config.ts index 2c64afa1..fed66578 100644 --- a/packages/integration-tests-next/fixtures/rollup4/application-key.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/application-key.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/application-key.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/basic-release-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup4/basic-release-disabled.config.ts index dd8d811d..8a7c8d91 100644 --- a/packages/integration-tests-next/fixtures/rollup4/basic-release-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/basic-release-disabled.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/basic-release-disabled.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.ts index 0109e892..4d708921 100644 --- a/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/basic-sourcemaps.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/basic.config.ts b/packages/integration-tests-next/fixtures/rollup4/basic.config.ts index b026f594..8f36cde5 100644 --- a/packages/integration-tests-next/fixtures/rollup4/basic.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/basic.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/basic.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/build-info.config.ts b/packages/integration-tests-next/fixtures/rollup4/build-info.config.ts index b1bd49d7..984f33b2 100644 --- a/packages/integration-tests-next/fixtures/rollup4/build-info.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/build-info.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/build-info.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.ts b/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.ts index bb5adc2e..6b37e5cc 100644 --- a/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/bundle-size-optimizations.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.config.ts index 61486e09..aaa7dfec 100644 --- a/packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/component-annotation-disabled.config.js"; import { babel } from "@rollup/plugin-babel"; import resolve from "@rollup/plugin-node-resolve"; diff --git a/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.ts index c8ae8de2..3282ce2b 100644 --- a/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/component-annotation-next.config.js"; import { babel } from "@rollup/plugin-babel"; import resolve from "@rollup/plugin-node-resolve"; diff --git a/packages/integration-tests-next/fixtures/rollup4/component-annotation.config.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation.config.ts index 15b3a85e..dd3cb534 100644 --- a/packages/integration-tests-next/fixtures/rollup4/component-annotation.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/component-annotation.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/component-annotation.config.js"; import { babel } from "@rollup/plugin-babel"; import resolve from "@rollup/plugin-node-resolve"; diff --git a/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.ts index 1edff6ab..2ac8dc76 100644 --- a/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/debugid-disabled.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts b/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts index 01ad08fe..2726d0b1 100644 --- a/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/debugids-already-injected.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/module-metadata.config.ts b/packages/integration-tests-next/fixtures/rollup4/module-metadata.config.ts index 48999991..9c758ad9 100644 --- a/packages/integration-tests-next/fixtures/rollup4/module-metadata.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/module-metadata.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/module-metadata.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/multiple-entry-points.config.ts b/packages/integration-tests-next/fixtures/rollup4/multiple-entry-points.config.ts index 59cf33a0..2f0a77af 100644 --- a/packages/integration-tests-next/fixtures/rollup4/multiple-entry-points.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/multiple-entry-points.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/multiple-entry-points.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/query-param.config.ts b/packages/integration-tests-next/fixtures/rollup4/query-param.config.ts index 81e15c2e..5c06653f 100644 --- a/packages/integration-tests-next/fixtures/rollup4/query-param.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/query-param.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/query-param.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/release-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup4/release-disabled.config.ts index 549c2298..99c580cc 100644 --- a/packages/integration-tests-next/fixtures/rollup4/release-disabled.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/release-disabled.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/release-disabled.config.js"; export default defineConfig({ diff --git a/packages/integration-tests-next/fixtures/rollup4/telemetry.config.ts b/packages/integration-tests-next/fixtures/rollup4/telemetry.config.ts index 15a329ca..c5e38e83 100644 --- a/packages/integration-tests-next/fixtures/rollup4/telemetry.config.ts +++ b/packages/integration-tests-next/fixtures/rollup4/telemetry.config.ts @@ -1,5 +1,5 @@ import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rolldown"; +import { defineConfig } from "rollup"; import { sentryConfig } from "../configs/telemetry.config.js"; export default defineConfig({ From 64a8ce9fce83b02c262675c000a25776fbf87eda Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Fri, 6 Mar 2026 13:29:33 +0100 Subject: [PATCH 10/11] Fix rollup tests --- ...fig.ts => after-upload-deletion.config.js} | 0 ...ey.config.ts => application-key.config.js} | 0 ...ig.ts => basic-release-disabled.config.js} | 0 ...s.config.ts => basic-sourcemaps.config.js} | 0 .../{basic.config.ts => basic.config.js} | 0 ...ld-info.config.ts => build-info.config.js} | 0 ...ts => bundle-size-optimizations.config.js} | 0 ...> component-annotation-disabled.config.js} | 0 ...ts => component-annotation-next.config.js} | 0 ...nfig.ts => component-annotation.config.js} | 0 ...d.config.ts => debugid-disabled.config.js} | 0 .../rollup3/debugids-already-injected.test.ts | 20 ------------------- ...ta.config.ts => module-metadata.config.js} | 0 ...fig.ts => multiple-entry-points.config.js} | 0 ...-param.config.ts => query-param.config.js} | 0 ...d.config.ts => release-disabled.config.js} | 0 ...elemetry.config.ts => telemetry.config.js} | 0 .../fixtures/rollup3/utils.ts | 2 +- ...fig.ts => after-upload-deletion.config.js} | 0 ...ey.config.ts => application-key.config.js} | 0 ...ig.ts => basic-release-disabled.config.js} | 0 ...s.config.ts => basic-sourcemaps.config.js} | 0 .../{basic.config.ts => basic.config.js} | 0 ...ld-info.config.ts => build-info.config.js} | 0 ...ts => bundle-size-optimizations.config.js} | 0 ...> component-annotation-disabled.config.js} | 0 ...ts => component-annotation-next.config.js} | 0 ...nfig.ts => component-annotation.config.js} | 0 ...d.config.ts => debugid-disabled.config.js} | 0 .../debugids-already-injected.config.js} | 0 .../debugids-already-injected.config.ts | 13 ------------ ...ta.config.ts => module-metadata.config.js} | 0 ...fig.ts => multiple-entry-points.config.js} | 0 ...-param.config.ts => query-param.config.js} | 0 ...d.config.ts => release-disabled.config.js} | 0 ...elemetry.config.ts => telemetry.config.js} | 0 .../fixtures/rollup4/utils.ts | 2 +- 37 files changed, 2 insertions(+), 35 deletions(-) rename packages/integration-tests-next/fixtures/rollup3/{after-upload-deletion.config.ts => after-upload-deletion.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{application-key.config.ts => application-key.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{basic-release-disabled.config.ts => basic-release-disabled.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{basic-sourcemaps.config.ts => basic-sourcemaps.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{basic.config.ts => basic.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{build-info.config.ts => build-info.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{bundle-size-optimizations.config.ts => bundle-size-optimizations.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{component-annotation-disabled.config.ts => component-annotation-disabled.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{component-annotation-next.config.ts => component-annotation-next.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{component-annotation.config.ts => component-annotation.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{debugid-disabled.config.ts => debugid-disabled.config.js} (100%) delete mode 100644 packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.test.ts rename packages/integration-tests-next/fixtures/rollup3/{module-metadata.config.ts => module-metadata.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{multiple-entry-points.config.ts => multiple-entry-points.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{query-param.config.ts => query-param.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{release-disabled.config.ts => release-disabled.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup3/{telemetry.config.ts => telemetry.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{after-upload-deletion.config.ts => after-upload-deletion.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{application-key.config.ts => application-key.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{basic-release-disabled.config.ts => basic-release-disabled.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{basic-sourcemaps.config.ts => basic-sourcemaps.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{basic.config.ts => basic.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{build-info.config.ts => build-info.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{bundle-size-optimizations.config.ts => bundle-size-optimizations.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{component-annotation-disabled.config.ts => component-annotation-disabled.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{component-annotation-next.config.ts => component-annotation-next.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{component-annotation.config.ts => component-annotation.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{debugid-disabled.config.ts => debugid-disabled.config.js} (100%) rename packages/integration-tests-next/fixtures/{rollup3/debugids-already-injected.config.ts => rollup4/debugids-already-injected.config.js} (100%) delete mode 100644 packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts rename packages/integration-tests-next/fixtures/rollup4/{module-metadata.config.ts => module-metadata.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{multiple-entry-points.config.ts => multiple-entry-points.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{query-param.config.ts => query-param.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{release-disabled.config.ts => release-disabled.config.js} (100%) rename packages/integration-tests-next/fixtures/rollup4/{telemetry.config.ts => telemetry.config.js} (100%) diff --git a/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.ts b/packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.ts rename to packages/integration-tests-next/fixtures/rollup3/after-upload-deletion.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/application-key.config.ts b/packages/integration-tests-next/fixtures/rollup3/application-key.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/application-key.config.ts rename to packages/integration-tests-next/fixtures/rollup3/application-key.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/basic-release-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup3/basic-release-disabled.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/basic-release-disabled.config.ts rename to packages/integration-tests-next/fixtures/rollup3/basic-release-disabled.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.ts rename to packages/integration-tests-next/fixtures/rollup3/basic-sourcemaps.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/basic.config.ts b/packages/integration-tests-next/fixtures/rollup3/basic.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/basic.config.ts rename to packages/integration-tests-next/fixtures/rollup3/basic.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/build-info.config.ts b/packages/integration-tests-next/fixtures/rollup3/build-info.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/build-info.config.ts rename to packages/integration-tests-next/fixtures/rollup3/build-info.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.ts b/packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.ts rename to packages/integration-tests-next/fixtures/rollup3/bundle-size-optimizations.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.config.ts rename to packages/integration-tests-next/fixtures/rollup3/component-annotation-disabled.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.ts rename to packages/integration-tests-next/fixtures/rollup3/component-annotation-next.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/component-annotation.config.ts b/packages/integration-tests-next/fixtures/rollup3/component-annotation.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/component-annotation.config.ts rename to packages/integration-tests-next/fixtures/rollup3/component-annotation.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.ts rename to packages/integration-tests-next/fixtures/rollup3/debugid-disabled.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.test.ts b/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.test.ts deleted file mode 100644 index fad6713f..00000000 --- a/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -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": "// eslint-disable-next-line no-console - !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(e){}}();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":"AAAA,CAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,CAAA;scACA,OAAO,CAAC,GAAG,CAAC,CAAA,KAAA,CAAA,KAAA,CAAa,CAAC","debugId":"252e0338-8927-4f52-bd57-188131defd0f","debug_id":"252e0338-8927-4f52-bd57-188131defd0f"}", - } - `); -}); diff --git a/packages/integration-tests-next/fixtures/rollup3/module-metadata.config.ts b/packages/integration-tests-next/fixtures/rollup3/module-metadata.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/module-metadata.config.ts rename to packages/integration-tests-next/fixtures/rollup3/module-metadata.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/multiple-entry-points.config.ts b/packages/integration-tests-next/fixtures/rollup3/multiple-entry-points.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/multiple-entry-points.config.ts rename to packages/integration-tests-next/fixtures/rollup3/multiple-entry-points.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/query-param.config.ts b/packages/integration-tests-next/fixtures/rollup3/query-param.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/query-param.config.ts rename to packages/integration-tests-next/fixtures/rollup3/query-param.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/release-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup3/release-disabled.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/release-disabled.config.ts rename to packages/integration-tests-next/fixtures/rollup3/release-disabled.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/telemetry.config.ts b/packages/integration-tests-next/fixtures/rollup3/telemetry.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/telemetry.config.ts rename to packages/integration-tests-next/fixtures/rollup3/telemetry.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/utils.ts b/packages/integration-tests-next/fixtures/rollup3/utils.ts index c0848124..6da0009d 100644 --- a/packages/integration-tests-next/fixtures/rollup3/utils.ts +++ b/packages/integration-tests-next/fixtures/rollup3/utils.ts @@ -30,7 +30,7 @@ export function test(url: string, callback: TestCallback) { outDir, runBundler: (env) => runBundler( - `rollup --config ${testName}.config.ts`, + `rollup --config ${testName}.config.js`, { cwd, env: { diff --git a/packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.config.ts b/packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.config.ts rename to packages/integration-tests-next/fixtures/rollup4/after-upload-deletion.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/application-key.config.ts b/packages/integration-tests-next/fixtures/rollup4/application-key.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/application-key.config.ts rename to packages/integration-tests-next/fixtures/rollup4/application-key.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/basic-release-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup4/basic-release-disabled.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/basic-release-disabled.config.ts rename to packages/integration-tests-next/fixtures/rollup4/basic-release-disabled.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.ts b/packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.ts rename to packages/integration-tests-next/fixtures/rollup4/basic-sourcemaps.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/basic.config.ts b/packages/integration-tests-next/fixtures/rollup4/basic.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/basic.config.ts rename to packages/integration-tests-next/fixtures/rollup4/basic.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/build-info.config.ts b/packages/integration-tests-next/fixtures/rollup4/build-info.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/build-info.config.ts rename to packages/integration-tests-next/fixtures/rollup4/build-info.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.ts b/packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.ts rename to packages/integration-tests-next/fixtures/rollup4/bundle-size-optimizations.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.config.ts rename to packages/integration-tests-next/fixtures/rollup4/component-annotation-disabled.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.ts rename to packages/integration-tests-next/fixtures/rollup4/component-annotation-next.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/component-annotation.config.ts b/packages/integration-tests-next/fixtures/rollup4/component-annotation.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/component-annotation.config.ts rename to packages/integration-tests-next/fixtures/rollup4/component-annotation.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.ts rename to packages/integration-tests-next/fixtures/rollup4/debugid-disabled.config.js diff --git a/packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.config.ts b/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup3/debugids-already-injected.config.ts rename to packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts b/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts deleted file mode 100644 index 2726d0b1..00000000 --- a/packages/integration-tests-next/fixtures/rollup4/debugids-already-injected.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { sentryRollupPlugin } from "@sentry/rollup-plugin"; -import { defineConfig } from "rollup"; -import { sentryConfig } from "../configs/debugids-already-injected.config.js"; - -export default defineConfig({ - input: "src/basic.js", - output: { - file: "out/debugids-already-injected/basic.js", - sourcemap: true, - sourcemapDebugIds: true, - }, - plugins: [sentryRollupPlugin(sentryConfig)], -}); diff --git a/packages/integration-tests-next/fixtures/rollup4/module-metadata.config.ts b/packages/integration-tests-next/fixtures/rollup4/module-metadata.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/module-metadata.config.ts rename to packages/integration-tests-next/fixtures/rollup4/module-metadata.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/multiple-entry-points.config.ts b/packages/integration-tests-next/fixtures/rollup4/multiple-entry-points.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/multiple-entry-points.config.ts rename to packages/integration-tests-next/fixtures/rollup4/multiple-entry-points.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/query-param.config.ts b/packages/integration-tests-next/fixtures/rollup4/query-param.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/query-param.config.ts rename to packages/integration-tests-next/fixtures/rollup4/query-param.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/release-disabled.config.ts b/packages/integration-tests-next/fixtures/rollup4/release-disabled.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/release-disabled.config.ts rename to packages/integration-tests-next/fixtures/rollup4/release-disabled.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/telemetry.config.ts b/packages/integration-tests-next/fixtures/rollup4/telemetry.config.js similarity index 100% rename from packages/integration-tests-next/fixtures/rollup4/telemetry.config.ts rename to packages/integration-tests-next/fixtures/rollup4/telemetry.config.js diff --git a/packages/integration-tests-next/fixtures/rollup4/utils.ts b/packages/integration-tests-next/fixtures/rollup4/utils.ts index ee3f4bb6..2ad6dd0d 100644 --- a/packages/integration-tests-next/fixtures/rollup4/utils.ts +++ b/packages/integration-tests-next/fixtures/rollup4/utils.ts @@ -30,7 +30,7 @@ export function test(url: string, callback: TestCallback) { outDir, runBundler: (env) => runBundler( - `rollup --config ${testName}.config.ts`, + `rollup --config ${testName}.config.js`, { cwd, env: { From 3a43d068add38413e3abf2b2dc169e848c301f54 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Fri, 6 Mar 2026 15:53:05 +0100 Subject: [PATCH 11/11] Ensure Windows line ending are never used --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..94f480de --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file