@sentry/wizard 3.42.0 → 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 (339) 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 +30 -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 -6
  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 -5
  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/nextjs/templates.test.ts +0 -12
  336. package/test/utils/clack-utils.test.ts +40 -50
  337. package/types/read-env.d.ts +3 -0
  338. package/types/xcode.d.ts +1 -0
  339. package/dist/package.json +0 -128
@@ -1 +1 @@
1
- {"version":3,"file":"MergeConfig.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/MergeConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,qCAAyB;AACzB,yCAA6B;AAE7B,8CAAiD;AAEjD,IAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,8BAA8B,CAAC,CAAC;AAC9E,IAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAC5B,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,gDAAgD,CACjD,CAAC;AAEF,SAAS,eAAe,CAAC,GAAW;IAIlC,IAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAC1B,SAAS,EACT,IAAI,EACJ,oCAA6B,GAAG,QAAK,CACtC,CAAC;IACF,IAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAC1B,SAAS,EACT,IAAI,EACJ,oCAA6B,GAAG,eAAY,CAC7C,CAAC;IACF,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,CAAC,CAAC,OAAO,CACjD,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CACpC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/// <reference types=\"jest\" />\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nimport { mergeConfigFile } from '../MergeConfig';\n\nconst configPath = path.join(__dirname, '..', 'test-fixtures/next.config.js');\nconst templatePath = path.join(\n __dirname,\n '..',\n '..',\n '..',\n 'scripts/NextJs/configs/next.config.template.js',\n);\n\nfunction configFileNames(num: number): {\n sourcePath: string;\n mergedPath: string;\n} {\n const sourcePath = path.join(\n __dirname,\n '..',\n `test-fixtures/next.config.${num}.js`,\n );\n const mergedPath = path.join(\n __dirname,\n '..',\n `test-fixtures/next.config.${num}-merged.js`,\n );\n return { sourcePath, mergedPath };\n}\n\ndescribe('Merging next.config.js', () => {\n afterEach(() => {\n fs.unlinkSync(configPath);\n });\n\n test('merge basic next.config.js return true', () => {\n const { sourcePath } = configFileNames(1);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge basic next.config.js', () => {\n const { sourcePath, mergedPath } = configFileNames(1);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(\n fs.readFileSync(mergedPath, 'utf8'),\n );\n });\n\n test('merge invalid javascript config return false', () => {\n const { sourcePath } = configFileNames(2);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(false);\n });\n\n test('merge more complicated next.config.js return true', () => {\n const { sourcePath } = configFileNames(3);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge more complicated next.config.js', () => {\n const { sourcePath, mergedPath } = configFileNames(3);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(\n fs.readFileSync(mergedPath, 'utf8'),\n );\n });\n\n test('merge next.config.js with function return true', () => {\n const { sourcePath } = configFileNames(4);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge next.config.js with function', () => {\n const { sourcePath, mergedPath } = configFileNames(4);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(\n fs.readFileSync(mergedPath, 'utf8'),\n );\n });\n});\n"]}
1
+ {"version":3,"file":"MergeConfig.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/MergeConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,uCAAyB;AACzB,2CAA6B;AAE7B,gDAAiD;AAEjD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,8BAA8B,CAAC,CAAC;AAC9E,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAC5B,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,gDAAgD,CACjD,CAAC;AAEF,SAAS,eAAe,CAAC,GAAW;IAIlC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAC1B,SAAS,EACT,IAAI,EACJ,6BAA6B,GAAG,KAAK,CACtC,CAAC;IACF,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAC1B,SAAS,EACT,IAAI,EACJ,6BAA6B,GAAG,YAAY,CAC7C,CAAC;IACF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AACpC,CAAC;AAED,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,SAAS,CAAC,GAAG,EAAE;QACb,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,IA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cesContent":["/// <reference types=\"jest\" />\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nimport { mergeConfigFile } from '../MergeConfig';\n\nconst configPath = path.join(__dirname, '..', 'test-fixtures/next.config.js');\nconst templatePath = path.join(\n __dirname,\n '..',\n '..',\n '..',\n 'scripts/NextJs/configs/next.config.template.js',\n);\n\nfunction configFileNames(num: number): {\n sourcePath: string;\n mergedPath: string;\n} {\n const sourcePath = path.join(\n __dirname,\n '..',\n `test-fixtures/next.config.${num}.js`,\n );\n const mergedPath = path.join(\n __dirname,\n '..',\n `test-fixtures/next.config.${num}-merged.js`,\n );\n return { sourcePath, mergedPath };\n}\n\ndescribe('Merging next.config.js', () => {\n afterEach(() => {\n fs.unlinkSync(configPath);\n });\n\n test('merge basic next.config.js return true', () => {\n const { sourcePath } = configFileNames(1);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge basic next.config.js', () => {\n const { sourcePath, mergedPath } = configFileNames(1);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(\n fs.readFileSync(mergedPath, 'utf8'),\n );\n });\n\n test('merge invalid javascript config return false', () => {\n const { sourcePath } = configFileNames(2);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(false);\n });\n\n test('merge more complicated next.config.js return true', () => {\n const { sourcePath } = configFileNames(3);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge more complicated next.config.js', () => {\n const { sourcePath, mergedPath } = configFileNames(3);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(\n fs.readFileSync(mergedPath, 'utf8'),\n );\n });\n\n test('merge next.config.js with function return true', () => {\n const { sourcePath } = configFileNames(4);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge next.config.js with function', () => {\n const { sourcePath, mergedPath } = configFileNames(4);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(\n fs.readFileSync(mergedPath, 'utf8'),\n );\n });\n});\n"]}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var Constants_1 = require("../../Constants");
4
- var SentryCli_1 = require("../SentryCli");
5
- var args = {
3
+ const Constants_1 = require("../../Constants");
4
+ const SentryCli_1 = require("../SentryCli");
5
+ const args = {
6
6
  debug: false,
7
7
  integration: Constants_1.Integration.reactNative,
8
8
  platform: [Constants_1.Platform.ios],
@@ -13,7 +13,7 @@ var args = {
13
13
  signup: false,
14
14
  disableTelemetry: false,
15
15
  };
16
- var demoAnswers = {
16
+ const demoAnswers = {
17
17
  config: {
18
18
  auth: {
19
19
  token: 'abcd',
@@ -26,44 +26,54 @@ var demoAnswers = {
26
26
  },
27
27
  },
28
28
  };
29
- describe('SentryCli', function () {
30
- test('convertAnswersToProperties', function () {
31
- var resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');
32
- var sentry = new SentryCli_1.SentryCli(args);
29
+ describe('SentryCli', () => {
30
+ test('convertAnswersToProperties', () => {
31
+ const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');
32
+ const sentry = new SentryCli_1.SentryCli(args);
33
33
  sentry.setResolveFunction(resolveFunc);
34
- var props = sentry.convertAnswersToProperties(demoAnswers);
34
+ const props = sentry.convertAnswersToProperties(demoAnswers);
35
35
  expect(props['defaults/url']).toBe('https://localhost:1234');
36
36
  expect(props['defaults/org']).toBe('test_org');
37
37
  expect(props['defaults/project']).toBe('test_proj');
38
38
  expect(props['auth/token']).toBe('abcd');
39
39
  expect(props['cli/executable']).toBe('node_modules/sentry/cli');
40
40
  });
41
- test('dump properties', function () {
42
- var resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');
43
- var sentry = new SentryCli_1.SentryCli(args);
41
+ test('dump properties', () => {
42
+ const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');
43
+ const sentry = new SentryCli_1.SentryCli(args);
44
44
  sentry.setResolveFunction(resolveFunc);
45
- var props = sentry.convertAnswersToProperties(demoAnswers);
45
+ const props = sentry.convertAnswersToProperties(demoAnswers);
46
46
  expect(sentry.dumpProperties(props))
47
- .toBe("defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules/sentry/cli\n");
47
+ .toBe(`defaults.url=https://localhost:1234
48
+ defaults.org=test_org
49
+ defaults.project=test_proj
50
+ auth.token=abcd
51
+ cli.executable=node_modules/sentry/cli
52
+ `);
48
53
  });
49
- test('convertAnswersToProperties windows', function () {
50
- var resolveFunc = jest.fn().mockReturnValue('node_modules\\sentry\\cli');
51
- var sentry = new SentryCli_1.SentryCli(args);
54
+ test('convertAnswersToProperties windows', () => {
55
+ const resolveFunc = jest.fn().mockReturnValue('node_modules\\sentry\\cli');
56
+ const sentry = new SentryCli_1.SentryCli(args);
52
57
  sentry.setResolveFunction(resolveFunc);
53
- var props = sentry.convertAnswersToProperties(demoAnswers);
58
+ const props = sentry.convertAnswersToProperties(demoAnswers);
54
59
  expect(props['defaults/url']).toBe('https://localhost:1234');
55
60
  expect(props['defaults/org']).toBe('test_org');
56
61
  expect(props['defaults/project']).toBe('test_proj');
57
62
  expect(props['auth/token']).toBe('abcd');
58
63
  expect(props['cli/executable']).toBe('node_modules\\\\sentry\\\\cli');
59
64
  });
60
- test('dump properties windows', function () {
61
- var resolveFunc = jest.fn().mockReturnValue('node_modules\\sentry\\cli');
62
- var sentry = new SentryCli_1.SentryCli(args);
65
+ test('dump properties windows', () => {
66
+ const resolveFunc = jest.fn().mockReturnValue('node_modules\\sentry\\cli');
67
+ const sentry = new SentryCli_1.SentryCli(args);
63
68
  sentry.setResolveFunction(resolveFunc);
64
- var props = sentry.convertAnswersToProperties(demoAnswers);
69
+ const props = sentry.convertAnswersToProperties(demoAnswers);
65
70
  expect(sentry.dumpProperties(props))
66
- .toBe("defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules\\\\sentry\\\\cli\n");
71
+ .toBe(`defaults.url=https://localhost:1234
72
+ defaults.org=test_org
73
+ defaults.project=test_proj
74
+ auth.token=abcd
75
+ cli.executable=node_modules\\\\sentry\\\\cli
76
+ `);
67
77
  });
68
78
  });
69
79
  //# sourceMappingURL=SentryCli.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/SentryCli.ts"],"names":[],"mappings":";;AAIA,6CAAwD;AACxD,0CAAyC;AAEzC,IAAM,IAAI,GAAS;IACjB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,uBAAW,CAAC,WAAW;IACpC,QAAQ,EAAE,CAAC,oBAAQ,CAAC,GAAG,CAAC;IACxB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,GAAG,EAAE,wBAAwB;IAC7B,MAAM,EAAE,KAAK;IACb,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF,IAAM,WAAW,GAAY;IAC3B,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;SACd;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,UAAU;SACjB;QACD,OAAO,EAAE;YACP,IAAI,EAAE,WAAW;SAClB;KACF;CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,EAAE;IACpB,IAAI,CAAC,4BAA4B,EAAE;QACjC,IAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;QACzE,IAAM,MAAM,GAAG,IAAI,qBAA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,CAAC,WAAW,CAAC,CAAC;QACvC,IAAM,KAAK,GAAG,MAAM,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,yBAAyB,EAAE;QAC9B,IAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,2BAA2B,CAAC,CAAC;QAC3E,IAAM,MAAM,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACvC,IAAM,KAAK,GAAG,MAAM,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;QAC7D,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;aACjC,IAAI,CAAC,yJAKX,CAAC,CAAC;IACD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/// <reference types=\"jest\" />\nimport type { Answers } from 'inquirer';\n\nimport type { Args } from '../../Constants';\nimport { Integration, Platform } from '../../Constants';\nimport { SentryCli } from '../SentryCli';\n\nconst args: Args = {\n debug: false,\n integration: Integration.reactNative,\n platform: [Platform.ios],\n quiet: false,\n skipConnect: false,\n uninstall: false,\n url: 'https://localhost:1234',\n signup: false,\n disableTelemetry: false,\n};\n\nconst demoAnswers: Answers = {\n config: {\n auth: {\n token: 'abcd',\n },\n organization: {\n slug: 'test_org',\n },\n project: {\n slug: 'test_proj',\n },\n },\n};\n\ndescribe('SentryCli', () => {\n test('convertAnswersToProperties', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(props['defaults/url']).toBe('https://localhost:1234');\n expect(props['defaults/org']).toBe('test_org');\n expect(props['defaults/project']).toBe('test_proj');\n expect(props['auth/token']).toBe('abcd');\n expect(props['cli/executable']).toBe('node_modules/sentry/cli');\n });\n\n test('dump properties', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(sentry.dumpProperties(props))\n .toBe(`defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules/sentry/cli\n`);\n });\n\n test('convertAnswersToProperties windows', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules\\\\sentry\\\\cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(props['defaults/url']).toBe('https://localhost:1234');\n expect(props['defaults/org']).toBe('test_org');\n expect(props['defaults/project']).toBe('test_proj');\n expect(props['auth/token']).toBe('abcd');\n expect(props['cli/executable']).toBe('node_modules\\\\\\\\sentry\\\\\\\\cli');\n });\n\n test('dump properties windows', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules\\\\sentry\\\\cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(sentry.dumpProperties(props))\n .toBe(`defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules\\\\\\\\sentry\\\\\\\\cli\n`);\n });\n});\n"]}
1
+ {"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/SentryCli.ts"],"names":[],"mappings":";;AAIA,+CAAwD;AACxD,4CAAyC;AAEzC,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,uBAAW,CAAC,WAAW;IACpC,QAAQ,EAAE,CAAC,oBAAQ,CAAC,GAAG,CAAC;IACxB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,GAAG,EAAE,wBAAwB;IAC7B,MAAM,EAAE,KAAK;IACb,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF,MAAM,WAAW,GAAY;IAC3B,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;SACd;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,UAAU;SACjB;QACD,OAAO,EAAE;YACP,IAAI,EAAE,WAAW;SAClB;KACF;CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAI,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACtC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;QACzE,MAAM,MAAM,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,MAAM,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC/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AAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACnC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,2BAA2B,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,MAAM,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;QAC7D,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;aACjC,IAAI,CAAC;;;;;CAKX,CAAC,CAAC;IACD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/// <reference types=\"jest\" />\nimport type { Answers } from 'inquirer';\n\nimport type { Args } from '../../Constants';\nimport { Integration, Platform } from '../../Constants';\nimport { SentryCli } from '../SentryCli';\n\nconst args: Args = {\n debug: false,\n integration: Integration.reactNative,\n platform: [Platform.ios],\n quiet: false,\n skipConnect: false,\n uninstall: false,\n url: 'https://localhost:1234',\n signup: false,\n disableTelemetry: false,\n};\n\nconst demoAnswers: Answers = {\n config: {\n auth: {\n token: 'abcd',\n },\n organization: {\n slug: 'test_org',\n },\n project: {\n slug: 'test_proj',\n },\n },\n};\n\ndescribe('SentryCli', () => {\n test('convertAnswersToProperties', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(props['defaults/url']).toBe('https://localhost:1234');\n expect(props['defaults/org']).toBe('test_org');\n expect(props['defaults/project']).toBe('test_proj');\n expect(props['auth/token']).toBe('abcd');\n expect(props['cli/executable']).toBe('node_modules/sentry/cli');\n });\n\n test('dump properties', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(sentry.dumpProperties(props))\n .toBe(`defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules/sentry/cli\n`);\n });\n\n test('convertAnswersToProperties windows', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules\\\\sentry\\\\cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(props['defaults/url']).toBe('https://localhost:1234');\n expect(props['defaults/org']).toBe('test_org');\n expect(props['defaults/project']).toBe('test_proj');\n expect(props['auth/token']).toBe('abcd');\n expect(props['cli/executable']).toBe('node_modules\\\\\\\\sentry\\\\\\\\cli');\n });\n\n test('dump properties windows', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules\\\\sentry\\\\cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(sentry.dumpProperties(props))\n .toBe(`defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules\\\\\\\\sentry\\\\\\\\cli\n`);\n });\n});\n"]}
package/dist/lib/Setup.js CHANGED
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
3
  if (k2 === undefined) k2 = k;
15
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -33,88 +22,37 @@ var __importStar = (this && this.__importStar) || function (mod) {
33
22
  __setModuleDefault(result, mod);
34
23
  return result;
35
24
  };
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- var __generator = (this && this.__generator) || function (thisArg, body) {
46
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
- function verb(n) { return function (v) { return step([n, v]); }; }
49
- function step(op) {
50
- if (f) throw new TypeError("Generator is already executing.");
51
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
52
- 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;
53
- if (y = 0, t) op = [op[0] & 2, t.value];
54
- switch (op[0]) {
55
- case 0: case 1: t = op; break;
56
- case 4: _.label++; return { value: op[1], done: false };
57
- case 5: _.label++; y = op[1]; op = [0]; continue;
58
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
- default:
60
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
- if (t[2]) _.ops.pop();
65
- _.trys.pop(); continue;
66
- }
67
- op = body.call(thisArg, _);
68
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
- }
71
- };
72
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
73
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
74
- if (ar || !(i in from)) {
75
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
76
- ar[i] = from[i];
77
- }
78
- }
79
- return to.concat(ar || Array.prototype.slice.call(from));
80
- };
81
25
  Object.defineProperty(exports, "__esModule", { value: true });
82
26
  exports.run = void 0;
83
- var _ = __importStar(require("lodash"));
84
- var debug_1 = require("../src/utils/debug");
85
- var Env_1 = require("./Helper/Env");
86
- var Wizard_1 = require("./Helper/Wizard");
87
- var Step = __importStar(require("./Steps"));
27
+ const debug_1 = require("../src/utils/debug");
28
+ const Env_1 = require("./Helper/Env");
29
+ const Wizard_1 = require("./Helper/Wizard");
30
+ const Step = __importStar(require("./Steps"));
88
31
  /**
89
32
  * @deprecated this function is the entry point to the old, step-based wizards located in `lib`.
90
33
  * When creating new wizards, we now add them to clack-based wizards under `src`.
91
34
  * Therefor, do not call this function anymore.
92
35
  * Use `run` from {@link ../src/run.ts} instead.
93
36
  */
94
- function run(argv) {
95
- return __awaiter(this, void 0, void 0, function () {
96
- var args, steps;
97
- return __generator(this, function (_a) {
98
- args = __assign(__assign({}, argv), (0, Env_1.readEnvironment)());
99
- if (argv.debug) {
100
- (0, debug_1.enableDebugLogs)();
101
- }
102
- if (args.uninstall === undefined) {
103
- args.uninstall = false;
104
- }
105
- steps = [
106
- Step.Initial,
107
- Step.Welcome,
108
- Step.ChooseIntegration,
109
- Step.ShouldConfigure,
110
- ];
111
- if (args.uninstall === false) {
112
- steps = _.concat(steps, Step.OpenSentry, Step.WaitForSentry, Step.SentryProjectSelector, Step.PromptForParameters);
113
- }
114
- steps = _.concat(steps, Step.ConfigureProject, Step.Result);
115
- return [2 /*return*/, Wizard_1.startWizard.apply(void 0, __spreadArray([args], steps, false))];
116
- });
117
- });
37
+ async function run(argv) {
38
+ const args = { ...argv, ...(0, Env_1.readEnvironment)() };
39
+ if (argv.debug) {
40
+ (0, debug_1.enableDebugLogs)();
41
+ }
42
+ if (args.uninstall === undefined) {
43
+ args.uninstall = false;
44
+ }
45
+ const steps = [
46
+ Step.Initial,
47
+ Step.Welcome,
48
+ Step.ChooseIntegration,
49
+ Step.ShouldConfigure,
50
+ ];
51
+ if (args.uninstall === false) {
52
+ steps.push(Step.OpenSentry, Step.WaitForSentry, Step.SentryProjectSelector, Step.PromptForParameters);
53
+ }
54
+ steps.push(Step.ConfigureProject, Step.Result);
55
+ return (0, Wizard_1.startWizard)(args, ...steps);
118
56
  }
119
57
  exports.run = run;
120
58
  //# sourceMappingURL=Setup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Setup.js","sourceRoot":"","sources":["../../lib/Setup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA4B;AAC5B,4CAAqD;AAErD,oCAA+C;AAC/C,0CAA8C;AAC9C,4CAAgC;AAEhC;;;;;GAKG;AACH,SAAsB,GAAG,CAAC,IAAS;;;;YAC3B,IAAI,yBAAQ,IAAI,GAAK,IAAA,qBAAe,GAAE,CAAE,CAAC;YAE/C,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,IAAA,uBAAe,GAAE,CAAC;aACnB;YAED,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;gBAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;aACxB;YACG,KAAK,GAAG;gBACV,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,iBAAiB;gBACtB,IAAI,CAAC,eAAe;aACrB,CAAC;YACF,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,EAAE;gBAC5B,KAAK,GAAG,CAAC,CAAC,MAAM,CACd,KAAK,EACL,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,qBAAqB,EAC1B,IAAI,CAAC,mBAAmB,CACzB,CAAC;aACH;YACD,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5D,sBAAO,oBAAW,8BAAC,IAAI,GAAK,KAAK,WAAE;;;CACpC;AA3BD,kBA2BC","sourcesContent":["import * as _ from 'lodash';\nimport { enableDebugLogs } from '../src/utils/debug';\n\nimport { readEnvironment } from './Helper/Env';\nimport { startWizard } from './Helper/Wizard';\nimport * as Step from './Steps';\n\n/**\n * @deprecated this function is the entry point to the old, step-based wizards located in `lib`.\n * When creating new wizards, we now add them to clack-based wizards under `src`.\n * Therefor, do not call this function anymore.\n * Use `run` from {@link ../src/run.ts} instead.\n */\nexport async function run(argv: any): Promise<any> {\n const args = { ...argv, ...readEnvironment() };\n\n if (argv.debug) {\n enableDebugLogs();\n }\n\n if (args.uninstall === undefined) {\n args.uninstall = false;\n }\n let steps = [\n Step.Initial,\n Step.Welcome,\n Step.ChooseIntegration,\n Step.ShouldConfigure,\n ];\n if (args.uninstall === false) {\n steps = _.concat(\n steps,\n Step.OpenSentry,\n Step.WaitForSentry,\n Step.SentryProjectSelector,\n Step.PromptForParameters,\n );\n }\n steps = _.concat(steps, Step.ConfigureProject, Step.Result);\n return startWizard(args, ...steps);\n}\n"]}
1
+ {"version":3,"file":"Setup.js","sourceRoot":"","sources":["../../lib/Setup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAqD;AAErD,sCAA+C;AAC/C,4CAA8C;AAC9C,8CAAgC;AAEhC;;;;;GAKG;AACI,KAAK,UAAU,GAAG,CAAC,IAAS;IACjC,MAAM,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,IAAA,qBAAe,GAAE,EAAE,CAAC;IAE/C,IAAI,IAAI,CAAC,KAAK,EAAE;QACd,IAAA,uBAAe,GAAE,CAAC;KACnB;IAED,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;QAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;KACxB;IACD,MAAM,KAAK,GAAG;QACZ,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,iBAAiB;QACtB,IAAI,CAAC,eAAe;KACrB,CAAC;IACF,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,EAAE;QAC5B,KAAK,CAAC,IAAI,CACR,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,qBAAqB,EAC1B,IAAI,CAAC,mBAAmB,CACzB,CAAC;KACH;IACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAE/C,OAAO,IAAA,oBAAW,EAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;AACrC,CAAC;AA3BD,kBA2BC","sourcesContent":["import { enableDebugLogs } from '../src/utils/debug';\n\nimport { readEnvironment } from './Helper/Env';\nimport { startWizard } from './Helper/Wizard';\nimport * as Step from './Steps';\n\n/**\n * @deprecated this function is the entry point to the old, step-based wizards located in `lib`.\n * When creating new wizards, we now add them to clack-based wizards under `src`.\n * Therefor, do not call this function anymore.\n * Use `run` from {@link ../src/run.ts} instead.\n */\nexport async function run(argv: any): Promise<any> {\n const args = { ...argv, ...readEnvironment() };\n\n if (argv.debug) {\n enableDebugLogs();\n }\n\n if (args.uninstall === undefined) {\n args.uninstall = false;\n }\n const steps = [\n Step.Initial,\n Step.Welcome,\n Step.ChooseIntegration,\n Step.ShouldConfigure,\n ];\n if (args.uninstall === false) {\n steps.push(\n Step.OpenSentry,\n Step.WaitForSentry,\n Step.SentryProjectSelector,\n Step.PromptForParameters,\n );\n }\n steps.push(Step.ConfigureProject, Step.Result);\n\n return startWizard(args, ...steps);\n}\n"]}
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseStep = void 0;
4
- var Logging_1 = require("../Helper/Logging");
5
- var BaseStep = /** @class */ (function () {
6
- function BaseStep(_argv) {
4
+ const Logging_1 = require("../Helper/Logging");
5
+ class BaseStep {
6
+ _argv;
7
+ _isDebug = false;
8
+ constructor(_argv) {
7
9
  this._argv = _argv;
8
- this._isDebug = false;
9
10
  this._isDebug = _argv.debug;
10
11
  }
11
- BaseStep.prototype.debug = function (msg) {
12
+ debug(msg) {
12
13
  if (this._isDebug) {
13
14
  (0, Logging_1.nl)();
14
15
  (0, Logging_1.debug)(msg);
15
16
  (0, Logging_1.nl)();
16
17
  }
17
- };
18
- return BaseStep;
19
- }());
18
+ }
19
+ }
20
20
  exports.BaseStep = BaseStep;
21
21
  //# sourceMappingURL=BaseStep.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseStep.js","sourceRoot":"","sources":["../../../lib/Steps/BaseStep.ts"],"names":[],"mappings":";;;AAGA,6CAA8C;AAE9C;IAEE,kBAA6B,KAAW;QAAX,UAAK,GAAL,KAAK,CAAM;QAD9B,aAAQ,GAAG,KAAK,CAAC;QAEzB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;IAC9B,CAAC;IAEM,wBAAK,GAAZ,UAAa,GAAQ;QACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAA,YAAE,GAAE,CAAC;YACL,IAAA,eAAK,EAAC,GAAG,CAAC,CAAC;YACX,IAAA,YAAE,GAAE,CAAC;SACN;IACH,CAAC;IAGH,eAAC;AAAD,CAAC,AAfD,IAeC;AAfqB,4BAAQ","sourcesContent":["import type { Answers } from 'inquirer';\n\nimport type { Args } from '../Constants';\nimport { debug, nl } from '../Helper/Logging';\n\nexport abstract class BaseStep implements IStep {\n protected _isDebug = false;\n public constructor(protected _argv: Args) {\n this._isDebug = _argv.debug;\n }\n\n public debug(msg: any): void {\n if (this._isDebug) {\n nl();\n debug(msg);\n nl();\n }\n }\n\n public abstract emit(answers: Answers): Promise<Answers>;\n}\n\nexport interface IStep {\n emit(answers?: Answers): Promise<Answers>;\n}\n"]}
1
+ {"version":3,"file":"BaseStep.js","sourceRoot":"","sources":["../../../lib/Steps/BaseStep.ts"],"names":[],"mappings":";;;AAGA,+CAA8C;AAE9C,MAAsB,QAAQ;IAEC;IADnB,QAAQ,GAAG,KAAK,CAAC;IAC3B,YAA6B,KAAW;QAAX,UAAK,GAAL,KAAK,CAAM;QACtC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;IAC9B,CAAC;IAEM,KAAK,CAAC,GAAQ;QACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAA,YAAE,GAAE,CAAC;YACL,IAAA,eAAK,EAAC,GAAG,CAAC,CAAC;YACX,IAAA,YAAE,GAAE,CAAC;SACN;IACH,CAAC;CAGF;AAfD,4BAeC","sourcesContent":["import type { Answers } from 'inquirer';\n\nimport type { Args } from '../Constants';\nimport { debug, nl } from '../Helper/Logging';\n\nexport abstract class BaseStep implements IStep {\n protected _isDebug = false;\n public constructor(protected _argv: Args) {\n this._isDebug = _argv.debug;\n }\n\n public debug(msg: any): void {\n if (this._isDebug) {\n nl();\n debug(msg);\n nl();\n }\n }\n\n public abstract emit(answers: Answers): Promise<Answers>;\n}\n\nexport interface IStep {\n emit(answers?: Answers): Promise<Answers>;\n}\n"]}
@@ -1,100 +1,62 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- 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;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
2
  Object.defineProperty(exports, "__esModule", { value: true });
54
3
  exports.ChooseIntegration = void 0;
55
- var inquirer_1 = require("inquirer");
56
- var Constants_1 = require("../Constants");
57
- var BaseStep_1 = require("./BaseStep");
58
- var Cordova_1 = require("./Integrations/Cordova");
59
- var Electron_1 = require("./Integrations/Electron");
60
- var package_json_1 = require("../../src/utils/package-json");
61
- var Logging_1 = require("../Helper/Logging");
62
- var projectPackage = {};
63
- try {
64
- // If we run directly in setup-wizard
65
- projectPackage = require('../../package.json');
66
- }
67
- catch (_a) {
68
- projectPackage = require("".concat(process.cwd(), "/package.json"));
4
+ const inquirer_1 = require("inquirer");
5
+ const node_fs_1 = require("node:fs");
6
+ const package_json_1 = require("../../src/utils/package-json");
7
+ const Constants_1 = require("../Constants");
8
+ const Logging_1 = require("../Helper/Logging");
9
+ const BaseStep_1 = require("./BaseStep");
10
+ const Cordova_1 = require("./Integrations/Cordova");
11
+ const Electron_1 = require("./Integrations/Electron");
12
+ function getProjectPackage() {
13
+ let projectPackage = {};
14
+ const projectPackagePathCandidates = [
15
+ // If we run directly in setup-wizard
16
+ '../../package.json',
17
+ // If we run from the CLI
18
+ `${process.cwd()}/package.json`,
19
+ ];
20
+ for (const pathCandidate of projectPackagePathCandidates) {
21
+ let data;
22
+ try {
23
+ data = (0, node_fs_1.readFileSync)(pathCandidate, 'utf-8');
24
+ }
25
+ catch (error) {
26
+ // If the file does not exist, continue to the next candidate
27
+ continue;
28
+ }
29
+ try {
30
+ projectPackage = JSON.parse(data);
31
+ break;
32
+ }
33
+ catch (error) {
34
+ // If the file exists but is not valid JSON, log an error and continue.
35
+ // Note: we don't want to crash the wizard if the package.json is invalid,
36
+ // because it is only use by the integration detection logic.
37
+ // Furthmore other package managers, i.e. bun, allow JSON-with-comments which might
38
+ // throw errors with JSON.parse, and will require a different JSON parser in the future.
39
+ (0, Logging_1.red)(`Failed to parse JSON from ${pathCandidate}, is your file a valid package.json?`);
40
+ }
41
+ }
42
+ return projectPackage;
69
43
  }
70
- var ChooseIntegration = /** @class */ (function (_super) {
71
- __extends(ChooseIntegration, _super);
72
- function ChooseIntegration() {
73
- return _super !== null && _super.apply(this, arguments) || this;
44
+ class ChooseIntegration extends BaseStep_1.BaseStep {
45
+ async emit(_answers) {
46
+ const integrationPrompt = await this._getIntegrationPromptSelection();
47
+ let integration = null;
48
+ switch (integrationPrompt.integration) {
49
+ case Constants_1.Integration.cordova:
50
+ integration = new Cordova_1.Cordova(sanitizeUrl(this._argv));
51
+ break;
52
+ case Constants_1.Integration.electron:
53
+ integration = new Electron_1.Electron(sanitizeUrl(this._argv));
54
+ break;
55
+ }
56
+ return { integration };
74
57
  }
75
- ChooseIntegration.prototype.emit = function (_answers) {
76
- return __awaiter(this, void 0, void 0, function () {
77
- var integrationPrompt, integration;
78
- return __generator(this, function (_a) {
79
- switch (_a.label) {
80
- case 0: return [4 /*yield*/, this._getIntegrationPromptSelection()];
81
- case 1:
82
- integrationPrompt = _a.sent();
83
- integration = null;
84
- switch (integrationPrompt.integration) {
85
- case Constants_1.Integration.cordova:
86
- integration = new Cordova_1.Cordova(sanitizeUrl(this._argv));
87
- break;
88
- case Constants_1.Integration.electron:
89
- integration = new Electron_1.Electron(sanitizeUrl(this._argv));
90
- break;
91
- }
92
- return [2 /*return*/, { integration: integration }];
93
- }
94
- });
95
- });
96
- };
97
- ChooseIntegration.prototype.tryDetectingIntegration = function () {
58
+ tryDetectingIntegration() {
59
+ const projectPackage = getProjectPackage();
98
60
  if ((0, package_json_1.hasPackageInstalled)('react-native', projectPackage)) {
99
61
  return Constants_1.Integration.reactNative;
100
62
  }
@@ -114,37 +76,30 @@ var ChooseIntegration = /** @class */ (function (_super) {
114
76
  return Constants_1.Integration.sveltekit;
115
77
  }
116
78
  return;
117
- };
118
- ChooseIntegration.prototype._getIntegrationPromptSelection = function () {
119
- return __awaiter(this, void 0, void 0, function () {
120
- var detectedDefaultSelection;
121
- return __generator(this, function (_a) {
122
- // If we receive project type as an arg we skip asking
123
- if (this._argv.integration) {
124
- return [2 /*return*/, { integration: this._argv.integration }];
125
- }
126
- else {
127
- if (this._argv.quiet) {
128
- throw new Error('You need to choose a platform');
129
- }
130
- detectedDefaultSelection = this.tryDetectingIntegration();
131
- return [2 /*return*/, (0, inquirer_1.prompt)([
132
- {
133
- choices: (0, Constants_1.getIntegrationChoices)(),
134
- default: detectedDefaultSelection,
135
- message: 'What platform do you want to set up?',
136
- name: 'integration',
137
- type: 'list',
138
- pageSize: 10,
139
- },
140
- ])];
141
- }
142
- return [2 /*return*/];
143
- });
144
- });
145
- };
146
- return ChooseIntegration;
147
- }(BaseStep_1.BaseStep));
79
+ }
80
+ async _getIntegrationPromptSelection() {
81
+ // If we receive project type as an arg we skip asking
82
+ if (this._argv.integration) {
83
+ return { integration: this._argv.integration };
84
+ }
85
+ else {
86
+ if (this._argv.quiet) {
87
+ throw new Error('You need to choose a platform');
88
+ }
89
+ const detectedDefaultSelection = this.tryDetectingIntegration();
90
+ return (0, inquirer_1.prompt)([
91
+ {
92
+ choices: (0, Constants_1.getIntegrationChoices)(),
93
+ default: detectedDefaultSelection,
94
+ message: 'What platform do you want to set up?',
95
+ name: 'integration',
96
+ type: 'list',
97
+ pageSize: 10,
98
+ },
99
+ ]);
100
+ }
101
+ }
102
+ }
148
103
  exports.ChooseIntegration = ChooseIntegration;
149
104
  /**
150
105
  * For the `clack`-based wizard flows, which we only shim here, we don't set
@@ -154,10 +109,10 @@ exports.ChooseIntegration = ChooseIntegration;
154
109
  function sanitizeUrl(argv) {
155
110
  if (!argv.url) {
156
111
  argv.url = Constants_1.DEFAULT_URL;
157
- (0, Logging_1.dim)("no URL provided, fallback to ".concat(argv.url));
112
+ (0, Logging_1.dim)(`no URL provided, fallback to ${argv.url}`);
158
113
  return argv;
159
114
  }
160
- var baseUrl = argv.url;
115
+ let baseUrl = argv.url;
161
116
  baseUrl += baseUrl.endsWith('/') ? '' : '/';
162
117
  baseUrl = baseUrl.replace(/:\/(?!\/)/g, '://');
163
118
  argv.url = baseUrl;
@@ -1 +1 @@
1
- {"version":3,"file":"ChooseIntegration.js","sourceRoot":"","sources":["../../../lib/Steps/ChooseIntegration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAAkC;AAElC,0CAKsB;AACtB,uCAAsC;AACtC,kDAAiD;AACjD,oDAAmD;AACnD,6DAAmE;AACnE,6CAAwC;AAExC,IAAI,cAAc,GAAQ,EAAE,CAAC;AAE7B,IAAI;IACF,qCAAqC;IACrC,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAChD;AAAC,WAAM;IACN,cAAc,GAAG,OAAO,CAAC,UAAG,OAAO,CAAC,GAAG,EAAE,kBAAe,CAAC,CAAC;CAC3D;AAMD;IAAuC,qCAAQ;IAA/C;;IA+DA,CAAC;IA9Dc,gCAAI,GAAjB,UAAkB,QAAiB;;;;;4BACP,qBAAM,IAAI,CAAC,8BAA8B,EAAE,EAAA;;wBAA/D,iBAAiB,GAAG,SAA2C;wBA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,EAAC;iBAChD;qBAAM;oBACL,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;wBACpB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;qBAClD;oBAEK,wBAAwB,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC;oBAEhE,sBAAO,IAAA,iBAAM,EAAC;4BACZ;gCACE,OAAO,EAAE,IAAA,iCAAqB,GAAE;gCAChC,OAAO,EAAE,wBAAwB;gCACjC,OAAO,EAAE,sCAAsC;gCAC/C,IAAI,EAAE,aAAa;gCACnB,IAAI,EAAE,MAAM;gCACZ,QAAQ,EAAE,EAAE;6BACb;yBACF,CAAC,EAAC;iBACJ;;;;KACF;IACH,wBAAC;AAAD,CAAC,AA/DD,CAAuC,mBAAQ,GA+D9C;AA/DY,8CAAiB;AAiE9B;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAU;IAC7B,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,GAAG,uBAAW,CAAC;QACvB,IAAA,aAAG,EAAC,uCAAgC,IAAI,CAAC,GAAG,CAAE,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;IACvB,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC;IAEnB,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\n\nimport {\n Args,\n DEFAULT_URL,\n getIntegrationChoices,\n Integration,\n} from '../Constants';\nimport { BaseStep } from './BaseStep';\nimport { Cordova } from './Integrations/Cordova';\nimport { Electron } from './Integrations/Electron';\nimport { hasPackageInstalled } from '../../src/utils/package-json';\nimport { dim } from '../Helper/Logging';\n\nlet projectPackage: any = {};\n\ntry {\n // If we run directly in setup-wizard\n projectPackage = require('../../package.json');\n} catch {\n projectPackage = require(`${process.cwd()}/package.json`);\n}\n\ntype IntegrationPromptAnswer = {\n integration: Integration;\n};\n\nexport class ChooseIntegration extends BaseStep {\n public async emit(_answers: Answers): Promise<Answers> {\n const integrationPrompt = await this._getIntegrationPromptSelection();\n\n let integration = null;\n switch (integrationPrompt.integration) {\n case Integration.cordova:\n integration = new Cordova(sanitizeUrl(this._argv));\n break;\n case Integration.electron:\n integration = new Electron(sanitizeUrl(this._argv));\n break;\n }\n\n return { integration };\n }\n\n public tryDetectingIntegration(): Integration | undefined {\n if (hasPackageInstalled('react-native', projectPackage)) {\n return Integration.reactNative;\n }\n if (hasPackageInstalled('cordova', projectPackage)) {\n return Integration.cordova;\n }\n if (hasPackageInstalled('electron', projectPackage)) {\n return Integration.electron;\n }\n if (hasPackageInstalled('next', projectPackage)) {\n return Integration.nextjs;\n }\n if (hasPackageInstalled('remix-run', projectPackage)) {\n return Integration.remix;\n }\n if (hasPackageInstalled('@sveltejs/kit', projectPackage)) {\n return Integration.sveltekit;\n }\n\n return;\n }\n\n private async _getIntegrationPromptSelection(): Promise<IntegrationPromptAnswer> {\n // If we receive project type as an arg we skip asking\n if (this._argv.integration) {\n return { integration: this._argv.integration };\n } else {\n if (this._argv.quiet) {\n throw new Error('You need to choose a platform');\n }\n\n const detectedDefaultSelection = this.tryDetectingIntegration();\n\n return prompt([\n {\n choices: getIntegrationChoices(),\n default: detectedDefaultSelection,\n message: 'What platform do you want to set up?',\n name: 'integration',\n type: 'list',\n pageSize: 10,\n },\n ]);\n }\n }\n}\n\n/**\n * For the `clack`-based wizard flows, which we only shim here, we don't set\n * a default url value. For backwards-compatibility with the other flows,\n * we fill it here and sanitize a user-enterd url.\n */\nfunction sanitizeUrl(argv: Args): Args {\n if (!argv.url) {\n argv.url = DEFAULT_URL;\n dim(`no URL provided, fallback to ${argv.url}`);\n return argv;\n }\n\n let baseUrl = argv.url;\n baseUrl += baseUrl.endsWith('/') ? '' : '/';\n baseUrl = baseUrl.replace(/:\\/(?!\\/)/g, '://');\n argv.url = baseUrl;\n\n return argv;\n}\n"]}
1
+ {"version":3,"file":"ChooseIntegration.js","sourceRoot":"","sources":["../../../lib/Steps/ChooseIntegration.ts"],"names":[],"mappings":";;;AACA,uCAAkC;AAElC,qCAAuC;AACvC,+DAAmE;AACnE,4CAKsB;AACtB,+CAA6C;AAC7C,yCAAsC;AACtC,oDAAiD;AACjD,sDAAmD;AAEnD,SAAS,iBAAiB;IACxB,IAAI,cAAc,GAA4B,EAAE,CAAC;IAEjD,MAAM,4BAA4B,GAAG;QACnC,qCAAqC;QACrC,oBAAoB;QAEpB,yBAAyB;QACzB,GAAG,OAAO,CAAC,GAAG,EAAE,eAAe;KAChC,CAAC;IAEF,KAAK,MAAM,aAAa,IAAI,4BAA4B,EAAE;QACxD,IAAI,IAAY,CAAC;QACjB,IAAI;YACF,IAAI,GAAG,IAAA,sBAAY,EAAC,aAAa,EAAE,OAAO,CAAC,CAAC;SAC7C;QAAC,OAAO,KAAK,EAAE;YACd,6DAA6D;YAC7D,SAAS;SACV;QAED,IAAI;YACF,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAA4B,CAAC;YAC7D,MAAM;SACP;QAAC,OAAO,KAAK,EAAE;YACd,uEAAuE;YACvE,0EAA0E;YAC1E,6DAA6D;YAC7D,mFAAmF;YACnF,wFAAwF;YACxF,IAAA,aAAG,EACD,6BAA6B,aAAa,sCAAsC,CACjF,CAAC;SACH;KACF;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AAMD,MAAa,iBAAkB,SAAQ,mBAAQ;IACtC,KAAK,CAAC,IAAI,CAAC,QAAiB;QACjC,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,8BAA8B,EAAE,CAAC;QAEtE,IAAI,WAAW,GAAG,I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WAAW,EAAE,CAAC;SAChD;aAAM;YACL,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;gBACpB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;aAClD;YAED,MAAM,wBAAwB,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC;YAEhE,OAAO,IAAA,iBAAM,EAAC;gBACZ;oBACE,OAAO,EAAE,IAAA,iCAAqB,GAAE;oBAChC,OAAO,EAAE,wBAAwB;oBACjC,OAAO,EAAE,sCAAsC;oBAC/C,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,EAAE;iBACb;aACF,CAAC,CAAC;SACJ;IACH,CAAC;CACF;AAjED,8CAiEC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAU;IAC7B,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,GAAG,uBAAW,CAAC;QACvB,IAAA,aAAG,EAAC,gCAAgC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;IACvB,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC;IAEnB,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\n\nimport { readFileSync } from 'node:fs';\nimport { hasPackageInstalled } from '../../src/utils/package-json';\nimport {\n Args,\n DEFAULT_URL,\n getIntegrationChoices,\n Integration,\n} from '../Constants';\nimport { dim, red } from '../Helper/Logging';\nimport { BaseStep } from './BaseStep';\nimport { Cordova } from './Integrations/Cordova';\nimport { Electron } from './Integrations/Electron';\n\nfunction getProjectPackage(): Record<string, unknown> {\n let projectPackage: Record<string, unknown> = {};\n\n const projectPackagePathCandidates = [\n // If we run directly in setup-wizard\n '../../package.json',\n\n // If we run from the CLI\n `${process.cwd()}/package.json`,\n ];\n\n for (const pathCandidate of projectPackagePathCandidates) {\n let data: string;\n try {\n data = readFileSync(pathCandidate, 'utf-8');\n } catch (error) {\n // If the file does not exist, continue to the next candidate\n continue;\n }\n\n try {\n projectPackage = JSON.parse(data) as Record<string, unknown>;\n break;\n } catch (error) {\n // If the file exists but is not valid JSON, log an error and continue.\n // Note: we don't want to crash the wizard if the package.json is invalid,\n // because it is only use by the integration detection logic.\n // Furthmore other package managers, i.e. bun, allow JSON-with-comments which might\n // throw errors with JSON.parse, and will require a different JSON parser in the future.\n red(\n `Failed to parse JSON from ${pathCandidate}, is your file a valid package.json?`,\n );\n }\n }\n\n return projectPackage;\n}\n\ntype IntegrationPromptAnswer = {\n integration: Integration;\n};\n\nexport class ChooseIntegration extends BaseStep {\n public async emit(_answers: Answers): Promise<Answers> {\n const integrationPrompt = await this._getIntegrationPromptSelection();\n\n let integration = null;\n switch (integrationPrompt.integration) {\n case Integration.cordova:\n integration = new Cordova(sanitizeUrl(this._argv));\n break;\n case Integration.electron:\n integration = new Electron(sanitizeUrl(this._argv));\n break;\n }\n\n return { integration };\n }\n\n public tryDetectingIntegration(): Integration | undefined {\n const projectPackage = getProjectPackage();\n\n if (hasPackageInstalled('react-native', projectPackage)) {\n return Integration.reactNative;\n }\n if (hasPackageInstalled('cordova', projectPackage)) {\n return Integration.cordova;\n }\n if (hasPackageInstalled('electron', projectPackage)) {\n return Integration.electron;\n }\n if (hasPackageInstalled('next', projectPackage)) {\n return Integration.nextjs;\n }\n if (hasPackageInstalled('remix-run', projectPackage)) {\n return Integration.remix;\n }\n if (hasPackageInstalled('@sveltejs/kit', projectPackage)) {\n return Integration.sveltekit;\n }\n\n return;\n }\n\n private async _getIntegrationPromptSelection(): Promise<IntegrationPromptAnswer> {\n // If we receive project type as an arg we skip asking\n if (this._argv.integration) {\n return { integration: this._argv.integration };\n } else {\n if (this._argv.quiet) {\n throw new Error('You need to choose a platform');\n }\n\n const detectedDefaultSelection = this.tryDetectingIntegration();\n\n return prompt([\n {\n choices: getIntegrationChoices(),\n default: detectedDefaultSelection,\n message: 'What platform do you want to set up?',\n name: 'integration',\n type: 'list',\n pageSize: 10,\n },\n ]);\n }\n }\n}\n\n/**\n * For the `clack`-based wizard flows, which we only shim here, we don't set\n * a default url value. For backwards-compatibility with the other flows,\n * we fill it here and sanitize a user-enterd url.\n */\nfunction sanitizeUrl(argv: Args): Args {\n if (!argv.url) {\n argv.url = DEFAULT_URL;\n dim(`no URL provided, fallback to ${argv.url}`);\n return argv;\n }\n\n let baseUrl = argv.url;\n baseUrl += baseUrl.endsWith('/') ? '' : '/';\n baseUrl = baseUrl.replace(/:\\/(?!\\/)/g, '://');\n argv.url = baseUrl;\n\n return argv;\n}\n"]}