Skip to content

Commit 2fe311c

Browse files
committed
move withSentry into wrappers directory
1 parent f7f8dbd commit 2fe311c

File tree

6 files changed

+6
-5
lines changed

6 files changed

+6
-5
lines changed

packages/nextjs/src/config/templates/apiProxyLoaderTemplate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type { PageConfig } from 'next';
1414

1515
// We import this from `withSentry` rather than directly from `next` because our version can work simultaneously with
1616
// multiple versions of next. See note in `withSentry` for more.
17-
import type { NextApiHandler } from '../../utils/withSentry';
17+
import type { NextApiHandler } from '../wrappers/withSentry';
1818

1919
type NextApiModule = {
2020
default: NextApiHandler;

packages/nextjs/src/config/wrappers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ export { withSentryServerSideDocumentGetInitialProps } from './withSentryServerS
55
export { withSentryServerSideErrorGetInitialProps } from './withSentryServerSideErrorGetInitialProps';
66
export { withSentryGetServerSideProps } from './withSentryGetServerSideProps';
77
export { withSentryAPI } from './withSentryAPI';
8+
export { withSentry } from './withSentry';

packages/nextjs/src/config/wrappers/withSentryAPI.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { formatAsCode, nextLogger } from '../../utils/nextLogger';
22
// We import these types from `withSentry` rather than directly from `next` because our version can work simultaneously
33
// with multiple versions of next. See note in `withSentry` for more.
4-
import type { NextApiHandler, WrappedNextApiHandler } from '../../utils/withSentry';
5-
import { withSentry } from '../../utils/withSentry';
4+
import type { NextApiHandler, WrappedNextApiHandler } from './withSentry';
5+
import { withSentry } from './withSentry';
66

77
/**
88
* Wrap the given API route handler for tracing and error capturing. Thin wrapper around `withSentry`, which only

packages/nextjs/src/index.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ export {
135135
withSentryServerSideDocumentGetInitialProps,
136136
withSentryServerSideErrorGetInitialProps,
137137
withSentryAPI,
138+
withSentry,
138139
} from './config/wrappers';
139-
export { withSentry } from './utils/withSentry';
140140

141141
// Wrap various server methods to enable error monitoring and tracing. (Note: This only happens for non-Vercel
142142
// deployments, because the current method of doing the wrapping a) crashes Next 12 apps deployed to Vercel and

packages/nextjs/test/utils/withSentry.test.ts renamed to packages/nextjs/test/config/withSentry.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Client, ClientOptions } from '@sentry/types';
44
import * as utils from '@sentry/utils';
55
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
66

7-
import { AugmentedNextApiResponse, withSentry, WrappedNextApiHandler } from '../../src/utils/withSentry';
7+
import { AugmentedNextApiResponse, withSentry, WrappedNextApiHandler } from '../../src/config/wrappers/withSentry';
88

99
const FLUSH_DURATION = 200;
1010

0 commit comments

Comments
 (0)