@sentry/wizard 3.42.1 → 4.0.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 (338) hide show
  1. package/.node-cache/node-v22.14.0-darwin-arm64 +0 -0
  2. package/.node-cache/node-v22.14.0-darwin-x64 +0 -0
  3. package/.node-cache/node-v22.14.0-linux-arm64 +0 -0
  4. package/.node-cache/node-v22.14.0-linux-x64 +0 -0
  5. package/.node-cache/node-v22.14.0-win-x64.exe +0 -0
  6. package/CHANGELOG.md +26 -0
  7. package/COPYING +3575 -0
  8. package/bin.ts +85 -80
  9. package/dist/bin.js +44 -35
  10. package/dist/bin.js.map +1 -1
  11. package/dist/e2e-tests/jest.config.js +1 -1
  12. package/dist/e2e-tests/jest.config.js.map +1 -1
  13. package/dist/e2e-tests/tests/flutter.test.js +62 -147
  14. package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
  15. package/dist/e2e-tests/tests/nextjs.test.js +77 -175
  16. package/dist/e2e-tests/tests/nextjs.test.js.map +1 -1
  17. package/dist/e2e-tests/tests/nuxt-3.test.js +61 -162
  18. package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
  19. package/dist/e2e-tests/tests/nuxt-4.test.js +62 -163
  20. package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
  21. package/dist/e2e-tests/tests/remix.test.js +147 -189
  22. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  23. package/dist/e2e-tests/tests/sveltekit.test.js +133 -187
  24. package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
  25. package/dist/e2e-tests/utils/index.d.ts +1 -1
  26. package/dist/e2e-tests/utils/index.js +113 -195
  27. package/dist/e2e-tests/utils/index.js.map +1 -1
  28. package/dist/lib/Constants.js +5 -5
  29. package/dist/lib/Constants.js.map +1 -1
  30. package/dist/lib/Helper/BottomBar.d.ts +1 -1
  31. package/dist/lib/Helper/BottomBar.js +14 -15
  32. package/dist/lib/Helper/BottomBar.js.map +1 -1
  33. package/dist/lib/Helper/Env.js +5 -2
  34. package/dist/lib/Helper/Env.js.map +1 -1
  35. package/dist/lib/Helper/File.js +14 -27
  36. package/dist/lib/Helper/File.js.map +1 -1
  37. package/dist/lib/Helper/Git.js +24 -59
  38. package/dist/lib/Helper/Git.js.map +1 -1
  39. package/dist/lib/Helper/Logging.js +2 -2
  40. package/dist/lib/Helper/Logging.js.map +1 -1
  41. package/dist/lib/Helper/MergeConfig.js +4 -4
  42. package/dist/lib/Helper/MergeConfig.js.map +1 -1
  43. package/dist/lib/Helper/Package.d.ts +4 -1
  44. package/dist/lib/Helper/Package.js +12 -38
  45. package/dist/lib/Helper/Package.js.map +1 -1
  46. package/dist/lib/Helper/SentryCli.js +77 -149
  47. package/dist/lib/Helper/SentryCli.js.map +1 -1
  48. package/dist/lib/Helper/Wizard.js +29 -124
  49. package/dist/lib/Helper/Wizard.js.map +1 -1
  50. package/dist/lib/Helper/__tests__/File.js +4 -4
  51. package/dist/lib/Helper/__tests__/File.js.map +1 -1
  52. package/dist/lib/Helper/__tests__/MergeConfig.js +24 -24
  53. package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
  54. package/dist/lib/Helper/__tests__/SentryCli.js +33 -23
  55. package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
  56. package/dist/lib/Setup.js +23 -85
  57. package/dist/lib/Setup.js.map +1 -1
  58. package/dist/lib/Steps/BaseStep.js +8 -8
  59. package/dist/lib/Steps/BaseStep.js.map +1 -1
  60. package/dist/lib/Steps/ChooseIntegration.js +80 -125
  61. package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
  62. package/dist/lib/Steps/ConfigureProject.js +6 -66
  63. package/dist/lib/Steps/ConfigureProject.js.map +1 -1
  64. package/dist/lib/Steps/Initial.js +16 -104
  65. package/dist/lib/Steps/Initial.js.map +1 -1
  66. package/dist/lib/Steps/Integrations/BaseIntegration.js +24 -118
  67. package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
  68. package/dist/lib/Steps/Integrations/Cordova.js +95 -183
  69. package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
  70. package/dist/lib/Steps/Integrations/Electron.js +87 -145
  71. package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
  72. package/dist/lib/Steps/Integrations/MobileProject.js +40 -148
  73. package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
  74. package/dist/lib/Steps/OpenSentry.js +63 -126
  75. package/dist/lib/Steps/OpenSentry.js.map +1 -1
  76. package/dist/lib/Steps/PromptForParameters.js +110 -206
  77. package/dist/lib/Steps/PromptForParameters.js.map +1 -1
  78. package/dist/lib/Steps/Result.js +19 -79
  79. package/dist/lib/Steps/Result.js.map +1 -1
  80. package/dist/lib/Steps/SentryProjectSelector.js +57 -148
  81. package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
  82. package/dist/lib/Steps/ShouldConfigure.js +6 -66
  83. package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
  84. package/dist/lib/Steps/WaitForSentry.js +43 -120
  85. package/dist/lib/Steps/WaitForSentry.js.map +1 -1
  86. package/dist/lib/Steps/Welcome.js +17 -76
  87. package/dist/lib/Steps/Welcome.js.map +1 -1
  88. package/dist/lib/__tests__/Env.js +3 -3
  89. package/dist/lib/__tests__/Env.js.map +1 -1
  90. package/dist/src/android/android-wizard.js +100 -176
  91. package/dist/src/android/android-wizard.js.map +1 -1
  92. package/dist/src/android/code-tools.js +24 -33
  93. package/dist/src/android/code-tools.js.map +1 -1
  94. package/dist/src/android/gradle.js +106 -165
  95. package/dist/src/android/gradle.js.map +1 -1
  96. package/dist/src/android/manifest.js +26 -27
  97. package/dist/src/android/manifest.js.map +1 -1
  98. package/dist/src/android/templates.js +76 -23
  99. package/dist/src/android/templates.js.map +1 -1
  100. package/dist/src/apple/apple-wizard.js +129 -225
  101. package/dist/src/apple/apple-wizard.js.map +1 -1
  102. package/dist/src/apple/cocoapod.js +47 -109
  103. package/dist/src/apple/cocoapod.js.map +1 -1
  104. package/dist/src/apple/code-tools.js +32 -35
  105. package/dist/src/apple/code-tools.js.map +1 -1
  106. package/dist/src/apple/fastlane.js +51 -97
  107. package/dist/src/apple/fastlane.js.map +1 -1
  108. package/dist/src/apple/templates.js +41 -5
  109. package/dist/src/apple/templates.js.map +1 -1
  110. package/dist/src/apple/xcode-manager.d.ts +2 -2
  111. package/dist/src/apple/xcode-manager.js +93 -108
  112. package/dist/src/apple/xcode-manager.js.map +1 -1
  113. package/dist/src/flutter/code-tools.js +79 -127
  114. package/dist/src/flutter/code-tools.js.map +1 -1
  115. package/dist/src/flutter/flutter-wizard.js +75 -136
  116. package/dist/src/flutter/flutter-wizard.js.map +1 -1
  117. package/dist/src/flutter/templates.js +48 -12
  118. package/dist/src/flutter/templates.js.map +1 -1
  119. package/dist/src/nextjs/nextjs-wizard.js +527 -805
  120. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  121. package/dist/src/nextjs/templates.js +380 -40
  122. package/dist/src/nextjs/templates.js.map +1 -1
  123. package/dist/src/nextjs/utils.js +5 -5
  124. package/dist/src/nextjs/utils.js.map +1 -1
  125. package/dist/src/nuxt/nuxt-wizard.js +91 -188
  126. package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
  127. package/dist/src/nuxt/sdk-example.js +68 -137
  128. package/dist/src/nuxt/sdk-example.js.map +1 -1
  129. package/dist/src/nuxt/sdk-setup.d.ts +4 -4
  130. package/dist/src/nuxt/sdk-setup.js +180 -336
  131. package/dist/src/nuxt/sdk-setup.js.map +1 -1
  132. package/dist/src/nuxt/templates.js +195 -18
  133. package/dist/src/nuxt/templates.js.map +1 -1
  134. package/dist/src/nuxt/utils.js +29 -76
  135. package/dist/src/nuxt/utils.js.map +1 -1
  136. package/dist/src/react-native/expo-env-file.js +41 -94
  137. package/dist/src/react-native/expo-env-file.js.map +1 -1
  138. package/dist/src/react-native/expo-metro.d.ts +1 -1
  139. package/dist/src/react-native/expo-metro.js +75 -130
  140. package/dist/src/react-native/expo-metro.js.map +1 -1
  141. package/dist/src/react-native/expo.js +61 -114
  142. package/dist/src/react-native/expo.js.map +1 -1
  143. package/dist/src/react-native/git.js +23 -56
  144. package/dist/src/react-native/git.js.map +1 -1
  145. package/dist/src/react-native/glob.js +3 -3
  146. package/dist/src/react-native/glob.js.map +1 -1
  147. package/dist/src/react-native/gradle.js +4 -4
  148. package/dist/src/react-native/gradle.js.map +1 -1
  149. package/dist/src/react-native/javascript.js +51 -95
  150. package/dist/src/react-native/javascript.js.map +1 -1
  151. package/dist/src/react-native/metro.js +176 -296
  152. package/dist/src/react-native/metro.js.map +1 -1
  153. package/dist/src/react-native/react-native-wizard.js +267 -418
  154. package/dist/src/react-native/react-native-wizard.js.map +1 -1
  155. package/dist/src/react-native/uninstall.js +37 -80
  156. package/dist/src/react-native/uninstall.js.map +1 -1
  157. package/dist/src/react-native/xcode.js +57 -55
  158. package/dist/src/react-native/xcode.js.map +1 -1
  159. package/dist/src/remix/codemods/express-server.js +27 -82
  160. package/dist/src/remix/codemods/express-server.js.map +1 -1
  161. package/dist/src/remix/codemods/handle-error.js +28 -31
  162. package/dist/src/remix/codemods/handle-error.js.map +1 -1
  163. package/dist/src/remix/codemods/root-common.js +11 -11
  164. package/dist/src/remix/codemods/root-common.js.map +1 -1
  165. package/dist/src/remix/codemods/root-v1.js +17 -67
  166. package/dist/src/remix/codemods/root-v1.js.map +1 -1
  167. package/dist/src/remix/codemods/root-v2.js +89 -140
  168. package/dist/src/remix/codemods/root-v2.js.map +1 -1
  169. package/dist/src/remix/remix-wizard.js +181 -343
  170. package/dist/src/remix/remix-wizard.js.map +1 -1
  171. package/dist/src/remix/sdk-example.js +84 -66
  172. package/dist/src/remix/sdk-example.js.map +1 -1
  173. package/dist/src/remix/sdk-setup.js +161 -293
  174. package/dist/src/remix/sdk-setup.js.map +1 -1
  175. package/dist/src/remix/templates.js +10 -2
  176. package/dist/src/remix/templates.js.map +1 -1
  177. package/dist/src/remix/utils.js +13 -14
  178. package/dist/src/remix/utils.js.map +1 -1
  179. package/dist/src/run.js +106 -178
  180. package/dist/src/run.js.map +1 -1
  181. package/dist/src/sourcemaps/sourcemaps-wizard.js +248 -372
  182. package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
  183. package/dist/src/sourcemaps/tools/angular.js +32 -66
  184. package/dist/src/sourcemaps/tools/angular.js.map +1 -1
  185. package/dist/src/sourcemaps/tools/create-react-app.js +14 -59
  186. package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -1
  187. package/dist/src/sourcemaps/tools/esbuild.js +34 -77
  188. package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
  189. package/dist/src/sourcemaps/tools/nextjs.d.ts +2 -2
  190. package/dist/src/sourcemaps/tools/nextjs.js +75 -102
  191. package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
  192. package/dist/src/sourcemaps/tools/remix.js +53 -93
  193. package/dist/src/sourcemaps/tools/remix.js.map +1 -1
  194. package/dist/src/sourcemaps/tools/rollup.js +35 -76
  195. package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
  196. package/dist/src/sourcemaps/tools/sentry-cli.js +157 -289
  197. package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
  198. package/dist/src/sourcemaps/tools/tsc.js +68 -134
  199. package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
  200. package/dist/src/sourcemaps/tools/vite.js +111 -196
  201. package/dist/src/sourcemaps/tools/vite.js.map +1 -1
  202. package/dist/src/sourcemaps/tools/webpack.d.ts +1 -1
  203. package/dist/src/sourcemaps/tools/webpack.js +158 -260
  204. package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
  205. package/dist/src/sourcemaps/utils/detect-tool.js +9 -54
  206. package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -1
  207. package/dist/src/sourcemaps/utils/other-wizards.js +77 -144
  208. package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -1
  209. package/dist/src/sourcemaps/utils/sdk-version.js +112 -191
  210. package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -1
  211. package/dist/src/sveltekit/sdk-example.js +20 -70
  212. package/dist/src/sveltekit/sdk-example.js.map +1 -1
  213. package/dist/src/sveltekit/sdk-setup.js +250 -411
  214. package/dist/src/sveltekit/sdk-setup.js.map +1 -1
  215. package/dist/src/sveltekit/sveltekit-wizard.js +107 -191
  216. package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
  217. package/dist/src/sveltekit/templates.js +147 -13
  218. package/dist/src/sveltekit/templates.js.map +1 -1
  219. package/dist/src/sveltekit/utils.js +3 -3
  220. package/dist/src/sveltekit/utils.js.map +1 -1
  221. package/dist/src/telemetry.d.ts +2 -2
  222. package/dist/src/telemetry.js +58 -108
  223. package/dist/src/telemetry.js.map +1 -1
  224. package/dist/src/utils/ast-utils.js +39 -54
  225. package/dist/src/utils/ast-utils.js.map +1 -1
  226. package/dist/src/utils/bash.js +28 -75
  227. package/dist/src/utils/bash.js.map +1 -1
  228. package/dist/src/utils/clack-utils.d.ts +3 -7
  229. package/dist/src/utils/clack-utils.js +688 -1083
  230. package/dist/src/utils/clack-utils.js.map +1 -1
  231. package/dist/src/utils/debug.js +6 -10
  232. package/dist/src/utils/debug.js.map +1 -1
  233. package/dist/src/utils/package-json.js +5 -6
  234. package/dist/src/utils/package-json.js.map +1 -1
  235. package/dist/src/utils/package-manager.js +65 -139
  236. package/dist/src/utils/package-manager.js.map +1 -1
  237. package/dist/src/utils/release-registry.js +12 -59
  238. package/dist/src/utils/release-registry.js.map +1 -1
  239. package/dist/src/utils/semver.js +3 -4
  240. package/dist/src/utils/semver.js.map +1 -1
  241. package/dist/src/utils/sentrycli-utils.js +4 -4
  242. package/dist/src/utils/sentrycli-utils.js.map +1 -1
  243. package/dist/src/utils/url.js +5 -6
  244. package/dist/src/utils/url.js.map +1 -1
  245. package/dist/test/android/code-tools.test.js +18 -18
  246. package/dist/test/android/code-tools.test.js.map +1 -1
  247. package/dist/test/apple/cocoapod.test.js +154 -299
  248. package/dist/test/apple/cocoapod.test.js.map +1 -1
  249. package/dist/test/apple/code-tools.test.js +375 -263
  250. package/dist/test/apple/code-tools.test.js.map +1 -1
  251. package/dist/test/apple/fastfile.test.js +319 -271
  252. package/dist/test/apple/fastfile.test.js.map +1 -1
  253. package/dist/test/apple/templates.test.js +114 -30
  254. package/dist/test/apple/templates.test.js.map +1 -1
  255. package/dist/test/apple/xcode-manager.test.js +230 -234
  256. package/dist/test/apple/xcode-manager.test.js.map +1 -1
  257. package/dist/test/flutter/code-tools.test.js +119 -48
  258. package/dist/test/flutter/code-tools.test.js.map +1 -1
  259. package/dist/test/flutter/templates.test.js +63 -20
  260. package/dist/test/flutter/templates.test.js.map +1 -1
  261. package/dist/test/nextjs/templates.test.js +332 -43
  262. package/dist/test/nextjs/templates.test.js.map +1 -1
  263. package/dist/test/nuxt/templates.test.js +161 -33
  264. package/dist/test/nuxt/templates.test.js.map +1 -1
  265. package/dist/test/react-native/expo-metro.test.js +61 -15
  266. package/dist/test/react-native/expo-metro.test.js.map +1 -1
  267. package/dist/test/react-native/expo.test.js +37 -17
  268. package/dist/test/react-native/expo.test.js.map +1 -1
  269. package/dist/test/react-native/gradle.test.js +260 -28
  270. package/dist/test/react-native/gradle.test.js.map +1 -1
  271. package/dist/test/react-native/javascript.test.js +85 -19
  272. package/dist/test/react-native/javascript.test.js.map +1 -1
  273. package/dist/test/react-native/metro.test.js +261 -187
  274. package/dist/test/react-native/metro.test.js.map +1 -1
  275. package/dist/test/react-native/xcode.test.js +243 -62
  276. package/dist/test/react-native/xcode.test.js.map +1 -1
  277. package/dist/test/remix/client-entry.test.js +81 -21
  278. package/dist/test/remix/client-entry.test.js.map +1 -1
  279. package/dist/test/remix/server-instrumentation.test.js +21 -8
  280. package/dist/test/remix/server-instrumentation.test.js.map +1 -1
  281. package/dist/test/sourcemaps/tools/sentry-cli.test.js +20 -72
  282. package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
  283. package/dist/test/sourcemaps/tools/tsc.test.js +142 -68
  284. package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
  285. package/dist/test/sourcemaps/tools/vite.test.js +106 -75
  286. package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
  287. package/dist/test/sourcemaps/tools/webpack.test.js +226 -102
  288. package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
  289. package/dist/test/sveltekit/templates.test.js +117 -18
  290. package/dist/test/sveltekit/templates.test.js.map +1 -1
  291. package/dist/test/utils/ast-utils.test.js +99 -58
  292. package/dist/test/utils/ast-utils.test.js.map +1 -1
  293. package/dist/test/utils/clack-utils.test.js +142 -247
  294. package/dist/test/utils/clack-utils.test.js.map +1 -1
  295. package/e2e-tests/package.json +1 -1
  296. package/e2e-tests/tests/flutter.test.ts +20 -20
  297. package/e2e-tests/tests/nextjs.test.ts +2 -2
  298. package/e2e-tests/tests/nuxt-3.test.ts +4 -4
  299. package/e2e-tests/tests/nuxt-4.test.ts +3 -3
  300. package/e2e-tests/tests/remix.test.ts +3 -3
  301. package/e2e-tests/tests/sveltekit.test.ts +3 -3
  302. package/e2e-tests/utils/index.ts +33 -15
  303. package/lib/Helper/BottomBar.ts +1 -1
  304. package/lib/Helper/Env.ts +1 -1
  305. package/lib/Helper/Package.ts +12 -10
  306. package/lib/Helper/SentryCli.ts +18 -27
  307. package/lib/Helper/Wizard.ts +1 -2
  308. package/lib/Setup.ts +4 -5
  309. package/lib/Steps/ChooseIntegration.ts +40 -8
  310. package/lib/Steps/Initial.ts +17 -26
  311. package/lib/Steps/Integrations/BaseIntegration.ts +2 -8
  312. package/lib/Steps/Integrations/Cordova.ts +9 -15
  313. package/lib/Steps/Integrations/Electron.ts +23 -20
  314. package/lib/Steps/Integrations/MobileProject.ts +18 -15
  315. package/lib/Steps/OpenSentry.ts +12 -7
  316. package/lib/Steps/PromptForParameters.ts +12 -19
  317. package/lib/Steps/SentryProjectSelector.ts +30 -29
  318. package/lib/Steps/WaitForSentry.ts +29 -23
  319. package/package.json +12 -8
  320. package/src/apple/xcode-manager.ts +10 -10
  321. package/src/nextjs/templates.ts +2 -3
  322. package/src/nuxt/sdk-setup.ts +21 -18
  323. package/src/react-native/expo-metro.ts +2 -2
  324. package/src/react-native/react-native-wizard.ts +1 -2
  325. package/src/react-native/uninstall.ts +1 -2
  326. package/src/react-native/xcode.ts +1 -1
  327. package/src/run.ts +12 -5
  328. package/src/sourcemaps/tools/nextjs.ts +2 -2
  329. package/src/sourcemaps/tools/webpack.ts +3 -3
  330. package/src/telemetry.ts +27 -7
  331. package/src/utils/clack-utils.ts +50 -47
  332. package/test/apple/cocoapod.test.ts +4 -0
  333. package/test/apple/fastfile.test.ts +12 -7
  334. package/test/apple/xcode-manager.test.ts +13 -11
  335. package/test/utils/clack-utils.test.ts +40 -50
  336. package/types/read-env.d.ts +3 -0
  337. package/types/xcode.d.ts +1 -0
  338. package/dist/package.json +0 -128
@@ -1,40 +1,83 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var templates_1 = require("../../src/flutter/templates");
4
- describe('Flutter code templates', function () {
5
- describe('pubspec', function () {
6
- it('generates pubspec with project and org', function () {
7
- var template = (0, templates_1.pubspecOptions)('fixture-project', 'fixture-org');
8
- expect(template).toMatchInlineSnapshot("\n \"sentry:\n upload_debug_symbols: true\n upload_source_maps: true\n project: fixture-project\n org: fixture-org\n \"\n ");
3
+ const templates_1 = require("../../src/flutter/templates");
4
+ describe('Flutter code templates', () => {
5
+ describe('pubspec', () => {
6
+ it('generates pubspec with project and org', () => {
7
+ const template = (0, templates_1.pubspecOptions)('fixture-project', 'fixture-org');
8
+ expect(template).toMatchInlineSnapshot(`
9
+ "sentry:
10
+ upload_debug_symbols: true
11
+ upload_source_maps: true
12
+ project: fixture-project
13
+ org: fixture-org
14
+ "
15
+ `);
9
16
  });
10
17
  });
11
- describe('sentry.properties', function () {
12
- it('generates sentry.properties with token', function () {
13
- var template = (0, templates_1.sentryProperties)('fixture-token');
14
- expect(template).toMatchInlineSnapshot("\"auth_token=fixture-token\"");
18
+ describe('sentry.properties', () => {
19
+ it('generates sentry.properties with token', () => {
20
+ const template = (0, templates_1.sentryProperties)('fixture-token');
21
+ expect(template).toMatchInlineSnapshot(`"auth_token=fixture-token"`);
15
22
  });
16
23
  });
17
- describe('init', function () {
18
- it('generates Sentry config with all features enabled', function () {
19
- var template = (0, templates_1.initSnippet)('my-dsn', {
24
+ describe('init', () => {
25
+ it('generates Sentry config with all features enabled', () => {
26
+ const template = (0, templates_1.initSnippet)('my-dsn', {
20
27
  tracing: true,
21
28
  profiling: true,
22
29
  }, 'const MyApp()');
23
- expect(template).toMatchInlineSnapshot("\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n // The sampling rate for profiling is relative to tracesSampleRate\n // Setting to 1.0 will profile 100% of sampled transactions:\n options.profilesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n ");
30
+ expect(template).toMatchInlineSnapshot(`
31
+ "await SentryFlutter.init(
32
+ (options) {
33
+ options.dsn = 'my-dsn';
34
+ // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
35
+ // We recommend adjusting this value in production.
36
+ options.tracesSampleRate = 1.0;
37
+ // The sampling rate for profiling is relative to tracesSampleRate
38
+ // Setting to 1.0 will profile 100% of sampled transactions:
39
+ options.profilesSampleRate = 1.0;
40
+ },
41
+ appRunner: () => runApp(SentryWidget(child: const MyApp())),
42
+ );
43
+ // TODO: Remove this line after sending the first sample event to sentry.
44
+ await Sentry.captureException(Exception('This is a sample exception.'));"
45
+ `);
24
46
  });
25
- it('generates Sentry config with profiling disabled', function () {
26
- var template = (0, templates_1.initSnippet)('my-dsn', {
47
+ it('generates Sentry config with profiling disabled', () => {
48
+ const template = (0, templates_1.initSnippet)('my-dsn', {
27
49
  tracing: true,
28
50
  profiling: false,
29
51
  }, 'const MyApp()');
30
- expect(template).toMatchInlineSnapshot("\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n ");
52
+ expect(template).toMatchInlineSnapshot(`
53
+ "await SentryFlutter.init(
54
+ (options) {
55
+ options.dsn = 'my-dsn';
56
+ // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
57
+ // We recommend adjusting this value in production.
58
+ options.tracesSampleRate = 1.0;
59
+ },
60
+ appRunner: () => runApp(SentryWidget(child: const MyApp())),
61
+ );
62
+ // TODO: Remove this line after sending the first sample event to sentry.
63
+ await Sentry.captureException(Exception('This is a sample exception.'));"
64
+ `);
31
65
  });
32
- it('generates Sentry config with tracing disabled', function () {
33
- var template = (0, templates_1.initSnippet)('my-dsn', {
66
+ it('generates Sentry config with tracing disabled', () => {
67
+ const template = (0, templates_1.initSnippet)('my-dsn', {
34
68
  tracing: false,
35
69
  profiling: false,
36
70
  }, 'const MyApp()');
37
- expect(template).toMatchInlineSnapshot("\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n ");
71
+ expect(template).toMatchInlineSnapshot(`
72
+ "await SentryFlutter.init(
73
+ (options) {
74
+ options.dsn = 'my-dsn';
75
+ },
76
+ appRunner: () => runApp(SentryWidget(child: const MyApp())),
77
+ );
78
+ // TODO: Remove this line after sending the first sample event to sentry.
79
+ await Sentry.captureException(Exception('This is a sample exception.'));"
80
+ `);
38
81
  });
39
82
  });
40
83
  });
@@ -1 +1 @@
1
- {"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/flutter/templates.test.ts"],"names":[],"mappings":";;AAAA,yDAIqC;AAErC,QAAQ,CAAC,wBAAwB,EAAE;IACjC,QAAQ,CAAC,SAAS,EAAE;QAClB,EAAE,CAAC,wCAAwC,EAAE;YAC3C,IAAM,QAAQ,GAAG,IAAA,0BAAc,EAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;YAClE,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,uKAOtC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,mBAAmB,EAAE;QAC5B,EAAE,CAAC,wCAAwC,EAAE;YAC3C,IAAM,QAAQ,GAAG,IAAA,4BAAgB,EAAC,eAAe,CAAC,CAAC;YACnD,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,8BAA4B,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,MAAM,EAAE;QACf,EAAE,CAAC,mDAAmD,EAAE;YACtD,IAAM,QAAQ,GAAG,IAAA,uBAAW,EAC1B,QAAQ,EACR;gBACE,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;aAChB,EACD,eAAe,CAChB,CAAC;YACF,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,kwBAetC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iDAAiD,EAAE;YACpD,IAAM,QAAQ,GAAG,IAAA,uBAAW,EAC1B,QAAQ,EACR;gBACE,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,KAAK;aACjB,EACD,eAAe,CAChB,CAAC;YACF,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,+kBAYtC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+CAA+C,EAAE;YAClD,IAAM,QAAQ,GAAG,IAAA,uBAAW,EAC1B,QAAQ,EACR;gBACE,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,KAAK;aACjB,EACD,eAAe,CAChB,CAAC;YACF,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,kYAStC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {\n pubspecOptions,\n sentryProperties,\n initSnippet,\n} from '../../src/flutter/templates';\n\ndescribe('Flutter code templates', () => {\n describe('pubspec', () => {\n it('generates pubspec with project and org', () => {\n const template = pubspecOptions('fixture-project', 'fixture-org');\n expect(template).toMatchInlineSnapshot(`\n \"sentry:\n upload_debug_symbols: true\n upload_source_maps: true\n project: fixture-project\n org: fixture-org\n \"\n `);\n });\n });\n describe('sentry.properties', () => {\n it('generates sentry.properties with token', () => {\n const template = sentryProperties('fixture-token');\n expect(template).toMatchInlineSnapshot(`\"auth_token=fixture-token\"`);\n });\n });\n describe('init', () => {\n it('generates Sentry config with all features enabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: true,\n profiling: true,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n // The sampling rate for profiling is relative to tracesSampleRate\n // Setting to 1.0 will profile 100% of sampled transactions:\n options.profilesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n\n it('generates Sentry config with profiling disabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: true,\n profiling: false,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n\n it('generates Sentry config with tracing disabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: false,\n profiling: false,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n });\n});\n"]}
1
+ {"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/flutter/templates.test.ts"],"names":[],"mappings":";;AAAA,2DAIqC;AAErC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;QACvB,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;YAChD,MAAM,QAAQ,GAAG,IAAA,0BAAc,EAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;YAClE,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;OAOtC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;QACjC,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;YAChD,MAAM,QAAQ,GAAG,IAAA,4BAAgB,EAAC,eAAe,CAAC,CAAC;YACnD,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,4BAA4B,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,QAAQ,GAAG,IAAA,uBAAW,EAC1B,QAAQ,EACR;gBACE,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;aAChB,EACD,eAAe,CAChB,CAAC;YACF,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;OAetC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;YACzD,MAAM,QAAQ,GAAG,IAAA,uBAAW,EAC1B,QAAQ,EACR;gBACE,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,KAAK;aACjB,EACD,eAAe,CAChB,CAAC;YACF,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;OAYtC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACvD,MAAM,QAAQ,GAAG,IAAA,uBAAW,EAC1B,QAAQ,EACR;gBACE,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,KAAK;aACjB,EACD,eAAe,CAChB,CAAC;YACF,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;OAStC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {\n pubspecOptions,\n sentryProperties,\n initSnippet,\n} from '../../src/flutter/templates';\n\ndescribe('Flutter code templates', () => {\n describe('pubspec', () => {\n it('generates pubspec with project and org', () => {\n const template = pubspecOptions('fixture-project', 'fixture-org');\n expect(template).toMatchInlineSnapshot(`\n \"sentry:\n upload_debug_symbols: true\n upload_source_maps: true\n project: fixture-project\n org: fixture-org\n \"\n `);\n });\n });\n describe('sentry.properties', () => {\n it('generates sentry.properties with token', () => {\n const template = sentryProperties('fixture-token');\n expect(template).toMatchInlineSnapshot(`\"auth_token=fixture-token\"`);\n });\n });\n describe('init', () => {\n it('generates Sentry config with all features enabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: true,\n profiling: true,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n // The sampling rate for profiling is relative to tracesSampleRate\n // Setting to 1.0 will profile 100% of sampled transactions:\n options.profilesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n\n it('generates Sentry config with profiling disabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: true,\n profiling: false,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n\n it('generates Sentry config with tracing disabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: false,\n profiling: false,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n });\n});\n"]}
@@ -1,74 +1,229 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var templates_1 = require("../../src/nextjs/templates");
4
- describe('Next.js code templates', function () {
5
- describe('getSentryConfigContents', function () {
6
- describe('client-side', function () {
7
- it('generates client-side Sentry config with all features enabled', function () {
8
- var template = (0, templates_1.getSentryConfigContents)('my-dsn', 'client', {
3
+ const templates_1 = require("../../src/nextjs/templates");
4
+ describe('Next.js code templates', () => {
5
+ describe('getSentryConfigContents', () => {
6
+ describe('client-side', () => {
7
+ it('generates client-side Sentry config with all features enabled', () => {
8
+ const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'client', {
9
9
  performance: true,
10
10
  replay: true,
11
11
  });
12
- expect(template).toMatchInlineSnapshot("\n \"// This file configures the initialization of Sentry on the client.\n // The config you add here will be used whenever a users loads a page in their browser.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Add optional integrations for additional features\n integrations: [\n Sentry.replayIntegration(),\n ],\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\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 // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n ");
12
+ expect(template).toMatchInlineSnapshot(`
13
+ "// This file configures the initialization of Sentry on the client.
14
+ // The config you add here will be used whenever a users loads a page in their browser.
15
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/
16
+
17
+ import * as Sentry from "@sentry/nextjs";
18
+
19
+ Sentry.init({
20
+ dsn: "my-dsn",
21
+
22
+ // Add optional integrations for additional features
23
+ integrations: [
24
+ Sentry.replayIntegration(),
25
+ ],
26
+
27
+ // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
28
+ tracesSampleRate: 1,
29
+
30
+ // Define how likely Replay events are sampled.
31
+ // This sets the sample rate to be 10%. You may want this to be 100% while
32
+ // in development and sample at a lower rate in production
33
+ replaysSessionSampleRate: 0.1,
34
+
35
+ // Define how likely Replay events are sampled when an error occurs.
36
+ replaysOnErrorSampleRate: 1.0,
37
+
38
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
39
+ debug: false,
40
+ });
41
+ "
42
+ `);
13
43
  });
14
- it('generates client-side Sentry config with performance monitoring disabled', function () {
15
- var template = (0, templates_1.getSentryConfigContents)('my-dsn', 'client', {
44
+ it('generates client-side Sentry config with performance monitoring disabled', () => {
45
+ const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'client', {
16
46
  performance: false,
17
47
  replay: true,
18
48
  });
19
- expect(template).toMatchInlineSnapshot("\n \"// This file configures the initialization of Sentry on the client.\n // The config you add here will be used whenever a users loads a page in their browser.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Add optional integrations for additional features\n integrations: [\n Sentry.replayIntegration(),\n ],\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 // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n ");
49
+ expect(template).toMatchInlineSnapshot(`
50
+ "// This file configures the initialization of Sentry on the client.
51
+ // The config you add here will be used whenever a users loads a page in their browser.
52
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/
53
+
54
+ import * as Sentry from "@sentry/nextjs";
55
+
56
+ Sentry.init({
57
+ dsn: "my-dsn",
58
+
59
+ // Add optional integrations for additional features
60
+ integrations: [
61
+ Sentry.replayIntegration(),
62
+ ],
63
+
64
+ // Define how likely Replay events are sampled.
65
+ // This sets the sample rate to be 10%. You may want this to be 100% while
66
+ // in development and sample at a lower rate in production
67
+ replaysSessionSampleRate: 0.1,
68
+
69
+ // Define how likely Replay events are sampled when an error occurs.
70
+ replaysOnErrorSampleRate: 1.0,
71
+
72
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
73
+ debug: false,
74
+ });
75
+ "
76
+ `);
20
77
  });
21
- it('generates client-side Sentry config with session replay disabled', function () {
22
- var template = (0, templates_1.getSentryConfigContents)('my-dsn', 'client', {
78
+ it('generates client-side Sentry config with session replay disabled', () => {
79
+ const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'client', {
23
80
  performance: true,
24
81
  replay: false,
25
82
  });
26
- expect(template).toMatchInlineSnapshot("\n \"// This file configures the initialization of Sentry on the client.\n // The config you add here will be used whenever a users loads a page in their browser.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\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 ");
83
+ expect(template).toMatchInlineSnapshot(`
84
+ "// This file configures the initialization of Sentry on the client.
85
+ // The config you add here will be used whenever a users loads a page in their browser.
86
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/
87
+
88
+ import * as Sentry from "@sentry/nextjs";
89
+
90
+ Sentry.init({
91
+ dsn: "my-dsn",
92
+
93
+ // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
94
+ tracesSampleRate: 1,
95
+
96
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
97
+ debug: false,
98
+ });
99
+ "
100
+ `);
27
101
  });
28
102
  });
29
- describe('server-side', function () {
30
- it('generates server-side Sentry config with all features enabled', function () {
31
- var template = (0, templates_1.getSentryConfigContents)('my-dsn', 'server', {
103
+ describe('server-side', () => {
104
+ it('generates server-side Sentry config with all features enabled', () => {
105
+ const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'server', {
32
106
  performance: true,
33
107
  replay: true,
34
108
  });
35
- expect(template).toMatchInlineSnapshot("\n \"// 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\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\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 ");
109
+ expect(template).toMatchInlineSnapshot(`
110
+ "// This file configures the initialization of Sentry on the server.
111
+ // The config you add here will be used whenever the server handles a request.
112
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/
113
+
114
+ import * as Sentry from "@sentry/nextjs";
115
+
116
+ Sentry.init({
117
+ dsn: "my-dsn",
118
+
119
+ // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
120
+ tracesSampleRate: 1,
121
+
122
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
123
+ debug: false,
124
+ });
125
+ "
126
+ `);
36
127
  });
37
- it('generates server-side Sentry config with performance monitoring disabled', function () {
38
- var template = (0, templates_1.getSentryConfigContents)('my-dsn', 'server', {
128
+ it('generates server-side Sentry config with performance monitoring disabled', () => {
129
+ const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'server', {
39
130
  performance: false,
40
131
  replay: true,
41
132
  });
42
- expect(template).toMatchInlineSnapshot("\n \"// 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\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\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 ");
133
+ expect(template).toMatchInlineSnapshot(`
134
+ "// This file configures the initialization of Sentry on the server.
135
+ // The config you add here will be used whenever the server handles a request.
136
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/
137
+
138
+ import * as Sentry from "@sentry/nextjs";
139
+
140
+ Sentry.init({
141
+ dsn: "my-dsn",
142
+
143
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
144
+ debug: false,
145
+ });
146
+ "
147
+ `);
43
148
  });
44
- it('generates server-side Sentry config with spotlight disabled', function () {
45
- var template = (0, templates_1.getSentryConfigContents)('my-dsn', 'server', {
149
+ it('generates server-side Sentry config with spotlight disabled', () => {
150
+ const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'server', {
46
151
  performance: true,
47
152
  replay: true,
48
153
  });
49
- expect(template).toMatchInlineSnapshot("\n \"// 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\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\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 ");
154
+ expect(template).toMatchInlineSnapshot(`
155
+ "// This file configures the initialization of Sentry on the server.
156
+ // The config you add here will be used whenever the server handles a request.
157
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/
158
+
159
+ import * as Sentry from "@sentry/nextjs";
160
+
161
+ Sentry.init({
162
+ dsn: "my-dsn",
163
+
164
+ // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
165
+ tracesSampleRate: 1,
166
+
167
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
168
+ debug: false,
169
+ });
170
+ "
171
+ `);
50
172
  });
51
173
  });
52
- describe('edge', function () {
53
- it('generates edge Sentry config with all features enabled', function () {
54
- var template = (0, templates_1.getSentryConfigContents)('my-dsn', 'edge', {
174
+ describe('edge', () => {
175
+ it('generates edge Sentry config with all features enabled', () => {
176
+ const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'edge', {
55
177
  performance: true,
56
178
  replay: true,
57
179
  });
58
- expect(template).toMatchInlineSnapshot("\n \"// 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 import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\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 ");
180
+ expect(template).toMatchInlineSnapshot(`
181
+ "// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).
182
+ // The config you add here will be used whenever one of the edge features is loaded.
183
+ // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.
184
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/
185
+
186
+ import * as Sentry from "@sentry/nextjs";
187
+
188
+ Sentry.init({
189
+ dsn: "my-dsn",
190
+
191
+ // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
192
+ tracesSampleRate: 1,
193
+
194
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
195
+ debug: false,
196
+ });
197
+ "
198
+ `);
59
199
  });
60
- it('generates edge Sentry config with performance monitoring disabled', function () {
61
- var template = (0, templates_1.getSentryConfigContents)('my-dsn', 'edge', {
200
+ it('generates edge Sentry config with performance monitoring disabled', () => {
201
+ const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'edge', {
62
202
  performance: false,
63
203
  replay: true,
64
204
  });
65
- expect(template).toMatchInlineSnapshot("\n \"// 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 import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\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 ");
205
+ expect(template).toMatchInlineSnapshot(`
206
+ "// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).
207
+ // The config you add here will be used whenever one of the edge features is loaded.
208
+ // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.
209
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/
210
+
211
+ import * as Sentry from "@sentry/nextjs";
212
+
213
+ Sentry.init({
214
+ dsn: "my-dsn",
215
+
216
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
217
+ debug: false,
218
+ });
219
+ "
220
+ `);
66
221
  });
67
222
  });
68
223
  });
69
- describe('getWithSentryConfigOptionsTemplate', function () {
70
- it('generates options for SaaS', function () {
71
- var template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
224
+ describe('getWithSentryConfigOptionsTemplate', () => {
225
+ it('generates options for SaaS', () => {
226
+ const template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
72
227
  orgSlug: 'my-org',
73
228
  projectSlug: 'my-project',
74
229
  selfHosted: false,
@@ -76,10 +231,42 @@ describe('Next.js code templates', function () {
76
231
  tunnelRoute: true,
77
232
  reactComponentAnnotation: false,
78
233
  });
79
- expect(template).toMatchInlineSnapshot("\n \"{\n // For all available options, see:\n // https://github.com/getsentry/sentry-webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\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 // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n 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 ");
234
+ expect(template).toMatchInlineSnapshot(`
235
+ "{
236
+ // For all available options, see:
237
+ // https://github.com/getsentry/sentry-webpack-plugin#options
238
+
239
+ org: "my-org",
240
+ project: "my-project",
241
+
242
+ // Only print logs for uploading source maps in CI
243
+ silent: !process.env.CI,
244
+
245
+ // For all available options, see:
246
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
247
+
248
+ // Upload a larger set of source maps for prettier stack traces (increases build time)
249
+ widenClientFileUpload: true,
250
+
251
+ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
252
+ // This can increase your server load as well as your hosting bill.
253
+ // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
254
+ // side errors will fail.
255
+ tunnelRoute: "/monitoring",
256
+
257
+ // Automatically tree-shake Sentry logger statements to reduce bundle size
258
+ disableLogger: true,
259
+
260
+ // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
261
+ // See the following for more information:
262
+ // https://docs.sentry.io/product/crons/
263
+ // https://vercel.com/docs/cron-jobs
264
+ automaticVercelMonitors: true,
265
+ }"
266
+ `);
80
267
  });
81
- it('generates options for self-hosted', function () {
82
- var template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
268
+ it('generates options for self-hosted', () => {
269
+ const template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
83
270
  orgSlug: 'my-org',
84
271
  projectSlug: 'my-project',
85
272
  selfHosted: true,
@@ -87,10 +274,43 @@ describe('Next.js code templates', function () {
87
274
  tunnelRoute: true,
88
275
  reactComponentAnnotation: false,
89
276
  });
90
- expect(template).toMatchInlineSnapshot("\n \"{\n // For all available options, see:\n // https://github.com/getsentry/sentry-webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\n sentryUrl: \"https://my-sentry.com\",\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 // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n 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 ");
277
+ expect(template).toMatchInlineSnapshot(`
278
+ "{
279
+ // For all available options, see:
280
+ // https://github.com/getsentry/sentry-webpack-plugin#options
281
+
282
+ org: "my-org",
283
+ project: "my-project",
284
+ sentryUrl: "https://my-sentry.com",
285
+
286
+ // Only print logs for uploading source maps in CI
287
+ silent: !process.env.CI,
288
+
289
+ // For all available options, see:
290
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
291
+
292
+ // Upload a larger set of source maps for prettier stack traces (increases build time)
293
+ widenClientFileUpload: true,
294
+
295
+ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
296
+ // This can increase your server load as well as your hosting bill.
297
+ // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
298
+ // side errors will fail.
299
+ tunnelRoute: "/monitoring",
300
+
301
+ // Automatically tree-shake Sentry logger statements to reduce bundle size
302
+ disableLogger: true,
303
+
304
+ // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
305
+ // See the following for more information:
306
+ // https://docs.sentry.io/product/crons/
307
+ // https://vercel.com/docs/cron-jobs
308
+ automaticVercelMonitors: true,
309
+ }"
310
+ `);
91
311
  });
92
- it('comments out tunnelRoute if `tunnelRoute` option is disabled', function () {
93
- var template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
312
+ it('comments out tunnelRoute if `tunnelRoute` option is disabled', () => {
313
+ const template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
94
314
  orgSlug: 'my-org',
95
315
  projectSlug: 'my-project',
96
316
  selfHosted: false,
@@ -98,10 +318,42 @@ describe('Next.js code templates', function () {
98
318
  tunnelRoute: false,
99
319
  reactComponentAnnotation: false,
100
320
  });
101
- expect(template).toMatchInlineSnapshot("\n \"{\n // For all available options, see:\n // https://github.com/getsentry/sentry-webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\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 // Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n // 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 ");
321
+ expect(template).toMatchInlineSnapshot(`
322
+ "{
323
+ // For all available options, see:
324
+ // https://github.com/getsentry/sentry-webpack-plugin#options
325
+
326
+ org: "my-org",
327
+ project: "my-project",
328
+
329
+ // Only print logs for uploading source maps in CI
330
+ silent: !process.env.CI,
331
+
332
+ // For all available options, see:
333
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
334
+
335
+ // Upload a larger set of source maps for prettier stack traces (increases build time)
336
+ widenClientFileUpload: true,
337
+
338
+ // Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
339
+ // This can increase your server load as well as your hosting bill.
340
+ // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
341
+ // side errors will fail.
342
+ // tunnelRoute: "/monitoring",
343
+
344
+ // Automatically tree-shake Sentry logger statements to reduce bundle size
345
+ disableLogger: true,
346
+
347
+ // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
348
+ // See the following for more information:
349
+ // https://docs.sentry.io/product/crons/
350
+ // https://vercel.com/docs/cron-jobs
351
+ automaticVercelMonitors: true,
352
+ }"
353
+ `);
102
354
  });
103
- it('adds `reactComponentAnnotations` option if `reactComponentAnnotations` is enabled', function () {
104
- var template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
355
+ it('adds `reactComponentAnnotations` option if `reactComponentAnnotations` is enabled', () => {
356
+ const template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
105
357
  orgSlug: 'my-org',
106
358
  projectSlug: 'my-project',
107
359
  selfHosted: false,
@@ -109,7 +361,44 @@ describe('Next.js code templates', function () {
109
361
  tunnelRoute: true,
110
362
  reactComponentAnnotation: true,
111
363
  });
112
- expect(template).toMatchInlineSnapshot("\n \"{\n // For all available options, see:\n // https://github.com/getsentry/sentry-webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\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 // Automatically annotate React components to show their full name in breadcrumbs and session replay\n reactComponentAnnotation: {\n enabled: true,\n },\n\n // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n 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 ");
364
+ expect(template).toMatchInlineSnapshot(`
365
+ "{
366
+ // For all available options, see:
367
+ // https://github.com/getsentry/sentry-webpack-plugin#options
368
+
369
+ org: "my-org",
370
+ project: "my-project",
371
+
372
+ // Only print logs for uploading source maps in CI
373
+ silent: !process.env.CI,
374
+
375
+ // For all available options, see:
376
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
377
+
378
+ // Upload a larger set of source maps for prettier stack traces (increases build time)
379
+ widenClientFileUpload: true,
380
+
381
+ // Automatically annotate React components to show their full name in breadcrumbs and session replay
382
+ reactComponentAnnotation: {
383
+ enabled: true,
384
+ },
385
+
386
+ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
387
+ // This can increase your server load as well as your hosting bill.
388
+ // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
389
+ // side errors will fail.
390
+ tunnelRoute: "/monitoring",
391
+
392
+ // Automatically tree-shake Sentry logger statements to reduce bundle size
393
+ disableLogger: true,
394
+
395
+ // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
396
+ // See the following for more information:
397
+ // https://docs.sentry.io/product/crons/
398
+ // https://vercel.com/docs/cron-jobs
399
+ automaticVercelMonitors: true,
400
+ }"
401
+ `);
113
402
  });
114
403
  });
115
404
  });