@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
@@ -1,34 +1,87 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sourceContextKts = exports.sourceContext = exports.testErrorSnippetKt = exports.testErrorSnippet = exports.sentryImportKt = exports.sentryImport = exports.manifest = exports.pluginKts = exports.plugin = exports.pluginsBlockKts = exports.pluginsBlock = void 0;
4
- var pluginsBlock = function (version) {
5
- if (version === void 0) { version = '3.12.0'; }
6
- return "\nplugins {\n id 'io.sentry.android.gradle' version '".concat(version, "'\n}\n\n");
7
- };
4
+ const pluginsBlock = (version = '3.12.0') => `
5
+ plugins {
6
+ id 'io.sentry.android.gradle' version '${version}'
7
+ }
8
+
9
+ `;
8
10
  exports.pluginsBlock = pluginsBlock;
9
- var pluginsBlockKts = function (version) {
10
- if (version === void 0) { version = '3.12.0'; }
11
- return "\nplugins {\n id(\"io.sentry.android.gradle\") version \"".concat(version, "\"\n}\n\n");
12
- };
11
+ const pluginsBlockKts = (version = '3.12.0') => `
12
+ plugins {
13
+ id("io.sentry.android.gradle") version "${version}"
14
+ }
15
+
16
+ `;
13
17
  exports.pluginsBlockKts = pluginsBlockKts;
14
- var plugin = function (version) {
15
- if (version === void 0) { version = '3.12.0'; }
16
- return "\n id 'io.sentry.android.gradle' version '".concat(version, "'\n");
17
- };
18
+ const plugin = (version = '3.12.0') => `
19
+ id 'io.sentry.android.gradle' version '${version}'
20
+ `;
18
21
  exports.plugin = plugin;
19
- var pluginKts = function (version) {
20
- if (version === void 0) { version = '3.12.0'; }
21
- return "\n id(\"io.sentry.android.gradle\") version \"".concat(version, "\"\n");
22
- };
22
+ const pluginKts = (version = '3.12.0') => `
23
+ id("io.sentry.android.gradle") version "${version}"
24
+ `;
23
25
  exports.pluginKts = pluginKts;
24
- var manifest = function (dsn) { return "\n <!-- Required: set your sentry.io project identifier (DSN) -->\n <meta-data android:name=\"io.sentry.dsn\" android:value=\"".concat(dsn, "\" />\n\n <!-- enable automatic breadcrumbs for user interactions (clicks, swipes, scrolls) -->\n <meta-data android:name=\"io.sentry.traces.user-interaction.enable\" android:value=\"true\" />\n <!-- enable screenshot for crashes (could contain sensitive/PII data) -->\n <meta-data android:name=\"io.sentry.attach-screenshot\" android:value=\"true\" />\n <!-- enable view hierarchy for crashes -->\n <meta-data android:name=\"io.sentry.attach-view-hierarchy\" android:value=\"true\" />\n\n <!-- enable the performance API by setting a sample-rate, adjust in production env -->\n <meta-data android:name=\"io.sentry.traces.sample-rate\" android:value=\"1.0\" />\n"); };
26
+ const manifest = (dsn) => `
27
+ <!-- Required: set your sentry.io project identifier (DSN) -->
28
+ <meta-data android:name="io.sentry.dsn" android:value="${dsn}" />
29
+
30
+ <!-- enable automatic breadcrumbs for user interactions (clicks, swipes, scrolls) -->
31
+ <meta-data android:name="io.sentry.traces.user-interaction.enable" android:value="true" />
32
+ <!-- enable screenshot for crashes (could contain sensitive/PII data) -->
33
+ <meta-data android:name="io.sentry.attach-screenshot" android:value="true" />
34
+ <!-- enable view hierarchy for crashes -->
35
+ <meta-data android:name="io.sentry.attach-view-hierarchy" android:value="true" />
36
+
37
+ <!-- enable the performance API by setting a sample-rate, adjust in production env -->
38
+ <meta-data android:name="io.sentry.traces.sample-rate" android:value="1.0" />
39
+ `;
25
40
  exports.manifest = manifest;
26
- exports.sentryImport = "import io.sentry.Sentry;\n";
27
- exports.sentryImportKt = "import io.sentry.Sentry\n";
28
- exports.testErrorSnippet = "\n // waiting for view to draw to better represent a captured error with a screenshot\n findViewById(android.R.id.content).getViewTreeObserver().addOnGlobalLayoutListener(() -> {\n try {\n throw new Exception(\"This app uses Sentry! :)\");\n } catch (Exception e) {\n Sentry.captureException(e);\n }\n });\n";
29
- exports.testErrorSnippetKt = "\n // waiting for view to draw to better represent a captured error with a screenshot\n findViewById<android.view.View>(android.R.id.content).viewTreeObserver.addOnGlobalLayoutListener {\n try {\n throw Exception(\"This app uses Sentry! :)\")\n } catch (e: Exception) {\n Sentry.captureException(e)\n }\n }\n";
30
- var sourceContext = function (orgSlug, projectSlug) { return "\n\nsentry {\n org = \"".concat(orgSlug, "\"\n projectName = \"").concat(projectSlug, "\"\n\n // this will upload your source code to Sentry to show it as part of the stack traces\n // disable if you don't want to expose your sources\n includeSourceContext = true\n}\n"); };
41
+ exports.sentryImport = `import io.sentry.Sentry;\n`;
42
+ exports.sentryImportKt = `import io.sentry.Sentry\n`;
43
+ exports.testErrorSnippet = `
44
+ // waiting for view to draw to better represent a captured error with a screenshot
45
+ findViewById(android.R.id.content).getViewTreeObserver().addOnGlobalLayoutListener(() -> {
46
+ try {
47
+ throw new Exception("This app uses Sentry! :)");
48
+ } catch (Exception e) {
49
+ Sentry.captureException(e);
50
+ }
51
+ });
52
+ `;
53
+ exports.testErrorSnippetKt = `
54
+ // waiting for view to draw to better represent a captured error with a screenshot
55
+ findViewById<android.view.View>(android.R.id.content).viewTreeObserver.addOnGlobalLayoutListener {
56
+ try {
57
+ throw Exception("This app uses Sentry! :)")
58
+ } catch (e: Exception) {
59
+ Sentry.captureException(e)
60
+ }
61
+ }
62
+ `;
63
+ const sourceContext = (orgSlug, projectSlug) => `
64
+
65
+ sentry {
66
+ org = "${orgSlug}"
67
+ projectName = "${projectSlug}"
68
+
69
+ // this will upload your source code to Sentry to show it as part of the stack traces
70
+ // disable if you don't want to expose your sources
71
+ includeSourceContext = true
72
+ }
73
+ `;
31
74
  exports.sourceContext = sourceContext;
32
- var sourceContextKts = function (orgSlug, projectSlug) { return "\n\nsentry {\n org.set(\"".concat(orgSlug, "\")\n projectName.set(\"").concat(projectSlug, "\")\n\n // this will upload your source code to Sentry to show it as part of the stack traces\n // disable if you don't want to expose your sources\n includeSourceContext.set(true)\n}\n"); };
75
+ const sourceContextKts = (orgSlug, projectSlug) => `
76
+
77
+ sentry {
78
+ org.set("${orgSlug}")
79
+ projectName.set("${projectSlug}")
80
+
81
+ // this will upload your source code to Sentry to show it as part of the stack traces
82
+ // disable if you don't want to expose your sources
83
+ includeSourceContext.set(true)
84
+ }
85
+ `;
33
86
  exports.sourceContextKts = sourceContextKts;
34
87
  //# sourceMappingURL=templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/android/templates.ts"],"names":[],"mappings":";;;AAAO,IAAM,YAAY,GAAG,UAAC,OAAkB;IAAlB,wBAAA,EAAA,kBAAkB;IAAK,OAAA,kEAEP,OAAO,aAGnD;AALmD,CAKnD,CAAC;AALW,QAAA,YAAY,gBAKvB;AAEK,IAAM,eAAe,GAAG,UAAC,OAAkB;IAAlB,wBAAA,EAAA,kBAAkB;IAAK,OAAA,sEAET,OAAO,cAGpD;AALsD,CAKtD,CAAC;AALW,QAAA,eAAe,mBAK1B;AAEK,IAAM,MAAM,GAAG,UAAC,OAAkB;IAAlB,wBAAA,EAAA,kBAAkB;IAAK,OAAA,uDACD,OAAO,QACnD;AAF6C,CAE7C,CAAC;AAFW,QAAA,MAAM,UAEjB;AAEK,IAAM,SAAS,GAAG,UAAC,OAAkB;IAAlB,wBAAA,EAAA,kBAAkB;IAAK,OAAA,2DACH,OAAO,SACpD;AAFgD,CAEhD,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,IAAM,QAAQ,GAAG,UAAC,GAAW,IAAK,OAAA,8IAEoB,GAAG,mrBAW/D,EAbwC,CAaxC,CAAC;AAbW,QAAA,QAAQ,YAanB;AAEW,QAAA,YAAY,GAAG,4BAA4B,CAAC;AAE5C,QAAA,cAAc,GAAG,2BAA2B,CAAC;AAE7C,QAAA,gBAAgB,GAAG,2VAS/B,CAAC;AAEW,QAAA,kBAAkB,GAAG,4VASjC,CAAC;AAEK,IAAM,aAAa,GAAG,UAAC,OAAe,EAAE,WAAmB,IAAK,OAAA,oCAG1D,OAAO,qCACC,WAAW,mMAM/B,EAVsE,CAUtE,CAAC;AAVW,QAAA,aAAa,iBAUxB;AAEK,IAAM,gBAAgB,GAAG,UAAC,OAAe,EAAE,WAAmB,IAAK,OAAA,sCAG3D,OAAO,wCACC,WAAW,uMAMjC,EAVyE,CAUzE,CAAC;AAVW,QAAA,gBAAgB,oBAU3B","sourcesContent":["export const pluginsBlock = (version = '3.12.0') => `\nplugins {\n id 'io.sentry.android.gradle' version '${version}'\n}\n\n`;\n\nexport const pluginsBlockKts = (version = '3.12.0') => `\nplugins {\n id(\"io.sentry.android.gradle\") version \"${version}\"\n}\n\n`;\n\nexport const plugin = (version = '3.12.0') => `\n id 'io.sentry.android.gradle' version '${version}'\n`;\n\nexport const pluginKts = (version = '3.12.0') => `\n id(\"io.sentry.android.gradle\") version \"${version}\"\n`;\n\nexport const manifest = (dsn: string) => `\n <!-- Required: set your sentry.io project identifier (DSN) -->\n <meta-data android:name=\"io.sentry.dsn\" android:value=\"${dsn}\" />\n\n <!-- enable automatic breadcrumbs for user interactions (clicks, swipes, scrolls) -->\n <meta-data android:name=\"io.sentry.traces.user-interaction.enable\" android:value=\"true\" />\n <!-- enable screenshot for crashes (could contain sensitive/PII data) -->\n <meta-data android:name=\"io.sentry.attach-screenshot\" android:value=\"true\" />\n <!-- enable view hierarchy for crashes -->\n <meta-data android:name=\"io.sentry.attach-view-hierarchy\" android:value=\"true\" />\n\n <!-- enable the performance API by setting a sample-rate, adjust in production env -->\n <meta-data android:name=\"io.sentry.traces.sample-rate\" android:value=\"1.0\" />\n`;\n\nexport const sentryImport = `import io.sentry.Sentry;\\n`;\n\nexport const sentryImportKt = `import io.sentry.Sentry\\n`;\n\nexport const testErrorSnippet = `\n // waiting for view to draw to better represent a captured error with a screenshot\n findViewById(android.R.id.content).getViewTreeObserver().addOnGlobalLayoutListener(() -> {\n try {\n throw new Exception(\"This app uses Sentry! :)\");\n } catch (Exception e) {\n Sentry.captureException(e);\n }\n });\n`;\n\nexport const testErrorSnippetKt = `\n // waiting for view to draw to better represent a captured error with a screenshot\n findViewById<android.view.View>(android.R.id.content).viewTreeObserver.addOnGlobalLayoutListener {\n try {\n throw Exception(\"This app uses Sentry! :)\")\n } catch (e: Exception) {\n Sentry.captureException(e)\n }\n }\n`;\n\nexport const sourceContext = (orgSlug: string, projectSlug: string) => `\n\nsentry {\n org = \"${orgSlug}\"\n projectName = \"${projectSlug}\"\n\n // this will upload your source code to Sentry to show it as part of the stack traces\n // disable if you don't want to expose your sources\n includeSourceContext = true\n}\n`;\n\nexport const sourceContextKts = (orgSlug: string, projectSlug: string) => `\n\nsentry {\n org.set(\"${orgSlug}\")\n projectName.set(\"${projectSlug}\")\n\n // this will upload your source code to Sentry to show it as part of the stack traces\n // disable if you don't want to expose your sources\n includeSourceContext.set(true)\n}\n`;\n"]}
1
+ {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/android/templates.ts"],"names":[],"mappings":";;;AAAO,MAAM,YAAY,GAAG,CAAC,OAAO,GAAG,QAAQ,EAAE,EAAE,CAAC;;6CAEP,OAAO;;;CAGnD,CAAC;AALW,QAAA,YAAY,gBAKvB;AAEK,MAAM,eAAe,GAAG,CAAC,OAAO,GAAG,QAAQ,EAAE,EAAE,CAAC;;8CAET,OAAO;;;CAGpD,CAAC;AALW,QAAA,eAAe,mBAK1B;AAEK,MAAM,MAAM,GAAG,CAAC,OAAO,GAAG,QAAQ,EAAE,EAAE,CAAC;6CACD,OAAO;CACnD,CAAC;AAFW,QAAA,MAAM,UAEjB;AAEK,MAAM,SAAS,GAAG,CAAC,OAAO,GAAG,QAAQ,EAAE,EAAE,CAAC;8CACH,OAAO;CACpD,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC;;6DAEoB,GAAG;;;;;;;;;;;CAW/D,CAAC;AAbW,QAAA,QAAQ,YAanB;AAEW,QAAA,YAAY,GAAG,4BAA4B,CAAC;AAE5C,QAAA,cAAc,GAAG,2BAA2B,CAAC;AAE7C,QAAA,gBAAgB,GAAG;;;;;;;;;CAS/B,CAAC;AAEW,QAAA,kBAAkB,GAAG;;;;;;;;;CASjC,CAAC;AAEK,MAAM,aAAa,GAAG,CAAC,OAAe,EAAE,WAAmB,EAAE,EAAE,CAAC;;;aAG1D,OAAO;qBACC,WAAW;;;;;;CAM/B,CAAC;AAVW,QAAA,aAAa,iBAUxB;AAEK,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAE,WAAmB,EAAE,EAAE,CAAC;;;eAG3D,OAAO;uBACC,WAAW;;;;;;CAMjC,CAAC;AAVW,QAAA,gBAAgB,oBAU3B","sourcesContent":["export const pluginsBlock = (version = '3.12.0') => `\nplugins {\n id 'io.sentry.android.gradle' version '${version}'\n}\n\n`;\n\nexport const pluginsBlockKts = (version = '3.12.0') => `\nplugins {\n id(\"io.sentry.android.gradle\") version \"${version}\"\n}\n\n`;\n\nexport const plugin = (version = '3.12.0') => `\n id 'io.sentry.android.gradle' version '${version}'\n`;\n\nexport const pluginKts = (version = '3.12.0') => `\n id(\"io.sentry.android.gradle\") version \"${version}\"\n`;\n\nexport const manifest = (dsn: string) => `\n <!-- Required: set your sentry.io project identifier (DSN) -->\n <meta-data android:name=\"io.sentry.dsn\" android:value=\"${dsn}\" />\n\n <!-- enable automatic breadcrumbs for user interactions (clicks, swipes, scrolls) -->\n <meta-data android:name=\"io.sentry.traces.user-interaction.enable\" android:value=\"true\" />\n <!-- enable screenshot for crashes (could contain sensitive/PII data) -->\n <meta-data android:name=\"io.sentry.attach-screenshot\" android:value=\"true\" />\n <!-- enable view hierarchy for crashes -->\n <meta-data android:name=\"io.sentry.attach-view-hierarchy\" android:value=\"true\" />\n\n <!-- enable the performance API by setting a sample-rate, adjust in production env -->\n <meta-data android:name=\"io.sentry.traces.sample-rate\" android:value=\"1.0\" />\n`;\n\nexport const sentryImport = `import io.sentry.Sentry;\\n`;\n\nexport const sentryImportKt = `import io.sentry.Sentry\\n`;\n\nexport const testErrorSnippet = `\n // waiting for view to draw to better represent a captured error with a screenshot\n findViewById(android.R.id.content).getViewTreeObserver().addOnGlobalLayoutListener(() -> {\n try {\n throw new Exception(\"This app uses Sentry! :)\");\n } catch (Exception e) {\n Sentry.captureException(e);\n }\n });\n`;\n\nexport const testErrorSnippetKt = `\n // waiting for view to draw to better represent a captured error with a screenshot\n findViewById<android.view.View>(android.R.id.content).viewTreeObserver.addOnGlobalLayoutListener {\n try {\n throw Exception(\"This app uses Sentry! :)\")\n } catch (e: Exception) {\n Sentry.captureException(e)\n }\n }\n`;\n\nexport const sourceContext = (orgSlug: string, projectSlug: string) => `\n\nsentry {\n org = \"${orgSlug}\"\n projectName = \"${projectSlug}\"\n\n // this will upload your source code to Sentry to show it as part of the stack traces\n // disable if you don't want to expose your sources\n includeSourceContext = true\n}\n`;\n\nexport const sourceContextKts = (orgSlug: string, projectSlug: string) => `\n\nsentry {\n org.set(\"${orgSlug}\")\n projectName.set(\"${projectSlug}\")\n\n // this will upload your source code to Sentry to show it as part of the stack traces\n // disable if you don't want to expose your sources\n includeSourceContext.set(true)\n}\n`;\n"]}
@@ -22,42 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
- function verb(n) { return function (v) { return step([n, v]); }; }
38
- function step(op) {
39
- if (f) throw new TypeError("Generator is already executing.");
40
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
- 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;
42
- if (y = 0, t) op = [op[0] & 2, t.value];
43
- switch (op[0]) {
44
- case 0: case 1: t = op; break;
45
- case 4: _.label++; return { value: op[1], done: false };
46
- case 5: _.label++; y = op[1]; op = [0]; continue;
47
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
- default:
49
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
- if (t[2]) _.ops.pop();
54
- _.trys.pop(); continue;
55
- }
56
- op = body.call(thisArg, _);
57
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
- }
60
- };
61
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
62
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
63
27
  };
@@ -69,212 +33,152 @@ exports.runAppleWizard = void 0;
69
33
  /* eslint-disable @typescript-eslint/no-unsafe-call */
70
34
  /* eslint-disable @typescript-eslint/no-unused-vars */
71
35
  // @ts-ignore - clack is ESM and TS complains about that. It works though
72
- var prompts_1 = __importDefault(require("@clack/prompts"));
73
- var fs = __importStar(require("fs"));
74
- var path = __importStar(require("path"));
75
- var xcode_manager_1 = require("./xcode-manager");
76
- var codeTools = __importStar(require("./code-tools"));
77
- var bash = __importStar(require("../utils/bash"));
78
- var SentryUtils = __importStar(require("../utils/sentrycli-utils"));
79
- var Sentry = __importStar(require("@sentry/node"));
80
- var telemetry_1 = require("../telemetry");
81
- var cocoapod = __importStar(require("./cocoapod"));
82
- var fastlane = __importStar(require("./fastlane"));
36
+ const prompts_1 = __importDefault(require("@clack/prompts"));
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const xcode_manager_1 = require("./xcode-manager");
40
+ const codeTools = __importStar(require("./code-tools"));
41
+ const bash = __importStar(require("../utils/bash"));
42
+ const SentryUtils = __importStar(require("../utils/sentrycli-utils"));
43
+ const Sentry = __importStar(require("@sentry/node"));
44
+ const telemetry_1 = require("../telemetry");
45
+ const cocoapod = __importStar(require("./cocoapod"));
46
+ const fastlane = __importStar(require("./fastlane"));
83
47
  /* eslint-enable @typescript-eslint/no-unused-vars */
84
- var clack_utils_1 = require("../utils/clack-utils");
85
- function runAppleWizard(options) {
86
- return __awaiter(this, void 0, void 0, function () {
87
- return __generator(this, function (_a) {
88
- return [2 /*return*/, (0, telemetry_1.withTelemetry)({
89
- enabled: options.telemetryEnabled,
90
- integration: 'ios',
91
- wizardOptions: options,
92
- }, function () { return runAppleWizardWithTelementry(options); })];
93
- });
94
- });
48
+ const clack_utils_1 = require("../utils/clack-utils");
49
+ async function runAppleWizard(options) {
50
+ return (0, telemetry_1.withTelemetry)({
51
+ enabled: options.telemetryEnabled,
52
+ integration: 'ios',
53
+ wizardOptions: options,
54
+ }, () => runAppleWizardWithTelementry(options));
95
55
  }
96
56
  exports.runAppleWizard = runAppleWizard;
97
- function runAppleWizardWithTelementry(options) {
98
- return __awaiter(this, void 0, void 0, function () {
99
- var hasCli, projectDir, xcodeProjFiles, xcodeProjFile, pbxproj, _a, project, apiKey, xcProject, availableTargets, target, _b, hasCocoa, pm, podAdded, codeAdded, hasFastlane, addLane, added;
100
- return __generator(this, function (_c) {
101
- switch (_c.label) {
102
- case 0:
103
- (0, clack_utils_1.printWelcome)({
104
- wizardName: 'Sentry Apple Wizard',
105
- promoCode: options.promoCode,
106
- });
107
- return [4 /*yield*/, (0, clack_utils_1.confirmContinueIfNoOrDirtyGitRepo)()];
108
- case 1:
109
- _c.sent();
110
- hasCli = bash.hasSentryCLI();
111
- Sentry.setTag('has-cli', hasCli);
112
- if (!!hasCli) return [3 /*break*/, 5];
113
- return [4 /*yield*/, (0, telemetry_1.traceStep)('Ask for SentryCLI', function () { return (0, clack_utils_1.askToInstallSentryCLI)(); })];
114
- case 2:
115
- if (!!(_c.sent())) return [3 /*break*/, 3];
116
- prompts_1.default.log.warn("Without sentry-cli, you won't be able to upload debug symbols to Sentry. You can install it later by following the instructions at https://docs.sentry.io/cli/");
117
- Sentry.setTag('CLI-Installed', false);
118
- return [3 /*break*/, 5];
119
- case 3: return [4 /*yield*/, bash.installSentryCLI()];
120
- case 4:
121
- _c.sent();
122
- Sentry.setTag('CLI-Installed', true);
123
- _c.label = 5;
124
- case 5:
125
- projectDir = process.cwd();
126
- xcodeProjFiles = searchXcodeProject(projectDir);
127
- if (!(!xcodeProjFiles || xcodeProjFiles.length === 0)) return [3 /*break*/, 7];
128
- prompts_1.default.log.error('No Xcode project found. Please run this command from the root of your project.');
129
- return [4 /*yield*/, (0, clack_utils_1.abort)()];
130
- case 6:
131
- _c.sent();
132
- return [2 /*return*/];
133
- case 7:
134
- if (!(xcodeProjFiles.length === 1)) return [3 /*break*/, 8];
135
- xcodeProjFile = xcodeProjFiles[0];
136
- Sentry.setTag('multiple-projects', false);
137
- return [3 /*break*/, 10];
138
- case 8:
139
- Sentry.setTag('multiple-projects', true);
140
- return [4 /*yield*/, (0, telemetry_1.traceStep)('Choose Xcode project', function () {
141
- return (0, clack_utils_1.askForItemSelection)(xcodeProjFiles, 'Which project do you want to add Sentry to?');
142
- })];
143
- case 9:
144
- xcodeProjFile = (_c.sent()).value;
145
- _c.label = 10;
146
- case 10:
147
- pbxproj = path.join(projectDir, xcodeProjFile, 'project.pbxproj');
148
- if (!!fs.existsSync(pbxproj)) return [3 /*break*/, 12];
149
- prompts_1.default.log.error("No pbxproj found at ".concat(xcodeProjFile));
150
- return [4 /*yield*/, (0, clack_utils_1.abort)()];
151
- case 11:
152
- _c.sent();
153
- return [2 /*return*/];
154
- case 12: return [4 /*yield*/, getSentryProjectAndApiKey(options)];
155
- case 13:
156
- _a = _c.sent(), project = _a.project, apiKey = _a.apiKey;
157
- xcProject = new xcode_manager_1.XcodeProject(pbxproj);
158
- availableTargets = xcProject.getAllTargets();
159
- if (!(availableTargets.length == 0)) return [3 /*break*/, 15];
160
- prompts_1.default.log.error("No suitable target found in ".concat(xcodeProjFile));
161
- Sentry.setTag('No-Target', true);
162
- return [4 /*yield*/, (0, clack_utils_1.abort)()];
163
- case 14:
164
- _c.sent();
165
- return [2 /*return*/];
166
- case 15:
167
- if (!(availableTargets.length == 1)) return [3 /*break*/, 16];
168
- _b = availableTargets[0];
169
- return [3 /*break*/, 18];
170
- case 16: return [4 /*yield*/, (0, telemetry_1.traceStep)('Choose target', function () {
171
- return (0, clack_utils_1.askForItemSelection)(availableTargets, 'Which target do you want to add Sentry to?');
172
- })];
173
- case 17:
174
- _b = (_c.sent()).value;
175
- _c.label = 18;
176
- case 18:
177
- target = _b;
178
- SentryUtils.createSentryCLIRC(projectDir, { auth_token: apiKey.token });
179
- prompts_1.default.log.info('We created a ".sentryclirc" file in your project directory in order to provide an auth token for Sentry CLI.\nIt was also added to your ".gitignore" file.\nAt your CI enviroment, you can set the SENTRY_AUTH_TOKEN environment variable instead. See https://docs.sentry.io/cli/configuration/#auth-token for more information.');
180
- hasCocoa = cocoapod.usesCocoaPod(projectDir);
181
- Sentry.setTag('cocoapod-exists', hasCocoa);
182
- if (!hasCocoa) return [3 /*break*/, 21];
183
- return [4 /*yield*/, (0, telemetry_1.traceStep)('Choose a package manager', function () {
184
- return (0, clack_utils_1.askForItemSelection)(['Swift Package Manager', 'CocoaPods'], 'Which package manager would you like to use to add Sentry?');
185
- })];
186
- case 19:
187
- pm = (_c.sent()).value;
188
- hasCocoa = pm === 'CocoaPods';
189
- if (!hasCocoa) return [3 /*break*/, 21];
190
- return [4 /*yield*/, (0, telemetry_1.traceStep)('Add CocoaPods reference', function () {
191
- return cocoapod.addCocoaPods(projectDir);
192
- })];
193
- case 20:
194
- podAdded = _c.sent();
195
- Sentry.setTag('cocoapod-added', podAdded);
196
- if (!podAdded) {
197
- prompts_1.default.log.warn("Could not add Sentry pod to your Podfile. You'll have to add it manually.\nPlease follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/#install");
198
- }
199
- _c.label = 21;
200
- case 21:
201
- Sentry.setTag('package-manager', hasCocoa ? 'cocoapods' : 'SPM');
202
- (0, telemetry_1.traceStep)('Update Xcode project', function () {
203
- xcProject.updateXcodeProject(project, target, !hasCocoa, true);
204
- });
205
- codeAdded = (0, telemetry_1.traceStep)('Add code snippet', function () {
206
- var files = xcProject.filesForTarget(target);
207
- if (files === undefined || files.length == 0)
208
- return false;
209
- return codeTools.addCodeSnippetToProject(projectDir, files, project.keys[0].dsn.public);
210
- });
211
- Sentry.setTag('Snippet-Added', codeAdded);
212
- if (!codeAdded) {
213
- prompts_1.default.log.warn('Added the Sentry dependency to your project but could not add the Sentry code snippet. Please add the code snipped manually by following the docs: https://docs.sentry.io/platforms/apple/guides/ios/#configure');
214
- }
215
- hasFastlane = fastlane.fastFile(projectDir);
216
- Sentry.setTag('fastlane-exists', hasFastlane);
217
- if (!hasFastlane) return [3 /*break*/, 24];
218
- return [4 /*yield*/, prompts_1.default.confirm({
219
- message: 'Found a Fastfile in your project. Do you want to configure a lane to upload debug symbols to Sentry?',
220
- })];
221
- case 22:
222
- addLane = _c.sent();
223
- Sentry.setTag('fastlane-desired', addLane);
224
- if (!addLane) return [3 /*break*/, 24];
225
- return [4 /*yield*/, (0, telemetry_1.traceStep)('Configure fastlane', function () {
226
- return fastlane.addSentryToFastlane(projectDir, project.organization.slug, project.slug);
227
- })];
228
- case 23:
229
- added = _c.sent();
230
- Sentry.setTag('fastlane-added', added);
231
- if (added) {
232
- prompts_1.default.log.step('A new step was added to your fastlane file. Now and you build your project with fastlane, debug symbols and source context will be uploaded to Sentry.');
233
- }
234
- else {
235
- prompts_1.default.log.warn('Could not edit your fastlane file to upload debug symbols to Sentry. Please follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/dsym/#fastlane');
236
- }
237
- _c.label = 24;
238
- case 24:
239
- prompts_1.default.log.success('Sentry was successfully added to your project! Run your project to send your first event to Sentry. Go to Sentry.io to see whether everything is working fine.');
240
- return [2 /*return*/];
57
+ async function runAppleWizardWithTelementry(options) {
58
+ (0, clack_utils_1.printWelcome)({
59
+ wizardName: 'Sentry Apple Wizard',
60
+ promoCode: options.promoCode,
61
+ });
62
+ await (0, clack_utils_1.confirmContinueIfNoOrDirtyGitRepo)();
63
+ const hasCli = bash.hasSentryCLI();
64
+ Sentry.setTag('has-cli', hasCli);
65
+ if (!hasCli) {
66
+ if (!(await (0, telemetry_1.traceStep)('Ask for SentryCLI', () => (0, clack_utils_1.askToInstallSentryCLI)()))) {
67
+ prompts_1.default.log.warn("Without sentry-cli, you won't be able to upload debug symbols to Sentry. You can install it later by following the instructions at https://docs.sentry.io/cli/");
68
+ Sentry.setTag('CLI-Installed', false);
69
+ }
70
+ else {
71
+ await bash.installSentryCLI();
72
+ Sentry.setTag('CLI-Installed', true);
73
+ }
74
+ }
75
+ const projectDir = process.cwd();
76
+ const xcodeProjFiles = searchXcodeProject(projectDir);
77
+ if (!xcodeProjFiles || xcodeProjFiles.length === 0) {
78
+ prompts_1.default.log.error('No Xcode project found. Please run this command from the root of your project.');
79
+ await (0, clack_utils_1.abort)();
80
+ return;
81
+ }
82
+ let xcodeProjFile;
83
+ if (xcodeProjFiles.length === 1) {
84
+ xcodeProjFile = xcodeProjFiles[0];
85
+ Sentry.setTag('multiple-projects', false);
86
+ }
87
+ else {
88
+ Sentry.setTag('multiple-projects', true);
89
+ xcodeProjFile = (await (0, telemetry_1.traceStep)('Choose Xcode project', () => (0, clack_utils_1.askForItemSelection)(xcodeProjFiles, 'Which project do you want to add Sentry to?'))).value;
90
+ }
91
+ const pbxproj = path.join(projectDir, xcodeProjFile, 'project.pbxproj');
92
+ if (!fs.existsSync(pbxproj)) {
93
+ prompts_1.default.log.error(`No pbxproj found at ${xcodeProjFile}`);
94
+ await (0, clack_utils_1.abort)();
95
+ return;
96
+ }
97
+ const { project, apiKey } = await getSentryProjectAndApiKey(options);
98
+ const xcProject = new xcode_manager_1.XcodeProject(pbxproj);
99
+ const availableTargets = xcProject.getAllTargets();
100
+ if (availableTargets.length == 0) {
101
+ prompts_1.default.log.error(`No suitable target found in ${xcodeProjFile}`);
102
+ Sentry.setTag('No-Target', true);
103
+ await (0, clack_utils_1.abort)();
104
+ return;
105
+ }
106
+ const target = availableTargets.length == 1
107
+ ? availableTargets[0]
108
+ : (await (0, telemetry_1.traceStep)('Choose target', () => (0, clack_utils_1.askForItemSelection)(availableTargets, 'Which target do you want to add Sentry to?'))).value;
109
+ SentryUtils.createSentryCLIRC(projectDir, { auth_token: apiKey.token });
110
+ prompts_1.default.log.info('We created a ".sentryclirc" file in your project directory in order to provide an auth token for Sentry CLI.\nIt was also added to your ".gitignore" file.\nAt your CI enviroment, you can set the SENTRY_AUTH_TOKEN environment variable instead. See https://docs.sentry.io/cli/configuration/#auth-token for more information.');
111
+ let hasCocoa = cocoapod.usesCocoaPod(projectDir);
112
+ Sentry.setTag('cocoapod-exists', hasCocoa);
113
+ if (hasCocoa) {
114
+ const pm = (await (0, telemetry_1.traceStep)('Choose a package manager', () => (0, clack_utils_1.askForItemSelection)(['Swift Package Manager', 'CocoaPods'], 'Which package manager would you like to use to add Sentry?'))).value;
115
+ hasCocoa = pm === 'CocoaPods';
116
+ if (hasCocoa) {
117
+ const podAdded = await (0, telemetry_1.traceStep)('Add CocoaPods reference', () => cocoapod.addCocoaPods(projectDir));
118
+ Sentry.setTag('cocoapod-added', podAdded);
119
+ if (!podAdded) {
120
+ prompts_1.default.log.warn("Could not add Sentry pod to your Podfile. You'll have to add it manually.\nPlease follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/#install");
241
121
  }
242
- });
122
+ }
123
+ }
124
+ Sentry.setTag('package-manager', hasCocoa ? 'cocoapods' : 'SPM');
125
+ (0, telemetry_1.traceStep)('Update Xcode project', () => {
126
+ xcProject.updateXcodeProject(project, target, !hasCocoa, true);
243
127
  });
128
+ const codeAdded = (0, telemetry_1.traceStep)('Add code snippet', () => {
129
+ const files = xcProject.filesForTarget(target);
130
+ if (files === undefined || files.length == 0)
131
+ return false;
132
+ return codeTools.addCodeSnippetToProject(projectDir, files, project.keys[0].dsn.public);
133
+ });
134
+ Sentry.setTag('Snippet-Added', codeAdded);
135
+ if (!codeAdded) {
136
+ prompts_1.default.log.warn('Added the Sentry dependency to your project but could not add the Sentry code snippet. Please add the code snipped manually by following the docs: https://docs.sentry.io/platforms/apple/guides/ios/#configure');
137
+ }
138
+ const hasFastlane = fastlane.fastFile(projectDir);
139
+ Sentry.setTag('fastlane-exists', hasFastlane);
140
+ if (hasFastlane) {
141
+ const addLane = await prompts_1.default.confirm({
142
+ message: 'Found a Fastfile in your project. Do you want to configure a lane to upload debug symbols to Sentry?',
143
+ });
144
+ Sentry.setTag('fastlane-desired', addLane);
145
+ if (addLane) {
146
+ const added = await (0, telemetry_1.traceStep)('Configure fastlane', () => fastlane.addSentryToFastlane(projectDir, project.organization.slug, project.slug));
147
+ Sentry.setTag('fastlane-added', added);
148
+ if (added) {
149
+ prompts_1.default.log.step('A new step was added to your fastlane file. Now and you build your project with fastlane, debug symbols and source context will be uploaded to Sentry.');
150
+ }
151
+ else {
152
+ prompts_1.default.log.warn('Could not edit your fastlane file to upload debug symbols to Sentry. Please follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/dsym/#fastlane');
153
+ }
154
+ }
155
+ }
156
+ prompts_1.default.log.success('Sentry was successfully added to your project! Run your project to send your first event to Sentry. Go to Sentry.io to see whether everything is working fine.');
244
157
  }
245
158
  //Prompt for Sentry project and API key
246
- function getSentryProjectAndApiKey(options) {
247
- return __awaiter(this, void 0, void 0, function () {
248
- var _a, selectedProject, authToken;
249
- return __generator(this, function (_b) {
250
- switch (_b.label) {
251
- case 0: return [4 /*yield*/, (0, clack_utils_1.getOrAskForProjectData)(options)];
252
- case 1:
253
- _a = _b.sent(), selectedProject = _a.selectedProject, authToken = _a.authToken;
254
- return [2 /*return*/, { project: selectedProject, apiKey: { token: authToken } }];
255
- }
256
- });
257
- });
159
+ async function getSentryProjectAndApiKey(options) {
160
+ const { selectedProject, authToken } = await (0, clack_utils_1.getOrAskForProjectData)(options);
161
+ return { project: selectedProject, apiKey: { token: authToken } };
258
162
  }
259
163
  function searchXcodeProject(at) {
260
- var projs = findFilesWithExtension(at, '.xcodeproj');
164
+ const projs = findFilesWithExtension(at, '.xcodeproj');
261
165
  if (projs.length > 0) {
262
166
  return projs;
263
167
  }
264
- var workspace = findFilesWithExtension(at, '.xcworkspace');
168
+ const workspace = findFilesWithExtension(at, '.xcworkspace');
265
169
  if (workspace.length == 0) {
266
170
  return [];
267
171
  }
268
- var xsworkspacedata = path.join(at, workspace[0], 'contents.xcworkspacedata');
172
+ const xsworkspacedata = path.join(at, workspace[0], 'contents.xcworkspacedata');
269
173
  if (!fs.existsSync(xsworkspacedata)) {
270
174
  return [];
271
175
  }
272
- var groupRegex = /location *= *"group:([^"]+)"/gim;
273
- var content = fs.readFileSync(xsworkspacedata, 'utf8');
274
- var matches = groupRegex.exec(content);
176
+ const groupRegex = /location *= *"group:([^"]+)"/gim;
177
+ const content = fs.readFileSync(xsworkspacedata, 'utf8');
178
+ let matches = groupRegex.exec(content);
275
179
  while (matches) {
276
- var group = matches[1];
277
- var groupPath = path.join(at, group);
180
+ const group = matches[1];
181
+ const groupPath = path.join(at, group);
278
182
  if (!group.endsWith('Pods.xcodeproj') &&
279
183
  group.endsWith('.xcodeproj') &&
280
184
  fs.existsSync(groupPath)) {
@@ -286,7 +190,7 @@ function searchXcodeProject(at) {
286
190
  }
287
191
  //find files with the given extension
288
192
  function findFilesWithExtension(dir, extension) {
289
- var files = fs.readdirSync(dir);
290
- return files.filter(function (file) { return file.endsWith(extension); });
193
+ const files = fs.readdirSync(dir);
194
+ return files.filter((file) => file.endsWith(extension));
291
195
  }
292
196
  //# sourceMappingURL=apple-wizard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"apple-wizard.js","sourceRoot":"","sources":["../../../src/apple/apple-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,+DAA+D;AAC/D,4DAA4D;AAC5D,sDAAsD;AACtD,sDAAsD;AACtD,yEAAyE;AACzE,2DAAmC;AACnC,qCAAyB;AACzB,yCAA6B;AAC7B,iDAA+C;AAC/C,sDAA0C;AAC1C,kDAAsC;AACtC,oEAAwD;AAExD,mDAAuC;AACvC,0CAAwD;AACxD,mDAAuC;AACvC,mDAAuC;AAEvC,qDAAqD;AAErD,oDAO8B;AAE9B,SAAsB,cAAc,CAAC,OAAsB;;;YACzD,sBAAO,IAAA,yBAAa,EAClB;oBACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;oBACjC,WAAW,EAAE,KAAK;oBAClB,aAAa,EAAE,OAAO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AO,EAAE,CAAC;KACX;IACD,IAAM,UAAU,GAAG,iCAAiC,CAAC;IACrD,IAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IACzD,IAAI,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEvC,OAAO,OAAO,EAAE;QACd,IAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACzB,IAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACvC,IACE,CAAC,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YACjC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC5B,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EACxB;YACA,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACnB;QACD,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACpC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,qCAAqC;AACrC,SAAS,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IAC5D,IAAM,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,KAAK,CAAC,MAAM,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAxB,CAAwB,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { XcodeProject } from './xcode-manager';\nimport * as codeTools from './code-tools';\nimport * as bash from '../utils/bash';\nimport * as SentryUtils from '../utils/sentrycli-utils';\nimport { SentryProjectData, WizardOptions } from '../utils/types';\nimport * as Sentry from '@sentry/node';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport * as cocoapod from './cocoapod';\nimport * as fastlane from './fastlane';\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nimport {\n askToInstallSentryCLI,\n printWelcome,\n abort,\n askForItemSelection,\n confirmContinueIfNoOrDirtyGitRepo,\n getOrAskForProjectData,\n} from '../utils/clack-utils';\n\nexport async function runAppleWizard(options: WizardOptions): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'ios',\n wizardOptions: options,\n },\n () => runAppleWizardWithTelementry(options),\n );\n}\n\nasync function runAppleWizardWithTelementry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Apple Wizard',\n promoCode: options.promoCode,\n });\n\n await confirmContinueIfNoOrDirtyGitRepo();\n\n const hasCli = bash.hasSentryCLI();\n Sentry.setTag('has-cli', hasCli);\n if (!hasCli) {\n if (\n !(await traceStep('Ask for SentryCLI', () => askToInstallSentryCLI()))\n ) {\n clack.log.warn(\n \"Without sentry-cli, you won't be able to upload debug symbols to Sentry. You can install it later by following the instructions at https://docs.sentry.io/cli/\",\n );\n Sentry.setTag('CLI-Installed', false);\n } else {\n await bash.installSentryCLI();\n Sentry.setTag('CLI-Installed', true);\n }\n }\n\n const projectDir = process.cwd();\n const xcodeProjFiles = searchXcodeProject(projectDir);\n\n if (!xcodeProjFiles || xcodeProjFiles.length === 0) {\n clack.log.error(\n 'No Xcode project found. Please run this command from the root of your project.',\n );\n await abort();\n return;\n }\n\n let xcodeProjFile;\n\n if (xcodeProjFiles.length === 1) {\n xcodeProjFile = xcodeProjFiles[0];\n Sentry.setTag('multiple-projects', false);\n } else {\n Sentry.setTag('multiple-projects', true);\n xcodeProjFile = (\n await traceStep('Choose Xcode project', () =>\n askForItemSelection(\n xcodeProjFiles,\n 'Which project do you want to add Sentry to?',\n ),\n )\n ).value;\n }\n\n const pbxproj = path.join(projectDir, xcodeProjFile, 'project.pbxproj');\n\n if (!fs.existsSync(pbxproj)) {\n clack.log.error(`No pbxproj found at ${xcodeProjFile}`);\n await abort();\n return;\n }\n\n const { project, apiKey } = await getSentryProjectAndApiKey(options);\n\n const xcProject = new XcodeProject(pbxproj);\n\n const availableTargets = xcProject.getAllTargets();\n\n if (availableTargets.length == 0) {\n clack.log.error(`No suitable target found in ${xcodeProjFile}`);\n Sentry.setTag('No-Target', true);\n await abort();\n return;\n }\n\n const target =\n availableTargets.length == 1\n ? availableTargets[0]\n : (\n await traceStep('Choose target', () =>\n askForItemSelection(\n availableTargets,\n 'Which target do you want to add Sentry to?',\n ),\n )\n ).value;\n\n SentryUtils.createSentryCLIRC(projectDir, { auth_token: apiKey.token });\n clack.log.info(\n 'We created a \".sentryclirc\" file in your project directory in order to provide an auth token for Sentry CLI.\\nIt was also added to your \".gitignore\" file.\\nAt your CI enviroment, you can set the SENTRY_AUTH_TOKEN environment variable instead. See https://docs.sentry.io/cli/configuration/#auth-token for more information.',\n );\n\n let hasCocoa = cocoapod.usesCocoaPod(projectDir);\n Sentry.setTag('cocoapod-exists', hasCocoa);\n\n if (hasCocoa) {\n const pm = (\n await traceStep('Choose a package manager', () =>\n askForItemSelection(\n ['Swift Package Manager', 'CocoaPods'],\n 'Which package manager would you like to use to add Sentry?',\n ),\n )\n ).value;\n\n hasCocoa = pm === 'CocoaPods';\n if (hasCocoa) {\n const podAdded = await traceStep('Add CocoaPods reference', () =>\n cocoapod.addCocoaPods(projectDir),\n );\n Sentry.setTag('cocoapod-added', podAdded);\n if (!podAdded) {\n clack.log.warn(\n \"Could not add Sentry pod to your Podfile. You'll have to add it manually.\\nPlease follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/#install\",\n );\n }\n }\n }\n\n Sentry.setTag('package-manager', hasCocoa ? 'cocoapods' : 'SPM');\n traceStep('Update Xcode project', () => {\n xcProject.updateXcodeProject(project, target, !hasCocoa, true);\n });\n\n const codeAdded = traceStep('Add code snippet', () => {\n const files = xcProject.filesForTarget(target);\n if (files === undefined || files.length == 0) return false;\n\n return codeTools.addCodeSnippetToProject(\n projectDir,\n files,\n project.keys[0].dsn.public,\n );\n });\n\n Sentry.setTag('Snippet-Added', codeAdded);\n\n if (!codeAdded) {\n clack.log.warn(\n 'Added the Sentry dependency to your project but could not add the Sentry code snippet. Please add the code snipped manually by following the docs: https://docs.sentry.io/platforms/apple/guides/ios/#configure',\n );\n }\n\n const hasFastlane = fastlane.fastFile(projectDir);\n Sentry.setTag('fastlane-exists', hasFastlane);\n if (hasFastlane) {\n const addLane = await clack.confirm({\n message:\n 'Found a Fastfile in your project. Do you want to configure a lane to upload debug symbols to Sentry?',\n });\n Sentry.setTag('fastlane-desired', addLane);\n if (addLane) {\n const added = await traceStep('Configure fastlane', () =>\n fastlane.addSentryToFastlane(\n projectDir,\n project.organization.slug,\n project.slug,\n ),\n );\n Sentry.setTag('fastlane-added', added);\n if (added) {\n clack.log.step(\n 'A new step was added to your fastlane file. Now and you build your project with fastlane, debug symbols and source context will be uploaded to Sentry.',\n );\n } else {\n clack.log.warn(\n 'Could not edit your fastlane file to upload debug symbols to Sentry. Please follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/dsym/#fastlane',\n );\n }\n }\n }\n\n clack.log.success(\n 'Sentry was successfully added to your project! Run your project to send your first event to Sentry. Go to Sentry.io to see whether everything is working fine.',\n );\n}\n\n//Prompt for Sentry project and API key\nasync function getSentryProjectAndApiKey(\n options: WizardOptions,\n): Promise<{ project: SentryProjectData; apiKey: { token: string } }> {\n const { selectedProject, authToken } = await getOrAskForProjectData(options);\n return { project: selectedProject, apiKey: { token: authToken } };\n}\n\nfunction searchXcodeProject(at: string): string[] {\n const projs = findFilesWithExtension(at, '.xcodeproj');\n if (projs.length > 0) {\n return projs;\n }\n\n const workspace = findFilesWithExtension(at, '.xcworkspace');\n if (workspace.length == 0) {\n return [];\n }\n\n const xsworkspacedata = path.join(\n at,\n workspace[0],\n 'contents.xcworkspacedata',\n );\n if (!fs.existsSync(xsworkspacedata)) {\n return [];\n }\n const groupRegex = /location *= *\"group:([^\"]+)\"/gim;\n const content = fs.readFileSync(xsworkspacedata, 'utf8');\n let matches = groupRegex.exec(content);\n\n while (matches) {\n const group = matches[1];\n const groupPath = path.join(at, group);\n if (\n !group.endsWith('Pods.xcodeproj') &&\n group.endsWith('.xcodeproj') &&\n fs.existsSync(groupPath)\n ) {\n projs.push(group);\n }\n matches = groupRegex.exec(content);\n }\n return projs;\n}\n\n//find files with the given extension\nfunction findFilesWithExtension(dir: string, extension: string): string[] {\n const files = fs.readdirSync(dir);\n return files.filter((file) => file.endsWith(extension));\n}\n"]}
1
+ {"version":3,"file":"apple-wizard.js","sourceRoot":"","sources":["../../../src/apple/apple-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,+DAA+D;AAC/D,4DAA4D;AAC5D,sDAAsD;AACtD,sDAAsD;AACtD,yEAAyE;AACzE,6DAAmC;AACnC,uCAAyB;AACzB,2CAA6B;AAC7B,mDAA+C;AAC/C,wDAA0C;AAC1C,oDAAsC;AACtC,sEAAwD;AAExD,qDAAuC;AACvC,4CAAwD;AACxD,qDAAuC;AACvC,qDAAuC;AAEvC,qDAAqD;AAErD,sDAO8B;AAEvB,KAAK,UAAU,cAAc,CAAC,OAAsB;IACzD,OAAO,IAAA,yBAAa,EAClB;QACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;QACjC,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,OAAO;KACvB,EACD,GAAG,EAAE,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAC5C,CAAC;AACJ,CAAC;AATD,wCASC;AAED,KAAK,UAAU,4BAA4B,CACzC,OAAsB;IAEtB,IAAA,0BAAY,EAAC;QACX,UAAU,EAAE,qBAAqB;QACjC,SAAS,EAAE,OAAO,CAAC,SAA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AAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACpC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,qCAAqC;AACrC,SAAS,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IAC5D,MAAM,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { XcodeProject } from './xcode-manager';\nimport * as codeTools from './code-tools';\nimport * as bash from '../utils/bash';\nimport * as SentryUtils from '../utils/sentrycli-utils';\nimport { SentryProjectData, WizardOptions } from '../utils/types';\nimport * as Sentry from '@sentry/node';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport * as cocoapod from './cocoapod';\nimport * as fastlane from './fastlane';\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nimport {\n askToInstallSentryCLI,\n printWelcome,\n abort,\n askForItemSelection,\n confirmContinueIfNoOrDirtyGitRepo,\n getOrAskForProjectData,\n} from '../utils/clack-utils';\n\nexport async function runAppleWizard(options: WizardOptions): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'ios',\n wizardOptions: options,\n },\n () => runAppleWizardWithTelementry(options),\n );\n}\n\nasync function runAppleWizardWithTelementry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Apple Wizard',\n promoCode: options.promoCode,\n });\n\n await confirmContinueIfNoOrDirtyGitRepo();\n\n const hasCli = bash.hasSentryCLI();\n Sentry.setTag('has-cli', hasCli);\n if (!hasCli) {\n if (\n !(await traceStep('Ask for SentryCLI', () => askToInstallSentryCLI()))\n ) {\n clack.log.warn(\n \"Without sentry-cli, you won't be able to upload debug symbols to Sentry. You can install it later by following the instructions at https://docs.sentry.io/cli/\",\n );\n Sentry.setTag('CLI-Installed', false);\n } else {\n await bash.installSentryCLI();\n Sentry.setTag('CLI-Installed', true);\n }\n }\n\n const projectDir = process.cwd();\n const xcodeProjFiles = searchXcodeProject(projectDir);\n\n if (!xcodeProjFiles || xcodeProjFiles.length === 0) {\n clack.log.error(\n 'No Xcode project found. Please run this command from the root of your project.',\n );\n await abort();\n return;\n }\n\n let xcodeProjFile;\n\n if (xcodeProjFiles.length === 1) {\n xcodeProjFile = xcodeProjFiles[0];\n Sentry.setTag('multiple-projects', false);\n } else {\n Sentry.setTag('multiple-projects', true);\n xcodeProjFile = (\n await traceStep('Choose Xcode project', () =>\n askForItemSelection(\n xcodeProjFiles,\n 'Which project do you want to add Sentry to?',\n ),\n )\n ).value;\n }\n\n const pbxproj = path.join(projectDir, xcodeProjFile, 'project.pbxproj');\n\n if (!fs.existsSync(pbxproj)) {\n clack.log.error(`No pbxproj found at ${xcodeProjFile}`);\n await abort();\n return;\n }\n\n const { project, apiKey } = await getSentryProjectAndApiKey(options);\n\n const xcProject = new XcodeProject(pbxproj);\n\n const availableTargets = xcProject.getAllTargets();\n\n if (availableTargets.length == 0) {\n clack.log.error(`No suitable target found in ${xcodeProjFile}`);\n Sentry.setTag('No-Target', true);\n await abort();\n return;\n }\n\n const target =\n availableTargets.length == 1\n ? availableTargets[0]\n : (\n await traceStep('Choose target', () =>\n askForItemSelection(\n availableTargets,\n 'Which target do you want to add Sentry to?',\n ),\n )\n ).value;\n\n SentryUtils.createSentryCLIRC(projectDir, { auth_token: apiKey.token });\n clack.log.info(\n 'We created a \".sentryclirc\" file in your project directory in order to provide an auth token for Sentry CLI.\\nIt was also added to your \".gitignore\" file.\\nAt your CI enviroment, you can set the SENTRY_AUTH_TOKEN environment variable instead. See https://docs.sentry.io/cli/configuration/#auth-token for more information.',\n );\n\n let hasCocoa = cocoapod.usesCocoaPod(projectDir);\n Sentry.setTag('cocoapod-exists', hasCocoa);\n\n if (hasCocoa) {\n const pm = (\n await traceStep('Choose a package manager', () =>\n askForItemSelection(\n ['Swift Package Manager', 'CocoaPods'],\n 'Which package manager would you like to use to add Sentry?',\n ),\n )\n ).value;\n\n hasCocoa = pm === 'CocoaPods';\n if (hasCocoa) {\n const podAdded = await traceStep('Add CocoaPods reference', () =>\n cocoapod.addCocoaPods(projectDir),\n );\n Sentry.setTag('cocoapod-added', podAdded);\n if (!podAdded) {\n clack.log.warn(\n \"Could not add Sentry pod to your Podfile. You'll have to add it manually.\\nPlease follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/#install\",\n );\n }\n }\n }\n\n Sentry.setTag('package-manager', hasCocoa ? 'cocoapods' : 'SPM');\n traceStep('Update Xcode project', () => {\n xcProject.updateXcodeProject(project, target, !hasCocoa, true);\n });\n\n const codeAdded = traceStep('Add code snippet', () => {\n const files = xcProject.filesForTarget(target);\n if (files === undefined || files.length == 0) return false;\n\n return codeTools.addCodeSnippetToProject(\n projectDir,\n files,\n project.keys[0].dsn.public,\n );\n });\n\n Sentry.setTag('Snippet-Added', codeAdded);\n\n if (!codeAdded) {\n clack.log.warn(\n 'Added the Sentry dependency to your project but could not add the Sentry code snippet. Please add the code snipped manually by following the docs: https://docs.sentry.io/platforms/apple/guides/ios/#configure',\n );\n }\n\n const hasFastlane = fastlane.fastFile(projectDir);\n Sentry.setTag('fastlane-exists', hasFastlane);\n if (hasFastlane) {\n const addLane = await clack.confirm({\n message:\n 'Found a Fastfile in your project. Do you want to configure a lane to upload debug symbols to Sentry?',\n });\n Sentry.setTag('fastlane-desired', addLane);\n if (addLane) {\n const added = await traceStep('Configure fastlane', () =>\n fastlane.addSentryToFastlane(\n projectDir,\n project.organization.slug,\n project.slug,\n ),\n );\n Sentry.setTag('fastlane-added', added);\n if (added) {\n clack.log.step(\n 'A new step was added to your fastlane file. Now and you build your project with fastlane, debug symbols and source context will be uploaded to Sentry.',\n );\n } else {\n clack.log.warn(\n 'Could not edit your fastlane file to upload debug symbols to Sentry. Please follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/dsym/#fastlane',\n );\n }\n }\n }\n\n clack.log.success(\n 'Sentry was successfully added to your project! Run your project to send your first event to Sentry. Go to Sentry.io to see whether everything is working fine.',\n );\n}\n\n//Prompt for Sentry project and API key\nasync function getSentryProjectAndApiKey(\n options: WizardOptions,\n): Promise<{ project: SentryProjectData; apiKey: { token: string } }> {\n const { selectedProject, authToken } = await getOrAskForProjectData(options);\n return { project: selectedProject, apiKey: { token: authToken } };\n}\n\nfunction searchXcodeProject(at: string): string[] {\n const projs = findFilesWithExtension(at, '.xcodeproj');\n if (projs.length > 0) {\n return projs;\n }\n\n const workspace = findFilesWithExtension(at, '.xcworkspace');\n if (workspace.length == 0) {\n return [];\n }\n\n const xsworkspacedata = path.join(\n at,\n workspace[0],\n 'contents.xcworkspacedata',\n );\n if (!fs.existsSync(xsworkspacedata)) {\n return [];\n }\n const groupRegex = /location *= *\"group:([^\"]+)\"/gim;\n const content = fs.readFileSync(xsworkspacedata, 'utf8');\n let matches = groupRegex.exec(content);\n\n while (matches) {\n const group = matches[1];\n const groupPath = path.join(at, group);\n if (\n !group.endsWith('Pods.xcodeproj') &&\n group.endsWith('.xcodeproj') &&\n fs.existsSync(groupPath)\n ) {\n projs.push(group);\n }\n matches = groupRegex.exec(content);\n }\n return projs;\n}\n\n//find files with the given extension\nfunction findFilesWithExtension(dir: string, extension: string): string[] {\n const files = fs.readdirSync(dir);\n return files.filter((file) => file.endsWith(extension));\n}\n"]}