Skip to content

Commit 105f25a

Browse files
authored
feat: Add @sentry/bundler-plugins core package (#938)
Consolidate all bundler plugin code into a single new `@sentry/bundler-plugins` package with subpath exports (`/rollup`, `/webpack`, `/vite`, etc.). Code was moved using `git mv` to preserve history. The existing bundler-specific packages (`@sentry/rollup-plugin`, etc.) become thin stubs that re-export from `@sentry/bundler-plugins`. This makes it straightforward to: - Add new bundler support (e.g. rolldown) without publishing a new package - Move all plugin code in the JS monorepo as a single dependency rather than 6 - Keep bundler-specific packages at v5, avoiding unnecessary major version bumps for users Individual packages can eventually be deprecated but there's no urgency — integration tests still target them and they remain fully functional.
1 parent c63ec4d commit 105f25a

95 files changed

Lines changed: 2047 additions & 1812 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.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ yarn-error.log
1111
packages/**/yarn.lock
1212

1313
.DS_Store
14-
packages/bundler-plugin-core/src/version.ts
14+
packages/bundler-plugins/src/core/version.ts
1515
packages/integration-tests-next/fixtures/**/pnpm-lock.yaml

.oxfmtrc.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
"printWidth": 100,
44
"experimentalSortPackageJson": false,
55
"trailingComma": "es5",
6-
"ignorePatterns": ["packages/bundler-plugin-core/test/fixtures", ".nxcache"]
6+
"ignorePatterns": [
7+
"packages/bundler-plugin-core/test/fixtures",
8+
"packages/bundler-plugins/test/core/fixtures",
9+
".nxcache"
10+
]
711
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"workspaces": [
99
"packages/babel-plugin-component-annotate",
1010
"packages/bundler-plugin-core",
11+
"packages/bundler-plugins",
1112
"packages/dev-utils",
1213
"packages/esbuild-plugin",
1314
"packages/playground",

packages/babel-plugin-component-annotate/package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,13 @@
4545
"clean": "run-s clean:build",
4646
"clean:all": "run-p clean clean:deps",
4747
"clean:build": "premove ./dist *.tgz",
48-
"clean:deps": "premove node_modules",
49-
"test": "vitest run"
48+
"clean:deps": "premove node_modules"
49+
},
50+
"dependencies": {
51+
"@sentry/bundler-plugins": "5.3.0"
5052
},
5153
"devDependencies": {
52-
"@babel/core": "7.18.5",
53-
"@types/babel__core": "^7.20.5",
54-
"@babel/preset-react": "^7.23.3",
5554
"@types/node": "^18.6.3",
56-
"vitest": "^4.0.0",
5755
"premove": "^4.0.0",
5856
"rolldown": "^1.0.0"
5957
},

packages/babel-plugin-component-annotate/rollup.config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import packageJson from "./package.json" with { type: "json" };
22

3+
const deps = Object.keys(packageJson.dependencies ?? {});
4+
35
export default {
46
platform: "node",
57
input: ["src/index.ts"],
6-
external: Object.keys(packageJson.dependencies ?? []),
8+
external: (id) => deps.some((dep) => id === dep || id.startsWith(`${dep}/`)),
79
output: [
810
{
911
file: packageJson.module,

0 commit comments

Comments
 (0)