Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions packages/aws-serverless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,46 @@
"require": {
"default": "./build/npm/cjs/awslambda-auto.js"
}
},
"./vite": {

Copy link
Copy Markdown
Member

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)

"import": {
"types": "./build/npm/types/bundler-plugin/vite.d.ts",
"default": "./build/npm/esm/bundler-plugin/vite.js"
},
"require": {
"types": "./build/npm/types/bundler-plugin/vite.d.ts",
"default": "./build/npm/cjs/bundler-plugin/vite.js"
}
},
"./rollup": {
"import": {
"types": "./build/npm/types/bundler-plugin/rollup.d.ts",
"default": "./build/npm/esm/bundler-plugin/rollup.js"
},
"require": {
"types": "./build/npm/types/bundler-plugin/rollup.d.ts",
"default": "./build/npm/cjs/bundler-plugin/rollup.js"
}
},
"./webpack": {
"import": {
"types": "./build/npm/types/bundler-plugin/webpack.d.ts",
"default": "./build/npm/esm/bundler-plugin/webpack.js"
},
"require": {
"types": "./build/npm/types/bundler-plugin/webpack.d.ts",
"default": "./build/npm/cjs/bundler-plugin/webpack.js"
}
},
"./esbuild": {
"import": {
"types": "./build/npm/types/bundler-plugin/esbuild.d.ts",
"default": "./build/npm/esm/bundler-plugin/esbuild.js"
},
"require": {
"types": "./build/npm/types/bundler-plugin/esbuild.d.ts",
"default": "./build/npm/cjs/bundler-plugin/esbuild.js"
}
}
},
"publishConfig": {
Expand Down
9 changes: 8 additions & 1 deletion packages/aws-serverless/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ export default [
// TODO: `awslambda-auto.ts` is a file which the lambda layer uses to automatically init the SDK. Does it need to be
// in the npm package? Is it possible that some people are using it themselves in the same way the layer uses it (in
// which case removing it would be a breaking change)? Should it stay here or not?
entrypoints: ['src/index.ts', 'src/awslambda-auto.ts'],
entrypoints: [
'src/index.ts',
'src/awslambda-auto.ts',
'src/bundler-plugin/vite.ts',
'src/bundler-plugin/rollup.ts',
'src/bundler-plugin/webpack.ts',
'src/bundler-plugin/esbuild.ts',
],
// packages with bundles have a different build directory structure
hasBundles: true,
packageSpecificConfig: {
Expand Down
2 changes: 2 additions & 0 deletions packages/aws-serverless/src/bundler-plugin/esbuild.ts
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';
2 changes: 2 additions & 0 deletions packages/aws-serverless/src/bundler-plugin/rollup.ts
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';
2 changes: 2 additions & 0 deletions packages/aws-serverless/src/bundler-plugin/vite.ts
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';
2 changes: 2 additions & 0 deletions packages/aws-serverless/src/bundler-plugin/webpack.ts
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';
18 changes: 18 additions & 0 deletions packages/aws-serverless/test/bundler-plugin.test.ts
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);
});
});
40 changes: 40 additions & 0 deletions packages/google-cloud-serverless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,46 @@
"import": {
"default": "./build/import-hook.mjs"
}
},
"./vite": {
"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": {
Expand Down
15 changes: 14 additions & 1 deletion packages/google-cloud-serverless/rollup.npm.config.mjs
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';
2 changes: 2 additions & 0 deletions packages/google-cloud-serverless/src/bundler-plugin/vite.ts
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';
18 changes: 18 additions & 0 deletions packages/google-cloud-serverless/test/bundler-plugin.test.ts
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);
});
});
40 changes: 40 additions & 0 deletions packages/hono/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,46 @@
"types": "./build/types/index.deno.d.ts",
"default": "./build/cjs/index.deno.js"
}
},
"./node/vite": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 ./cloudflare/vite export too

"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": {
Expand Down
4 changes: 4 additions & 0 deletions packages/hono/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const baseConfig = makeBaseNPMConfig({
'src/index.node.ts',
'src/index.bun.ts',
'src/index.deno.ts',
'src/node/bundler-plugin/vite.ts',
'src/node/bundler-plugin/rollup.ts',
'src/node/bundler-plugin/webpack.ts',
'src/node/bundler-plugin/esbuild.ts',
],
packageSpecificConfig: {
output: {
Expand Down
2 changes: 2 additions & 0 deletions packages/hono/src/node/bundler-plugin/esbuild.ts
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';
2 changes: 2 additions & 0 deletions packages/hono/src/node/bundler-plugin/rollup.ts
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';
2 changes: 2 additions & 0 deletions packages/hono/src/node/bundler-plugin/vite.ts
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';
2 changes: 2 additions & 0 deletions packages/hono/src/node/bundler-plugin/webpack.ts
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';
18 changes: 18 additions & 0 deletions packages/hono/test/node/bundler-plugin.test.ts
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);
});
});
40 changes: 40 additions & 0 deletions packages/nestjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,46 @@
"types": "./setup.d.ts",
"default": "./build/cjs/setup.js"
}
},
"./vite": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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:

The Nest CLI has three builders. You set the builder with compilerOptions.builder in nest-cli.json:

  • tsc: This is the default. It does not make a bundle.
  • webpack: This makes a bundle. It is the default only in monorepo mode ("monorepo": true). You can also select it with "webpack": true or nest build --webpack.
  • swc: This compiles files and does not make a bundle. You select it with "builder": "swc" or nest start -b swc.

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": {
Expand Down
9 changes: 8 additions & 1 deletion packages/nestjs/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollu

export default makeNPMConfigVariants(
makeBaseNPMConfig({
entrypoints: ['src/index.ts', 'src/setup.ts'],
entrypoints: [
'src/index.ts',
'src/setup.ts',
'src/bundler-plugin/vite.ts',
'src/bundler-plugin/rollup.ts',
'src/bundler-plugin/webpack.ts',
'src/bundler-plugin/esbuild.ts',
],
}),
);
2 changes: 2 additions & 0 deletions packages/nestjs/src/bundler-plugin/esbuild.ts
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';
2 changes: 2 additions & 0 deletions packages/nestjs/src/bundler-plugin/rollup.ts
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';
2 changes: 2 additions & 0 deletions packages/nestjs/src/bundler-plugin/vite.ts
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';
2 changes: 2 additions & 0 deletions packages/nestjs/src/bundler-plugin/webpack.ts
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';
18 changes: 18 additions & 0 deletions packages/nestjs/test/bundler-plugin.test.ts
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);
});
});
Comment thread
cursor[bot] marked this conversation as resolved.
Loading