@sentry/wizard 3.42.1 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (585) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/bin.js +44 -35
  3. package/dist/bin.js.map +1 -1
  4. package/dist/e2e-tests/jest.config.js +1 -1
  5. package/dist/e2e-tests/jest.config.js.map +1 -1
  6. package/dist/e2e-tests/tests/flutter.test.js +62 -147
  7. package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
  8. package/dist/e2e-tests/tests/nextjs.test.js +77 -175
  9. package/dist/e2e-tests/tests/nextjs.test.js.map +1 -1
  10. package/dist/e2e-tests/tests/nuxt-3.test.js +61 -162
  11. package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
  12. package/dist/e2e-tests/tests/nuxt-4.test.js +62 -163
  13. package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
  14. package/dist/e2e-tests/tests/remix.test.js +147 -189
  15. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  16. package/dist/e2e-tests/tests/sveltekit.test.js +133 -187
  17. package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
  18. package/dist/e2e-tests/utils/index.d.ts +1 -1
  19. package/dist/e2e-tests/utils/index.js +113 -195
  20. package/dist/e2e-tests/utils/index.js.map +1 -1
  21. package/dist/lib/Constants.js +5 -5
  22. package/dist/lib/Constants.js.map +1 -1
  23. package/dist/lib/Helper/BottomBar.d.ts +1 -1
  24. package/dist/lib/Helper/BottomBar.js +14 -15
  25. package/dist/lib/Helper/BottomBar.js.map +1 -1
  26. package/dist/lib/Helper/Env.js +5 -2
  27. package/dist/lib/Helper/Env.js.map +1 -1
  28. package/dist/lib/Helper/File.js +14 -27
  29. package/dist/lib/Helper/File.js.map +1 -1
  30. package/dist/lib/Helper/Git.js +24 -59
  31. package/dist/lib/Helper/Git.js.map +1 -1
  32. package/dist/lib/Helper/Logging.js +2 -2
  33. package/dist/lib/Helper/Logging.js.map +1 -1
  34. package/dist/lib/Helper/MergeConfig.js +4 -4
  35. package/dist/lib/Helper/MergeConfig.js.map +1 -1
  36. package/dist/lib/Helper/Package.d.ts +4 -1
  37. package/dist/lib/Helper/Package.js +12 -38
  38. package/dist/lib/Helper/Package.js.map +1 -1
  39. package/dist/lib/Helper/SentryCli.js +77 -149
  40. package/dist/lib/Helper/SentryCli.js.map +1 -1
  41. package/dist/lib/Helper/Wizard.js +29 -124
  42. package/dist/lib/Helper/Wizard.js.map +1 -1
  43. package/dist/lib/Helper/__tests__/File.js +4 -4
  44. package/dist/lib/Helper/__tests__/File.js.map +1 -1
  45. package/dist/lib/Helper/__tests__/MergeConfig.js +24 -24
  46. package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
  47. package/dist/lib/Helper/__tests__/SentryCli.js +33 -23
  48. package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
  49. package/dist/lib/Setup.js +23 -85
  50. package/dist/lib/Setup.js.map +1 -1
  51. package/dist/lib/Steps/BaseStep.js +8 -8
  52. package/dist/lib/Steps/BaseStep.js.map +1 -1
  53. package/dist/lib/Steps/ChooseIntegration.js +80 -125
  54. package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
  55. package/dist/lib/Steps/ConfigureProject.js +6 -66
  56. package/dist/lib/Steps/ConfigureProject.js.map +1 -1
  57. package/dist/lib/Steps/Initial.js +16 -104
  58. package/dist/lib/Steps/Initial.js.map +1 -1
  59. package/dist/lib/Steps/Integrations/BaseIntegration.js +24 -118
  60. package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
  61. package/dist/lib/Steps/Integrations/Cordova.js +95 -183
  62. package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
  63. package/dist/lib/Steps/Integrations/Electron.js +87 -145
  64. package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
  65. package/dist/lib/Steps/Integrations/MobileProject.js +40 -148
  66. package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
  67. package/dist/lib/Steps/OpenSentry.js +63 -126
  68. package/dist/lib/Steps/OpenSentry.js.map +1 -1
  69. package/dist/lib/Steps/PromptForParameters.js +110 -206
  70. package/dist/lib/Steps/PromptForParameters.js.map +1 -1
  71. package/dist/lib/Steps/Result.js +19 -79
  72. package/dist/lib/Steps/Result.js.map +1 -1
  73. package/dist/lib/Steps/SentryProjectSelector.js +57 -148
  74. package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
  75. package/dist/lib/Steps/ShouldConfigure.js +6 -66
  76. package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
  77. package/dist/lib/Steps/WaitForSentry.js +43 -120
  78. package/dist/lib/Steps/WaitForSentry.js.map +1 -1
  79. package/dist/lib/Steps/Welcome.js +17 -76
  80. package/dist/lib/Steps/Welcome.js.map +1 -1
  81. package/dist/lib/__tests__/Env.js +3 -3
  82. package/dist/lib/__tests__/Env.js.map +1 -1
  83. package/dist/src/android/android-wizard.js +100 -176
  84. package/dist/src/android/android-wizard.js.map +1 -1
  85. package/dist/src/android/code-tools.js +24 -33
  86. package/dist/src/android/code-tools.js.map +1 -1
  87. package/dist/src/android/gradle.js +106 -165
  88. package/dist/src/android/gradle.js.map +1 -1
  89. package/dist/src/android/manifest.js +26 -27
  90. package/dist/src/android/manifest.js.map +1 -1
  91. package/dist/src/android/templates.js +76 -23
  92. package/dist/src/android/templates.js.map +1 -1
  93. package/dist/src/apple/apple-wizard.js +129 -225
  94. package/dist/src/apple/apple-wizard.js.map +1 -1
  95. package/dist/src/apple/cocoapod.js +47 -109
  96. package/dist/src/apple/cocoapod.js.map +1 -1
  97. package/dist/src/apple/code-tools.js +32 -35
  98. package/dist/src/apple/code-tools.js.map +1 -1
  99. package/dist/src/apple/fastlane.js +51 -97
  100. package/dist/src/apple/fastlane.js.map +1 -1
  101. package/dist/src/apple/templates.js +41 -5
  102. package/dist/src/apple/templates.js.map +1 -1
  103. package/dist/src/apple/xcode-manager.d.ts +2 -2
  104. package/dist/src/apple/xcode-manager.js +93 -108
  105. package/dist/src/apple/xcode-manager.js.map +1 -1
  106. package/dist/src/flutter/code-tools.js +79 -127
  107. package/dist/src/flutter/code-tools.js.map +1 -1
  108. package/dist/src/flutter/flutter-wizard.js +75 -136
  109. package/dist/src/flutter/flutter-wizard.js.map +1 -1
  110. package/dist/src/flutter/templates.js +48 -12
  111. package/dist/src/flutter/templates.js.map +1 -1
  112. package/dist/src/nextjs/nextjs-wizard.js +527 -805
  113. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  114. package/dist/src/nextjs/templates.js +380 -40
  115. package/dist/src/nextjs/templates.js.map +1 -1
  116. package/dist/src/nextjs/utils.js +5 -5
  117. package/dist/src/nextjs/utils.js.map +1 -1
  118. package/dist/src/nuxt/nuxt-wizard.js +91 -188
  119. package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
  120. package/dist/src/nuxt/sdk-example.js +68 -137
  121. package/dist/src/nuxt/sdk-example.js.map +1 -1
  122. package/dist/src/nuxt/sdk-setup.d.ts +4 -4
  123. package/dist/src/nuxt/sdk-setup.js +180 -336
  124. package/dist/src/nuxt/sdk-setup.js.map +1 -1
  125. package/dist/src/nuxt/templates.js +195 -18
  126. package/dist/src/nuxt/templates.js.map +1 -1
  127. package/dist/src/nuxt/utils.js +29 -76
  128. package/dist/src/nuxt/utils.js.map +1 -1
  129. package/dist/src/react-native/expo-env-file.js +41 -94
  130. package/dist/src/react-native/expo-env-file.js.map +1 -1
  131. package/dist/src/react-native/expo-metro.d.ts +1 -1
  132. package/dist/src/react-native/expo-metro.js +75 -130
  133. package/dist/src/react-native/expo-metro.js.map +1 -1
  134. package/dist/src/react-native/expo.js +61 -114
  135. package/dist/src/react-native/expo.js.map +1 -1
  136. package/dist/src/react-native/git.js +23 -56
  137. package/dist/src/react-native/git.js.map +1 -1
  138. package/dist/src/react-native/glob.js +3 -3
  139. package/dist/src/react-native/glob.js.map +1 -1
  140. package/dist/src/react-native/gradle.js +4 -4
  141. package/dist/src/react-native/gradle.js.map +1 -1
  142. package/dist/src/react-native/javascript.js +51 -95
  143. package/dist/src/react-native/javascript.js.map +1 -1
  144. package/dist/src/react-native/metro.js +176 -296
  145. package/dist/src/react-native/metro.js.map +1 -1
  146. package/dist/src/react-native/react-native-wizard.js +267 -418
  147. package/dist/src/react-native/react-native-wizard.js.map +1 -1
  148. package/dist/src/react-native/uninstall.js +37 -80
  149. package/dist/src/react-native/uninstall.js.map +1 -1
  150. package/dist/src/react-native/xcode.js +57 -55
  151. package/dist/src/react-native/xcode.js.map +1 -1
  152. package/dist/src/remix/codemods/express-server.js +27 -82
  153. package/dist/src/remix/codemods/express-server.js.map +1 -1
  154. package/dist/src/remix/codemods/handle-error.js +28 -31
  155. package/dist/src/remix/codemods/handle-error.js.map +1 -1
  156. package/dist/src/remix/codemods/root-common.js +11 -11
  157. package/dist/src/remix/codemods/root-common.js.map +1 -1
  158. package/dist/src/remix/codemods/root-v1.js +17 -67
  159. package/dist/src/remix/codemods/root-v1.js.map +1 -1
  160. package/dist/src/remix/codemods/root-v2.js +89 -140
  161. package/dist/src/remix/codemods/root-v2.js.map +1 -1
  162. package/dist/src/remix/remix-wizard.js +181 -343
  163. package/dist/src/remix/remix-wizard.js.map +1 -1
  164. package/dist/src/remix/sdk-example.js +84 -66
  165. package/dist/src/remix/sdk-example.js.map +1 -1
  166. package/dist/src/remix/sdk-setup.js +161 -293
  167. package/dist/src/remix/sdk-setup.js.map +1 -1
  168. package/dist/src/remix/templates.js +10 -2
  169. package/dist/src/remix/templates.js.map +1 -1
  170. package/dist/src/remix/utils.js +13 -14
  171. package/dist/src/remix/utils.js.map +1 -1
  172. package/dist/src/run.js +106 -178
  173. package/dist/src/run.js.map +1 -1
  174. package/dist/src/sourcemaps/sourcemaps-wizard.js +248 -372
  175. package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
  176. package/dist/src/sourcemaps/tools/angular.js +32 -66
  177. package/dist/src/sourcemaps/tools/angular.js.map +1 -1
  178. package/dist/src/sourcemaps/tools/create-react-app.js +14 -59
  179. package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -1
  180. package/dist/src/sourcemaps/tools/esbuild.js +34 -77
  181. package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
  182. package/dist/src/sourcemaps/tools/nextjs.d.ts +2 -2
  183. package/dist/src/sourcemaps/tools/nextjs.js +75 -102
  184. package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
  185. package/dist/src/sourcemaps/tools/remix.js +53 -93
  186. package/dist/src/sourcemaps/tools/remix.js.map +1 -1
  187. package/dist/src/sourcemaps/tools/rollup.js +35 -76
  188. package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
  189. package/dist/src/sourcemaps/tools/sentry-cli.js +157 -289
  190. package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
  191. package/dist/src/sourcemaps/tools/tsc.js +68 -134
  192. package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
  193. package/dist/src/sourcemaps/tools/vite.js +111 -196
  194. package/dist/src/sourcemaps/tools/vite.js.map +1 -1
  195. package/dist/src/sourcemaps/tools/webpack.d.ts +1 -1
  196. package/dist/src/sourcemaps/tools/webpack.js +158 -260
  197. package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
  198. package/dist/src/sourcemaps/utils/detect-tool.js +9 -54
  199. package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -1
  200. package/dist/src/sourcemaps/utils/other-wizards.js +77 -144
  201. package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -1
  202. package/dist/src/sourcemaps/utils/sdk-version.js +112 -191
  203. package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -1
  204. package/dist/src/sveltekit/sdk-example.js +20 -70
  205. package/dist/src/sveltekit/sdk-example.js.map +1 -1
  206. package/dist/src/sveltekit/sdk-setup.js +250 -411
  207. package/dist/src/sveltekit/sdk-setup.js.map +1 -1
  208. package/dist/src/sveltekit/sveltekit-wizard.js +107 -191
  209. package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
  210. package/dist/src/sveltekit/templates.js +147 -13
  211. package/dist/src/sveltekit/templates.js.map +1 -1
  212. package/dist/src/sveltekit/utils.js +3 -3
  213. package/dist/src/sveltekit/utils.js.map +1 -1
  214. package/dist/src/telemetry.d.ts +2 -2
  215. package/dist/src/telemetry.js +58 -108
  216. package/dist/src/telemetry.js.map +1 -1
  217. package/dist/src/utils/ast-utils.js +39 -54
  218. package/dist/src/utils/ast-utils.js.map +1 -1
  219. package/dist/src/utils/bash.js +28 -75
  220. package/dist/src/utils/bash.js.map +1 -1
  221. package/dist/src/utils/clack-utils.d.ts +3 -7
  222. package/dist/src/utils/clack-utils.js +688 -1083
  223. package/dist/src/utils/clack-utils.js.map +1 -1
  224. package/dist/src/utils/debug.js +6 -10
  225. package/dist/src/utils/debug.js.map +1 -1
  226. package/dist/src/utils/package-json.js +5 -6
  227. package/dist/src/utils/package-json.js.map +1 -1
  228. package/dist/src/utils/package-manager.js +65 -139
  229. package/dist/src/utils/package-manager.js.map +1 -1
  230. package/dist/src/utils/release-registry.js +12 -59
  231. package/dist/src/utils/release-registry.js.map +1 -1
  232. package/dist/src/utils/semver.js +3 -4
  233. package/dist/src/utils/semver.js.map +1 -1
  234. package/dist/src/utils/sentrycli-utils.js +4 -4
  235. package/dist/src/utils/sentrycli-utils.js.map +1 -1
  236. package/dist/src/utils/url.js +5 -6
  237. package/dist/src/utils/url.js.map +1 -1
  238. package/dist/test/android/code-tools.test.js +18 -18
  239. package/dist/test/android/code-tools.test.js.map +1 -1
  240. package/dist/test/apple/cocoapod.test.js +154 -299
  241. package/dist/test/apple/cocoapod.test.js.map +1 -1
  242. package/dist/test/apple/code-tools.test.js +375 -263
  243. package/dist/test/apple/code-tools.test.js.map +1 -1
  244. package/dist/test/apple/fastfile.test.js +319 -271
  245. package/dist/test/apple/fastfile.test.js.map +1 -1
  246. package/dist/test/apple/templates.test.js +114 -30
  247. package/dist/test/apple/templates.test.js.map +1 -1
  248. package/dist/test/apple/xcode-manager.test.js +230 -234
  249. package/dist/test/apple/xcode-manager.test.js.map +1 -1
  250. package/dist/test/flutter/code-tools.test.js +119 -48
  251. package/dist/test/flutter/code-tools.test.js.map +1 -1
  252. package/dist/test/flutter/templates.test.js +63 -20
  253. package/dist/test/flutter/templates.test.js.map +1 -1
  254. package/dist/test/nextjs/templates.test.js +332 -43
  255. package/dist/test/nextjs/templates.test.js.map +1 -1
  256. package/dist/test/nuxt/templates.test.js +161 -33
  257. package/dist/test/nuxt/templates.test.js.map +1 -1
  258. package/dist/test/react-native/expo-metro.test.js +61 -15
  259. package/dist/test/react-native/expo-metro.test.js.map +1 -1
  260. package/dist/test/react-native/expo.test.js +37 -17
  261. package/dist/test/react-native/expo.test.js.map +1 -1
  262. package/dist/test/react-native/gradle.test.js +260 -28
  263. package/dist/test/react-native/gradle.test.js.map +1 -1
  264. package/dist/test/react-native/javascript.test.js +85 -19
  265. package/dist/test/react-native/javascript.test.js.map +1 -1
  266. package/dist/test/react-native/metro.test.js +261 -187
  267. package/dist/test/react-native/metro.test.js.map +1 -1
  268. package/dist/test/react-native/xcode.test.js +243 -62
  269. package/dist/test/react-native/xcode.test.js.map +1 -1
  270. package/dist/test/remix/client-entry.test.js +81 -21
  271. package/dist/test/remix/client-entry.test.js.map +1 -1
  272. package/dist/test/remix/server-instrumentation.test.js +21 -8
  273. package/dist/test/remix/server-instrumentation.test.js.map +1 -1
  274. package/dist/test/sourcemaps/tools/sentry-cli.test.js +20 -72
  275. package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
  276. package/dist/test/sourcemaps/tools/tsc.test.js +142 -68
  277. package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
  278. package/dist/test/sourcemaps/tools/vite.test.js +106 -75
  279. package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
  280. package/dist/test/sourcemaps/tools/webpack.test.js +226 -102
  281. package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
  282. package/dist/test/sveltekit/templates.test.js +117 -18
  283. package/dist/test/sveltekit/templates.test.js.map +1 -1
  284. package/dist/test/utils/ast-utils.test.js +99 -58
  285. package/dist/test/utils/ast-utils.test.js.map +1 -1
  286. package/dist/test/utils/clack-utils.test.js +142 -247
  287. package/dist/test/utils/clack-utils.test.js.map +1 -1
  288. package/package.json +16 -9
  289. package/bin.ts +0 -138
  290. package/codecov.yml +0 -15
  291. package/dist/package.json +0 -128
  292. package/e2e-tests/.env.example +0 -11
  293. package/e2e-tests/README.md +0 -63
  294. package/e2e-tests/jest.config.ts +0 -22
  295. package/e2e-tests/package.json +0 -14
  296. package/e2e-tests/run.sh +0 -15
  297. package/e2e-tests/test-applications/apple/damaged-missing-configuration-list/Project.xcodeproj/project.pbxproj +0 -52
  298. package/e2e-tests/test-applications/apple/damaged-missing-configuration-list/Project.xcodeproj/xcshareddata/xcschemes/Project1.xcscheme +0 -78
  299. package/e2e-tests/test-applications/apple/no-targets/Project.xcodeproj/project.pbxproj +0 -62
  300. package/e2e-tests/test-applications/apple/no-targets/Project.xcodeproj/xcshareddata/xcschemes/Project1.xcscheme +0 -78
  301. package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project.xcodeproj/project.pbxproj +0 -470
  302. package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project.xcodeproj/xcshareddata/xcschemes/Project1.xcscheme +0 -78
  303. package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project1/ContentView.swift +0 -7
  304. package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project1/Project1App.swift +0 -10
  305. package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project2/ContentView.swift +0 -7
  306. package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project2/Project2App.swift +0 -10
  307. package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Project.xcodeproj/project.pbxproj +0 -382
  308. package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Project.xcodeproj/xcshareddata/xcschemes/Project.xcscheme +0 -78
  309. package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Sources/ContentView.swift +0 -7
  310. package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Sources/MainApp.swift +0 -10
  311. package/e2e-tests/test-applications/flutter-test-app/.metadata +0 -45
  312. package/e2e-tests/test-applications/flutter-test-app/README.md +0 -16
  313. package/e2e-tests/test-applications/flutter-test-app/analysis_options.yaml +0 -28
  314. package/e2e-tests/test-applications/flutter-test-app/android/app/build.gradle +0 -44
  315. package/e2e-tests/test-applications/flutter-test-app/android/app/src/debug/AndroidManifest.xml +0 -7
  316. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/AndroidManifest.xml +0 -45
  317. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/kotlin/com/example/flutter_magic/MainActivity.kt +0 -5
  318. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/drawable/launch_background.xml +0 -12
  319. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/drawable-v21/launch_background.xml +0 -12
  320. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  321. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  322. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  323. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  324. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  325. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/values/styles.xml +0 -18
  326. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/values-night/styles.xml +0 -18
  327. package/e2e-tests/test-applications/flutter-test-app/android/app/src/profile/AndroidManifest.xml +0 -7
  328. package/e2e-tests/test-applications/flutter-test-app/android/build.gradle +0 -18
  329. package/e2e-tests/test-applications/flutter-test-app/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  330. package/e2e-tests/test-applications/flutter-test-app/android/gradle.properties +0 -3
  331. package/e2e-tests/test-applications/flutter-test-app/android/settings.gradle +0 -25
  332. package/e2e-tests/test-applications/flutter-test-app/lib/main.dart +0 -125
  333. package/e2e-tests/test-applications/flutter-test-app/linux/CMakeLists.txt +0 -145
  334. package/e2e-tests/test-applications/flutter-test-app/linux/flutter/CMakeLists.txt +0 -88
  335. package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugin_registrant.cc +0 -11
  336. package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugin_registrant.h +0 -15
  337. package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugins.cmake +0 -23
  338. package/e2e-tests/test-applications/flutter-test-app/linux/main.cc +0 -6
  339. package/e2e-tests/test-applications/flutter-test-app/linux/my_application.cc +0 -124
  340. package/e2e-tests/test-applications/flutter-test-app/linux/my_application.h +0 -18
  341. package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/Flutter-Debug.xcconfig +0 -2
  342. package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/Flutter-Release.xcconfig +0 -2
  343. package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/GeneratedPluginRegistrant.swift +0 -10
  344. package/e2e-tests/test-applications/flutter-test-app/macos/Podfile +0 -43
  345. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/AppDelegate.swift +0 -9
  346. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -68
  347. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
  348. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
  349. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
  350. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
  351. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
  352. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
  353. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
  354. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Base.lproj/MainMenu.xib +0 -343
  355. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/AppInfo.xcconfig +0 -14
  356. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Debug.xcconfig +0 -2
  357. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Release.xcconfig +0 -2
  358. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Warnings.xcconfig +0 -13
  359. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/DebugProfile.entitlements +0 -12
  360. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Info.plist +0 -32
  361. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/MainFlutterWindow.swift +0 -15
  362. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Release.entitlements +0 -8
  363. package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/project.pbxproj +0 -705
  364. package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  365. package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +0 -98
  366. package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcworkspace/contents.xcworkspacedata +0 -7
  367. package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  368. package/e2e-tests/test-applications/flutter-test-app/macos/RunnerTests/RunnerTests.swift +0 -12
  369. package/e2e-tests/test-applications/flutter-test-app/pubspec.lock +0 -213
  370. package/e2e-tests/test-applications/flutter-test-app/pubspec.yaml +0 -89
  371. package/e2e-tests/test-applications/flutter-test-app/test/widget_test.dart +0 -30
  372. package/e2e-tests/test-applications/flutter-test-app/web/favicon.png +0 -0
  373. package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-192.png +0 -0
  374. package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-512.png +0 -0
  375. package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-maskable-192.png +0 -0
  376. package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-maskable-512.png +0 -0
  377. package/e2e-tests/test-applications/flutter-test-app/web/index.html +0 -38
  378. package/e2e-tests/test-applications/flutter-test-app/web/manifest.json +0 -35
  379. package/e2e-tests/test-applications/flutter-test-app/windows/CMakeLists.txt +0 -108
  380. package/e2e-tests/test-applications/flutter-test-app/windows/flutter/CMakeLists.txt +0 -109
  381. package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugin_registrant.cc +0 -11
  382. package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugin_registrant.h +0 -15
  383. package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugins.cmake +0 -23
  384. package/e2e-tests/test-applications/flutter-test-app/windows/runner/CMakeLists.txt +0 -40
  385. package/e2e-tests/test-applications/flutter-test-app/windows/runner/Runner.rc +0 -121
  386. package/e2e-tests/test-applications/flutter-test-app/windows/runner/flutter_window.cpp +0 -71
  387. package/e2e-tests/test-applications/flutter-test-app/windows/runner/flutter_window.h +0 -33
  388. package/e2e-tests/test-applications/flutter-test-app/windows/runner/main.cpp +0 -43
  389. package/e2e-tests/test-applications/flutter-test-app/windows/runner/resource.h +0 -16
  390. package/e2e-tests/test-applications/flutter-test-app/windows/runner/resources/app_icon.ico +0 -0
  391. package/e2e-tests/test-applications/flutter-test-app/windows/runner/runner.exe.manifest +0 -14
  392. package/e2e-tests/test-applications/flutter-test-app/windows/runner/utils.cpp +0 -65
  393. package/e2e-tests/test-applications/flutter-test-app/windows/runner/utils.h +0 -19
  394. package/e2e-tests/test-applications/flutter-test-app/windows/runner/win32_window.cpp +0 -288
  395. package/e2e-tests/test-applications/flutter-test-app/windows/runner/win32_window.h +0 -102
  396. package/e2e-tests/test-applications/nextjs-test-app/next.config.mjs +0 -4
  397. package/e2e-tests/test-applications/nextjs-test-app/package.json +0 -22
  398. package/e2e-tests/test-applications/nextjs-test-app/src/app/layout.tsx +0 -20
  399. package/e2e-tests/test-applications/nextjs-test-app/src/app/page.tsx +0 -90
  400. package/e2e-tests/test-applications/nuxt-3-test-app/README.md +0 -75
  401. package/e2e-tests/test-applications/nuxt-3-test-app/nuxt.config.ts +0 -5
  402. package/e2e-tests/test-applications/nuxt-3-test-app/package.json +0 -18
  403. package/e2e-tests/test-applications/nuxt-3-test-app/public/favicon.ico +0 -0
  404. package/e2e-tests/test-applications/nuxt-3-test-app/public/robots.txt +0 -1
  405. package/e2e-tests/test-applications/nuxt-4-test-app/README.md +0 -75
  406. package/e2e-tests/test-applications/nuxt-4-test-app/nuxt.config.ts +0 -6
  407. package/e2e-tests/test-applications/nuxt-4-test-app/package.json +0 -18
  408. package/e2e-tests/test-applications/nuxt-4-test-app/public/favicon.ico +0 -0
  409. package/e2e-tests/test-applications/nuxt-4-test-app/public/robots.txt +0 -1
  410. package/e2e-tests/test-applications/remix-test-app/app/entry.client.tsx +0 -18
  411. package/e2e-tests/test-applications/remix-test-app/app/entry.server.tsx +0 -140
  412. package/e2e-tests/test-applications/remix-test-app/app/root.tsx +0 -30
  413. package/e2e-tests/test-applications/remix-test-app/app/routes/_index.tsx +0 -48
  414. package/e2e-tests/test-applications/remix-test-app/app/tailwind.css +0 -3
  415. package/e2e-tests/test-applications/remix-test-app/package.json +0 -37
  416. package/e2e-tests/test-applications/remix-test-app/postcss.config.js +0 -6
  417. package/e2e-tests/test-applications/remix-test-app/tailwind.config.ts +0 -9
  418. package/e2e-tests/test-applications/remix-test-app/vite.config.ts +0 -16
  419. package/e2e-tests/test-applications/sveltekit-test-app/package.json +0 -21
  420. package/e2e-tests/test-applications/sveltekit-test-app/src/app.d.ts +0 -13
  421. package/e2e-tests/test-applications/sveltekit-test-app/src/app.html +0 -11
  422. package/e2e-tests/test-applications/sveltekit-test-app/src/lib/index.ts +0 -1
  423. package/e2e-tests/test-applications/sveltekit-test-app/src/routes/+page.svelte +0 -2
  424. package/e2e-tests/test-applications/sveltekit-test-app/svelte.config.js +0 -18
  425. package/e2e-tests/test-applications/sveltekit-test-app/vite.config.ts +0 -6
  426. package/e2e-tests/tests/flutter.test.ts +0 -127
  427. package/e2e-tests/tests/nextjs.test.ts +0 -161
  428. package/e2e-tests/tests/nuxt-3.test.ts +0 -189
  429. package/e2e-tests/tests/nuxt-4.test.ts +0 -188
  430. package/e2e-tests/tests/remix.test.ts +0 -277
  431. package/e2e-tests/tests/sveltekit.test.ts +0 -284
  432. package/e2e-tests/utils/index.ts +0 -438
  433. package/index.ts +0 -2
  434. package/lib/Constants.ts +0 -118
  435. package/lib/Helper/BottomBar.ts +0 -28
  436. package/lib/Helper/Env.ts +0 -7
  437. package/lib/Helper/File.ts +0 -65
  438. package/lib/Helper/Git.ts +0 -39
  439. package/lib/Helper/Logging.ts +0 -44
  440. package/lib/Helper/MergeConfig.ts +0 -19
  441. package/lib/Helper/Package.ts +0 -78
  442. package/lib/Helper/SentryCli.ts +0 -148
  443. package/lib/Helper/Wizard.ts +0 -59
  444. package/lib/Helper/__tests__/File.ts +0 -15
  445. package/lib/Helper/__tests__/MergeConfig.ts +0 -98
  446. package/lib/Helper/__tests__/SentryCli.ts +0 -86
  447. package/lib/Helper/test-fixtures/next.config.1-merged.js +0 -18
  448. package/lib/Helper/test-fixtures/next.config.1.js +0 -6
  449. package/lib/Helper/test-fixtures/next.config.2.js +0 -8
  450. package/lib/Helper/test-fixtures/next.config.3-merged.js +0 -21
  451. package/lib/Helper/test-fixtures/next.config.3.js +0 -9
  452. package/lib/Helper/test-fixtures/next.config.4-merged.js +0 -21
  453. package/lib/Helper/test-fixtures/next.config.4.js +0 -9
  454. package/lib/Setup.ts +0 -41
  455. package/lib/Steps/BaseStep.ts +0 -25
  456. package/lib/Steps/ChooseIntegration.ts +0 -112
  457. package/lib/Steps/ConfigureProject.ts +0 -10
  458. package/lib/Steps/Initial.ts +0 -44
  459. package/lib/Steps/Integrations/BaseIntegration.ts +0 -48
  460. package/lib/Steps/Integrations/Cordova.ts +0 -289
  461. package/lib/Steps/Integrations/Electron.ts +0 -161
  462. package/lib/Steps/Integrations/MobileProject.ts +0 -69
  463. package/lib/Steps/OpenSentry.ts +0 -75
  464. package/lib/Steps/PromptForParameters.ts +0 -207
  465. package/lib/Steps/Result.ts +0 -22
  466. package/lib/Steps/SentryProjectSelector.ts +0 -82
  467. package/lib/Steps/ShouldConfigure.ts +0 -10
  468. package/lib/Steps/WaitForSentry.ts +0 -50
  469. package/lib/Steps/Welcome.ts +0 -21
  470. package/lib/Steps/index.ts +0 -10
  471. package/lib/__tests__/Env.ts +0 -29
  472. package/scripts/NextJs/configs/_error.js +0 -39
  473. package/scripts/NextJs/configs/next.config.js +0 -36
  474. package/scripts/NextJs/configs/next.config.template.js +0 -12
  475. package/scripts/NextJs/configs/sentry.client.config.js +0 -17
  476. package/scripts/NextJs/configs/sentry.edge.config.js +0 -17
  477. package/scripts/NextJs/configs/sentry.server.config.js +0 -17
  478. package/scripts/NextJs/sentry_sample_error.js +0 -47
  479. package/scripts/craft-pre-release.sh +0 -10
  480. package/src/android/android-wizard.ts +0 -192
  481. package/src/android/code-tools.ts +0 -170
  482. package/src/android/gradle.ts +0 -250
  483. package/src/android/manifest.ts +0 -180
  484. package/src/android/templates.ts +0 -86
  485. package/src/apple/apple-wizard.ts +0 -269
  486. package/src/apple/cocoapod.ts +0 -73
  487. package/src/apple/code-tools.ts +0 -147
  488. package/src/apple/fastlane.ts +0 -170
  489. package/src/apple/templates.ts +0 -65
  490. package/src/apple/xcode-manager.ts +0 -404
  491. package/src/flutter/code-tools.ts +0 -284
  492. package/src/flutter/flutter-wizard.ts +0 -164
  493. package/src/flutter/templates.ts +0 -90
  494. package/src/nextjs/nextjs-wizard.ts +0 -1007
  495. package/src/nextjs/templates.ts +0 -526
  496. package/src/nextjs/utils.ts +0 -21
  497. package/src/nuxt/nuxt-wizard.ts +0 -188
  498. package/src/nuxt/sdk-example.ts +0 -135
  499. package/src/nuxt/sdk-setup.ts +0 -349
  500. package/src/nuxt/templates.ts +0 -303
  501. package/src/nuxt/types.ts +0 -8
  502. package/src/nuxt/utils.ts +0 -42
  503. package/src/react-native/expo-env-file.ts +0 -55
  504. package/src/react-native/expo-metro.ts +0 -212
  505. package/src/react-native/expo.ts +0 -175
  506. package/src/react-native/git.ts +0 -25
  507. package/src/react-native/glob.ts +0 -13
  508. package/src/react-native/gradle.ts +0 -26
  509. package/src/react-native/javascript.ts +0 -103
  510. package/src/react-native/metro.ts +0 -599
  511. package/src/react-native/options.ts +0 -5
  512. package/src/react-native/react-native-wizard.ts +0 -513
  513. package/src/react-native/uninstall.ts +0 -110
  514. package/src/react-native/xcode.ts +0 -302
  515. package/src/remix/codemods/express-server.ts +0 -44
  516. package/src/remix/codemods/handle-error.ts +0 -118
  517. package/src/remix/codemods/root-common.ts +0 -63
  518. package/src/remix/codemods/root-v1.ts +0 -41
  519. package/src/remix/codemods/root-v2.ts +0 -153
  520. package/src/remix/remix-wizard.ts +0 -261
  521. package/src/remix/sdk-example.ts +0 -120
  522. package/src/remix/sdk-setup.ts +0 -546
  523. package/src/remix/templates.ts +0 -11
  524. package/src/remix/utils.ts +0 -96
  525. package/src/run.ts +0 -204
  526. package/src/sourcemaps/sourcemaps-wizard.ts +0 -364
  527. package/src/sourcemaps/tools/angular.ts +0 -42
  528. package/src/sourcemaps/tools/create-react-app.ts +0 -19
  529. package/src/sourcemaps/tools/esbuild.ts +0 -65
  530. package/src/sourcemaps/tools/nextjs.ts +0 -114
  531. package/src/sourcemaps/tools/remix.ts +0 -90
  532. package/src/sourcemaps/tools/rollup.ts +0 -67
  533. package/src/sourcemaps/tools/sentry-cli.ts +0 -287
  534. package/src/sourcemaps/tools/tsc.ts +0 -144
  535. package/src/sourcemaps/tools/types.ts +0 -11
  536. package/src/sourcemaps/tools/vite.ts +0 -300
  537. package/src/sourcemaps/tools/webpack.ts +0 -383
  538. package/src/sourcemaps/utils/detect-tool.ts +0 -46
  539. package/src/sourcemaps/utils/other-wizards.ts +0 -167
  540. package/src/sourcemaps/utils/sdk-version.ts +0 -266
  541. package/src/sveltekit/sdk-example.ts +0 -56
  542. package/src/sveltekit/sdk-setup.ts +0 -667
  543. package/src/sveltekit/sveltekit-wizard.ts +0 -192
  544. package/src/sveltekit/templates.ts +0 -185
  545. package/src/sveltekit/utils.ts +0 -50
  546. package/src/telemetry.ts +0 -124
  547. package/src/utils/ast-utils.ts +0 -270
  548. package/src/utils/bash.ts +0 -57
  549. package/src/utils/clack-utils.ts +0 -1533
  550. package/src/utils/debug.ts +0 -20
  551. package/src/utils/package-json.ts +0 -51
  552. package/src/utils/package-manager.ts +0 -172
  553. package/src/utils/release-registry.ts +0 -19
  554. package/src/utils/semver.ts +0 -33
  555. package/src/utils/sentrycli-utils.ts +0 -24
  556. package/src/utils/string.ts +0 -7
  557. package/src/utils/types.ts +0 -77
  558. package/src/utils/url.ts +0 -27
  559. package/src/utils/vendor/is-unicorn-supported.ts +0 -29
  560. package/test/android/code-tools.test.ts +0 -49
  561. package/test/apple/cocoapod.test.ts +0 -306
  562. package/test/apple/code-tools.test.ts +0 -1042
  563. package/test/apple/fastfile.test.ts +0 -550
  564. package/test/apple/templates.test.ts +0 -191
  565. package/test/apple/xcode-manager.test.ts +0 -1066
  566. package/test/flutter/code-tools.test.ts +0 -212
  567. package/test/flutter/templates.test.ts +0 -100
  568. package/test/nextjs/templates.test.ts +0 -429
  569. package/test/nuxt/templates.test.ts +0 -255
  570. package/test/react-native/expo-metro.test.ts +0 -81
  571. package/test/react-native/expo.test.ts +0 -86
  572. package/test/react-native/gradle.test.ts +0 -310
  573. package/test/react-native/javascript.test.ts +0 -134
  574. package/test/react-native/metro.test.ts +0 -396
  575. package/test/react-native/xcode.test.ts +0 -401
  576. package/test/remix/client-entry.test.ts +0 -122
  577. package/test/remix/server-instrumentation.test.ts +0 -36
  578. package/test/sourcemaps/tools/sentry-cli.test.ts +0 -57
  579. package/test/sourcemaps/tools/tsc.test.ts +0 -181
  580. package/test/sourcemaps/tools/vite.test.ts +0 -149
  581. package/test/sourcemaps/tools/webpack.test.ts +0 -303
  582. package/test/sveltekit/templates.test.ts +0 -152
  583. package/test/utils/ast-utils.test.ts +0 -264
  584. package/test/utils/clack-utils.test.ts +0 -234
  585. package/types/xcode.d.ts +0 -526
@@ -2,31 +2,165 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSentryExampleApiRoute = exports.getSentryExampleSveltePage = exports.getServerHooksTemplate = exports.getClientHooksTemplate = void 0;
4
4
  function getClientHooksTemplate(dsn, selectedFeatures) {
5
- return "import { handleErrorWithSentry, replayIntegration } from \"@sentry/sveltekit\";\nimport * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '".concat(dsn, "',\n").concat(selectedFeatures.performance
6
- ? "\n tracesSampleRate: 1.0,\n"
7
- : '', "\n").concat(selectedFeatures.replay
8
- ? " // 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 // If the entire session is not sampled, use the below sample rate to sample\n // sessions when an error occurs.\n replaysOnErrorSampleRate: 1.0,\n\n // If you don't want to use Session Replay, just remove the line below:\n integrations: [replayIntegration()],"
9
- : '', "\n});\n\n// If you have a custom error handler, pass it to `handleErrorWithSentry`\nexport const handleError = handleErrorWithSentry();\n");
5
+ return `import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
6
+ import * as Sentry from '@sentry/sveltekit';
7
+
8
+ Sentry.init({
9
+ dsn: '${dsn}',
10
+ ${selectedFeatures.performance
11
+ ? `
12
+ tracesSampleRate: 1.0,
13
+ `
14
+ : ''}
15
+ ${selectedFeatures.replay
16
+ ? ` // This sets the sample rate to be 10%. You may want this to be 100% while
17
+ // in development and sample at a lower rate in production
18
+ replaysSessionSampleRate: 0.1,
19
+
20
+ // If the entire session is not sampled, use the below sample rate to sample
21
+ // sessions when an error occurs.
22
+ replaysOnErrorSampleRate: 1.0,
23
+
24
+ // If you don't want to use Session Replay, just remove the line below:
25
+ integrations: [replayIntegration()],`
26
+ : ''}
27
+ });
28
+
29
+ // If you have a custom error handler, pass it to \`handleErrorWithSentry\`
30
+ export const handleError = handleErrorWithSentry();
31
+ `;
10
32
  }
11
33
  exports.getClientHooksTemplate = getClientHooksTemplate;
12
34
  function getServerHooksTemplate(dsn, selectedFeatures) {
13
- return "import { sequence } from \"@sveltejs/kit/hooks\";\nimport { handleErrorWithSentry, sentryHandle } from \"@sentry/sveltekit\";\nimport * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '".concat(dsn, "',\n").concat(selectedFeatures.performance
14
- ? "\n tracesSampleRate: 1.0,\n"
15
- : '', "\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: import.meta.env.DEV,\n});\n\n// If you have custom handlers, make sure to place them after `sentryHandle()` in the `sequence` function.\nexport const handle = sequence(sentryHandle());\n\n// If you have a custom error handler, pass it to `handleErrorWithSentry`\nexport const handleError = handleErrorWithSentry();\n");
35
+ return `import { sequence } from "@sveltejs/kit/hooks";
36
+ import { handleErrorWithSentry, sentryHandle } from "@sentry/sveltekit";
37
+ import * as Sentry from '@sentry/sveltekit';
38
+
39
+ Sentry.init({
40
+ dsn: '${dsn}',
41
+ ${selectedFeatures.performance
42
+ ? `
43
+ tracesSampleRate: 1.0,
44
+ `
45
+ : ''}
46
+ // uncomment the line below to enable Spotlight (https://spotlightjs.com)
47
+ // spotlight: import.meta.env.DEV,
48
+ });
49
+
50
+ // If you have custom handlers, make sure to place them after \`sentryHandle()\` in the \`sequence\` function.
51
+ export const handle = sequence(sentryHandle());
52
+
53
+ // If you have a custom error handler, pass it to \`handleErrorWithSentry\`
54
+ export const handleError = handleErrorWithSentry();
55
+ `;
16
56
  }
17
57
  exports.getServerHooksTemplate = getServerHooksTemplate;
18
58
  /**
19
59
  * +page.svelte with Sentry example
20
60
  */
21
61
  function getSentryExampleSveltePage(options) {
22
- var issuesPageLink = options.selfHosted
23
- ? "".concat(options.url, "organizations/").concat(options.orgSlug, "/issues/?project=").concat(options.projectId)
24
- : "https://".concat(options.orgSlug, ".sentry.io/issues/?project=").concat(options.projectId);
25
- return "<!--\nThis is just a very simple page with a button to throw an example error.\nFeel free to delete this file and the entire sentry route.\n-->\n\n<script>\n import * as Sentry from '@sentry/sveltekit';\n\n function getSentryData() {\n Sentry.startSpan(\n {\n name: 'Example Frontend Span',\n op: 'test'\n },\n async () => {\n const res = await fetch('/sentry-example');\n if (!res.ok) {\n throw new Error('Sentry Example Frontend Error');\n }\n }\n );\n }\n</script>\n\n<title>Sentry Onboarding</title>\n\n<div>\n <main>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 44\">\n <path\n fill=\"currentColor\"\n d=\"M124.32,28.28,109.56,9.22h-3.68V34.77h3.73V15.19l15.18,19.58h3.26V9.22h-3.73ZM87.15,23.54h13.23V20.22H87.14V12.53h14.93V9.21H83.34V34.77h18.92V31.45H87.14ZM71.59,20.3h0C66.44,19.06,65,18.08,65,15.7c0-2.14,1.89-3.59,4.71-3.59a12.06,12.06,0,0,1,7.07,2.55l2-2.83a14.1,14.1,0,0,0-9-3c-5.06,0-8.59,3-8.59,7.27,0,4.6,3,6.19,8.46,7.52C74.51,24.74,76,25.78,76,28.11s-2,3.77-5.09,3.77a12.34,12.34,0,0,1-8.3-3.26l-2.25,2.69a15.94,15.94,0,0,0,10.42,3.85c5.48,0,9-2.95,9-7.51C79.75,23.79,77.47,21.72,71.59,20.3ZM195.7,9.22l-7.69,12-7.64-12h-4.46L186,24.67V34.78h3.84V24.55L200,9.22Zm-64.63,3.46h8.37v22.1h3.84V12.68h8.37V9.22H131.08ZM169.41,24.8c3.86-1.07,6-3.77,6-7.63,0-4.91-3.59-8-9.38-8H154.67V34.76h3.8V25.58h6.45l6.48,9.2h4.44l-7-9.82Zm-10.95-2.5V12.6h7.17c3.74,0,5.88,1.77,5.88,4.84s-2.29,4.86-5.84,4.86Z M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z\"\n />\n </svg>\n <p>\n Get Started with this <strong>simple Example:</strong>\n </p>\n\n <p>1. Send us a sample error:</p>\n <button type=\"button\" on:click={getSentryData}> Throw error! </button>\n\n <p>\n 2. Look for the error on the\n <a href=\"".concat(issuesPageLink, "\">Issues Page</a>.\n </p>\n <p style=\"margin-top: 24px;\">\n For more information, take a look at the\n <a href=\"https://docs.sentry.io/platforms/javascript/guides/sveltekit/\">\n Sentry SvelteKit Documentation\n </a>\n </p>\n </main>\n</div>\n\n<style>\n main {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n }\n\n svg {\n font-size: 4rem;\n margin: 14px 0;\n height: 1em;\n }\n\n button {\n padding: 12px;\n cursor: pointer;\n background-color: rgb(54, 45, 89);\n border-radius: 4px;\n border: none;\n color: white;\n font-size: 1em;\n margin: 1em;\n transition: all 0.25s ease-in-out;\n }\n button:hover {\n background-color: #8c5393;\n box-shadow: 4px;\n box-shadow: 0px 0px 15px 2px rgba(140, 83, 147, 0.5);\n }\n button:active {\n background-color: #c73852;\n }\n</style>\n");
62
+ const issuesPageLink = options.selfHosted
63
+ ? `${options.url}organizations/${options.orgSlug}/issues/?project=${options.projectId}`
64
+ : `https://${options.orgSlug}.sentry.io/issues/?project=${options.projectId}`;
65
+ return `<!--
66
+ This is just a very simple page with a button to throw an example error.
67
+ Feel free to delete this file and the entire sentry route.
68
+ -->
69
+
70
+ <script>
71
+ import * as Sentry from '@sentry/sveltekit';
72
+
73
+ function getSentryData() {
74
+ Sentry.startSpan(
75
+ {
76
+ name: 'Example Frontend Span',
77
+ op: 'test'
78
+ },
79
+ async () => {
80
+ const res = await fetch('/sentry-example');
81
+ if (!res.ok) {
82
+ throw new Error('Sentry Example Frontend Error');
83
+ }
84
+ }
85
+ );
86
+ }
87
+ </script>
88
+
89
+ <title>Sentry Onboarding</title>
90
+
91
+ <div>
92
+ <main>
93
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 44">
94
+ <path
95
+ fill="currentColor"
96
+ d="M124.32,28.28,109.56,9.22h-3.68V34.77h3.73V15.19l15.18,19.58h3.26V9.22h-3.73ZM87.15,23.54h13.23V20.22H87.14V12.53h14.93V9.21H83.34V34.77h18.92V31.45H87.14ZM71.59,20.3h0C66.44,19.06,65,18.08,65,15.7c0-2.14,1.89-3.59,4.71-3.59a12.06,12.06,0,0,1,7.07,2.55l2-2.83a14.1,14.1,0,0,0-9-3c-5.06,0-8.59,3-8.59,7.27,0,4.6,3,6.19,8.46,7.52C74.51,24.74,76,25.78,76,28.11s-2,3.77-5.09,3.77a12.34,12.34,0,0,1-8.3-3.26l-2.25,2.69a15.94,15.94,0,0,0,10.42,3.85c5.48,0,9-2.95,9-7.51C79.75,23.79,77.47,21.72,71.59,20.3ZM195.7,9.22l-7.69,12-7.64-12h-4.46L186,24.67V34.78h3.84V24.55L200,9.22Zm-64.63,3.46h8.37v22.1h3.84V12.68h8.37V9.22H131.08ZM169.41,24.8c3.86-1.07,6-3.77,6-7.63,0-4.91-3.59-8-9.38-8H154.67V34.76h3.8V25.58h6.45l6.48,9.2h4.44l-7-9.82Zm-10.95-2.5V12.6h7.17c3.74,0,5.88,1.77,5.88,4.84s-2.29,4.86-5.84,4.86Z M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"
97
+ />
98
+ </svg>
99
+ <p>
100
+ Get Started with this <strong>simple Example:</strong>
101
+ </p>
102
+
103
+ <p>1. Send us a sample error:</p>
104
+ <button type="button" on:click={getSentryData}> Throw error! </button>
105
+
106
+ <p>
107
+ 2. Look for the error on the
108
+ <a href="${issuesPageLink}">Issues Page</a>.
109
+ </p>
110
+ <p style="margin-top: 24px;">
111
+ For more information, take a look at the
112
+ <a href="https://docs.sentry.io/platforms/javascript/guides/sveltekit/">
113
+ Sentry SvelteKit Documentation
114
+ </a>
115
+ </p>
116
+ </main>
117
+ </div>
118
+
119
+ <style>
120
+ main {
121
+ display: flex;
122
+ flex-direction: column;
123
+ justify-content: center;
124
+ align-items: center;
125
+ }
126
+
127
+ svg {
128
+ font-size: 4rem;
129
+ margin: 14px 0;
130
+ height: 1em;
131
+ }
132
+
133
+ button {
134
+ padding: 12px;
135
+ cursor: pointer;
136
+ background-color: rgb(54, 45, 89);
137
+ border-radius: 4px;
138
+ border: none;
139
+ color: white;
140
+ font-size: 1em;
141
+ margin: 1em;
142
+ transition: all 0.25s ease-in-out;
143
+ }
144
+ button:hover {
145
+ background-color: #8c5393;
146
+ box-shadow: 4px;
147
+ box-shadow: 0px 0px 15px 2px rgba(140, 83, 147, 0.5);
148
+ }
149
+ button:active {
150
+ background-color: #c73852;
151
+ }
152
+ </style>
153
+ `;
26
154
  }
27
155
  exports.getSentryExampleSveltePage = getSentryExampleSveltePage;
28
156
  function getSentryExampleApiRoute() {
29
- return "// This is just a very simple API route that throws an example error.\n// Feel free to delete this file and the entire sentry route.\n\nexport const GET = async () => {\n throw new Error(\"Sentry Example API Route Error\");\n};\n";
157
+ return `// This is just a very simple API route that throws an example error.
158
+ // Feel free to delete this file and the entire sentry route.
159
+
160
+ export const GET = async () => {
161
+ throw new Error("Sentry Example API Route Error");
162
+ };
163
+ `;
30
164
  }
31
165
  exports.getSentryExampleApiRoute = getSentryExampleApiRoute;
32
166
  //# sourceMappingURL=templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/sveltekit/templates.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CACpC,GAAW,EACX,gBAGC;IAED,OAAO,kKAIC,GAAG,iBAEX,gBAAgB,CAAC,WAAW;QAC1B,CAAC,CAAC,8BAEL;QACG,CAAC,CAAC,EAAE,eAGN,gBAAgB,CAAC,MAAM;QACrB,CAAC,CAAC,4bASiC;QACnC,CAAC,CAAC,EAAE,8IAMP,CAAC;AACF,CAAC;AAtCD,wDAsCC;AAED,SAAgB,sBAAsB,CACpC,GAAW,EACX,gBAGC;IAED,OAAO,gNAKC,GAAG,iBAEX,gBAAgB,CAAC,WAAW;QAC1B,CAAC,CAAC,8BAEL;QACG,CAAC,CAAC,EAAE,gaAWP,CAAC;AACF,CAAC;AA9BD,wDA8BC;AAED;;GAEG;AACH,SAAgB,0BAA0B,CAAC,OAK1C;IACC,IAAM,cAAc,GAAG,OAAO,CAAC,UAAU;QACvC,CAAC,CAAC,UAAG,OAAO,CAAC,GAAG,2BAAiB,OAAO,CAAC,OAAO,8BAAoB,OAAO,CAAC,SAAS,CAAE;QACvF,CAAC,CAAC,kBAAW,OAAO,CAAC,OAAO,wCAA8B,OAAO,CAAC,SAAS,CAAE,CAAC;IAEhF,OAAO,myEA2CQ,cAAc,y6BA6C9B,CAAC;AACF,CAAC;AAnGD,gEAmGC;AAED,SAAgB,wBAAwB;IACtC,OAAO,wOAMR,CAAC;AACF,CAAC;AARD,4DAQC","sourcesContent":["export function getClientHooksTemplate(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n replay: boolean;\n },\n) {\n return `import { handleErrorWithSentry, replayIntegration } from \"@sentry/sveltekit\";\nimport * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '${dsn}',\n${\n selectedFeatures.performance\n ? `\n tracesSampleRate: 1.0,\n`\n : ''\n}\n${\n selectedFeatures.replay\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 // If the entire session is not sampled, use the below sample rate to sample\n // sessions when an error occurs.\n replaysOnErrorSampleRate: 1.0,\n\n // If you don't want to use Session Replay, just remove the line below:\n integrations: [replayIntegration()],`\n : ''\n}\n});\n\n// If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\nexport const handleError = handleErrorWithSentry();\n`;\n}\n\nexport function getServerHooksTemplate(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n replay: boolean;\n },\n) {\n return `import { sequence } from \"@sveltejs/kit/hooks\";\nimport { handleErrorWithSentry, sentryHandle } from \"@sentry/sveltekit\";\nimport * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '${dsn}',\n${\n selectedFeatures.performance\n ? `\n tracesSampleRate: 1.0,\n`\n : ''\n}\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: import.meta.env.DEV,\n});\n\n// If you have custom handlers, make sure to place them after \\`sentryHandle()\\` in the \\`sequence\\` function.\nexport const handle = sequence(sentryHandle());\n\n// If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\nexport const handleError = handleErrorWithSentry();\n`;\n}\n\n/**\n * +page.svelte with Sentry example\n */\nexport function getSentryExampleSveltePage(options: {\n selfHosted: boolean;\n url: string;\n orgSlug: string;\n projectId: string;\n}) {\n const issuesPageLink = options.selfHosted\n ? `${options.url}organizations/${options.orgSlug}/issues/?project=${options.projectId}`\n : `https://${options.orgSlug}.sentry.io/issues/?project=${options.projectId}`;\n\n return `<!--\nThis is just a very simple page with a button to throw an example error.\nFeel free to delete this file and the entire sentry route.\n-->\n\n<script>\n import * as Sentry from '@sentry/sveltekit';\n\n function getSentryData() {\n Sentry.startSpan(\n {\n name: 'Example Frontend Span',\n op: 'test'\n },\n async () => {\n const res = await fetch('/sentry-example');\n if (!res.ok) {\n throw new Error('Sentry Example Frontend Error');\n }\n }\n );\n }\n</script>\n\n<title>Sentry Onboarding</title>\n\n<div>\n <main>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 44\">\n <path\n fill=\"currentColor\"\n d=\"M124.32,28.28,109.56,9.22h-3.68V34.77h3.73V15.19l15.18,19.58h3.26V9.22h-3.73ZM87.15,23.54h13.23V20.22H87.14V12.53h14.93V9.21H83.34V34.77h18.92V31.45H87.14ZM71.59,20.3h0C66.44,19.06,65,18.08,65,15.7c0-2.14,1.89-3.59,4.71-3.59a12.06,12.06,0,0,1,7.07,2.55l2-2.83a14.1,14.1,0,0,0-9-3c-5.06,0-8.59,3-8.59,7.27,0,4.6,3,6.19,8.46,7.52C74.51,24.74,76,25.78,76,28.11s-2,3.77-5.09,3.77a12.34,12.34,0,0,1-8.3-3.26l-2.25,2.69a15.94,15.94,0,0,0,10.42,3.85c5.48,0,9-2.95,9-7.51C79.75,23.79,77.47,21.72,71.59,20.3ZM195.7,9.22l-7.69,12-7.64-12h-4.46L186,24.67V34.78h3.84V24.55L200,9.22Zm-64.63,3.46h8.37v22.1h3.84V12.68h8.37V9.22H131.08ZM169.41,24.8c3.86-1.07,6-3.77,6-7.63,0-4.91-3.59-8-9.38-8H154.67V34.76h3.8V25.58h6.45l6.48,9.2h4.44l-7-9.82Zm-10.95-2.5V12.6h7.17c3.74,0,5.88,1.77,5.88,4.84s-2.29,4.86-5.84,4.86Z M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z\"\n />\n </svg>\n <p>\n Get Started with this <strong>simple Example:</strong>\n </p>\n\n <p>1. Send us a sample error:</p>\n <button type=\"button\" on:click={getSentryData}> Throw error! </button>\n\n <p>\n 2. Look for the error on the\n <a href=\"${issuesPageLink}\">Issues Page</a>.\n </p>\n <p style=\"margin-top: 24px;\">\n For more information, take a look at the\n <a href=\"https://docs.sentry.io/platforms/javascript/guides/sveltekit/\">\n Sentry SvelteKit Documentation\n </a>\n </p>\n </main>\n</div>\n\n<style>\n main {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n }\n\n svg {\n font-size: 4rem;\n margin: 14px 0;\n height: 1em;\n }\n\n button {\n padding: 12px;\n cursor: pointer;\n background-color: rgb(54, 45, 89);\n border-radius: 4px;\n border: none;\n color: white;\n font-size: 1em;\n margin: 1em;\n transition: all 0.25s ease-in-out;\n }\n button:hover {\n background-color: #8c5393;\n box-shadow: 4px;\n box-shadow: 0px 0px 15px 2px rgba(140, 83, 147, 0.5);\n }\n button:active {\n background-color: #c73852;\n }\n</style>\n`;\n}\n\nexport function getSentryExampleApiRoute() {\n return `// This is just a very simple API route that throws an example error.\n// Feel free to delete this file and the entire sentry route.\n\nexport const GET = async () => {\n throw new Error(\"Sentry Example API Route Error\");\n};\n`;\n}\n"]}
1
+ {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/sveltekit/templates.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CACpC,GAAW,EACX,gBAGC;IAED,OAAO;;;;UAIC,GAAG;EAEX,gBAAgB,CAAC,WAAW;QAC1B,CAAC,CAAC;;CAEL;QACG,CAAC,CAAC,EACN;EAEE,gBAAgB,CAAC,MAAM;QACrB,CAAC,CAAC;;;;;;;;;uCASiC;QACnC,CAAC,CAAC,EACN;;;;;CAKC,CAAC;AACF,CAAC;AAtCD,wDAsCC;AAED,SAAgB,sBAAsB,CACpC,GAAW,EACX,gBAGC;IAED,OAAO;;;;;UAKC,GAAG;EAEX,gBAAgB,CAAC,WAAW;QAC1B,CAAC,CAAC;;CAEL;QACG,CAAC,CAAC,EACN;;;;;;;;;;CAUC,CAAC;AACF,CAAC;AA9BD,wDA8BC;AAED;;GAEG;AACH,SAAgB,0BAA0B,CAAC,OAK1C;IACC,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU;QACvC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,iBAAiB,OAAO,CAAC,OAAO,oBAAoB,OAAO,CAAC,SAAS,EAAE;QACvF,CAAC,CAAC,WAAW,OAAO,CAAC,OAAO,8BAA8B,OAAO,CAAC,SAAS,EAAE,CAAC;IAEhF,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2CQ,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6C9B,CAAC;AACF,CAAC;AAnGD,gEAmGC;AAED,SAAgB,wBAAwB;IACtC,OAAO;;;;;;CAMR,CAAC;AACF,CAAC;AARD,4DAQC","sourcesContent":["export function getClientHooksTemplate(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n replay: boolean;\n },\n) {\n return `import { handleErrorWithSentry, replayIntegration } from \"@sentry/sveltekit\";\nimport * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '${dsn}',\n${\n selectedFeatures.performance\n ? `\n tracesSampleRate: 1.0,\n`\n : ''\n}\n${\n selectedFeatures.replay\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 // If the entire session is not sampled, use the below sample rate to sample\n // sessions when an error occurs.\n replaysOnErrorSampleRate: 1.0,\n\n // If you don't want to use Session Replay, just remove the line below:\n integrations: [replayIntegration()],`\n : ''\n}\n});\n\n// If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\nexport const handleError = handleErrorWithSentry();\n`;\n}\n\nexport function getServerHooksTemplate(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n replay: boolean;\n },\n) {\n return `import { sequence } from \"@sveltejs/kit/hooks\";\nimport { handleErrorWithSentry, sentryHandle } from \"@sentry/sveltekit\";\nimport * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '${dsn}',\n${\n selectedFeatures.performance\n ? `\n tracesSampleRate: 1.0,\n`\n : ''\n}\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: import.meta.env.DEV,\n});\n\n// If you have custom handlers, make sure to place them after \\`sentryHandle()\\` in the \\`sequence\\` function.\nexport const handle = sequence(sentryHandle());\n\n// If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\nexport const handleError = handleErrorWithSentry();\n`;\n}\n\n/**\n * +page.svelte with Sentry example\n */\nexport function getSentryExampleSveltePage(options: {\n selfHosted: boolean;\n url: string;\n orgSlug: string;\n projectId: string;\n}) {\n const issuesPageLink = options.selfHosted\n ? `${options.url}organizations/${options.orgSlug}/issues/?project=${options.projectId}`\n : `https://${options.orgSlug}.sentry.io/issues/?project=${options.projectId}`;\n\n return `<!--\nThis is just a very simple page with a button to throw an example error.\nFeel free to delete this file and the entire sentry route.\n-->\n\n<script>\n import * as Sentry from '@sentry/sveltekit';\n\n function getSentryData() {\n Sentry.startSpan(\n {\n name: 'Example Frontend Span',\n op: 'test'\n },\n async () => {\n const res = await fetch('/sentry-example');\n if (!res.ok) {\n throw new Error('Sentry Example Frontend Error');\n }\n }\n );\n }\n</script>\n\n<title>Sentry Onboarding</title>\n\n<div>\n <main>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 44\">\n <path\n fill=\"currentColor\"\n d=\"M124.32,28.28,109.56,9.22h-3.68V34.77h3.73V15.19l15.18,19.58h3.26V9.22h-3.73ZM87.15,23.54h13.23V20.22H87.14V12.53h14.93V9.21H83.34V34.77h18.92V31.45H87.14ZM71.59,20.3h0C66.44,19.06,65,18.08,65,15.7c0-2.14,1.89-3.59,4.71-3.59a12.06,12.06,0,0,1,7.07,2.55l2-2.83a14.1,14.1,0,0,0-9-3c-5.06,0-8.59,3-8.59,7.27,0,4.6,3,6.19,8.46,7.52C74.51,24.74,76,25.78,76,28.11s-2,3.77-5.09,3.77a12.34,12.34,0,0,1-8.3-3.26l-2.25,2.69a15.94,15.94,0,0,0,10.42,3.85c5.48,0,9-2.95,9-7.51C79.75,23.79,77.47,21.72,71.59,20.3ZM195.7,9.22l-7.69,12-7.64-12h-4.46L186,24.67V34.78h3.84V24.55L200,9.22Zm-64.63,3.46h8.37v22.1h3.84V12.68h8.37V9.22H131.08ZM169.41,24.8c3.86-1.07,6-3.77,6-7.63,0-4.91-3.59-8-9.38-8H154.67V34.76h3.8V25.58h6.45l6.48,9.2h4.44l-7-9.82Zm-10.95-2.5V12.6h7.17c3.74,0,5.88,1.77,5.88,4.84s-2.29,4.86-5.84,4.86Z M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z\"\n />\n </svg>\n <p>\n Get Started with this <strong>simple Example:</strong>\n </p>\n\n <p>1. Send us a sample error:</p>\n <button type=\"button\" on:click={getSentryData}> Throw error! </button>\n\n <p>\n 2. Look for the error on the\n <a href=\"${issuesPageLink}\">Issues Page</a>.\n </p>\n <p style=\"margin-top: 24px;\">\n For more information, take a look at the\n <a href=\"https://docs.sentry.io/platforms/javascript/guides/sveltekit/\">\n Sentry SvelteKit Documentation\n </a>\n </p>\n </main>\n</div>\n\n<style>\n main {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n }\n\n svg {\n font-size: 4rem;\n margin: 14px 0;\n height: 1em;\n }\n\n button {\n padding: 12px;\n cursor: pointer;\n background-color: rgb(54, 45, 89);\n border-radius: 4px;\n border: none;\n color: white;\n font-size: 1em;\n margin: 1em;\n transition: all 0.25s ease-in-out;\n }\n button:hover {\n background-color: #8c5393;\n box-shadow: 4px;\n box-shadow: 0px 0px 15px 2px rgba(140, 83, 147, 0.5);\n }\n button:active {\n background-color: #c73852;\n }\n</style>\n`;\n}\n\nexport function getSentryExampleApiRoute() {\n return `// This is just a very simple API route that throws an example error.\n// Feel free to delete this file and the entire sentry route.\n\nexport const GET = async () => {\n throw new Error(\"Sentry Example API Route Error\");\n};\n`;\n}\n"]}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSvelteVersionBucket = exports.getKitVersionBucket = void 0;
4
- var semver_1 = require("semver");
4
+ const semver_1 = require("semver");
5
5
  function getKitVersionBucket(version) {
6
6
  if (!version) {
7
7
  return 'none';
8
8
  }
9
- var minVer = (0, semver_1.minVersion)(version);
9
+ const minVer = (0, semver_1.minVersion)(version);
10
10
  if (!minVer) {
11
11
  return 'invalid';
12
12
  }
@@ -28,7 +28,7 @@ function getSvelteVersionBucket(version) {
28
28
  if (!version) {
29
29
  return 'none';
30
30
  }
31
- var minVer = (0, semver_1.minVersion)(version);
31
+ const minVer = (0, semver_1.minVersion)(version);
32
32
  if (!minVer) {
33
33
  return 'invalid';
34
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/sveltekit/utils.ts"],"names":[],"mappings":";;;AAAA,iCAAwC;AAExC,SAAgB,mBAAmB,CACjC,OAA2B;IAE3B,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,MAAM,CAAC;KACf;IAED,IAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,KAAK,CAAC;KACd;SAAM,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;QAC/B,OAAO,iBAAiB,CAAC;KAC1B;SAAM;QACL,yEAAyE;QACzE,0EAA0E;QAC1E,6CAA6C;QAC7C,OAAO,UAAU,CAAC;KACnB;AACH,CAAC;AAtBD,kDAsBC;AAED,SAAgB,sBAAsB,CACpC,OAA2B;IAE3B,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,MAAM,CAAC;KACf;IAED,IAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,QAAQ,CAAC;KACjB;IACD,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,KAAK,CAAC;KACd;IACD,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,KAAK,CAAC;KACd;IACD,uDAAuD;IACvD,OAAO,MAAM,CAAC;AAChB,CAAC;AAvBD,wDAuBC","sourcesContent":["import { lt, minVersion } from 'semver';\n\nexport function getKitVersionBucket(\n version: string | undefined,\n): 'none' | 'invalid' | '0.x' | '>=1.0.0 <1.24.0' | '>=1.24.0' {\n if (!version) {\n return 'none';\n }\n\n const minVer = minVersion(version);\n if (!minVer) {\n return 'invalid';\n }\n\n if (lt(minVer, '1.0.0')) {\n return '0.x';\n } else if (lt(minVer, '1.24.0')) {\n return '>=1.0.0 <1.24.0';\n } else {\n // This is the version when the client-side invalidation fix was released\n // https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fkit%401.24.0\n // https://github.com/sveltejs/kit/pull/10576\n return '>=1.24.0';\n }\n}\n\nexport function getSvelteVersionBucket(\n version: string | undefined,\n): 'none' | 'invalid' | '<3.0.0' | '3.x' | '4.x' | '>4.x' {\n if (!version) {\n return 'none';\n }\n\n const minVer = minVersion(version);\n if (!minVer) {\n return 'invalid';\n }\n\n if (lt(minVer, '3.0.0')) {\n return '<3.0.0';\n }\n if (lt(minVer, '4.0.0')) {\n return '3.x';\n }\n if (lt(minVer, '5.0.0')) {\n return '4.x';\n }\n // Svelte 5 isn't released yet but it's being worked on\n return '>4.x';\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/sveltekit/utils.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC,SAAgB,mBAAmB,CACjC,OAA2B;IAE3B,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,MAAM,CAAC;KACf;IAED,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,KAAK,CAAC;KACd;SAAM,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;QAC/B,OAAO,iBAAiB,CAAC;KAC1B;SAAM;QACL,yEAAyE;QACzE,0EAA0E;QAC1E,6CAA6C;QAC7C,OAAO,UAAU,CAAC;KACnB;AACH,CAAC;AAtBD,kDAsBC;AAED,SAAgB,sBAAsB,CACpC,OAA2B;IAE3B,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,MAAM,CAAC;KACf;IAED,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,QAAQ,CAAC;KACjB;IACD,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,KAAK,CAAC;KACd;IACD,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,KAAK,CAAC;KACd;IACD,uDAAuD;IACvD,OAAO,MAAM,CAAC;AAChB,CAAC;AAvBD,wDAuBC","sourcesContent":["import { lt, minVersion } from 'semver';\n\nexport function getKitVersionBucket(\n version: string | undefined,\n): 'none' | 'invalid' | '0.x' | '>=1.0.0 <1.24.0' | '>=1.24.0' {\n if (!version) {\n return 'none';\n }\n\n const minVer = minVersion(version);\n if (!minVer) {\n return 'invalid';\n }\n\n if (lt(minVer, '1.0.0')) {\n return '0.x';\n } else if (lt(minVer, '1.24.0')) {\n return '>=1.0.0 <1.24.0';\n } else {\n // This is the version when the client-side invalidation fix was released\n // https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fkit%401.24.0\n // https://github.com/sveltejs/kit/pull/10576\n return '>=1.24.0';\n }\n}\n\nexport function getSvelteVersionBucket(\n version: string | undefined,\n): 'none' | 'invalid' | '<3.0.0' | '3.x' | '4.x' | '>4.x' {\n if (!version) {\n return 'none';\n }\n\n const minVer = minVersion(version);\n if (!minVer) {\n return 'invalid';\n }\n\n if (lt(minVer, '3.0.0')) {\n return '<3.0.0';\n }\n if (lt(minVer, '4.0.0')) {\n return '3.x';\n }\n if (lt(minVer, '5.0.0')) {\n return '4.x';\n }\n // Svelte 5 isn't released yet but it's being worked on\n return '>4.x';\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { Span } from '@sentry/node';
2
- import { WizardOptions } from './utils/types';
1
+ import { type Span } from '@sentry/node';
2
+ import type { WizardOptions } from './utils/types';
3
3
  export declare function withTelemetry<F>(options: {
4
4
  enabled: boolean;
5
5
  integration: string;
@@ -1,126 +1,76 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
2
  Object.defineProperty(exports, "__esModule", { value: true });
42
3
  exports.updateProgress = exports.traceStep = exports.withTelemetry = void 0;
43
- var node_1 = require("@sentry/node");
44
- var package_json_1 = __importDefault(require("../package.json"));
45
- function withTelemetry(options, callback) {
46
- return __awaiter(this, void 0, void 0, function () {
47
- var _a, sentryHub, sentryClient, sentrySession, e_1;
48
- var _this = this;
49
- return __generator(this, function (_b) {
50
- switch (_b.label) {
51
- case 0:
52
- _a = createSentryInstance(options.enabled, options.integration), sentryHub = _a.sentryHub, sentryClient = _a.sentryClient;
53
- (0, node_1.makeMain)(sentryHub);
54
- sentrySession = sentryHub.startSession();
55
- sentryHub.captureSession();
56
- // Set tag for passed CLI args
57
- sentryHub.setTag('args.project', !!options.wizardOptions.projectSlug);
58
- sentryHub.setTag('args.org', !!options.wizardOptions.orgSlug);
59
- sentryHub.setTag('args.saas', !!options.wizardOptions.saas);
60
- _b.label = 1;
61
- case 1:
62
- _b.trys.push([1, 3, 4, 7]);
63
- return [4 /*yield*/, (0, node_1.startSpan)({
64
- name: 'sentry-wizard-execution',
65
- status: 'ok',
66
- op: 'wizard.flow',
67
- }, function () { return __awaiter(_this, void 0, void 0, function () {
68
- var res;
69
- return __generator(this, function (_a) {
70
- switch (_a.label) {
71
- case 0:
72
- updateProgress('start');
73
- return [4 /*yield*/, (0, node_1.runWithAsyncContext)(callback)];
74
- case 1:
75
- res = _a.sent();
76
- updateProgress('finished');
77
- return [2 /*return*/, res];
78
- }
79
- });
80
- }); })];
81
- case 2: return [2 /*return*/, _b.sent()];
82
- case 3:
83
- e_1 = _b.sent();
84
- sentryHub.captureException('Error during wizard execution.');
85
- sentrySession.status = 'crashed';
86
- throw e_1;
87
- case 4:
88
- sentryHub.endSession();
89
- return [4 /*yield*/, sentryClient.flush(3000).then(null, function () {
90
- // If telemetry flushing fails we generally don't care
91
- })];
92
- case 5:
93
- _b.sent();
94
- return [4 /*yield*/, (0, node_1.flush)(3000).then(null, function () {
95
- // If telemetry flushing fails we generally don't care
96
- })];
97
- case 6:
98
- _b.sent();
99
- return [7 /*endfinally*/];
100
- case 7: return [2 /*return*/];
101
- }
4
+ const node_1 = require("@sentry/node");
5
+ const node_fs_1 = require("node:fs");
6
+ const node_path_1 = require("node:path");
7
+ async function withTelemetry(options, callback) {
8
+ const { sentryHub, sentryClient } = createSentryInstance(options.enabled, options.integration);
9
+ (0, node_1.makeMain)(sentryHub);
10
+ const sentrySession = sentryHub.startSession();
11
+ sentryHub.captureSession();
12
+ // Set tag for passed CLI args
13
+ sentryHub.setTag('args.project', !!options.wizardOptions.projectSlug);
14
+ sentryHub.setTag('args.org', !!options.wizardOptions.orgSlug);
15
+ sentryHub.setTag('args.saas', !!options.wizardOptions.saas);
16
+ try {
17
+ return await (0, node_1.startSpan)({
18
+ name: 'sentry-wizard-execution',
19
+ status: 'ok',
20
+ op: 'wizard.flow',
21
+ }, async () => {
22
+ updateProgress('start');
23
+ const res = await (0, node_1.runWithAsyncContext)(callback);
24
+ updateProgress('finished');
25
+ return res;
102
26
  });
103
- });
27
+ }
28
+ catch (e) {
29
+ sentryHub.captureException('Error during wizard execution.');
30
+ sentrySession.status = 'crashed';
31
+ throw e;
32
+ }
33
+ finally {
34
+ sentryHub.endSession();
35
+ await sentryClient.flush(3000).then(null, () => {
36
+ // If telemetry flushing fails we generally don't care
37
+ });
38
+ await (0, node_1.flush)(3000).then(null, () => {
39
+ // If telemetry flushing fails we generally don't care
40
+ });
41
+ }
104
42
  }
105
43
  exports.withTelemetry = withTelemetry;
106
44
  function createSentryInstance(enabled, integration) {
107
- var client = new node_1.NodeClient({
45
+ let version = process.env.npm_package_version;
46
+ if (!version) {
47
+ try {
48
+ const pathToPackageJson = (0, node_path_1.join)((0, node_path_1.dirname)(require.resolve('@sentry/wizard')), '..', 'package.json');
49
+ const packageJsonData = (0, node_fs_1.readFileSync)(pathToPackageJson, 'utf-8');
50
+ const parsedPackageJson = JSON.parse(packageJsonData);
51
+ version = parsedPackageJson.version;
52
+ }
53
+ catch {
54
+ // If we fail to read the package.json file, we don't want to crash the wizard
55
+ // so we just don't set the version
56
+ }
57
+ }
58
+ const client = new node_1.NodeClient({
108
59
  dsn: 'https://8871d3ff64814ed8960c96d1fcc98a27@o1.ingest.sentry.io/4505425820712960',
109
60
  enabled: enabled,
110
- environment: "production-".concat(integration),
61
+ environment: `production-${integration}`,
111
62
  tracesSampleRate: 1,
112
63
  sampleRate: 1,
113
- release: package_json_1.default.version,
64
+ release: version,
114
65
  integrations: [new node_1.Integrations.Http()],
115
66
  tracePropagationTargets: [/^https:\/\/sentry.io\//],
116
67
  stackParser: node_1.defaultStackParser,
117
- beforeSendTransaction: function (event) {
68
+ beforeSendTransaction: (event) => {
118
69
  delete event.server_name; // Server name might contain PII
119
70
  return event;
120
71
  },
121
- beforeSend: function (event) {
122
- var _a, _b;
123
- (_b = (_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b.forEach(function (exception) {
72
+ beforeSend: (event) => {
73
+ event.exception?.values?.forEach((exception) => {
124
74
  delete exception.stacktrace;
125
75
  });
126
76
  delete event.server_name; // Server name might contain PII
@@ -129,7 +79,7 @@ function createSentryInstance(enabled, integration) {
129
79
  transport: node_1.makeNodeTransport,
130
80
  debug: true,
131
81
  });
132
- var hub = new node_1.Hub(client);
82
+ const hub = new node_1.Hub(client);
133
83
  hub.setTag('integration', integration);
134
84
  hub.setTag('node', process.version);
135
85
  hub.setTag('platform', process.platform);
@@ -137,7 +87,7 @@ function createSentryInstance(enabled, integration) {
137
87
  }
138
88
  function traceStep(step, callback) {
139
89
  updateProgress(step);
140
- return (0, node_1.startSpan)({ name: step, op: 'wizard.step' }, function (span) { return callback(span); });
90
+ return (0, node_1.startSpan)({ name: step, op: 'wizard.step' }, (span) => callback(span));
141
91
  }
142
92
  exports.traceStep = traceStep;
143
93
  function updateProgress(step) {
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/telemetry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAYsB;AACtB,iEAA0C;AAG1C,SAAsB,aAAa,CACjC,OAIC,EACD,QAA8B;;;;;;;oBAExB,KAA8B,oBAAoB,CACtD,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,WAAW,CACpB,EAHO,SAAS,eAAA,EAAE,YAAY,kBAAA,CAG7B;oBAEF,IAAA,eAAQ,EAAC,SAAS,CAAC,CAAC;oBAEd,aAAa,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;oBAC/C,SAAS,CAAC,cAAc,EAAE,CAAC;oBAE3B,8BAA8B;oBAC9B,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;oBACtE,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;oBAC9D,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;;;;oBAGnD,qBAAM,IAAA,gBAAS,EACpB;4BACE,IAAI,EAAE,yBAAyB;4BAC/B,MAAM,EAAE,IAAI;4BACZ,EAAE,EAAE,aAAa;yBAClB,EACD;;;;;wCACE,cAAc,CAAC,OAAO,CAAC,CAAC;wCACZ,qBAAM,IAAA,0BAAmB,EAAC,QAAQ,CAAC,EAAA;;wCAAzC,GAAG,GAAG,SAAmC;wCAC/C,cAAc,CAAC,UAAU,CAAC,CAAC;wCAE3B,sBAAO,GAAG,EAAC;;;6BACZ,CACF,EAAA;wBAbD,sBAAO,SAaN,EAAC;;;oBAEF,SAAS,CAAC,gBAAgB,CAAC,gCAAgC,CAAC,CAAC;oBAC7D,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;oBACjC,MAAM,GAAC,CAAC;;oBAER,SAAS,CAAC,UAAU,EAAE,CAAC;oBACvB,qBAAM,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE;4BACxC,sDAAsD;wBACxD,CAAC,CAAC,EAAA;;oBAFF,SAEE,CAAC;oBACH,qBAAM,IAAA,YAAK,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE;4BAC3B,sDAAsD;wBACxD,CAAC,CAAC,EAAA;;oBAFF,SAEE,CAAC;;;;;;CAEN;AAnDD,sCAmDC;AAED,SAAS,oBAAoB,CAAC,OAAgB,EAAE,WAAmB;IACjE,IAAM,MAAM,GAAG,IAAI,iBAAU,CAAC;QAC5B,GAAG,EAAE,+EAA+E;QACpF,OAAO,EAAE,OAAO;QAEhB,WAAW,EAAE,qBAAc,WAAW,CAAE;QAExC,gBAAgB,EAAE,CAAC;QACnB,UAAU,EAAE,CAAC;QAEb,OAAO,EAAE,sBAAW,CAAC,OAAO;QAC5B,YAAY,EAAE,CAAC,IAAI,mBAAY,CAAC,IAAI,EAAE,CAAC;QACvC,uBAAuB,EAAE,CAAC,wBAAwB,CAAC;QAEnD,WAAW,EAAE,yBAAkB;QAE/B,qBAAqB,EAAE,UAAC,KAAK;YAC3B,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,gCAAgC;YAC1D,OAAO,KAAK,CAAC;QACf,CAAC;QAED,UAAU,EAAE,UAAC,KAAK;;YAChB,MAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,0CAAE,OAAO,CAAC,UAAC,SAAS;gBACzC,OAAO,SAAS,CAAC,UAAU,CAAC;YAC9B,CAAC,CAAC,CAAC;YAEH,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,gCAAgC;YAC1D,OAAO,KAAK,CAAC;QACf,CAAC;QAED,SAAS,EAAE,wBAAiB;QAE5B,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;IAEH,IAAM,GAAG,GAAG,IAAI,UAAG,CAAC,MAAM,CAAC,CAAC;IAE5B,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IACvC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEzC,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;AAClD,CAAC;AAED,SAAgB,SAAS,CACvB,IAAY,EACZ,QAAuC;IAEvC,cAAc,CAAC,IAAI,CAAC,CAAC;IACrB,OAAO,IAAA,gBAAS,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,UAAC,IAAI,IAAK,OAAA,QAAQ,CAAC,IAAI,CAAC,EAAd,CAAc,CAAC,CAAC;AAChF,CAAC;AAND,8BAMC;AAED,SAAgB,cAAc,CAAC,IAAY;IACzC,IAAA,aAAM,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC;AAFD,wCAEC","sourcesContent":["import {\n defaultStackParser,\n Hub,\n Integrations,\n makeMain,\n makeNodeTransport,\n NodeClient,\n runWithAsyncContext,\n setTag,\n startSpan,\n flush,\n Span,\n} from '@sentry/node';\nimport packageJson from '../package.json';\nimport { WizardOptions } from './utils/types';\n\nexport async function withTelemetry<F>(\n options: {\n enabled: boolean;\n integration: string;\n wizardOptions: WizardOptions;\n },\n callback: () => F | Promise<F>,\n): Promise<F> {\n const { sentryHub, sentryClient } = createSentryInstance(\n options.enabled,\n options.integration,\n );\n\n makeMain(sentryHub);\n\n const sentrySession = sentryHub.startSession();\n sentryHub.captureSession();\n\n // Set tag for passed CLI args\n sentryHub.setTag('args.project', !!options.wizardOptions.projectSlug);\n sentryHub.setTag('args.org', !!options.wizardOptions.orgSlug);\n sentryHub.setTag('args.saas', !!options.wizardOptions.saas);\n\n try {\n return await startSpan(\n {\n name: 'sentry-wizard-execution',\n status: 'ok',\n op: 'wizard.flow',\n },\n async () => {\n updateProgress('start');\n const res = await runWithAsyncContext(callback);\n updateProgress('finished');\n\n return res;\n },\n );\n } catch (e) {\n sentryHub.captureException('Error during wizard execution.');\n sentrySession.status = 'crashed';\n throw e;\n } finally {\n sentryHub.endSession();\n await sentryClient.flush(3000).then(null, () => {\n // If telemetry flushing fails we generally don't care\n });\n await flush(3000).then(null, () => {\n // If telemetry flushing fails we generally don't care\n });\n }\n}\n\nfunction createSentryInstance(enabled: boolean, integration: string) {\n const client = new NodeClient({\n dsn: 'https://8871d3ff64814ed8960c96d1fcc98a27@o1.ingest.sentry.io/4505425820712960',\n enabled: enabled,\n\n environment: `production-${integration}`,\n\n tracesSampleRate: 1,\n sampleRate: 1,\n\n release: packageJson.version,\n integrations: [new Integrations.Http()],\n tracePropagationTargets: [/^https:\\/\\/sentry.io\\//],\n\n stackParser: defaultStackParser,\n\n beforeSendTransaction: (event) => {\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n beforeSend: (event) => {\n event.exception?.values?.forEach((exception) => {\n delete exception.stacktrace;\n });\n\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n transport: makeNodeTransport,\n\n debug: true,\n });\n\n const hub = new Hub(client);\n\n hub.setTag('integration', integration);\n hub.setTag('node', process.version);\n hub.setTag('platform', process.platform);\n\n return { sentryHub: hub, sentryClient: client };\n}\n\nexport function traceStep<T>(\n step: string,\n callback: (span: Span | undefined) => T,\n): T {\n updateProgress(step);\n return startSpan({ name: step, op: 'wizard.step' }, (span) => callback(span));\n}\n\nexport function updateProgress(step: string) {\n setTag('progress', step);\n}\n"]}
1
+ {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/telemetry.ts"],"names":[],"mappings":"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","sourcesContent":["import {\n Hub,\n Integrations,\n NodeClient,\n type Span,\n defaultStackParser,\n flush,\n makeMain,\n makeNodeTransport,\n runWithAsyncContext,\n setTag,\n startSpan,\n} from '@sentry/node';\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport type { WizardOptions } from './utils/types';\n\nexport async function withTelemetry<F>(\n options: {\n enabled: boolean;\n integration: string;\n wizardOptions: WizardOptions;\n },\n callback: () => F | Promise<F>,\n): Promise<F> {\n const { sentryHub, sentryClient } = createSentryInstance(\n options.enabled,\n options.integration,\n );\n\n makeMain(sentryHub);\n\n const sentrySession = sentryHub.startSession();\n sentryHub.captureSession();\n\n // Set tag for passed CLI args\n sentryHub.setTag('args.project', !!options.wizardOptions.projectSlug);\n sentryHub.setTag('args.org', !!options.wizardOptions.orgSlug);\n sentryHub.setTag('args.saas', !!options.wizardOptions.saas);\n\n try {\n return await startSpan(\n {\n name: 'sentry-wizard-execution',\n status: 'ok',\n op: 'wizard.flow',\n },\n async () => {\n updateProgress('start');\n const res = await runWithAsyncContext(callback);\n updateProgress('finished');\n\n return res;\n },\n );\n } catch (e) {\n sentryHub.captureException('Error during wizard execution.');\n sentrySession.status = 'crashed';\n throw e;\n } finally {\n sentryHub.endSession();\n await sentryClient.flush(3000).then(null, () => {\n // If telemetry flushing fails we generally don't care\n });\n await flush(3000).then(null, () => {\n // If telemetry flushing fails we generally don't care\n });\n }\n}\n\nfunction createSentryInstance(enabled: boolean, integration: string) {\n let version: string | undefined = process.env.npm_package_version;\n if (!version) {\n try {\n const pathToPackageJson = join(\n dirname(require.resolve('@sentry/wizard')),\n '..',\n 'package.json',\n );\n const packageJsonData = readFileSync(pathToPackageJson, 'utf-8');\n const parsedPackageJson = JSON.parse(packageJsonData) as {\n version?: string;\n };\n version = parsedPackageJson.version;\n } catch {\n // If we fail to read the package.json file, we don't want to crash the wizard\n // so we just don't set the version\n }\n }\n\n const client = new NodeClient({\n dsn: 'https://8871d3ff64814ed8960c96d1fcc98a27@o1.ingest.sentry.io/4505425820712960',\n enabled: enabled,\n\n environment: `production-${integration}`,\n\n tracesSampleRate: 1,\n sampleRate: 1,\n\n release: version,\n integrations: [new Integrations.Http()],\n tracePropagationTargets: [/^https:\\/\\/sentry.io\\//],\n\n stackParser: defaultStackParser,\n\n beforeSendTransaction: (event) => {\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n beforeSend: (event) => {\n event.exception?.values?.forEach((exception) => {\n delete exception.stacktrace;\n });\n\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n transport: makeNodeTransport,\n\n debug: true,\n });\n\n const hub = new Hub(client);\n\n hub.setTag('integration', integration);\n hub.setTag('node', process.version);\n hub.setTag('platform', process.platform);\n\n return { sentryHub: hub, sentryClient: client };\n}\n\nexport function traceStep<T>(\n step: string,\n callback: (span: Span | undefined) => T,\n): T {\n updateProgress(step);\n return startSpan({ name: step, op: 'wizard.step' }, (span) => callback(span));\n}\n\nexport function updateProgress(step: string) {\n setTag('progress', step);\n}\n"]}