Skip to content

Commit a37151b

Browse files
committed
fix(bundler-plugins): integration with monorepo
Integrate the newly merged in `@sentry/bundler-plugins` project to the sentry-javascript monorepo. - Integration tests are updated to use the named submodule exports on the `@sentry/bundler-plugins` package, rather than the per-platform re-export shims. - Lint and naming conventions brought in line with project standards. - Bundler-plugins integration tests now run on CI. - Aligned on the same vitest version for bundler-plugins and the rest of the repo. It might be good to upgrade vitest, but not needed for this merge. The version has not been updated from its independent 5.x line, though it may be a good idea to bump it up to align with the 10.x line that the rest of the monorepo uses.
1 parent dcaeb3e commit a37151b

266 files changed

Lines changed: 3229 additions & 3328 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.craft.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ targets:
1616
- name: npm
1717
id: '@sentry/node-core'
1818
includeNames: /^sentry-node-core-\d.*\.tgz$/
19+
- name: npm
20+
id: '@sentry/bundler-plugins'
21+
includeNames: /^sentry-bundler-plugins-\d.*\.tgz$/
1922
- name: npm
2023
id: '@sentry-internal/server-utils'
2124
includeNames: /^sentry-internal-server-utils-\d.*\.tgz$/

.github/dependency-review-config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ allow-ghsas:
1111
- GHSA-gp8f-8m3g-qvj9
1212
# devalue vulnerability - this is just used by nuxt & astro as transitive dependency
1313
- GHSA-vj54-72f3-p5jv
14+
# The bundler-plugin integration test fixtures deliberately pin multiple Vite
15+
# major versions (4/6/7/8) to test the plugin against each. These are dev-only
16+
# test fixtures that run `vite build` (never the dev server) and are never
17+
# shipped, so the following Vite dev-server / transitive advisories do not apply:
18+
# launch-editor command injection (via Vite 4 fixture)
19+
- GHSA-c27g-q93r-2cwf
20+
# Vite arbitrary file read via dev server WebSocket (Vite 6/7/8 fixtures)
21+
- GHSA-p9ff-h696-f583
22+
# Vite `server.fs.deny` bypassed with queries (Vite 7/8 fixtures)
23+
- GHSA-v2wj-q39q-566r

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ jobs:
172172
changed_bun_integration:
173173
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
174174
'@sentry-internal/bun-integration-tests') }}
175+
changed_bundler_plugin_integration:
176+
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
177+
'@sentry-internal/bundler-plugin-integration-tests') }}
175178
changed_browser_integration:
176179
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
177180
'@sentry-internal/browser-integration-tests') }}
@@ -904,6 +907,33 @@ jobs:
904907
working-directory: dev-packages/bun-integration-tests
905908
run: yarn test
906909

910+
job_bundler_plugin_integration_tests:
911+
name: Bundler Plugin Integration Tests
912+
needs: [job_get_metadata, job_build]
913+
if: needs.job_build.outputs.changed_bundler_plugin_integration == 'true' || github.event_name != 'pull_request'
914+
runs-on: ubuntu-24.04
915+
timeout-minutes: 15
916+
steps:
917+
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
918+
uses: actions/checkout@v6
919+
with:
920+
ref: ${{ env.HEAD_COMMIT }}
921+
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
922+
with:
923+
version: 9.15.9
924+
- name: Set up Node
925+
uses: actions/setup-node@v6
926+
with:
927+
node-version-file: 'package.json'
928+
- name: Restore caches
929+
uses: ./.github/actions/restore-cache
930+
with:
931+
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
932+
933+
- name: Run integration tests
934+
working-directory: dev-packages/bundler-plugin-integration-tests
935+
run: yarn test
936+
907937
job_build_tarballs:
908938
name: Build tarballs
909939
# We want to run this if:
@@ -1201,6 +1231,7 @@ jobs:
12011231
job_node_core_integration_tests,
12021232
job_cloudflare_integration_tests,
12031233
job_bun_integration_tests,
1234+
job_bundler_plugin_integration_tests,
12041235
job_browser_playwright_tests,
12051236
job_browser_loader_tests,
12061237
job_e2e_tests,

.oxfmtrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"ignorePatterns": [
1010
"packages/browser/test/loader.js",
1111
"packages/replay-worker/examples/worker.min.js",
12+
"packages/bundler-plugins/test/core/fixtures",
1213
"dev-packages/browser-integration-tests/fixtures",
14+
"dev-packages/bundler-plugin-integration-tests/fixtures",
1315
"**/test.ts-snapshots/**",
1416
"/.nx/cache",
1517
"/.nx/workspace-data"

.oxlintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"test/manual/**",
3939
"types/**",
4040
"scripts/*.js",
41-
"node_modules/**"
41+
"node_modules/**",
42+
"packages/bundler-plugins/test/core/fixtures/**"
4243
]
4344
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
fixtures/*/out/**
2+
3+
# Regenerated on every run by `pnpm install --force` in setup.mjs
4+
fixtures/*/pnpm-lock.yaml
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "../../node_modules/oxlint/configuration_schema.json",
3+
"extends": ["../.oxlintrc.json"],
4+
"env": {
5+
"node": true
6+
},
7+
"ignorePatterns": ["fixtures/**/src/**", "fixtures/**/out/**"]
8+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin";
1+
import type { SentryRollupPluginOptions } from "@sentry/bundler-plugins/rollup";
22
export declare function getSentryConfig(outDir: string): SentryRollupPluginOptions;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin";
1+
import type { SentryRollupPluginOptions } from "@sentry/bundler-plugins/rollup";
22
export declare const sentryConfig: SentryRollupPluginOptions;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import type { SentryRollupPluginOptions } from "@sentry/rollup-plugin";
1+
import type { SentryRollupPluginOptions } from "@sentry/bundler-plugins/rollup";
22
export declare const sentryConfig: SentryRollupPluginOptions;

0 commit comments

Comments
 (0)