@sentry/wizard 4.7.0 → 4.9.0

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.
Files changed (175) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +19 -19
  3. package/dist/e2e-tests/tests/angular-17.test.d.ts +1 -0
  4. package/dist/e2e-tests/tests/angular-17.test.js +196 -0
  5. package/dist/e2e-tests/tests/angular-17.test.js.map +1 -0
  6. package/dist/e2e-tests/tests/angular-19.test.d.ts +1 -0
  7. package/dist/e2e-tests/tests/angular-19.test.js +194 -0
  8. package/dist/e2e-tests/tests/angular-19.test.js.map +1 -0
  9. package/dist/e2e-tests/tests/expo.test.d.ts +1 -0
  10. package/dist/e2e-tests/tests/expo.test.js +103 -0
  11. package/dist/e2e-tests/tests/expo.test.js.map +1 -0
  12. package/dist/e2e-tests/tests/help-message.test.js +2 -2
  13. package/dist/e2e-tests/tests/help-message.test.js.map +1 -1
  14. package/dist/e2e-tests/tests/react-native.test.d.ts +1 -0
  15. package/dist/e2e-tests/tests/react-native.test.js +132 -0
  16. package/dist/e2e-tests/tests/react-native.test.js.map +1 -0
  17. package/dist/e2e-tests/tests/remix.test.js +4 -4
  18. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  19. package/dist/e2e-tests/tests/sveltekit.test.js +2 -2
  20. package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
  21. package/dist/e2e-tests/utils/index.d.ts +7 -0
  22. package/dist/e2e-tests/utils/index.js +32 -7
  23. package/dist/e2e-tests/utils/index.js.map +1 -1
  24. package/dist/lib/Constants.d.ts +1 -0
  25. package/dist/lib/Constants.js +3 -0
  26. package/dist/lib/Constants.js.map +1 -1
  27. package/dist/lib/Helper/SentryCli.d.ts +0 -11
  28. package/dist/lib/Helper/SentryCli.js +0 -52
  29. package/dist/lib/Helper/SentryCli.js.map +1 -1
  30. package/dist/src/android/templates.js +2 -0
  31. package/dist/src/android/templates.js.map +1 -1
  32. package/dist/src/angular/angular-wizard.d.ts +3 -0
  33. package/dist/src/angular/angular-wizard.js +186 -0
  34. package/dist/src/angular/angular-wizard.js.map +1 -0
  35. package/dist/src/angular/codemods/app-config.d.ts +3 -0
  36. package/dist/src/angular/codemods/app-config.js +211 -0
  37. package/dist/src/angular/codemods/app-config.js.map +1 -0
  38. package/dist/src/angular/codemods/main.d.ts +20 -0
  39. package/dist/src/angular/codemods/main.js +62 -0
  40. package/dist/src/angular/codemods/main.js.map +1 -0
  41. package/dist/src/angular/codemods/sourcemaps.d.ts +21 -0
  42. package/dist/src/angular/codemods/sourcemaps.js +94 -0
  43. package/dist/src/angular/codemods/sourcemaps.js.map +1 -0
  44. package/dist/src/angular/example-component.d.ts +8 -0
  45. package/dist/src/angular/example-component.js +286 -0
  46. package/dist/src/angular/example-component.js.map +1 -0
  47. package/dist/src/angular/sdk-setup.d.ts +6 -0
  48. package/dist/src/angular/sdk-setup.js +99 -0
  49. package/dist/src/angular/sdk-setup.js.map +1 -0
  50. package/dist/src/apple/code-tools.d.ts +4 -2
  51. package/dist/src/apple/code-tools.js +21 -11
  52. package/dist/src/apple/code-tools.js.map +1 -1
  53. package/dist/src/apple/inject-code-snippet.js +5 -3
  54. package/dist/src/apple/inject-code-snippet.js.map +1 -1
  55. package/dist/src/apple/macos-system-helper.d.ts +5 -0
  56. package/dist/src/apple/macos-system-helper.js +86 -0
  57. package/dist/src/apple/macos-system-helper.js.map +1 -0
  58. package/dist/src/apple/templates.js +10 -0
  59. package/dist/src/apple/templates.js.map +1 -1
  60. package/dist/src/apple/xcode-manager.d.ts +237 -11
  61. package/dist/src/apple/xcode-manager.js +736 -65
  62. package/dist/src/apple/xcode-manager.js.map +1 -1
  63. package/dist/src/apple/xcode-project-object-with-id.d.ts +5 -0
  64. package/dist/src/apple/xcode-project-object-with-id.js +3 -0
  65. package/dist/src/apple/xcode-project-object-with-id.js.map +1 -0
  66. package/dist/src/flutter/flutter-wizard.js +10 -2
  67. package/dist/src/flutter/flutter-wizard.js.map +1 -1
  68. package/dist/src/flutter/templates.js +7 -1
  69. package/dist/src/flutter/templates.js.map +1 -1
  70. package/dist/src/nextjs/nextjs-wizard.js +27 -15
  71. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  72. package/dist/src/nextjs/templates.js +56 -7
  73. package/dist/src/nextjs/templates.js.map +1 -1
  74. package/dist/src/nuxt/nuxt-wizard.js +1 -3
  75. package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
  76. package/dist/src/nuxt/templates.js +30 -0
  77. package/dist/src/nuxt/templates.js.map +1 -1
  78. package/dist/src/react-native/expo-env-file.js +5 -0
  79. package/dist/src/react-native/expo-env-file.js.map +1 -1
  80. package/dist/src/react-native/expo-metro.js +22 -6
  81. package/dist/src/react-native/expo-metro.js.map +1 -1
  82. package/dist/src/react-native/expo.js +11 -1
  83. package/dist/src/react-native/expo.js.map +1 -1
  84. package/dist/src/react-native/glob.js +14 -4
  85. package/dist/src/react-native/glob.js.map +1 -1
  86. package/dist/src/react-native/gradle.js +14 -4
  87. package/dist/src/react-native/gradle.js.map +1 -1
  88. package/dist/src/react-native/javascript.d.ts +9 -4
  89. package/dist/src/react-native/javascript.js +52 -23
  90. package/dist/src/react-native/javascript.js.map +1 -1
  91. package/dist/src/react-native/metro.d.ts +1 -1
  92. package/dist/src/react-native/metro.js +36 -4
  93. package/dist/src/react-native/metro.js.map +1 -1
  94. package/dist/src/react-native/react-native-wizard.d.ts +4 -0
  95. package/dist/src/react-native/react-native-wizard.js +32 -4
  96. package/dist/src/react-native/react-native-wizard.js.map +1 -1
  97. package/dist/src/react-native/xcode.js +29 -10
  98. package/dist/src/react-native/xcode.js.map +1 -1
  99. package/dist/src/remix/remix-wizard.js +1 -3
  100. package/dist/src/remix/remix-wizard.js.map +1 -1
  101. package/dist/src/remix/sdk-example.js +30 -1
  102. package/dist/src/remix/sdk-example.js.map +1 -1
  103. package/dist/src/remix/sdk-setup.js +11 -5
  104. package/dist/src/remix/sdk-setup.js.map +1 -1
  105. package/dist/src/run.d.ts +1 -1
  106. package/dist/src/run.js +5 -0
  107. package/dist/src/run.js.map +1 -1
  108. package/dist/src/sourcemaps/sourcemaps-wizard.d.ts +1 -1
  109. package/dist/src/sourcemaps/sourcemaps-wizard.js +35 -20
  110. package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
  111. package/dist/src/sourcemaps/tools/angular.d.ts +1 -0
  112. package/dist/src/sourcemaps/tools/angular.js +7 -7
  113. package/dist/src/sourcemaps/tools/angular.js.map +1 -1
  114. package/dist/src/sourcemaps/tools/sentry-cli.d.ts +5 -1
  115. package/dist/src/sourcemaps/tools/sentry-cli.js +6 -3
  116. package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
  117. package/dist/src/sourcemaps/tools/tsc.js +5 -1
  118. package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
  119. package/dist/src/sourcemaps/tools/vite.js +4 -1
  120. package/dist/src/sourcemaps/tools/vite.js.map +1 -1
  121. package/dist/src/sourcemaps/tools/webpack.js +4 -1
  122. package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
  123. package/dist/src/sveltekit/sdk-example.js +1 -1
  124. package/dist/src/sveltekit/sdk-example.js.map +1 -1
  125. package/dist/src/sveltekit/sveltekit-wizard.js +3 -5
  126. package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
  127. package/dist/src/sveltekit/templates.js +28 -1
  128. package/dist/src/sveltekit/templates.js.map +1 -1
  129. package/dist/src/utils/clack/index.d.ts +13 -15
  130. package/dist/src/utils/clack/index.js +17 -50
  131. package/dist/src/utils/clack/index.js.map +1 -1
  132. package/dist/src/utils/git.d.ts +11 -0
  133. package/dist/src/utils/git.js +69 -0
  134. package/dist/src/utils/git.js.map +1 -0
  135. package/dist/src/utils/sentrycli-utils.js +13 -4
  136. package/dist/src/utils/sentrycli-utils.js.map +1 -1
  137. package/dist/src/version.d.ts +1 -1
  138. package/dist/src/version.js +1 -1
  139. package/dist/src/version.js.map +1 -1
  140. package/dist/test/angular/angular-wizard.test.d.ts +1 -0
  141. package/dist/test/angular/angular-wizard.test.js +27 -0
  142. package/dist/test/angular/angular-wizard.test.js.map +1 -0
  143. package/dist/test/angular/codemods/sourcemaps.test.d.ts +1 -0
  144. package/dist/test/angular/codemods/sourcemaps.test.js +237 -0
  145. package/dist/test/angular/codemods/sourcemaps.test.js.map +1 -0
  146. package/dist/test/angular/example-component.test.d.ts +1 -0
  147. package/dist/test/angular/example-component.test.js +105 -0
  148. package/dist/test/angular/example-component.test.js.map +1 -0
  149. package/dist/test/apple/code-tools.test.js +54 -35
  150. package/dist/test/apple/code-tools.test.js.map +1 -1
  151. package/dist/test/apple/configure-sentry-cli.test.d.ts +1 -0
  152. package/dist/test/apple/configure-sentry-cli.test.js +131 -0
  153. package/dist/test/apple/configure-sentry-cli.test.js.map +1 -0
  154. package/dist/test/apple/macos-system-helper-mocked.test.d.ts +1 -0
  155. package/dist/test/apple/macos-system-helper-mocked.test.js +46 -0
  156. package/dist/test/apple/macos-system-helper-mocked.test.js.map +1 -0
  157. package/dist/test/apple/macos-system-helper.test.d.ts +1 -0
  158. package/dist/test/apple/macos-system-helper.test.js +88 -0
  159. package/dist/test/apple/macos-system-helper.test.js.map +1 -0
  160. package/dist/test/apple/templates.test.js +10 -0
  161. package/dist/test/apple/templates.test.js.map +1 -1
  162. package/dist/test/apple/xcode-manager.test.js +745 -379
  163. package/dist/test/apple/xcode-manager.test.js.map +1 -1
  164. package/dist/test/flutter/templates.test.js +9 -0
  165. package/dist/test/flutter/templates.test.js.map +1 -1
  166. package/dist/test/react-native/javascript.test.js +119 -0
  167. package/dist/test/react-native/javascript.test.js.map +1 -1
  168. package/dist/test/react-native/metro.test.js +113 -0
  169. package/dist/test/react-native/metro.test.js.map +1 -1
  170. package/dist/test/remix/client-entry.test.js +10 -10
  171. package/dist/test/remix/client-entry.test.js.map +1 -1
  172. package/dist/test/utils/git.test.d.ts +1 -0
  173. package/dist/test/utils/git.test.js +70 -0
  174. package/dist/test/utils/git.test.js.map +1 -0
  175. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"nextjs-wizard.js","sourceRoot":"","sources":["../../../src/nextjs/nextjs-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,+EAA+E;AAC/E,6DAAmC;AACnC,kDAA0B;AAC1B,uCAAyB;AACzB,kFAAkF;AAClF,uCAA+D;AAC/D,2CAA6B;AAE7B,qDAAuC;AAEvC,uEAA0D;AAC1D,4CAAwD;AACxD,0CAiBwB;AACxB,wDAA+E;AAE/E,2CAoBqB;AACrB,mCAAiD;AAEjD,SAAgB,eAAe,CAAC,OAAsB;IACpD,OAAO,IAAA,yBAAa,EAClB;QACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;QACjC,WAAW,EAAE,QAAQ;QACrB,aAAa,EAAE,OAAO;KACvB,EACD,GAAG,EAAE,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAC5C,CAAC;AACJ,CAAC;AATD,0CASC;AAEM,KAAK,UAAU,4BAA4B,CAChD,OAAsB;IAEtB,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAE9D,IAAA,oBAAY,EAAC;QACX,UAAU,EAAE,uBAAuB;QACnC,SAAS;QACT,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,IAAA,yBAAiB,GAAE,CAAC;IAE/C,MAAM,IAAA,yCAAiC,EAAC;QACtC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;QAC1C,GAAG,EAAE,SAAS;KACf,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,MAAM,IAAA,yBAAiB,GAAE,CAAC;IAE9C,MAAM,IAAA,gCAAwB,EAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IAE/D,MAAM,WAAW,GAAG,IAAA,gCAAiB,EAAC,MAAM,EAAE,WAAW,CAAC,C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AM,CAAC;YACX,OAAO,EACL,uGAAuG;YACzG,OAAO,EAAE;gBACP;oBACE,KAAK,EAAE,KAAK;oBACZ,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,gDAAgD;iBACvD;gBACD;oBACE,KAAK,EAAE,IAAI;oBACX,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,uFAAuF;iBAC9F;aACF;YACD,YAAY,EAAE,IAAI;SACnB,CAAC,CACH,CAAC;QAEF,IAAI,CAAC,oBAAoB,EAAE;YACzB,iBAAK,CAAC,GAAG,CAAC,IAAI,CACZ,0EAA0E,CAC3E,CAAC;SACH;QAED,IAAI,EAAE,YAAY,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;QACxD,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;QAEnD,OAAO,oBAAoB,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,6BAA6B;IAC1C,IAAI,kBAA0B,CAAC;IAC/B,IAAI;QACF,kBAAkB,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAC7C,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,EACxC,MAAM,CACP,CAAC;KACH;IAAC,MAAM;QACN,OAAO,IAAI,CAAC;KACb;IAED,OAAO,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAChD,CAAC","sourcesContent":["/* eslint-disable max-lines */\n// @ts-expect-error - 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-expect-error - 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 { setupCI } from '../sourcemaps/sourcemaps-wizard';\nimport { traceStep, withTelemetry } from '../telemetry';\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';\nimport { getPackageVersion, hasPackageInstalled } from '../utils/package-json';\nimport type { SentryProjectData, WizardOptions } from '../utils/types';\nimport {\n getFullUnderscoreErrorCopyPasteSnippet,\n getGlobalErrorCopyPasteSnippet,\n getInstrumentationHookContent,\n getInstrumentationHookCopyPasteSnippet,\n getNextjsConfigCjsAppendix,\n getNextjsConfigCjsTemplate,\n getNextjsConfigEsmCopyPasteSnippet,\n getNextjsConfigMjsTemplate,\n getRootLayout,\n getSentryServersideConfigContents,\n getInstrumentationClientFileContents,\n getSentryDefaultGlobalErrorPage,\n getSentryDefaultUnderscoreErrorPage,\n getSentryExampleAppDirApiRoute,\n getSentryExamplePageContents,\n getSentryExamplePagesDirApiRoute,\n getSimpleUnderscoreErrorCopyPasteSnippet,\n getWithSentryConfigOptionsTemplate,\n getInstrumentationClientHookCopyPasteSnippet,\n} from './templates';\nimport { getNextJsVersionBucket } from './utils';\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 ignoreGitChanges: options.ignoreGitChanges,\n cwd: undefined,\n });\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@latest',\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\n await createOrMergeNextJsFiles(selectedProject, selfHosted, sentryUrl, {\n tunnelRoute,\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 is only compatible with Turbopack on Next.js version 15.3.0 (or 15.3.0-canary.8) or later. ${chalk.bold(\n `If you are using Turbopack with an older Next.js version, temporarily remove \\`--turbo\\` or \\`--turbopack\\` from your dev command until you have verified the SDK is working as expected. Note that the SDK will continue to work for non-Turbopack production builds.`,\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 && !options.comingFrom) {\n clack.log.info(\n \"▲ It seems like you're using Vercel. We recommend using the Sentry Vercel \\\n integration to set up an auth token for Vercel deployments: https://vercel.com/integrations/sentry\",\n );\n } else {\n await setupCI('nextjs', authToken, options.comingFrom);\n }\n\n const packageManagerForOutro =\n packageManagerFromInstallStep ?? (await getPackageManager());\n await runPrettierIfInstalled({\n cwd: undefined,\n });\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\\` or \\`--turbopack\\` 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};\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 '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', '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 getSentryServersideConfigContents(\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 \"create the file if it doesn't already exist\",\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-instrumentation-client-hook', async () => {\n const hasRootAppDirectory = hasDirectoryPathFromRoot('app');\n const hasRootPagesDirectory = hasDirectoryPathFromRoot('pages');\n const hasSrcDirectory = hasDirectoryPathFromRoot('src');\n\n let instrumentationClientHookLocation: 'src' | 'root' | 'does-not-exist';\n\n const instrumentationClientTsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation-client.ts'),\n );\n const instrumentationClientJsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation-client.js'),\n );\n const srcInstrumentationClientTsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation-client.ts'),\n );\n const srcInstrumentationClientJsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation-client.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 (instrumentationClientJsExists || instrumentationClientTsExists) {\n instrumentationClientHookLocation = 'root';\n } else {\n instrumentationClientHookLocation = 'does-not-exist';\n }\n } else {\n if (\n srcInstrumentationClientTsExists ||\n srcInstrumentationClientJsExists\n ) {\n instrumentationClientHookLocation = 'src';\n } else {\n instrumentationClientHookLocation = 'does-not-exist';\n }\n }\n\n const newInstrumentationClientFileName = `instrumentation-client.${\n typeScriptDetected ? 'ts' : 'js'\n }`;\n\n if (instrumentationClientHookLocation === 'does-not-exist') {\n let newInstrumentationClientHookLocation: 'root' | 'src';\n if (hasRootPagesDirectory || hasRootAppDirectory) {\n newInstrumentationClientHookLocation = 'root';\n } else if (hasSrcDirectory) {\n newInstrumentationClientHookLocation = 'src';\n } else {\n newInstrumentationClientHookLocation = 'root';\n }\n\n const newInstrumentationClientHookPath =\n newInstrumentationClientHookLocation === 'root'\n ? path.join(process.cwd(), newInstrumentationClientFileName)\n : path.join(process.cwd(), 'src', newInstrumentationClientFileName);\n\n const successfullyCreated = await createNewConfigFile(\n newInstrumentationClientHookPath,\n getInstrumentationClientFileContents(\n selectedProject.keys[0].dsn.public,\n selectedFeatures,\n ),\n );\n\n if (!successfullyCreated) {\n await showCopyPasteInstructions(\n newInstrumentationClientFileName,\n getInstrumentationClientHookCopyPasteSnippet(\n selectedProject.keys[0].dsn.public,\n selectedFeatures,\n ),\n \"create the file if it doesn't already exist\",\n );\n }\n } else {\n await showCopyPasteInstructions(\n srcInstrumentationClientTsExists || instrumentationClientTsExists\n ? 'instrumentation-client.ts'\n : srcInstrumentationClientJsExists || instrumentationClientJsExists\n ? 'instrumentation-client.js'\n : newInstrumentationClientFileName,\n getInstrumentationClientHookCopyPasteSnippet(\n selectedProject.keys[0].dsn.public,\n selectedFeatures,\n ),\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 });\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 appFolderPath = path.join(process.cwd(), ...appFolderLocation);\n\n const hasRootLayout = ['jsx', 'tsx', 'js'].some((ext) =>\n fs.existsSync(path.join(appFolderPath, `layout.${ext}`)),\n );\n\n if (!hasRootLayout) {\n // In case no root layout file exists, we create a simple one so that\n // the example page can be rendered correctly.\n const newRootLayoutFilename = `layout.${\n typeScriptDetected ? 'tsx' : 'jsx'\n }`;\n\n await fs.promises.writeFile(\n path.join(appFolderPath, newRootLayoutFilename),\n getRootLayout(typeScriptDetected),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...appFolderLocation, newRootLayoutFilename),\n )}.`,\n );\n }\n\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(path.join(appFolderPath, 'sentry-example-page'), {\n recursive: true,\n });\n\n const newPageFileName = `page.${typeScriptDetected ? 'tsx' : 'jsx'}`;\n\n await fs.promises.writeFile(\n path.join(appFolderPath, 'sentry-example-page', newPageFileName),\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(path.join(appFolderPath, 'api', 'sentry-example-api'), {\n recursive: true,\n });\n\n const newRouteFileName = `route.${typeScriptDetected ? 'ts' : 'js'}`;\n\n await fs.promises.writeFile(\n path.join(appFolderPath, 'api', 'sentry-example-api', newRouteFileName),\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\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,+EAA+E;AAC/E,6DAAmC;AACnC,kDAA0B;AAC1B,uCAAyB;AACzB,kFAAkF;AAClF,uCAA+D;AAC/D,2CAA6B;AAE7B,qDAAuC;AAEvC,uEAA0D;AAC1D,4CAAwD;AACxD,0CAiBwB;AACxB,wDAA+E;AAE/E,2CAoBqB;AACrB,mCAAi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uF;iBAC9F;aACF;YACD,YAAY,EAAE,IAAI;SACnB,CAAC,CACH,CAAC;QAEF,IAAI,CAAC,oBAAoB,EAAE;YACzB,iBAAK,CAAC,GAAG,CAAC,IAAI,CACZ,0EAA0E,CAC3E,CAAC;SACH;QAED,IAAI,EAAE,YAAY,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;QACxD,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;QAEnD,OAAO,oBAAoB,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,6BAA6B;IAC1C,IAAI,kBAA0B,CAAC;IAC/B,IAAI;QACF,kBAAkB,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAC7C,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,EACxC,MAAM,CACP,CAAC;KACH;IAAC,MAAM;QACN,OAAO,IAAI,CAAC;KACb;IAED,OAAO,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAChD,CAAC","sourcesContent":["/* eslint-disable max-lines */\n// @ts-expect-error - 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-expect-error - 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 { setupCI } from '../sourcemaps/sourcemaps-wizard';\nimport { traceStep, withTelemetry } from '../telemetry';\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';\nimport { getPackageVersion, hasPackageInstalled } from '../utils/package-json';\nimport type { SentryProjectData, WizardOptions } from '../utils/types';\nimport {\n getFullUnderscoreErrorCopyPasteSnippet,\n getGlobalErrorCopyPasteSnippet,\n getInstrumentationHookContent,\n getInstrumentationHookCopyPasteSnippet,\n getNextjsConfigCjsAppendix,\n getNextjsConfigCjsTemplate,\n getNextjsConfigEsmCopyPasteSnippet,\n getNextjsConfigMjsTemplate,\n getRootLayout,\n getSentryServersideConfigContents,\n getInstrumentationClientFileContents,\n getSentryDefaultGlobalErrorPage,\n getSentryDefaultUnderscoreErrorPage,\n getSentryExampleAppDirApiRoute,\n getSentryExamplePageContents,\n getSentryExamplePagesDirApiRoute,\n getSimpleUnderscoreErrorCopyPasteSnippet,\n getWithSentryConfigOptionsTemplate,\n getInstrumentationClientHookCopyPasteSnippet,\n} from './templates';\nimport { getNextJsVersionBucket } from './utils';\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 ignoreGitChanges: options.ignoreGitChanges,\n cwd: undefined,\n });\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@latest',\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\n await createOrMergeNextJsFiles(selectedProject, selfHosted, sentryUrl, {\n tunnelRoute,\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 is only compatible with Turbopack on Next.js version 15.3.0 (or 15.3.0-canary.8) or later. ${chalk.bold(\n `If you are using Turbopack with an older Next.js version, temporarily remove \\`--turbo\\` or \\`--turbopack\\` from your dev command until you have verified the SDK is working as expected. Note that the SDK will continue to work for non-Turbopack production builds.`,\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 && !options.comingFrom) {\n clack.log.info(\n \"▲ It seems like you're using Vercel. We recommend using the Sentry Vercel \\\n integration to set up an auth token for Vercel deployments: https://vercel.com/integrations/sentry\",\n );\n } else {\n await setupCI('nextjs', authToken, options.comingFrom);\n }\n\n const packageManagerForOutro =\n packageManagerFromInstallStep ?? (await getPackageManager());\n\n await runPrettierIfInstalled({ cwd: undefined });\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\\` or \\`--turbopack\\` 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};\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 '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', '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 getSentryServersideConfigContents(\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 filename: newInstrumentationFileName,\n codeSnippet: getInstrumentationHookCopyPasteSnippet(\n newInstrumentationHookLocation,\n ),\n hint: \"create the file if it doesn't already exist\",\n });\n }\n } else {\n await showCopyPasteInstructions({\n filename:\n srcInstrumentationTsExists || instrumentationTsExists\n ? 'instrumentation.ts'\n : srcInstrumentationJsExists || instrumentationJsExists\n ? 'instrumentation.js'\n : newInstrumentationFileName,\n codeSnippet: getInstrumentationHookCopyPasteSnippet(\n instrumentationHookLocation,\n ),\n });\n }\n });\n\n await traceStep('setup-instrumentation-client-hook', async () => {\n const hasRootAppDirectory = hasDirectoryPathFromRoot('app');\n const hasRootPagesDirectory = hasDirectoryPathFromRoot('pages');\n const hasSrcDirectory = hasDirectoryPathFromRoot('src');\n\n let instrumentationClientHookLocation: 'src' | 'root' | 'does-not-exist';\n\n const instrumentationClientTsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation-client.ts'),\n );\n const instrumentationClientJsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation-client.js'),\n );\n const srcInstrumentationClientTsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation-client.ts'),\n );\n const srcInstrumentationClientJsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation-client.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 (instrumentationClientJsExists || instrumentationClientTsExists) {\n instrumentationClientHookLocation = 'root';\n } else {\n instrumentationClientHookLocation = 'does-not-exist';\n }\n } else {\n if (\n srcInstrumentationClientTsExists ||\n srcInstrumentationClientJsExists\n ) {\n instrumentationClientHookLocation = 'src';\n } else {\n instrumentationClientHookLocation = 'does-not-exist';\n }\n }\n\n const newInstrumentationClientFileName = `instrumentation-client.${\n typeScriptDetected ? 'ts' : 'js'\n }`;\n\n if (instrumentationClientHookLocation === 'does-not-exist') {\n let newInstrumentationClientHookLocation: 'root' | 'src';\n if (hasRootPagesDirectory || hasRootAppDirectory) {\n newInstrumentationClientHookLocation = 'root';\n } else if (hasSrcDirectory) {\n newInstrumentationClientHookLocation = 'src';\n } else {\n newInstrumentationClientHookLocation = 'root';\n }\n\n const newInstrumentationClientHookPath =\n newInstrumentationClientHookLocation === 'root'\n ? path.join(process.cwd(), newInstrumentationClientFileName)\n : path.join(process.cwd(), 'src', newInstrumentationClientFileName);\n\n const successfullyCreated = await createNewConfigFile(\n newInstrumentationClientHookPath,\n getInstrumentationClientFileContents(\n selectedProject.keys[0].dsn.public,\n selectedFeatures,\n ),\n );\n\n if (!successfullyCreated) {\n await showCopyPasteInstructions({\n filename: newInstrumentationClientFileName,\n codeSnippet: getInstrumentationClientHookCopyPasteSnippet(\n selectedProject.keys[0].dsn.public,\n selectedFeatures,\n ),\n hint: \"create the file if it doesn't already exist\",\n });\n }\n } else {\n await showCopyPasteInstructions({\n filename:\n srcInstrumentationClientTsExists || instrumentationClientTsExists\n ? 'instrumentation-client.ts'\n : srcInstrumentationClientJsExists || instrumentationClientJsExists\n ? 'instrumentation-client.js'\n : newInstrumentationClientFileName,\n codeSnippet: getInstrumentationClientHookCopyPasteSnippet(\n selectedProject.keys[0].dsn.public,\n selectedFeatures,\n ),\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 });\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 appFolderPath = path.join(process.cwd(), ...appFolderLocation);\n\n const hasRootLayout = ['jsx', 'tsx', 'js'].some((ext) =>\n fs.existsSync(path.join(appFolderPath, `layout.${ext}`)),\n );\n\n if (!hasRootLayout) {\n // In case no root layout file exists, we create a simple one so that\n // the example page can be rendered correctly.\n const newRootLayoutFilename = `layout.${\n typeScriptDetected ? 'tsx' : 'jsx'\n }`;\n\n await fs.promises.writeFile(\n path.join(appFolderPath, newRootLayoutFilename),\n getRootLayout(typeScriptDetected),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...appFolderLocation, newRootLayoutFilename),\n )}.`,\n );\n }\n\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(path.join(appFolderPath, 'sentry-example-page'), {\n recursive: true,\n });\n\n const newPageFileName = `page.${typeScriptDetected ? 'tsx' : 'jsx'}`;\n\n await fs.promises.writeFile(\n path.join(appFolderPath, 'sentry-example-page', newPageFileName),\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(path.join(appFolderPath, 'api', 'sentry-example-api'), {\n recursive: true,\n });\n\n const newRouteFileName = `route.${typeScriptDetected ? 'ts' : 'js'}`;\n\n await fs.promises.writeFile(\n path.join(appFolderPath, 'api', 'sentry-example-api', newRouteFileName),\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\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"]}
@@ -183,10 +183,26 @@ function getSentryExamplePageContents(options) {
183
183
  : `https://${options.orgSlug}.sentry.io/issues/?project=${options.projectId}`;
184
184
  return `${options.useClient ? '"use client";\n\n' : ''}import Head from "next/head";
185
185
  import * as Sentry from "@sentry/nextjs";
186
- import { useState } from "react";
186
+ import { useState, useEffect } from "react";
187
+
188
+ class SentryExampleFrontendError extends Error {
189
+ constructor(message: string | undefined) {
190
+ super(message);
191
+ this.name = "SentryExampleFrontendError";
192
+ }
193
+ }
187
194
 
188
195
  export default function Page() {
189
196
  const [hasSentError, setHasSentError] = useState(false);
197
+ const [isConnected, setIsConnected] = useState(true);
198
+
199
+ useEffect(() => {
200
+ async function checkConnectivity() {
201
+ const result = await Sentry.diagnoseSdkConnectivity();
202
+ setIsConnected(result !== 'sentry-unreachable');
203
+ }
204
+ checkConnectivity();
205
+ }, []);
190
206
 
191
207
  return (
192
208
  <div>
@@ -219,7 +235,7 @@ export default function Page() {
219
235
  const res = await fetch("/api/sentry-example-api");
220
236
  if (!res.ok) {
221
237
  setHasSentError(true);
222
- throw new Error("Sentry Example Frontend Error");
238
+ throw new SentryExampleFrontendError("This error is raised on the frontend of the example page.");
223
239
  }
224
240
  });
225
241
  }}
@@ -233,11 +249,16 @@ export default function Page() {
233
249
  <p className="success">
234
250
  Sample error was sent to Sentry.
235
251
  </p>
252
+ ) : !isConnected ? (
253
+ <div className="connectivity-error">
254
+ <p>The Sentry SDK is not able to reach Sentry right now - this may be due to an adblocker. For more information, see <a target="_blank" href="https://docs.sentry.io/platforms/javascript/guides/nextjs/troubleshooting/#the-sdk-is-not-sending-any-data">the troubleshooting guide</a>.</p>
255
+ </div>
236
256
  ) : (
237
257
  <div className="success_placeholder" />
238
258
  )}
239
259
 
240
260
  <div className="flex-spacer" />
261
+
241
262
  <p className="description">
242
263
  Adblockers will prevent errors from being sent to Sentry.
243
264
  </p>
@@ -338,6 +359,22 @@ export default function Page() {
338
359
  .success_placeholder {
339
360
  height: 46px;
340
361
  }
362
+
363
+ .connectivity-error {
364
+ padding: 12px 16px;
365
+ background-color: #E50045;
366
+ border-radius: 8px;
367
+ width: 500px;
368
+ color: #FFFFFF;
369
+ border: 1px solid #A80033;
370
+ text-align: center;
371
+ margin: 0;
372
+ }
373
+
374
+ .connectivity-error a {
375
+ color: #FFFFFF;
376
+ text-decoration: underline;
377
+ }
341
378
  \`}</style>
342
379
  </div>
343
380
  );
@@ -346,10 +383,17 @@ export default function Page() {
346
383
  }
347
384
  exports.getSentryExamplePageContents = getSentryExamplePageContents;
348
385
  function getSentryExamplePagesDirApiRoute() {
349
- return `// A faulty API route to test Sentry's error monitoring
386
+ return `// Custom error class for Sentry testing
387
+ class SentryExampleAPIError extends Error {
388
+ constructor(message: string | undefined) {
389
+ super(message);
390
+ this.name = "SentryExampleAPIError";
391
+ }
392
+ }
393
+ // A faulty API route to test Sentry's error monitoring
350
394
  export default function handler(_req, res) {
351
- throw new Error("Sentry Example API Route Error");
352
- res.status(200).json({ name: "John Doe" });
395
+ throw new SentryExampleAPIError("This error is raised on the backend called by the example page.");
396
+ res.status(200).json({ name: "John Doe" });
353
397
  }
354
398
  `;
355
399
  }
@@ -358,10 +402,15 @@ function getSentryExampleAppDirApiRoute() {
358
402
  return `import { NextResponse } from "next/server";
359
403
 
360
404
  export const dynamic = "force-dynamic";
361
-
405
+ class SentryExampleAPIError extends Error {
406
+ constructor(message: string | undefined) {
407
+ super(message);
408
+ this.name = "SentryExampleAPIError";
409
+ }
410
+ }
362
411
  // A faulty API route to test Sentry's error monitoring
363
412
  export function GET() {
364
- throw new Error("Sentry Example API Route Error");
413
+ throw new SentryExampleAPIError("This error is raised on the backend called by the example page.");
365
414
  return NextResponse.json({ data: "Testing Sentry Error..." });
366
415
  }
367
416
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/nextjs/templates.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,0CAAiD;AAUjD,SAAgB,kCAAkC,CAAC,EACjD,OAAO,EACP,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,GACe;IACxB,OAAO;;;;YAIG,OAAO;gBACH,WAAW,KACvB,UAAU,CAAC,CAAC,CAAC,qBAAqB,SAAS,IAAI,CAAC,CAAC,CAAC,EACpD;;;;;;;;;;;SAYI,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,oBAC1B;;;;MAIE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK;;;;;;;;;;IAU1B,CAAC;AACL,CAAC;AA1CD,gFA0CC;AAED,SAAgB,0BAA0B,CACxC,+BAAuC;IAEvC,OAAO;;;;;;;IAOL,+BAA+B;;CAElC,CAAC;AACF,CAAC;AAbD,gEAaC;AAED,SAAgB,0BAA0B,CACxC,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EAAE,IAAI,EAAE,EAAE;QAC/C,OAAO,IAAI,CAAC,oCAAoC,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACL,CAAC;AAVD,oGAUC;AAED,SAAgB,+BAA+B,CAAC,IAAa;IAC3D,OAAO,IAAI;QACT,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;EAsBJ;QACE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;CAuBL,CAAC;AACF,CAAC;AAjDD,0EAiDC;AAED,SAAgB,8BAA8B,CAAC,IAAa;IAC1D,IAAI,IAAI,EAAE;QACR,OAAO;;EAET,eAAK,CAAC,KAAK,CAAC,2CAA2C,CAAC;EACxD,eAAK,CAAC,KAAK,CAAC,iCAAiC,CAAC;EAC9C,eAAK,CAAC,KAAK,CAAC,oCAAoC,CAAC;;sCAEb,eAAK,CAAC,KAAK,CAC3C,6BAA6B,CAC9B;IACD,eAAK,CAAC,KAAK,CAAC;;eAED,CAAC;;;;;;;;;;CAUf,CAAC;KACC;IACD,OAAO;;EAEP,eAAK,CAAC,KAAK,CAAC,2CAA2C,CAAC;EACxD,eAAK,CAAC,KAAK,CAAC,iCAAiC,CAAC;EAC9C,eAAK,CAAC,KAAK,CAAC,oCAAoC,CAAC;;sCAEb,eAAK,CAAC,KAAK,CAAC,WAAW,CAAC;IAC1D,eAAK,CAAC,KAAK,CAAC;;eAED,CAAC;;;;;;;;;;CAUf,CAAC;AACF,CAAC;AA7CD,wEA6CC;AAEM,MAAM,aAAa,GAAG,CAC3B,IAAa,EACb,EAAE,CAAC;;;;;;;;;;GAWH,IAAI;IACF,CAAC,CAAC;;EAEJ;IACE,CAAC,CAAC,EACN;;;;;;;CAOC,CAAC;AAzBW,QAAA,aAAa,iBAyBxB","sourcesContent":["import chalk from 'chalk';\nimport { makeCodeSnippet } from '../utils/clack';\n\ntype WithSentryConfigOptions = {\n orgSlug: string;\n projectSlug: string;\n selfHosted: boolean;\n sentryUrl: string;\n tunnelRoute: boolean;\n};\n\nexport function getWithSentryConfigOptionsTemplate({\n orgSlug,\n projectSlug,\n selfHosted,\n tunnelRoute,\n sentryUrl,\n}: WithSentryConfigOptions): string {\n return `{\n // For all available options, see:\n // https://www.npmjs.com/package/@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\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 getSentryServersideConfigContents(\n dsn: string,\n config: 'server' | '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 === '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 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}\",${performanceOptions}\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 getInstrumentationClientFileContents(\n dsn: string,\n selectedFeaturesMap: {\n replay: boolean;\n performance: boolean;\n },\n): string {\n const integrationsOptions = getClientIntegrationsSnippet({\n replay: selectedFeaturesMap.replay,\n });\n\n let replayOptions = '';\n\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 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 return `// This file configures the initialization of Sentry on the client.\n// The added config here will be used whenever a users loads a page in their browser.\n// https://docs.sentry.io/platforms/javascript/guides/nextjs/\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\nexport const onRouterTransitionStart = Sentry.captureRouterTransitionStart;`;\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\";\nimport { useState } from \"react\";\n\nexport default function Page() {\n const [hasSentError, setHasSentError] = useState(false);\n\n return (\n <div>\n <Head>\n <title>sentry-example-page</title>\n <meta name=\"description\" content=\"Test Sentry for your Next.js app!\" />\n </Head>\n\n <main>\n <div className=\"flex-spacer\" />\n <svg height=\"40\" width=\"40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21.85 2.995a3.698 3.698 0 0 1 1.353 1.354l16.303 28.278a3.703 3.703 0 0 1-1.354 5.053 3.694 3.694 0 0 1-1.848.496h-3.828a31.149 31.149 0 0 0 0-3.09h3.815a.61.61 0 0 0 .537-.917L20.523 5.893a.61.61 0 0 0-1.057 0l-3.739 6.494a28.948 28.948 0 0 1 9.63 10.453 28.988 28.988 0 0 1 3.499 13.78v1.542h-9.852v-1.544a19.106 19.106 0 0 0-2.182-8.85 19.08 19.08 0 0 0-6.032-6.829l-1.85 3.208a15.377 15.377 0 0 1 6.382 12.484v1.542H3.696A3.694 3.694 0 0 1 0 34.473c0-.648.17-1.286.494-1.849l2.33-4.074a8.562 8.562 0 0 1 2.689 1.536L3.158 34.17a.611.611 0 0 0 .538.917h8.448a12.481 12.481 0 0 0-6.037-9.09l-1.344-.772 4.908-8.545 1.344.77a22.16 22.16 0 0 1 7.705 7.444 22.193 22.193 0 0 1 3.316 10.193h3.699a25.892 25.892 0 0 0-3.811-12.033 25.856 25.856 0 0 0-9.046-8.796l-1.344-.772 5.269-9.136a3.698 3.698 0 0 1 3.2-1.849c.648 0 1.285.17 1.847.495Z\" fill=\"currentcolor\"/>\n </svg>\n <h1>\n sentry-example-page\n </h1>\n\n <p className=\"description\">\n Click the button below, and view the sample error on the Sentry <a target=\"_blank\" href=\"${issuesPageLink}\">Issues Page</a>.\n For more details about setting up Sentry, <a target=\"_blank\" href=\"https://docs.sentry.io/platforms/javascript/guides/nextjs/\">read our docs</a>.\n </p>\n\n <button\n type=\"button\"\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 setHasSentError(true);\n throw new Error(\"Sentry Example Frontend Error\");\n }\n });\n }}\n >\n <span>\n Throw Sample Error\n </span>\n </button>\n\n {hasSentError ? (\n <p className=\"success\">\n Sample error was sent to Sentry.\n </p>\n ) : (\n <div className=\"success_placeholder\" />\n )}\n\n <div className=\"flex-spacer\" />\n <p className=\"description\">\n Adblockers will prevent errors from being sent to Sentry.\n </p>\n </main>\n\n <style>{\\`\n main {\n display: flex;\n min-height: 100vh;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 16px;\n padding: 16px;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", sans-serif;\n }\n\n h1 {\n padding: 0px 4px;\n border-radius: 4px;\n background-color: rgba(24, 20, 35, 0.03);\n font-family: monospace;\n font-size: 20px;\n line-height: 1.2;\n }\n\n p {\n margin: 0;\n font-size: 20px;\n }\n\n a {\n color: #6341F0;\n text-decoration: underline;\n cursor: pointer;\n\n @media (prefers-color-scheme: dark) {\n color: #B3A1FF;\n }\n }\n\n button {\n border-radius: 8px;\n color: white;\n cursor: pointer;\n background-color: #553DB8;\n border: none;\n padding: 0;\n margin-top: 4px;\n\n & > span {\n display: inline-block;\n padding: 12px 16px;\n border-radius: inherit;\n font-size: 20px;\n font-weight: bold;\n line-height: 1;\n background-color: #7553FF;\n border: 1px solid #553DB8;\n transform: translateY(-4px);\n }\n\n &:hover > span {\n transform: translateY(-8px);\n }\n\n &:active > span {\n transform: translateY(0);\n }\n }\n\n .description {\n text-align: center;\n color: #6E6C75;\n max-width: 500px;\n line-height: 1.5;\n font-size: 20px;\n\n @media (prefers-color-scheme: dark) {\n color: #A49FB5;\n }\n }\n\n .flex-spacer {\n flex: 1;\n }\n\n .success {\n padding: 12px 16px;\n border-radius: 8px;\n font-size: 20px;\n line-height: 1;\n background-color: #00F261;\n border: 1px solid #00BF4D;\n color: #181423;\n }\n\n .success_placeholder {\n height: 46px;\n }\n \\`}</style>\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 getInstrumentationClientHookCopyPasteSnippet(\n dsn: string,\n selectedFeaturesMap: {\n replay: boolean;\n performance: boolean;\n },\n) {\n return makeCodeSnippet(true, (unchanged, plus) => {\n return plus(getInstrumentationClientFileContents(dsn, selectedFeaturesMap));\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 }\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\nexport const getRootLayout = (\n isTs: boolean,\n) => `// This file was generated by the Sentry wizard because we couldn't find a root layout file.\n// You can delete this file at any time.\n\nexport const metadata = {\n title: 'Sentry NextJS Example',\n description: 'Generated by Sentry',\n}\n\nexport default function RootLayout({\n children,\n}${\n isTs\n ? `: {\n children: React.ReactNode\n}`\n : ''\n}) {\n return (\n <html lang=\"en\">\n <body>{children}</body>\n </html>\n )\n}\n`;\n"]}
1
+ {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/nextjs/templates.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,0CAAiD;AAUjD,SAAgB,kCAAk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O;;EAEP,eAAK,CAAC,KAAK,CAAC,2CAA2C,CAAC;EACxD,eAAK,CAAC,KAAK,CAAC,iCAAiC,CAAC;EAC9C,eAAK,CAAC,KAAK,CAAC,oCAAoC,CAAC;;sCAEb,eAAK,CAAC,KAAK,CAAC,WAAW,CAAC;IAC1D,eAAK,CAAC,KAAK,CAAC;;eAED,CAAC;;;;;;;;;;CAUf,CAAC;AACF,CAAC;AA7CD,wEA6CC;AAEM,MAAM,aAAa,GAAG,CAC3B,IAAa,EACb,EAAE,CAAC;;;;;;;;;;GAWH,IAAI;IACF,CAAC,CAAC;;EAEJ;IACE,CAAC,CAAC,EACN;;;;;;;CAOC,CAAC;AAzBW,QAAA,aAAa,iBAyBxB","sourcesContent":["import chalk from 'chalk';\nimport { makeCodeSnippet } from '../utils/clack';\n\ntype WithSentryConfigOptions = {\n orgSlug: string;\n projectSlug: string;\n selfHosted: boolean;\n sentryUrl: string;\n tunnelRoute: boolean;\n};\n\nexport function getWithSentryConfigOptionsTemplate({\n orgSlug,\n projectSlug,\n selfHosted,\n tunnelRoute,\n sentryUrl,\n}: WithSentryConfigOptions): string {\n return `{\n // For all available options, see:\n // https://www.npmjs.com/package/@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\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 getSentryServersideConfigContents(\n dsn: string,\n config: 'server' | '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 === '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 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}\",${performanceOptions}\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 getInstrumentationClientFileContents(\n dsn: string,\n selectedFeaturesMap: {\n replay: boolean;\n performance: boolean;\n },\n): string {\n const integrationsOptions = getClientIntegrationsSnippet({\n replay: selectedFeaturesMap.replay,\n });\n\n let replayOptions = '';\n\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 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 return `// This file configures the initialization of Sentry on the client.\n// The added config here will be used whenever a users loads a page in their browser.\n// https://docs.sentry.io/platforms/javascript/guides/nextjs/\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\nexport const onRouterTransitionStart = Sentry.captureRouterTransitionStart;`;\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\";\nimport { useState, useEffect } from \"react\";\n\nclass SentryExampleFrontendError extends Error {\n constructor(message: string | undefined) {\n super(message);\n this.name = \"SentryExampleFrontendError\";\n }\n}\n\nexport default function Page() {\n const [hasSentError, setHasSentError] = useState(false);\n const [isConnected, setIsConnected] = useState(true);\n \n useEffect(() => {\n async function checkConnectivity() {\n const result = await Sentry.diagnoseSdkConnectivity();\n setIsConnected(result !== 'sentry-unreachable');\n }\n checkConnectivity();\n }, []);\n\n return (\n <div>\n <Head>\n <title>sentry-example-page</title>\n <meta name=\"description\" content=\"Test Sentry for your Next.js app!\" />\n </Head>\n\n <main>\n <div className=\"flex-spacer\" />\n <svg height=\"40\" width=\"40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21.85 2.995a3.698 3.698 0 0 1 1.353 1.354l16.303 28.278a3.703 3.703 0 0 1-1.354 5.053 3.694 3.694 0 0 1-1.848.496h-3.828a31.149 31.149 0 0 0 0-3.09h3.815a.61.61 0 0 0 .537-.917L20.523 5.893a.61.61 0 0 0-1.057 0l-3.739 6.494a28.948 28.948 0 0 1 9.63 10.453 28.988 28.988 0 0 1 3.499 13.78v1.542h-9.852v-1.544a19.106 19.106 0 0 0-2.182-8.85 19.08 19.08 0 0 0-6.032-6.829l-1.85 3.208a15.377 15.377 0 0 1 6.382 12.484v1.542H3.696A3.694 3.694 0 0 1 0 34.473c0-.648.17-1.286.494-1.849l2.33-4.074a8.562 8.562 0 0 1 2.689 1.536L3.158 34.17a.611.611 0 0 0 .538.917h8.448a12.481 12.481 0 0 0-6.037-9.09l-1.344-.772 4.908-8.545 1.344.77a22.16 22.16 0 0 1 7.705 7.444 22.193 22.193 0 0 1 3.316 10.193h3.699a25.892 25.892 0 0 0-3.811-12.033 25.856 25.856 0 0 0-9.046-8.796l-1.344-.772 5.269-9.136a3.698 3.698 0 0 1 3.2-1.849c.648 0 1.285.17 1.847.495Z\" fill=\"currentcolor\"/>\n </svg>\n <h1>\n sentry-example-page\n </h1>\n\n <p className=\"description\">\n Click the button below, and view the sample error on the Sentry <a target=\"_blank\" href=\"${issuesPageLink}\">Issues Page</a>.\n For more details about setting up Sentry, <a target=\"_blank\" href=\"https://docs.sentry.io/platforms/javascript/guides/nextjs/\">read our docs</a>.\n </p>\n\n <button\n type=\"button\"\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 setHasSentError(true);\n throw new SentryExampleFrontendError(\"This error is raised on the frontend of the example page.\");\n }\n });\n }}\n >\n <span>\n Throw Sample Error\n </span>\n </button>\n\n {hasSentError ? (\n <p className=\"success\">\n Sample error was sent to Sentry.\n </p>\n ) : !isConnected ? (\n <div className=\"connectivity-error\">\n <p>The Sentry SDK is not able to reach Sentry right now - this may be due to an adblocker. For more information, see <a target=\"_blank\" href=\"https://docs.sentry.io/platforms/javascript/guides/nextjs/troubleshooting/#the-sdk-is-not-sending-any-data\">the troubleshooting guide</a>.</p>\n </div>\n ) : (\n <div className=\"success_placeholder\" />\n )}\n\n <div className=\"flex-spacer\" />\n \n <p className=\"description\">\n Adblockers will prevent errors from being sent to Sentry.\n </p>\n </main>\n\n <style>{\\`\n main {\n display: flex;\n min-height: 100vh;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 16px;\n padding: 16px;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", sans-serif;\n }\n\n h1 {\n padding: 0px 4px;\n border-radius: 4px;\n background-color: rgba(24, 20, 35, 0.03);\n font-family: monospace;\n font-size: 20px;\n line-height: 1.2;\n }\n\n p {\n margin: 0;\n font-size: 20px;\n }\n\n a {\n color: #6341F0;\n text-decoration: underline;\n cursor: pointer;\n\n @media (prefers-color-scheme: dark) {\n color: #B3A1FF;\n }\n }\n\n button {\n border-radius: 8px;\n color: white;\n cursor: pointer;\n background-color: #553DB8;\n border: none;\n padding: 0;\n margin-top: 4px;\n\n & > span {\n display: inline-block;\n padding: 12px 16px;\n border-radius: inherit;\n font-size: 20px;\n font-weight: bold;\n line-height: 1;\n background-color: #7553FF;\n border: 1px solid #553DB8;\n transform: translateY(-4px);\n }\n\n &:hover > span {\n transform: translateY(-8px);\n }\n\n &:active > span {\n transform: translateY(0);\n }\n }\n\n .description {\n text-align: center;\n color: #6E6C75;\n max-width: 500px;\n line-height: 1.5;\n font-size: 20px;\n\n @media (prefers-color-scheme: dark) {\n color: #A49FB5;\n }\n }\n\n .flex-spacer {\n flex: 1;\n }\n\n .success {\n padding: 12px 16px;\n border-radius: 8px;\n font-size: 20px;\n line-height: 1;\n background-color: #00F261;\n border: 1px solid #00BF4D;\n color: #181423;\n }\n\n .success_placeholder {\n height: 46px;\n }\n\n .connectivity-error {\n padding: 12px 16px;\n background-color: #E50045;\n border-radius: 8px;\n width: 500px;\n color: #FFFFFF;\n border: 1px solid #A80033;\n text-align: center;\n margin: 0;\n }\n \n .connectivity-error a {\n color: #FFFFFF;\n text-decoration: underline;\n }\n \\`}</style>\n </div>\n );\n}\n`;\n}\n\nexport function getSentryExamplePagesDirApiRoute() {\n return `// Custom error class for Sentry testing\nclass SentryExampleAPIError extends Error {\n constructor(message: string | undefined) {\n super(message);\n this.name = \"SentryExampleAPIError\";\n }\n}\n// A faulty API route to test Sentry's error monitoring\nexport default function handler(_req, res) {\nthrow new SentryExampleAPIError(\"This error is raised on the backend called by the example page.\");\nres.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\";\nclass SentryExampleAPIError extends Error {\n constructor(message: string | undefined) {\n super(message);\n this.name = \"SentryExampleAPIError\";\n }\n}\n// A faulty API route to test Sentry's error monitoring\nexport function GET() {\n throw new SentryExampleAPIError(\"This error is raised on the backend called by the example page.\");\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 getInstrumentationClientHookCopyPasteSnippet(\n dsn: string,\n selectedFeaturesMap: {\n replay: boolean;\n performance: boolean;\n },\n) {\n return makeCodeSnippet(true, (unchanged, plus) => {\n return plus(getInstrumentationClientFileContents(dsn, selectedFeaturesMap));\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 }\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\nexport const getRootLayout = (\n isTs: boolean,\n) => `// This file was generated by the Sentry wizard because we couldn't find a root layout file.\n// You can delete this file at any time.\n\nexport const metadata = {\n title: 'Sentry NextJS Example',\n description: 'Generated by Sentry',\n}\n\nexport default function RootLayout({\n children,\n}${\n isTs\n ? `: {\n children: React.ReactNode\n}`\n : ''\n}) {\n return (\n <html lang=\"en\">\n <body>{children}</body>\n </html>\n )\n}\n`;\n"]}
@@ -123,9 +123,7 @@ async function runNuxtWizardWithTelemetry(options) {
123
123
  await (0, telemetry_1.traceStep)('create-example-component', async () => (0, sdk_example_1.createExampleComponent)(isV4));
124
124
  }
125
125
  }
126
- await (0, clack_1.runPrettierIfInstalled)({
127
- cwd: undefined,
128
- });
126
+ await (0, clack_1.runPrettierIfInstalled)({ cwd: undefined });
129
127
  await (0, sdk_setup_1.confirmReadImportDocs)(deploymentPlatform);
130
128
  clack.outro(buildOutroMessage(shouldCreateExamplePage, shouldCreateExampleButton));
131
129
  }