Repository navigation
feat: Export the Node bundler plugins from SDKs that wrap @sentry/node #25536
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
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 |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryEsbuildPlugin } from '@sentry/node/esbuild'; | ||
| export type { SentryEsbuildPluginOptions } from '@sentry/node/esbuild'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryRollupPlugin } from '@sentry/node/rollup'; | ||
| export type { SentryRollupPluginOptions } from '@sentry/node/rollup'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryVitePlugin } from '@sentry/node/vite'; | ||
| export type { SentryVitePluginOptions } from '@sentry/node/vite'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryWebpackPlugin } from '@sentry/node/webpack'; | ||
| export type { SentryWebpackPluginOptions } from '@sentry/node/webpack'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { sentryEsbuildPlugin as nodeEsbuildPlugin } from '@sentry/node/esbuild'; | ||
| import { sentryRollupPlugin as nodeRollupPlugin } from '@sentry/node/rollup'; | ||
| import { sentryVitePlugin as nodeVitePlugin } from '@sentry/node/vite'; | ||
| import { sentryWebpackPlugin as nodeWebpackPlugin } from '@sentry/node/webpack'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { sentryEsbuildPlugin } from '../src/bundler-plugin/esbuild'; | ||
| import { sentryRollupPlugin } from '../src/bundler-plugin/rollup'; | ||
| import { sentryVitePlugin } from '../src/bundler-plugin/vite'; | ||
| import { sentryWebpackPlugin } from '../src/bundler-plugin/webpack'; | ||
|
|
||
| describe('@sentry/aws-serverless bundler plugins', () => { | ||
| it('re-exports the @sentry/node plugins', () => { | ||
| expect(sentryVitePlugin).toBe(nodeVitePlugin); | ||
| expect(sentryRollupPlugin).toBe(nodeRollupPlugin); | ||
| expect(sentryWebpackPlugin).toBe(nodeWebpackPlugin); | ||
| expect(sentryEsbuildPlugin).toBe(nodeEsbuildPlugin); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,16 @@ | ||
| import { makeBaseNPMConfig, makeNPMConfigVariants, makeOrchestrionLoader } from '@sentry-internal/rollup-utils'; | ||
|
|
||
| export default [...makeNPMConfigVariants(makeBaseNPMConfig()), ...makeOrchestrionLoader('./build')]; | ||
| export default [ | ||
| ...makeNPMConfigVariants( | ||
| makeBaseNPMConfig({ | ||
| entrypoints: [ | ||
| 'src/index.ts', | ||
| 'src/bundler-plugin/vite.ts', | ||
| 'src/bundler-plugin/rollup.ts', | ||
| 'src/bundler-plugin/webpack.ts', | ||
| 'src/bundler-plugin/esbuild.ts', | ||
| ], | ||
| }), | ||
| ), | ||
| ...makeOrchestrionLoader('./build'), | ||
| ]; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryEsbuildPlugin } from '@sentry/node/esbuild'; | ||
| export type { SentryEsbuildPluginOptions } from '@sentry/node/esbuild'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryRollupPlugin } from '@sentry/node/rollup'; | ||
| export type { SentryRollupPluginOptions } from '@sentry/node/rollup'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryVitePlugin } from '@sentry/node/vite'; | ||
| export type { SentryVitePluginOptions } from '@sentry/node/vite'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryWebpackPlugin } from '@sentry/node/webpack'; | ||
| export type { SentryWebpackPluginOptions } from '@sentry/node/webpack'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { sentryEsbuildPlugin as nodeEsbuildPlugin } from '@sentry/node/esbuild'; | ||
| import { sentryRollupPlugin as nodeRollupPlugin } from '@sentry/node/rollup'; | ||
| import { sentryVitePlugin as nodeVitePlugin } from '@sentry/node/vite'; | ||
| import { sentryWebpackPlugin as nodeWebpackPlugin } from '@sentry/node/webpack'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { sentryEsbuildPlugin } from '../src/bundler-plugin/esbuild'; | ||
| import { sentryRollupPlugin } from '../src/bundler-plugin/rollup'; | ||
| import { sentryVitePlugin } from '../src/bundler-plugin/vite'; | ||
| import { sentryWebpackPlugin } from '../src/bundler-plugin/webpack'; | ||
|
|
||
| describe('@sentry/google-cloud-serverless bundler plugins', () => { | ||
| it('re-exports the @sentry/node plugins', () => { | ||
| expect(sentryVitePlugin).toBe(nodeVitePlugin); | ||
| expect(sentryRollupPlugin).toBe(nodeRollupPlugin); | ||
| expect(sentryWebpackPlugin).toBe(nodeWebpackPlugin); | ||
| expect(sentryEsbuildPlugin).toBe(nodeEsbuildPlugin); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,46 @@ | |
| "types": "./build/types/index.deno.d.ts", | ||
| "default": "./build/cjs/index.deno.js" | ||
| } | ||
| }, | ||
| "./node/vite": { | ||
|
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. l: Hono might be deprecated, so we could leave that out I guess. And if we would keep it we might need a |
||
| "import": { | ||
| "types": "./build/types/node/bundler-plugin/vite.d.ts", | ||
| "default": "./build/esm/node/bundler-plugin/vite.js" | ||
| }, | ||
| "require": { | ||
| "types": "./build/types/node/bundler-plugin/vite.d.ts", | ||
| "default": "./build/cjs/node/bundler-plugin/vite.js" | ||
| } | ||
| }, | ||
| "./node/rollup": { | ||
| "import": { | ||
| "types": "./build/types/node/bundler-plugin/rollup.d.ts", | ||
| "default": "./build/esm/node/bundler-plugin/rollup.js" | ||
| }, | ||
| "require": { | ||
| "types": "./build/types/node/bundler-plugin/rollup.d.ts", | ||
| "default": "./build/cjs/node/bundler-plugin/rollup.js" | ||
| } | ||
| }, | ||
| "./node/webpack": { | ||
| "import": { | ||
| "types": "./build/types/node/bundler-plugin/webpack.d.ts", | ||
| "default": "./build/esm/node/bundler-plugin/webpack.js" | ||
| }, | ||
| "require": { | ||
| "types": "./build/types/node/bundler-plugin/webpack.d.ts", | ||
| "default": "./build/cjs/node/bundler-plugin/webpack.js" | ||
| } | ||
| }, | ||
| "./node/esbuild": { | ||
| "import": { | ||
| "types": "./build/types/node/bundler-plugin/esbuild.d.ts", | ||
| "default": "./build/esm/node/bundler-plugin/esbuild.js" | ||
| }, | ||
| "require": { | ||
| "types": "./build/types/node/bundler-plugin/esbuild.d.ts", | ||
| "default": "./build/cjs/node/bundler-plugin/esbuild.js" | ||
| } | ||
| } | ||
| }, | ||
| "publishConfig": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryEsbuildPlugin } from '@sentry/node/esbuild'; | ||
| export type { SentryEsbuildPluginOptions } from '@sentry/node/esbuild'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryRollupPlugin } from '@sentry/node/rollup'; | ||
| export type { SentryRollupPluginOptions } from '@sentry/node/rollup'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryVitePlugin } from '@sentry/node/vite'; | ||
| export type { SentryVitePluginOptions } from '@sentry/node/vite'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryWebpackPlugin } from '@sentry/node/webpack'; | ||
| export type { SentryWebpackPluginOptions } from '@sentry/node/webpack'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { sentryEsbuildPlugin as nodeEsbuildPlugin } from '@sentry/node/esbuild'; | ||
| import { sentryRollupPlugin as nodeRollupPlugin } from '@sentry/node/rollup'; | ||
| import { sentryVitePlugin as nodeVitePlugin } from '@sentry/node/vite'; | ||
| import { sentryWebpackPlugin as nodeWebpackPlugin } from '@sentry/node/webpack'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { sentryEsbuildPlugin } from '../../src/node/bundler-plugin/esbuild'; | ||
| import { sentryRollupPlugin } from '../../src/node/bundler-plugin/rollup'; | ||
| import { sentryVitePlugin } from '../../src/node/bundler-plugin/vite'; | ||
| import { sentryWebpackPlugin } from '../../src/node/bundler-plugin/webpack'; | ||
|
|
||
| describe('@sentry/hono/node bundler plugins', () => { | ||
| it('re-exports the @sentry/node plugins', () => { | ||
| expect(sentryVitePlugin).toBe(nodeVitePlugin); | ||
| expect(sentryRollupPlugin).toBe(nodeRollupPlugin); | ||
| expect(sentryWebpackPlugin).toBe(nodeWebpackPlugin); | ||
| expect(sentryEsbuildPlugin).toBe(nodeEsbuildPlugin); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,46 @@ | |
| "types": "./setup.d.ts", | ||
| "default": "./build/cjs/setup.js" | ||
| } | ||
| }, | ||
| "./vite": { | ||
|
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. m: I did a quick research and it does seem that NestJS only uses webpack. I also saw that this can be extended, but this is not really in their docs, but only in one of their examples: https://github.com/nestjs/nest/blob/master/sample/08-webpack/webpack-hmr.config.cjs This is a tldr of the clanker:
And before we export one of these we should check if it works via an E2E test |
||
| "import": { | ||
| "types": "./build/types/bundler-plugin/vite.d.ts", | ||
| "default": "./build/esm/bundler-plugin/vite.js" | ||
| }, | ||
| "require": { | ||
| "types": "./build/types/bundler-plugin/vite.d.ts", | ||
| "default": "./build/cjs/bundler-plugin/vite.js" | ||
| } | ||
| }, | ||
| "./rollup": { | ||
| "import": { | ||
| "types": "./build/types/bundler-plugin/rollup.d.ts", | ||
| "default": "./build/esm/bundler-plugin/rollup.js" | ||
| }, | ||
| "require": { | ||
| "types": "./build/types/bundler-plugin/rollup.d.ts", | ||
| "default": "./build/cjs/bundler-plugin/rollup.js" | ||
| } | ||
| }, | ||
| "./webpack": { | ||
| "import": { | ||
| "types": "./build/types/bundler-plugin/webpack.d.ts", | ||
| "default": "./build/esm/bundler-plugin/webpack.js" | ||
| }, | ||
| "require": { | ||
| "types": "./build/types/bundler-plugin/webpack.d.ts", | ||
| "default": "./build/cjs/bundler-plugin/webpack.js" | ||
| } | ||
| }, | ||
| "./esbuild": { | ||
| "import": { | ||
| "types": "./build/types/bundler-plugin/esbuild.d.ts", | ||
| "default": "./build/esm/bundler-plugin/esbuild.js" | ||
| }, | ||
| "require": { | ||
| "types": "./build/types/bundler-plugin/esbuild.d.ts", | ||
| "default": "./build/cjs/bundler-plugin/esbuild.js" | ||
| } | ||
| } | ||
| }, | ||
| "publishConfig": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryEsbuildPlugin } from '@sentry/node/esbuild'; | ||
| export type { SentryEsbuildPluginOptions } from '@sentry/node/esbuild'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryRollupPlugin } from '@sentry/node/rollup'; | ||
| export type { SentryRollupPluginOptions } from '@sentry/node/rollup'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryVitePlugin } from '@sentry/node/vite'; | ||
| export type { SentryVitePluginOptions } from '@sentry/node/vite'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { sentryWebpackPlugin } from '@sentry/node/webpack'; | ||
| export type { SentryWebpackPluginOptions } from '@sentry/node/webpack'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { sentryEsbuildPlugin as nodeEsbuildPlugin } from '@sentry/node/esbuild'; | ||
| import { sentryRollupPlugin as nodeRollupPlugin } from '@sentry/node/rollup'; | ||
| import { sentryVitePlugin as nodeVitePlugin } from '@sentry/node/vite'; | ||
| import { sentryWebpackPlugin as nodeWebpackPlugin } from '@sentry/node/webpack'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { sentryEsbuildPlugin } from '../src/bundler-plugin/esbuild'; | ||
| import { sentryRollupPlugin } from '../src/bundler-plugin/rollup'; | ||
| import { sentryVitePlugin } from '../src/bundler-plugin/vite'; | ||
| import { sentryWebpackPlugin } from '../src/bundler-plugin/webpack'; | ||
|
|
||
| describe('@sentry/nestjs bundler plugins', () => { | ||
| it('re-exports the @sentry/node plugins', () => { | ||
| expect(sentryVitePlugin).toBe(nodeVitePlugin); | ||
| expect(sentryRollupPlugin).toBe(nodeRollupPlugin); | ||
| expect(sentryWebpackPlugin).toBe(nodeWebpackPlugin); | ||
| expect(sentryEsbuildPlugin).toBe(nodeEsbuildPlugin); | ||
| }); | ||
| }); | ||
|
cursor[bot] marked this conversation as resolved.
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q: Is it common to have bundlers in front of AWS lambdas? I thought they're always quite plain when it comes to bundlers (same for Google)