@sentry/wizard 6.10.0 → 6.12.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 (203) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/ci-ensure-runtime-loaded.sh +82 -0
  3. package/dist/e2e-tests/tests/angular-17.test.js +72 -82
  4. package/dist/e2e-tests/tests/angular-17.test.js.map +1 -1
  5. package/dist/e2e-tests/tests/angular-19.test.js +71 -80
  6. package/dist/e2e-tests/tests/angular-19.test.js.map +1 -1
  7. package/dist/e2e-tests/tests/cloudflare-worker.test.d.ts +1 -0
  8. package/dist/e2e-tests/tests/cloudflare-worker.test.js +69 -0
  9. package/dist/e2e-tests/tests/cloudflare-worker.test.js.map +1 -0
  10. package/dist/e2e-tests/tests/cloudflare-wrangler-sourcemaps.test.js +2 -5
  11. package/dist/e2e-tests/tests/cloudflare-wrangler-sourcemaps.test.js.map +1 -1
  12. package/dist/e2e-tests/tests/expo.test.js +36 -61
  13. package/dist/e2e-tests/tests/expo.test.js.map +1 -1
  14. package/dist/e2e-tests/tests/flutter.test.js +63 -70
  15. package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
  16. package/dist/e2e-tests/tests/help-message.test.js +2 -2
  17. package/dist/e2e-tests/tests/help-message.test.js.map +1 -1
  18. package/dist/e2e-tests/tests/nextjs-14.test.js +48 -76
  19. package/dist/e2e-tests/tests/nextjs-14.test.js.map +1 -1
  20. package/dist/e2e-tests/tests/nextjs-15.test.js +89 -99
  21. package/dist/e2e-tests/tests/nextjs-15.test.js.map +1 -1
  22. package/dist/e2e-tests/tests/nextjs-16.test.js +48 -45
  23. package/dist/e2e-tests/tests/nextjs-16.test.js.map +1 -1
  24. package/dist/e2e-tests/tests/nuxt-3.test.js +45 -58
  25. package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
  26. package/dist/e2e-tests/tests/nuxt-4.test.js +59 -73
  27. package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
  28. package/dist/e2e-tests/tests/pnpm-workspace.test.js +6 -8
  29. package/dist/e2e-tests/tests/pnpm-workspace.test.js.map +1 -1
  30. package/dist/e2e-tests/tests/react-native.test.js +44 -80
  31. package/dist/e2e-tests/tests/react-native.test.js.map +1 -1
  32. package/dist/e2e-tests/tests/react-router-instrumentation-api.test.d.ts +1 -0
  33. package/dist/e2e-tests/tests/react-router-instrumentation-api.test.js +96 -0
  34. package/dist/e2e-tests/tests/react-router-instrumentation-api.test.js.map +1 -0
  35. package/dist/e2e-tests/tests/react-router.test.js +165 -145
  36. package/dist/e2e-tests/tests/react-router.test.js.map +1 -1
  37. package/dist/e2e-tests/tests/remix.test.js +162 -132
  38. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  39. package/dist/e2e-tests/tests/sveltekit-hooks.test.js +48 -36
  40. package/dist/e2e-tests/tests/sveltekit-hooks.test.js.map +1 -1
  41. package/dist/e2e-tests/tests/sveltekit-tracing.test.js +5 -7
  42. package/dist/e2e-tests/tests/sveltekit-tracing.test.js.map +1 -1
  43. package/dist/e2e-tests/utils/index.d.ts +15 -43
  44. package/dist/e2e-tests/utils/index.js +95 -185
  45. package/dist/e2e-tests/utils/index.js.map +1 -1
  46. package/dist/get-e2e-test-matrix.mjs +11 -0
  47. package/dist/lib/Constants.d.ts +1 -0
  48. package/dist/lib/Constants.js +5 -0
  49. package/dist/lib/Constants.js.map +1 -1
  50. package/dist/src/android/android-wizard.js +2 -4
  51. package/dist/src/android/android-wizard.js.map +1 -1
  52. package/dist/src/angular/angular-wizard.js +4 -6
  53. package/dist/src/angular/angular-wizard.js.map +1 -1
  54. package/dist/src/angular/sdk-setup.js +1 -1
  55. package/dist/src/angular/sdk-setup.js.map +1 -1
  56. package/dist/src/apple/apple-wizard.js +2 -4
  57. package/dist/src/apple/apple-wizard.js.map +1 -1
  58. package/dist/src/apple/code-tools.js +17 -3
  59. package/dist/src/apple/code-tools.js.map +1 -1
  60. package/dist/src/apple/configure-package-manager.js +18 -5
  61. package/dist/src/apple/configure-package-manager.js.map +1 -1
  62. package/dist/src/cloudflare/cloudflare-wizard.d.ts +3 -0
  63. package/dist/src/cloudflare/cloudflare-wizard.js +104 -0
  64. package/dist/src/cloudflare/cloudflare-wizard.js.map +1 -0
  65. package/dist/src/cloudflare/sdk-setup.d.ts +8 -0
  66. package/dist/src/cloudflare/sdk-setup.js +47 -0
  67. package/dist/src/cloudflare/sdk-setup.js.map +1 -0
  68. package/dist/src/cloudflare/templates.d.ts +5 -0
  69. package/dist/src/cloudflare/templates.js +50 -0
  70. package/dist/src/cloudflare/templates.js.map +1 -0
  71. package/dist/src/cloudflare/wrangler/create-wrangler-config.d.ts +4 -0
  72. package/dist/src/cloudflare/wrangler/create-wrangler-config.js +27 -0
  73. package/dist/src/cloudflare/wrangler/create-wrangler-config.js.map +1 -0
  74. package/dist/src/cloudflare/wrangler/ensure-wrangler-config.d.ts +4 -0
  75. package/dist/src/cloudflare/wrangler/ensure-wrangler-config.js +25 -0
  76. package/dist/src/cloudflare/wrangler/ensure-wrangler-config.js.map +1 -0
  77. package/dist/src/cloudflare/wrangler/find-wrangler-config.d.ts +4 -0
  78. package/dist/src/cloudflare/wrangler/find-wrangler-config.js +23 -0
  79. package/dist/src/cloudflare/wrangler/find-wrangler-config.js.map +1 -0
  80. package/dist/src/cloudflare/wrangler/get-entry-point-from-wrangler-config.d.ts +6 -0
  81. package/dist/src/cloudflare/wrangler/get-entry-point-from-wrangler-config.js +52 -0
  82. package/dist/src/cloudflare/wrangler/get-entry-point-from-wrangler-config.js.map +1 -0
  83. package/dist/src/cloudflare/wrangler/update-wrangler-config.d.ts +17 -0
  84. package/dist/src/cloudflare/wrangler/update-wrangler-config.js +173 -0
  85. package/dist/src/cloudflare/wrangler/update-wrangler-config.js.map +1 -0
  86. package/dist/src/cloudflare/wrap-worker.d.ts +33 -0
  87. package/dist/src/cloudflare/wrap-worker.js +116 -0
  88. package/dist/src/cloudflare/wrap-worker.js.map +1 -0
  89. package/dist/src/flutter/flutter-wizard.js +3 -6
  90. package/dist/src/flutter/flutter-wizard.js.map +1 -1
  91. package/dist/src/nextjs/nextjs-wizard.js +0 -2
  92. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  93. package/dist/src/nuxt/nuxt-wizard.js +3 -5
  94. package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
  95. package/dist/src/react-native/expo.d.ts +6 -0
  96. package/dist/src/react-native/expo.js +27 -1
  97. package/dist/src/react-native/expo.js.map +1 -1
  98. package/dist/src/react-native/git.d.ts +5 -0
  99. package/dist/src/react-native/git.js +32 -1
  100. package/dist/src/react-native/git.js.map +1 -1
  101. package/dist/src/react-native/javascript.js +3 -1
  102. package/dist/src/react-native/javascript.js.map +1 -1
  103. package/dist/src/react-native/react-native-wizard.js +14 -10
  104. package/dist/src/react-native/react-native-wizard.js.map +1 -1
  105. package/dist/src/react-router/codemods/client.entry.d.ts +1 -1
  106. package/dist/src/react-router/codemods/client.entry.js +69 -12
  107. package/dist/src/react-router/codemods/client.entry.js.map +1 -1
  108. package/dist/src/react-router/codemods/react-router-config.js +1 -1
  109. package/dist/src/react-router/codemods/react-router-config.js.map +1 -1
  110. package/dist/src/react-router/codemods/root.js +1 -2
  111. package/dist/src/react-router/codemods/root.js.map +1 -1
  112. package/dist/src/react-router/codemods/server-entry.d.ts +1 -1
  113. package/dist/src/react-router/codemods/server-entry.js +39 -4
  114. package/dist/src/react-router/codemods/server-entry.js.map +1 -1
  115. package/dist/src/react-router/codemods/vite.js +46 -1
  116. package/dist/src/react-router/codemods/vite.js.map +1 -1
  117. package/dist/src/react-router/react-router-wizard.js +55 -10
  118. package/dist/src/react-router/react-router-wizard.js.map +1 -1
  119. package/dist/src/react-router/sdk-setup.d.ts +5 -3
  120. package/dist/src/react-router/sdk-setup.js +35 -9
  121. package/dist/src/react-router/sdk-setup.js.map +1 -1
  122. package/dist/src/react-router/templates.d.ts +2 -2
  123. package/dist/src/react-router/templates.js +72 -2
  124. package/dist/src/react-router/templates.js.map +1 -1
  125. package/dist/src/remix/remix-wizard.js +2 -4
  126. package/dist/src/remix/remix-wizard.js.map +1 -1
  127. package/dist/src/run.d.ts +1 -1
  128. package/dist/src/run.js +5 -0
  129. package/dist/src/run.js.map +1 -1
  130. package/dist/src/sourcemaps/tools/vite.js +1 -1
  131. package/dist/src/sourcemaps/tools/vite.js.map +1 -1
  132. package/dist/src/sveltekit/sdk-setup/vite.js +1 -1
  133. package/dist/src/sveltekit/sdk-setup/vite.js.map +1 -1
  134. package/dist/src/sveltekit/sveltekit-wizard.js +2 -4
  135. package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
  136. package/dist/src/utils/abort-if-sportlight-not-supported.d.ts +5 -0
  137. package/dist/src/utils/abort-if-sportlight-not-supported.js +40 -0
  138. package/dist/src/utils/abort-if-sportlight-not-supported.js.map +1 -0
  139. package/dist/src/utils/ast-utils.d.ts +11 -1
  140. package/dist/src/utils/ast-utils.js +19 -1
  141. package/dist/src/utils/ast-utils.js.map +1 -1
  142. package/dist/src/utils/clack/index.d.ts +2 -2
  143. package/dist/src/utils/clack/index.js.map +1 -1
  144. package/dist/src/utils/clack/mcp-config.js +117 -59
  145. package/dist/src/utils/clack/mcp-config.js.map +1 -1
  146. package/dist/src/version.d.ts +1 -1
  147. package/dist/src/version.js +1 -1
  148. package/dist/src/version.js.map +1 -1
  149. package/dist/test/angular/angular-wizard.test.js +2 -4
  150. package/dist/test/angular/angular-wizard.test.js.map +1 -1
  151. package/dist/test/apple/code-tools.test.js +78 -0
  152. package/dist/test/apple/code-tools.test.js.map +1 -1
  153. package/dist/test/apple/configure-package-manager.test.d.ts +1 -0
  154. package/dist/test/apple/configure-package-manager.test.js +161 -0
  155. package/dist/test/apple/configure-package-manager.test.js.map +1 -0
  156. package/dist/test/cloudflare/create-wrangler-config.test.d.ts +1 -0
  157. package/dist/test/cloudflare/create-wrangler-config.test.js +48 -0
  158. package/dist/test/cloudflare/create-wrangler-config.test.js.map +1 -0
  159. package/dist/test/cloudflare/ensure-wrangler-config.test.d.ts +1 -0
  160. package/dist/test/cloudflare/ensure-wrangler-config.test.js +61 -0
  161. package/dist/test/cloudflare/ensure-wrangler-config.test.js.map +1 -0
  162. package/dist/test/cloudflare/find-wrangler-config.test.d.ts +1 -0
  163. package/dist/test/cloudflare/find-wrangler-config.test.js +77 -0
  164. package/dist/test/cloudflare/find-wrangler-config.test.js.map +1 -0
  165. package/dist/test/cloudflare/get-entry-point-from-wrangler-config.test.d.ts +1 -0
  166. package/dist/test/cloudflare/get-entry-point-from-wrangler-config.test.js +81 -0
  167. package/dist/test/cloudflare/get-entry-point-from-wrangler-config.test.js.map +1 -0
  168. package/dist/test/cloudflare/sdk-setup.test.d.ts +1 -0
  169. package/dist/test/cloudflare/sdk-setup.test.js +170 -0
  170. package/dist/test/cloudflare/sdk-setup.test.js.map +1 -0
  171. package/dist/test/cloudflare/templates.test.d.ts +1 -0
  172. package/dist/test/cloudflare/templates.test.js +122 -0
  173. package/dist/test/cloudflare/templates.test.js.map +1 -0
  174. package/dist/test/cloudflare/update-wrangler-config.test.d.ts +1 -0
  175. package/dist/test/cloudflare/update-wrangler-config.test.js +216 -0
  176. package/dist/test/cloudflare/update-wrangler-config.test.js.map +1 -0
  177. package/dist/test/cloudflare/wrap-worker.test.d.ts +1 -0
  178. package/dist/test/cloudflare/wrap-worker.test.js +206 -0
  179. package/dist/test/cloudflare/wrap-worker.test.js.map +1 -0
  180. package/dist/test/react-native/expo.test.js +140 -0
  181. package/dist/test/react-native/expo.test.js.map +1 -1
  182. package/dist/test/react-native/git.test.d.ts +1 -0
  183. package/dist/test/react-native/git.test.js +160 -0
  184. package/dist/test/react-native/git.test.js.map +1 -0
  185. package/dist/test/react-router/codemods/client-entry.test.js +29 -0
  186. package/dist/test/react-router/codemods/client-entry.test.js.map +1 -1
  187. package/dist/test/react-router/codemods/root.test.js +4 -0
  188. package/dist/test/react-router/codemods/root.test.js.map +1 -1
  189. package/dist/test/react-router/codemods/server-entry.test.js +70 -0
  190. package/dist/test/react-router/codemods/server-entry.test.js.map +1 -1
  191. package/dist/test/react-router/codemods/vite.test.js +89 -0
  192. package/dist/test/react-router/codemods/vite.test.js.map +1 -1
  193. package/dist/test/react-router/sdk-setup.test.js +64 -8
  194. package/dist/test/react-router/sdk-setup.test.js.map +1 -1
  195. package/dist/test/react-router/templates.test.js +50 -0
  196. package/dist/test/react-router/templates.test.js.map +1 -1
  197. package/dist/test/sourcemaps/tools/vite.test.js +12 -8
  198. package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
  199. package/dist/test/utils/ast-utils.test.js +22 -0
  200. package/dist/test/utils/ast-utils.test.js.map +1 -1
  201. package/dist/test/utils/clack/mcp-config.test.js +176 -51
  202. package/dist/test/utils/clack/mcp-config.test.js.map +1 -1
  203. package/package.json +6 -5
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../e2e-tests/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,gDAAkC;AAElC,mDAAkD;AAClD,2DAAqD;AAErD,sDAA2D;AAC3D,mCAAgC;AAEnB,QAAA,IAAI,GAAG;IAClB,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,GAAG;CACX,CAAC;AAEW,QAAA,SAAS,GAAG;IACvB,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,iBAAiB;IACnE,WAAW,EACT,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,0CAA0C;IAC3E,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,eAAe;IACxD,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,mBAAmB;CACrE,CAAC;AAEW,QAAA,GAAG,GAAG;IACjB,OAAO,EAAE,CAA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jB,CAAC;AAbD,oDAaC;AAED;;;;GAIG;AACI,KAAK,UAAU,qBAAqB,CACzC,UAAkB,EAClB,cAAsB,EACtB,YAAY,GAAG,OAAO;IAEtB,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE;QAC9D,GAAG,EAAE,UAAU;KAChB,CAAC,CAAC;IAEH,IAAA,eAAM,EACJ,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE;QAC1C,OAAO,EAAE,MAAO;KACjB,CAAC,CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,OAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC;AAhBD,sDAgBC","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\n\nimport { Integration } from '../../lib/Constants';\nimport { spawn, execSync } from 'node:child_process';\nimport type { ChildProcess } from 'node:child_process';\nimport { dim, green, red } from '../../lib/Helper/Logging';\nimport { expect } from 'vitest';\n\nexport const KEYS = {\n UP: '\\u001b[A',\n DOWN: '\\u001b[B',\n LEFT: '\\u001b[D',\n RIGHT: '\\u001b[C',\n ENTER: '\\r',\n SPACE: ' ',\n};\n\nexport const TEST_ARGS = {\n AUTH_TOKEN: process.env.SENTRY_TEST_AUTH_TOKEN || 'TEST_AUTH_TOKEN',\n PROJECT_DSN:\n process.env.SENTRY_TEST_DSN || 'https://public@dsn.ingest.sentry.io/1337',\n ORG_SLUG: process.env.SENTRY_TEST_ORG || 'TEST_ORG_SLUG',\n PROJECT_SLUG: process.env.SENTRY_TEST_PROJECT || 'TEST_PROJECT_SLUG',\n};\n\nexport const log = {\n success: (message: string) => {\n green(`[SUCCESS] ${message}`);\n },\n info: (message: string) => {\n dim(`[INFO] ${message}`);\n },\n error: (message: unknown) => {\n function formatMessage(message: unknown, depth: number): string {\n if (depth > 3) {\n return '...';\n }\n\n if (message instanceof Error) {\n return JSON.stringify(\n {\n name: message.name,\n message: message.message,\n stack: message.stack,\n ...(message.cause\n ? {\n cause: formatMessage(message.cause, depth + 1),\n }\n : {}),\n },\n null,\n 2,\n );\n }\n return String(message);\n }\n red(`[ERROR] ${formatMessage(message, 0)}`);\n },\n};\n\nexport class WizardTestEnv {\n taskHandle: ChildProcess;\n\n constructor(\n cmd: string,\n args: string[],\n opts?: {\n cwd?: string;\n debug?: boolean;\n },\n ) {\n this.taskHandle = spawn(cmd, args, { cwd: opts?.cwd, stdio: 'pipe' });\n\n if (opts?.debug) {\n this.taskHandle.stdout?.pipe(process.stdout);\n this.taskHandle.stderr?.pipe(process.stderr);\n }\n }\n\n sendStdin(input: string) {\n this.taskHandle.stdin?.write(input);\n }\n\n /**\n * Sends the input and waits for the output.\n * @returns a promise that resolves when the output was found\n * @throws an error when the output was not found within the timeout\n */\n sendStdinAndWaitForOutput(\n input: string | string[],\n output: string,\n options?: { timeout?: number; optional?: boolean },\n ) {\n const outputPromise = this.waitForOutput(output, options);\n\n if (Array.isArray(input)) {\n for (const i of input) {\n this.sendStdin(i);\n }\n } else {\n this.sendStdin(input);\n }\n return outputPromise;\n }\n\n /**\n * Waits for the task to exit with a given `statusCode`.\n *\n * @returns a promise that resolves to `true` if the run ends with the status\n * code, or it rejects when the `timeout` was reached.\n */\n waitForStatusCode(\n statusCode: number | null,\n options: {\n /** Timeout in ms */\n timeout?: number;\n } = {},\n ) {\n const { timeout } = {\n timeout: 60_000,\n ...options,\n };\n\n return new Promise<boolean>((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n this.kill();\n reject(\n new Error(`Timeout waiting for status code: ${statusCode ?? 'null'}`),\n );\n }, timeout);\n\n this.taskHandle.on('error', (err: Error) => {\n clearTimeout(timeoutId);\n reject(err);\n });\n\n this.taskHandle.on('exit', (code: number | null) => {\n clearTimeout(timeoutId);\n resolve(code === statusCode);\n });\n });\n }\n\n /**\n * Waits for the provided output with `.includes()` logic.\n *\n * @returns a promise that resolves to `true` if the output was found, `false` if the output was not found within the\n * timeout and `optional: true` is set, or it rejects when the timeout was reached with `optional: false`\n */\n waitForOutput(\n output: string,\n options: {\n /** Timeout in ms */\n timeout?: number;\n /** Whether to always resolve after the timeout, no matter whether the input was actually found or not. */\n optional?: boolean;\n } = {},\n ) {\n const { timeout, optional } = {\n timeout: 60_000,\n optional: false,\n ...options,\n };\n\n return new Promise<boolean>((resolve, reject) => {\n let outputBuffer = '';\n const timeoutId = setTimeout(() => {\n this.taskHandle.off('error', errorListener);\n this.taskHandle.stdout?.off('data', dataListener);\n\n this.kill();\n if (optional) {\n // The output is not found but it's optional so we can resolve the promise with false\n resolve(false);\n } else {\n reject(\n new Error(\n `Timeout waiting for output: ${output}. Got the following instead: ${outputBuffer}`,\n ),\n );\n }\n }, timeout);\n\n const dataListener = (data: string) => {\n outputBuffer += data;\n if (outputBuffer.includes(output)) {\n clearTimeout(timeoutId);\n this.taskHandle.off('error', errorListener);\n this.taskHandle.stdout?.off('data', dataListener);\n // The output is found so we can resolve the promise with true\n resolve(true);\n }\n };\n\n const errorListener = (err: Error) => {\n this.taskHandle.off('error', errorListener);\n this.taskHandle.stdout?.off('data', dataListener);\n clearTimeout(timeoutId);\n reject(err);\n };\n\n this.taskHandle.on('error', errorListener);\n this.taskHandle.stdout?.on('data', dataListener);\n });\n }\n\n kill() {\n this.taskHandle.stdin?.destroy();\n this.taskHandle.stderr?.destroy();\n this.taskHandle.stdout?.destroy();\n this.taskHandle.kill('SIGINT');\n this.taskHandle.unref();\n }\n}\n\n/**\n * Initialize a git repository in the given directory\n * @param projectDir\n */\nexport function initGit(projectDir: string): void {\n try {\n execSync('git init', { cwd: projectDir });\n // Add all files to the git repo\n execSync('git add -A', { cwd: projectDir });\n // Add author info to avoid git commit error\n execSync('git config user.email test@test.sentry.io', { cwd: projectDir });\n execSync('git config user.name Test', { cwd: projectDir });\n execSync('git commit -m init', { cwd: projectDir });\n } catch (e) {\n log.error('Error initializing git');\n log.error(e);\n }\n}\n\n/**\n * Cleanup the git repository in the given directory\n *\n * Caution! Make sure `projectDir` is a test project directory,\n * if in doubt, please commit your local non-test changes first!\n * @param projectDir\n */\nexport function cleanupGit(projectDir: string): void {\n try {\n // Remove the .git directory\n execSync(`rm -rf ${projectDir}/.git`);\n } catch (e) {\n log.error('Error cleaning up git');\n log.error(e);\n }\n}\n\n/**\n * Revert local changes in the given directory\n *\n * Caution! Make sure `projectDir` is a test project directory,\n * if in doubt, please commit your local non-test changes first!\n *\n * @param projectDir\n */\nexport function revertLocalChanges(projectDir: string): void {\n try {\n // Check if this is a git repository first\n const isGitRepo = fs.existsSync(path.join(projectDir, '.git'));\n\n if (isGitRepo) {\n // Revert tracked files\n execSync('git restore .', { cwd: projectDir });\n // Revert untracked files\n execSync('git clean -fd .', { cwd: projectDir });\n }\n\n // Remove node_modules and dist (.gitignore'd and therefore not removed via git clean)\n execSync('rm -rf node_modules', { cwd: projectDir });\n execSync('rm -rf dist', { cwd: projectDir });\n } catch (e) {\n log.error('Error reverting local changes');\n log.error(e);\n }\n}\n\nexport function getWizardCommand(integration: Integration): string {\n const binName = process.env.SENTRY_WIZARD_E2E_TEST_BIN\n ? ['dist-bin', `sentry-wizard-${process.platform}-${process.arch}`]\n : ['dist', 'bin.js'];\n const binPath = path.join(__dirname, '..', '..', ...binName);\n\n const args = [\n '--debug',\n '-i',\n integration,\n '--preSelectedProject.authToken',\n TEST_ARGS.AUTH_TOKEN,\n '--preSelectedProject.dsn',\n TEST_ARGS.PROJECT_DSN,\n '--preSelectedProject.orgSlug',\n TEST_ARGS.ORG_SLUG,\n '--preSelectedProject.projectSlug',\n TEST_ARGS.PROJECT_SLUG,\n '--disable-telemetry',\n ];\n\n return `${binPath} ${args.join(' ')}`;\n}\n\n/**\n * Start the wizard instance with the given integration and project directory\n * @param integration\n * @param projectDir\n *\n * @returns WizardTestEnv\n */\nexport function startWizardInstance(\n integration: Integration,\n projectDir: string,\n debug = false,\n spotlight = false,\n): WizardTestEnv {\n const binName = process.env.SENTRY_WIZARD_E2E_TEST_BIN\n ? ['dist-bin', `sentry-wizard-${process.platform}-${process.arch}`]\n : ['dist', 'bin.js'];\n const binPath = path.join(__dirname, '..', '..', ...binName);\n\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n initGit(projectDir);\n\n const args = ['--debug', '-i', integration];\n\n if (spotlight) {\n // Spotlight mode: skip authentication\n args.push('--spotlight');\n } else {\n args.push(\n '--preSelectedProject.authToken',\n TEST_ARGS.AUTH_TOKEN,\n '--preSelectedProject.dsn',\n TEST_ARGS.PROJECT_DSN,\n '--preSelectedProject.orgSlug',\n TEST_ARGS.ORG_SLUG,\n '--preSelectedProject.projectSlug',\n TEST_ARGS.PROJECT_SLUG,\n );\n }\n\n args.push('--disable-telemetry');\n\n return new WizardTestEnv(binPath, args, { cwd: projectDir, debug });\n}\n\n/**\n * Create a file with the given content\n *\n * @param filePath\n * @param content\n */\nexport function createFile(filePath: string, content?: string) {\n return fs.writeFileSync(filePath, content || '');\n}\n\n/**\n * Modify the file with the new content\n *\n * @param filePath\n * @param oldContent\n * @param newContent\n */\nexport function modifyFile(\n filePath: string,\n replaceMap: Record<string, string>,\n) {\n const fileContent = fs.readFileSync(filePath, 'utf-8');\n let newFileContent = fileContent;\n\n for (const [oldContent, newContent] of Object.entries(replaceMap)) {\n newFileContent = newFileContent.replace(oldContent, newContent);\n }\n\n fs.writeFileSync(filePath, newFileContent);\n}\n\n/**\n * Read the file contents and check if it does not contain the given content\n *\n * @param {string} filePath\n * @param {(string | string[])} content\n */\nexport function checkFileDoesNotContain(\n filePath: string,\n content: string | string[],\n) {\n const fileContent = fs.readFileSync(filePath, 'utf-8');\n const contentArray = Array.isArray(content) ? content : [content];\n\n for (const c of contentArray) {\n expect(fileContent).not.toContain(c);\n }\n}\n\n/**\n * Read the file contents and check if it contains the given content\n *\n * @param {string} filePath\n * @param {(string | string[])} content\n */\nexport function checkFileContents(\n filePath: string,\n content: string | string[],\n) {\n const fileContent = fs.readFileSync(filePath, 'utf-8');\n const contentArray = Array.isArray(content) ? content : [content];\n\n for (const c of contentArray) {\n expect(fileContent).toContain(c);\n }\n}\n\n/**\n * Check if the file exists\n *\n * @param filePath\n */\nexport function checkFileExists(filePath: string) {\n expect(fs.existsSync(filePath)).toBe(true);\n}\n\n/**\n * Check if the file does not exist\n *\n * @param filePath\n */\nexport function checkFileDoesNotExist(filePath: string) {\n expect(fs.existsSync(filePath)).toBe(false);\n}\n\n/**\n * Map integration to its corresponding Sentry package name\n * @param type Integration type\n * @returns Package name or undefined if no package exists\n */\nfunction mapIntegrationToPackageName(type: string): string | undefined {\n switch (type) {\n case Integration.android:\n return undefined; // Android doesn't have a JavaScript package\n case Integration.reactNative:\n return '@sentry/react-native';\n case Integration.flutter:\n return undefined; // Flutter doesn't have a JavaScript package\n case Integration.cordova:\n return '@sentry/cordova';\n case Integration.angular:\n return '@sentry/angular';\n case Integration.electron:\n return '@sentry/electron';\n case Integration.nextjs:\n return '@sentry/nextjs';\n case Integration.nuxt:\n return '@sentry/nuxt';\n case Integration.remix:\n return '@sentry/remix';\n case Integration.reactRouter:\n return '@sentry/react-router';\n case Integration.sveltekit:\n return '@sentry/sveltekit';\n case Integration.sourcemaps:\n return undefined; // Sourcemaps doesn't install a package\n case Integration.ios:\n return undefined; // iOS doesn't have a JavaScript package\n default:\n return undefined;\n }\n}\n\n/**\n * Check if the package.json contains the given integration\n *\n * @param projectDir\n * @param integration\n */\nexport function checkPackageJson(projectDir: string, integration: Integration) {\n const packageName = mapIntegrationToPackageName(integration);\n if (!packageName) {\n throw new Error(`No package name found for integration: ${integration}`);\n }\n checkFileContents(`${projectDir}/package.json`, packageName);\n}\n\n/**\n * Check if the .sentryclirc contains the auth token\n *\n * @param projectDir\n */\nexport function checkSentryCliRc(projectDir: string) {\n checkFileContents(\n `${projectDir}/.sentryclirc`,\n `token=${TEST_ARGS.AUTH_TOKEN}`,\n );\n}\n\n/**\n * Check if the .env.sentry-build-plugin contains the auth token\n * @param projectDir\n */\nexport function checkEnvBuildPlugin(projectDir: string) {\n checkFileContents(\n `${projectDir}/.env.sentry-build-plugin`,\n `SENTRY_AUTH_TOKEN=${TEST_ARGS.AUTH_TOKEN}`,\n );\n}\n\n/**\n * Check if the sentry.properties contains the auth token\n * @param projectDir\n */\nexport function checkSentryProperties(projectDir: string) {\n checkFileContents(\n `${projectDir}/sentry.properties`,\n `auth_token=${TEST_ARGS.AUTH_TOKEN}`,\n );\n}\n\n/**\n * Check if the project builds\n * Check if the project builds and ends with status code 0.\n * @param projectDir\n */\nexport async function checkIfBuilds(projectDir: string) {\n const testEnv = new WizardTestEnv('npm', ['run', 'build'], {\n cwd: projectDir,\n });\n\n const builtSuccessfully = await testEnv.waitForStatusCode(0, {\n timeout: 120_000,\n });\n\n expect(builtSuccessfully).toBe(true);\n}\n\n/**\n * Check if the project lints successfully\n * Runs `npm run lint` and expects status code 0.\n * @param projectDir\n */\nexport async function checkIfLints(projectDir: string) {\n const testEnv = new WizardTestEnv('npm', ['run', 'lint'], {\n cwd: projectDir,\n });\n\n const lintedSuccessfully = await testEnv.waitForStatusCode(0, {\n timeout: 120_000,\n });\n\n expect(lintedSuccessfully).toBe(true);\n}\n\n/**\n * Check if the flutter project builds\n * @param projectDir\n */\nexport async function checkIfFlutterBuilds(\n projectDir: string,\n expectedOutput: string,\n debug = false,\n) {\n const testEnv = new WizardTestEnv('flutter', ['build', 'web'], {\n cwd: projectDir,\n debug: debug,\n });\n\n const outputReceived = await testEnv.waitForOutput(expectedOutput, {\n timeout: 120_000,\n });\n\n expect(outputReceived).toBe(true);\n}\n\n/**\n * Check if the React Native project bundles successfully for the specified platform.\n * Returns a boolean indicating if the process exits with status code 0.\n * @param projectDir The root directory of the React Native project.\n * @param platform The platform to bundle for ('ios' or 'android').\n * @param debug runs the command in debug mode if true\n */\nexport async function checkIfReactNativeBundles(\n projectDir: string,\n platform: 'ios' | 'android',\n debug = false,\n): Promise<boolean> {\n const entryFile = 'index.js';\n const dev = 'false'; // Test a production-like bundle\n let bundleOutput: string;\n let assetsDest: string;\n\n if (platform === 'ios') {\n bundleOutput = './ios/main.jsbundle';\n assetsDest = './ios';\n } else {\n // android\n bundleOutput = './android/app/src/main/assets/index.android.bundle';\n assetsDest = './android/app/src/main/res';\n }\n\n const bundleCommandArgs = [\n 'react-native',\n 'bundle',\n '--entry-file',\n entryFile,\n '--platform',\n platform,\n '--dev',\n dev,\n '--bundle-output',\n bundleOutput,\n '--assets-dest',\n assetsDest,\n ];\n\n const testEnv = new WizardTestEnv('npx', bundleCommandArgs, {\n cwd: projectDir,\n debug: debug,\n });\n\n const builtSuccessfully = await testEnv.waitForStatusCode(0, {\n timeout: 300_000,\n });\n\n testEnv.kill();\n\n return builtSuccessfully;\n}\n\n/**\n * Check if the Expo project exports successfully for the specified platform.\n * Returns a boolean indicating if the process exits with status code 0.\n * @param projectDir The root directory of the Expo project.\n * @param platform The platform to export for ('ios', 'android', or 'web').\n * @param debug runs the command in debug mode if true\n */\nexport async function checkIfExpoBundles(\n projectDir: string,\n platform: 'ios' | 'android' | 'web',\n debug = false,\n): Promise<boolean> {\n const exportCommandArgs = [\n 'expo',\n 'export',\n '--platform',\n platform,\n ];\n\n const testEnv = new WizardTestEnv('npx', exportCommandArgs, {\n cwd: projectDir,\n debug: debug,\n });\n\n const builtSuccessfully = await testEnv.waitForStatusCode(0, {\n timeout: 300_000,\n });\n\n testEnv.kill();\n return builtSuccessfully;\n}\n\n/**\n * Check if the project runs on dev mode\n * @param projectDir\n * @param expectedOutput\n */\nexport async function checkIfRunsOnDevMode(\n projectDir: string,\n expectedOutput: string,\n) {\n const testEnv = new WizardTestEnv('npm', ['run', 'dev'], { cwd: projectDir });\n\n expect(\n await testEnv.waitForOutput(expectedOutput, {\n timeout: 120_000,\n }),\n ).toBe(true);\n\n testEnv.kill();\n}\n\n/**\n * Check if the project runs on prod mode\n * @param projectDir\n * @param expectedOutput\n */\nexport async function checkIfRunsOnProdMode(\n projectDir: string,\n expectedOutput: string,\n startCommand = 'start',\n) {\n const testEnv = new WizardTestEnv('npm', ['run', startCommand], {\n cwd: projectDir,\n });\n\n expect(\n await testEnv.waitForOutput(expectedOutput, {\n timeout: 120_000,\n }),\n ).toBe(true);\n\n testEnv.kill();\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../e2e-tests/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,4CAA8B;AAC9B,gDAAkC;AAGlC,2DAAqD;AAErD,sDAA2D;AAC3D,mCAAgC;AAGnB,QAAA,IAAI,GAAG;IAClB,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,GAAG;CACX,CAAC;AAEW,QAAA,SAAS,GAAG;IACvB,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,iBAAiB;IACnE,WAAW,EACT,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,0CAA0C;IAC3E,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,eAAe;IACxD,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,mBAAmB;CACrE,CAAC;AAEW,QAAA,GAAG,GAAG;IACjB,OAAO,EAAE,CAAC,OAAe,EAAE,EAAE;QAC3B,IAAA,eAAK,EAAC,aAAa,OAAO,EAAE,CAAC,CAAC;IAChC,CAAC;IACD,IAAI,EAAE,CAAC,OAAe,EAAE,EAAE;QACxB,IAAA,aAAG,EAAC,UAAU,OAAO,EAAE,CAAC,CAAC;IAC3B,CAAC;IACD,KAAK,EAAE,CAAC,OAAgB,EAAE,EAAE;QAC1B,SAAS,aAAa,CAAC,OAAgB,EAAE,KAAa;YACpD,IAAI,KAAK,GAAG,CAAC,EAAE;gBACb,OAAO,KAAK,CAAC;aACd;YAED,IAAI,OAAO,YAAY,KAAK,EAAE;gBAC5B,OAAO,IAAI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;GAGG;AACH,SAAS,OAAO,CAAC,UAAkB;IACjC,IAAI;QACF,IAAA,6BAAQ,EAAC,UAAU,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;QAC1C,gCAAgC;QAChC,IAAA,6BAAQ,EAAC,YAAY,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;QAC5C,4CAA4C;QAC5C,IAAA,6BAAQ,EAAC,2CAA2C,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;QAC3E,IAAA,6BAAQ,EAAC,2BAA2B,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;QAC3D,IAAA,6BAAQ,EAAC,oBAAoB,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;KACrD;IAAC,OAAO,CAAC,EAAE;QACV,WAAG,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACpC,WAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACd;AACH,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\n\nimport { Integration } from '../../lib/Constants';\nimport { spawn, execSync } from 'node:child_process';\nimport type { ChildProcess } from 'node:child_process';\nimport { dim, green, red } from '../../lib/Helper/Logging';\nimport { expect } from 'vitest';\nimport { PackageDotJson } from '../../src/utils/package-json';\n\nexport const KEYS = {\n UP: '\\u001b[A',\n DOWN: '\\u001b[B',\n LEFT: '\\u001b[D',\n RIGHT: '\\u001b[C',\n ENTER: '\\r',\n SPACE: ' ',\n};\n\nexport const TEST_ARGS = {\n AUTH_TOKEN: process.env.SENTRY_TEST_AUTH_TOKEN || 'TEST_AUTH_TOKEN',\n PROJECT_DSN:\n process.env.SENTRY_TEST_DSN || 'https://public@dsn.ingest.sentry.io/1337',\n ORG_SLUG: process.env.SENTRY_TEST_ORG || 'TEST_ORG_SLUG',\n PROJECT_SLUG: process.env.SENTRY_TEST_PROJECT || 'TEST_PROJECT_SLUG',\n};\n\nexport const log = {\n success: (message: string) => {\n green(`[SUCCESS] ${message}`);\n },\n info: (message: string) => {\n dim(`[INFO] ${message}`);\n },\n error: (message: unknown) => {\n function formatMessage(message: unknown, depth: number): string {\n if (depth > 3) {\n return '...';\n }\n\n if (message instanceof Error) {\n return JSON.stringify(\n {\n name: message.name,\n message: message.message,\n stack: message.stack,\n ...(message.cause\n ? {\n cause: formatMessage(message.cause, depth + 1),\n }\n : {}),\n },\n null,\n 2,\n );\n }\n return String(message);\n }\n red(`[ERROR] ${formatMessage(message, 0)}`);\n },\n};\n\n/**\n * Creates an isolated test environment by copying a test application to a temporary directory.\n * Each call creates a NEW unique temporary directory, allowing multiple isolated environments\n * per test file (useful for tests that run the wizard multiple times with different configs).\n *\n * @param testAppName - Name of the test application folder (e.g., 'nextjs-16-test-app')\n * @returns Object with projectDir path and cleanup function\n */\nexport function createIsolatedTestEnv(testAppName: string): {\n projectDir: string;\n cleanup: () => void;\n} {\n const sourceDir = path.resolve(\n __dirname,\n '../test-applications',\n testAppName,\n );\n const tmpBaseDir = path.join(os.tmpdir(), 'sentry-wizard-e2e');\n\n if (!fs.existsSync(tmpBaseDir)) {\n fs.mkdirSync(tmpBaseDir, { recursive: true });\n }\n\n const projectDir = fs.mkdtempSync(path.join(tmpBaseDir, `${testAppName}-`));\n\n log.info(`Created isolated test env at: ${projectDir}`);\n\n try {\n fs.cpSync(sourceDir, projectDir, { recursive: true });\n } catch (e) {\n log.error('Error copying test application');\n log.error(e);\n throw e;\n }\n\n initGit(projectDir);\n\n const cleanup = () => {\n try {\n const keepOnFailure = process.env.SENTRY_WIZARD_E2E_KEEP_TEMP === 'true';\n\n if (keepOnFailure) {\n log.info(`Keeping temp directory for debugging: ${projectDir}`);\n } else {\n fs.rmSync(projectDir, { recursive: true, force: true });\n log.info(`Cleaned up isolated test env: ${projectDir}`);\n }\n } catch (e) {\n log.error(`Error cleaning up test environment at ${projectDir}`);\n log.error(e);\n }\n };\n\n return { projectDir, cleanup };\n}\n\nexport class ProcessRunner {\n taskHandle: ChildProcess;\n\n constructor(\n cmd: string,\n args: string[],\n opts?: {\n cwd?: string;\n debug?: boolean;\n },\n ) {\n this.taskHandle = spawn(cmd, args, { cwd: opts?.cwd, stdio: 'pipe' });\n\n if (opts?.debug) {\n this.taskHandle.stdout?.pipe(process.stdout);\n this.taskHandle.stderr?.pipe(process.stderr);\n }\n }\n\n /**\n * Waits for the task to exit with a given `statusCode`.\n *\n * @returns a promise that resolves to `true` if the run ends with the status\n * code, or it rejects when the `timeout` was reached.\n */\n waitForStatusCode(\n statusCode: number | null,\n options: {\n /** Timeout in ms */\n timeout?: number;\n } = {},\n ) {\n const { timeout } = {\n timeout: 60_000,\n ...options,\n };\n\n return new Promise<boolean>((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n this.kill();\n reject(\n new Error(`Timeout waiting for status code: ${statusCode ?? 'null'}`),\n );\n }, timeout);\n\n this.taskHandle.on('error', (err: Error) => {\n clearTimeout(timeoutId);\n reject(err);\n });\n\n this.taskHandle.on('exit', (code: number | null) => {\n clearTimeout(timeoutId);\n resolve(code === statusCode);\n });\n });\n }\n\n /**\n * Waits for the provided output with `.includes()` logic.\n *\n * @returns a promise that resolves to `true` if the output was found, `false` if the output was not found within the\n * timeout and `optional: true` is set, or it rejects when the timeout was reached with `optional: false`\n */\n waitForOutput(\n output: string,\n options: {\n /** Timeout in ms */\n timeout?: number;\n /** Whether to always resolve after the timeout, no matter whether the input was actually found or not. */\n optional?: boolean;\n } = {},\n ) {\n const { timeout, optional } = {\n timeout: 60_000,\n optional: false,\n ...options,\n };\n\n return new Promise<boolean>((resolve, reject) => {\n let outputBuffer = '';\n const timeoutId = setTimeout(() => {\n this.taskHandle.off('error', errorListener);\n this.taskHandle.stdout?.off('data', dataListener);\n\n this.kill();\n if (optional) {\n // The output is not found but it's optional so we can resolve the promise with false\n resolve(false);\n } else {\n reject(\n new Error(\n `Timeout waiting for output: ${output}. Got the following instead: ${outputBuffer}`,\n ),\n );\n }\n }, timeout);\n\n const dataListener = (data: string) => {\n outputBuffer += data;\n if (outputBuffer.includes(output)) {\n clearTimeout(timeoutId);\n this.taskHandle.off('error', errorListener);\n this.taskHandle.stdout?.off('data', dataListener);\n // The output is found so we can resolve the promise with true\n resolve(true);\n }\n };\n\n const errorListener = (err: Error) => {\n this.taskHandle.off('error', errorListener);\n this.taskHandle.stdout?.off('data', dataListener);\n clearTimeout(timeoutId);\n reject(err);\n };\n\n this.taskHandle.on('error', errorListener);\n this.taskHandle.stdout?.on('data', dataListener);\n });\n }\n\n kill() {\n this.taskHandle.stdin?.destroy();\n this.taskHandle.stderr?.destroy();\n this.taskHandle.stdout?.destroy();\n this.taskHandle.kill('SIGINT');\n this.taskHandle.unref();\n }\n}\n\nexport function getWizardCommand(integration: Integration): string {\n const binName = process.env.SENTRY_WIZARD_E2E_TEST_BIN\n ? ['dist-bin', `sentry-wizard-${process.platform}-${process.arch}`]\n : ['dist', 'bin.js'];\n const binPath = path.join(__dirname, '..', '..', ...binName);\n\n const args = [\n '--debug',\n '-i',\n integration,\n '--preSelectedProject.authToken',\n TEST_ARGS.AUTH_TOKEN,\n '--preSelectedProject.dsn',\n TEST_ARGS.PROJECT_DSN,\n '--preSelectedProject.orgSlug',\n TEST_ARGS.ORG_SLUG,\n '--preSelectedProject.projectSlug',\n TEST_ARGS.PROJECT_SLUG,\n '--disable-telemetry',\n ];\n\n return `${binPath} ${args.join(' ')}`;\n}\n\n/**\n * Create a file with the given content\n *\n * @param filePath\n * @param content\n */\nexport function createFile(filePath: string, content?: string) {\n return fs.writeFileSync(filePath, content || '');\n}\n\n/**\n * Modify the file with the new content\n *\n * @param filePath\n * @param oldContent\n * @param newContent\n */\nexport function modifyFile(\n filePath: string,\n replaceMap: Record<string, string>,\n) {\n const fileContent = fs.readFileSync(filePath, 'utf-8');\n let newFileContent = fileContent;\n\n for (const [oldContent, newContent] of Object.entries(replaceMap)) {\n newFileContent = newFileContent.replace(oldContent, newContent);\n }\n\n fs.writeFileSync(filePath, newFileContent);\n}\n\n/**\n * Read the file contents and check if it does not contain the given content\n *\n * @param {string} filePath\n * @param {(string | string[])} content\n */\nexport function checkFileDoesNotContain(\n filePath: string,\n content: string | string[],\n) {\n const fileContent = fs.readFileSync(filePath, 'utf-8');\n const contentArray = Array.isArray(content) ? content : [content];\n\n for (const c of contentArray) {\n expect(fileContent).not.toContain(c);\n }\n}\n\n/**\n * Read the file contents and check if it contains the given content\n *\n * @param {string} filePath\n * @param {(string | string[])} content\n */\nexport function checkFileContents(\n filePath: string,\n content: string | string[],\n) {\n const fileContent = fs.readFileSync(filePath, 'utf-8');\n const contentArray = Array.isArray(content) ? content : [content];\n for (const c of contentArray) {\n expect(fileContent).toContain(c);\n }\n}\n\n/**\n * Check if the file exists\n *\n * @param filePath\n */\nexport function checkFileExists(filePath: string) {\n expect(fs.existsSync(filePath)).toBe(true);\n}\n\n/**\n * Check if the file does not exist\n *\n * @param filePath\n */\nexport function checkFileDoesNotExist(filePath: string) {\n expect(fs.existsSync(filePath)).toBe(false);\n}\n\n/**\n * Check if the package.json lists the given package as a dependency or dev dependency\n *\n * @param projectDir\n * @param integration\n */\nexport function checkPackageJson(\n projectDir: string,\n packageName: string,\n devDependency = false,\n) {\n const packageJson = fs.readFileSync(`${projectDir}/package.json`, 'utf-8');\n const packageJsonObject = JSON.parse(packageJson) as PackageDotJson;\n\n const packageVersion =\n packageJsonObject.dependencies?.[packageName] ||\n (devDependency && packageJsonObject.devDependencies?.[packageName]);\n\n expect(packageVersion).toBeTruthy();\n}\n\n/**\n * Check if the .sentryclirc contains the auth token\n *\n * @param projectDir\n */\nexport function checkSentryCliRc(projectDir: string) {\n checkFileContents(\n `${projectDir}/.sentryclirc`,\n `token=${TEST_ARGS.AUTH_TOKEN}`,\n );\n}\n\n/**\n * Check if the .env.sentry-build-plugin contains the auth token\n * @param projectDir\n */\nexport function checkEnvBuildPlugin(projectDir: string) {\n checkFileContents(\n `${projectDir}/.env.sentry-build-plugin`,\n `SENTRY_AUTH_TOKEN=${TEST_ARGS.AUTH_TOKEN}`,\n );\n}\n\n/**\n * Check if the sentry.properties contains the auth token\n * @param projectDir\n */\nexport function checkSentryProperties(projectDir: string) {\n checkFileContents(\n `${projectDir}/sentry.properties`,\n `auth_token=${TEST_ARGS.AUTH_TOKEN}`,\n );\n}\n\n/**\n * Check if the project builds\n * Check if the project builds and ends with status code 0.\n * @param projectDir\n */\nexport async function checkIfBuilds(projectDir: string) {\n const npmRunner = new ProcessRunner('npm', ['run', 'build'], {\n cwd: projectDir,\n });\n\n const builtSuccessfully = await npmRunner.waitForStatusCode(0, {\n timeout: 120_000,\n });\n\n expect(builtSuccessfully).toBe(true);\n}\n\n/**\n * Check if the project lints successfully\n * Runs `npm run lint` and expects status code 0.\n * @param projectDir\n */\nexport async function checkIfLints(projectDir: string) {\n const npmRunner = new ProcessRunner('npm', ['run', 'lint'], {\n cwd: projectDir,\n });\n\n const lintedSuccessfully = await npmRunner.waitForStatusCode(0, {\n timeout: 120_000,\n });\n\n expect(lintedSuccessfully).toBe(true);\n}\n\n/**\n * Check if the flutter project builds\n * @param projectDir\n */\nexport async function checkIfFlutterBuilds(\n projectDir: string,\n expectedOutput: string,\n debug = false,\n) {\n const flutterRunner = new ProcessRunner('flutter', ['build', 'web'], {\n cwd: projectDir,\n debug: debug,\n });\n\n const outputReceived = await flutterRunner.waitForOutput(expectedOutput, {\n timeout: 120_000,\n });\n\n expect(outputReceived).toBe(true);\n}\n\n/**\n * Check if the React Native project bundles successfully for the specified platform.\n * Returns a boolean indicating if the process exits with status code 0.\n * @param projectDir The root directory of the React Native project.\n * @param platform The platform to bundle for ('ios' or 'android').\n * @param debug runs the command in debug mode if true\n */\nexport async function checkIfReactNativeBundles(\n projectDir: string,\n platform: 'ios' | 'android',\n debug = false,\n): Promise<boolean> {\n const entryFile = 'index.js';\n const dev = 'false'; // Test a production-like bundle\n let bundleOutput: string;\n let assetsDest: string;\n\n if (platform === 'ios') {\n bundleOutput = './ios/main.jsbundle';\n assetsDest = './ios';\n } else {\n // android\n bundleOutput = './android/app/src/main/assets/index.android.bundle';\n assetsDest = './android/app/src/main/res';\n }\n\n const bundleCommandArgs = [\n 'react-native',\n 'bundle',\n '--entry-file',\n entryFile,\n '--platform',\n platform,\n '--dev',\n dev,\n '--bundle-output',\n bundleOutput,\n '--assets-dest',\n assetsDest,\n ];\n\n const npxRunner = new ProcessRunner('npx', bundleCommandArgs, {\n cwd: projectDir,\n debug: debug,\n });\n\n const builtSuccessfully = await npxRunner.waitForStatusCode(0, {\n timeout: 300_000,\n });\n\n npxRunner.kill();\n\n return builtSuccessfully;\n}\n\n/**\n * Check if the Expo project exports successfully for the specified platform.\n * Returns a boolean indicating if the process exits with status code 0.\n * @param projectDir The root directory of the Expo project.\n * @param platform The platform to export for ('ios', 'android', or 'web').\n * @param debug runs the command in debug mode if true\n */\nexport async function checkIfExpoBundles(\n projectDir: string,\n platform: 'ios' | 'android' | 'web',\n debug = false,\n): Promise<boolean> {\n const exportCommandArgs = ['expo', 'export', '--platform', platform];\n\n const npxRunner = new ProcessRunner('npx', exportCommandArgs, {\n cwd: projectDir,\n debug: debug,\n });\n\n const builtSuccessfully = await npxRunner.waitForStatusCode(0, {\n timeout: 300_000,\n });\n\n npxRunner.kill();\n return builtSuccessfully;\n}\n\n/**\n * Check if the project runs on dev mode\n * @param projectDir\n * @param expectedOutput\n */\nexport async function checkIfRunsOnDevMode(\n projectDir: string,\n expectedOutput: string,\n) {\n const npmRunner = new ProcessRunner('npm', ['run', 'dev'], {\n cwd: projectDir,\n });\n\n expect(\n await npmRunner.waitForOutput(expectedOutput, {\n timeout: 120_000,\n }),\n ).toBe(true);\n\n npmRunner.kill();\n}\n\n/**\n * Check if the project runs on prod mode\n * @param projectDir\n * @param expectedOutput\n */\nexport async function checkIfRunsOnProdMode(\n projectDir: string,\n expectedOutput: string,\n startCommand = 'start',\n) {\n const npmRunner = new ProcessRunner('npm', ['run', startCommand], {\n cwd: projectDir,\n });\n\n expect(\n await npmRunner.waitForOutput(expectedOutput, {\n timeout: 120_000,\n }),\n ).toBe(true);\n\n npmRunner.kill();\n}\n\n/**\n * Initialize a git repository in the given directory\n * @param projectDir\n */\nfunction initGit(projectDir: string): void {\n try {\n execSync('git init', { cwd: projectDir });\n // Add all files to the git repo\n execSync('git add -A', { cwd: projectDir });\n // Add author info to avoid git commit error\n execSync('git config user.email test@test.sentry.io', { cwd: projectDir });\n execSync('git config user.name Test', { cwd: projectDir });\n execSync('git commit -m init', { cwd: projectDir });\n } catch (e) {\n log.error('Error initializing git');\n log.error(e);\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { readdirSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+
4
+ const dirname = new URL('.', import.meta.url).pathname;
5
+ const tests = readdirSync(join(dirname, '../e2e-tests/tests'));
6
+
7
+ const matrixValues = tests
8
+ .filter((test) => test.endsWith('.test.ts'))
9
+ .map((test) => test.replace('.test.ts', ''));
10
+
11
+ console.log(JSON.stringify(matrixValues));
@@ -6,6 +6,7 @@ export declare enum Integration {
6
6
  android = "android",
7
7
  cordova = "cordova",
8
8
  angular = "angular",
9
+ cloudflare = "cloudflare",
9
10
  electron = "electron",
10
11
  nextjs = "nextjs",
11
12
  nuxt = "nuxt",
@@ -10,6 +10,7 @@ var Integration;
10
10
  Integration["android"] = "android";
11
11
  Integration["cordova"] = "cordova";
12
12
  Integration["angular"] = "angular";
13
+ Integration["cloudflare"] = "cloudflare";
13
14
  Integration["electron"] = "electron";
14
15
  Integration["nextjs"] = "nextjs";
15
16
  Integration["nuxt"] = "nuxt";
@@ -65,6 +66,8 @@ function getIntegrationDescription(type) {
65
66
  return 'Configure Source Maps Upload';
66
67
  case Integration.ios:
67
68
  return 'iOS';
69
+ case Integration.cloudflare:
70
+ return 'Cloudflare';
68
71
  default:
69
72
  return 'React Native';
70
73
  }
@@ -94,6 +97,8 @@ function mapIntegrationToPlatform(type) {
94
97
  return 'javascript-sveltekit';
95
98
  case Integration.sourcemaps:
96
99
  return undefined;
100
+ case Integration.cloudflare:
101
+ return 'node-cloudflare-workers';
97
102
  case Integration.ios:
98
103
  return 'iOS';
99
104
  default:
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../lib/Constants.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AACxC,IAAY,WAcX;AAdD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;IACnB,0BAAW,CAAA;IACX,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,0CAA2B,CAAA;IAC3B,sCAAuB,CAAA;IACvB,wCAAyB,CAAA;AAC3B,CAAC,EAdW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QActB;AAED,wCAAwC;AACxC,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,+BAAmB,CAAA;AACrB,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,SAAgB,kBAAkB;IAKhC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAC9C,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC;QACtC,KAAK,EAAE,QAAQ;KAChB,CAAC,CAAC,CAAC;AACN,CAAC;AAVD,gDAUC;AAED,SAAgB,sBAAsB,CAAC,IAAY;IACjD,QAAQ,IAAI,EAAE;QACZ,KAAK,QAAQ,CAAC,GAAG;YACf,OAAO,KAAK,CAAC;QACf;YACE,OAAO,SAAS,CAAC;KACpB;AACH,CAAC;AAPD,wDAOC;AAED,SAAgB,yBAAyB,CAAC,IAAY;IACpD,QAAQ,IAAI,EAAE;QACZ,KAA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WAAW,CAAC,SAAS;YACxB,OAAO,sBAAsB,CAAC;QAChC,KAAK,WAAW,CAAC,UAAU;YACzB,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW,CAAC,GAAG;YAClB,OAAO,KAAK,CAAC;QACf;YACE,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;KAClD;AACH,CAAC;AA7BD,4DA6BC;AAOD,SAAgB,qBAAqB;IACnC,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC;QACrD,IAAI,EAAE,yBAAyB,CAAC,IAAI,CAAC;QACrC,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC,CAAC;AACN,CAAC;AALD,sDAKC;AAkBY,QAAA,WAAW,GAAG,oBAAoB,CAAC","sourcesContent":["/** Key value should be the same here */\nexport enum Integration {\n reactNative = 'reactNative',\n flutter = 'flutter',\n ios = 'ios',\n android = 'android',\n cordova = 'cordova',\n angular = 'angular',\n electron = 'electron',\n nextjs = 'nextjs',\n nuxt = 'nuxt',\n remix = 'remix',\n reactRouter = 'reactRouter',\n sveltekit = 'sveltekit',\n sourcemaps = 'sourcemaps',\n}\n\n/** Key value should be the same here */\nexport enum Platform {\n ios = 'ios',\n android = 'android',\n}\n\nexport function getPlatformChoices(): Array<{\n checked: boolean;\n name: string;\n value: string;\n}> {\n return Object.keys(Platform).map((platform) => ({\n checked: true,\n name: getPlatformDescription(platform),\n value: platform,\n }));\n}\n\nexport function getPlatformDescription(type: string): string {\n switch (type) {\n case Platform.ios:\n return 'iOS';\n default:\n return 'Android';\n }\n}\n\nexport function getIntegrationDescription(type: string): string {\n switch (type) {\n case Integration.android:\n return 'Android';\n case Integration.reactNative:\n return 'React Native';\n case Integration.flutter:\n return 'Flutter';\n case Integration.cordova:\n return 'Cordova';\n case Integration.electron:\n return 'Electron';\n case Integration.nextjs:\n return 'Next.js';\n case Integration.remix:\n return 'Remix';\n case Integration.reactRouter:\n return 'React Router (framework)';\n case Integration.sveltekit:\n return 'SvelteKit';\n case Integration.sourcemaps:\n return 'Configure Source Maps Upload';\n case Integration.ios:\n return 'iOS';\n default:\n return 'React Native';\n }\n}\n\nexport function mapIntegrationToPlatform(type: string): string | undefined {\n switch (type) {\n case Integration.android:\n return 'android';\n case Integration.reactNative:\n return 'react-native';\n case Integration.flutter:\n return 'flutter';\n case Integration.cordova:\n return 'cordova';\n case Integration.angular:\n return 'javascript-angular';\n case Integration.electron:\n return 'javascript-electron';\n case Integration.nextjs:\n return 'javascript-nextjs';\n case Integration.remix:\n return 'javascript-remix';\n case Integration.reactRouter:\n return 'javascript-react-router';\n case Integration.sveltekit:\n return 'javascript-sveltekit';\n case Integration.sourcemaps:\n return undefined;\n case Integration.ios:\n return 'iOS';\n default:\n throw new Error(`Unknown integration ${type}`);\n }\n}\n\ntype IntegrationChoice = {\n name: string;\n value: string;\n};\n\nexport function getIntegrationChoices(): IntegrationChoice[] {\n return Object.keys(Integration).map((type: string) => ({\n name: getIntegrationDescription(type),\n value: type,\n }));\n}\n\nexport interface Args {\n url: string;\n debug: boolean;\n uninstall: boolean;\n integration: Integration;\n platform: Platform[];\n skipConnect: boolean;\n quiet: boolean;\n signup: boolean;\n promoCode?: string;\n disableTelemetry?: boolean;\n comingFrom?: string;\n ignoreGitChanges?: boolean;\n xcodeProjectDir?: string;\n}\n\nexport const DEFAULT_URL = 'https://sentry.io/';\n"]}
1
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../lib/Constants.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AACxC,IAAY,WAeX;AAfD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;IACnB,0BAAW,CAAA;IACX,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAA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C,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC;QACrD,IAAI,EAAE,yBAAyB,CAAC,IAAI,CAAC;QACrC,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC,CAAC;AACN,CAAC;AALD,sDAKC;AAkBY,QAAA,WAAW,GAAG,oBAAoB,CAAC","sourcesContent":["/** Key value should be the same here */\nexport enum Integration {\n reactNative = 'reactNative',\n flutter = 'flutter',\n ios = 'ios',\n android = 'android',\n cordova = 'cordova',\n angular = 'angular',\n cloudflare = 'cloudflare',\n electron = 'electron',\n nextjs = 'nextjs',\n nuxt = 'nuxt',\n remix = 'remix',\n reactRouter = 'reactRouter',\n sveltekit = 'sveltekit',\n sourcemaps = 'sourcemaps',\n}\n\n/** Key value should be the same here */\nexport enum Platform {\n ios = 'ios',\n android = 'android',\n}\n\nexport function getPlatformChoices(): Array<{\n checked: boolean;\n name: string;\n value: string;\n}> {\n return Object.keys(Platform).map((platform) => ({\n checked: true,\n name: getPlatformDescription(platform),\n value: platform,\n }));\n}\n\nexport function getPlatformDescription(type: string): string {\n switch (type) {\n case Platform.ios:\n return 'iOS';\n default:\n return 'Android';\n }\n}\n\nexport function getIntegrationDescription(type: string): string {\n switch (type) {\n case Integration.android:\n return 'Android';\n case Integration.reactNative:\n return 'React Native';\n case Integration.flutter:\n return 'Flutter';\n case Integration.cordova:\n return 'Cordova';\n case Integration.electron:\n return 'Electron';\n case Integration.nextjs:\n return 'Next.js';\n case Integration.remix:\n return 'Remix';\n case Integration.reactRouter:\n return 'React Router (framework)';\n case Integration.sveltekit:\n return 'SvelteKit';\n case Integration.sourcemaps:\n return 'Configure Source Maps Upload';\n case Integration.ios:\n return 'iOS';\n case Integration.cloudflare:\n return 'Cloudflare';\n default:\n return 'React Native';\n }\n}\n\nexport function mapIntegrationToPlatform(type: string): string | undefined {\n switch (type) {\n case Integration.android:\n return 'android';\n case Integration.reactNative:\n return 'react-native';\n case Integration.flutter:\n return 'flutter';\n case Integration.cordova:\n return 'cordova';\n case Integration.angular:\n return 'javascript-angular';\n case Integration.electron:\n return 'javascript-electron';\n case Integration.nextjs:\n return 'javascript-nextjs';\n case Integration.remix:\n return 'javascript-remix';\n case Integration.reactRouter:\n return 'javascript-react-router';\n case Integration.sveltekit:\n return 'javascript-sveltekit';\n case Integration.sourcemaps:\n return undefined;\n case Integration.cloudflare:\n return 'node-cloudflare-workers';\n case Integration.ios:\n return 'iOS';\n default:\n throw new Error(`Unknown integration ${type}`);\n }\n}\n\ntype IntegrationChoice = {\n name: string;\n value: string;\n};\n\nexport function getIntegrationChoices(): IntegrationChoice[] {\n return Object.keys(Integration).map((type: string) => ({\n name: getIntegrationDescription(type),\n value: type,\n }));\n}\n\nexport interface Args {\n url: string;\n debug: boolean;\n uninstall: boolean;\n integration: Integration;\n platform: Platform[];\n skipConnect: boolean;\n quiet: boolean;\n signup: boolean;\n promoCode?: string;\n disableTelemetry?: boolean;\n comingFrom?: string;\n ignoreGitChanges?: boolean;\n xcodeProjectDir?: string;\n}\n\nexport const DEFAULT_URL = 'https://sentry.io/';\n"]}
@@ -40,6 +40,7 @@ const mcp_config_1 = require("../utils/clack/mcp-config");
40
40
  const codetools = __importStar(require("./code-tools"));
41
41
  const gradle = __importStar(require("./gradle"));
42
42
  const manifest = __importStar(require("./manifest"));
43
+ const abort_if_sportlight_not_supported_1 = require("../utils/abort-if-sportlight-not-supported");
43
44
  const proguardMappingCliSetupConfig = {
44
45
  ...clack_1.propertiesCliSetupConfig,
45
46
  name: 'proguard mappings',
@@ -75,10 +76,7 @@ async function runAndroidWizardWithTelemetry(options) {
75
76
  const appFile = await (0, telemetry_1.traceStep)('Select App File', () => gradle.selectAppFile(buildGradleFiles));
76
77
  const projectData = await (0, clack_1.getOrAskForProjectData)(options, 'android');
77
78
  if (projectData.spotlight) {
78
- clack.log.warn('Spotlight mode is not yet supported for Android.');
79
- clack.log.info('Spotlight is currently only available for Next.js.');
80
- await (0, clack_1.abort)('Exiting wizard', 0);
81
- return;
79
+ return (0, abort_if_sportlight_not_supported_1.abortIfSpotlightNotSupported)('Android');
82
80
  }
83
81
  const { selectedProject, selfHosted, sentryUrl, authToken } = projectData;
84
82
  // Ask if user wants to enable Sentry Logs
@@ -1 +1 @@
1
- {"version":3,"file":"android-wizard.js","sourceRoot":"","sources":["../../../src/android/android-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA4D;AAC5D,uCAAyB;AACzB,+EAA+E;AAC/E,sDAAwC;AACxC,qDAAuC;AACvC,kDAA0B;AAC1B,2CAA6B;AAC7B,4CAAwD;AACxD,0CASwB;AAExB,0DAAwE;AACxE,wDAA0C;AAC1C,iDAAmC;AACnC,qDAAuC;AAEvC,MAAM,6BAA6B,GAAmB;IACpD,GAAG,gCAAwB;IAC3B,IAAI,EAAE,mBAAmB;CAC1B,CAAC;AAEK,KAAK,UAAU,gBAAgB,CAAC,OAAsB;IAC3D,OAAO,IAAA,yBAAa,EAClB;QACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;QACjC,WAAW,EAAE,SAAS;QACtB,aAAa,EAAE,OAAO;KACvB,EACD,GAAG,EAAE,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAC7C,CAAC;AACJ,CAAC;AATD,4CASC;AAED,KAAK,UAAU,6BAA6B,CAC1C,OAAsB;IAEtB,IAAA,oBAAY,EAAC;QACX,UAAU,EAAE,uBAAuB;QACnC,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAC,CAAC;IAEH,MAAM,IAAA,yCAAiC,EAAC;QACtC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;QAC1C,GAAG,EAAE,SAAS;KACf,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC,UAAU,EAAE;QAC3D,SAAS;QACT,YAAY;KACb,CAAC,CAAC;IAEH,IAAI,CAAC,gBAAgB,IAAI,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G,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACzE;KACF;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport * as fs from 'fs';\n// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\nimport * as Sentry from '@sentry/node';\nimport chalk from 'chalk';\nimport * as path from 'path';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport {\n CliSetupConfig,\n abort,\n abortIfCancelled,\n addSentryCliConfig,\n confirmContinueIfNoOrDirtyGitRepo,\n getOrAskForProjectData,\n printWelcome,\n propertiesCliSetupConfig,\n} from '../utils/clack';\nimport { WizardOptions } from '../utils/types';\nimport { offerProjectScopedMcpConfig } from '../utils/clack/mcp-config';\nimport * as codetools from './code-tools';\nimport * as gradle from './gradle';\nimport * as manifest from './manifest';\n\nconst proguardMappingCliSetupConfig: CliSetupConfig = {\n ...propertiesCliSetupConfig,\n name: 'proguard mappings',\n};\n\nexport async function runAndroidWizard(options: WizardOptions): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'android',\n wizardOptions: options,\n },\n () => runAndroidWizardWithTelemetry(options),\n );\n}\n\nasync function runAndroidWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Android Wizard',\n promoCode: options.promoCode,\n });\n\n await confirmContinueIfNoOrDirtyGitRepo({\n ignoreGitChanges: options.ignoreGitChanges,\n cwd: undefined,\n });\n\n const projectDir = process.cwd();\n const buildGradleFiles = findFilesWithExtensions(projectDir, [\n '.gradle',\n 'gradle.kts',\n ]);\n\n if (!buildGradleFiles || buildGradleFiles.length === 0) {\n clack.log.error(\n 'No Gradle project found. Please run this command from the root of your project.',\n );\n Sentry.captureException('No Gradle project found');\n await abort();\n return;\n }\n\n const appFile = await traceStep('Select App File', () =>\n gradle.selectAppFile(buildGradleFiles),\n );\n\n const projectData = await getOrAskForProjectData(options, 'android');\n\n if (projectData.spotlight) {\n clack.log.warn('Spotlight mode is not yet supported for Android.');\n clack.log.info('Spotlight is currently only available for Next.js.');\n await abort('Exiting wizard', 0);\n return;\n }\n\n const { selectedProject, selfHosted, sentryUrl, authToken } = projectData;\n\n // Ask if user wants to enable Sentry Logs\n const enableLogs = await abortIfCancelled(\n clack.confirm({\n message:\n 'Do you want to enable Logs? (See https://docs.sentry.io/platforms/android/logs/)',\n }),\n );\n Sentry.setTag('enable-logs', enableLogs);\n\n if (enableLogs) {\n clack.log.info(\n 'Logs will be enabled with default settings. You can send logs using the Sentry.logger() APIs or use one of the integrations: https://docs.sentry.io/platforms/android/logs/#integrations.',\n );\n }\n\n // ======== STEP 1. Add Sentry Gradle Plugin to build.gradle(.kts) ============\n clack.log.step(\n `Adding ${chalk.bold('Sentry Gradle plugin')} to your app's ${chalk.cyan(\n 'build.gradle',\n )} file.`,\n );\n const pluginAdded = await traceStep('Add Gradle Plugin', () =>\n gradle.addGradlePlugin(\n appFile,\n selectedProject.organization.slug,\n selectedProject.slug,\n ),\n );\n if (!pluginAdded) {\n clack.log.warn(\n \"Could not add Sentry Gradle plugin to your app's build.gradle file. You'll have to add it manually.\\nPlease follow the instructions at https://docs.sentry.io/platforms/android/#install\",\n );\n }\n Sentry.setTag('gradle-plugin-added', pluginAdded);\n\n // ======== STEP 2. Configure Sentry SDK via AndroidManifest ============\n clack.log.step(\n `Configuring Sentry SDK via ${chalk.cyan('AndroidManifest.xml')}`,\n );\n const appDir = path.dirname(appFile);\n const manifestFile = path.join(appDir, 'src', 'main', 'AndroidManifest.xml');\n\n const manifestUpdated = traceStep('Update Android Manifest', () =>\n manifest.addManifestSnippet(\n manifestFile,\n selectedProject.keys[0].dsn.public,\n enableLogs,\n ),\n );\n if (!manifestUpdated) {\n clack.log.warn(\n \"Could not configure the Sentry SDK. You'll have to do it manually.\\nPlease follow the instructions at https://docs.sentry.io/platforms/android/#configure\",\n );\n }\n Sentry.setTag('android-manifest-updated', manifestUpdated);\n\n // ======== STEP 3. Patch Main Activity with a test error snippet ============\n clack.log.step(\n `Patching ${chalk.bold('Main Activity')} with a test error snippet.`,\n );\n const mainActivity = traceStep('Find Main Activity', () =>\n manifest.getMainActivity(manifestFile),\n );\n let packageName = mainActivity.packageName;\n if (!packageName) {\n // if no package name in AndroidManifest, look into gradle script\n packageName = gradle.getNamespace(appFile);\n }\n const activityName = mainActivity.activityName;\n Sentry.setTag('has-activity-name', !!activityName);\n Sentry.setTag('has-package-name', !!packageName);\n if (!activityName || !packageName) {\n clack.log.warn(\n \"Could not find Activity with intent action MAIN. You'll have to manually verify the setup.\\nPlease follow the instructions at https://docs.sentry.io/platforms/android/#verify\",\n );\n Sentry.captureException('Could not find Main Activity');\n } else {\n const packageNameStable = packageName;\n const activityFile = traceStep('Find Main Activity Source File', () =>\n codetools.findActivitySourceFile(appDir, packageNameStable, activityName),\n );\n\n const activityPatched = traceStep('Patch Main Activity', () =>\n codetools.patchMainActivity(activityFile),\n );\n if (!activityPatched) {\n clack.log.warn(\n \"Could not patch main activity. You'll have to manually verify the setup.\\nPlease follow the instructions at https://docs.sentry.io/platforms/android/#verify\",\n );\n }\n Sentry.setTag('main-activity-patched', activityPatched);\n }\n\n // ======== STEP 4. Add sentry-cli config file ============\n clack.log.step(\n `Configuring ${chalk.bold('proguard mappings upload')} via the ${chalk.cyan(\n 'sentry.properties',\n )} file.`,\n );\n\n await addSentryCliConfig({ authToken }, proguardMappingCliSetupConfig);\n\n // Offer optional project-scoped MCP config for Sentry with org and project scope\n await offerProjectScopedMcpConfig(\n selectedProject.organization.slug,\n selectedProject.slug,\n );\n\n // ======== OUTRO ========\n const issuesPageLink = selfHosted\n ? `${sentryUrl}organizations/${selectedProject.organization.slug}/issues/?project=${selectedProject.id}`\n : `https://${selectedProject.organization.slug}.sentry.io/issues/?project=${selectedProject.id}`;\n\n clack.outro(`\n${chalk.greenBright('Successfully installed the Sentry Android SDK!')}\n\n${chalk.cyan(\n `You can validate your setup by launching your application and checking Sentry issues page afterwards\n${issuesPageLink}`,\n)}\n\nCheck out the SDK documentation for further configuration:\nhttps://docs.sentry.io/platforms/android/\n `);\n}\n\n//find files with the given extension\nfunction findFilesWithExtensions(\n dir: string,\n extensions: string[],\n filesWithExtensions: string[] = [],\n): string[] {\n const cwd = process.cwd();\n const files = fs.readdirSync(dir, { withFileTypes: true });\n for (const file of files) {\n if (file.isDirectory()) {\n const childDir = path.join(dir, file.name);\n findFilesWithExtensions(childDir, extensions, filesWithExtensions);\n } else if (extensions.some((ext) => file.name.endsWith(ext))) {\n filesWithExtensions.push(path.relative(cwd, path.join(dir, file.name)));\n }\n }\n return filesWithExtensions;\n}\n"]}
1
+ {"version":3,"file":"android-wizard.js","sourceRoot":"","sources":["../../../src/android/android-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA4D;AAC5D,uCAAyB;AACzB,+EAA+E;AAC/E,sDAAwC;AACxC,qDAAuC;AACvC,kDAA0B;AAC1B,2CAA6B;AAC7B,4CAAwD;AACxD,0CASwB;AAExB,0DAAwE;AACxE,wDAA0C;AAC1C,iDAAmC;AACnC,qDAAuC;AACvC,kGAA0F;AAE1F,MAAM,6BAA6B,GAAmB;IACpD,GAAG,gCAAwB;IAC3B,IAAI,EAAE,mBAAmB;CAC1B,CAAC;AAEK,KAAK,UAAU,gBAAgB,CAAC,OAAsB;IAC3D,OAAO,IAAA,yBAAa,EAClB;QACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;QACjC,WAAW,EAAE,SAAS;QACtB,aAAa,EAAE,OAAO;KACvB,EACD,GAAG,EAAE,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAC7C,CAAC;AACJ,CAAC;AATD,4CASC;AAED,KAAK,UAAU,6BAA6B,CAC1C,OAAsB;IAEtB,IAAA,oBAAY,EAAC;QACX,UAAU,EAAE,uBAAuB;QACnC,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CA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AI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE;YAC5D,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACzE;KACF;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport * as fs from 'fs';\n// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\nimport * as Sentry from '@sentry/node';\nimport chalk from 'chalk';\nimport * as path from 'path';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport {\n CliSetupConfig,\n abort,\n abortIfCancelled,\n addSentryCliConfig,\n confirmContinueIfNoOrDirtyGitRepo,\n getOrAskForProjectData,\n printWelcome,\n propertiesCliSetupConfig,\n} from '../utils/clack';\nimport { WizardOptions } from '../utils/types';\nimport { offerProjectScopedMcpConfig } from '../utils/clack/mcp-config';\nimport * as codetools from './code-tools';\nimport * as gradle from './gradle';\nimport * as manifest from './manifest';\nimport { abortIfSpotlightNotSupported } from '../utils/abort-if-sportlight-not-supported';\n\nconst proguardMappingCliSetupConfig: CliSetupConfig = {\n ...propertiesCliSetupConfig,\n name: 'proguard mappings',\n};\n\nexport async function runAndroidWizard(options: WizardOptions): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'android',\n wizardOptions: options,\n },\n () => runAndroidWizardWithTelemetry(options),\n );\n}\n\nasync function runAndroidWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Android Wizard',\n promoCode: options.promoCode,\n });\n\n await confirmContinueIfNoOrDirtyGitRepo({\n ignoreGitChanges: options.ignoreGitChanges,\n cwd: undefined,\n });\n\n const projectDir = process.cwd();\n const buildGradleFiles = findFilesWithExtensions(projectDir, [\n '.gradle',\n 'gradle.kts',\n ]);\n\n if (!buildGradleFiles || buildGradleFiles.length === 0) {\n clack.log.error(\n 'No Gradle project found. Please run this command from the root of your project.',\n );\n Sentry.captureException('No Gradle project found');\n await abort();\n return;\n }\n\n const appFile = await traceStep('Select App File', () =>\n gradle.selectAppFile(buildGradleFiles),\n );\n\n const projectData = await getOrAskForProjectData(options, 'android');\n\n if (projectData.spotlight) {\n return abortIfSpotlightNotSupported('Android');\n }\n\n const { selectedProject, selfHosted, sentryUrl, authToken } = projectData;\n\n // Ask if user wants to enable Sentry Logs\n const enableLogs = await abortIfCancelled(\n clack.confirm({\n message:\n 'Do you want to enable Logs? (See https://docs.sentry.io/platforms/android/logs/)',\n }),\n );\n Sentry.setTag('enable-logs', enableLogs);\n\n if (enableLogs) {\n clack.log.info(\n 'Logs will be enabled with default settings. You can send logs using the Sentry.logger() APIs or use one of the integrations: https://docs.sentry.io/platforms/android/logs/#integrations.',\n );\n }\n\n // ======== STEP 1. Add Sentry Gradle Plugin to build.gradle(.kts) ============\n clack.log.step(\n `Adding ${chalk.bold('Sentry Gradle plugin')} to your app's ${chalk.cyan(\n 'build.gradle',\n )} file.`,\n );\n const pluginAdded = await traceStep('Add Gradle Plugin', () =>\n gradle.addGradlePlugin(\n appFile,\n selectedProject.organization.slug,\n selectedProject.slug,\n ),\n );\n if (!pluginAdded) {\n clack.log.warn(\n \"Could not add Sentry Gradle plugin to your app's build.gradle file. You'll have to add it manually.\\nPlease follow the instructions at https://docs.sentry.io/platforms/android/#install\",\n );\n }\n Sentry.setTag('gradle-plugin-added', pluginAdded);\n\n // ======== STEP 2. Configure Sentry SDK via AndroidManifest ============\n clack.log.step(\n `Configuring Sentry SDK via ${chalk.cyan('AndroidManifest.xml')}`,\n );\n const appDir = path.dirname(appFile);\n const manifestFile = path.join(appDir, 'src', 'main', 'AndroidManifest.xml');\n\n const manifestUpdated = traceStep('Update Android Manifest', () =>\n manifest.addManifestSnippet(\n manifestFile,\n selectedProject.keys[0].dsn.public,\n enableLogs,\n ),\n );\n if (!manifestUpdated) {\n clack.log.warn(\n \"Could not configure the Sentry SDK. You'll have to do it manually.\\nPlease follow the instructions at https://docs.sentry.io/platforms/android/#configure\",\n );\n }\n Sentry.setTag('android-manifest-updated', manifestUpdated);\n\n // ======== STEP 3. Patch Main Activity with a test error snippet ============\n clack.log.step(\n `Patching ${chalk.bold('Main Activity')} with a test error snippet.`,\n );\n const mainActivity = traceStep('Find Main Activity', () =>\n manifest.getMainActivity(manifestFile),\n );\n let packageName = mainActivity.packageName;\n if (!packageName) {\n // if no package name in AndroidManifest, look into gradle script\n packageName = gradle.getNamespace(appFile);\n }\n const activityName = mainActivity.activityName;\n Sentry.setTag('has-activity-name', !!activityName);\n Sentry.setTag('has-package-name', !!packageName);\n if (!activityName || !packageName) {\n clack.log.warn(\n \"Could not find Activity with intent action MAIN. You'll have to manually verify the setup.\\nPlease follow the instructions at https://docs.sentry.io/platforms/android/#verify\",\n );\n Sentry.captureException('Could not find Main Activity');\n } else {\n const packageNameStable = packageName;\n const activityFile = traceStep('Find Main Activity Source File', () =>\n codetools.findActivitySourceFile(appDir, packageNameStable, activityName),\n );\n\n const activityPatched = traceStep('Patch Main Activity', () =>\n codetools.patchMainActivity(activityFile),\n );\n if (!activityPatched) {\n clack.log.warn(\n \"Could not patch main activity. You'll have to manually verify the setup.\\nPlease follow the instructions at https://docs.sentry.io/platforms/android/#verify\",\n );\n }\n Sentry.setTag('main-activity-patched', activityPatched);\n }\n\n // ======== STEP 4. Add sentry-cli config file ============\n clack.log.step(\n `Configuring ${chalk.bold('proguard mappings upload')} via the ${chalk.cyan(\n 'sentry.properties',\n )} file.`,\n );\n\n await addSentryCliConfig({ authToken }, proguardMappingCliSetupConfig);\n\n // Offer optional project-scoped MCP config for Sentry with org and project scope\n await offerProjectScopedMcpConfig(\n selectedProject.organization.slug,\n selectedProject.slug,\n );\n\n // ======== OUTRO ========\n const issuesPageLink = selfHosted\n ? `${sentryUrl}organizations/${selectedProject.organization.slug}/issues/?project=${selectedProject.id}`\n : `https://${selectedProject.organization.slug}.sentry.io/issues/?project=${selectedProject.id}`;\n\n clack.outro(`\n${chalk.greenBright('Successfully installed the Sentry Android SDK!')}\n\n${chalk.cyan(\n `You can validate your setup by launching your application and checking Sentry issues page afterwards\n${issuesPageLink}`,\n)}\n\nCheck out the SDK documentation for further configuration:\nhttps://docs.sentry.io/platforms/android/\n `);\n}\n\n//find files with the given extension\nfunction findFilesWithExtensions(\n dir: string,\n extensions: string[],\n filesWithExtensions: string[] = [],\n): string[] {\n const cwd = process.cwd();\n const files = fs.readdirSync(dir, { withFileTypes: true });\n for (const file of files) {\n if (file.isDirectory()) {\n const childDir = path.join(dir, file.name);\n findFilesWithExtensions(childDir, extensions, filesWithExtensions);\n } else if (extensions.some((ext) => file.name.endsWith(ext))) {\n filesWithExtensions.push(path.relative(cwd, path.join(dir, file.name)));\n }\n }\n return filesWithExtensions;\n}\n"]}
@@ -41,6 +41,7 @@ const sdk_setup_2 = require("./sdk-setup");
41
41
  const sourcemaps_wizard_1 = require("../sourcemaps/sourcemaps-wizard");
42
42
  const sourcemaps_1 = require("./codemods/sourcemaps");
43
43
  const example_component_1 = require("./example-component");
44
+ const abort_if_sportlight_not_supported_1 = require("../utils/abort-if-sportlight-not-supported");
44
45
  const MIN_SUPPORTED_ANGULAR_VERSION = '14.0.0';
45
46
  const MIN_SUPPORTED_WIZARD_ANGULAR_VERSION = '17.0.0';
46
47
  async function runAngularWizard(options) {
@@ -108,10 +109,7 @@ Apologies for the inconvenience!`);
108
109
  }
109
110
  const projectData = await (0, clack_1.getOrAskForProjectData)(options, 'javascript-angular');
110
111
  if (projectData.spotlight) {
111
- prompts_1.default.log.warn('Spotlight mode is not yet supported for Angular.');
112
- prompts_1.default.log.info('Spotlight is currently only available for Next.js.');
113
- await (0, clack_1.abort)('Exiting wizard', 0);
114
- return;
112
+ return (0, abort_if_sportlight_not_supported_1.abortIfSpotlightNotSupported)('Angular');
115
113
  }
116
114
  const { selectedProject, authToken, sentryUrl, selfHosted } = projectData;
117
115
  const dsn = selectedProject.keys[0].dsn.public;
@@ -130,7 +128,7 @@ Apologies for the inconvenience!`);
130
128
  },
131
129
  {
132
130
  id: 'replay',
133
- prompt: `Do you want to enable ${chalk_1.default.bold('Sentry Session Replay')} to get a video-like reproduction of errors during a user session?`,
131
+ prompt: `Do you want to enable ${chalk_1.default.bold('Session Replay')} to get a video-like reproduction of errors during a user session?`,
134
132
  enabledHint: 'recommended, but increases bundle size',
135
133
  },
136
134
  {
@@ -189,7 +187,7 @@ Apologies for the inconvenience!`);
189
187
  prompts_1.default.outro(buildOutroMessage(shouldCreateExampleComponent));
190
188
  }
191
189
  function buildOutroMessage(createdExampleComponent) {
192
- let msg = chalk_1.default.green('\nSuccessfully installed the Sentry Angular SDK!');
190
+ let msg = chalk_1.default.green('Successfully installed the Sentry Angular SDK!');
193
191
  if (createdExampleComponent) {
194
192
  msg += `\n\nYou can validate your setup by starting your dev environment (${chalk_1.default.cyan('ng serve')}) and throwing an error in the example component.`;
195
193
  }
@@ -1 +1 @@
1
- {"version":3,"file":"angular-wizard.js","sourceRoot":"","sources":["../../../src/angular/angular-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAA+E;AAC/E,6DAAmC;AAEnC,kDAA0B;AAE1B,4CAAwD;AACxD,0DAAwE;AACxE,0CAYwB;AACxB,wDAA+E;AAC/E,mCAAiD;AAEjD,qDAAuC;AACvC,2CAAiE;AACjE,2CAA8C;AAC9C,uEAAsE;AACtE,sDAAuE;AACvE,2DAA6D;AAE7D,MAAM,6BAA6B,GAAG,QAAQ,CAAC;AAC/C,MAAM,oCAAoC,GAAG,QAAQ,CAAC;AAE/C,KAAK,UAAU,gBAAgB,CAAC,OAAsB;IAC3D,OAAO,IAAA,yBAAa,EAClB;QACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;QACjC,WAAW,EAAE,SAAS;QACtB,aAAa,EAAE,OAAO;KACv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AC,cAAc,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,IAAA,8BAAsB,EAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,iFAAiF;IACjF,MAAM,IAAA,wCAA2B,EAC/B,eAAe,CAAC,YAAY,CAAC,IAAI,EACjC,eAAe,CAAC,IAAI,CACrB,CAAC;IAEF,iBAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,4BAA4B,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,SAAgB,iBAAiB,CAAC,uBAAgC;IAChE,IAAI,GAAG,GAAG,eAAK,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;IAE1E,IAAI,uBAAuB,EAAE;QAC3B,GAAG,IAAI,qEAAqE,eAAK,CAAC,IAAI,CACpF,UAAU,CACX,mDAAmD,CAAC;KACtD;IAED,GAAG,IAAI;4DACmD,CAAC;IAE3D,OAAO,GAAG,CAAC;AACb,CAAC;AAbD,8CAaC","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\n\nimport chalk from 'chalk';\nimport type { WizardOptions } from '../utils/types';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport { offerProjectScopedMcpConfig } from '../utils/clack/mcp-config';\nimport {\n abortIfCancelled,\n askShouldCreateExampleComponent,\n confirmContinueIfNoOrDirtyGitRepo,\n ensurePackageIsInstalled,\n featureSelectionPrompt,\n getOrAskForProjectData,\n getPackageDotJson,\n installPackage,\n printWelcome,\n runPrettierIfInstalled,\n abort,\n} from '../utils/clack';\nimport { getPackageVersion, hasPackageInstalled } from '../utils/package-json';\nimport { gte, minVersion, SemVer } from 'semver';\n\nimport * as Sentry from '@sentry/node';\nimport { initializeSentryOnApplicationEntry } from './sdk-setup';\nimport { updateAppConfig } from './sdk-setup';\nimport { runSourcemapsWizard } from '../sourcemaps/sourcemaps-wizard';\nimport { addSourcemapEntryToAngularJSON } from './codemods/sourcemaps';\nimport { createExampleComponent } from './example-component';\n\nconst MIN_SUPPORTED_ANGULAR_VERSION = '14.0.0';\nconst MIN_SUPPORTED_WIZARD_ANGULAR_VERSION = '17.0.0';\n\nexport async function runAngularWizard(options: WizardOptions): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'angular',\n wizardOptions: options,\n },\n () => runAngularWizardWithTelemetry(options),\n );\n}\n\nasync function runAngularWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Angular Wizard',\n promoCode: options.promoCode,\n telemetryEnabled: options.telemetryEnabled,\n });\n\n await confirmContinueIfNoOrDirtyGitRepo({\n ignoreGitChanges: options.ignoreGitChanges,\n cwd: undefined,\n });\n\n const packageJson = await getPackageDotJson();\n\n await ensurePackageIsInstalled(packageJson, '@angular/core', 'Angular');\n\n let installedAngularVersion = getPackageVersion('@angular/core', packageJson);\n\n if (!installedAngularVersion) {\n clack.log.warn('Could not determine installed Angular version.');\n\n installedAngularVersion = await abortIfCancelled(\n clack.text({\n message: `Please enter your installed Angular major version (e.g. ${chalk.cyan(\n '18',\n )} for Angular 18)`,\n validate(value) {\n if (!value) {\n return 'Angular version is required';\n }\n\n try {\n if (!minVersion(value)) {\n return `Invalid Angular version provided: ${value}`;\n }\n } catch (error) {\n return `Invalid Angular version provided: ${value}`;\n }\n },\n }),\n );\n }\n\n Sentry.setTag('angular-version', installedAngularVersion);\n\n const installedMinVersion = minVersion(installedAngularVersion) as SemVer;\n\n const sdkSupportsAngularVersion = gte(\n installedMinVersion,\n MIN_SUPPORTED_ANGULAR_VERSION,\n );\n\n const wizardSupportsAngularVersion = gte(\n installedMinVersion,\n MIN_SUPPORTED_WIZARD_ANGULAR_VERSION,\n );\n\n if (!sdkSupportsAngularVersion) {\n Sentry.setTag('angular-version-compatible', false);\n\n clack.log.warn(\n `Angular version ${chalk.cyan(\n MIN_SUPPORTED_ANGULAR_VERSION,\n )} or higher is required for the Sentry SDK.`,\n );\n clack.log.warn(\n `Please refer to Sentry's version compatibility table for more information:\n\n${chalk.underline(\n 'https://docs.sentry.io/platforms/javascript/guides/angular/#angular-version-compatibility',\n)}\n`,\n );\n\n return abort('Exiting the wizard.', 0);\n }\n\n if (!wizardSupportsAngularVersion) {\n Sentry.setTag('angular-wizard-version-compatible', false);\n\n clack.log.warn(\n `The Sentry Angular Wizard requires Angular version ${chalk.cyan(\n MIN_SUPPORTED_WIZARD_ANGULAR_VERSION,\n )} or higher.`,\n );\n clack.log.warn(\n `Your Angular version (${installedAngularVersion}) is compatible with the Sentry SDK but you need to set it up manually by following our documentation:\n\n${chalk.underline('https://docs.sentry.io/platforms/javascript/guides/angular')}\n\nApologies for the inconvenience!`,\n );\n\n return abort('Exiting the wizard.', 0);\n }\n\n const projectData = await getOrAskForProjectData(\n options,\n 'javascript-angular',\n );\n\n if (projectData.spotlight) {\n clack.log.warn('Spotlight mode is not yet supported for Angular.');\n clack.log.info('Spotlight is currently only available for Next.js.');\n await abort('Exiting wizard', 0);\n return;\n }\n\n const { selectedProject, authToken, sentryUrl, selfHosted } = projectData;\n\n const dsn = selectedProject.keys[0].dsn.public;\n\n const sdkAlreadyInstalled = hasPackageInstalled(\n '@sentry/angular',\n packageJson,\n );\n\n Sentry.setTag('sdk-already-installed', sdkAlreadyInstalled);\n\n await installPackage({\n packageName: '@sentry/angular@^10',\n packageNameDisplayLabel: '@sentry/angular',\n alreadyInstalled: sdkAlreadyInstalled,\n });\n\n const selectedFeatures = await featureSelectionPrompt([\n {\n id: 'performance',\n prompt: `Do you want to enable ${chalk.bold(\n 'Tracing',\n )} to track the performance of your application?`,\n enabledHint: 'recommended',\n },\n {\n id: 'replay',\n prompt: `Do you want to enable ${chalk.bold(\n 'Sentry Session Replay',\n )} to get a video-like reproduction of errors during a user session?`,\n enabledHint: 'recommended, but increases bundle size',\n },\n {\n id: 'logs',\n prompt: `Do you want to enable ${chalk.bold(\n 'Logs',\n )} to send your application logs to Sentry?`,\n enabledHint: 'recommended',\n },\n ] as const);\n\n await traceStep(\n 'Initialize Sentry on Angular application entry point',\n async () => {\n await initializeSentryOnApplicationEntry(dsn, selectedFeatures);\n },\n );\n\n await traceStep('Update Angular project configuration', async () => {\n await updateAppConfig(installedMinVersion, selectedFeatures.performance);\n });\n\n await traceStep('Setup for sourcemap uploads', async () => {\n await addSourcemapEntryToAngularJSON();\n\n if (!options.preSelectedProject) {\n options.preSelectedProject = {\n authToken,\n selfHosted,\n project: {\n organization: {\n id: selectedProject.organization.id,\n name: selectedProject.organization.name,\n slug: selectedProject.organization.slug,\n },\n id: selectedProject.id,\n slug: selectedProject.slug,\n keys: [\n {\n dsn: {\n public: dsn,\n },\n },\n ],\n },\n };\n\n options.url = sentryUrl;\n }\n\n await runSourcemapsWizard(options, 'angular');\n });\n\n const shouldCreateExampleComponent = await askShouldCreateExampleComponent();\n\n Sentry.setTag('create-example-component', shouldCreateExampleComponent);\n\n if (shouldCreateExampleComponent) {\n await traceStep(\n 'create-example-component',\n async () =>\n await createExampleComponent({\n url: sentryUrl,\n orgSlug: selectedProject.organization.slug,\n projectId: selectedProject.id,\n }),\n );\n }\n\n await traceStep('Run Prettier', async () => {\n await runPrettierIfInstalled({ cwd: undefined });\n });\n\n // Offer optional project-scoped MCP config for Sentry with org and project scope\n await offerProjectScopedMcpConfig(\n selectedProject.organization.slug,\n selectedProject.slug,\n );\n\n clack.outro(buildOutroMessage(shouldCreateExampleComponent));\n}\n\nexport function buildOutroMessage(createdExampleComponent: boolean): string {\n let msg = chalk.green('\\nSuccessfully installed the Sentry Angular SDK!');\n\n if (createdExampleComponent) {\n msg += `\\n\\nYou can validate your setup by starting your dev environment (${chalk.cyan(\n 'ng serve',\n )}) and throwing an error in the example component.`;\n }\n\n msg += `\\n\\nCheck out the SDK documentation for further configuration:\nhttps://docs.sentry.io/platforms/javascript/guides/angular/`;\n\n return msg;\n}\n"]}
1
+ {"version":3,"file":"angular-wizard.js","sourceRoot":"","sources":["../../../src/angular/angular-wizard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CAA+B,GAAE,CAAC;IAE7E,MAAM,CAAC,MAAM,CAAC,0BAA0B,EAAE,4BAA4B,CAAC,CAAC;IAExE,IAAI,4BAA4B,EAAE;QAChC,MAAM,IAAA,qBAAS,EACb,0BAA0B,EAC1B,KAAK,IAAI,EAAE,CACT,MAAM,IAAA,0CAAsB,EAAC;YAC3B,GAAG,EAAE,SAAS;YACd,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC,IAAI;YAC1C,SAAS,EAAE,eAAe,CAAC,EAAE;SAC9B,CAAC,CACL,CAAC;KACH;IAED,MAAM,IAAA,qBAAS,EAAC,cAAc,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,IAAA,8BAAsB,EAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,iFAAiF;IACjF,MAAM,IAAA,wCAA2B,EAC/B,eAAe,CAAC,YAAY,CAAC,IAAI,EACjC,eAAe,CAAC,IAAI,CACrB,CAAC;IAEF,iBAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,4BAA4B,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,SAAgB,iBAAiB,CAAC,uBAAgC;IAChE,IAAI,GAAG,GAAG,eAAK,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAExE,IAAI,uBAAuB,EAAE;QAC3B,GAAG,IAAI,qEAAqE,eAAK,CAAC,IAAI,CACpF,UAAU,CACX,mDAAmD,CAAC;KACtD;IAED,GAAG,IAAI;4DACmD,CAAC;IAE3D,OAAO,GAAG,CAAC;AACb,CAAC;AAbD,8CAaC","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\n\nimport chalk from 'chalk';\nimport type { WizardOptions } from '../utils/types';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport { offerProjectScopedMcpConfig } from '../utils/clack/mcp-config';\nimport {\n abortIfCancelled,\n askShouldCreateExampleComponent,\n confirmContinueIfNoOrDirtyGitRepo,\n ensurePackageIsInstalled,\n featureSelectionPrompt,\n getOrAskForProjectData,\n getPackageDotJson,\n installPackage,\n printWelcome,\n runPrettierIfInstalled,\n abort,\n} from '../utils/clack';\nimport { getPackageVersion, hasPackageInstalled } from '../utils/package-json';\nimport { gte, minVersion, SemVer } from 'semver';\n\nimport * as Sentry from '@sentry/node';\nimport { initializeSentryOnApplicationEntry } from './sdk-setup';\nimport { updateAppConfig } from './sdk-setup';\nimport { runSourcemapsWizard } from '../sourcemaps/sourcemaps-wizard';\nimport { addSourcemapEntryToAngularJSON } from './codemods/sourcemaps';\nimport { createExampleComponent } from './example-component';\nimport { abortIfSpotlightNotSupported } from '../utils/abort-if-sportlight-not-supported';\n\nconst MIN_SUPPORTED_ANGULAR_VERSION = '14.0.0';\nconst MIN_SUPPORTED_WIZARD_ANGULAR_VERSION = '17.0.0';\n\nexport async function runAngularWizard(options: WizardOptions): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'angular',\n wizardOptions: options,\n },\n () => runAngularWizardWithTelemetry(options),\n );\n}\n\nasync function runAngularWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Angular Wizard',\n promoCode: options.promoCode,\n telemetryEnabled: options.telemetryEnabled,\n });\n\n await confirmContinueIfNoOrDirtyGitRepo({\n ignoreGitChanges: options.ignoreGitChanges,\n cwd: undefined,\n });\n\n const packageJson = await getPackageDotJson();\n\n await ensurePackageIsInstalled(packageJson, '@angular/core', 'Angular');\n\n let installedAngularVersion = getPackageVersion('@angular/core', packageJson);\n\n if (!installedAngularVersion) {\n clack.log.warn('Could not determine installed Angular version.');\n\n installedAngularVersion = await abortIfCancelled(\n clack.text({\n message: `Please enter your installed Angular major version (e.g. ${chalk.cyan(\n '18',\n )} for Angular 18)`,\n validate(value) {\n if (!value) {\n return 'Angular version is required';\n }\n\n try {\n if (!minVersion(value)) {\n return `Invalid Angular version provided: ${value}`;\n }\n } catch (error) {\n return `Invalid Angular version provided: ${value}`;\n }\n },\n }),\n );\n }\n\n Sentry.setTag('angular-version', installedAngularVersion);\n\n const installedMinVersion = minVersion(installedAngularVersion) as SemVer;\n\n const sdkSupportsAngularVersion = gte(\n installedMinVersion,\n MIN_SUPPORTED_ANGULAR_VERSION,\n );\n\n const wizardSupportsAngularVersion = gte(\n installedMinVersion,\n MIN_SUPPORTED_WIZARD_ANGULAR_VERSION,\n );\n\n if (!sdkSupportsAngularVersion) {\n Sentry.setTag('angular-version-compatible', false);\n\n clack.log.warn(\n `Angular version ${chalk.cyan(\n MIN_SUPPORTED_ANGULAR_VERSION,\n )} or higher is required for the Sentry SDK.`,\n );\n clack.log.warn(\n `Please refer to Sentry's version compatibility table for more information:\n\n${chalk.underline(\n 'https://docs.sentry.io/platforms/javascript/guides/angular/#angular-version-compatibility',\n)}\n`,\n );\n\n return abort('Exiting the wizard.', 0);\n }\n\n if (!wizardSupportsAngularVersion) {\n Sentry.setTag('angular-wizard-version-compatible', false);\n\n clack.log.warn(\n `The Sentry Angular Wizard requires Angular version ${chalk.cyan(\n MIN_SUPPORTED_WIZARD_ANGULAR_VERSION,\n )} or higher.`,\n );\n clack.log.warn(\n `Your Angular version (${installedAngularVersion}) is compatible with the Sentry SDK but you need to set it up manually by following our documentation:\n\n${chalk.underline('https://docs.sentry.io/platforms/javascript/guides/angular')}\n\nApologies for the inconvenience!`,\n );\n\n return abort('Exiting the wizard.', 0);\n }\n\n const projectData = await getOrAskForProjectData(\n options,\n 'javascript-angular',\n );\n\n if (projectData.spotlight) {\n return abortIfSpotlightNotSupported('Angular');\n }\n\n const { selectedProject, authToken, sentryUrl, selfHosted } = projectData;\n\n const dsn = selectedProject.keys[0].dsn.public;\n\n const sdkAlreadyInstalled = hasPackageInstalled(\n '@sentry/angular',\n packageJson,\n );\n\n Sentry.setTag('sdk-already-installed', sdkAlreadyInstalled);\n\n await installPackage({\n packageName: '@sentry/angular@^10',\n packageNameDisplayLabel: '@sentry/angular',\n alreadyInstalled: sdkAlreadyInstalled,\n });\n\n const selectedFeatures = await featureSelectionPrompt([\n {\n id: 'performance',\n prompt: `Do you want to enable ${chalk.bold(\n 'Tracing',\n )} to track the performance of your application?`,\n enabledHint: 'recommended',\n },\n {\n id: 'replay',\n prompt: `Do you want to enable ${chalk.bold(\n 'Session Replay',\n )} to get a video-like reproduction of errors during a user session?`,\n enabledHint: 'recommended, but increases bundle size',\n },\n {\n id: 'logs',\n prompt: `Do you want to enable ${chalk.bold(\n 'Logs',\n )} to send your application logs to Sentry?`,\n enabledHint: 'recommended',\n },\n ] as const);\n\n await traceStep(\n 'Initialize Sentry on Angular application entry point',\n async () => {\n await initializeSentryOnApplicationEntry(dsn, selectedFeatures);\n },\n );\n\n await traceStep('Update Angular project configuration', async () => {\n await updateAppConfig(installedMinVersion, selectedFeatures.performance);\n });\n\n await traceStep('Setup for sourcemap uploads', async () => {\n await addSourcemapEntryToAngularJSON();\n\n if (!options.preSelectedProject) {\n options.preSelectedProject = {\n authToken,\n selfHosted,\n project: {\n organization: {\n id: selectedProject.organization.id,\n name: selectedProject.organization.name,\n slug: selectedProject.organization.slug,\n },\n id: selectedProject.id,\n slug: selectedProject.slug,\n keys: [\n {\n dsn: {\n public: dsn,\n },\n },\n ],\n },\n };\n\n options.url = sentryUrl;\n }\n\n await runSourcemapsWizard(options, 'angular');\n });\n\n const shouldCreateExampleComponent = await askShouldCreateExampleComponent();\n\n Sentry.setTag('create-example-component', shouldCreateExampleComponent);\n\n if (shouldCreateExampleComponent) {\n await traceStep(\n 'create-example-component',\n async () =>\n await createExampleComponent({\n url: sentryUrl,\n orgSlug: selectedProject.organization.slug,\n projectId: selectedProject.id,\n }),\n );\n }\n\n await traceStep('Run Prettier', async () => {\n await runPrettierIfInstalled({ cwd: undefined });\n });\n\n // Offer optional project-scoped MCP config for Sentry with org and project scope\n await offerProjectScopedMcpConfig(\n selectedProject.organization.slug,\n selectedProject.slug,\n );\n\n clack.outro(buildOutroMessage(shouldCreateExampleComponent));\n}\n\nexport function buildOutroMessage(createdExampleComponent: boolean): string {\n let msg = chalk.green('Successfully installed the Sentry Angular SDK!');\n\n if (createdExampleComponent) {\n msg += `\\n\\nYou can validate your setup by starting your dev environment (${chalk.cyan(\n 'ng serve',\n )}) and throwing an error in the example component.`;\n }\n\n msg += `\\n\\nCheck out the SDK documentation for further configuration:\nhttps://docs.sentry.io/platforms/javascript/guides/angular/`;\n\n return msg;\n}\n"]}
@@ -58,7 +58,7 @@ Skipping adding Sentry functionality to ${chalk_1.default.cyan(appEntryFilename)
58
58
  ${chalk_1.default.underline('https://docs.sentry.io/platforms/javascript/guides/angular/#configure')}`);
59
59
  return;
60
60
  }
61
- prompts_1.default.log.success(`Successfully initialized Sentry on ${chalk_1.default.cyan(appEntryFilename)}`);
61
+ prompts_1.default.log.success(`Successfully initialized Sentry in ${chalk_1.default.cyan(appEntryFilename)}`);
62
62
  }
63
63
  exports.initializeSentryOnApplicationEntry = initializeSentryOnApplicationEntry;
64
64
  async function updateAppConfig(angularVersion, isTracingEnabled) {
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-setup.js","sourceRoot":"","sources":["../../../src/angular/sdk-setup.ts"],"names":[],"mappings":";AAAA,4DAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5D,kFAAkF;AAClF,uCAA+C;AAE/C,uCAAyB;AACzB,2CAA6B;AAE7B,+EAA+E;AAC/E,6DAAmC;AACnC,kDAA0B;AAC1B,sDAA2D;AAC3D,0CAAoD;AACpD,kDAAsD;AACtD,qDAAuC;AAKhC,KAAK,UAAU,kCAAkC,CACtD,GAAW,EACX,gBAIC;IAED,MAAM,gBAAgB,GAAG,SAAS,CAAC;IACnC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAEvE,MAAM,gBAAgB,GAAG,MAAM,IAAA,mBAAQ,EAAC,YAAY,CAAC,CAAC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ACR;IAED,iBAAK,CAAC,GAAG,CAAC,OAAO,CACf,wCAAwC,eAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CACxE,CAAC;AACJ,CAAC;AA5ED,0CA4EC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n\n// @ts-expect-error - magicast is ESM and TS complains about that. It works though\nimport { loadFile, writeFile } from 'magicast';\n\nimport * as fs from 'fs';\nimport * as path from 'path';\n\n// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport { updateAppConfigMod } from './codemods/app-config';\nimport { updateAppEntryMod } from './codemods/main';\nimport { hasSentryContent } from '../utils/ast-utils';\nimport * as Sentry from '@sentry/node';\n\nimport type { namedTypes as t } from 'ast-types';\nimport type { SemVer } from 'semver';\n\nexport async function initializeSentryOnApplicationEntry(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n replay: boolean;\n logs: boolean;\n },\n): Promise<void> {\n const appEntryFilename = 'main.ts';\n const appEntryPath = path.join(process.cwd(), 'src', appEntryFilename);\n\n const originalAppEntry = await loadFile(appEntryPath);\n\n if (hasSentryContent(originalAppEntry.$ast as t.Program)) {\n clack.log.warn(\n `File ${chalk.cyan(appEntryFilename)} already contains Sentry.\nSkipping adding Sentry functionality to ${chalk.cyan(appEntryFilename)}.`,\n );\n\n return;\n }\n\n const updatedAppEntryMod = updateAppEntryMod(\n originalAppEntry,\n dsn,\n selectedFeatures,\n );\n\n try {\n await writeFile(updatedAppEntryMod.$ast, appEntryPath);\n } catch (error: unknown) {\n clack.log.error(\n `Error while adding Sentry to ${chalk.cyan(appEntryFilename)}`,\n );\n\n clack.log.warn(\n `Please refer to the documentation for manual setup:\n${chalk.underline(\n 'https://docs.sentry.io/platforms/javascript/guides/angular/#configure',\n)}`,\n );\n\n return;\n }\n\n clack.log.success(\n `Successfully initialized Sentry on ${chalk.cyan(appEntryFilename)}`,\n );\n}\n\nexport async function updateAppConfig(\n angularVersion: SemVer,\n isTracingEnabled: boolean,\n): Promise<void> {\n const appConfigFilename = 'app.config.ts';\n const appConfigPath = path.join(\n process.cwd(),\n 'src',\n 'app',\n appConfigFilename,\n );\n\n if (!fs.existsSync(appConfigPath)) {\n Sentry.setTag('angular-app-config-found', false);\n\n clack.log.warn(\n `File ${chalk.cyan(\n appConfigFilename,\n )} not found. Skipping adding Sentry functionality.`,\n );\n\n clack.log.warn(`Please refer to the documentation for manual setup:\n${chalk.underline(\n 'https://docs.sentry.io/platforms/javascript/guides/angular/#configure',\n)}`);\n\n return;\n }\n\n Sentry.setTag('angular-app-config-found', true);\n\n const appConfig = await loadFile(appConfigPath);\n\n if (hasSentryContent(appConfig.$ast as t.Program)) {\n clack.log.warn(\n `File ${chalk.cyan(appConfigFilename)} already contains Sentry.\n Skipping adding Sentry functionality to ${chalk.cyan(appConfigFilename)}.`,\n );\n\n return;\n }\n\n try {\n const updatedAppConfigMod = updateAppConfigMod(\n appConfig,\n angularVersion,\n isTracingEnabled,\n );\n\n await writeFile(updatedAppConfigMod.$ast, appConfigPath);\n } catch (error: unknown) {\n clack.log.error(\n `Error while updating your app config ${chalk.cyan(appConfigFilename)}.`,\n );\n\n clack.log.info(\n chalk.dim(\n typeof error === 'object' && error != null && 'toString' in error\n ? error.toString()\n : typeof error === 'string'\n ? error\n : '',\n ),\n );\n\n clack.log.warn(`Please refer to the documentation for manual setup:\n${chalk.underline(\n 'https://docs.sentry.io/platforms/javascript/guides/angular/#configure',\n)}`);\n\n return;\n }\n\n clack.log.success(\n `Successfully updated your app config ${chalk.cyan(appConfigFilename)}`,\n );\n}\n"]}
1
+ {"version":3,"file":"sdk-setup.js","sourceRoot":"","sources":["../../../src/angular/sdk-setup.ts"],"names":[],"mappings":";AAAA,4DAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5D,kFAAkF;AAClF,uCAA+C;AAE/C,uCAAyB;AACzB,2CAA6B;AAE7B,+EAA+E;AAC/E,6DAAmC;AACnC,k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KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,IAAI,UAAU,IAAI,KAAK;YAC/D,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE;YAClB,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ;gBAC3B,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,EAAE,CACP,CACF,CAAC;QAEF,iBAAK,CAAC,GAAG,CAAC,IAAI,CAAC;EACjB,eAAK,CAAC,SAAS,CACf,uEAAuE,CACxE,EAAE,CAAC,CAAC;QAED,OAAO;KACR;IAED,iBAAK,CAAC,GAAG,CAAC,OAAO,CACf,wCAAwC,eAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CACxE,CAAC;AACJ,CAAC;AA5ED,0CA4EC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n\n// @ts-expect-error - magicast is ESM and TS complains about that. It works though\nimport { loadFile, writeFile } from 'magicast';\n\nimport * as fs from 'fs';\nimport * as path from 'path';\n\n// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport { updateAppConfigMod } from './codemods/app-config';\nimport { updateAppEntryMod } from './codemods/main';\nimport { hasSentryContent } from '../utils/ast-utils';\nimport * as Sentry from '@sentry/node';\n\nimport type { namedTypes as t } from 'ast-types';\nimport type { SemVer } from 'semver';\n\nexport async function initializeSentryOnApplicationEntry(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n replay: boolean;\n logs: boolean;\n },\n): Promise<void> {\n const appEntryFilename = 'main.ts';\n const appEntryPath = path.join(process.cwd(), 'src', appEntryFilename);\n\n const originalAppEntry = await loadFile(appEntryPath);\n\n if (hasSentryContent(originalAppEntry.$ast as t.Program)) {\n clack.log.warn(\n `File ${chalk.cyan(appEntryFilename)} already contains Sentry.\nSkipping adding Sentry functionality to ${chalk.cyan(appEntryFilename)}.`,\n );\n\n return;\n }\n\n const updatedAppEntryMod = updateAppEntryMod(\n originalAppEntry,\n dsn,\n selectedFeatures,\n );\n\n try {\n await writeFile(updatedAppEntryMod.$ast, appEntryPath);\n } catch (error: unknown) {\n clack.log.error(\n `Error while adding Sentry to ${chalk.cyan(appEntryFilename)}`,\n );\n\n clack.log.warn(\n `Please refer to the documentation for manual setup:\n${chalk.underline(\n 'https://docs.sentry.io/platforms/javascript/guides/angular/#configure',\n)}`,\n );\n\n return;\n }\n\n clack.log.success(\n `Successfully initialized Sentry in ${chalk.cyan(appEntryFilename)}`,\n );\n}\n\nexport async function updateAppConfig(\n angularVersion: SemVer,\n isTracingEnabled: boolean,\n): Promise<void> {\n const appConfigFilename = 'app.config.ts';\n const appConfigPath = path.join(\n process.cwd(),\n 'src',\n 'app',\n appConfigFilename,\n );\n\n if (!fs.existsSync(appConfigPath)) {\n Sentry.setTag('angular-app-config-found', false);\n\n clack.log.warn(\n `File ${chalk.cyan(\n appConfigFilename,\n )} not found. Skipping adding Sentry functionality.`,\n );\n\n clack.log.warn(`Please refer to the documentation for manual setup:\n${chalk.underline(\n 'https://docs.sentry.io/platforms/javascript/guides/angular/#configure',\n)}`);\n\n return;\n }\n\n Sentry.setTag('angular-app-config-found', true);\n\n const appConfig = await loadFile(appConfigPath);\n\n if (hasSentryContent(appConfig.$ast as t.Program)) {\n clack.log.warn(\n `File ${chalk.cyan(appConfigFilename)} already contains Sentry.\n Skipping adding Sentry functionality to ${chalk.cyan(appConfigFilename)}.`,\n );\n\n return;\n }\n\n try {\n const updatedAppConfigMod = updateAppConfigMod(\n appConfig,\n angularVersion,\n isTracingEnabled,\n );\n\n await writeFile(updatedAppConfigMod.$ast, appConfigPath);\n } catch (error: unknown) {\n clack.log.error(\n `Error while updating your app config ${chalk.cyan(appConfigFilename)}.`,\n );\n\n clack.log.info(\n chalk.dim(\n typeof error === 'object' && error != null && 'toString' in error\n ? error.toString()\n : typeof error === 'string'\n ? error\n : '',\n ),\n );\n\n clack.log.warn(`Please refer to the documentation for manual setup:\n${chalk.underline(\n 'https://docs.sentry.io/platforms/javascript/guides/angular/#configure',\n)}`);\n\n return;\n }\n\n clack.log.success(\n `Successfully updated your app config ${chalk.cyan(appConfigFilename)}`,\n );\n}\n"]}
@@ -17,6 +17,7 @@ const configure_sentry_cli_1 = require("./configure-sentry-cli");
17
17
  const configure_xcode_project_1 = require("./configure-xcode-project");
18
18
  const inject_code_snippet_1 = require("./inject-code-snippet");
19
19
  const lookup_xcode_project_1 = require("./lookup-xcode-project");
20
+ const abort_if_sportlight_not_supported_1 = require("../utils/abort-if-sportlight-not-supported");
20
21
  async function runAppleWizard(options) {
21
22
  return (0, telemetry_1.withTelemetry)({
22
23
  enabled: options.telemetryEnabled,
@@ -49,10 +50,7 @@ async function runAppleWizardWithTelementry(options) {
49
50
  // Step - Sentry Project and API Key
50
51
  const projectData = await (0, clack_1.getOrAskForProjectData)(options, 'apple-ios');
51
52
  if (projectData.spotlight) {
52
- prompts_1.default.log.warn('Spotlight mode is not yet supported for Apple/iOS.');
53
- prompts_1.default.log.info('Spotlight is currently only available for Next.js.');
54
- await (0, clack_1.abort)('Exiting wizard', 0);
55
- return;
53
+ return (0, abort_if_sportlight_not_supported_1.abortIfSpotlightNotSupported)('Apple/iOS');
56
54
  }
57
55
  const { selectedProject, authToken } = projectData;
58
56
  // Step - Sentry CLI Configuration Setup
@@ -1 +1 @@
1
- {"version":3,"file":"apple-wizard.js","sourceRoot":"","sources":["../../../src/apple/apple-wizard.ts"],"names":[],"mappings":";;;;;;AAAA,+EAA+E;AAC/E,6DAAmC;AACnC,kDAA0B;AAE1B,4CAA6C;AAC7C,0CAMwB;AACxB,0DAAwE;AACxE,+DAA0D;AAC1D,6DAAyD;AACzD,2EAAsE;AACtE,iEAA4D;AAC5D,uEAAkE;AAClE,+DAA0D;AAC1D,iEAA4D;AAGrD,KAAK,UAAU,cAAc,CAClC,OAA2B;IAE3B,OAAO,IAAA,yBAAa,EAClB;QACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;QACjC,WAAW,EAAE,KAAK;Q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,YAAY,EAAE,GAAG,MAAM,IAAA,mDAAuB,EAAC;QACrD,UAAU;KACX,CAAC,CAAC;IAEH,iCAAiC;IACjC,IAAA,+CAAqB,EAAC;QACpB,SAAS;QACT,OAAO,EAAE,eAAe;QACxB,MAAM;QACN,YAAY;KACb,CAAC,CAAC;IAEH,2BAA2B;IAC3B,MAAM,gBAAgB,GAAG,MAAM,IAAA,8BAAsB,EAAC;QACpD;YACE,EAAE,EAAE,MAAM;YACV,MAAM,EAAE,yBAAyB,eAAK,CAAC,IAAI,CACzC,MAAM,CACP,2CAA2C;YAC5C,WAAW,EAAE,UAAU;SACxB;KACF,CAAC,CAAC;IAEH,0BAA0B;IAC1B,IAAA,uCAAiB,EAAC;QAChB,OAAO,EAAE,SAAS;QAClB,MAAM;QACN,GAAG,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM;QACvC,UAAU,EAAE,gBAAgB,CAAC,IAAI,IAAI,KAAK;KAC3C,CAAC,CAAC;IAEH,gCAAgC;IAChC,MAAM,IAAA,sCAAiB,EAAC;QACtB,UAAU;QACV,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC,IAAI;QAC1C,WAAW,EAAE,eAAe,CAAC,IAAI;KAClC,CAAC,CAAC;IAEH,iFAAiF;IACjF,MAAM,IAAA,wCAA2B,EAC/B,eAAe,CAAC,YAAY,CAAC,IAAI,EACjC,eAAe,CAAC,IAAI,CACrB,CAAC;IAEF,iBAAK,CAAC,GAAG,CAAC,OAAO,CACf,gKAAgK,CACjK,CAAC;AACJ,CAAC","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\n\nimport { withTelemetry } from '../telemetry';\nimport {\n abort,\n confirmContinueIfNoOrDirtyGitRepo,\n featureSelectionPrompt,\n getOrAskForProjectData,\n printWelcome,\n} from '../utils/clack';\nimport { offerProjectScopedMcpConfig } from '../utils/clack/mcp-config';\nimport { checkInstalledCLI } from './check-installed-cli';\nimport { configureFastlane } from './configure-fastlane';\nimport { configurePackageManager } from './configure-package-manager';\nimport { configureSentryCLI } from './configure-sentry-cli';\nimport { configureXcodeProject } from './configure-xcode-project';\nimport { injectCodeSnippet } from './inject-code-snippet';\nimport { lookupXcodeProject } from './lookup-xcode-project';\nimport { AppleWizardOptions } from './options';\n\nexport async function runAppleWizard(\n options: AppleWizardOptions,\n): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'ios',\n wizardOptions: options,\n },\n () => runAppleWizardWithTelementry(options),\n );\n}\n\nasync function runAppleWizardWithTelementry(\n options: AppleWizardOptions,\n): Promise<void> {\n // Define options with defaults\n const projectDir = options.projectDir ?? process.cwd();\n\n // Step - Welcome Message\n printWelcome({\n wizardName: 'Sentry Apple Wizard',\n promoCode: options.promoCode,\n });\n\n // Step - Git Status Check\n await confirmContinueIfNoOrDirtyGitRepo({\n ignoreGitChanges: options.ignoreGitChanges,\n cwd: projectDir,\n });\n\n // Step - Sentry CLI Check\n await checkInstalledCLI();\n\n // Step - Xcode Project Lookup\n // This step should be run before the Sentry Project and API Key step\n // because it can abort the wizard if no Xcode project is found.\n const { xcProject, target } = await lookupXcodeProject({\n projectDir,\n });\n\n // Step - Sentry Project and API Key\n const projectData = await getOrAskForProjectData(options, 'apple-ios');\n\n if (projectData.spotlight) {\n clack.log.warn('Spotlight mode is not yet supported for Apple/iOS.');\n clack.log.info('Spotlight is currently only available for Next.js.');\n await abort('Exiting wizard', 0);\n return;\n }\n\n const { selectedProject, authToken } = projectData;\n\n // Step - Sentry CLI Configuration Setup\n configureSentryCLI({\n projectDir,\n authToken: authToken,\n });\n\n // Step - Set up Package Manager\n const { shouldUseSPM } = await configurePackageManager({\n projectDir,\n });\n\n // Step - Configure Xcode Project\n configureXcodeProject({\n xcProject,\n project: selectedProject,\n target,\n shouldUseSPM,\n });\n\n // Step - Feature Selection\n const selectedFeatures = await featureSelectionPrompt([\n {\n id: 'logs',\n prompt: `Do you want to enable ${chalk.bold(\n 'Logs',\n )} to send your application logs to Sentry?`,\n enabledHint: 'optional',\n },\n ]);\n\n // Step - Add Code Snippet\n injectCodeSnippet({\n project: xcProject,\n target,\n dsn: selectedProject.keys[0].dsn.public,\n enableLogs: selectedFeatures.logs ?? false,\n });\n\n // Step - Fastlane Configuration\n await configureFastlane({\n projectDir,\n orgSlug: selectedProject.organization.slug,\n projectSlug: selectedProject.slug,\n });\n\n // Offer optional project-scoped MCP config for Sentry with org and project scope\n await offerProjectScopedMcpConfig(\n selectedProject.organization.slug,\n selectedProject.slug,\n );\n\n clack.log.success(\n 'Sentry was successfully added to your project! Run your project to send your first event to Sentry. Go to Sentry.io to see whether everything is working fine.',\n );\n}\n"]}
1
+ {"version":3,"file":"apple-wizard.js","sourceRoot":"","sources":["../../../src/apple/apple-wizard.ts"],"names":[],"mappings":";;;;;;AAAA,+EAA+E;AAC/E,6DAAmC;AACnC,kDAA0B;AAE1B,4CAA6C;AAC7C,0CAKwB;AACxB,0DAAwE;AACxE,+DAA0D;AAC1D,6DAAyD;AACzD,2EAAsE;AACtE,iEAA4D;AAC5D,uEAAkE;AAClE,+DAA0D;AAC1D,iEAA4D;AAE5D,kGAA0F;AAEnF,KAAK,UAAU,cAAc,CAClC,OAA2B;IAE3B,OAAO,IAAA,yBAAa,EAClB;QACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;QACjC,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,OAAO;KACvB,EACD,GAAG,EAAE,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAC5C,CAAC;AACJ,CAAC;AAXD,wCAWC;AAED,KAAK,UAAU,4BAA4B,CACzC,OAA2B;IAE3B,+BAA+B;IAC/B,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAEvD,yBAAyB;IACzB,IAAA,oBAAY,EAAC;QACX,UAAU,EAAE,qBAAqB;QACjC,SAAS,EAAE,OA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GAAG,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM;QACvC,UAAU,EAAE,gBAAgB,CAAC,IAAI,IAAI,KAAK;KAC3C,CAAC,CAAC;IAEH,gCAAgC;IAChC,MAAM,IAAA,sCAAiB,EAAC;QACtB,UAAU;QACV,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC,IAAI;QAC1C,WAAW,EAAE,eAAe,CAAC,IAAI;KAClC,CAAC,CAAC;IAEH,iFAAiF;IACjF,MAAM,IAAA,wCAA2B,EAC/B,eAAe,CAAC,YAAY,CAAC,IAAI,EACjC,eAAe,CAAC,IAAI,CACrB,CAAC;IAEF,iBAAK,CAAC,GAAG,CAAC,OAAO,CACf,gKAAgK,CACjK,CAAC;AACJ,CAAC","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\n\nimport { withTelemetry } from '../telemetry';\nimport {\n confirmContinueIfNoOrDirtyGitRepo,\n featureSelectionPrompt,\n getOrAskForProjectData,\n printWelcome,\n} from '../utils/clack';\nimport { offerProjectScopedMcpConfig } from '../utils/clack/mcp-config';\nimport { checkInstalledCLI } from './check-installed-cli';\nimport { configureFastlane } from './configure-fastlane';\nimport { configurePackageManager } from './configure-package-manager';\nimport { configureSentryCLI } from './configure-sentry-cli';\nimport { configureXcodeProject } from './configure-xcode-project';\nimport { injectCodeSnippet } from './inject-code-snippet';\nimport { lookupXcodeProject } from './lookup-xcode-project';\nimport { AppleWizardOptions } from './options';\nimport { abortIfSpotlightNotSupported } from '../utils/abort-if-sportlight-not-supported';\n\nexport async function runAppleWizard(\n options: AppleWizardOptions,\n): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'ios',\n wizardOptions: options,\n },\n () => runAppleWizardWithTelementry(options),\n );\n}\n\nasync function runAppleWizardWithTelementry(\n options: AppleWizardOptions,\n): Promise<void> {\n // Define options with defaults\n const projectDir = options.projectDir ?? process.cwd();\n\n // Step - Welcome Message\n printWelcome({\n wizardName: 'Sentry Apple Wizard',\n promoCode: options.promoCode,\n });\n\n // Step - Git Status Check\n await confirmContinueIfNoOrDirtyGitRepo({\n ignoreGitChanges: options.ignoreGitChanges,\n cwd: projectDir,\n });\n\n // Step - Sentry CLI Check\n await checkInstalledCLI();\n\n // Step - Xcode Project Lookup\n // This step should be run before the Sentry Project and API Key step\n // because it can abort the wizard if no Xcode project is found.\n const { xcProject, target } = await lookupXcodeProject({\n projectDir,\n });\n\n // Step - Sentry Project and API Key\n const projectData = await getOrAskForProjectData(options, 'apple-ios');\n\n if (projectData.spotlight) {\n return abortIfSpotlightNotSupported('Apple/iOS');\n }\n\n const { selectedProject, authToken } = projectData;\n\n // Step - Sentry CLI Configuration Setup\n configureSentryCLI({\n projectDir,\n authToken: authToken,\n });\n\n // Step - Set up Package Manager\n const { shouldUseSPM } = await configurePackageManager({\n projectDir,\n });\n\n // Step - Configure Xcode Project\n configureXcodeProject({\n xcProject,\n project: selectedProject,\n target,\n shouldUseSPM,\n });\n\n // Step - Feature Selection\n const selectedFeatures = await featureSelectionPrompt([\n {\n id: 'logs',\n prompt: `Do you want to enable ${chalk.bold(\n 'Logs',\n )} to send your application logs to Sentry?`,\n enabledHint: 'optional',\n },\n ]);\n\n // Step - Add Code Snippet\n injectCodeSnippet({\n project: xcProject,\n target,\n dsn: selectedProject.keys[0].dsn.public,\n enableLogs: selectedFeatures.logs ?? false,\n });\n\n // Step - Fastlane Configuration\n await configureFastlane({\n projectDir,\n orgSlug: selectedProject.organization.slug,\n projectSlug: selectedProject.slug,\n });\n\n // Offer optional project-scoped MCP config for Sentry with org and project scope\n await offerProjectScopedMcpConfig(\n selectedProject.organization.slug,\n selectedProject.slug,\n );\n\n clack.log.success(\n 'Sentry was successfully added to your project! Run your project to send your first event to Sentry. Go to Sentry.io to see whether everything is working fine.',\n );\n}\n"]}
@@ -34,6 +34,7 @@ const debug_1 = require("../utils/debug");
34
34
  const swiftAppLaunchRegex = /(func\s+application\s*\(\s*_\s+application:\s*[^,]+,\s*didFinishLaunchingWithOptions[^,]+:\s*[^)]+\s*\)\s+->\s+Bool\s+{)|func\s+applicationDidFinishLaunching\s*\(\s*_\s+aNotification:\s+Notification\s*\)\s*{/im;
35
35
  const objcAppLaunchRegex = /-\s*\(\s*BOOL\s*\)\s*application:\s*\(\s*UIApplication\s*\*\s*\)\s*application\s+didFinishLaunchingWithOptions:\s*\(\s*NSDictionary\s*\*\s*\)\s*launchOptions\s*{/im;
36
36
  const swiftUIRegex = /@main\s+struct[^:]+:\s*(SwiftUI\.)?App\s*{/im;
37
+ const swiftUIInitRegex = /\binit\s*\(\s*\)\s*\{/m;
37
38
  function isAppDelegateFile(filePath) {
38
39
  (0, debug_1.debug)('Checking if ' + filePath + ' is an AppDelegate file');
39
40
  const appLaunchRegex = filePath.toLowerCase().endsWith('.swift')
@@ -107,9 +108,22 @@ function addCodeSnippetToProject(files, dsn, enableLogs) {
107
108
  // This branch is not reached, because we already checked for SwiftUI in isAppDelegateFile
108
109
  return false;
109
110
  }
110
- //Is SwiftUI with no init
111
- match = swiftUIMatch;
112
- codeSnippet = ` init() {\n${codeSnippet} }`;
111
+ const afterStructContent = fileContent.slice(swiftUIMatch.index);
112
+ const bodyMatch = /var\s+body\s*:/m.exec(afterStructContent);
113
+ const searchRange = bodyMatch
114
+ ? afterStructContent.slice(0, bodyMatch.index)
115
+ : afterStructContent;
116
+ const initMatch = swiftUIInitRegex.exec(searchRange);
117
+ if (initMatch) {
118
+ match = {
119
+ index: swiftUIMatch.index + initMatch.index,
120
+ 0: initMatch[0],
121
+ };
122
+ }
123
+ else {
124
+ match = swiftUIMatch;
125
+ codeSnippet = ` init() {\n${codeSnippet} }`;
126
+ }
113
127
  }
114
128
  const insertIndex = match.index + match[0].length;
115
129
  let newFileContent = fileContent.slice(0, insertIndex) +