Repository navigation
feat(bundler-plugins): Move individual bundler plugin packages #25095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
7ccd59f
3058255
b3a5c6d
9ec908e
d1a1537
563d2fc
62dd3bf
882fab8
b2f3bc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ import { sync as globSync } from 'glob'; | |
| const E2E_TESTS_ROOT = path.resolve(__dirname, '..'); | ||
| const REPOSITORY_ROOT = path.resolve(E2E_TESTS_ROOT, '../..'); | ||
|
|
||
| export const PACKAGE_JSON_GLOB = '{packages/*,packages/legacy/*}/package.json'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E2E tarball counts will mismatchMedium Severity
Additional Locations (1)Reviewed by Cursor Bugbot for commit b2f3bc1. Configure here. |
||
|
|
||
| /** | ||
| * Workspace @sentry and @sentry-internal packages that have a built tarball for the E2E version. | ||
| * @returns The names of the published Sentry tarball packages. | ||
|
|
@@ -13,7 +15,7 @@ export function getPublishedSentryTarballPackageNames(): string[] { | |
| const version = getE2eTestsPackageVersion(); | ||
| const names: string[] = []; | ||
|
|
||
| for (const packageJsonPath of globSync('packages/*/package.json', { | ||
| for (const packageJsonPath of globSync(PACKAGE_JSON_GLOB, { | ||
| cwd: REPOSITORY_ROOT, | ||
| absolute: true, | ||
| })) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| build | ||
| *.tgz |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # MIT License | ||
|
|
||
| Copyright (c) 2022-2026, Sentry | ||
| All rights reserved. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are met: | ||
|
|
||
| - Redistributions of source code must retain the above copyright notice, this | ||
| list of conditions and the following disclaimer. | ||
|
|
||
| - Redistributions in binary form must reproduce the above copyright notice, | ||
| this list of conditions and the following disclaimer in the documentation | ||
| and/or other materials provided with the distribution. | ||
|
|
||
| - Neither the name of the copyright holder nor the names of its | ||
| contributors may be used to endorse or promote products derived from | ||
| this software without specific prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
| FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
| SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
| CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
| OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This just reminded me: did we migrate the options documentation for the new packages? Right now, I think https://www.npmjs.com/package/@sentry/vite-plugin is the only place where all plugin options are documented. Unless we already took care of this when we added If not, I'd say the cheapest thing we can do is add the options table to the readme of the legacy and probably also of the new package. WDYT? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| <p align="center"> | ||
| <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank"> | ||
| <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84"> | ||
| </a> | ||
| </p> | ||
|
|
||
| # Sentry esbuild Plugin | ||
|
|
||
| A esbuild plugin that uploads source maps to Sentry and injects release and Debug ID information into your bundles. | ||
|
|
||
| This package re-exports `@sentry/bundler-plugins/esbuild`. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| npm install @sentry/esbuild-plugin --save-dev | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ```js | ||
| // build.js | ||
| import * as esbuild from 'esbuild'; | ||
| import { sentryEsbuildPlugin } from '@sentry/esbuild-plugin'; | ||
|
|
||
| await esbuild.build({ | ||
| sourcemap: true, | ||
| plugins: [ | ||
| sentryEsbuildPlugin({ | ||
| org: process.env.SENTRY_ORG, | ||
| project: process.env.SENTRY_PROJECT, | ||
| authToken: process.env.SENTRY_AUTH_TOKEN, | ||
| }), | ||
| ], | ||
| }); | ||
| ``` | ||
|
|
||
| ## Documentation | ||
|
|
||
| - [Uploading source maps](https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/) | ||
|
|
||
| ## Support | ||
|
|
||
| - [Report a bug](https://github.com/getsentry/sentry-javascript/issues/new/choose) | ||
| - [Contributing](https://github.com/getsentry/sentry-javascript/blob/develop/CONTRIBUTING.md) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| { | ||
| "name": "@sentry/esbuild-plugin", | ||
| "version": "11.5.0", | ||
| "description": "Official Sentry esbuild plugin", | ||
| "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
| "homepage": "https://github.com/getsentry/sentry-javascript/tree/develop/packages/legacy/esbuild-plugin", | ||
| "author": "Sentry", | ||
| "license": "MIT", | ||
| "keywords": [ | ||
| "Sentry", | ||
| "esbuild", | ||
| "bundler", | ||
| "plugin" | ||
| ], | ||
| "engines": { | ||
| "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "files": [ | ||
| "/build" | ||
| ], | ||
| "main": "build/cjs/index.js", | ||
| "module": "build/esm/index.js", | ||
| "types": "build/types/index.d.ts", | ||
| "exports": { | ||
| "./package.json": "./package.json", | ||
| ".": { | ||
| "types": "./build/types/index.d.ts", | ||
| "import": "./build/esm/index.js", | ||
| "require": "./build/cjs/index.js" | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "build": "run-p build:transpile build:types", | ||
| "build:dev": "yarn build", | ||
| "build:transpile": "rollup -c rollup.npm.config.mjs", | ||
| "build:types": "tsc -p tsconfig.types.json", | ||
| "build:watch": "run-p build:transpile:watch", | ||
| "build:dev:watch": "yarn build:watch", | ||
| "build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch", | ||
| "build:tarball": "npm pack", | ||
| "clean": "rimraf build coverage sentry-esbuild-plugin-*.tgz", | ||
| "lint": "oxlint . --type-aware", | ||
| "lint:fix": "oxlint . --fix --type-aware", | ||
| "test": "vitest run", | ||
| "test:unit": "vitest run" | ||
| }, | ||
| "dependencies": { | ||
| "@sentry/bundler-plugins": "11.5.0" | ||
| }, | ||
| "volta": { | ||
| "extends": "../../../package.json" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils'; | ||
|
|
||
| export default makeNPMConfigVariants( | ||
| makeBaseNPMConfig({ | ||
| entrypoints: ['src/index.ts'], | ||
| packageSpecificConfig: { | ||
| output: { | ||
| exports: 'named', | ||
| }, | ||
| }, | ||
| }), | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export * from '@sentry/bundler-plugins/esbuild'; | ||
| export { default } from '@sentry/bundler-plugins/esbuild'; | ||
|
timfish marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import * as bundlerPlugins from '@sentry/bundler-plugins/esbuild'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import * as plugin from '../src/index'; | ||
|
|
||
| describe('@sentry/esbuild-plugin', () => { | ||
| it('re-exports @sentry/bundler-plugins/esbuild', () => { | ||
| expect(plugin.sentryEsbuildPlugin).toBe(bundlerPlugins.sentryEsbuildPlugin); | ||
| expect(Object.keys(plugin).sort()).toEqual(Object.keys(bundlerPlugins).sort()); | ||
| }); | ||
|
|
||
| it('re-exports the default export', () => { | ||
| expect(plugin.default).toBe(bundlerPlugins.default); | ||
| }); | ||
| }); | ||
|
timfish marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/tsconfig", | ||
| "extends": "../tsconfig.json", | ||
| "include": ["../src/**/*", "./**/*"], | ||
| "compilerOptions": { | ||
| "types": ["node"] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/tsconfig", | ||
| "extends": "../../../tsconfig.json", | ||
| "include": ["./src/**/*.ts", "./package.json"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/tsconfig", | ||
| "extends": "./tsconfig.json", | ||
| "include": ["./src/**/*"], | ||
| "compilerOptions": { | ||
| "rootDir": "./src", | ||
| "declaration": true, | ||
| "declarationMap": true, | ||
| "emitDeclarationOnly": true, | ||
| "outDir": "build/types" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import baseConfig from '../../../vite/vite.config'; | ||
|
|
||
| export default { | ||
| ...baseConfig, | ||
| test: { | ||
| ...baseConfig.test, | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| build | ||
| *.tgz |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # MIT License | ||
|
|
||
| Copyright (c) 2022-2026, Sentry | ||
| All rights reserved. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are met: | ||
|
|
||
| - Redistributions of source code must retain the above copyright notice, this | ||
| list of conditions and the following disclaimer. | ||
|
|
||
| - Redistributions in binary form must reproduce the above copyright notice, | ||
| this list of conditions and the following disclaimer in the documentation | ||
| and/or other materials provided with the distribution. | ||
|
|
||
| - Neither the name of the copyright holder nor the names of its | ||
| contributors may be used to endorse or promote products derived from | ||
| this software without specific prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
| FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
| SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
| CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
| OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| <p align="center"> | ||
| <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank"> | ||
| <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84"> | ||
| </a> | ||
| </p> | ||
|
|
||
| # Sentry Rollup Plugin | ||
|
|
||
| A Rollup plugin that uploads source maps to Sentry and injects release and Debug ID information into your bundles. | ||
|
|
||
| This package re-exports `@sentry/bundler-plugins/rollup`. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| npm install @sentry/rollup-plugin --save-dev | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ```js | ||
| // rollup.config.js | ||
| import { sentryRollupPlugin } from '@sentry/rollup-plugin'; | ||
|
|
||
| export default { | ||
| output: { | ||
| sourcemap: true, | ||
| }, | ||
| plugins: [ | ||
| sentryRollupPlugin({ | ||
| org: process.env.SENTRY_ORG, | ||
| project: process.env.SENTRY_PROJECT, | ||
| authToken: process.env.SENTRY_AUTH_TOKEN, | ||
| }), | ||
| ], | ||
| }; | ||
| ``` | ||
|
|
||
| ## Documentation | ||
|
|
||
| - [Uploading source maps](https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/) | ||
|
|
||
| ## Support | ||
|
|
||
| - [Report a bug](https://github.com/getsentry/sentry-javascript/issues/new/choose) | ||
| - [Contributing](https://github.com/getsentry/sentry-javascript/blob/develop/CONTRIBUTING.md) |


Uh oh!
There was an error while loading. Please reload this page.