@sentry/wizard 3.41.0 → 3.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/e2e-tests/tests/remix.test.js +1 -1
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +1 -1
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.js +1 -1
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.js +1 -1
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +1 -1
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/remix/sdk-setup.js +0 -4
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/sourcemaps/tools/nextjs.js +1 -1
- package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +4 -4
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/remix/server-instrumentation.test.js +2 -2
- package/dist/test/remix/server-instrumentation.test.js.map +1 -1
- package/e2e-tests/tests/remix.test.ts +1 -2
- package/package.json +1 -1
- package/src/nextjs/nextjs-wizard.ts +1 -1
- package/src/nextjs/templates.ts +0 -3
- package/src/nuxt/nuxt-wizard.ts +1 -1
- package/src/remix/remix-wizard.ts +1 -1
- package/src/remix/sdk-setup.ts +0 -5
- package/src/sourcemaps/tools/nextjs.ts +0 -3
- package/src/sveltekit/sveltekit-wizard.ts +1 -1
- package/test/nextjs/templates.test.ts +0 -12
- package/test/remix/server-instrumentation.test.ts +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.42.1
|
|
4
|
+
|
|
5
|
+
- fix(nextjs): Remove outdated `hideSourceMaps` option (#798)
|
|
6
|
+
|
|
7
|
+
## 3.42.0
|
|
8
|
+
|
|
9
|
+
- feat: Update `nextjs`, `remix`, `sveltekit` and `nuxt` wizards to install v9 ([#794](https://github.com/getsentry/sentry-wizard/pull/794))
|
|
10
|
+
|
|
3
11
|
## 3.41.0
|
|
4
12
|
|
|
5
13
|
- feat: Add `forceInstall` option to NPM-based wizards ([#791](https://github.com/getsentry/sentry-wizard/pull/791))
|
|
@@ -158,7 +158,7 @@ function checkRemixProject(projectDir, integration, options) {
|
|
|
158
158
|
test('instrumentation.server file contains Sentry initialization', function () {
|
|
159
159
|
(0, utils_1.checkFileContents)("".concat(projectDir, "/instrumentation.server.mjs"), [
|
|
160
160
|
'import * as Sentry from "@sentry/remix";',
|
|
161
|
-
"Sentry.init({\n dsn: \"".concat(utils_1.TEST_ARGS.PROJECT_DSN, "\",\n tracesSampleRate: 1
|
|
161
|
+
"Sentry.init({\n dsn: \"".concat(utils_1.TEST_ARGS.PROJECT_DSN, "\",\n tracesSampleRate: 1\n})"),
|
|
162
162
|
]);
|
|
163
163
|
});
|
|
164
164
|
test('root file contains Sentry ErrorBoundary', function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remix.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/remix.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,iDAAkD;AAClD,kCAekB;AAClB,yCAA6B;AAE7B,IAAM,eAAe,GAAG,gjCAyCvB,CAAC;AAEF,SAAe,uBAAuB,CACpC,UAAkB,EAClB,WAAwB,EACxB,kBAGY;;;;;;oBAEN,cAAc,GAAG,IAAA,2BAAmB,EAAC,WAAW,EAAE,UAAU,CAAC,CAAC;oBAChE,sBAAsB,GAAG,KAAK,CAAC;yB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,UAAU,GAAG,IAAI,CAAC,OAAO,CAC7B,SAAS,EACT,qCAAqC,CACtC,CAAC;QAEF,SAAS,CAAC;;;4BACR,qBAAM,uBAAuB,CAAC,UAAU,EAAE,WAAW,EAAE,UAAC,UAAU;4BAChE,IAAA,kBAAU,EAAC,UAAG,UAAU,gBAAa,EAAE,eAAe,CAAC,CAAC;4BAExD,IAAA,kBAAU,EAAC,UAAG,UAAU,kBAAe,EAAE;gCACvC,gDAAgD,EAC9C,8BAA8B;gCAChC,yBAAyB,EAAE,4BAA4B;6BACxD,CAAC,CAAC;wBACL,CAAC,CAAC,EAAA;;wBARF,SAQE,CAAC;;;;aACJ,CAAC,CAAC;QAEH,QAAQ,CAAC;YACP,IAAA,0BAAkB,EAAC,UAAU,CAAC,CAAC;YAC/B,IAAA,kBAAU,EAAC,UAAU,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,iBAAiB,CAAC,UAAU,EAAE,WAAW,EAAE;YACzC,qBAAqB,EAAE,0BAA0B;YACjD,sBAAsB,EAAE,0BAA0B;SACnD,CAAC,CAAC;QAEH,IAAI,CAAC,iDAAiD,EAAE;YACtD,IAAA,yBAAiB,EAAC,UAAG,UAAU,gBAAa,EAAE;gBAC5C,wCAAwC;aACzC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable jest/expect-expect */\nimport { Integration } from '../../lib/Constants';\nimport {\n checkEnvBuildPlugin,\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n cleanupGit,\n createFile,\n KEYS,\n modifyFile,\n revertLocalChanges,\n startWizardInstance,\n TEST_ARGS,\n} from '../utils';\nimport * as path from 'path';\n\nconst SERVER_TEMPLATE = `import { createRequestHandler } from '@remix-run/express';\nimport { installGlobals } from '@remix-run/node';\nimport compression from 'compression';\nimport express from 'express';\nimport morgan from 'morgan';\n\ninstallGlobals();\n\nconst viteDevServer =\n process.env.NODE_ENV === 'production'\n ? undefined\n : await import('vite').then(vite =>\n vite.createServer({\n server: { middlewareMode: true },\n }),\n );\n\nconst app = express();\n\napp.use(compression());\napp.disable('x-powered-by');\n\nif (viteDevServer) {\n app.use(viteDevServer.middlewares);\n} else {\n app.use('/assets', express.static('build/client/assets', { immutable: true, maxAge: '1y' }));\n}\n\napp.use(express.static('build/client', { maxAge: '1h' }));\napp.use(morgan('tiny'));\n\napp.all(\n '*',\n createRequestHandler({\n build: viteDevServer\n ? () => viteDevServer.ssrLoadModule('virtual:remix/server-build')\n : await import('./build/server/index.js'),\n }),\n);\n\napp.listen(0, () => console.log('Express server listening'));\n`;\n\nasync function runWizardOnRemixProject(\n projectDir: string,\n integration: Integration,\n fileModificationFn?: (\n projectDir: string,\n integration: Integration,\n ) => unknown,\n) {\n const wizardInstance = startWizardInstance(integration, projectDir);\n let packageManagerPrompted = false;\n\n if (fileModificationFn) {\n fileModificationFn(projectDir, integration);\n\n await wizardInstance.waitForOutput('Do you want to continue anyway?');\n\n packageManagerPrompted = await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Please select your package manager.',\n );\n } else {\n packageManagerPrompted = await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n );\n }\n\n const tracingOptionPrompted =\n packageManagerPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, KEYS.ENTER],\n // \"Do you want to enable Tracing\", sometimes doesn't work as `Tracing` can be printed in bold.\n 'to track the performance of your application?',\n {\n timeout: 240_000,\n },\n ));\n\n const replayOptionPrompted =\n tracingOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Sentry Session Replay\", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.\n 'to get a video-like reproduction of errors during a user session?',\n ));\n\n replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Do you want to create an example page',\n {\n optional: true,\n },\n ));\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER, KEYS.ENTER],\n 'Sentry has been successfully configured for your Remix project',\n );\n\n wizardInstance.kill();\n}\n\nfunction checkRemixProject(\n projectDir: string,\n integration: Integration,\n options?: {\n devModeExpectedOutput?: string;\n prodModeExpectedOutput?: string;\n },\n) {\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, integration);\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/app/routes/sentry-example-page.tsx`);\n });\n\n test('instrumentation.server file exists', () => {\n checkFileExists(`${projectDir}/instrumentation.server.mjs`);\n });\n\n test('entry.client file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/app/entry.client.tsx`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `Sentry.init({\n dsn: \"${TEST_ARGS.PROJECT_DSN}\",\n tracesSampleRate: 1,\n\n integrations: [Sentry.browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n }), Sentry.replayIntegration({\n maskAllText: true,\n blockAllMedia: true\n })],\n\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1\n})`,\n ]);\n });\n\n test('entry.server file contains Sentry code', () => {\n checkFileContents(`${projectDir}/app/entry.server.tsx`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `export const handleError = Sentry.wrapHandleErrorWithSentry((error, { request }) => {\n // Custom handleError implementation\n});`,\n ]);\n });\n\n test('instrumentation.server file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/instrumentation.server.mjs`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `Sentry.init({\n dsn: \"${TEST_ARGS.PROJECT_DSN}\",\n tracesSampleRate: 1,\n autoInstrumentRemix: true\n})`,\n ]);\n });\n\n test('root file contains Sentry ErrorBoundary', () => {\n checkFileContents(`${projectDir}/app/root.tsx`, [\n 'import { captureRemixErrorBoundaryError } from \"@sentry/remix\";',\n `export const ErrorBoundary = () => {\n const error = useRouteError();\n captureRemixErrorBoundaryError(error);\n return <div>Something went wrong</div>;\n};`,\n ]);\n });\n\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(\n projectDir,\n options?.devModeExpectedOutput || 'to expose',\n );\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(\n projectDir,\n options?.prodModeExpectedOutput || '[remix-serve]',\n );\n });\n}\n\ndescribe('Remix', () => {\n describe('with empty project', () => {\n const integration = Integration.remix;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/remix-test-app',\n );\n\n beforeAll(async () => {\n await runWizardOnRemixProject(projectDir, integration);\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n checkRemixProject(projectDir, integration);\n });\n\n describe('with existing custom Express server', () => {\n const integration = Integration.remix;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/remix-test-app',\n );\n\n beforeAll(async () => {\n await runWizardOnRemixProject(projectDir, integration, (projectDir) => {\n createFile(`${projectDir}/server.mjs`, SERVER_TEMPLATE);\n\n modifyFile(`${projectDir}/package.json`, {\n '\"start\": \"remix-serve ./build/server/index.js\"':\n '\"start\": \"node ./server.mjs\"',\n '\"dev\": \"remix vite:dev\"': '\"dev\": \"node ./server.mjs\"',\n });\n });\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n checkRemixProject(projectDir, integration, {\n devModeExpectedOutput: 'Express server listening',\n prodModeExpectedOutput: 'Express server listening',\n });\n\n test('server.mjs contains instrumentation file import', () => {\n checkFileContents(`${projectDir}/server.mjs`, [\n \"import './instrumentation.server.mjs';\",\n ]);\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"remix.test.js","sourceRoot":"","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C,CAAC,CAAC","sourcesContent":["/* eslint-disable jest/expect-expect */\nimport { Integration } from '../../lib/Constants';\nimport {\n checkEnvBuildPlugin,\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n cleanupGit,\n createFile,\n KEYS,\n modifyFile,\n revertLocalChanges,\n startWizardInstance,\n TEST_ARGS,\n} from '../utils';\nimport * as path from 'path';\n\nconst SERVER_TEMPLATE = `import { createRequestHandler } from '@remix-run/express';\nimport { installGlobals } from '@remix-run/node';\nimport compression from 'compression';\nimport express from 'express';\nimport morgan from 'morgan';\n\ninstallGlobals();\n\nconst viteDevServer =\n process.env.NODE_ENV === 'production'\n ? undefined\n : await import('vite').then(vite =>\n vite.createServer({\n server: { middlewareMode: true },\n }),\n );\n\nconst app = express();\n\napp.use(compression());\napp.disable('x-powered-by');\n\nif (viteDevServer) {\n app.use(viteDevServer.middlewares);\n} else {\n app.use('/assets', express.static('build/client/assets', { immutable: true, maxAge: '1y' }));\n}\n\napp.use(express.static('build/client', { maxAge: '1h' }));\napp.use(morgan('tiny'));\n\napp.all(\n '*',\n createRequestHandler({\n build: viteDevServer\n ? () => viteDevServer.ssrLoadModule('virtual:remix/server-build')\n : await import('./build/server/index.js'),\n }),\n);\n\napp.listen(0, () => console.log('Express server listening'));\n`;\n\nasync function runWizardOnRemixProject(\n projectDir: string,\n integration: Integration,\n fileModificationFn?: (\n projectDir: string,\n integration: Integration,\n ) => unknown,\n) {\n const wizardInstance = startWizardInstance(integration, projectDir);\n let packageManagerPrompted = false;\n\n if (fileModificationFn) {\n fileModificationFn(projectDir, integration);\n\n await wizardInstance.waitForOutput('Do you want to continue anyway?');\n\n packageManagerPrompted = await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Please select your package manager.',\n );\n } else {\n packageManagerPrompted = await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n );\n }\n\n const tracingOptionPrompted =\n packageManagerPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, KEYS.ENTER],\n // \"Do you want to enable Tracing\", sometimes doesn't work as `Tracing` can be printed in bold.\n 'to track the performance of your application?',\n {\n timeout: 240_000,\n },\n ));\n\n const replayOptionPrompted =\n tracingOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Sentry Session Replay\", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.\n 'to get a video-like reproduction of errors during a user session?',\n ));\n\n replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Do you want to create an example page',\n {\n optional: true,\n },\n ));\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER, KEYS.ENTER],\n 'Sentry has been successfully configured for your Remix project',\n );\n\n wizardInstance.kill();\n}\n\nfunction checkRemixProject(\n projectDir: string,\n integration: Integration,\n options?: {\n devModeExpectedOutput?: string;\n prodModeExpectedOutput?: string;\n },\n) {\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, integration);\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/app/routes/sentry-example-page.tsx`);\n });\n\n test('instrumentation.server file exists', () => {\n checkFileExists(`${projectDir}/instrumentation.server.mjs`);\n });\n\n test('entry.client file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/app/entry.client.tsx`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `Sentry.init({\n dsn: \"${TEST_ARGS.PROJECT_DSN}\",\n tracesSampleRate: 1,\n\n integrations: [Sentry.browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n }), Sentry.replayIntegration({\n maskAllText: true,\n blockAllMedia: true\n })],\n\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1\n})`,\n ]);\n });\n\n test('entry.server file contains Sentry code', () => {\n checkFileContents(`${projectDir}/app/entry.server.tsx`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `export const handleError = Sentry.wrapHandleErrorWithSentry((error, { request }) => {\n // Custom handleError implementation\n});`,\n ]);\n });\n\n test('instrumentation.server file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/instrumentation.server.mjs`, [\n 'import * as Sentry from \"@sentry/remix\";',\n `Sentry.init({\n dsn: \"${TEST_ARGS.PROJECT_DSN}\",\n tracesSampleRate: 1\n})`,\n ]);\n });\n\n test('root file contains Sentry ErrorBoundary', () => {\n checkFileContents(`${projectDir}/app/root.tsx`, [\n 'import { captureRemixErrorBoundaryError } from \"@sentry/remix\";',\n `export const ErrorBoundary = () => {\n const error = useRouteError();\n captureRemixErrorBoundaryError(error);\n return <div>Something went wrong</div>;\n};`,\n ]);\n });\n\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(\n projectDir,\n options?.devModeExpectedOutput || 'to expose',\n );\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(\n projectDir,\n options?.prodModeExpectedOutput || '[remix-serve]',\n );\n });\n}\n\ndescribe('Remix', () => {\n describe('with empty project', () => {\n const integration = Integration.remix;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/remix-test-app',\n );\n\n beforeAll(async () => {\n await runWizardOnRemixProject(projectDir, integration);\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n checkRemixProject(projectDir, integration);\n });\n\n describe('with existing custom Express server', () => {\n const integration = Integration.remix;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/remix-test-app',\n );\n\n beforeAll(async () => {\n await runWizardOnRemixProject(projectDir, integration, (projectDir) => {\n createFile(`${projectDir}/server.mjs`, SERVER_TEMPLATE);\n\n modifyFile(`${projectDir}/package.json`, {\n '\"start\": \"remix-serve ./build/server/index.js\"':\n '\"start\": \"node ./server.mjs\"',\n '\"dev\": \"remix vite:dev\"': '\"dev\": \"node ./server.mjs\"',\n });\n });\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n checkRemixProject(projectDir, integration, {\n devModeExpectedOutput: 'Express server listening',\n prodModeExpectedOutput: 'Express server listening',\n });\n\n test('server.mjs contains instrumentation file import', () => {\n checkFileContents(`${projectDir}/server.mjs`, [\n \"import './instrumentation.server.mjs';\",\n ]);\n });\n });\n});\n"]}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/wizard",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.42.1",
|
|
4
4
|
"homepage": "https://github.com/getsentry/sentry-wizard",
|
|
5
5
|
"repository": "https://github.com/getsentry/sentry-wizard",
|
|
6
6
|
"description": "Sentry wizard helping you to configure your project",
|
|
@@ -127,7 +127,7 @@ function runNextjsWizardWithTelemetry(options) {
|
|
|
127
127
|
sdkAlreadyInstalled = (0, package_json_1.hasPackageInstalled)('@sentry/nextjs', packageJson);
|
|
128
128
|
Sentry.setTag('sdk-already-installed', sdkAlreadyInstalled);
|
|
129
129
|
return [4 /*yield*/, (0, clack_utils_1.installPackage)({
|
|
130
|
-
packageName: '@sentry/nextjs@^
|
|
130
|
+
packageName: '@sentry/nextjs@^9',
|
|
131
131
|
packageNameDisplayLabel: '@sentry/nextjs',
|
|
132
132
|
alreadyInstalled: !!((_a = packageJson === null || packageJson === void 0 ? void 0 : packageJson.dependencies) === null || _a === void 0 ? void 0 : _a['@sentry/nextjs']),
|
|
133
133
|
forceInstall: forceInstall,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextjs-wizard.js","sourceRoot":"","sources":["../../../src/nextjs/nextjs-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAC7C,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,EACxC,MAAM,CACP,EAAA;;oBAHD,kBAAkB,GAAG,SAGpB,CAAC;;;;oBAEF,sBAAO,IAAI,EAAC;wBAGd,sBAAO,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAC;;;;CAC/C","sourcesContent":["/* eslint-disable max-lines */\n// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport * as fs from 'fs';\n// @ts-ignore - magicast is ESM and TS complains about that. It works though\nimport { builders, generateCode, parseModule } from 'magicast';\nimport * as path from 'path';\n\nimport * as Sentry from '@sentry/node';\n\nimport {\n abort,\n abortIfCancelled,\n addDotEnvSentryBuildPluginFile,\n askShouldCreateExamplePage,\n confirmContinueIfNoOrDirtyGitRepo,\n createNewConfigFile,\n ensurePackageIsInstalled,\n featureSelectionPrompt,\n getOrAskForProjectData,\n getPackageDotJson,\n getPackageManager,\n installPackage,\n isUsingTypeScript,\n printWelcome,\n runPrettierIfInstalled,\n showCopyPasteInstructions,\n} from '../utils/clack-utils';\nimport type { SentryProjectData, WizardOptions } from '../utils/types';\nimport {\n getFullUnderscoreErrorCopyPasteSnippet,\n getGlobalErrorCopyPasteSnippet,\n getInstrumentationHookContent,\n getInstrumentationHookCopyPasteSnippet,\n getNextjsConfigCjsAppendix,\n getNextjsConfigCjsTemplate,\n getNextjsConfigEsmCopyPasteSnippet,\n getSentryConfigContents,\n getSentryDefaultGlobalErrorPage,\n getSentryDefaultUnderscoreErrorPage,\n getSentryExamplePagesDirApiRoute,\n getSentryExampleAppDirApiRoute,\n getSentryExamplePageContents,\n getSimpleUnderscoreErrorCopyPasteSnippet,\n getWithSentryConfigOptionsTemplate,\n getNextjsConfigMjsTemplate,\n} from './templates';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport { getPackageVersion, hasPackageInstalled } from '../utils/package-json';\nimport { getNextJsVersionBucket } from './utils';\nimport { configureCI } from '../sourcemaps/sourcemaps-wizard';\n\nexport function runNextjsWizard(options: WizardOptions) {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'nextjs',\n wizardOptions: options,\n },\n () => runNextjsWizardWithTelemetry(options),\n );\n}\n\nexport async function runNextjsWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n const { promoCode, telemetryEnabled, forceInstall } = options;\n\n printWelcome({\n wizardName: 'Sentry Next.js Wizard',\n promoCode,\n telemetryEnabled,\n });\n\n const typeScriptDetected = isUsingTypeScript();\n\n await confirmContinueIfNoOrDirtyGitRepo();\n\n const packageJson = await getPackageDotJson();\n\n await ensurePackageIsInstalled(packageJson, 'next', 'Next.js');\n\n const nextVersion = getPackageVersion('next', packageJson);\n Sentry.setTag('nextjs-version', getNextJsVersionBucket(nextVersion));\n\n const { selectedProject, authToken, selfHosted, sentryUrl } =\n await getOrAskForProjectData(options, 'javascript-nextjs');\n\n const sdkAlreadyInstalled = hasPackageInstalled(\n '@sentry/nextjs',\n packageJson,\n );\n Sentry.setTag('sdk-already-installed', sdkAlreadyInstalled);\n\n const { packageManager: packageManagerFromInstallStep } =\n await installPackage({\n packageName: '@sentry/nextjs@^8',\n packageNameDisplayLabel: '@sentry/nextjs',\n alreadyInstalled: !!packageJson?.dependencies?.['@sentry/nextjs'],\n forceInstall,\n });\n\n await traceStep('configure-sdk', async () => {\n const tunnelRoute = await askShouldSetTunnelRoute();\n const reactComponentAnnotation =\n await askShouldEnableReactComponentAnnotation();\n\n await createOrMergeNextJsFiles(selectedProject, selfHosted, sentryUrl, {\n tunnelRoute,\n reactComponentAnnotation,\n });\n });\n\n await traceStep('create-underscoreerror-page', async () => {\n const srcDir = path.join(process.cwd(), 'src');\n const maybePagesDirPath = path.join(process.cwd(), 'pages');\n const maybeSrcPagesDirPath = path.join(srcDir, 'pages');\n\n const pagesLocation =\n fs.existsSync(maybePagesDirPath) &&\n fs.lstatSync(maybePagesDirPath).isDirectory()\n ? ['pages']\n : fs.existsSync(maybeSrcPagesDirPath) &&\n fs.lstatSync(maybeSrcPagesDirPath).isDirectory()\n ? ['src', 'pages']\n : undefined;\n\n if (!pagesLocation) {\n return;\n }\n\n const underscoreErrorPageFile = fs.existsSync(\n path.join(process.cwd(), ...pagesLocation, '_error.tsx'),\n )\n ? '_error.tsx'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.ts'))\n ? '_error.ts'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.jsx'))\n ? '_error.jsx'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.js'))\n ? '_error.js'\n : undefined;\n\n if (!underscoreErrorPageFile) {\n await fs.promises.writeFile(\n path.join(process.cwd(), ...pagesLocation, '_error.jsx'),\n getSentryDefaultUnderscoreErrorPage(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(path.join(...pagesLocation, '_error.jsx'))}.`,\n );\n } else if (\n fs\n .readFileSync(\n path.join(process.cwd(), ...pagesLocation, underscoreErrorPageFile),\n 'utf8',\n )\n .includes('getInitialProps')\n ) {\n clack.log.info(\n `It seems like you already have a custom error page.\\n\\nPlease put the following function call in the ${chalk.bold(\n 'getInitialProps',\n )}\\nmethod of your custom error page at ${chalk.bold(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )}:`,\n );\n\n // eslint-disable-next-line no-console\n console.log(getSimpleUnderscoreErrorCopyPasteSnippet());\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did you modify your ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n } else {\n clack.log.info(\n `It seems like you already have a custom error page.\\n\\nPlease add the following code to your custom error page\\nat ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )}:`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getFullUnderscoreErrorCopyPasteSnippet(\n underscoreErrorPageFile === '_error.ts' ||\n underscoreErrorPageFile === '_error.tsx',\n ),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did you add the code to your ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n });\n\n await traceStep('create-global-error-page', async () => {\n const maybeAppDirPath = path.join(process.cwd(), 'app');\n const maybeSrcAppDirPath = path.join(process.cwd(), 'src', 'app');\n\n const appDirLocation =\n fs.existsSync(maybeAppDirPath) &&\n fs.lstatSync(maybeAppDirPath).isDirectory()\n ? ['app']\n : fs.existsSync(maybeSrcAppDirPath) &&\n fs.lstatSync(maybeSrcAppDirPath).isDirectory()\n ? ['src', 'app']\n : undefined;\n\n if (!appDirLocation) {\n return;\n }\n\n const globalErrorPageFile = fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.tsx'),\n )\n ? 'global-error.tsx'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.ts'),\n )\n ? 'global-error.ts'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.jsx'),\n )\n ? 'global-error.jsx'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.js'),\n )\n ? 'global-error.js'\n : undefined;\n\n if (!globalErrorPageFile) {\n const newGlobalErrorFileName = `global-error.${\n typeScriptDetected ? 'tsx' : 'jsx'\n }`;\n\n await fs.promises.writeFile(\n path.join(process.cwd(), ...appDirLocation, newGlobalErrorFileName),\n getSentryDefaultGlobalErrorPage(typeScriptDetected),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...appDirLocation, newGlobalErrorFileName),\n )}.`,\n );\n } else {\n clack.log.info(\n `It seems like you already have a custom error page for your app directory.\\n\\nPlease add the following code to your custom error page\\nat ${chalk.cyan(\n path.join(...appDirLocation, globalErrorPageFile),\n )}:\\n`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getGlobalErrorCopyPasteSnippet(\n globalErrorPageFile === 'global-error.ts' ||\n globalErrorPageFile === 'global-error.tsx',\n ),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did you add the code to your ${chalk.cyan(\n path.join(...appDirLocation, globalErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n });\n\n const shouldCreateExamplePage = await askShouldCreateExamplePage();\n if (shouldCreateExamplePage) {\n await traceStep('create-example-page', async () =>\n createExamplePage(selfHosted, selectedProject, sentryUrl),\n );\n }\n\n await addDotEnvSentryBuildPluginFile(authToken);\n\n const isLikelyUsingTurbopack = await checkIfLikelyIsUsingTurbopack();\n if (isLikelyUsingTurbopack || isLikelyUsingTurbopack === null) {\n await abortIfCancelled(\n clack.select({\n message: `Warning: The Sentry SDK doesn't yet fully support Turbopack in dev mode. The SDK will not be loaded in the browser, and serverside instrumentation will be inaccurate or incomplete. Production builds will still fully work. ${chalk.bold(\n `To continue this setup, if you are using Turbopack, temporarily remove \\`--turbo\\` from your dev command until you have verified the SDK is working as expected.`,\n )}`,\n options: [\n {\n label: 'I understand.',\n hint: 'press enter',\n value: true,\n },\n ],\n initialValue: true,\n }),\n );\n }\n\n const mightBeUsingVercel = fs.existsSync(\n path.join(process.cwd(), 'vercel.json'),\n );\n\n if (mightBeUsingVercel) {\n clack.log.info(\n \"▲ It seems like you're using Vercel. We recommend using the Sentry Vercel integration to set up an auth token for Vercel deployments: https://vercel.com/integrations/sentry\",\n );\n } else {\n await traceStep('configure-ci', () => configureCI('nextjs', authToken));\n }\n\n const packageManagerForOutro =\n packageManagerFromInstallStep ?? (await getPackageManager());\n await runPrettierIfInstalled();\n\n clack.outro(`\n${chalk.green('Successfully installed the Sentry Next.js SDK!')} ${\n shouldCreateExamplePage\n ? `\\n\\nYou can validate your setup by (re)starting your dev environment (e.g. ${chalk.cyan(\n `${packageManagerForOutro.runScriptCommand} dev`,\n )}) and visiting ${chalk.cyan('\"/sentry-example-page\"')}`\n : ''\n }${\n shouldCreateExamplePage && isLikelyUsingTurbopack\n ? `\\nDon't forget to remove \\`--turbo\\` from your dev command until you have verified the SDK is working. You can safely add it back afterwards.`\n : ''\n }\n\n${chalk.dim(\n 'If you encounter any issues, let us know here: https://github.com/getsentry/sentry-javascript/issues',\n)}`);\n}\n\ntype SDKConfigOptions = {\n tunnelRoute: boolean;\n reactComponentAnnotation: boolean;\n};\n\nasync function createOrMergeNextJsFiles(\n selectedProject: SentryProjectData,\n selfHosted: boolean,\n sentryUrl: string,\n sdkConfigOptions: SDKConfigOptions,\n) {\n const selectedFeatures = await featureSelectionPrompt([\n {\n id: 'performance',\n prompt: `Do you want to enable ${chalk.bold(\n 'Tracing',\n )} to track the performance of your application?`,\n enabledHint: 'recommended',\n },\n {\n id: 'replay',\n prompt: `Do you want to enable ${chalk.bold(\n 'Sentry Session Replay',\n )} to get a video-like reproduction of errors during a user session?`,\n enabledHint: 'recommended, but increases bundle size',\n },\n ] as const);\n\n const typeScriptDetected = isUsingTypeScript();\n\n const configVariants = ['server', 'client', 'edge'] as const;\n\n for (const configVariant of configVariants) {\n await traceStep(`create-sentry-${configVariant}-config`, async () => {\n const jsConfig = `sentry.${configVariant}.config.js`;\n const tsConfig = `sentry.${configVariant}.config.ts`;\n\n const jsConfigExists = fs.existsSync(path.join(process.cwd(), jsConfig));\n const tsConfigExists = fs.existsSync(path.join(process.cwd(), tsConfig));\n\n let shouldWriteFile = true;\n\n if (jsConfigExists || tsConfigExists) {\n const existingConfigs = [];\n\n if (jsConfigExists) {\n existingConfigs.push(jsConfig);\n }\n\n if (tsConfigExists) {\n existingConfigs.push(tsConfig);\n }\n\n const overwriteExistingConfigs = await abortIfCancelled(\n clack.confirm({\n message: `Found existing Sentry ${configVariant} config (${existingConfigs.join(\n ', ',\n )}). Overwrite ${existingConfigs.length > 1 ? 'them' : 'it'}?`,\n }),\n );\n Sentry.setTag(\n `overwrite-${configVariant}-config`,\n overwriteExistingConfigs,\n );\n\n shouldWriteFile = overwriteExistingConfigs;\n\n if (overwriteExistingConfigs) {\n if (jsConfigExists) {\n fs.unlinkSync(path.join(process.cwd(), jsConfig));\n clack.log.warn(`Removed existing ${chalk.cyan(jsConfig)}.`);\n }\n if (tsConfigExists) {\n fs.unlinkSync(path.join(process.cwd(), tsConfig));\n clack.log.warn(`Removed existing ${chalk.cyan(tsConfig)}.`);\n }\n }\n }\n\n if (shouldWriteFile) {\n await fs.promises.writeFile(\n path.join(process.cwd(), typeScriptDetected ? tsConfig : jsConfig),\n getSentryConfigContents(\n selectedProject.keys[0].dsn.public,\n configVariant,\n selectedFeatures,\n ),\n { encoding: 'utf8', flag: 'w' },\n );\n clack.log.success(\n `Created fresh ${chalk.cyan(\n typeScriptDetected ? tsConfig : jsConfig,\n )}.`,\n );\n Sentry.setTag(`created-${configVariant}-config`, true);\n }\n });\n }\n\n await traceStep('setup-instrumentation-hook', async () => {\n const hasRootAppDirectory = hasDirectoryPathFromRoot('app');\n const hasRootPagesDirectory = hasDirectoryPathFromRoot('pages');\n const hasSrcDirectory = hasDirectoryPathFromRoot('src');\n\n let instrumentationHookLocation: 'src' | 'root' | 'does-not-exist';\n\n const instrumentationTsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation.ts'),\n );\n const instrumentationJsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation.js'),\n );\n const srcInstrumentationTsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation.ts'),\n );\n const srcInstrumentationJsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation.js'),\n );\n\n // https://nextjs.org/docs/app/building-your-application/configuring/src-directory\n // https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation\n // The logic for where Next.js picks up the instrumentation file is as follows:\n // - If there is either an `app` folder or a `pages` folder in the root directory of your Next.js app, Next.js looks\n // for an `instrumentation.ts` file in the root of the Next.js app.\n // - Otherwise, if there is neither an `app` folder or a `pages` folder in the rood directory of your Next.js app,\n // AND if there is an `src` folder, Next.js will look for the `instrumentation.ts` file in the `src` folder.\n if (hasRootPagesDirectory || hasRootAppDirectory) {\n if (instrumentationJsExists || instrumentationTsExists) {\n instrumentationHookLocation = 'root';\n } else {\n instrumentationHookLocation = 'does-not-exist';\n }\n } else {\n if (srcInstrumentationTsExists || srcInstrumentationJsExists) {\n instrumentationHookLocation = 'src';\n } else {\n instrumentationHookLocation = 'does-not-exist';\n }\n }\n\n const newInstrumentationFileName = `instrumentation.${\n typeScriptDetected ? 'ts' : 'js'\n }`;\n\n if (instrumentationHookLocation === 'does-not-exist') {\n let newInstrumentationHookLocation: 'root' | 'src';\n if (hasRootPagesDirectory || hasRootAppDirectory) {\n newInstrumentationHookLocation = 'root';\n } else if (hasSrcDirectory) {\n newInstrumentationHookLocation = 'src';\n } else {\n newInstrumentationHookLocation = 'root';\n }\n\n const newInstrumentationHookPath =\n newInstrumentationHookLocation === 'root'\n ? path.join(process.cwd(), newInstrumentationFileName)\n : path.join(process.cwd(), 'src', newInstrumentationFileName);\n\n const successfullyCreated = await createNewConfigFile(\n newInstrumentationHookPath,\n getInstrumentationHookContent(newInstrumentationHookLocation),\n );\n\n if (!successfullyCreated) {\n await showCopyPasteInstructions(\n newInstrumentationFileName,\n getInstrumentationHookCopyPasteSnippet(\n newInstrumentationHookLocation,\n ),\n );\n }\n } else {\n await showCopyPasteInstructions(\n srcInstrumentationTsExists || instrumentationTsExists\n ? 'instrumentation.ts'\n : srcInstrumentationJsExists || instrumentationJsExists\n ? 'instrumentation.js'\n : newInstrumentationFileName,\n getInstrumentationHookCopyPasteSnippet(instrumentationHookLocation),\n );\n }\n });\n\n await traceStep('setup-next-config', async () => {\n const withSentryConfigOptionsTemplate = getWithSentryConfigOptionsTemplate({\n orgSlug: selectedProject.organization.slug,\n projectSlug: selectedProject.slug,\n selfHosted,\n sentryUrl,\n tunnelRoute: sdkConfigOptions.tunnelRoute,\n reactComponentAnnotation: sdkConfigOptions.reactComponentAnnotation,\n });\n\n const nextConfigPossibleFilesMap = {\n js: 'next.config.js',\n mjs: 'next.config.mjs',\n cjs: 'next.config.cjs',\n ts: 'next.config.ts',\n mts: 'next.config.mts',\n cts: 'next.config.cts',\n };\n\n const foundNextConfigFile = Object.entries(nextConfigPossibleFilesMap).find(\n ([, fileName]) => fs.existsSync(path.join(process.cwd(), fileName)),\n );\n\n if (!foundNextConfigFile) {\n Sentry.setTag('next-config-strategy', 'create');\n\n // Try to figure out whether the user prefers ESM\n let isTypeModule = false;\n try {\n const packageJsonText = await fs.promises.readFile(\n path.join(process.cwd(), 'package.json'),\n 'utf8',\n );\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const packageJson = JSON.parse(packageJsonText);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (packageJson.type === 'module') {\n isTypeModule = true;\n }\n } catch {\n // noop\n }\n\n // We are creating `next.config.(m)js` files by default as they are supported by the most Next.js versions\n const configFilename = isTypeModule\n ? nextConfigPossibleFilesMap.mjs\n : nextConfigPossibleFilesMap.js;\n const configContent = isTypeModule\n ? getNextjsConfigMjsTemplate(withSentryConfigOptionsTemplate)\n : getNextjsConfigCjsTemplate(withSentryConfigOptionsTemplate);\n\n await fs.promises.writeFile(\n path.join(process.cwd(), configFilename),\n configContent,\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(configFilename)} with Sentry configuration.`,\n );\n\n return;\n }\n\n const [foundNextConfigFileType, foundNextConfigFileFilename] =\n foundNextConfigFile;\n\n if (foundNextConfigFileType === 'js' || foundNextConfigFileType === 'cjs') {\n Sentry.setTag('next-config-strategy', 'modify');\n\n const nextConfigCjsContent = fs.readFileSync(\n path.join(process.cwd(), foundNextConfigFileFilename),\n 'utf8',\n );\n\n const probablyIncludesSdk =\n nextConfigCjsContent.includes('@sentry/nextjs') &&\n nextConfigCjsContent.includes('withSentryConfig');\n\n let shouldInject = true;\n\n if (probablyIncludesSdk) {\n const injectAnyhow = await abortIfCancelled(\n clack.confirm({\n message: `${chalk.cyan(\n foundNextConfigFileFilename,\n )} already contains Sentry SDK configuration. Should the wizard modify it anyways?`,\n }),\n );\n\n shouldInject = injectAnyhow;\n }\n\n if (shouldInject) {\n await fs.promises.appendFile(\n path.join(process.cwd(), foundNextConfigFileFilename),\n getNextjsConfigCjsAppendix(withSentryConfigOptionsTemplate),\n 'utf8',\n );\n\n clack.log.success(\n `Added Sentry configuration to ${chalk.cyan(\n foundNextConfigFileFilename,\n )}. ${chalk.dim('(you probably want to clean this up a bit!)')}`,\n );\n }\n\n Sentry.setTag('next-config-mod-result', 'success');\n }\n\n if (\n foundNextConfigFileType === 'mjs' ||\n foundNextConfigFileType === 'mts' ||\n foundNextConfigFileType === 'cts' ||\n foundNextConfigFileType === 'ts'\n ) {\n const nextConfigMjsContent = fs.readFileSync(\n path.join(process.cwd(), foundNextConfigFileFilename),\n 'utf8',\n );\n\n const probablyIncludesSdk =\n nextConfigMjsContent.includes('@sentry/nextjs') &&\n nextConfigMjsContent.includes('withSentryConfig');\n\n let shouldInject = true;\n\n if (probablyIncludesSdk) {\n const injectAnyhow = await abortIfCancelled(\n clack.confirm({\n message: `${chalk.cyan(\n foundNextConfigFileFilename,\n )} already contains Sentry SDK configuration. Should the wizard modify it anyways?`,\n }),\n );\n\n shouldInject = injectAnyhow;\n }\n\n try {\n if (shouldInject) {\n const mod = parseModule(nextConfigMjsContent);\n mod.imports.$add({\n from: '@sentry/nextjs',\n imported: 'withSentryConfig',\n local: 'withSentryConfig',\n });\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access\n const expressionToWrap = generateCode(mod.exports.default.$ast).code;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n mod.exports.default = builders.raw(`withSentryConfig(\n ${expressionToWrap},\n ${withSentryConfigOptionsTemplate}\n)`);\n const newCode = mod.generate().code;\n\n await fs.promises.writeFile(\n path.join(process.cwd(), foundNextConfigFileFilename),\n newCode,\n {\n encoding: 'utf8',\n flag: 'w',\n },\n );\n clack.log.success(\n `Added Sentry configuration to ${chalk.cyan(\n foundNextConfigFileFilename,\n )}. ${chalk.dim('(you probably want to clean this up a bit!)')}`,\n );\n\n Sentry.setTag('next-config-mod-result', 'success');\n }\n } catch {\n Sentry.setTag('next-config-mod-result', 'fail');\n clack.log.warn(\n chalk.yellow(\n `Something went wrong writing to ${chalk.cyan(\n foundNextConfigFileFilename,\n )}.`,\n ),\n );\n clack.log.info(\n `Please put the following code snippet into ${chalk.cyan(\n foundNextConfigFileFilename,\n )}: ${chalk.dim('You probably have to clean it up a bit.')}\\n`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getNextjsConfigEsmCopyPasteSnippet(withSentryConfigOptionsTemplate),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Are you done putting the snippet above into ${chalk.cyan(\n foundNextConfigFileFilename,\n )}?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n }\n });\n}\n\nfunction hasDirectoryPathFromRoot(dirnameOrDirs: string | string[]): boolean {\n const dirPath = Array.isArray(dirnameOrDirs)\n ? path.join(process.cwd(), ...dirnameOrDirs)\n : path.join(process.cwd(), dirnameOrDirs);\n\n return fs.existsSync(dirPath) && fs.lstatSync(dirPath).isDirectory();\n}\n\nasync function createExamplePage(\n selfHosted: boolean,\n selectedProject: SentryProjectData,\n sentryUrl: string,\n): Promise<void> {\n const hasSrcDirectory = hasDirectoryPathFromRoot('src');\n const hasRootAppDirectory = hasDirectoryPathFromRoot('app');\n const hasRootPagesDirectory = hasDirectoryPathFromRoot('pages');\n const hasSrcAppDirectory = hasDirectoryPathFromRoot(['src', 'app']);\n const hasSrcPagesDirectory = hasDirectoryPathFromRoot(['src', 'pages']);\n\n Sentry.setTag('nextjs-app-dir', hasRootAppDirectory || hasSrcAppDirectory);\n\n const typeScriptDetected = isUsingTypeScript();\n\n // If `pages` or an `app` directory exists in the root, we'll put the example page there.\n // `app` directory takes priority over `pages` directory when they coexist, so we prioritize that.\n // https://nextjs.org/docs/app/building-your-application/routing#the-app-router\n\n const appFolderLocation = hasRootAppDirectory\n ? ['app']\n : hasSrcAppDirectory\n ? ['src', 'app']\n : undefined;\n\n let pagesFolderLocation = hasRootPagesDirectory\n ? ['pages']\n : hasSrcPagesDirectory\n ? ['src', 'pages']\n : undefined;\n\n // If the user has neither pages nor app directory we create a pages folder for them\n if (!appFolderLocation && !pagesFolderLocation) {\n const newPagesFolderLocation = hasSrcDirectory\n ? ['src', 'pages']\n : ['pages'];\n fs.mkdirSync(path.join(process.cwd(), ...newPagesFolderLocation), {\n recursive: true,\n });\n\n pagesFolderLocation = newPagesFolderLocation;\n }\n\n if (appFolderLocation) {\n const examplePageContents = getSentryExamplePageContents({\n selfHosted,\n orgSlug: selectedProject.organization.slug,\n projectId: selectedProject.id,\n sentryUrl,\n useClient: true,\n });\n\n fs.mkdirSync(\n path.join(process.cwd(), ...appFolderLocation, 'sentry-example-page'),\n {\n recursive: true,\n },\n );\n\n const newPageFileName = `page.${typeScriptDetected ? 'tsx' : 'jsx'}`;\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...appFolderLocation,\n 'sentry-example-page',\n newPageFileName,\n ),\n examplePageContents,\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...appFolderLocation, 'sentry-example-page', newPageFileName),\n )}.`,\n );\n\n fs.mkdirSync(\n path.join(\n process.cwd(),\n ...appFolderLocation,\n 'api',\n 'sentry-example-api',\n ),\n {\n recursive: true,\n },\n );\n\n const newRouteFileName = `route.${typeScriptDetected ? 'ts' : 'js'}`;\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...appFolderLocation,\n 'api',\n 'sentry-example-api',\n newRouteFileName,\n ),\n getSentryExampleAppDirApiRoute(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(\n ...appFolderLocation,\n 'api',\n 'sentry-example-api',\n newRouteFileName,\n ),\n )}.`,\n );\n } else if (pagesFolderLocation) {\n const examplePageContents = getSentryExamplePageContents({\n selfHosted,\n orgSlug: selectedProject.organization.slug,\n projectId: selectedProject.id,\n sentryUrl,\n useClient: false,\n });\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...pagesFolderLocation,\n 'sentry-example-page.jsx',\n ),\n examplePageContents,\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...pagesFolderLocation, 'sentry-example-page.js'),\n )}.`,\n );\n\n fs.mkdirSync(path.join(process.cwd(), ...pagesFolderLocation, 'api'), {\n recursive: true,\n });\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...pagesFolderLocation,\n 'api',\n 'sentry-example-api.js',\n ),\n getSentryExamplePagesDirApiRoute(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...pagesFolderLocation, 'api', 'sentry-example-api.js'),\n )}.`,\n );\n }\n}\n\n/**\n * Ask users if they want to set the tunnelRoute option.\n * We can't set this by default because it potentially increases hosting bills.\n * It's valuable enough to for users to justify asking the additional question.\n */\nasync function askShouldSetTunnelRoute() {\n return await traceStep('ask-tunnelRoute-option', async (span) => {\n const shouldSetTunnelRoute = await abortIfCancelled(\n clack.select({\n message:\n 'Do you want to route Sentry requests in the browser through your Next.js server to avoid ad blockers?',\n options: [\n {\n label: 'Yes',\n value: true,\n hint: 'Can increase your server load and hosting bill',\n },\n {\n label: 'No',\n value: false,\n hint: 'Browser errors and events might be blocked by ad blockers before being sent to Sentry',\n },\n ],\n initialValue: true,\n }),\n );\n\n if (!shouldSetTunnelRoute) {\n clack.log.info(\n \"Sounds good! We'll leave the option commented for later, just in case :)\",\n );\n }\n\n span?.setAttribute('tunnelRoute', shouldSetTunnelRoute);\n Sentry.setTag('tunnelRoute', shouldSetTunnelRoute);\n\n return shouldSetTunnelRoute;\n });\n}\n\nasync function askShouldEnableReactComponentAnnotation() {\n return await traceStep('ask-react-component-annotation-option', async () => {\n const shouldEnableReactComponentAnnotation = await abortIfCancelled(\n clack.select({\n message:\n 'Do you want to enable React component annotations to make breadcrumbs and session replays more readable?',\n options: [\n {\n label: 'Yes',\n value: true,\n hint: 'Annotates React component names - increases bundle size',\n },\n {\n label: 'No',\n value: false,\n hint: 'Continue without React component annotations',\n },\n ],\n initialValue: true,\n }),\n );\n\n return shouldEnableReactComponentAnnotation;\n });\n}\n\n/**\n * Returns true or false depending on whether we think the user is using Turbopack. May return null in case we aren't sure.\n */\nasync function checkIfLikelyIsUsingTurbopack(): Promise<boolean | null> {\n let packageJsonContent: string;\n try {\n packageJsonContent = await fs.promises.readFile(\n path.join(process.cwd(), 'package.json'),\n 'utf8',\n );\n } catch {\n return null;\n }\n\n return packageJsonContent.includes('--turbo');\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nextjs-wizard.js","sourceRoot":"","sources":["../../../src/nextjs/nextjs-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,yEAAyE;AACzE,2DAAmC;AACnC,gDAA0B;AAC1B,qCAAyB;AACzB,4EAA4E;AAC5E,qCAA+D;AAC/D,yCAA6B;AAE7B,mDAAuC;AAEvC,oDAiB8B;AAE9B,yCAiBqB;AACrB,0CAAwD;AACxD,sDAA+E;AAC/E,iCAAiD;AACjD,qEAA8D;AAE9D,SAAgB,eAAe,CAAC,OAAsB;IACpD,OAAO,IAAA,yBAAa,EAClB;QACE,OAA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complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport * as fs from 'fs';\n// @ts-ignore - magicast is ESM and TS complains about that. It works though\nimport { builders, generateCode, parseModule } from 'magicast';\nimport * as path from 'path';\n\nimport * as Sentry from '@sentry/node';\n\nimport {\n abort,\n abortIfCancelled,\n addDotEnvSentryBuildPluginFile,\n askShouldCreateExamplePage,\n confirmContinueIfNoOrDirtyGitRepo,\n createNewConfigFile,\n ensurePackageIsInstalled,\n featureSelectionPrompt,\n getOrAskForProjectData,\n getPackageDotJson,\n getPackageManager,\n installPackage,\n isUsingTypeScript,\n printWelcome,\n runPrettierIfInstalled,\n showCopyPasteInstructions,\n} from '../utils/clack-utils';\nimport type { SentryProjectData, WizardOptions } from '../utils/types';\nimport {\n getFullUnderscoreErrorCopyPasteSnippet,\n getGlobalErrorCopyPasteSnippet,\n getInstrumentationHookContent,\n getInstrumentationHookCopyPasteSnippet,\n getNextjsConfigCjsAppendix,\n getNextjsConfigCjsTemplate,\n getNextjsConfigEsmCopyPasteSnippet,\n getSentryConfigContents,\n getSentryDefaultGlobalErrorPage,\n getSentryDefaultUnderscoreErrorPage,\n getSentryExamplePagesDirApiRoute,\n getSentryExampleAppDirApiRoute,\n getSentryExamplePageContents,\n getSimpleUnderscoreErrorCopyPasteSnippet,\n getWithSentryConfigOptionsTemplate,\n getNextjsConfigMjsTemplate,\n} from './templates';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport { getPackageVersion, hasPackageInstalled } from '../utils/package-json';\nimport { getNextJsVersionBucket } from './utils';\nimport { configureCI } from '../sourcemaps/sourcemaps-wizard';\n\nexport function runNextjsWizard(options: WizardOptions) {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'nextjs',\n wizardOptions: options,\n },\n () => runNextjsWizardWithTelemetry(options),\n );\n}\n\nexport async function runNextjsWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n const { promoCode, telemetryEnabled, forceInstall } = options;\n\n printWelcome({\n wizardName: 'Sentry Next.js Wizard',\n promoCode,\n telemetryEnabled,\n });\n\n const typeScriptDetected = isUsingTypeScript();\n\n await confirmContinueIfNoOrDirtyGitRepo();\n\n const packageJson = await getPackageDotJson();\n\n await ensurePackageIsInstalled(packageJson, 'next', 'Next.js');\n\n const nextVersion = getPackageVersion('next', packageJson);\n Sentry.setTag('nextjs-version', getNextJsVersionBucket(nextVersion));\n\n const { selectedProject, authToken, selfHosted, sentryUrl } =\n await getOrAskForProjectData(options, 'javascript-nextjs');\n\n const sdkAlreadyInstalled = hasPackageInstalled(\n '@sentry/nextjs',\n packageJson,\n );\n Sentry.setTag('sdk-already-installed', sdkAlreadyInstalled);\n\n const { packageManager: packageManagerFromInstallStep } =\n await installPackage({\n packageName: '@sentry/nextjs@^9',\n packageNameDisplayLabel: '@sentry/nextjs',\n alreadyInstalled: !!packageJson?.dependencies?.['@sentry/nextjs'],\n forceInstall,\n });\n\n await traceStep('configure-sdk', async () => {\n const tunnelRoute = await askShouldSetTunnelRoute();\n const reactComponentAnnotation =\n await askShouldEnableReactComponentAnnotation();\n\n await createOrMergeNextJsFiles(selectedProject, selfHosted, sentryUrl, {\n tunnelRoute,\n reactComponentAnnotation,\n });\n });\n\n await traceStep('create-underscoreerror-page', async () => {\n const srcDir = path.join(process.cwd(), 'src');\n const maybePagesDirPath = path.join(process.cwd(), 'pages');\n const maybeSrcPagesDirPath = path.join(srcDir, 'pages');\n\n const pagesLocation =\n fs.existsSync(maybePagesDirPath) &&\n fs.lstatSync(maybePagesDirPath).isDirectory()\n ? ['pages']\n : fs.existsSync(maybeSrcPagesDirPath) &&\n fs.lstatSync(maybeSrcPagesDirPath).isDirectory()\n ? ['src', 'pages']\n : undefined;\n\n if (!pagesLocation) {\n return;\n }\n\n const underscoreErrorPageFile = fs.existsSync(\n path.join(process.cwd(), ...pagesLocation, '_error.tsx'),\n )\n ? '_error.tsx'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.ts'))\n ? '_error.ts'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.jsx'))\n ? '_error.jsx'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.js'))\n ? '_error.js'\n : undefined;\n\n if (!underscoreErrorPageFile) {\n await fs.promises.writeFile(\n path.join(process.cwd(), ...pagesLocation, '_error.jsx'),\n getSentryDefaultUnderscoreErrorPage(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(path.join(...pagesLocation, '_error.jsx'))}.`,\n );\n } else if (\n fs\n .readFileSync(\n path.join(process.cwd(), ...pagesLocation, underscoreErrorPageFile),\n 'utf8',\n )\n .includes('getInitialProps')\n ) {\n clack.log.info(\n `It seems like you already have a custom error page.\\n\\nPlease put the following function call in the ${chalk.bold(\n 'getInitialProps',\n )}\\nmethod of your custom error page at ${chalk.bold(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )}:`,\n );\n\n // eslint-disable-next-line no-console\n console.log(getSimpleUnderscoreErrorCopyPasteSnippet());\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did you modify your ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n } else {\n clack.log.info(\n `It seems like you already have a custom error page.\\n\\nPlease add the following code to your custom error page\\nat ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )}:`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getFullUnderscoreErrorCopyPasteSnippet(\n underscoreErrorPageFile === '_error.ts' ||\n underscoreErrorPageFile === '_error.tsx',\n ),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did you add the code to your ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n });\n\n await traceStep('create-global-error-page', async () => {\n const maybeAppDirPath = path.join(process.cwd(), 'app');\n const maybeSrcAppDirPath = path.join(process.cwd(), 'src', 'app');\n\n const appDirLocation =\n fs.existsSync(maybeAppDirPath) &&\n fs.lstatSync(maybeAppDirPath).isDirectory()\n ? ['app']\n : fs.existsSync(maybeSrcAppDirPath) &&\n fs.lstatSync(maybeSrcAppDirPath).isDirectory()\n ? ['src', 'app']\n : undefined;\n\n if (!appDirLocation) {\n return;\n }\n\n const globalErrorPageFile = fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.tsx'),\n )\n ? 'global-error.tsx'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.ts'),\n )\n ? 'global-error.ts'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.jsx'),\n )\n ? 'global-error.jsx'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.js'),\n )\n ? 'global-error.js'\n : undefined;\n\n if (!globalErrorPageFile) {\n const newGlobalErrorFileName = `global-error.${\n typeScriptDetected ? 'tsx' : 'jsx'\n }`;\n\n await fs.promises.writeFile(\n path.join(process.cwd(), ...appDirLocation, newGlobalErrorFileName),\n getSentryDefaultGlobalErrorPage(typeScriptDetected),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...appDirLocation, newGlobalErrorFileName),\n )}.`,\n );\n } else {\n clack.log.info(\n `It seems like you already have a custom error page for your app directory.\\n\\nPlease add the following code to your custom error page\\nat ${chalk.cyan(\n path.join(...appDirLocation, globalErrorPageFile),\n )}:\\n`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getGlobalErrorCopyPasteSnippet(\n globalErrorPageFile === 'global-error.ts' ||\n globalErrorPageFile === 'global-error.tsx',\n ),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did you add the code to your ${chalk.cyan(\n path.join(...appDirLocation, globalErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n });\n\n const shouldCreateExamplePage = await askShouldCreateExamplePage();\n if (shouldCreateExamplePage) {\n await traceStep('create-example-page', async () =>\n createExamplePage(selfHosted, selectedProject, sentryUrl),\n );\n }\n\n await addDotEnvSentryBuildPluginFile(authToken);\n\n const isLikelyUsingTurbopack = await checkIfLikelyIsUsingTurbopack();\n if (isLikelyUsingTurbopack || isLikelyUsingTurbopack === null) {\n await abortIfCancelled(\n clack.select({\n message: `Warning: The Sentry SDK doesn't yet fully support Turbopack in dev mode. The SDK will not be loaded in the browser, and serverside instrumentation will be inaccurate or incomplete. Production builds will still fully work. ${chalk.bold(\n `To continue this setup, if you are using Turbopack, temporarily remove \\`--turbo\\` from your dev command until you have verified the SDK is working as expected.`,\n )}`,\n options: [\n {\n label: 'I understand.',\n hint: 'press enter',\n value: true,\n },\n ],\n initialValue: true,\n }),\n );\n }\n\n const mightBeUsingVercel = fs.existsSync(\n path.join(process.cwd(), 'vercel.json'),\n );\n\n if (mightBeUsingVercel) {\n clack.log.info(\n \"▲ It seems like you're using Vercel. We recommend using the Sentry Vercel integration to set up an auth token for Vercel deployments: https://vercel.com/integrations/sentry\",\n );\n } else {\n await traceStep('configure-ci', () => configureCI('nextjs', authToken));\n }\n\n const packageManagerForOutro =\n packageManagerFromInstallStep ?? (await getPackageManager());\n await runPrettierIfInstalled();\n\n clack.outro(`\n${chalk.green('Successfully installed the Sentry Next.js SDK!')} ${\n shouldCreateExamplePage\n ? `\\n\\nYou can validate your setup by (re)starting your dev environment (e.g. ${chalk.cyan(\n `${packageManagerForOutro.runScriptCommand} dev`,\n )}) and visiting ${chalk.cyan('\"/sentry-example-page\"')}`\n : ''\n }${\n shouldCreateExamplePage && isLikelyUsingTurbopack\n ? `\\nDon't forget to remove \\`--turbo\\` from your dev command until you have verified the SDK is working. You can safely add it back afterwards.`\n : ''\n }\n\n${chalk.dim(\n 'If you encounter any issues, let us know here: https://github.com/getsentry/sentry-javascript/issues',\n)}`);\n}\n\ntype SDKConfigOptions = {\n tunnelRoute: boolean;\n reactComponentAnnotation: boolean;\n};\n\nasync function createOrMergeNextJsFiles(\n selectedProject: SentryProjectData,\n selfHosted: boolean,\n sentryUrl: string,\n sdkConfigOptions: SDKConfigOptions,\n) {\n const selectedFeatures = await featureSelectionPrompt([\n {\n id: 'performance',\n prompt: `Do you want to enable ${chalk.bold(\n 'Tracing',\n )} to track the performance of your application?`,\n enabledHint: 'recommended',\n },\n {\n id: 'replay',\n prompt: `Do you want to enable ${chalk.bold(\n 'Sentry Session Replay',\n )} to get a video-like reproduction of errors during a user session?`,\n enabledHint: 'recommended, but increases bundle size',\n },\n ] as const);\n\n const typeScriptDetected = isUsingTypeScript();\n\n const configVariants = ['server', 'client', 'edge'] as const;\n\n for (const configVariant of configVariants) {\n await traceStep(`create-sentry-${configVariant}-config`, async () => {\n const jsConfig = `sentry.${configVariant}.config.js`;\n const tsConfig = `sentry.${configVariant}.config.ts`;\n\n const jsConfigExists = fs.existsSync(path.join(process.cwd(), jsConfig));\n const tsConfigExists = fs.existsSync(path.join(process.cwd(), tsConfig));\n\n let shouldWriteFile = true;\n\n if (jsConfigExists || tsConfigExists) {\n const existingConfigs = [];\n\n if (jsConfigExists) {\n existingConfigs.push(jsConfig);\n }\n\n if (tsConfigExists) {\n existingConfigs.push(tsConfig);\n }\n\n const overwriteExistingConfigs = await abortIfCancelled(\n clack.confirm({\n message: `Found existing Sentry ${configVariant} config (${existingConfigs.join(\n ', ',\n )}). Overwrite ${existingConfigs.length > 1 ? 'them' : 'it'}?`,\n }),\n );\n Sentry.setTag(\n `overwrite-${configVariant}-config`,\n overwriteExistingConfigs,\n );\n\n shouldWriteFile = overwriteExistingConfigs;\n\n if (overwriteExistingConfigs) {\n if (jsConfigExists) {\n fs.unlinkSync(path.join(process.cwd(), jsConfig));\n clack.log.warn(`Removed existing ${chalk.cyan(jsConfig)}.`);\n }\n if (tsConfigExists) {\n fs.unlinkSync(path.join(process.cwd(), tsConfig));\n clack.log.warn(`Removed existing ${chalk.cyan(tsConfig)}.`);\n }\n }\n }\n\n if (shouldWriteFile) {\n await fs.promises.writeFile(\n path.join(process.cwd(), typeScriptDetected ? tsConfig : jsConfig),\n getSentryConfigContents(\n selectedProject.keys[0].dsn.public,\n configVariant,\n selectedFeatures,\n ),\n { encoding: 'utf8', flag: 'w' },\n );\n clack.log.success(\n `Created fresh ${chalk.cyan(\n typeScriptDetected ? tsConfig : jsConfig,\n )}.`,\n );\n Sentry.setTag(`created-${configVariant}-config`, true);\n }\n });\n }\n\n await traceStep('setup-instrumentation-hook', async () => {\n const hasRootAppDirectory = hasDirectoryPathFromRoot('app');\n const hasRootPagesDirectory = hasDirectoryPathFromRoot('pages');\n const hasSrcDirectory = hasDirectoryPathFromRoot('src');\n\n let instrumentationHookLocation: 'src' | 'root' | 'does-not-exist';\n\n const instrumentationTsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation.ts'),\n );\n const instrumentationJsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation.js'),\n );\n const srcInstrumentationTsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation.ts'),\n );\n const srcInstrumentationJsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation.js'),\n );\n\n // https://nextjs.org/docs/app/building-your-application/configuring/src-directory\n // https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation\n // The logic for where Next.js picks up the instrumentation file is as follows:\n // - If there is either an `app` folder or a `pages` folder in the root directory of your Next.js app, Next.js looks\n // for an `instrumentation.ts` file in the root of the Next.js app.\n // - Otherwise, if there is neither an `app` folder or a `pages` folder in the rood directory of your Next.js app,\n // AND if there is an `src` folder, Next.js will look for the `instrumentation.ts` file in the `src` folder.\n if (hasRootPagesDirectory || hasRootAppDirectory) {\n if (instrumentationJsExists || instrumentationTsExists) {\n instrumentationHookLocation = 'root';\n } else {\n instrumentationHookLocation = 'does-not-exist';\n }\n } else {\n if (srcInstrumentationTsExists || srcInstrumentationJsExists) {\n instrumentationHookLocation = 'src';\n } else {\n instrumentationHookLocation = 'does-not-exist';\n }\n }\n\n const newInstrumentationFileName = `instrumentation.${\n typeScriptDetected ? 'ts' : 'js'\n }`;\n\n if (instrumentationHookLocation === 'does-not-exist') {\n let newInstrumentationHookLocation: 'root' | 'src';\n if (hasRootPagesDirectory || hasRootAppDirectory) {\n newInstrumentationHookLocation = 'root';\n } else if (hasSrcDirectory) {\n newInstrumentationHookLocation = 'src';\n } else {\n newInstrumentationHookLocation = 'root';\n }\n\n const newInstrumentationHookPath =\n newInstrumentationHookLocation === 'root'\n ? path.join(process.cwd(), newInstrumentationFileName)\n : path.join(process.cwd(), 'src', newInstrumentationFileName);\n\n const successfullyCreated = await createNewConfigFile(\n newInstrumentationHookPath,\n getInstrumentationHookContent(newInstrumentationHookLocation),\n );\n\n if (!successfullyCreated) {\n await showCopyPasteInstructions(\n newInstrumentationFileName,\n getInstrumentationHookCopyPasteSnippet(\n newInstrumentationHookLocation,\n ),\n );\n }\n } else {\n await showCopyPasteInstructions(\n srcInstrumentationTsExists || instrumentationTsExists\n ? 'instrumentation.ts'\n : srcInstrumentationJsExists || instrumentationJsExists\n ? 'instrumentation.js'\n : newInstrumentationFileName,\n getInstrumentationHookCopyPasteSnippet(instrumentationHookLocation),\n );\n }\n });\n\n await traceStep('setup-next-config', async () => {\n const withSentryConfigOptionsTemplate = getWithSentryConfigOptionsTemplate({\n orgSlug: selectedProject.organization.slug,\n projectSlug: selectedProject.slug,\n selfHosted,\n sentryUrl,\n tunnelRoute: sdkConfigOptions.tunnelRoute,\n reactComponentAnnotation: sdkConfigOptions.reactComponentAnnotation,\n });\n\n const nextConfigPossibleFilesMap = {\n js: 'next.config.js',\n mjs: 'next.config.mjs',\n cjs: 'next.config.cjs',\n ts: 'next.config.ts',\n mts: 'next.config.mts',\n cts: 'next.config.cts',\n };\n\n const foundNextConfigFile = Object.entries(nextConfigPossibleFilesMap).find(\n ([, fileName]) => fs.existsSync(path.join(process.cwd(), fileName)),\n );\n\n if (!foundNextConfigFile) {\n Sentry.setTag('next-config-strategy', 'create');\n\n // Try to figure out whether the user prefers ESM\n let isTypeModule = false;\n try {\n const packageJsonText = await fs.promises.readFile(\n path.join(process.cwd(), 'package.json'),\n 'utf8',\n );\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const packageJson = JSON.parse(packageJsonText);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (packageJson.type === 'module') {\n isTypeModule = true;\n }\n } catch {\n // noop\n }\n\n // We are creating `next.config.(m)js` files by default as they are supported by the most Next.js versions\n const configFilename = isTypeModule\n ? nextConfigPossibleFilesMap.mjs\n : nextConfigPossibleFilesMap.js;\n const configContent = isTypeModule\n ? getNextjsConfigMjsTemplate(withSentryConfigOptionsTemplate)\n : getNextjsConfigCjsTemplate(withSentryConfigOptionsTemplate);\n\n await fs.promises.writeFile(\n path.join(process.cwd(), configFilename),\n configContent,\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(configFilename)} with Sentry configuration.`,\n );\n\n return;\n }\n\n const [foundNextConfigFileType, foundNextConfigFileFilename] =\n foundNextConfigFile;\n\n if (foundNextConfigFileType === 'js' || foundNextConfigFileType === 'cjs') {\n Sentry.setTag('next-config-strategy', 'modify');\n\n const nextConfigCjsContent = fs.readFileSync(\n path.join(process.cwd(), foundNextConfigFileFilename),\n 'utf8',\n );\n\n const probablyIncludesSdk =\n nextConfigCjsContent.includes('@sentry/nextjs') &&\n nextConfigCjsContent.includes('withSentryConfig');\n\n let shouldInject = true;\n\n if (probablyIncludesSdk) {\n const injectAnyhow = await abortIfCancelled(\n clack.confirm({\n message: `${chalk.cyan(\n foundNextConfigFileFilename,\n )} already contains Sentry SDK configuration. Should the wizard modify it anyways?`,\n }),\n );\n\n shouldInject = injectAnyhow;\n }\n\n if (shouldInject) {\n await fs.promises.appendFile(\n path.join(process.cwd(), foundNextConfigFileFilename),\n getNextjsConfigCjsAppendix(withSentryConfigOptionsTemplate),\n 'utf8',\n );\n\n clack.log.success(\n `Added Sentry configuration to ${chalk.cyan(\n foundNextConfigFileFilename,\n )}. ${chalk.dim('(you probably want to clean this up a bit!)')}`,\n );\n }\n\n Sentry.setTag('next-config-mod-result', 'success');\n }\n\n if (\n foundNextConfigFileType === 'mjs' ||\n foundNextConfigFileType === 'mts' ||\n foundNextConfigFileType === 'cts' ||\n foundNextConfigFileType === 'ts'\n ) {\n const nextConfigMjsContent = fs.readFileSync(\n path.join(process.cwd(), foundNextConfigFileFilename),\n 'utf8',\n );\n\n const probablyIncludesSdk =\n nextConfigMjsContent.includes('@sentry/nextjs') &&\n nextConfigMjsContent.includes('withSentryConfig');\n\n let shouldInject = true;\n\n if (probablyIncludesSdk) {\n const injectAnyhow = await abortIfCancelled(\n clack.confirm({\n message: `${chalk.cyan(\n foundNextConfigFileFilename,\n )} already contains Sentry SDK configuration. Should the wizard modify it anyways?`,\n }),\n );\n\n shouldInject = injectAnyhow;\n }\n\n try {\n if (shouldInject) {\n const mod = parseModule(nextConfigMjsContent);\n mod.imports.$add({\n from: '@sentry/nextjs',\n imported: 'withSentryConfig',\n local: 'withSentryConfig',\n });\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access\n const expressionToWrap = generateCode(mod.exports.default.$ast).code;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n mod.exports.default = builders.raw(`withSentryConfig(\n ${expressionToWrap},\n ${withSentryConfigOptionsTemplate}\n)`);\n const newCode = mod.generate().code;\n\n await fs.promises.writeFile(\n path.join(process.cwd(), foundNextConfigFileFilename),\n newCode,\n {\n encoding: 'utf8',\n flag: 'w',\n },\n );\n clack.log.success(\n `Added Sentry configuration to ${chalk.cyan(\n foundNextConfigFileFilename,\n )}. ${chalk.dim('(you probably want to clean this up a bit!)')}`,\n );\n\n Sentry.setTag('next-config-mod-result', 'success');\n }\n } catch {\n Sentry.setTag('next-config-mod-result', 'fail');\n clack.log.warn(\n chalk.yellow(\n `Something went wrong writing to ${chalk.cyan(\n foundNextConfigFileFilename,\n )}.`,\n ),\n );\n clack.log.info(\n `Please put the following code snippet into ${chalk.cyan(\n foundNextConfigFileFilename,\n )}: ${chalk.dim('You probably have to clean it up a bit.')}\\n`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getNextjsConfigEsmCopyPasteSnippet(withSentryConfigOptionsTemplate),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Are you done putting the snippet above into ${chalk.cyan(\n foundNextConfigFileFilename,\n )}?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n }\n });\n}\n\nfunction hasDirectoryPathFromRoot(dirnameOrDirs: string | string[]): boolean {\n const dirPath = Array.isArray(dirnameOrDirs)\n ? path.join(process.cwd(), ...dirnameOrDirs)\n : path.join(process.cwd(), dirnameOrDirs);\n\n return fs.existsSync(dirPath) && fs.lstatSync(dirPath).isDirectory();\n}\n\nasync function createExamplePage(\n selfHosted: boolean,\n selectedProject: SentryProjectData,\n sentryUrl: string,\n): Promise<void> {\n const hasSrcDirectory = hasDirectoryPathFromRoot('src');\n const hasRootAppDirectory = hasDirectoryPathFromRoot('app');\n const hasRootPagesDirectory = hasDirectoryPathFromRoot('pages');\n const hasSrcAppDirectory = hasDirectoryPathFromRoot(['src', 'app']);\n const hasSrcPagesDirectory = hasDirectoryPathFromRoot(['src', 'pages']);\n\n Sentry.setTag('nextjs-app-dir', hasRootAppDirectory || hasSrcAppDirectory);\n\n const typeScriptDetected = isUsingTypeScript();\n\n // If `pages` or an `app` directory exists in the root, we'll put the example page there.\n // `app` directory takes priority over `pages` directory when they coexist, so we prioritize that.\n // https://nextjs.org/docs/app/building-your-application/routing#the-app-router\n\n const appFolderLocation = hasRootAppDirectory\n ? ['app']\n : hasSrcAppDirectory\n ? ['src', 'app']\n : undefined;\n\n let pagesFolderLocation = hasRootPagesDirectory\n ? ['pages']\n : hasSrcPagesDirectory\n ? ['src', 'pages']\n : undefined;\n\n // If the user has neither pages nor app directory we create a pages folder for them\n if (!appFolderLocation && !pagesFolderLocation) {\n const newPagesFolderLocation = hasSrcDirectory\n ? ['src', 'pages']\n : ['pages'];\n fs.mkdirSync(path.join(process.cwd(), ...newPagesFolderLocation), {\n recursive: true,\n });\n\n pagesFolderLocation = newPagesFolderLocation;\n }\n\n if (appFolderLocation) {\n const examplePageContents = getSentryExamplePageContents({\n selfHosted,\n orgSlug: selectedProject.organization.slug,\n projectId: selectedProject.id,\n sentryUrl,\n useClient: true,\n });\n\n fs.mkdirSync(\n path.join(process.cwd(), ...appFolderLocation, 'sentry-example-page'),\n {\n recursive: true,\n },\n );\n\n const newPageFileName = `page.${typeScriptDetected ? 'tsx' : 'jsx'}`;\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...appFolderLocation,\n 'sentry-example-page',\n newPageFileName,\n ),\n examplePageContents,\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...appFolderLocation, 'sentry-example-page', newPageFileName),\n )}.`,\n );\n\n fs.mkdirSync(\n path.join(\n process.cwd(),\n ...appFolderLocation,\n 'api',\n 'sentry-example-api',\n ),\n {\n recursive: true,\n },\n );\n\n const newRouteFileName = `route.${typeScriptDetected ? 'ts' : 'js'}`;\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...appFolderLocation,\n 'api',\n 'sentry-example-api',\n newRouteFileName,\n ),\n getSentryExampleAppDirApiRoute(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(\n ...appFolderLocation,\n 'api',\n 'sentry-example-api',\n newRouteFileName,\n ),\n )}.`,\n );\n } else if (pagesFolderLocation) {\n const examplePageContents = getSentryExamplePageContents({\n selfHosted,\n orgSlug: selectedProject.organization.slug,\n projectId: selectedProject.id,\n sentryUrl,\n useClient: false,\n });\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...pagesFolderLocation,\n 'sentry-example-page.jsx',\n ),\n examplePageContents,\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...pagesFolderLocation, 'sentry-example-page.js'),\n )}.`,\n );\n\n fs.mkdirSync(path.join(process.cwd(), ...pagesFolderLocation, 'api'), {\n recursive: true,\n });\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...pagesFolderLocation,\n 'api',\n 'sentry-example-api.js',\n ),\n getSentryExamplePagesDirApiRoute(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...pagesFolderLocation, 'api', 'sentry-example-api.js'),\n )}.`,\n );\n }\n}\n\n/**\n * Ask users if they want to set the tunnelRoute option.\n * We can't set this by default because it potentially increases hosting bills.\n * It's valuable enough to for users to justify asking the additional question.\n */\nasync function askShouldSetTunnelRoute() {\n return await traceStep('ask-tunnelRoute-option', async (span) => {\n const shouldSetTunnelRoute = await abortIfCancelled(\n clack.select({\n message:\n 'Do you want to route Sentry requests in the browser through your Next.js server to avoid ad blockers?',\n options: [\n {\n label: 'Yes',\n value: true,\n hint: 'Can increase your server load and hosting bill',\n },\n {\n label: 'No',\n value: false,\n hint: 'Browser errors and events might be blocked by ad blockers before being sent to Sentry',\n },\n ],\n initialValue: true,\n }),\n );\n\n if (!shouldSetTunnelRoute) {\n clack.log.info(\n \"Sounds good! We'll leave the option commented for later, just in case :)\",\n );\n }\n\n span?.setAttribute('tunnelRoute', shouldSetTunnelRoute);\n Sentry.setTag('tunnelRoute', shouldSetTunnelRoute);\n\n return shouldSetTunnelRoute;\n });\n}\n\nasync function askShouldEnableReactComponentAnnotation() {\n return await traceStep('ask-react-component-annotation-option', async () => {\n const shouldEnableReactComponentAnnotation = await abortIfCancelled(\n clack.select({\n message:\n 'Do you want to enable React component annotations to make breadcrumbs and session replays more readable?',\n options: [\n {\n label: 'Yes',\n value: true,\n hint: 'Annotates React component names - increases bundle size',\n },\n {\n label: 'No',\n value: false,\n hint: 'Continue without React component annotations',\n },\n ],\n initialValue: true,\n }),\n );\n\n return shouldEnableReactComponentAnnotation;\n });\n}\n\n/**\n * Returns true or false depending on whether we think the user is using Turbopack. May return null in case we aren't sure.\n */\nasync function checkIfLikelyIsUsingTurbopack(): Promise<boolean | null> {\n let packageJsonContent: string;\n try {\n packageJsonContent = await fs.promises.readFile(\n path.join(process.cwd(), 'package.json'),\n 'utf8',\n );\n } catch {\n return null;\n }\n\n return packageJsonContent.includes('--turbo');\n}\n"]}
|
|
@@ -10,7 +10,7 @@ function getWithSentryConfigOptionsTemplate(_a) {
|
|
|
10
10
|
var orgSlug = _a.orgSlug, projectSlug = _a.projectSlug, selfHosted = _a.selfHosted, tunnelRoute = _a.tunnelRoute, reactComponentAnnotation = _a.reactComponentAnnotation, sentryUrl = _a.sentryUrl;
|
|
11
11
|
return "{\n // For all available options, see:\n // https://github.com/getsentry/sentry-webpack-plugin#options\n\n org: \"".concat(orgSlug, "\",\n project: \"").concat(projectSlug, "\",").concat(selfHosted ? "\n sentryUrl: \"".concat(sentryUrl, "\",") : '', "\n\n // Only print logs for uploading source maps in CI\n silent: !process.env.CI,\n\n // For all available options, see:\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\n\n // Upload a larger set of source maps for prettier stack traces (increases build time)\n widenClientFileUpload: true,").concat(reactComponentAnnotation
|
|
12
12
|
? "\n\n // Automatically annotate React components to show their full name in breadcrumbs and session replay\n reactComponentAnnotation: {\n enabled: true,\n },"
|
|
13
|
-
: '', "\n\n // ").concat(tunnelRoute ? 'Route' : 'Uncomment to route', " browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n ").concat(tunnelRoute ? '' : '// ', "tunnelRoute: \"/monitoring\",\n\n //
|
|
13
|
+
: '', "\n\n // ").concat(tunnelRoute ? 'Route' : 'Uncomment to route', " browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n ").concat(tunnelRoute ? '' : '// ', "tunnelRoute: \"/monitoring\",\n\n // Automatically tree-shake Sentry logger statements to reduce bundle size\n disableLogger: true,\n\n // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)\n // See the following for more information:\n // https://docs.sentry.io/product/crons/\n // https://vercel.com/docs/cron-jobs\n automaticVercelMonitors: true,\n }");
|
|
14
14
|
}
|
|
15
15
|
exports.getWithSentryConfigOptionsTemplate = getWithSentryConfigOptionsTemplate;
|
|
16
16
|
function getNextjsConfigCjsTemplate(withSentryConfigOptionsTemplate) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/nextjs/templates.ts"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAC1B,oDAAuD;AAWvD,SAAgB,kCAAkC,CAAC,EAOzB;QANxB,OAAO,aAAA,EACP,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,wBAAwB,8BAAA,EACxB,SAAS,eAAA;IAET,OAAO,qIAIG,OAAO,iCACH,WAAW,gBACvB,UAAU,CAAC,CAAC,CAAC,6BAAqB,SAAS,QAAI,CAAC,CAAC,CAAC,EAAE,+VAWlD,wBAAwB;QACtB,CAAC,CAAC,6KAIH;QACC,CAAC,CAAC,EAAE,wBAIN,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,qUAK5C,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,6gBAa1B,CAAC;AACL,CAAC;AAtDD,gFAsDC;AAED,SAAgB,0BAA0B,C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K,CAAC,KAAK,CAAC,wEAED,CAAC,kIAUf,CAAC;KACC;SAAM;QACL,OAAO,6BAET,eAAK,CAAC,KAAK,CAAC,2CAA2C,CAAC,eACxD,eAAK,CAAC,KAAK,CAAC,iCAAiC,CAAC,eAC9C,eAAK,CAAC,KAAK,CAAC,oCAAoC,CAAC,qDAEb,eAAK,CAAC,KAAK,CAAC,WAAW,CAAC,oBAC1D,eAAK,CAAC,KAAK,CAAC,wEAED,CAAC,kIAUf,CAAC;KACC;AACH,CAAC;AA9CD,wEA8CC","sourcesContent":["import chalk from 'chalk';\nimport { makeCodeSnippet } from '../utils/clack-utils';\n\ntype WithSentryConfigOptions = {\n orgSlug: string;\n projectSlug: string;\n selfHosted: boolean;\n sentryUrl: string;\n tunnelRoute: boolean;\n reactComponentAnnotation: boolean;\n};\n\nexport function getWithSentryConfigOptionsTemplate({\n orgSlug,\n projectSlug,\n selfHosted,\n tunnelRoute,\n reactComponentAnnotation,\n sentryUrl,\n}: WithSentryConfigOptions): string {\n return `{\n // For all available options, see:\n // https://github.com/getsentry/sentry-webpack-plugin#options\n\n org: \"${orgSlug}\",\n project: \"${projectSlug}\",${\n selfHosted ? `\\n sentryUrl: \"${sentryUrl}\",` : ''\n }\n\n // Only print logs for uploading source maps in CI\n silent: !process.env.CI,\n\n // For all available options, see:\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\n\n // Upload a larger set of source maps for prettier stack traces (increases build time)\n widenClientFileUpload: true,${\n reactComponentAnnotation\n ? `\\n\n // Automatically annotate React components to show their full name in breadcrumbs and session replay\n reactComponentAnnotation: {\n enabled: true,\n },`\n : ''\n }\n\n // ${\n tunnelRoute ? 'Route' : 'Uncomment to route'\n } browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n ${tunnelRoute ? '' : '// '}tunnelRoute: \"/monitoring\",\n\n // Hides source maps from generated client bundles\n hideSourceMaps: true,\n\n // Automatically tree-shake Sentry logger statements to reduce bundle size\n disableLogger: true,\n\n // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)\n // See the following for more information:\n // https://docs.sentry.io/product/crons/\n // https://vercel.com/docs/cron-jobs\n automaticVercelMonitors: true,\n }`;\n}\n\nexport function getNextjsConfigCjsTemplate(\n withSentryConfigOptionsTemplate: string,\n): string {\n return `const { withSentryConfig } = require(\"@sentry/nextjs\");\n\n/** @type {import('next').NextConfig} */\nconst nextConfig = {};\n\nmodule.exports = withSentryConfig(\n nextConfig,\n ${withSentryConfigOptionsTemplate}\n);\n`;\n}\n\nexport function getNextjsConfigMjsTemplate(\n withSentryConfigOptionsTemplate: string,\n): string {\n return `import { withSentryConfig } from \"@sentry/nextjs\";\n\n/** @type {import('next').NextConfig} */\nconst nextConfig = {};\n\nexport default withSentryConfig(\n nextConfig,\n ${withSentryConfigOptionsTemplate}\n);\n`;\n}\n\nexport function getNextjsConfigCjsAppendix(\n withSentryConfigOptionsTemplate: string,\n): string {\n return `\n\n// Injected content via Sentry wizard below\n\nconst { withSentryConfig } = require(\"@sentry/nextjs\");\n\nmodule.exports = withSentryConfig(\n module.exports,\n ${withSentryConfigOptionsTemplate}\n);\n`;\n}\n\nexport function getNextjsConfigEsmCopyPasteSnippet(\n withSentryConfigOptionsTemplate: string,\n): string {\n return `\n\n// next.config.mjs\nimport { withSentryConfig } from \"@sentry/nextjs\";\n\nexport default withSentryConfig(\n yourNextConfig,\n ${withSentryConfigOptionsTemplate}\n);\n`;\n}\n\nfunction getClientIntegrationsSnippet(features: { replay: boolean }) {\n if (features.replay) {\n return `\n\n // Add optional integrations for additional features\n integrations: [\n Sentry.replayIntegration(),\n ],`;\n }\n\n return '';\n}\n\nexport function getSentryConfigContents(\n dsn: string,\n config: 'server' | 'client' | 'edge',\n selectedFeaturesMap: {\n replay: boolean;\n performance: boolean;\n },\n): string {\n let primer;\n if (config === 'server') {\n primer = `// This file configures the initialization of Sentry on the server.\n// The config you add here will be used whenever the server handles a request.\n// https://docs.sentry.io/platforms/javascript/guides/nextjs/`;\n } else if (config === 'client') {\n primer = `// This file configures the initialization of Sentry on the client.\n// The config you add here will be used whenever a users loads a page in their browser.\n// https://docs.sentry.io/platforms/javascript/guides/nextjs/`;\n } else if (config === 'edge') {\n primer = `// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).\n// The config you add here will be used whenever one of the edge features is loaded.\n// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.\n// https://docs.sentry.io/platforms/javascript/guides/nextjs/`;\n }\n\n const integrationsOptions = getClientIntegrationsSnippet({\n replay: config === 'client' && selectedFeaturesMap.replay,\n });\n\n let replayOptions = '';\n if (config === 'client') {\n if (selectedFeaturesMap.replay) {\n replayOptions += `\n\n // Define how likely Replay events are sampled.\n // This sets the sample rate to be 10%. You may want this to be 100% while\n // in development and sample at a lower rate in production\n replaysSessionSampleRate: 0.1,\n\n // Define how likely Replay events are sampled when an error occurs.\n replaysOnErrorSampleRate: 1.0,`;\n }\n }\n\n let performanceOptions = '';\n if (selectedFeaturesMap.performance) {\n performanceOptions += `\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,`;\n }\n\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return `${primer}\n\nimport * as Sentry from \"@sentry/nextjs\";\n\nSentry.init({\n dsn: \"${dsn}\",${integrationsOptions}${performanceOptions}${replayOptions}\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n});\n`;\n}\n\nexport function getSentryExamplePageContents(options: {\n selfHosted: boolean;\n sentryUrl: string;\n orgSlug: string;\n projectId: string;\n useClient: boolean;\n}): string {\n const issuesPageLink = options.selfHosted\n ? `${options.sentryUrl}organizations/${options.orgSlug}/issues/?project=${options.projectId}`\n : `https://${options.orgSlug}.sentry.io/issues/?project=${options.projectId}`;\n\n return `${\n options.useClient ? '\"use client\";\\n\\n' : ''\n }import Head from \"next/head\";\nimport * as Sentry from \"@sentry/nextjs\";\n\nexport default function Page() {\n return (\n <div>\n <Head>\n <title>Sentry Onboarding</title>\n <meta name=\"description\" content=\"Test Sentry for your Next.js app!\" />\n </Head>\n\n <main\n style={{\n minHeight: \"100vh\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"center\",\n }}\n >\n <h1 style={{ fontSize: \"4rem\", margin: \"14px 0\" }}>\n <svg\n style={{\n height: \"1em\",\n }}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 200 44\"\n >\n <path\n fill=\"currentColor\"\n d=\"M124.32,28.28,109.56,9.22h-3.68V34.77h3.73V15.19l15.18,19.58h3.26V9.22h-3.73ZM87.15,23.54h13.23V20.22H87.14V12.53h14.93V9.21H83.34V34.77h18.92V31.45H87.14ZM71.59,20.3h0C66.44,19.06,65,18.08,65,15.7c0-2.14,1.89-3.59,4.71-3.59a12.06,12.06,0,0,1,7.07,2.55l2-2.83a14.1,14.1,0,0,0-9-3c-5.06,0-8.59,3-8.59,7.27,0,4.6,3,6.19,8.46,7.52C74.51,24.74,76,25.78,76,28.11s-2,3.77-5.09,3.77a12.34,12.34,0,0,1-8.3-3.26l-2.25,2.69a15.94,15.94,0,0,0,10.42,3.85c5.48,0,9-2.95,9-7.51C79.75,23.79,77.47,21.72,71.59,20.3ZM195.7,9.22l-7.69,12-7.64-12h-4.46L186,24.67V34.78h3.84V24.55L200,9.22Zm-64.63,3.46h8.37v22.1h3.84V12.68h8.37V9.22H131.08ZM169.41,24.8c3.86-1.07,6-3.77,6-7.63,0-4.91-3.59-8-9.38-8H154.67V34.76h3.8V25.58h6.45l6.48,9.2h4.44l-7-9.82Zm-10.95-2.5V12.6h7.17c3.74,0,5.88,1.77,5.88,4.84s-2.29,4.86-5.84,4.86Z M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z\"\n ></path>\n </svg>\n </h1>\n\n <p>Get started by sending us a sample error:</p>\n <button\n type=\"button\"\n style={{\n padding: \"12px\",\n cursor: \"pointer\",\n backgroundColor: \"#AD6CAA\",\n borderRadius: \"4px\",\n border: \"none\",\n color: \"white\",\n fontSize: \"14px\",\n margin: \"18px\",\n }}\n onClick={async () => {\n await Sentry.startSpan({\n name: 'Example Frontend Span',\n op: 'test'\n }, async () => {\n const res = await fetch(\"/api/sentry-example-api\");\n if (!res.ok) {\n throw new Error(\"Sentry Example Frontend Error\");\n }\n });\n }}\n >\n Throw error!\n </button>\n\n <p>\n Next, look for the error on the{\" \"}\n <a href=\"${issuesPageLink}\">Issues Page</a>.\n </p>\n <p style={{ marginTop: \"24px\" }}>\n For more information, see{\" \"}\n <a href=\"https://docs.sentry.io/platforms/javascript/guides/nextjs/\">\n https://docs.sentry.io/platforms/javascript/guides/nextjs/\n </a>\n </p>\n </main>\n </div>\n );\n}\n`;\n}\n\nexport function getSentryExamplePagesDirApiRoute() {\n return `// A faulty API route to test Sentry's error monitoring\nexport default function handler(_req, res) {\n throw new Error(\"Sentry Example API Route Error\");\n res.status(200).json({ name: \"John Doe\" });\n}\n`;\n}\n\nexport function getSentryExampleAppDirApiRoute() {\n return `import { NextResponse } from \"next/server\";\n\nexport const dynamic = \"force-dynamic\";\n\n// A faulty API route to test Sentry's error monitoring\nexport function GET() {\n throw new Error(\"Sentry Example API Route Error\");\n return NextResponse.json({ data: \"Testing Sentry Error...\" });\n}\n`;\n}\n\nexport function getSentryDefaultUnderscoreErrorPage() {\n return `import * as Sentry from \"@sentry/nextjs\";\nimport Error from \"next/error\";\n\nconst CustomErrorComponent = (props) => {\n return <Error statusCode={props.statusCode} />;\n};\n\nCustomErrorComponent.getInitialProps = async (contextData) => {\n // In case this is running in a serverless function, await this in order to give Sentry\n // time to send the error before the lambda exits\n await Sentry.captureUnderscoreErrorException(contextData);\n\n // This will contain the status code of the response\n return Error.getInitialProps(contextData);\n};\n\nexport default CustomErrorComponent;\n`;\n}\n\nexport function getSimpleUnderscoreErrorCopyPasteSnippet() {\n return `\n${chalk.green(`import * as Sentry from '@sentry/nextjs';`)}\n${chalk.green(`import Error from \"next/error\";`)}\n\n${chalk.dim(\n '// Replace \"YourCustomErrorComponent\" with your custom error component!',\n)}\nYourCustomErrorComponent.getInitialProps = async (${chalk.green(\n 'contextData',\n )}) => {\n ${chalk.green('await Sentry.captureUnderscoreErrorException(contextData);')}\n\n ${chalk.dim('// ...other getInitialProps code')}\n\n return Error.getInitialProps(contextData);\n};\n`;\n}\n\nexport function getFullUnderscoreErrorCopyPasteSnippet(isTs: boolean) {\n return `\nimport * as Sentry from '@sentry/nextjs';${\n isTs ? '\\nimport type { NextPageContext } from \"next\";' : ''\n }\nimport Error from \"next/error\";\n\n${chalk.dim(\n '// Replace \"YourCustomErrorComponent\" with your custom error component!',\n)}\nYourCustomErrorComponent.getInitialProps = async (contextData${\n isTs ? ': NextPageContext' : ''\n }) => {\n await Sentry.captureUnderscoreErrorException(contextData);\n\n return Error.getInitialProps(contextData);\n};\n`;\n}\n\nexport function getInstrumentationHookContent(\n instrumentationHookLocation: 'src' | 'root',\n) {\n return `import * as Sentry from '@sentry/nextjs';\n\nexport async function register() {\n if (process.env.NEXT_RUNTIME === 'nodejs') {\n await import('${\n instrumentationHookLocation === 'root' ? '.' : '..'\n }/sentry.server.config');\n }\n\n if (process.env.NEXT_RUNTIME === 'edge') {\n await import('${\n instrumentationHookLocation === 'root' ? '.' : '..'\n }/sentry.edge.config');\n }\n}\n\nexport const onRequestError = Sentry.captureRequestError;\n`;\n}\n\nexport function getInstrumentationHookCopyPasteSnippet(\n instrumentationHookLocation: 'src' | 'root',\n) {\n return makeCodeSnippet(true, (unchanged, plus) => {\n return unchanged(`${plus(\"import * as Sentry from '@sentry/nextjs';\")}\n\nexport ${plus('async')} function register() {\n ${plus(`if (process.env.NEXT_RUNTIME === 'nodejs') {\n await import('${\n instrumentationHookLocation === 'root' ? '.' : '..'\n }/sentry.server.config');\n }\n\n if (process.env.NEXT_RUNTIME === 'edge') {\n await import('${\n instrumentationHookLocation === 'root' ? '.' : '..'\n }/sentry.edge.config');\n }`)}\n}\n\n${plus('export const onRequestError = Sentry.captureRequestError;')}\n`);\n });\n}\n\nexport function getSentryDefaultGlobalErrorPage(isTs: boolean) {\n return isTs\n ? `\"use client\";\n\nimport * as Sentry from \"@sentry/nextjs\";\nimport NextError from \"next/error\";\nimport { useEffect } from \"react\";\n\nexport default function GlobalError({ error }: { error: Error & { digest?: string } }) {\n useEffect(() => {\n Sentry.captureException(error);\n }, [error]);\n\n return (\n <html>\n <body>\n {/* \\`NextError\\` is the default Next.js error page component. Its type\n definition requires a \\`statusCode\\` prop. However, since the App Router\n does not expose status codes for errors, we simply pass 0 to render a\n generic error message. */}\n <NextError statusCode={0} />\n </body>\n </html>\n );\n}`\n : `\"use client\";\n\nimport * as Sentry from \"@sentry/nextjs\";\nimport NextError from \"next/error\";\nimport { useEffect } from \"react\";\n\nexport default function GlobalError({ error }) {\n useEffect(() => {\n Sentry.captureException(error);\n }, [error]);\n\n return (\n <html>\n <body>\n {/* \\`NextError\\` is the default Next.js error page component. Its type\n definition requires a \\`statusCode\\` prop. However, since the App Router\n does not expose status codes for errors, we simply pass 0 to render a\n generic error message. */}\n <NextError statusCode={0} />\n </body>\n </html>\n );\n}\n`;\n}\n\nexport function getGlobalErrorCopyPasteSnippet(isTs: boolean) {\n if (isTs) {\n return `\"use client\";\n\n${chalk.green('import * as Sentry from \"@sentry/nextjs\";')}\n${chalk.green('import Error from \"next/error\";')}\n${chalk.green('import { useEffect } from \"react\";')}\n\nexport default function GlobalError(${chalk.green(\n '{ error }: { error: Error }',\n )}) {\n ${chalk.green(`useEffect(() => {\n Sentry.captureException(error);\n }, [error]);`)}\n\n return (\n <html>\n <body>\n {/* Your Error component here... */}\n </body>\n </html>\n );\n}\n`;\n } else {\n return `\"use client\";\n\n${chalk.green('import * as Sentry from \"@sentry/nextjs\";')}\n${chalk.green('import Error from \"next/error\";')}\n${chalk.green('import { useEffect } from \"react\";')}\n\nexport default function GlobalError(${chalk.green('{ error }')}) {\n ${chalk.green(`useEffect(() => {\n Sentry.captureException(error);\n }, [error]);`)}\n\n return (\n <html>\n <body>\n {/* Your Error component here... */}\n </body>\n </html>\n );\n}\n`;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/nextjs/templates.ts"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAC1B,oDAAuD;AAWvD,SAAgB,kCAAkC,CAAC,EAOzB;QANxB,OAAO,aAAA,EACP,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,wBAAwB,8BAAA,EACxB,SAAS,eAAA;IAET,OAAO,qIAIG,OAAO,iCACH,WAAW,gBACvB,UAAU,CAAC,CAAC,CAAC,6BAAqB,SAAS,QAAI,CAAC,CAAC,CAAC,EAAE,+VAWlD,wBAAwB;QACtB,CAAC,CAAC,6KAIH;QACC,CAAC,CAAC,EAAE,wBAIN,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,qUAK5C,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,wbAU1B,CAAC;AACL,CAAC;AAnDD,gFAmDC;AAED,SAAgB,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oBACD,eAAK,CAAC,KAAK,CAAC,wEAED,CAAC,kIAUf,CAAC;KACC;SAAM;QACL,OAAO,6BAET,eAAK,CAAC,KAAK,CAAC,2CAA2C,CAAC,eACxD,eAAK,CAAC,KAAK,CAAC,iCAAiC,CAAC,eAC9C,eAAK,CAAC,KAAK,CAAC,oCAAoC,CAAC,qDAEb,eAAK,CAAC,KAAK,CAAC,WAAW,CAAC,oBAC1D,eAAK,CAAC,KAAK,CAAC,wEAED,CAAC,kIAUf,CAAC;KACC;AACH,CAAC;AA9CD,wEA8CC","sourcesContent":["import chalk from 'chalk';\nimport { makeCodeSnippet } from '../utils/clack-utils';\n\ntype WithSentryConfigOptions = {\n orgSlug: string;\n projectSlug: string;\n selfHosted: boolean;\n sentryUrl: string;\n tunnelRoute: boolean;\n reactComponentAnnotation: boolean;\n};\n\nexport function getWithSentryConfigOptionsTemplate({\n orgSlug,\n projectSlug,\n selfHosted,\n tunnelRoute,\n reactComponentAnnotation,\n sentryUrl,\n}: WithSentryConfigOptions): string {\n return `{\n // For all available options, see:\n // https://github.com/getsentry/sentry-webpack-plugin#options\n\n org: \"${orgSlug}\",\n project: \"${projectSlug}\",${\n selfHosted ? `\\n sentryUrl: \"${sentryUrl}\",` : ''\n }\n\n // Only print logs for uploading source maps in CI\n silent: !process.env.CI,\n\n // For all available options, see:\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\n\n // Upload a larger set of source maps for prettier stack traces (increases build time)\n widenClientFileUpload: true,${\n reactComponentAnnotation\n ? `\\n\n // Automatically annotate React components to show their full name in breadcrumbs and session replay\n reactComponentAnnotation: {\n enabled: true,\n },`\n : ''\n }\n\n // ${\n tunnelRoute ? 'Route' : 'Uncomment to route'\n } browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n ${tunnelRoute ? '' : '// '}tunnelRoute: \"/monitoring\",\n\n // Automatically tree-shake Sentry logger statements to reduce bundle size\n disableLogger: true,\n\n // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)\n // See the following for more information:\n // https://docs.sentry.io/product/crons/\n // https://vercel.com/docs/cron-jobs\n automaticVercelMonitors: true,\n }`;\n}\n\nexport function getNextjsConfigCjsTemplate(\n withSentryConfigOptionsTemplate: string,\n): string {\n return `const { withSentryConfig } = require(\"@sentry/nextjs\");\n\n/** @type {import('next').NextConfig} */\nconst nextConfig = {};\n\nmodule.exports = withSentryConfig(\n nextConfig,\n ${withSentryConfigOptionsTemplate}\n);\n`;\n}\n\nexport function getNextjsConfigMjsTemplate(\n withSentryConfigOptionsTemplate: string,\n): string {\n return `import { withSentryConfig } from \"@sentry/nextjs\";\n\n/** @type {import('next').NextConfig} */\nconst nextConfig = {};\n\nexport default withSentryConfig(\n nextConfig,\n ${withSentryConfigOptionsTemplate}\n);\n`;\n}\n\nexport function getNextjsConfigCjsAppendix(\n withSentryConfigOptionsTemplate: string,\n): string {\n return `\n\n// Injected content via Sentry wizard below\n\nconst { withSentryConfig } = require(\"@sentry/nextjs\");\n\nmodule.exports = withSentryConfig(\n module.exports,\n ${withSentryConfigOptionsTemplate}\n);\n`;\n}\n\nexport function getNextjsConfigEsmCopyPasteSnippet(\n withSentryConfigOptionsTemplate: string,\n): string {\n return `\n\n// next.config.mjs\nimport { withSentryConfig } from \"@sentry/nextjs\";\n\nexport default withSentryConfig(\n yourNextConfig,\n ${withSentryConfigOptionsTemplate}\n);\n`;\n}\n\nfunction getClientIntegrationsSnippet(features: { replay: boolean }) {\n if (features.replay) {\n return `\n\n // Add optional integrations for additional features\n integrations: [\n Sentry.replayIntegration(),\n ],`;\n }\n\n return '';\n}\n\nexport function getSentryConfigContents(\n dsn: string,\n config: 'server' | 'client' | 'edge',\n selectedFeaturesMap: {\n replay: boolean;\n performance: boolean;\n },\n): string {\n let primer;\n if (config === 'server') {\n primer = `// This file configures the initialization of Sentry on the server.\n// The config you add here will be used whenever the server handles a request.\n// https://docs.sentry.io/platforms/javascript/guides/nextjs/`;\n } else if (config === 'client') {\n primer = `// This file configures the initialization of Sentry on the client.\n// The config you add here will be used whenever a users loads a page in their browser.\n// https://docs.sentry.io/platforms/javascript/guides/nextjs/`;\n } else if (config === 'edge') {\n primer = `// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).\n// The config you add here will be used whenever one of the edge features is loaded.\n// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.\n// https://docs.sentry.io/platforms/javascript/guides/nextjs/`;\n }\n\n const integrationsOptions = getClientIntegrationsSnippet({\n replay: config === 'client' && selectedFeaturesMap.replay,\n });\n\n let replayOptions = '';\n if (config === 'client') {\n if (selectedFeaturesMap.replay) {\n replayOptions += `\n\n // Define how likely Replay events are sampled.\n // This sets the sample rate to be 10%. You may want this to be 100% while\n // in development and sample at a lower rate in production\n replaysSessionSampleRate: 0.1,\n\n // Define how likely Replay events are sampled when an error occurs.\n replaysOnErrorSampleRate: 1.0,`;\n }\n }\n\n let performanceOptions = '';\n if (selectedFeaturesMap.performance) {\n performanceOptions += `\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,`;\n }\n\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return `${primer}\n\nimport * as Sentry from \"@sentry/nextjs\";\n\nSentry.init({\n dsn: \"${dsn}\",${integrationsOptions}${performanceOptions}${replayOptions}\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n});\n`;\n}\n\nexport function getSentryExamplePageContents(options: {\n selfHosted: boolean;\n sentryUrl: string;\n orgSlug: string;\n projectId: string;\n useClient: boolean;\n}): string {\n const issuesPageLink = options.selfHosted\n ? `${options.sentryUrl}organizations/${options.orgSlug}/issues/?project=${options.projectId}`\n : `https://${options.orgSlug}.sentry.io/issues/?project=${options.projectId}`;\n\n return `${\n options.useClient ? '\"use client\";\\n\\n' : ''\n }import Head from \"next/head\";\nimport * as Sentry from \"@sentry/nextjs\";\n\nexport default function Page() {\n return (\n <div>\n <Head>\n <title>Sentry Onboarding</title>\n <meta name=\"description\" content=\"Test Sentry for your Next.js app!\" />\n </Head>\n\n <main\n style={{\n minHeight: \"100vh\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"center\",\n }}\n >\n <h1 style={{ fontSize: \"4rem\", margin: \"14px 0\" }}>\n <svg\n style={{\n height: \"1em\",\n }}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 200 44\"\n >\n <path\n fill=\"currentColor\"\n d=\"M124.32,28.28,109.56,9.22h-3.68V34.77h3.73V15.19l15.18,19.58h3.26V9.22h-3.73ZM87.15,23.54h13.23V20.22H87.14V12.53h14.93V9.21H83.34V34.77h18.92V31.45H87.14ZM71.59,20.3h0C66.44,19.06,65,18.08,65,15.7c0-2.14,1.89-3.59,4.71-3.59a12.06,12.06,0,0,1,7.07,2.55l2-2.83a14.1,14.1,0,0,0-9-3c-5.06,0-8.59,3-8.59,7.27,0,4.6,3,6.19,8.46,7.52C74.51,24.74,76,25.78,76,28.11s-2,3.77-5.09,3.77a12.34,12.34,0,0,1-8.3-3.26l-2.25,2.69a15.94,15.94,0,0,0,10.42,3.85c5.48,0,9-2.95,9-7.51C79.75,23.79,77.47,21.72,71.59,20.3ZM195.7,9.22l-7.69,12-7.64-12h-4.46L186,24.67V34.78h3.84V24.55L200,9.22Zm-64.63,3.46h8.37v22.1h3.84V12.68h8.37V9.22H131.08ZM169.41,24.8c3.86-1.07,6-3.77,6-7.63,0-4.91-3.59-8-9.38-8H154.67V34.76h3.8V25.58h6.45l6.48,9.2h4.44l-7-9.82Zm-10.95-2.5V12.6h7.17c3.74,0,5.88,1.77,5.88,4.84s-2.29,4.86-5.84,4.86Z M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z\"\n ></path>\n </svg>\n </h1>\n\n <p>Get started by sending us a sample error:</p>\n <button\n type=\"button\"\n style={{\n padding: \"12px\",\n cursor: \"pointer\",\n backgroundColor: \"#AD6CAA\",\n borderRadius: \"4px\",\n border: \"none\",\n color: \"white\",\n fontSize: \"14px\",\n margin: \"18px\",\n }}\n onClick={async () => {\n await Sentry.startSpan({\n name: 'Example Frontend Span',\n op: 'test'\n }, async () => {\n const res = await fetch(\"/api/sentry-example-api\");\n if (!res.ok) {\n throw new Error(\"Sentry Example Frontend Error\");\n }\n });\n }}\n >\n Throw error!\n </button>\n\n <p>\n Next, look for the error on the{\" \"}\n <a href=\"${issuesPageLink}\">Issues Page</a>.\n </p>\n <p style={{ marginTop: \"24px\" }}>\n For more information, see{\" \"}\n <a href=\"https://docs.sentry.io/platforms/javascript/guides/nextjs/\">\n https://docs.sentry.io/platforms/javascript/guides/nextjs/\n </a>\n </p>\n </main>\n </div>\n );\n}\n`;\n}\n\nexport function getSentryExamplePagesDirApiRoute() {\n return `// A faulty API route to test Sentry's error monitoring\nexport default function handler(_req, res) {\n throw new Error(\"Sentry Example API Route Error\");\n res.status(200).json({ name: \"John Doe\" });\n}\n`;\n}\n\nexport function getSentryExampleAppDirApiRoute() {\n return `import { NextResponse } from \"next/server\";\n\nexport const dynamic = \"force-dynamic\";\n\n// A faulty API route to test Sentry's error monitoring\nexport function GET() {\n throw new Error(\"Sentry Example API Route Error\");\n return NextResponse.json({ data: \"Testing Sentry Error...\" });\n}\n`;\n}\n\nexport function getSentryDefaultUnderscoreErrorPage() {\n return `import * as Sentry from \"@sentry/nextjs\";\nimport Error from \"next/error\";\n\nconst CustomErrorComponent = (props) => {\n return <Error statusCode={props.statusCode} />;\n};\n\nCustomErrorComponent.getInitialProps = async (contextData) => {\n // In case this is running in a serverless function, await this in order to give Sentry\n // time to send the error before the lambda exits\n await Sentry.captureUnderscoreErrorException(contextData);\n\n // This will contain the status code of the response\n return Error.getInitialProps(contextData);\n};\n\nexport default CustomErrorComponent;\n`;\n}\n\nexport function getSimpleUnderscoreErrorCopyPasteSnippet() {\n return `\n${chalk.green(`import * as Sentry from '@sentry/nextjs';`)}\n${chalk.green(`import Error from \"next/error\";`)}\n\n${chalk.dim(\n '// Replace \"YourCustomErrorComponent\" with your custom error component!',\n)}\nYourCustomErrorComponent.getInitialProps = async (${chalk.green(\n 'contextData',\n )}) => {\n ${chalk.green('await Sentry.captureUnderscoreErrorException(contextData);')}\n\n ${chalk.dim('// ...other getInitialProps code')}\n\n return Error.getInitialProps(contextData);\n};\n`;\n}\n\nexport function getFullUnderscoreErrorCopyPasteSnippet(isTs: boolean) {\n return `\nimport * as Sentry from '@sentry/nextjs';${\n isTs ? '\\nimport type { NextPageContext } from \"next\";' : ''\n }\nimport Error from \"next/error\";\n\n${chalk.dim(\n '// Replace \"YourCustomErrorComponent\" with your custom error component!',\n)}\nYourCustomErrorComponent.getInitialProps = async (contextData${\n isTs ? ': NextPageContext' : ''\n }) => {\n await Sentry.captureUnderscoreErrorException(contextData);\n\n return Error.getInitialProps(contextData);\n};\n`;\n}\n\nexport function getInstrumentationHookContent(\n instrumentationHookLocation: 'src' | 'root',\n) {\n return `import * as Sentry from '@sentry/nextjs';\n\nexport async function register() {\n if (process.env.NEXT_RUNTIME === 'nodejs') {\n await import('${\n instrumentationHookLocation === 'root' ? '.' : '..'\n }/sentry.server.config');\n }\n\n if (process.env.NEXT_RUNTIME === 'edge') {\n await import('${\n instrumentationHookLocation === 'root' ? '.' : '..'\n }/sentry.edge.config');\n }\n}\n\nexport const onRequestError = Sentry.captureRequestError;\n`;\n}\n\nexport function getInstrumentationHookCopyPasteSnippet(\n instrumentationHookLocation: 'src' | 'root',\n) {\n return makeCodeSnippet(true, (unchanged, plus) => {\n return unchanged(`${plus(\"import * as Sentry from '@sentry/nextjs';\")}\n\nexport ${plus('async')} function register() {\n ${plus(`if (process.env.NEXT_RUNTIME === 'nodejs') {\n await import('${\n instrumentationHookLocation === 'root' ? '.' : '..'\n }/sentry.server.config');\n }\n\n if (process.env.NEXT_RUNTIME === 'edge') {\n await import('${\n instrumentationHookLocation === 'root' ? '.' : '..'\n }/sentry.edge.config');\n }`)}\n}\n\n${plus('export const onRequestError = Sentry.captureRequestError;')}\n`);\n });\n}\n\nexport function getSentryDefaultGlobalErrorPage(isTs: boolean) {\n return isTs\n ? `\"use client\";\n\nimport * as Sentry from \"@sentry/nextjs\";\nimport NextError from \"next/error\";\nimport { useEffect } from \"react\";\n\nexport default function GlobalError({ error }: { error: Error & { digest?: string } }) {\n useEffect(() => {\n Sentry.captureException(error);\n }, [error]);\n\n return (\n <html>\n <body>\n {/* \\`NextError\\` is the default Next.js error page component. Its type\n definition requires a \\`statusCode\\` prop. However, since the App Router\n does not expose status codes for errors, we simply pass 0 to render a\n generic error message. */}\n <NextError statusCode={0} />\n </body>\n </html>\n );\n}`\n : `\"use client\";\n\nimport * as Sentry from \"@sentry/nextjs\";\nimport NextError from \"next/error\";\nimport { useEffect } from \"react\";\n\nexport default function GlobalError({ error }) {\n useEffect(() => {\n Sentry.captureException(error);\n }, [error]);\n\n return (\n <html>\n <body>\n {/* \\`NextError\\` is the default Next.js error page component. Its type\n definition requires a \\`statusCode\\` prop. However, since the App Router\n does not expose status codes for errors, we simply pass 0 to render a\n generic error message. */}\n <NextError statusCode={0} />\n </body>\n </html>\n );\n}\n`;\n}\n\nexport function getGlobalErrorCopyPasteSnippet(isTs: boolean) {\n if (isTs) {\n return `\"use client\";\n\n${chalk.green('import * as Sentry from \"@sentry/nextjs\";')}\n${chalk.green('import Error from \"next/error\";')}\n${chalk.green('import { useEffect } from \"react\";')}\n\nexport default function GlobalError(${chalk.green(\n '{ error }: { error: Error }',\n )}) {\n ${chalk.green(`useEffect(() => {\n Sentry.captureException(error);\n }, [error]);`)}\n\n return (\n <html>\n <body>\n {/* Your Error component here... */}\n </body>\n </html>\n );\n}\n`;\n } else {\n return `\"use client\";\n\n${chalk.green('import * as Sentry from \"@sentry/nextjs\";')}\n${chalk.green('import Error from \"next/error\";')}\n${chalk.green('import { useEffect } from \"react\";')}\n\nexport default function GlobalError(${chalk.green('{ error }')}) {\n ${chalk.green(`useEffect(() => {\n Sentry.captureException(error);\n }, [error]);`)}\n\n return (\n <html>\n <body>\n {/* Your Error component here... */}\n </body>\n </html>\n );\n}\n`;\n }\n}\n"]}
|
|
@@ -139,7 +139,7 @@ function runNuxtWizardWithTelemetry(options) {
|
|
|
139
139
|
sdkAlreadyInstalled = (0, package_json_1.hasPackageInstalled)('@sentry/nuxt', packageJson);
|
|
140
140
|
Sentry.setTag('sdk-already-installed', sdkAlreadyInstalled);
|
|
141
141
|
return [4 /*yield*/, (0, clack_utils_1.installPackage)({
|
|
142
|
-
packageName: '@sentry/nuxt',
|
|
142
|
+
packageName: '@sentry/nuxt@^9',
|
|
143
143
|
alreadyInstalled: sdkAlreadyInstalled,
|
|
144
144
|
packageManager: packageManager,
|
|
145
145
|
forceInstall: forceInstall,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt-wizard.js","sourceRoot":"","sources":["../../../src/nuxt/nuxt-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAAyE;AACzE,oDAAwC;AACxC,mDAAuC;AACvC,gDAA0B;AAC1B,iCAAwC;A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iB,EAAC,IAAI,EAAE,WAAW,CAAC,EAAA;iCAAA,CACrC,EAAA;;oBAFD,SAEC,CAAC;;;yBAGwB,qBAAM,IAAA,6CAA+B,GAAE,EAAA;;oBAAnE,yBAAyB,GAAG,SAAuC,CAAC;yBAEhE,yBAAyB,EAAzB,yBAAyB;oBAC3B,qBAAM,IAAA,qBAAS,EAAC,0BAA0B,EAAE;4BAC1C,sBAAA,IAAA,oCAAsB,EAAC,IAAI,CAAC,EAAA;iCAAA,CAC7B,EAAA;;oBAFD,SAEC,CAAC;;yBAIN,qBAAM,IAAA,oCAAsB,GAAE,EAAA;;oBAA9B,SAA8B,CAAC;oBAE/B,qBAAM,IAAA,iCAAqB,EAAC,kBAAkB,CAAC,EAAA;;oBAA/C,SAA+C,CAAC;oBAEhD,KAAK,CAAC,KAAK,CACT,iBAAiB,CAAC,uBAAuB,EAAE,yBAAyB,CAAC,CACtE,CAAC;;;;;CACH;AAlHD,gEAkHC;AAED,SAAS,iBAAiB,CACxB,uBAAgC,EAChC,yBAAkC;IAElC,IAAI,GAAG,GAAG,eAAK,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;IAEvE,IAAI,uBAAuB,EAAE;QAC3B,GAAG,IAAI,sDAA+C,eAAK,CAAC,IAAI,CAC9D,wBAAwB,CACzB,MAAG,CAAC;KACN;IACD,IAAI,yBAAyB,EAAE;QAC7B,GAAG,IAAI,wDAAiD,eAAK,CAAC,IAAI,CAChE,uBAAuB,CACxB,4CAAyC,CAAC;KAC5C;IAED,GAAG,IAAI,yEAAkE,eAAK,CAAC,SAAS,CACtF,0DAA0D,CAC3D,CAAE,CAAC;IAEJ,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\nimport * as Sentry from '@sentry/node';\nimport chalk from 'chalk';\nimport { lt, minVersion } from 'semver';\nimport type { WizardOptions } from '../utils/types';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport {\n abort,\n abortIfCancelled,\n addDotEnvSentryBuildPluginFile,\n askShouldCreateExampleComponent,\n askShouldCreateExamplePage,\n confirmContinueIfNoOrDirtyGitRepo,\n ensurePackageIsInstalled,\n getOrAskForProjectData,\n getPackageDotJson,\n getPackageManager,\n installPackage,\n printWelcome,\n runPrettierIfInstalled,\n} from '../utils/clack-utils';\nimport { getPackageVersion, hasPackageInstalled } from '../utils/package-json';\nimport {\n addSDKModule,\n getNuxtConfig,\n createConfigFiles,\n addNuxtOverrides,\n askDeploymentPlatform,\n confirmReadImportDocs,\n} from './sdk-setup';\nimport {\n createExampleComponent,\n createExamplePage,\n supportsExamplePage,\n} from './sdk-example';\nimport { isNuxtV4 } from './utils';\n\nexport function runNuxtWizard(options: WizardOptions) {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'nuxt',\n wizardOptions: options,\n },\n () => runNuxtWizardWithTelemetry(options),\n );\n}\n\nexport async function runNuxtWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n const { promoCode, telemetryEnabled, forceInstall } = options;\n\n printWelcome({\n wizardName: 'Sentry Nuxt Wizard',\n promoCode,\n telemetryEnabled,\n });\n\n await confirmContinueIfNoOrDirtyGitRepo();\n\n const packageJson = await getPackageDotJson();\n\n await ensurePackageIsInstalled(packageJson, 'nuxt', 'Nuxt');\n\n const nuxtVersion = getPackageVersion('nuxt', packageJson);\n Sentry.setTag('nuxt-version', nuxtVersion);\n\n const minVer = minVersion(nuxtVersion || '0.0.0');\n\n if (!nuxtVersion || !minVer || lt(minVer, '3.7.0')) {\n clack.log.warn(\n \"It seems you're using a Nuxt version <3.7.0 which is not supported by Sentry.\\nWe recommend upgrading to the latest version before you continue.\",\n );\n const shouldContinue = await abortIfCancelled(\n clack.select({\n message: 'Do you want to continue anyway?',\n options: [\n {\n label: 'Yes, continue',\n hint: 'The SDK might not work correctly',\n value: true,\n },\n { label: \"No, I'll upgrade first\", value: false },\n ],\n }),\n );\n if (!shouldContinue) {\n await abort('Exiting Wizard', 0);\n return;\n }\n }\n\n const { authToken, selectedProject, selfHosted, sentryUrl } =\n await getOrAskForProjectData(options, 'javascript-nuxt');\n\n const packageManager = await getPackageManager();\n\n await addNuxtOverrides(packageJson, packageManager, minVer, forceInstall);\n\n const sdkAlreadyInstalled = hasPackageInstalled('@sentry/nuxt', packageJson);\n Sentry.setTag('sdk-already-installed', sdkAlreadyInstalled);\n\n await installPackage({\n packageName: '@sentry/nuxt@^9',\n alreadyInstalled: sdkAlreadyInstalled,\n packageManager,\n forceInstall,\n });\n\n await addDotEnvSentryBuildPluginFile(authToken);\n\n const nuxtConfig = await traceStep('load-nuxt-config', getNuxtConfig);\n\n const projectData = {\n org: selectedProject.organization.slug,\n project: selectedProject.slug,\n projectId: selectedProject.id,\n url: sentryUrl,\n selfHosted,\n };\n\n const deploymentPlatform = await askDeploymentPlatform();\n Sentry.setTag('deployment-platform', deploymentPlatform);\n\n await traceStep('configure-sdk', async () => {\n await addSDKModule(nuxtConfig, projectData, deploymentPlatform);\n await createConfigFiles(selectedProject.keys[0].dsn.public);\n });\n\n let shouldCreateExamplePage = false;\n let shouldCreateExampleButton = false;\n\n const isV4 = await isNuxtV4(nuxtConfig, nuxtVersion);\n const canCreateExamplePage = await supportsExamplePage(isV4);\n Sentry.setTag('supports-example-page-creation', canCreateExamplePage);\n\n if (canCreateExamplePage) {\n shouldCreateExamplePage = await askShouldCreateExamplePage();\n\n if (shouldCreateExamplePage) {\n await traceStep('create-example-page', async () =>\n createExamplePage(isV4, projectData),\n );\n }\n } else {\n shouldCreateExampleButton = await askShouldCreateExampleComponent();\n\n if (shouldCreateExampleButton) {\n await traceStep('create-example-component', async () =>\n createExampleComponent(isV4),\n );\n }\n }\n\n await runPrettierIfInstalled();\n\n await confirmReadImportDocs(deploymentPlatform);\n\n clack.outro(\n buildOutroMessage(shouldCreateExamplePage, shouldCreateExampleButton),\n );\n}\n\nfunction buildOutroMessage(\n shouldCreateExamplePage: boolean,\n shouldCreateExampleButton: boolean,\n): string {\n let msg = chalk.green('\\nSuccessfully installed the Sentry Nuxt SDK!');\n\n if (shouldCreateExamplePage) {\n msg += `\\n\\nYou can validate your setup by visiting ${chalk.cyan(\n '\"/sentry-example-page\"',\n )}.`;\n }\n if (shouldCreateExampleButton) {\n msg += `\\n\\nYou can validate your setup by adding the ${chalk.cyan(\n '`SentryExampleButton`',\n )} component to a page and triggering it.`;\n }\n\n msg += `\\n\\nCheck out the SDK documentation for further configuration: ${chalk.underline(\n 'https://docs.sentry.io/platforms/javascript/guides/nuxt/',\n )}`;\n\n return msg;\n}\n"]}
|
|
@@ -96,7 +96,7 @@ function runRemixWizardWithTelemetry(options) {
|
|
|
96
96
|
case 5:
|
|
97
97
|
_a = _b.sent(), selectedProject = _a.selectedProject, authToken = _a.authToken, sentryUrl = _a.sentryUrl, selfHosted = _a.selfHosted;
|
|
98
98
|
return [4 /*yield*/, (0, clack_utils_1.installPackage)({
|
|
99
|
-
packageName: '@sentry/remix@^
|
|
99
|
+
packageName: '@sentry/remix@^9',
|
|
100
100
|
packageNameDisplayLabel: '@sentry/remix',
|
|
101
101
|
alreadyInstalled: (0, package_json_1.hasPackageInstalled)('@sentry/remix', packageJson),
|
|
102
102
|
forceInstall: forceInstall,
|