@sentry/wizard 3.42.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/.node-cache/node-v22.14.0-darwin-arm64 +0 -0
  2. package/.node-cache/node-v22.14.0-darwin-x64 +0 -0
  3. package/.node-cache/node-v22.14.0-linux-arm64 +0 -0
  4. package/.node-cache/node-v22.14.0-linux-x64 +0 -0
  5. package/.node-cache/node-v22.14.0-win-x64.exe +0 -0
  6. package/CHANGELOG.md +26 -0
  7. package/COPYING +3575 -0
  8. package/bin.ts +85 -80
  9. package/dist/bin.js +44 -35
  10. package/dist/bin.js.map +1 -1
  11. package/dist/e2e-tests/jest.config.js +1 -1
  12. package/dist/e2e-tests/jest.config.js.map +1 -1
  13. package/dist/e2e-tests/tests/flutter.test.js +62 -147
  14. package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
  15. package/dist/e2e-tests/tests/nextjs.test.js +77 -175
  16. package/dist/e2e-tests/tests/nextjs.test.js.map +1 -1
  17. package/dist/e2e-tests/tests/nuxt-3.test.js +61 -162
  18. package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
  19. package/dist/e2e-tests/tests/nuxt-4.test.js +62 -163
  20. package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
  21. package/dist/e2e-tests/tests/remix.test.js +147 -189
  22. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  23. package/dist/e2e-tests/tests/sveltekit.test.js +133 -187
  24. package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
  25. package/dist/e2e-tests/utils/index.d.ts +1 -1
  26. package/dist/e2e-tests/utils/index.js +113 -195
  27. package/dist/e2e-tests/utils/index.js.map +1 -1
  28. package/dist/lib/Constants.js +5 -5
  29. package/dist/lib/Constants.js.map +1 -1
  30. package/dist/lib/Helper/BottomBar.d.ts +1 -1
  31. package/dist/lib/Helper/BottomBar.js +14 -15
  32. package/dist/lib/Helper/BottomBar.js.map +1 -1
  33. package/dist/lib/Helper/Env.js +5 -2
  34. package/dist/lib/Helper/Env.js.map +1 -1
  35. package/dist/lib/Helper/File.js +14 -27
  36. package/dist/lib/Helper/File.js.map +1 -1
  37. package/dist/lib/Helper/Git.js +24 -59
  38. package/dist/lib/Helper/Git.js.map +1 -1
  39. package/dist/lib/Helper/Logging.js +2 -2
  40. package/dist/lib/Helper/Logging.js.map +1 -1
  41. package/dist/lib/Helper/MergeConfig.js +4 -4
  42. package/dist/lib/Helper/MergeConfig.js.map +1 -1
  43. package/dist/lib/Helper/Package.d.ts +4 -1
  44. package/dist/lib/Helper/Package.js +12 -38
  45. package/dist/lib/Helper/Package.js.map +1 -1
  46. package/dist/lib/Helper/SentryCli.js +77 -149
  47. package/dist/lib/Helper/SentryCli.js.map +1 -1
  48. package/dist/lib/Helper/Wizard.js +29 -124
  49. package/dist/lib/Helper/Wizard.js.map +1 -1
  50. package/dist/lib/Helper/__tests__/File.js +4 -4
  51. package/dist/lib/Helper/__tests__/File.js.map +1 -1
  52. package/dist/lib/Helper/__tests__/MergeConfig.js +24 -24
  53. package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
  54. package/dist/lib/Helper/__tests__/SentryCli.js +33 -23
  55. package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
  56. package/dist/lib/Setup.js +23 -85
  57. package/dist/lib/Setup.js.map +1 -1
  58. package/dist/lib/Steps/BaseStep.js +8 -8
  59. package/dist/lib/Steps/BaseStep.js.map +1 -1
  60. package/dist/lib/Steps/ChooseIntegration.js +80 -125
  61. package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
  62. package/dist/lib/Steps/ConfigureProject.js +6 -66
  63. package/dist/lib/Steps/ConfigureProject.js.map +1 -1
  64. package/dist/lib/Steps/Initial.js +16 -104
  65. package/dist/lib/Steps/Initial.js.map +1 -1
  66. package/dist/lib/Steps/Integrations/BaseIntegration.js +24 -118
  67. package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
  68. package/dist/lib/Steps/Integrations/Cordova.js +95 -183
  69. package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
  70. package/dist/lib/Steps/Integrations/Electron.js +87 -145
  71. package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
  72. package/dist/lib/Steps/Integrations/MobileProject.js +40 -148
  73. package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
  74. package/dist/lib/Steps/OpenSentry.js +63 -126
  75. package/dist/lib/Steps/OpenSentry.js.map +1 -1
  76. package/dist/lib/Steps/PromptForParameters.js +110 -206
  77. package/dist/lib/Steps/PromptForParameters.js.map +1 -1
  78. package/dist/lib/Steps/Result.js +19 -79
  79. package/dist/lib/Steps/Result.js.map +1 -1
  80. package/dist/lib/Steps/SentryProjectSelector.js +57 -148
  81. package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
  82. package/dist/lib/Steps/ShouldConfigure.js +6 -66
  83. package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
  84. package/dist/lib/Steps/WaitForSentry.js +43 -120
  85. package/dist/lib/Steps/WaitForSentry.js.map +1 -1
  86. package/dist/lib/Steps/Welcome.js +17 -76
  87. package/dist/lib/Steps/Welcome.js.map +1 -1
  88. package/dist/lib/__tests__/Env.js +3 -3
  89. package/dist/lib/__tests__/Env.js.map +1 -1
  90. package/dist/src/android/android-wizard.js +100 -176
  91. package/dist/src/android/android-wizard.js.map +1 -1
  92. package/dist/src/android/code-tools.js +24 -33
  93. package/dist/src/android/code-tools.js.map +1 -1
  94. package/dist/src/android/gradle.js +106 -165
  95. package/dist/src/android/gradle.js.map +1 -1
  96. package/dist/src/android/manifest.js +26 -27
  97. package/dist/src/android/manifest.js.map +1 -1
  98. package/dist/src/android/templates.js +76 -23
  99. package/dist/src/android/templates.js.map +1 -1
  100. package/dist/src/apple/apple-wizard.js +129 -225
  101. package/dist/src/apple/apple-wizard.js.map +1 -1
  102. package/dist/src/apple/cocoapod.js +47 -109
  103. package/dist/src/apple/cocoapod.js.map +1 -1
  104. package/dist/src/apple/code-tools.js +32 -35
  105. package/dist/src/apple/code-tools.js.map +1 -1
  106. package/dist/src/apple/fastlane.js +51 -97
  107. package/dist/src/apple/fastlane.js.map +1 -1
  108. package/dist/src/apple/templates.js +41 -5
  109. package/dist/src/apple/templates.js.map +1 -1
  110. package/dist/src/apple/xcode-manager.d.ts +2 -2
  111. package/dist/src/apple/xcode-manager.js +93 -108
  112. package/dist/src/apple/xcode-manager.js.map +1 -1
  113. package/dist/src/flutter/code-tools.js +79 -127
  114. package/dist/src/flutter/code-tools.js.map +1 -1
  115. package/dist/src/flutter/flutter-wizard.js +75 -136
  116. package/dist/src/flutter/flutter-wizard.js.map +1 -1
  117. package/dist/src/flutter/templates.js +48 -12
  118. package/dist/src/flutter/templates.js.map +1 -1
  119. package/dist/src/nextjs/nextjs-wizard.js +527 -805
  120. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  121. package/dist/src/nextjs/templates.js +380 -40
  122. package/dist/src/nextjs/templates.js.map +1 -1
  123. package/dist/src/nextjs/utils.js +5 -5
  124. package/dist/src/nextjs/utils.js.map +1 -1
  125. package/dist/src/nuxt/nuxt-wizard.js +91 -188
  126. package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
  127. package/dist/src/nuxt/sdk-example.js +68 -137
  128. package/dist/src/nuxt/sdk-example.js.map +1 -1
  129. package/dist/src/nuxt/sdk-setup.d.ts +4 -4
  130. package/dist/src/nuxt/sdk-setup.js +180 -336
  131. package/dist/src/nuxt/sdk-setup.js.map +1 -1
  132. package/dist/src/nuxt/templates.js +195 -18
  133. package/dist/src/nuxt/templates.js.map +1 -1
  134. package/dist/src/nuxt/utils.js +29 -76
  135. package/dist/src/nuxt/utils.js.map +1 -1
  136. package/dist/src/react-native/expo-env-file.js +41 -94
  137. package/dist/src/react-native/expo-env-file.js.map +1 -1
  138. package/dist/src/react-native/expo-metro.d.ts +1 -1
  139. package/dist/src/react-native/expo-metro.js +75 -130
  140. package/dist/src/react-native/expo-metro.js.map +1 -1
  141. package/dist/src/react-native/expo.js +61 -114
  142. package/dist/src/react-native/expo.js.map +1 -1
  143. package/dist/src/react-native/git.js +23 -56
  144. package/dist/src/react-native/git.js.map +1 -1
  145. package/dist/src/react-native/glob.js +3 -3
  146. package/dist/src/react-native/glob.js.map +1 -1
  147. package/dist/src/react-native/gradle.js +4 -4
  148. package/dist/src/react-native/gradle.js.map +1 -1
  149. package/dist/src/react-native/javascript.js +51 -95
  150. package/dist/src/react-native/javascript.js.map +1 -1
  151. package/dist/src/react-native/metro.js +176 -296
  152. package/dist/src/react-native/metro.js.map +1 -1
  153. package/dist/src/react-native/react-native-wizard.js +267 -418
  154. package/dist/src/react-native/react-native-wizard.js.map +1 -1
  155. package/dist/src/react-native/uninstall.js +37 -80
  156. package/dist/src/react-native/uninstall.js.map +1 -1
  157. package/dist/src/react-native/xcode.js +57 -55
  158. package/dist/src/react-native/xcode.js.map +1 -1
  159. package/dist/src/remix/codemods/express-server.js +27 -82
  160. package/dist/src/remix/codemods/express-server.js.map +1 -1
  161. package/dist/src/remix/codemods/handle-error.js +28 -31
  162. package/dist/src/remix/codemods/handle-error.js.map +1 -1
  163. package/dist/src/remix/codemods/root-common.js +11 -11
  164. package/dist/src/remix/codemods/root-common.js.map +1 -1
  165. package/dist/src/remix/codemods/root-v1.js +17 -67
  166. package/dist/src/remix/codemods/root-v1.js.map +1 -1
  167. package/dist/src/remix/codemods/root-v2.js +89 -140
  168. package/dist/src/remix/codemods/root-v2.js.map +1 -1
  169. package/dist/src/remix/remix-wizard.js +181 -343
  170. package/dist/src/remix/remix-wizard.js.map +1 -1
  171. package/dist/src/remix/sdk-example.js +84 -66
  172. package/dist/src/remix/sdk-example.js.map +1 -1
  173. package/dist/src/remix/sdk-setup.js +161 -293
  174. package/dist/src/remix/sdk-setup.js.map +1 -1
  175. package/dist/src/remix/templates.js +10 -2
  176. package/dist/src/remix/templates.js.map +1 -1
  177. package/dist/src/remix/utils.js +13 -14
  178. package/dist/src/remix/utils.js.map +1 -1
  179. package/dist/src/run.js +106 -178
  180. package/dist/src/run.js.map +1 -1
  181. package/dist/src/sourcemaps/sourcemaps-wizard.js +248 -372
  182. package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
  183. package/dist/src/sourcemaps/tools/angular.js +32 -66
  184. package/dist/src/sourcemaps/tools/angular.js.map +1 -1
  185. package/dist/src/sourcemaps/tools/create-react-app.js +14 -59
  186. package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -1
  187. package/dist/src/sourcemaps/tools/esbuild.js +34 -77
  188. package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
  189. package/dist/src/sourcemaps/tools/nextjs.d.ts +2 -2
  190. package/dist/src/sourcemaps/tools/nextjs.js +75 -102
  191. package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
  192. package/dist/src/sourcemaps/tools/remix.js +53 -93
  193. package/dist/src/sourcemaps/tools/remix.js.map +1 -1
  194. package/dist/src/sourcemaps/tools/rollup.js +35 -76
  195. package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
  196. package/dist/src/sourcemaps/tools/sentry-cli.js +157 -289
  197. package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
  198. package/dist/src/sourcemaps/tools/tsc.js +68 -134
  199. package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
  200. package/dist/src/sourcemaps/tools/vite.js +111 -196
  201. package/dist/src/sourcemaps/tools/vite.js.map +1 -1
  202. package/dist/src/sourcemaps/tools/webpack.d.ts +1 -1
  203. package/dist/src/sourcemaps/tools/webpack.js +158 -260
  204. package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
  205. package/dist/src/sourcemaps/utils/detect-tool.js +9 -54
  206. package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -1
  207. package/dist/src/sourcemaps/utils/other-wizards.js +77 -144
  208. package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -1
  209. package/dist/src/sourcemaps/utils/sdk-version.js +112 -191
  210. package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -1
  211. package/dist/src/sveltekit/sdk-example.js +20 -70
  212. package/dist/src/sveltekit/sdk-example.js.map +1 -1
  213. package/dist/src/sveltekit/sdk-setup.js +250 -411
  214. package/dist/src/sveltekit/sdk-setup.js.map +1 -1
  215. package/dist/src/sveltekit/sveltekit-wizard.js +107 -191
  216. package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
  217. package/dist/src/sveltekit/templates.js +147 -13
  218. package/dist/src/sveltekit/templates.js.map +1 -1
  219. package/dist/src/sveltekit/utils.js +3 -3
  220. package/dist/src/sveltekit/utils.js.map +1 -1
  221. package/dist/src/telemetry.d.ts +2 -2
  222. package/dist/src/telemetry.js +58 -108
  223. package/dist/src/telemetry.js.map +1 -1
  224. package/dist/src/utils/ast-utils.js +39 -54
  225. package/dist/src/utils/ast-utils.js.map +1 -1
  226. package/dist/src/utils/bash.js +28 -75
  227. package/dist/src/utils/bash.js.map +1 -1
  228. package/dist/src/utils/clack-utils.d.ts +3 -7
  229. package/dist/src/utils/clack-utils.js +688 -1083
  230. package/dist/src/utils/clack-utils.js.map +1 -1
  231. package/dist/src/utils/debug.js +6 -10
  232. package/dist/src/utils/debug.js.map +1 -1
  233. package/dist/src/utils/package-json.js +5 -6
  234. package/dist/src/utils/package-json.js.map +1 -1
  235. package/dist/src/utils/package-manager.js +65 -139
  236. package/dist/src/utils/package-manager.js.map +1 -1
  237. package/dist/src/utils/release-registry.js +12 -59
  238. package/dist/src/utils/release-registry.js.map +1 -1
  239. package/dist/src/utils/semver.js +3 -4
  240. package/dist/src/utils/semver.js.map +1 -1
  241. package/dist/src/utils/sentrycli-utils.js +4 -4
  242. package/dist/src/utils/sentrycli-utils.js.map +1 -1
  243. package/dist/src/utils/url.js +5 -6
  244. package/dist/src/utils/url.js.map +1 -1
  245. package/dist/test/android/code-tools.test.js +18 -18
  246. package/dist/test/android/code-tools.test.js.map +1 -1
  247. package/dist/test/apple/cocoapod.test.js +154 -299
  248. package/dist/test/apple/cocoapod.test.js.map +1 -1
  249. package/dist/test/apple/code-tools.test.js +375 -263
  250. package/dist/test/apple/code-tools.test.js.map +1 -1
  251. package/dist/test/apple/fastfile.test.js +319 -271
  252. package/dist/test/apple/fastfile.test.js.map +1 -1
  253. package/dist/test/apple/templates.test.js +114 -30
  254. package/dist/test/apple/templates.test.js.map +1 -1
  255. package/dist/test/apple/xcode-manager.test.js +230 -234
  256. package/dist/test/apple/xcode-manager.test.js.map +1 -1
  257. package/dist/test/flutter/code-tools.test.js +119 -48
  258. package/dist/test/flutter/code-tools.test.js.map +1 -1
  259. package/dist/test/flutter/templates.test.js +63 -20
  260. package/dist/test/flutter/templates.test.js.map +1 -1
  261. package/dist/test/nextjs/templates.test.js +332 -43
  262. package/dist/test/nextjs/templates.test.js.map +1 -1
  263. package/dist/test/nuxt/templates.test.js +161 -33
  264. package/dist/test/nuxt/templates.test.js.map +1 -1
  265. package/dist/test/react-native/expo-metro.test.js +61 -15
  266. package/dist/test/react-native/expo-metro.test.js.map +1 -1
  267. package/dist/test/react-native/expo.test.js +37 -17
  268. package/dist/test/react-native/expo.test.js.map +1 -1
  269. package/dist/test/react-native/gradle.test.js +260 -28
  270. package/dist/test/react-native/gradle.test.js.map +1 -1
  271. package/dist/test/react-native/javascript.test.js +85 -19
  272. package/dist/test/react-native/javascript.test.js.map +1 -1
  273. package/dist/test/react-native/metro.test.js +261 -187
  274. package/dist/test/react-native/metro.test.js.map +1 -1
  275. package/dist/test/react-native/xcode.test.js +243 -62
  276. package/dist/test/react-native/xcode.test.js.map +1 -1
  277. package/dist/test/remix/client-entry.test.js +81 -21
  278. package/dist/test/remix/client-entry.test.js.map +1 -1
  279. package/dist/test/remix/server-instrumentation.test.js +21 -8
  280. package/dist/test/remix/server-instrumentation.test.js.map +1 -1
  281. package/dist/test/sourcemaps/tools/sentry-cli.test.js +20 -72
  282. package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
  283. package/dist/test/sourcemaps/tools/tsc.test.js +142 -68
  284. package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
  285. package/dist/test/sourcemaps/tools/vite.test.js +106 -75
  286. package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
  287. package/dist/test/sourcemaps/tools/webpack.test.js +226 -102
  288. package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
  289. package/dist/test/sveltekit/templates.test.js +117 -18
  290. package/dist/test/sveltekit/templates.test.js.map +1 -1
  291. package/dist/test/utils/ast-utils.test.js +99 -58
  292. package/dist/test/utils/ast-utils.test.js.map +1 -1
  293. package/dist/test/utils/clack-utils.test.js +142 -247
  294. package/dist/test/utils/clack-utils.test.js.map +1 -1
  295. package/e2e-tests/package.json +1 -1
  296. package/e2e-tests/tests/flutter.test.ts +20 -20
  297. package/e2e-tests/tests/nextjs.test.ts +2 -2
  298. package/e2e-tests/tests/nuxt-3.test.ts +4 -4
  299. package/e2e-tests/tests/nuxt-4.test.ts +3 -3
  300. package/e2e-tests/tests/remix.test.ts +3 -3
  301. package/e2e-tests/tests/sveltekit.test.ts +3 -3
  302. package/e2e-tests/utils/index.ts +33 -15
  303. package/lib/Helper/BottomBar.ts +1 -1
  304. package/lib/Helper/Env.ts +1 -1
  305. package/lib/Helper/Package.ts +12 -10
  306. package/lib/Helper/SentryCli.ts +18 -27
  307. package/lib/Helper/Wizard.ts +1 -2
  308. package/lib/Setup.ts +4 -5
  309. package/lib/Steps/ChooseIntegration.ts +40 -8
  310. package/lib/Steps/Initial.ts +17 -26
  311. package/lib/Steps/Integrations/BaseIntegration.ts +2 -8
  312. package/lib/Steps/Integrations/Cordova.ts +9 -15
  313. package/lib/Steps/Integrations/Electron.ts +23 -20
  314. package/lib/Steps/Integrations/MobileProject.ts +18 -15
  315. package/lib/Steps/OpenSentry.ts +12 -7
  316. package/lib/Steps/PromptForParameters.ts +12 -19
  317. package/lib/Steps/SentryProjectSelector.ts +30 -29
  318. package/lib/Steps/WaitForSentry.ts +29 -23
  319. package/package.json +12 -8
  320. package/src/apple/xcode-manager.ts +10 -10
  321. package/src/nextjs/templates.ts +2 -3
  322. package/src/nuxt/sdk-setup.ts +21 -18
  323. package/src/react-native/expo-metro.ts +2 -2
  324. package/src/react-native/react-native-wizard.ts +1 -2
  325. package/src/react-native/uninstall.ts +1 -2
  326. package/src/react-native/xcode.ts +1 -1
  327. package/src/run.ts +12 -5
  328. package/src/sourcemaps/tools/nextjs.ts +2 -2
  329. package/src/sourcemaps/tools/webpack.ts +3 -3
  330. package/src/telemetry.ts +27 -7
  331. package/src/utils/clack-utils.ts +50 -47
  332. package/test/apple/cocoapod.test.ts +4 -0
  333. package/test/apple/fastfile.test.ts +12 -7
  334. package/test/apple/xcode-manager.test.ts +13 -11
  335. package/test/utils/clack-utils.test.ts +40 -50
  336. package/types/read-env.d.ts +3 -0
  337. package/types/xcode.d.ts +1 -0
  338. package/dist/package.json +0 -128
@@ -1,8 +1,7 @@
1
- import * as fs from 'fs';
1
+ import * as fs from 'node:fs';
2
2
  import type { Answers } from 'inquirer';
3
3
  import { prompt } from 'inquirer';
4
- import * as _ from 'lodash';
5
- import * as path from 'path';
4
+ import * as path from 'node:path';
6
5
 
7
6
  import type { Args } from '../../Constants';
8
7
  import { dim, green, l, nl, red } from '../../Helper/Logging';
@@ -31,7 +30,11 @@ const Sentry = require('@sentry/electron/renderer');
31
30
 
32
31
  Sentry.init({});`;
33
32
 
34
- let appPackage: any = {};
33
+ type PackageJSON = {
34
+ dependencies?: Record<string, string>;
35
+ devDependencies?: Record<string, string>;
36
+ };
37
+ let appPackage: PackageJSON = {};
35
38
 
36
39
  function printExample(example: string, title = ''): void {
37
40
  if (title) {
@@ -44,7 +47,9 @@ function printExample(example: string, title = ''): void {
44
47
  }
45
48
 
46
49
  try {
47
- appPackage = require(path.join(process.cwd(), 'package.json'));
50
+ appPackage = JSON.parse(
51
+ fs.readFileSync(path.join(process.cwd(), 'package.json'), 'utf-8'),
52
+ ) as PackageJSON;
48
53
  } catch {
49
54
  // We don't need to have this
50
55
  }
@@ -59,7 +64,7 @@ export class Electron extends BaseIntegration {
59
64
 
60
65
  // eslint-disable-next-line @typescript-eslint/require-await
61
66
  public async emit(answers: Answers): Promise<Answers> {
62
- const dsn = _.get(answers, ['config', 'dsn', 'public'], null);
67
+ const dsn = answers.config?.dsn?.public ?? null;
63
68
  nl();
64
69
 
65
70
  const sentryCliProps = this._sentryCli.convertAnswersToProperties(answers);
@@ -112,7 +117,7 @@ export class Electron extends BaseIntegration {
112
117
 
113
118
  nl();
114
119
 
115
- if (!_.get(continued, 'continue', false)) {
120
+ if (!continued?.continue) {
116
121
  throw new Error('Please install the required dependencies to continue.');
117
122
  }
118
123
 
@@ -123,25 +128,23 @@ export class Electron extends BaseIntegration {
123
128
 
124
129
  private _checkDep(packageName: string, minVersion?: string): boolean {
125
130
  const depVersion = parseInt(
126
- _.get(appPackage, ['dependencies', packageName], '0').replace(/\D+/g, ''),
131
+ (appPackage.dependencies?.[packageName] || '0').replace(/\D+/g, ''),
127
132
  10,
128
133
  );
129
134
  const devDepVersion = parseInt(
130
- _.get(appPackage, ['devDependencies', packageName], '0').replace(
131
- /\D+/g,
132
- '',
133
- ),
135
+ (appPackage.devDependencies?.[packageName] || '0').replace(/\D+/g, ''),
134
136
  10,
135
137
  );
136
138
 
137
139
  if (
138
- !_.get(appPackage, `dependencies.${packageName}`, false) &&
139
- !_.get(appPackage, `devDependencies.${packageName}`, false)
140
+ !appPackage.dependencies?.[packageName] &&
141
+ !appPackage.devDependencies?.[packageName]
140
142
  ) {
141
143
  red(`✗ ${packageName} isn't in your dependencies`);
142
144
  red(' please install it with yarn/npm');
143
145
  return false;
144
- } else if (
146
+ }
147
+ if (
145
148
  minVersion &&
146
149
  depVersion < MIN_ELECTRON_VERSION &&
147
150
  devDepVersion < MIN_ELECTRON_VERSION
@@ -150,12 +153,12 @@ export class Electron extends BaseIntegration {
150
153
  `✗ Your installed version of ${packageName} is to old, >${MIN_ELECTRON_VERSION_STRING} needed`,
151
154
  );
152
155
  return false;
156
+ }
157
+ if (minVersion) {
158
+ green(`✓ ${packageName} > ${minVersion} is installed`);
153
159
  } else {
154
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
155
- minVersion
156
- ? green(`✓ ${packageName} > ${minVersion} is installed`)
157
- : green(`✓ ${packageName} is installed`);
158
- return true;
160
+ green(`✓ ${packageName} is installed`);
159
161
  }
162
+ return true;
160
163
  }
161
164
  }
@@ -1,6 +1,5 @@
1
1
  import type { Answers } from 'inquirer';
2
2
  import { prompt } from 'inquirer';
3
- import * as _ from 'lodash';
4
3
 
5
4
  import { getPlatformChoices, Platform } from '../../Constants';
6
5
  import { dim } from '../../Helper/Logging';
@@ -10,19 +9,24 @@ export abstract class MobileProject extends BaseIntegration {
10
9
  protected _platforms: Platform[];
11
10
 
12
11
  public getPlatforms(answers: Answers): string[] {
13
- if (!_.has(answers, 'shouldConfigurePlatforms')) {
12
+ if (!answers.shouldConfigurePlatforms) {
14
13
  throw new Error('No platform selected');
15
14
  }
16
- const shouldConfigurePlatforms = _.get(answers, 'shouldConfigurePlatforms');
17
- return _.keys(
18
- _.pickBy(shouldConfigurePlatforms, (active: boolean) => active),
19
- );
15
+ const shouldConfigurePlatforms =
16
+ answers.shouldConfigurePlatforms as Partial<Record<Platform, boolean>>;
17
+ return Object.entries(shouldConfigurePlatforms)
18
+ .filter((pair) => pair[1])
19
+ .map((pair) => pair[0]); // only return the keys
20
20
  }
21
21
 
22
22
  public async shouldConfigure(answers: Answers): Promise<Answers> {
23
- if (_.get(answers, 'shouldConfigurePlatforms')) {
24
- return _.get(answers, 'shouldConfigurePlatforms');
23
+ let { shouldConfigurePlatforms } = answers as {
24
+ shouldConfigurePlatforms?: Partial<Record<Platform, boolean>>;
25
+ };
26
+ if (shouldConfigurePlatforms) {
27
+ return { shouldConfigurePlatforms };
25
28
  }
29
+
26
30
  const isPlatformSet =
27
31
  this._argv.platform &&
28
32
  Array.isArray(this._argv.platform) &&
@@ -32,20 +36,19 @@ export abstract class MobileProject extends BaseIntegration {
32
36
  ? this._argv.platform
33
37
  : (await this._platformSelector()).platform;
34
38
 
35
- const shouldConfigurePlatforms: any = {};
39
+ shouldConfigurePlatforms = {};
36
40
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
37
- _.keys(Platform).forEach(async (platform: Platform) => {
38
- shouldConfigurePlatforms[platform] =
39
- _.indexOf(this._platforms, platform) >= 0
40
- ? await this._shouldConfigurePlatform(platform)
41
- : false;
41
+ for (const platform of Object.values(Platform)) {
42
+ shouldConfigurePlatforms[platform] = this._platforms.includes(platform)
43
+ ? await this._shouldConfigurePlatform(platform)
44
+ : false;
42
45
  if (
43
46
  shouldConfigurePlatforms[platform] === false &&
44
47
  this._argv.uninstall === false
45
48
  ) {
46
49
  dim(`will not configure ${platform}`);
47
50
  }
48
- });
51
+ }
49
52
  return { shouldConfigurePlatforms };
50
53
  }
51
54
 
@@ -1,5 +1,5 @@
1
+ import { URL } from 'node:url';
1
2
  import type { Answers } from 'inquirer';
2
- import { URL } from 'url';
3
3
 
4
4
  import { mapIntegrationToPlatform } from '../Constants';
5
5
  import { BottomBar } from '../Helper/BottomBar';
@@ -7,8 +7,7 @@ import { dim, green, l, nl, red } from '../Helper/Logging';
7
7
  import { getCurrentIntegration } from '../Helper/Wizard';
8
8
  import { BaseStep } from './BaseStep';
9
9
 
10
- const opn = require('opn');
11
- const r2 = require('r2');
10
+ import opn from 'opn';
12
11
 
13
12
  export class OpenSentry extends BaseStep {
14
13
  public async emit(answers: Answers): Promise<Answers> {
@@ -27,7 +26,13 @@ export class OpenSentry extends BaseStep {
27
26
  this.debug(`Loading wizard for ${baseUrl}`);
28
27
 
29
28
  try {
30
- const data = await r2.get(`${baseUrl}api/0/wizard/`).json;
29
+ const response = await fetch(`${baseUrl}api/0/wizard/`);
30
+ if (!response.ok) {
31
+ throw new Error(
32
+ `Failed to connect to Sentry: ${response.status} ${response.statusText}`,
33
+ );
34
+ }
35
+ const data = (await response.json()) as { hash: string };
31
36
 
32
37
  BottomBar.hide();
33
38
 
@@ -48,9 +53,9 @@ export class OpenSentry extends BaseStep {
48
53
 
49
54
  const urlToOpen = urlObj.toString();
50
55
 
51
- opn(urlToOpen, { wait: false }).catch(() => {
52
- // opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here
53
- });
56
+ // opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here
57
+ const noop = () => {}; // eslint-disable-line @typescript-eslint/no-empty-function
58
+ opn(urlToOpen, { wait: false }).then((cp) => cp.on('error', noop), noop);
54
59
 
55
60
  nl();
56
61
  l('Please open');
@@ -1,6 +1,5 @@
1
1
  import type { Answers } from 'inquirer';
2
2
  import { prompt } from 'inquirer';
3
- import * as _ from 'lodash';
4
3
 
5
4
  import { dim } from '../Helper/Logging';
6
5
  import { getCurrentIntegration } from '../Helper/Wizard';
@@ -80,12 +79,13 @@ export class PromptForParameters extends BaseStep {
80
79
  ]);
81
80
 
82
81
  return {
83
- config: _.merge(_.get(answers, 'config'), {
82
+ config: {
83
+ ...answers.config,
84
84
  auth,
85
85
  dsn,
86
86
  project,
87
87
  organization,
88
- }),
88
+ },
89
89
  };
90
90
  }
91
91
 
@@ -95,26 +95,19 @@ export class PromptForParameters extends BaseStep {
95
95
  projectSlug?: string,
96
96
  ): string {
97
97
  const baseUrl = this._argv.url;
98
- const orgSlug = _.get(
99
- answers,
100
- 'config.organization.slug',
101
- organizationSlug || 'organization_slug',
102
- );
103
- const projSlug = _.get(
104
- answers,
105
- 'config.project.slug',
106
- projectSlug || 'project_slug',
107
- );
98
+ const orgSlug =
99
+ answers.config?.organization?.slug ??
100
+ organizationSlug ??
101
+ 'organization_slug';
102
+ const projSlug =
103
+ answers.config?.project?.slug ?? projectSlug ?? 'project_slug';
108
104
  return `${baseUrl}${orgSlug}/${projSlug}`;
109
105
  }
110
106
 
111
107
  private _getDSNKeyUrl(answers: Answers, projectSlug?: string): string {
112
108
  const baseUrl = this._argv.url;
113
- const projSlug = _.get(
114
- answers,
115
- 'config.project.slug',
116
- projectSlug || 'project_slug',
117
- );
109
+ const projSlug =
110
+ answers.config?.project?.slug ?? projectSlug ?? 'project_slug';
118
111
  return `${baseUrl}settings/projects/${projSlug}/keys`;
119
112
  }
120
113
 
@@ -123,7 +116,7 @@ export class PromptForParameters extends BaseStep {
123
116
  configKey: string,
124
117
  preHook?: () => void,
125
118
  ): boolean {
126
- const shouldAsk = _.get(answers, configKey, null) === null;
119
+ const shouldAsk = answers[configKey] != null;
127
120
  if (shouldAsk && preHook) {
128
121
  preHook();
129
122
  }
@@ -1,9 +1,23 @@
1
1
  import type { Answers } from 'inquirer';
2
2
  import { prompt } from 'inquirer';
3
- import * as _ from 'lodash';
4
3
 
5
4
  import { BaseStep } from './BaseStep';
6
5
 
6
+ type Project = {
7
+ id: string;
8
+ slug: string;
9
+ organization?: {
10
+ name: string;
11
+ slug: string;
12
+ };
13
+ keys: {
14
+ dsn: {
15
+ public: string;
16
+ private: string;
17
+ };
18
+ }[];
19
+ };
20
+
7
21
  function sleep(n: number): Promise<void> {
8
22
  return new Promise((resolve) => setTimeout(resolve, n));
9
23
  }
@@ -12,23 +26,22 @@ export class SentryProjectSelector extends BaseStep {
12
26
  public async emit(answers: Answers): Promise<any> {
13
27
  this.debug(answers);
14
28
 
15
- if (!_.has(answers, 'wizard')) {
29
+ if (!answers.wizard) {
16
30
  // we skip this completely because the wizard wasn't running
17
31
  return {};
18
32
  }
19
33
 
20
- if (
21
- _.has(answers, 'wizard.projects') &&
22
- answers.wizard.projects.length === 0
23
- ) {
34
+ if (!answers.wizard.projects || answers.wizard.projects.length === 0) {
24
35
  throw new Error(
25
36
  'No Projects found. Please create a new Project in Sentry and try again.',
26
37
  );
27
38
  }
28
39
 
29
- let selectedProject = null;
40
+ let selectedProject: { selectedProject: Project } | null = null;
30
41
  if (answers.wizard.projects.length === 1) {
31
- selectedProject = { selectedProject: answers.wizard.projects[0] };
42
+ selectedProject = {
43
+ selectedProject: answers.wizard.projects[0] as Project,
44
+ };
32
45
  // the wizard CLI closes too quickly when we skip the prompt
33
46
  // as it will cause the UI to be stuck saying Waiting for wizard to connect
34
47
  await sleep(1000);
@@ -47,34 +60,22 @@ export class SentryProjectSelector extends BaseStep {
47
60
  },
48
61
  ]);
49
62
  }
50
-
63
+ const dsn = selectedProject?.selectedProject.keys[0]?.dsn ?? {
64
+ public: null,
65
+ private: null,
66
+ };
51
67
  return {
52
68
  config: {
53
69
  auth: {
54
- token: _.get(answers, 'wizard.apiKeys.token', null),
55
- },
56
- dsn: {
57
- public: _.get(
58
- selectedProject,
59
- 'selectedProject.keys.0.dsn.public',
60
- null,
61
- ),
62
- secret: _.get(
63
- selectedProject,
64
- 'selectedProject.keys.0.dsn.secret',
65
- null,
66
- ),
70
+ token: answers.wizard.apiKeys?.token ?? null,
67
71
  },
72
+ dsn,
68
73
  organization: {
69
- slug: _.get(
70
- selectedProject,
71
- 'selectedProject.organization.slug',
72
- null,
73
- ),
74
+ slug: selectedProject?.selectedProject.organization?.slug ?? null,
74
75
  },
75
76
  project: {
76
- id: _.get(selectedProject, 'selectedProject.id', null),
77
- slug: _.get(selectedProject, 'selectedProject.slug', null),
77
+ id: selectedProject?.selectedProject.id ?? null,
78
+ slug: selectedProject?.selectedProject.slug ?? null,
78
79
  },
79
80
  },
80
81
  };
@@ -4,8 +4,6 @@ import { BottomBar } from '../Helper/BottomBar';
4
4
  import { getCurrentIntegration } from '../Helper/Wizard';
5
5
  import { BaseStep } from './BaseStep';
6
6
 
7
- const r2 = require('r2');
8
-
9
7
  export class WaitForSentry extends BaseStep {
10
8
  public async emit(answers: Answers): Promise<Answers> {
11
9
  if (!(await getCurrentIntegration(answers).shouldEmit(answers))) {
@@ -15,36 +13,44 @@ export class WaitForSentry extends BaseStep {
15
13
  return {};
16
14
  }
17
15
 
18
- // eslint-disable-next-line no-async-promise-executor
16
+ if (!answers.hash) {
17
+ throw new Error(`No wizard hash found ${answers}`);
18
+ }
19
+
19
20
  return new Promise((resolve, _reject) => {
20
21
  this.debug(answers);
21
22
 
22
23
  BottomBar.show('Waiting for Sentry...');
23
24
  const baseUrl = this._argv.url;
24
25
 
25
- const polling = async (): Promise<void> => {
26
- try {
27
- this.debug(`Polling: ${baseUrl}api/0/wizard/${answers.hash}/`);
28
- const response = await r2.get(
29
- `${baseUrl}api/0/wizard/${answers.hash}/`,
30
- ).response;
31
- this.debug('Polling received data');
32
- if (response.status !== 200) {
33
- throw new Error(`Received status ${response.status}`);
34
- }
35
- const data = await response.json();
36
- // Delete the wizard hash since we were able to fetch the data
37
- await r2.delete(`${baseUrl}api/0/wizard/${answers.hash}/`);
38
- BottomBar.hide();
39
- this.debug('Polling Success!');
40
- resolve({ wizard: data });
41
- } catch (e) {
26
+ const pingSentry = async (): Promise<void> => {
27
+ const response = await fetch(`${baseUrl}api/0/wizard/${answers.hash}/`);
28
+ this.debug('Polling received data');
29
+ if (!response.ok) {
30
+ throw new Error(
31
+ `Received status ${response.status} ${response.statusText}`,
32
+ );
33
+ }
34
+ const data = await response.json();
35
+ // Delete the wizard hash since we were able to fetch the data
36
+ await fetch(`${baseUrl}api/0/wizard/${answers.hash}/`, {
37
+ method: 'DELETE',
38
+ });
39
+ BottomBar.hide();
40
+ this.debug('Polling Success!');
41
+ resolve({ wizard: data });
42
+ };
43
+
44
+ const poll = (): void => {
45
+ this.debug(`Polling: ${baseUrl}api/0/wizard/${answers.hash}/`);
46
+ pingSentry().catch((e) => {
42
47
  this.debug('Polling received:');
43
48
  this.debug(e);
44
- setTimeout(polling.bind(this), 1000);
45
- }
49
+ setTimeout(poll, 1000);
50
+ });
46
51
  };
47
- polling.bind(this)();
52
+
53
+ poll();
48
54
  });
49
55
  }
50
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/wizard",
3
- "version": "3.42.1",
3
+ "version": "4.0.0",
4
4
  "homepage": "https://github.com/getsentry/sentry-wizard",
5
5
  "repository": "https://github.com/getsentry/sentry-wizard",
6
6
  "description": "Sentry wizard helping you to configure your project",
@@ -25,16 +25,13 @@
25
25
  "dependencies": {
26
26
  "@clack/core": "^0.3.4",
27
27
  "@clack/prompts": "0.7.0",
28
- "@sentry/cli": "^1.77.3",
29
28
  "@sentry/node": "^7.119.2",
30
29
  "axios": "1.7.4",
31
30
  "chalk": "^2.4.1",
32
31
  "glob": "9.3.5",
33
32
  "inquirer": "^6.2.0",
34
- "lodash": "^4.17.15",
35
33
  "magicast": "^0.2.10",
36
34
  "opn": "^5.4.0",
37
- "r2": "^2.0.1",
38
35
  "read-env": "^1.3.0",
39
36
  "recast": "^0.23.3",
40
37
  "semver": "^7.5.3",
@@ -43,13 +40,15 @@
43
40
  "yargs": "^16.2.0"
44
41
  },
45
42
  "devDependencies": {
43
+ "@babel/types": "~7.21.4",
46
44
  "@sentry-internal/eslint-config-sdk": "^7.48.0",
47
45
  "@types/chai": "^4.3.17",
48
46
  "@types/glob": "^7.2.0",
49
47
  "@types/inquirer": "^0.0.43",
50
48
  "@types/jest": "^29.5.0",
51
49
  "@types/lodash": "^4.14.144",
52
- "@types/node": "^10.11.0",
50
+ "@types/node": "^18.19.76",
51
+ "@types/opn": "5.1.0",
53
52
  "@types/rimraf": "^3.0.2",
54
53
  "@types/semver": "^7.3.7",
55
54
  "@types/yargs": "^16.0.9",
@@ -59,6 +58,7 @@
59
58
  "eslint": "^8.18.0",
60
59
  "eslint-config-prettier": "^8.3.0",
61
60
  "eslint-plugin-jest": "^25.3.0",
61
+ "fossilize": "^0.3.1",
62
62
  "jest": "^29.5.0",
63
63
  "prettier": "^2.8.7",
64
64
  "rimraf": "^3.0.2",
@@ -67,8 +67,11 @@
67
67
  "tsx": "^3.14.0",
68
68
  "typescript": "^5.0.4"
69
69
  },
70
+ "resolutions": {
71
+ "simple-plist": "1.4.0-0"
72
+ },
70
73
  "engines": {
71
- "node": ">=14.18.0",
74
+ "node": ">=18.20.6",
72
75
  "npm": ">=3.10.7",
73
76
  "yarn": ">=1.0.2"
74
77
  },
@@ -86,6 +89,7 @@
86
89
  "fix:eslint": "eslint . --format stylish --fix",
87
90
  "test": "yarn build && jest",
88
91
  "test:e2e": "yarn build && ./e2e-tests/run.sh",
92
+ "test:e2e:bin": "chmod +x ./dist-bin/* && SENTRY_WIZARD_E2E_TEST_BIN=1 ./e2e-tests/run.sh",
89
93
  "try": "ts-node bin.ts",
90
94
  "try:uninstall": "ts-node bin.ts --uninstall",
91
95
  "test:watch": "jest --watch"
@@ -107,7 +111,7 @@
107
111
  "json"
108
112
  ],
109
113
  "modulePathIgnorePatterns": [
110
- "<rootDir>/dist/__mocks__"
114
+ "<rootDir>/dist/"
111
115
  ],
112
116
  "testPathIgnorePatterns": [
113
117
  "/dist/",
@@ -121,7 +125,7 @@
121
125
  "author": "Sentry",
122
126
  "license": "MIT",
123
127
  "volta": {
124
- "node": "14.18.3",
128
+ "node": "18.20.6",
125
129
  "yarn": "1.22.19"
126
130
  },
127
131
  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
@@ -4,20 +4,20 @@
4
4
  /* eslint-disable @typescript-eslint/no-unsafe-call */
5
5
  // @ts-ignore - clack is ESM and TS complains about that. It works though
6
6
  import clack from '@clack/prompts';
7
- import * as fs from 'fs';
8
- import * as path from 'path';
9
- import { SentryProjectData } from '../utils/types';
7
+ import * as fs from 'node:fs';
8
+ import * as path from 'node:path';
9
+ import type { SentryProjectData } from '../utils/types';
10
10
  import * as templates from './templates';
11
11
 
12
12
  import {
13
13
  project as createXcodeProject,
14
- PBXBuildFile,
15
- PBXGroup,
16
- PBXNativeTarget,
17
- PBXObjects,
18
- PBXSourcesBuildPhase,
19
- Project,
20
- XCConfigurationList,
14
+ type PBXBuildFile,
15
+ type PBXGroup,
16
+ type PBXNativeTarget,
17
+ type PBXObjects,
18
+ type PBXSourcesBuildPhase,
19
+ type Project,
20
+ type XCConfigurationList,
21
21
  } from 'xcode';
22
22
 
23
23
  interface ProjectFile {
@@ -501,8 +501,8 @@ export default function GlobalError(${chalk.green(
501
501
  );
502
502
  }
503
503
  `;
504
- } else {
505
- return `"use client";
504
+ }
505
+ return `"use client";
506
506
 
507
507
  ${chalk.green('import * as Sentry from "@sentry/nextjs";')}
508
508
  ${chalk.green('import Error from "next/error";')}
@@ -522,5 +522,4 @@ export default function GlobalError(${chalk.green('{ error }')}) {
522
522
  );
523
523
  }
524
524
  `;
525
- }
526
525
  }
@@ -1,19 +1,16 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
1
3
  // @ts-expect-error - clack is ESM and TS complains about that. It works though
2
4
  import * as clack from '@clack/prompts';
3
5
  import * as Sentry from '@sentry/node';
4
6
  import chalk from 'chalk';
5
- import fs from 'fs';
6
7
  // @ts-expect-error - magicast is ESM and TS complains about that. It works though
7
- import { loadFile, generateCode } from 'magicast';
8
+ import { generateCode, loadFile } from 'magicast';
8
9
  // @ts-expect-error - magicast is ESM and TS complains about that. It works though
9
10
  import { addNuxtModule } from 'magicast/helpers';
10
- import path from 'path';
11
- import {
12
- getConfigBody,
13
- getDefaultNuxtConfig,
14
- getNuxtModuleFallbackTemplate,
15
- getSentryConfigContents,
16
- } from './templates';
11
+ import opn from 'opn';
12
+ import { type SemVer, lt } from 'semver';
13
+ import { traceStep } from '../telemetry';
17
14
  import {
18
15
  abortIfCancelled,
19
16
  askShouldAddPackageOverride,
@@ -21,13 +18,19 @@ import {
21
18
  featureSelectionPrompt,
22
19
  installPackage,
23
20
  isUsingTypeScript,
24
- opn,
25
21
  } from '../utils/clack-utils';
26
- import { traceStep } from '../telemetry';
27
- import { lt, SemVer } from 'semver';
28
- import { PackageManager, PNPM } from '../utils/package-manager';
29
- import { hasPackageInstalled, PackageDotJson } from '../utils/package-json';
30
- import { deploymentPlatforms, DeploymentPlatform } from './types';
22
+ import {
23
+ type PackageDotJson,
24
+ hasPackageInstalled,
25
+ } from '../utils/package-json';
26
+ import { PNPM, type PackageManager } from '../utils/package-manager';
27
+ import {
28
+ getConfigBody,
29
+ getDefaultNuxtConfig,
30
+ getNuxtModuleFallbackTemplate,
31
+ getSentryConfigContents,
32
+ } from './templates';
33
+ import { type DeploymentPlatform, deploymentPlatforms } from './types';
31
34
 
32
35
  const possibleNuxtConfig = [
33
36
  'nuxt.config.js',
@@ -342,8 +345,8 @@ export async function confirmReadImportDocs(
342
345
  Sentry.setTag('init-with-import-docs-opened', shouldOpenDocs);
343
346
 
344
347
  if (shouldOpenDocs) {
345
- opn(docsUrl, { wait: false }).catch(() => {
346
- // opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here
347
- });
348
+ // opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here
349
+ const noop = () => {}; // eslint-disable-line @typescript-eslint/no-empty-function
350
+ opn(docsUrl, { wait: false }).then((cp) => cp.on('error', noop), noop);
348
351
  }
349
352
  }
@@ -1,8 +1,8 @@
1
- import * as fs from 'fs';
1
+ import * as fs from 'node:fs';
2
2
  // @ts-ignore - clack is ESM and TS complains about that. It works though
3
3
  import * as clack from '@clack/prompts';
4
4
  // @ts-ignore - magicast is ESM and TS complains about that. It works though
5
- import { ProxifiedModule } from 'magicast';
5
+ import type { ProxifiedModule } from 'magicast';
6
6
  import chalk from 'chalk';
7
7
  import * as Sentry from '@sentry/node';
8
8