@sentry/wizard 6.12.0 → 6.13.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 (184) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/bin.js +16 -1
  3. package/dist/bin.js.map +1 -1
  4. package/dist/e2e-tests/tests/angular-17.test.js +3 -4
  5. package/dist/e2e-tests/tests/angular-17.test.js.map +1 -1
  6. package/dist/e2e-tests/tests/angular-19.test.js +3 -4
  7. package/dist/e2e-tests/tests/angular-19.test.js.map +1 -1
  8. package/dist/e2e-tests/tests/flutter.test.js +60 -0
  9. package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
  10. package/dist/e2e-tests/tests/help-message.test.js +8 -3
  11. package/dist/e2e-tests/tests/help-message.test.js.map +1 -1
  12. package/dist/e2e-tests/tests/nuxt-3.test.js +12 -6
  13. package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
  14. package/dist/e2e-tests/tests/nuxt-4.test.js +12 -6
  15. package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
  16. package/dist/e2e-tests/tests/pnpm-workspace.test.js +6 -3
  17. package/dist/e2e-tests/tests/pnpm-workspace.test.js.map +1 -1
  18. package/dist/e2e-tests/tests/react-router-instrumentation-api.test.js +4 -4
  19. package/dist/e2e-tests/tests/react-router-instrumentation-api.test.js.map +1 -1
  20. package/dist/e2e-tests/tests/react-router.test.js +3 -6
  21. package/dist/e2e-tests/tests/react-router.test.js.map +1 -1
  22. package/dist/e2e-tests/tests/remix.test.js +2 -4
  23. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  24. package/dist/e2e-tests/tests/sveltekit-hooks.test.js +24 -8
  25. package/dist/e2e-tests/tests/sveltekit-hooks.test.js.map +1 -1
  26. package/dist/e2e-tests/tests/sveltekit-tracing.test.js +6 -3
  27. package/dist/e2e-tests/tests/sveltekit-tracing.test.js.map +1 -1
  28. package/dist/lib/Constants.d.ts +1 -0
  29. package/dist/lib/Constants.js +5 -0
  30. package/dist/lib/Constants.js.map +1 -1
  31. package/dist/lib/Steps/Integrations/Electron.js +2 -2
  32. package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
  33. package/dist/src/android/android-wizard.js +3 -0
  34. package/dist/src/android/android-wizard.js.map +1 -1
  35. package/dist/src/angular/codemods/main.d.ts +1 -1
  36. package/dist/src/angular/codemods/main.js +0 -1
  37. package/dist/src/angular/codemods/main.js.map +1 -1
  38. package/dist/src/apple/apple-wizard.js +2 -3
  39. package/dist/src/apple/apple-wizard.js.map +1 -1
  40. package/dist/src/apple/check-installed-cli.d.ts +1 -1
  41. package/dist/src/apple/check-installed-cli.js +13 -7
  42. package/dist/src/apple/check-installed-cli.js.map +1 -1
  43. package/dist/src/apple/configure-xcode-project.js +8 -1
  44. package/dist/src/apple/configure-xcode-project.js.map +1 -1
  45. package/dist/src/apple/lookup-xcode-project.d.ts +8 -5
  46. package/dist/src/apple/lookup-xcode-project.js +22 -17
  47. package/dist/src/apple/lookup-xcode-project.js.map +1 -1
  48. package/dist/src/apple/options.d.ts +5 -0
  49. package/dist/src/apple/options.js.map +1 -1
  50. package/dist/src/apple/sentry-swift-package.d.ts +4 -0
  51. package/dist/src/apple/sentry-swift-package.js +17 -0
  52. package/dist/src/apple/sentry-swift-package.js.map +1 -0
  53. package/dist/src/apple/snapshots/apple-snapshots-wizard.d.ts +2 -0
  54. package/dist/src/apple/snapshots/apple-snapshots-wizard.js +251 -0
  55. package/dist/src/apple/snapshots/apple-snapshots-wizard.js.map +1 -0
  56. package/dist/src/apple/snapshots/configure-snapshotpreviews-xcode-project.d.ts +13 -0
  57. package/dist/src/apple/snapshots/configure-snapshotpreviews-xcode-project.js +48 -0
  58. package/dist/src/apple/snapshots/configure-snapshotpreviews-xcode-project.js.map +1 -0
  59. package/dist/src/apple/snapshots/snapshot-test-file.d.ts +18 -0
  60. package/dist/src/apple/snapshots/snapshot-test-file.js +122 -0
  61. package/dist/src/apple/snapshots/snapshot-test-file.js.map +1 -0
  62. package/dist/src/apple/snapshots/snapshot-verification-scheme.d.ts +6 -0
  63. package/dist/src/apple/snapshots/snapshot-verification-scheme.js +147 -0
  64. package/dist/src/apple/snapshots/snapshot-verification-scheme.js.map +1 -0
  65. package/dist/src/apple/snapshots/snapshotpreviews-package.d.ts +4 -0
  66. package/dist/src/apple/snapshots/snapshotpreviews-package.js +8 -0
  67. package/dist/src/apple/snapshots/snapshotpreviews-package.js.map +1 -0
  68. package/dist/src/apple/snapshots/snapshots-cli-preflight.d.ts +23 -0
  69. package/dist/src/apple/snapshots/snapshots-cli-preflight.js +136 -0
  70. package/dist/src/apple/snapshots/snapshots-cli-preflight.js.map +1 -0
  71. package/dist/src/apple/xcode-manager.d.ts +59 -1
  72. package/dist/src/apple/xcode-manager.js +507 -106
  73. package/dist/src/apple/xcode-manager.js.map +1 -1
  74. package/dist/src/flutter/flutter-wizard.js +3 -0
  75. package/dist/src/flutter/flutter-wizard.js.map +1 -1
  76. package/dist/src/nextjs/templates.js +12 -6
  77. package/dist/src/nextjs/templates.js.map +1 -1
  78. package/dist/src/nuxt/templates.js +12 -6
  79. package/dist/src/nuxt/templates.js.map +1 -1
  80. package/dist/src/react-router/codemods/client.entry.d.ts +1 -1
  81. package/dist/src/react-router/codemods/client.entry.js +93 -52
  82. package/dist/src/react-router/codemods/client.entry.js.map +1 -1
  83. package/dist/src/react-router/codemods/server-entry.js +8 -7
  84. package/dist/src/react-router/codemods/server-entry.js.map +1 -1
  85. package/dist/src/react-router/react-router-wizard.js +13 -19
  86. package/dist/src/react-router/react-router-wizard.js.map +1 -1
  87. package/dist/src/react-router/sdk-setup.d.ts +2 -2
  88. package/dist/src/react-router/sdk-setup.js +16 -15
  89. package/dist/src/react-router/sdk-setup.js.map +1 -1
  90. package/dist/src/react-router/templates.d.ts +1 -3
  91. package/dist/src/react-router/templates.js +24 -92
  92. package/dist/src/react-router/templates.js.map +1 -1
  93. package/dist/src/remix/sdk-setup.js +1 -2
  94. package/dist/src/remix/sdk-setup.js.map +1 -1
  95. package/dist/src/run.d.ts +4 -1
  96. package/dist/src/run.js +13 -0
  97. package/dist/src/run.js.map +1 -1
  98. package/dist/src/sourcemaps/tools/remix.js +4 -4
  99. package/dist/src/sourcemaps/tools/remix.js.map +1 -1
  100. package/dist/src/sveltekit/sdk-setup/setup.js +17 -4
  101. package/dist/src/sveltekit/sdk-setup/setup.js.map +1 -1
  102. package/dist/src/sveltekit/templates.js +12 -6
  103. package/dist/src/sveltekit/templates.js.map +1 -1
  104. package/dist/src/utils/clack/index.d.ts +2 -1
  105. package/dist/src/utils/clack/index.js +17 -6
  106. package/dist/src/utils/clack/index.js.map +1 -1
  107. package/dist/src/utils/files.d.ts +2 -0
  108. package/dist/src/utils/files.js +58 -0
  109. package/dist/src/utils/files.js.map +1 -0
  110. package/dist/src/utils/git.d.ts +3 -1
  111. package/dist/src/utils/git.js +2 -1
  112. package/dist/src/utils/git.js.map +1 -1
  113. package/dist/src/utils/line-endings.d.ts +1 -0
  114. package/dist/src/utils/line-endings.js +76 -0
  115. package/dist/src/utils/line-endings.js.map +1 -0
  116. package/dist/src/version.d.ts +1 -1
  117. package/dist/src/version.js +1 -1
  118. package/dist/src/version.js.map +1 -1
  119. package/dist/test/angular/angular-wizard.test.js +0 -5
  120. package/dist/test/angular/angular-wizard.test.js.map +1 -1
  121. package/dist/test/apple/lookup-xcode-project.test.js +167 -0
  122. package/dist/test/apple/lookup-xcode-project.test.js.map +1 -0
  123. package/dist/test/apple/snapshots/apple-snapshots-wizard.test.d.ts +1 -0
  124. package/dist/test/apple/snapshots/apple-snapshots-wizard.test.js +487 -0
  125. package/dist/test/apple/snapshots/apple-snapshots-wizard.test.js.map +1 -0
  126. package/dist/test/apple/snapshots/hosted-test-target-fixture.d.ts +24 -0
  127. package/dist/test/apple/snapshots/hosted-test-target-fixture.js +191 -0
  128. package/dist/test/apple/snapshots/hosted-test-target-fixture.js.map +1 -0
  129. package/dist/test/apple/snapshots/snapshot-test-file.test.d.ts +1 -0
  130. package/dist/test/apple/snapshots/snapshot-test-file.test.js +110 -0
  131. package/dist/test/apple/snapshots/snapshot-test-file.test.js.map +1 -0
  132. package/dist/test/apple/snapshots/snapshot-verification-scheme.test.d.ts +1 -0
  133. package/dist/test/apple/snapshots/snapshot-verification-scheme.test.js +146 -0
  134. package/dist/test/apple/snapshots/snapshot-verification-scheme.test.js.map +1 -0
  135. package/dist/test/apple/snapshots/snapshotpreviews-xcode-smoke.test.d.ts +1 -0
  136. package/dist/test/apple/snapshots/snapshotpreviews-xcode-smoke.test.js +186 -0
  137. package/dist/test/apple/snapshots/snapshotpreviews-xcode-smoke.test.js.map +1 -0
  138. package/dist/test/apple/snapshots/snapshots-cli-preflight.test.d.ts +1 -0
  139. package/dist/test/apple/snapshots/snapshots-cli-preflight.test.js +192 -0
  140. package/dist/test/apple/snapshots/snapshots-cli-preflight.test.js.map +1 -0
  141. package/dist/test/apple/snapshots/source-file-insertion.test.d.ts +1 -0
  142. package/dist/test/apple/snapshots/source-file-insertion.test.js +77 -0
  143. package/dist/test/apple/snapshots/source-file-insertion.test.js.map +1 -0
  144. package/dist/test/apple/xcode-manager.test.js +452 -43
  145. package/dist/test/apple/xcode-manager.test.js.map +1 -1
  146. package/dist/test/constants.test.d.ts +1 -0
  147. package/dist/test/constants.test.js +12 -0
  148. package/dist/test/constants.test.js.map +1 -0
  149. package/dist/test/nextjs/templates.test.js +66 -33
  150. package/dist/test/nextjs/templates.test.js.map +1 -1
  151. package/dist/test/nuxt/templates.test.js +66 -36
  152. package/dist/test/nuxt/templates.test.js.map +1 -1
  153. package/dist/test/react-router/codemods/client-entry.test.js +15 -11
  154. package/dist/test/react-router/codemods/client-entry.test.js.map +1 -1
  155. package/dist/test/react-router/codemods/server-entry.test.js +21 -8
  156. package/dist/test/react-router/codemods/server-entry.test.js.map +1 -1
  157. package/dist/test/react-router/sdk-setup.test.js +46 -10
  158. package/dist/test/react-router/sdk-setup.test.js.map +1 -1
  159. package/dist/test/react-router/templates.test.js +26 -64
  160. package/dist/test/react-router/templates.test.js.map +1 -1
  161. package/dist/test/remix/build-script.test.d.ts +1 -0
  162. package/dist/test/remix/build-script.test.js +124 -0
  163. package/dist/test/remix/build-script.test.js.map +1 -0
  164. package/dist/test/remix/client-entry.test.js +4 -10
  165. package/dist/test/remix/client-entry.test.js.map +1 -1
  166. package/dist/test/run.test.d.ts +1 -0
  167. package/dist/test/run.test.js +137 -0
  168. package/dist/test/run.test.js.map +1 -0
  169. package/dist/test/sveltekit/templates.test.js +78 -27
  170. package/dist/test/sveltekit/templates.test.js.map +1 -1
  171. package/dist/test/utils/clack/index.test.js +101 -0
  172. package/dist/test/utils/clack/index.test.js.map +1 -1
  173. package/dist/test/utils/git.test.js +10 -0
  174. package/dist/test/utils/git.test.js.map +1 -1
  175. package/dist/test/utils/line-endings.test.d.ts +1 -0
  176. package/dist/test/utils/line-endings.test.js +103 -0
  177. package/dist/test/utils/line-endings.test.js.map +1 -0
  178. package/package.json +2 -2
  179. package/dist/src/react-router/codemods/root.d.ts +0 -1
  180. package/dist/src/react-router/codemods/root.js +0 -170
  181. package/dist/src/react-router/codemods/root.js.map +0 -1
  182. package/dist/test/react-router/codemods/root.test.js +0 -182
  183. package/dist/test/react-router/codemods/root.test.js.map +0 -1
  184. /package/dist/test/{react-router/codemods/root.test.d.ts → apple/lookup-xcode-project.test.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.13.0
4
+
5
+ ### Fixes
6
+
7
+ - fix(remix): Use `npx @sentry/remix --upload-sourcemaps` instead of `sentry-upload-sourcemaps` to avoid global bin collisions
8
+ - fix(all): Update `userInfo` data collection to be opt-out by default — generated code now shows `// dataCollection: { userInfo: false }` commented out instead of `dataCollection: { userInfo: true }`
9
+ - fix(all): Update `dataCollection` opt-out hint to include `httpBodies`
10
+ - fix(all): Use an empty `dataCollection` object in generated snippets instead of fully commenting it out
11
+
12
+ ### Features
13
+
14
+ - feat(apple): Add Apple Snapshots wizard for SnapshotPreviews Xcode setup
15
+ - feat(react-router): Use the stabilized instrumentation API (`createSentryServerInstrumentation` + `reactRouterTracingIntegration().clientInstrumentation`) instead of the experimental `useInstrumentationAPI` flag
16
+ - feat(react-router): Use `sentryOnError` on `HydratedRouter` instead of mutating `root.tsx` ErrorBoundary
17
+
3
18
  ## 6.12.0
4
19
 
5
20
  ### Features
package/dist/bin.js CHANGED
@@ -73,7 +73,7 @@ const PRESELECTED_PROJECT_OPTIONS = {
73
73
  };
74
74
  const xcodeProjectDirOption = {
75
75
  default: undefined,
76
- describe: 'Path to the project containing the Xcode project file. Only applies to the Apple wizard.',
76
+ describe: 'Path to the project containing the Xcode project file. Applies to the Apple and Apple Snapshots wizards.',
77
77
  type: 'string',
78
78
  // This is a hidden option because it is used as an internal option
79
79
  hidden: true,
@@ -101,6 +101,11 @@ const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv), process.
101
101
  describe: 'Do not fallback to prompting user asking questions\nenv: SENTRY_WIZARD_QUIET',
102
102
  type: 'boolean',
103
103
  },
104
+ 'non-interactive': {
105
+ default: false,
106
+ describe: 'Run in non-interactive mode, useful for agentic setup',
107
+ type: 'boolean',
108
+ },
104
109
  i: {
105
110
  alias: 'integration',
106
111
  choices: Object.keys(Constants_1.Integration),
@@ -166,6 +171,16 @@ const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv), process.
166
171
  type: 'boolean',
167
172
  },
168
173
  'xcode-project-dir': xcodeProjectDirOption,
174
+ 'app-target': {
175
+ default: undefined,
176
+ describe: 'Xcode application target that hosts Swift previews.',
177
+ type: 'string',
178
+ },
179
+ 'hosted-test-target': {
180
+ default: undefined,
181
+ describe: 'Hosted XCTest target to configure.',
182
+ type: 'string',
183
+ },
169
184
  ...PRESELECTED_PROJECT_OPTIONS,
170
185
  })
171
186
  // This prevents `yargs` from trying to read the local package.json
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"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C,kBAAkB,EAAE,yBAAyB;QAC7C,OAAO,EAAE,SAAS;KACnB;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,oDAAoD;QAC9D,kBAAkB,EAAE,yCAAyC;QAC7D,IAAI,EAAE,SAAS;KAChB;IACD,CAAC,EAAE;QACD,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,0CAA0C;QACpD,IAAI,EAAE,SAAS;KAChB;IACD,mBAAmB,EAAE;QACnB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,qCAAqC;QAC/C,IAAI,EAAE,SAAS;KAChB;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,YAAY;QACnB,QAAQ,EAAE,iDAAiD;QAC3D,IAAI,EAAE,QAAQ;KACf;IACD,eAAe,EAAE;QACf,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,mCAAmC;QAC7C,IAAI,EAAE,SAAS;KAChB;IACD,oBAAoB,EAAE;QACpB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,mCAAmC;QAC7C,IAAI,EAAE,SAAS;KAChB;IACD,SAAS,EAAE;QACT,OAAO,EAAE,KAAK;QACd,QAAQ,EACN,4FAA4F;QAC9F,IAAI,EAAE,SAAS;KAChB;IACD,mBAAmB,EAAE,qBAAqB;IAC1C,GAAG,2BAA2B;CAC/B,CAAC;IACF,mEAAmE;IACnE,gFAAgF;KAC/E,OAAO,CAAC,wBAAc,CAAC,CAAC,IAAI,CAAC;AAEhC,0FAA0F;AAC1F,sFAAsF;AACtF,mEAAmE;AACnE,KAAK,IAAA,SAAG,EAAC,IAAI,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { satisfies } from 'semver';\nimport { red } from './lib/Helper/Logging';\n\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\n\nconst NODE_VERSION_RANGE = '>=18.20.0';\n\n// Have to run this above the other imports because they are importing clack that\n// has the problematic imports.\nif (!satisfies(process.version, NODE_VERSION_RANGE)) {\n red(\n `Sentry wizard requires Node.js ${NODE_VERSION_RANGE}. You are using Node.js ${process.version}. Please upgrade your Node.js version.`,\n );\n process.exit(1);\n}\n\nimport { Integration, Platform } from './lib/Constants';\nimport { run } from './src/run';\nimport { WIZARD_VERSION } from './src/version';\n\nexport * from './lib/Setup';\n\nconst PRESELECTED_PROJECT_OPTIONS: Record<string, yargs.Options> = {\n 'preSelectedProject.authToken': {\n describe: 'Preselected project auth token',\n hidden: true,\n },\n 'preSelectedProject.selfHosted': {\n describe: 'Preselected project is self-hosted',\n hidden: true,\n },\n 'preSelectedProject.dsn': {\n describe: 'Preselected project DSN',\n hidden: true,\n },\n 'preSelectedProject.id': {\n describe: 'Preselected project id',\n hidden: true,\n },\n 'preSelectedProject.projectSlug': {\n describe: 'Preselected project slug',\n hidden: true,\n },\n 'preSelectedProject.projectName': {\n describe: 'Preselected project name',\n hidden: true,\n },\n 'preSelectedProject.orgId': {\n describe: 'Preselected organization id',\n hidden: true,\n },\n 'preSelectedProject.orgName': {\n describe: 'Preselected organization name',\n hidden: true,\n },\n 'preSelectedProject.orgSlug': {\n describe: 'Preselected organization slug',\n hidden: true,\n },\n};\nconst xcodeProjectDirOption: yargs.Options = {\n default: undefined,\n describe:\n 'Path to the project containing the Xcode project file. Only applies to the Apple wizard.',\n type: 'string',\n // This is a hidden option because it is used as an internal option\n hidden: true,\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\nconst argv = yargs(hideBin(process.argv), process.cwd())\n .options({\n debug: {\n default: false,\n describe: 'Enable verbose logging\\nenv: SENTRY_WIZARD_DEBUG',\n type: 'boolean',\n },\n uninstall: {\n default: false,\n describe: 'Revert project setup process\\nenv: SENTRY_WIZARD_UNINSTALL',\n type: 'boolean',\n },\n 'skip-connect': {\n default: false,\n describe:\n 'Skips the connection to the server\\nenv: SENTRY_WIZARD_SKIP_CONNECT',\n type: 'boolean',\n },\n quiet: {\n default: false,\n describe:\n 'Do not fallback to prompting user asking questions\\nenv: SENTRY_WIZARD_QUIET',\n type: 'boolean',\n },\n i: {\n alias: 'integration',\n choices: Object.keys(Integration),\n describe:\n 'Choose the integration to setup\\nenv: SENTRY_WIZARD_INTEGRATION',\n },\n p: {\n alias: 'platform',\n choices: Object.keys(Platform),\n describe: 'Choose platform(s)\\nenv: SENTRY_WIZARD_PLATFORM',\n type: 'array',\n },\n u: {\n alias: 'url',\n describe: 'The url to your Sentry installation\\nenv: SENTRY_WIZARD_URL',\n },\n project: {\n type: 'string',\n describe: 'The Sentry project slug to use',\n defaultDescription: 'Select project during setup',\n default: undefined,\n },\n org: {\n type: 'string',\n describe: 'The Sentry org slug to use',\n defaultDescription: 'Select org during setup',\n default: undefined,\n },\n saas: {\n default: false,\n describe: 'Skip the self-hosted or SaaS URL selection process',\n defaultDescription: 'Select self-hosted or SaaS during setup',\n type: 'boolean',\n },\n s: {\n alias: 'signup',\n default: false,\n describe: 'Redirect to signup page if not logged in',\n type: 'boolean',\n },\n 'disable-telemetry': {\n default: false,\n describe: \"Don't send telemetry data to Sentry\",\n type: 'boolean',\n },\n 'promo-code': {\n alias: 'promo-code',\n describe: 'A promo code that will be applied during signup',\n type: 'string',\n },\n 'force-install': {\n default: false,\n describe: 'Force install the SDK NPM package',\n type: 'boolean',\n },\n 'ignore-git-changes': {\n default: false,\n describe: 'Ignore git changes in the project',\n type: 'boolean',\n },\n spotlight: {\n default: false,\n describe:\n 'Enable Spotlight for local development. This does not require a Sentry account or project.',\n type: 'boolean',\n },\n 'xcode-project-dir': xcodeProjectDirOption,\n ...PRESELECTED_PROJECT_OPTIONS,\n })\n // This prevents `yargs` from trying to read the local package.json\n // as it's not available in the Node Single Executable Binary artifacts versions\n .version(WIZARD_VERSION).argv;\n\n// @ts-expect-error - for some reason TS doesn't recognize the aliases as valid properties\n// meaning it only knows e.g. u but not url. Maybe a bug in this old version of yargs?\n// Can't upgrade yargs though without dropping support for Node 14.\nvoid run(argv);\n"]}
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../bin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,mCAAmC;AACnC,kDAA2C;AAE3C,kDAA0B;AAC1B,2CAAwC;AAExC,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAEvC,iFAAiF;AACjF,+BAA+B;AAC/B,IAAI,CAAC,IAAA,kBAAS,EAAC,OAAO,CAAC,OAAO,EAAE,kBAAkB,CAAC,EAAE;IACnD,IAAA,aAAG,EACD,kCAAkC,kBAAkB,2BAA2B,OAAO,CAAC,OAAO,wCAAwC,CACvI,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACjB;AAED,+CAAwD;AACxD,mCAAgC;AAChC,2CAA+C;AAE/C,8CAA4B;AAE5B,MAAM,2BAA2B,GAAkC;IACjE,8BAA8B,EAAE;QAC9B,QAAQ,EAAE,gCAAgC;QAC1C,MAAM,EAAE,IAAI;KACb;IACD,+BAA+B,EAAE;QAC/B,QAAQ,EAAE,oCAAoC;QAC9C,MAAM,EAAE,IAAI;KACb;IACD,wBAAwB,EAAE;QACxB,QAAQ,EAAE,yBAAyB;QACnC,MAAM,EAAE,IAAI;KACb;IACD,uBAAuB,EAAE;QACvB,QAAQ,EAAE,wBAAwB;QAClC,MAAM,EAAE,IAAI;KACb;IACD,gCAAgC,EAAE;QAChC,QAAQ,EAAE,0BAA0B;QACpC,MAAM,EAAE,IAAI;KACb;IACD,gCAAgC,EAAE;QAChC,QAAQ,EAAE,0BAA0B;QACpC,MAAM,EAAE,IAAI;KACb;IACD,0BAA0B,EAAE;QAC1B,QAAQ,EAAE,6BAA6B;QACvC,MAAM,EAAE,IAAI;KACb;IACD,4BAA4B,EAAE;QAC5B,QAAQ,EAAE,+BAA+B;QACzC,MAAM,EAAE,IAAI;KACb;IACD,4BAA4B,EAAE;QAC5B,QAAQ,EAAE,+BAA+B;QACzC,MAAM,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AgF;KAC/E,OAAO,CAAC,wBAAc,CAAC,CAAC,IAAI,CAAC;AAEhC,0FAA0F;AAC1F,sFAAsF;AACtF,mEAAmE;AACnE,KAAK,IAAA,SAAG,EAAC,IAAI,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { satisfies } from 'semver';\nimport { red } from './lib/Helper/Logging';\n\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\n\nconst NODE_VERSION_RANGE = '>=18.20.0';\n\n// Have to run this above the other imports because they are importing clack that\n// has the problematic imports.\nif (!satisfies(process.version, NODE_VERSION_RANGE)) {\n red(\n `Sentry wizard requires Node.js ${NODE_VERSION_RANGE}. You are using Node.js ${process.version}. Please upgrade your Node.js version.`,\n );\n process.exit(1);\n}\n\nimport { Integration, Platform } from './lib/Constants';\nimport { run } from './src/run';\nimport { WIZARD_VERSION } from './src/version';\n\nexport * from './lib/Setup';\n\nconst PRESELECTED_PROJECT_OPTIONS: Record<string, yargs.Options> = {\n 'preSelectedProject.authToken': {\n describe: 'Preselected project auth token',\n hidden: true,\n },\n 'preSelectedProject.selfHosted': {\n describe: 'Preselected project is self-hosted',\n hidden: true,\n },\n 'preSelectedProject.dsn': {\n describe: 'Preselected project DSN',\n hidden: true,\n },\n 'preSelectedProject.id': {\n describe: 'Preselected project id',\n hidden: true,\n },\n 'preSelectedProject.projectSlug': {\n describe: 'Preselected project slug',\n hidden: true,\n },\n 'preSelectedProject.projectName': {\n describe: 'Preselected project name',\n hidden: true,\n },\n 'preSelectedProject.orgId': {\n describe: 'Preselected organization id',\n hidden: true,\n },\n 'preSelectedProject.orgName': {\n describe: 'Preselected organization name',\n hidden: true,\n },\n 'preSelectedProject.orgSlug': {\n describe: 'Preselected organization slug',\n hidden: true,\n },\n};\nconst xcodeProjectDirOption: yargs.Options = {\n default: undefined,\n describe:\n 'Path to the project containing the Xcode project file. Applies to the Apple and Apple Snapshots wizards.',\n type: 'string',\n // This is a hidden option because it is used as an internal option\n hidden: true,\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\nconst argv = yargs(hideBin(process.argv), process.cwd())\n .options({\n debug: {\n default: false,\n describe: 'Enable verbose logging\\nenv: SENTRY_WIZARD_DEBUG',\n type: 'boolean',\n },\n uninstall: {\n default: false,\n describe: 'Revert project setup process\\nenv: SENTRY_WIZARD_UNINSTALL',\n type: 'boolean',\n },\n 'skip-connect': {\n default: false,\n describe:\n 'Skips the connection to the server\\nenv: SENTRY_WIZARD_SKIP_CONNECT',\n type: 'boolean',\n },\n quiet: {\n default: false,\n describe:\n 'Do not fallback to prompting user asking questions\\nenv: SENTRY_WIZARD_QUIET',\n type: 'boolean',\n },\n 'non-interactive': {\n default: false,\n describe: 'Run in non-interactive mode, useful for agentic setup',\n type: 'boolean',\n },\n i: {\n alias: 'integration',\n choices: Object.keys(Integration),\n describe:\n 'Choose the integration to setup\\nenv: SENTRY_WIZARD_INTEGRATION',\n },\n p: {\n alias: 'platform',\n choices: Object.keys(Platform),\n describe: 'Choose platform(s)\\nenv: SENTRY_WIZARD_PLATFORM',\n type: 'array',\n },\n u: {\n alias: 'url',\n describe: 'The url to your Sentry installation\\nenv: SENTRY_WIZARD_URL',\n },\n project: {\n type: 'string',\n describe: 'The Sentry project slug to use',\n defaultDescription: 'Select project during setup',\n default: undefined,\n },\n org: {\n type: 'string',\n describe: 'The Sentry org slug to use',\n defaultDescription: 'Select org during setup',\n default: undefined,\n },\n saas: {\n default: false,\n describe: 'Skip the self-hosted or SaaS URL selection process',\n defaultDescription: 'Select self-hosted or SaaS during setup',\n type: 'boolean',\n },\n s: {\n alias: 'signup',\n default: false,\n describe: 'Redirect to signup page if not logged in',\n type: 'boolean',\n },\n 'disable-telemetry': {\n default: false,\n describe: \"Don't send telemetry data to Sentry\",\n type: 'boolean',\n },\n 'promo-code': {\n alias: 'promo-code',\n describe: 'A promo code that will be applied during signup',\n type: 'string',\n },\n 'force-install': {\n default: false,\n describe: 'Force install the SDK NPM package',\n type: 'boolean',\n },\n 'ignore-git-changes': {\n default: false,\n describe: 'Ignore git changes in the project',\n type: 'boolean',\n },\n spotlight: {\n default: false,\n describe:\n 'Enable Spotlight for local development. This does not require a Sentry account or project.',\n type: 'boolean',\n },\n 'xcode-project-dir': xcodeProjectDirOption,\n 'app-target': {\n default: undefined,\n describe: 'Xcode application target that hosts Swift previews.',\n type: 'string',\n },\n 'hosted-test-target': {\n default: undefined,\n describe: 'Hosted XCTest target to configure.',\n type: 'string',\n },\n ...PRESELECTED_PROJECT_OPTIONS,\n })\n // This prevents `yargs` from trying to read the local package.json\n // as it's not available in the Node Single Executable Binary artifacts versions\n .version(WIZARD_VERSION).argv;\n\n// @ts-expect-error - for some reason TS doesn't recognize the aliases as valid properties\n// meaning it only knows e.g. u but not url. Maybe a bug in this old version of yargs?\n// Can't upgrade yargs though without dropping support for Node 14.\nvoid run(argv);\n"]}
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  const Constants_1 = require("../../lib/Constants");
27
27
  const utils_1 = require("../utils");
28
+ const fs = __importStar(require("fs"));
28
29
  const path = __importStar(require("path"));
29
30
  const utils_2 = require("../utils");
30
31
  const vitest_1 = require("vitest");
@@ -151,7 +152,6 @@ function checkAngularProject(projectDir, integration, options) {
151
152
  'replaysSessionSampleRate: 0.1',
152
153
  'replaysOnErrorSampleRate: 1',
153
154
  'enableLogs: true',
154
- 'sendDefaultPii: true',
155
155
  ]);
156
156
  });
157
157
  (0, vitest_1.test)('Sentry is correctly injected into Angular app module', () => {
@@ -177,11 +177,10 @@ function checkAngularProject(projectDir, integration, options) {
177
177
  multi: true`,
178
178
  ]);
179
179
  });
180
- (0, vitest_1.test)('angular.json is updated correctly', async () => {
180
+ (0, vitest_1.test)('angular.json is updated correctly', () => {
181
181
  const angularJsonFile = path.resolve(projectDir, 'angular.json');
182
182
  (0, utils_1.checkFileExists)(angularJsonFile);
183
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
184
- const angularJson = (await import(angularJsonFile));
183
+ const angularJson = JSON.parse(fs.readFileSync(angularJsonFile, 'utf-8'));
185
184
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
186
185
  for (const [, project] of Object.entries(
187
186
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1 +1 @@
1
- {"version":3,"file":"angular-17.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/angular-17.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAkD;AAClD,oCAWkB;AAClB,2CAA6B;AAC7B,oCAAqC;AACrC,mCAAyE;AAEzE,uCAAuC;AACvC,mCAAuC;AAEvC,IAAA,iBAAQ,EAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAA,iBAAQ,EAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,MAAM,WAAW,GAAG,uBAAW,CAAC,OAAO,CAAC;QACxC,IAAI,cAAsB,CAAC;QAE3B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EACnD,qBAAqB,CACtB,CAAC;QAEF,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;YACnB,cAAc,GAAG,MAAM,yBAAyB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;QAEH,IAAA,iBAAQ,EAAC,GAAG,EAAE;YACZ,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;QAEH,IAAA,WAAE,EAAC,wBAAwB,EAAE,GAAG,EAAE;YAChC,IAAA,eAAM,EAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,mBAAmB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,IAAA,iBAAQ,EAAC,+BAA+B,EAAE,GAAG,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EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,IAAA,6BAAqB,EACzB,UAAU,EACV,yCAAyC,CAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAA,4BAAoB,EACxB,UAAU,EACV,yCAAyC,CAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Integration } from '../../lib/Constants';\nimport {\n checkFileContents,\n checkFileDoesNotContain,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n modifyFile,\n} from '../utils';\nimport * as path from 'path';\nimport { TEST_ARGS } from '../utils';\nimport { test, expect, describe, beforeAll, afterAll, it } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('Angular-17', () => {\n describe('with empty project', () => {\n const integration = Integration.angular;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'angular-17-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await runWizardOnAngularProject(projectDir, integration);\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n checkAngularProject(projectDir, integration);\n });\n\n describe('with pre-defined ErrorHandler', () => {\n const integration = Integration.angular;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'angular-17-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await runWizardOnAngularProject(\n projectDir,\n integration,\n (projectDir) => {\n modifyFile(`${projectDir}/src/app/app.config.ts`, {\n 'providers: [': `providers: [{\n provide: ErrorHandler,\n useValue: null\n },\n `,\n });\n },\n );\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n checkAngularProject(projectDir, integration, {\n preExistingErrorHandler: true,\n });\n });\n});\n\nasync function runWizardOnAngularProject(\n projectDir: string,\n integration: Integration,\n fileModificationFn?: (projectDir: string) => unknown,\n): Promise<number> {\n const wizardInteraction = withEnv({\n cwd: projectDir,\n }).defineInteraction();\n\n if (fileModificationFn) {\n fileModificationFn(projectDir);\n\n wizardInteraction\n .whenAsked('Do you want to continue anyway?')\n .respondWith(KEYS.ENTER);\n }\n\n return (\n wizardInteraction\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.ENTER) // npm is the default for Angular\n .expectOutput('Installing @sentry/angular')\n // Installing the sdk can take a while in CI\n .expectOutput('Installed @sentry/angular with NPM.', {\n timeout: 240_000,\n })\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked('Do you want to enable Session Replay')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked('Do you want to enable Logs')\n .respondWith(KEYS.ENTER) // yes\n .expectOutput('initialized Sentry in main.ts', {\n timeout: 10_000,\n })\n .expectOutput('updated your app config app.config.ts')\n .expectOutput('Installing @sentry/cli')\n .expectOutput('Installed @sentry/cli@', {\n timeout: 240_000, // installing Sentry CLI can take a while in CI\n })\n .whenAsked('Where are your build artifacts located?')\n .respondWith(KEYS.ENTER) // ./dist is the default value\n .whenAsked(\n 'We couldn\\'t find build artifacts at \"./dist\". What would you like to do?',\n )\n .respondWith(KEYS.DOWN, KEYS.DOWN, KEYS.ENTER) // Proceed anyway (this is expected)\n .whenAsked(\n 'Do you want to automatically run the sentry:sourcemaps script after each production build?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER) // no - we can't upload in CI when testing building\n .whenAsked(\n 'Are you using a CI/CD tool to build and deploy your application?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Add a step to your CI pipeline that runs the sentry:sourcemaps script right after building your application',\n )\n .respondWith(KEYS.ENTER)\n .expectOutput(\n 'Add the Sentry authentication token as an environment variable to your CI setup:',\n )\n .expectOutput('SENTRY_AUTH_TOKEN=')\n .whenAsked('Did you configure CI as shown above?')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked(\n 'Do you want to create an example component to test your Sentry setup?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('Did you apply the snippet above?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Looks like you have Prettier in your project. Do you want to run it on your files?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Angular SDK!')\n .run(getWizardCommand(integration))\n );\n}\n\nfunction checkAngularProject(\n projectDir: string,\n integration: Integration,\n options?: {\n preExistingErrorHandler?: boolean;\n },\n) {\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/angular');\n\n const packageJsonFile = path.resolve(projectDir, 'package.json');\n checkFileContents(packageJsonFile, [\n `\"sentry:sourcemaps\": \"sentry-cli sourcemaps inject --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist && sentry-cli sourcemaps upload --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist\"`,\n `\"build\": \"ng build\"`,\n ]);\n });\n\n test('Sentry is correctly injected into Angular app config', () => {\n const appConfigFile = path.resolve(projectDir, 'src/main.ts');\n checkFileExists(appConfigFile);\n\n checkFileContents(appConfigFile, [\n `import * as Sentry from \"@sentry/angular\";`,\n 'Sentry.init({',\n TEST_ARGS.PROJECT_DSN,\n 'Sentry.browserTracingIntegration()',\n 'Sentry.replayIntegration()',\n 'tracesSampleRate: 1',\n 'replaysSessionSampleRate: 0.1',\n 'replaysOnErrorSampleRate: 1',\n 'enableLogs: true',\n 'sendDefaultPii: true',\n ]);\n });\n\n test('Sentry is correctly injected into Angular app module', () => {\n const appModuleFile = path.resolve(projectDir, 'src/app/app.config.ts');\n checkFileExists(appModuleFile);\n\n // Checking if the ErrorHandler is already present in the providers array,\n // and if it is, we skip adding it\n if (options?.preExistingErrorHandler) {\n checkFileDoesNotContain(appModuleFile, 'Sentry.createErrorHandler()');\n }\n\n checkFileContents(appModuleFile, [\n `import * as Sentry from \"@sentry/angular\";`,\n options?.preExistingErrorHandler\n ? `provide: ErrorHandler,\n useValue: null`\n : `provide: ErrorHandler,\n useValue: Sentry.createErrorHandler()`,\n `provide: Sentry.TraceService,\n deps: [Router]`,\n `provide: APP_INITIALIZER,\n useFactory: () => () => {},\n deps: [Sentry.TraceService],\n multi: true`,\n ]);\n });\n\n test('angular.json is updated correctly', async () => {\n const angularJsonFile = path.resolve(projectDir, 'angular.json');\n checkFileExists(angularJsonFile);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const angularJson = (await import(angularJsonFile)) as Record<string, any>;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n for (const [, project] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n angularJson.projects as Record<string, any>,\n )) {\n expect(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n project?.architect?.build?.configurations?.production?.sourceMap,\n ).toBe(true);\n }\n });\n\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n}\n"]}
1
+ {"version":3,"file":"angular-17.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/angular-17.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAkD;AAClD,oCAW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CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Integration } from '../../lib/Constants';\nimport {\n checkFileContents,\n checkFileDoesNotContain,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n modifyFile,\n} from '../utils';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { TEST_ARGS } from '../utils';\nimport { test, expect, describe, beforeAll, afterAll, it } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('Angular-17', () => {\n describe('with empty project', () => {\n const integration = Integration.angular;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'angular-17-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await runWizardOnAngularProject(projectDir, integration);\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n checkAngularProject(projectDir, integration);\n });\n\n describe('with pre-defined ErrorHandler', () => {\n const integration = Integration.angular;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'angular-17-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await runWizardOnAngularProject(\n projectDir,\n integration,\n (projectDir) => {\n modifyFile(`${projectDir}/src/app/app.config.ts`, {\n 'providers: [': `providers: [{\n provide: ErrorHandler,\n useValue: null\n },\n `,\n });\n },\n );\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n checkAngularProject(projectDir, integration, {\n preExistingErrorHandler: true,\n });\n });\n});\n\nasync function runWizardOnAngularProject(\n projectDir: string,\n integration: Integration,\n fileModificationFn?: (projectDir: string) => unknown,\n): Promise<number> {\n const wizardInteraction = withEnv({\n cwd: projectDir,\n }).defineInteraction();\n\n if (fileModificationFn) {\n fileModificationFn(projectDir);\n\n wizardInteraction\n .whenAsked('Do you want to continue anyway?')\n .respondWith(KEYS.ENTER);\n }\n\n return (\n wizardInteraction\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.ENTER) // npm is the default for Angular\n .expectOutput('Installing @sentry/angular')\n // Installing the sdk can take a while in CI\n .expectOutput('Installed @sentry/angular with NPM.', {\n timeout: 240_000,\n })\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked('Do you want to enable Session Replay')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked('Do you want to enable Logs')\n .respondWith(KEYS.ENTER) // yes\n .expectOutput('initialized Sentry in main.ts', {\n timeout: 10_000,\n })\n .expectOutput('updated your app config app.config.ts')\n .expectOutput('Installing @sentry/cli')\n .expectOutput('Installed @sentry/cli@', {\n timeout: 240_000, // installing Sentry CLI can take a while in CI\n })\n .whenAsked('Where are your build artifacts located?')\n .respondWith(KEYS.ENTER) // ./dist is the default value\n .whenAsked(\n 'We couldn\\'t find build artifacts at \"./dist\". What would you like to do?',\n )\n .respondWith(KEYS.DOWN, KEYS.DOWN, KEYS.ENTER) // Proceed anyway (this is expected)\n .whenAsked(\n 'Do you want to automatically run the sentry:sourcemaps script after each production build?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER) // no - we can't upload in CI when testing building\n .whenAsked(\n 'Are you using a CI/CD tool to build and deploy your application?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Add a step to your CI pipeline that runs the sentry:sourcemaps script right after building your application',\n )\n .respondWith(KEYS.ENTER)\n .expectOutput(\n 'Add the Sentry authentication token as an environment variable to your CI setup:',\n )\n .expectOutput('SENTRY_AUTH_TOKEN=')\n .whenAsked('Did you configure CI as shown above?')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked(\n 'Do you want to create an example component to test your Sentry setup?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('Did you apply the snippet above?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Looks like you have Prettier in your project. Do you want to run it on your files?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Angular SDK!')\n .run(getWizardCommand(integration))\n );\n}\n\nfunction checkAngularProject(\n projectDir: string,\n integration: Integration,\n options?: {\n preExistingErrorHandler?: boolean;\n },\n) {\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/angular');\n\n const packageJsonFile = path.resolve(projectDir, 'package.json');\n checkFileContents(packageJsonFile, [\n `\"sentry:sourcemaps\": \"sentry-cli sourcemaps inject --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist && sentry-cli sourcemaps upload --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist\"`,\n `\"build\": \"ng build\"`,\n ]);\n });\n\n test('Sentry is correctly injected into Angular app config', () => {\n const appConfigFile = path.resolve(projectDir, 'src/main.ts');\n checkFileExists(appConfigFile);\n\n checkFileContents(appConfigFile, [\n `import * as Sentry from \"@sentry/angular\";`,\n 'Sentry.init({',\n TEST_ARGS.PROJECT_DSN,\n 'Sentry.browserTracingIntegration()',\n 'Sentry.replayIntegration()',\n 'tracesSampleRate: 1',\n 'replaysSessionSampleRate: 0.1',\n 'replaysOnErrorSampleRate: 1',\n 'enableLogs: true',\n ]);\n });\n\n test('Sentry is correctly injected into Angular app module', () => {\n const appModuleFile = path.resolve(projectDir, 'src/app/app.config.ts');\n checkFileExists(appModuleFile);\n\n // Checking if the ErrorHandler is already present in the providers array,\n // and if it is, we skip adding it\n if (options?.preExistingErrorHandler) {\n checkFileDoesNotContain(appModuleFile, 'Sentry.createErrorHandler()');\n }\n\n checkFileContents(appModuleFile, [\n `import * as Sentry from \"@sentry/angular\";`,\n options?.preExistingErrorHandler\n ? `provide: ErrorHandler,\n useValue: null`\n : `provide: ErrorHandler,\n useValue: Sentry.createErrorHandler()`,\n `provide: Sentry.TraceService,\n deps: [Router]`,\n `provide: APP_INITIALIZER,\n useFactory: () => () => {},\n deps: [Sentry.TraceService],\n multi: true`,\n ]);\n });\n\n test('angular.json is updated correctly', () => {\n const angularJsonFile = path.resolve(projectDir, 'angular.json');\n checkFileExists(angularJsonFile);\n\n const angularJson = JSON.parse(\n fs.readFileSync(angularJsonFile, 'utf-8'),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) as Record<string, any>;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n for (const [, project] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n angularJson.projects as Record<string, any>,\n )) {\n expect(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n project?.architect?.build?.configurations?.production?.sourceMap,\n ).toBe(true);\n }\n });\n\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n}\n"]}
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  const Constants_1 = require("../../lib/Constants");
27
27
  const utils_1 = require("../utils");
28
+ const fs = __importStar(require("fs"));
28
29
  const path = __importStar(require("path"));
29
30
  const utils_2 = require("../utils");
30
31
  const vitest_1 = require("vitest");
@@ -151,7 +152,6 @@ function checkAngularProject(projectDir, integration, options) {
151
152
  'replaysSessionSampleRate: 0.1',
152
153
  'replaysOnErrorSampleRate: 1',
153
154
  'enableLogs: true',
154
- 'sendDefaultPii: true',
155
155
  ]);
156
156
  });
157
157
  (0, vitest_1.test)('Sentry is correctly injected into Angular app module', () => {
@@ -176,11 +176,10 @@ function checkAngularProject(projectDir, integration, options) {
176
176
  })`,
177
177
  ]);
178
178
  });
179
- (0, vitest_1.test)('angular.json is updated correctly', async () => {
179
+ (0, vitest_1.test)('angular.json is updated correctly', () => {
180
180
  const angularJsonFile = path.resolve(projectDir, 'angular.json');
181
181
  (0, utils_1.checkFileExists)(angularJsonFile);
182
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
183
- const angularJson = (await import(angularJsonFile));
182
+ const angularJson = JSON.parse(fs.readFileSync(angularJsonFile, 'utf-8'));
184
183
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
185
184
  for (const [, project] of Object.entries(
186
185
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1 +1 @@
1
- {"version":3,"file":"angular-19.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/angular-19.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAkD;AAClD,oCAWkB;AAClB,2CAA6B;AAC7B,oCAAqC;AACrC,mCAAyE;AAEzE,uCAAuC;AACvC,mCAAuC;AAEvC,iBAAQ,CAAC,UAAU,CAAC,YAAY,EAAE,GAAG,EAAE;IACrC,IAAA,iBAAQ,EAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,MAAM,WAAW,GAAG,uBAAW,CAAC,OAAO,CAAC;QACxC,IAAI,cAAsB,CAAC;QAE3B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EACnD,qBAAqB,CACtB,CAAC;QAEF,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;YACnB,cAAc,GAAG,MAAM,yBAAyB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;QAEH,IAAA,iBAAQ,EAAC,GAAG,EAAE;YACZ,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;QAEH,IAAA,WAAE,EAAC,wBAAwB,EAAE,GAAG,EAAE;YAChC,IAAA,eAAM,EAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CA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AE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,CACjE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACd;IACH,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,IAAA,6BAAqB,EACzB,UAAU,EACV,yCAAyC,CAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAA,4BAAoB,EACxB,UAAU,EACV,yCAAyC,CAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Integration } from '../../lib/Constants';\nimport {\n checkFileContents,\n checkFileDoesNotContain,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n modifyFile,\n} from '../utils';\nimport * as path from 'path';\nimport { TEST_ARGS } from '../utils';\nimport { test, expect, describe, beforeAll, afterAll, it } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe.sequential('Angular-19', () => {\n describe('with empty project', () => {\n const integration = Integration.angular;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'angular-19-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await runWizardOnAngularProject(projectDir, integration);\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n checkAngularProject(projectDir, integration);\n });\n\n describe('with pre-defined ErrorHandler', () => {\n const integration = Integration.angular;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'angular-19-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await runWizardOnAngularProject(\n projectDir,\n integration,\n (projectDir) => {\n modifyFile(`${projectDir}/src/app/app.config.ts`, {\n 'providers: [': `providers: [{\n provide: ErrorHandler,\n useValue: null\n },\n `,\n });\n },\n );\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n checkAngularProject(projectDir, integration, {\n preExistingErrorHandler: true,\n });\n });\n});\n\nasync function runWizardOnAngularProject(\n projectDir: string,\n integration: Integration,\n fileModificationFn?: (projectDir: string) => unknown,\n): Promise<number> {\n const wizardInteraction = withEnv({\n cwd: projectDir,\n }).defineInteraction();\n\n if (fileModificationFn) {\n fileModificationFn(projectDir);\n\n wizardInteraction\n .whenAsked('Do you want to continue anyway?')\n .respondWith(KEYS.ENTER);\n }\n return (\n wizardInteraction\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.ENTER) // npm is the default for Angular\n .expectOutput('Installing @sentry/angular')\n // Installing the sdk can take a while in CI\n .expectOutput('Installed @sentry/angular with NPM.', {\n timeout: 240_000,\n })\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked('Do you want to enable Session Replay')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked('Do you want to enable Logs')\n .respondWith(KEYS.ENTER) // yes\n .expectOutput('initialized Sentry in main.ts', {\n timeout: 10_000,\n })\n .expectOutput('updated your app config app.config.ts')\n .expectOutput('Installing @sentry/cli')\n .expectOutput('Installed @sentry/cli@', {\n timeout: 240_000, // installing Sentry CLI can take a while in CI\n })\n .whenAsked('Where are your build artifacts located?')\n .respondWith(KEYS.ENTER) // ./dist is the default value\n .whenAsked(\n 'We couldn\\'t find build artifacts at \"./dist\". What would you like to do?',\n )\n .respondWith(KEYS.DOWN, KEYS.DOWN, KEYS.ENTER) // Proceed anyway (this is expected)\n .whenAsked(\n 'Do you want to automatically run the sentry:sourcemaps script after each production build?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER) // no - we can't upload in CI when testing building\n .whenAsked(\n 'Are you using a CI/CD tool to build and deploy your application?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Add a step to your CI pipeline that runs the sentry:sourcemaps script right after building your application',\n )\n .respondWith(KEYS.ENTER)\n .expectOutput(\n 'Add the Sentry authentication token as an environment variable to your CI setup:',\n )\n .expectOutput('SENTRY_AUTH_TOKEN=')\n .whenAsked('Did you configure CI as shown above?')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked(\n 'Do you want to create an example component to test your Sentry setup?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('Did you apply the snippet above?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Looks like you have Prettier in your project. Do you want to run it on your files?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Angular SDK!')\n .run(getWizardCommand(integration))\n );\n}\n\nfunction checkAngularProject(\n projectDir: string,\n integration: Integration,\n options?: {\n preExistingErrorHandler?: boolean;\n },\n) {\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/angular');\n\n const packageJsonFile = path.resolve(projectDir, 'package.json');\n checkFileContents(packageJsonFile, [\n `\"sentry:sourcemaps\": \"sentry-cli sourcemaps inject --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist && sentry-cli sourcemaps upload --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist\"`,\n `\"build\": \"ng build\"`,\n ]);\n });\n\n test('Sentry is correctly injected into Angular app config', () => {\n const appConfigFile = path.resolve(projectDir, 'src/main.ts');\n checkFileExists(appConfigFile);\n\n checkFileContents(appConfigFile, [\n `import * as Sentry from \"@sentry/angular\";`,\n 'Sentry.init({',\n TEST_ARGS.PROJECT_DSN,\n 'Sentry.browserTracingIntegration()',\n 'Sentry.replayIntegration()',\n 'tracesSampleRate: 1',\n 'replaysSessionSampleRate: 0.1',\n 'replaysOnErrorSampleRate: 1',\n 'enableLogs: true',\n 'sendDefaultPii: true',\n ]);\n });\n\n test('Sentry is correctly injected into Angular app module', () => {\n const appModuleFile = path.resolve(projectDir, 'src/app/app.config.ts');\n checkFileExists(appModuleFile);\n\n // Checking if the ErrorHandler is already present in the providers array,\n // and if it is, we skip adding it\n if (options?.preExistingErrorHandler) {\n checkFileDoesNotContain(appModuleFile, 'Sentry.createErrorHandler()');\n }\n\n checkFileContents(appModuleFile, [\n `import * as Sentry from \"@sentry/angular\";`,\n options?.preExistingErrorHandler\n ? `provide: ErrorHandler,\n useValue: null`\n : `provide: ErrorHandler,\n useValue: Sentry.createErrorHandler()`,\n `provide: Sentry.TraceService,\n deps: [Router]`,\n `provideAppInitializer(() => {\n inject(Sentry.TraceService);\n })`,\n ]);\n });\n\n test('angular.json is updated correctly', async () => {\n const angularJsonFile = path.resolve(projectDir, 'angular.json');\n checkFileExists(angularJsonFile);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const angularJson = (await import(angularJsonFile)) as Record<string, any>;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n for (const [, project] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n angularJson.projects as Record<string, any>,\n )) {\n expect(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n project?.architect?.build?.configurations?.production?.sourceMap,\n ).toBe(true);\n }\n });\n\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n}\n"]}
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,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAA,4BAAoB,EACxB,UAAU,EACV,yCAAyC,CAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Integration } from '../../lib/Constants';\nimport {\n checkFileContents,\n checkFileDoesNotContain,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n modifyFile,\n} from '../utils';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { TEST_ARGS } from '../utils';\nimport { test, expect, describe, beforeAll, afterAll, it } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe.sequential('Angular-19', () => {\n describe('with empty project', () => {\n const integration = Integration.angular;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'angular-19-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await runWizardOnAngularProject(projectDir, integration);\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n checkAngularProject(projectDir, integration);\n });\n\n describe('with pre-defined ErrorHandler', () => {\n const integration = Integration.angular;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'angular-19-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await runWizardOnAngularProject(\n projectDir,\n integration,\n (projectDir) => {\n modifyFile(`${projectDir}/src/app/app.config.ts`, {\n 'providers: [': `providers: [{\n provide: ErrorHandler,\n useValue: null\n },\n `,\n });\n },\n );\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n checkAngularProject(projectDir, integration, {\n preExistingErrorHandler: true,\n });\n });\n});\n\nasync function runWizardOnAngularProject(\n projectDir: string,\n integration: Integration,\n fileModificationFn?: (projectDir: string) => unknown,\n): Promise<number> {\n const wizardInteraction = withEnv({\n cwd: projectDir,\n }).defineInteraction();\n\n if (fileModificationFn) {\n fileModificationFn(projectDir);\n\n wizardInteraction\n .whenAsked('Do you want to continue anyway?')\n .respondWith(KEYS.ENTER);\n }\n return (\n wizardInteraction\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.ENTER) // npm is the default for Angular\n .expectOutput('Installing @sentry/angular')\n // Installing the sdk can take a while in CI\n .expectOutput('Installed @sentry/angular with NPM.', {\n timeout: 240_000,\n })\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked('Do you want to enable Session Replay')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked('Do you want to enable Logs')\n .respondWith(KEYS.ENTER) // yes\n .expectOutput('initialized Sentry in main.ts', {\n timeout: 10_000,\n })\n .expectOutput('updated your app config app.config.ts')\n .expectOutput('Installing @sentry/cli')\n .expectOutput('Installed @sentry/cli@', {\n timeout: 240_000, // installing Sentry CLI can take a while in CI\n })\n .whenAsked('Where are your build artifacts located?')\n .respondWith(KEYS.ENTER) // ./dist is the default value\n .whenAsked(\n 'We couldn\\'t find build artifacts at \"./dist\". What would you like to do?',\n )\n .respondWith(KEYS.DOWN, KEYS.DOWN, KEYS.ENTER) // Proceed anyway (this is expected)\n .whenAsked(\n 'Do you want to automatically run the sentry:sourcemaps script after each production build?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER) // no - we can't upload in CI when testing building\n .whenAsked(\n 'Are you using a CI/CD tool to build and deploy your application?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Add a step to your CI pipeline that runs the sentry:sourcemaps script right after building your application',\n )\n .respondWith(KEYS.ENTER)\n .expectOutput(\n 'Add the Sentry authentication token as an environment variable to your CI setup:',\n )\n .expectOutput('SENTRY_AUTH_TOKEN=')\n .whenAsked('Did you configure CI as shown above?')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked(\n 'Do you want to create an example component to test your Sentry setup?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('Did you apply the snippet above?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Looks like you have Prettier in your project. Do you want to run it on your files?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Angular SDK!')\n .run(getWizardCommand(integration))\n );\n}\n\nfunction checkAngularProject(\n projectDir: string,\n integration: Integration,\n options?: {\n preExistingErrorHandler?: boolean;\n },\n) {\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/angular');\n\n const packageJsonFile = path.resolve(projectDir, 'package.json');\n checkFileContents(packageJsonFile, [\n `\"sentry:sourcemaps\": \"sentry-cli sourcemaps inject --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist && sentry-cli sourcemaps upload --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist\"`,\n `\"build\": \"ng build\"`,\n ]);\n });\n\n test('Sentry is correctly injected into Angular app config', () => {\n const appConfigFile = path.resolve(projectDir, 'src/main.ts');\n checkFileExists(appConfigFile);\n\n checkFileContents(appConfigFile, [\n `import * as Sentry from \"@sentry/angular\";`,\n 'Sentry.init({',\n TEST_ARGS.PROJECT_DSN,\n 'Sentry.browserTracingIntegration()',\n 'Sentry.replayIntegration()',\n 'tracesSampleRate: 1',\n 'replaysSessionSampleRate: 0.1',\n 'replaysOnErrorSampleRate: 1',\n 'enableLogs: true',\n ]);\n });\n\n test('Sentry is correctly injected into Angular app module', () => {\n const appModuleFile = path.resolve(projectDir, 'src/app/app.config.ts');\n checkFileExists(appModuleFile);\n\n // Checking if the ErrorHandler is already present in the providers array,\n // and if it is, we skip adding it\n if (options?.preExistingErrorHandler) {\n checkFileDoesNotContain(appModuleFile, 'Sentry.createErrorHandler()');\n }\n\n checkFileContents(appModuleFile, [\n `import * as Sentry from \"@sentry/angular\";`,\n options?.preExistingErrorHandler\n ? `provide: ErrorHandler,\n useValue: null`\n : `provide: ErrorHandler,\n useValue: Sentry.createErrorHandler()`,\n `provide: Sentry.TraceService,\n deps: [Router]`,\n `provideAppInitializer(() => {\n inject(Sentry.TraceService);\n })`,\n ]);\n });\n\n test('angular.json is updated correctly', () => {\n const angularJsonFile = path.resolve(projectDir, 'angular.json');\n checkFileExists(angularJsonFile);\n\n const angularJson = JSON.parse(\n fs.readFileSync(angularJsonFile, 'utf-8'),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) as Record<string, any>;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n for (const [, project] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n angularJson.projects as Record<string, any>,\n )) {\n expect(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n project?.architect?.build?.configurations?.production?.sourceMap,\n ).toBe(true);\n }\n });\n\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n}\n"]}
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  const fs = __importStar(require("node:fs"));
27
+ const path = __importStar(require("node:path"));
27
28
  const Constants_1 = require("../../lib/Constants");
28
29
  const utils_1 = require("../utils");
29
30
  const utils_2 = require("../utils");
@@ -130,5 +131,64 @@ const clifty_1 = require("clifty");
130
131
  (0, utils_2.checkFileContents)(`${projectDir}/lib/main.dart`, `options.enableLogs = true;`);
131
132
  });
132
133
  });
134
+ (0, vitest_1.describe)('with CRLF line endings', () => {
135
+ let wizardExitCode;
136
+ const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('flutter-test-app');
137
+ function convertToCrlf(dir) {
138
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
139
+ for (const entry of entries) {
140
+ const fullPath = path.join(dir, entry.name);
141
+ if (entry.isDirectory()) {
142
+ convertToCrlf(fullPath);
143
+ }
144
+ else if (/\.(yaml|dart|properties)$/.test(entry.name) ||
145
+ entry.name === '.gitignore') {
146
+ const content = fs.readFileSync(fullPath, 'utf-8');
147
+ fs.writeFileSync(fullPath, content.replace(/\r?\n/g, '\r\n'), 'utf-8');
148
+ }
149
+ }
150
+ }
151
+ (0, vitest_1.beforeAll)(async () => {
152
+ convertToCrlf(projectDir);
153
+ wizardExitCode = await (0, clifty_1.withEnv)({
154
+ cwd: projectDir,
155
+ debug: true,
156
+ })
157
+ .defineInteraction()
158
+ .whenAsked('Do you want to continue anyway?')
159
+ .respondWith(clifty_1.KEYS.ENTER)
160
+ .expectOutput('The Sentry Flutter Wizard will help you set up Sentry for your application')
161
+ .whenAsked('Do you want to enable Tracing')
162
+ .respondWith(clifty_1.KEYS.ENTER)
163
+ .whenAsked('to analyze CPU usage and optimize performance-critical code on iOS & macOS?')
164
+ .respondWith(clifty_1.KEYS.ENTER)
165
+ .whenAsked('to record user interactions and debug issues?')
166
+ .respondWith(clifty_1.KEYS.ENTER)
167
+ .whenAsked('to send your application logs to Sentry?')
168
+ .respondWith(clifty_1.KEYS.ENTER)
169
+ .whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
170
+ .respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
171
+ .expectOutput('Successfully installed the Sentry Flutter SDK!')
172
+ .run((0, utils_1.getWizardCommand)(Constants_1.Integration.flutter));
173
+ });
174
+ (0, vitest_1.afterAll)(() => {
175
+ cleanup();
176
+ });
177
+ (0, vitest_1.test)('exits with exit code 0', () => {
178
+ (0, vitest_1.expect)(wizardExitCode).toBe(0);
179
+ });
180
+ (0, vitest_1.test)('modified files preserve CRLF line endings', () => {
181
+ const textFiles = fs
182
+ .readdirSync(projectDir, { recursive: true, encoding: 'utf-8' })
183
+ .filter((f) => /\.(yaml|dart|properties)$/.test(f) || f.endsWith('.gitignore'));
184
+ (0, vitest_1.expect)(textFiles.length).toBeGreaterThan(0);
185
+ const filesWithMixedEndings = textFiles.filter((file) => {
186
+ const content = fs.readFileSync(path.join(projectDir, file), 'utf-8');
187
+ const stripped = content.replace(/\r\n/g, '');
188
+ return stripped.includes('\n');
189
+ });
190
+ (0, vitest_1.expect)(filesWithMixedEndings).toEqual([]);
191
+ });
192
+ });
133
193
  });
134
194
  //# sourceMappingURL=flutter.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flutter.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/flutter.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,mDAAkD;AAClD,oCAAmE;AACnE,oCAIkB;AAClB,mCAAqE;AAErE,uCAAuC;AACvC,mCAAuC;AAEvC,IAAA,iBAAQ,EAAC,SAAS,EAAE,GAAG,EAAE;IACvB,IAAA,iBAAQ,EAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,IAAI,cAAsB,CAAC;QAC3B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EAAC,kBAAkB,CAAC,CAAC;QAE1E,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;YACnB,cAAc,GAAG,MAAM,IAAA,gBAAO,EAAC;gBAC7B,GAAG,EAAE,UAAU;gBACf,KAAK,EAAE,IAAI;aACZ,CAAC;iBACC,iBAAiB,EAAE;iBACnB,YAAY,CACX,4EAA4E,CAC7E;iBACA,SAAS,CAAC,+BAA+B,CAAC;iBAC1C,WAAW,CAAC,aAAI,CAAC,KAAK,CAAC;iBACvB,SAAS,CACR,6EAA6E,CAC9E;iBACA,WAAW,CAAC,aA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AAmC,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QAEH,IAAA,aAAI,EAAC,4BAA4B,EAAE,GAAG,EAAE;YACtC,IAAA,yBAAiB,EACf,GAAG,UAAU,gBAAgB,EAC7B,4BAA4B,CAC7B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport { Integration } from '../../lib/Constants';\nimport { createIsolatedTestEnv, getWizardCommand } from '../utils';\nimport {\n checkFileContents,\n checkIfFlutterBuilds,\n checkSentryProperties,\n} from '../utils';\nimport { afterAll, beforeAll, describe, expect, test } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('Flutter', () => {\n describe('with apple platforms', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv('flutter-test-app');\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({\n cwd: projectDir,\n debug: true,\n })\n .defineInteraction()\n .expectOutput(\n 'The Sentry Flutter Wizard will help you set up Sentry for your application',\n )\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'to analyze CPU usage and optimize performance-critical code on iOS & macOS?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to record user interactions and debug issues?')\n .respondWith(KEYS.ENTER)\n .whenAsked('to send your application logs to Sentry?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Flutter SDK!')\n .run(getWizardCommand(Integration.flutter));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('pubspec.yaml is updated.', () => {\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry_flutter:`); // dependencies\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry_dart_plugin:`); // dev_dependencies\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry:`); // gradle plugin options\n });\n\n test('sentry.properties exists and has auth token', () => {\n checkSentryProperties(projectDir);\n });\n\n test('.gitignore has sentry.properties', () => {\n checkFileContents(`${projectDir}/.gitignore`, `sentry.properties`);\n });\n\n test('lib/main.dart calls sentry init', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `import 'package:sentry_flutter/sentry_flutter.dart';`,\n );\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `await SentryFlutter.init(`,\n );\n });\n\n test('lib/main.dart enables tracing and profiling', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.tracesSampleRate = 1.0;`,\n );\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.profilesSampleRate = 1.0;`,\n );\n });\n\n test('lib/main.dart enables logs', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.enableLogs = true;`,\n );\n });\n\n test('builds correctly', async () => {\n await checkIfFlutterBuilds(projectDir, '✓ Built build/web');\n });\n });\n\n describe('without apple platforms', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv('flutter-test-app');\n\n beforeAll(async () => {\n // Remove apple platform directories to simulate non-apple setup\n if (fs.existsSync(`${projectDir}/ios`)) {\n fs.renameSync(`${projectDir}/ios`, `${projectDir}/_ios`);\n }\n if (fs.existsSync(`${projectDir}/macos`)) {\n fs.renameSync(`${projectDir}/macos`, `${projectDir}/_macos`);\n }\n\n wizardExitCode = await withEnv({\n cwd: projectDir,\n debug: true,\n })\n .defineInteraction()\n .whenAsked('Do you want to continue anyway?')\n .respondWith(KEYS.ENTER)\n .expectOutput(\n 'The Sentry Flutter Wizard will help you set up Sentry for your application',\n )\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER)\n .whenAsked('to record user interactions and debug issues?')\n .respondWith(KEYS.ENTER)\n .whenAsked('to send your application logs to Sentry?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Flutter SDK!')\n .run(getWizardCommand(Integration.flutter));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('lib/main.dart does not add profiling with missing ios and macos folder', () => {\n const fileContent = fs.readFileSync(\n `${projectDir}/lib/main.dart`,\n 'utf-8',\n );\n expect(fileContent).not.toContain(`options.profilesSampleRate = 1.0;`);\n });\n\n test('lib/main.dart enables logs', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.enableLogs = true;`,\n );\n });\n });\n});\n"]}
1
+ {"version":3,"file":"flutter.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/flutter.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,gDAAkC;AAClC,mDAAkD;AAClD,oCAAmE;AACnE,oCAIkB;AAClB,mCAAqE;AAErE,uCAAuC;AACvC,mCAAuC;AAEvC,IAAA,iBAAQ,EAAC,SAAS,EAAE,GAAG,EAAE;IACvB,IAAA,iBAAQ,EAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,IAAI,cAAsB,CAAC;QAC3B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EAAC,kBAAkB,CAAC,CAAC;QAE1E,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;YACnB,cAAc,GAAG,MAAM,IAAA,gBAAO,EAAC;gBAC7B,GAAG,EAAE,UAAU;gBACf,KAAK,EAAE,IAAI;aACZ,CAAC;iBACC,iBAAiB,EAAE;iBACnB,YAAY,CACX,4EAA4E,CAC7E;iBACA,SAAS,CAAC,+BAA+B,CAAC;iBAC1C,WAAW,CAAC,aAAI,CAAC,KAAK,CAAC;iBACv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C,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAClE,CAAC;YAEJ,IAAA,eAAM,EAAC,SAAS,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YAE5C,MAAM,qBAAqB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;gBACtD,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAC7B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,EAC3B,OAAO,CACR,CAAC;gBACF,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC9C,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;YAEH,IAAA,eAAM,EAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport { Integration } from '../../lib/Constants';\nimport { createIsolatedTestEnv, getWizardCommand } from '../utils';\nimport {\n checkFileContents,\n checkIfFlutterBuilds,\n checkSentryProperties,\n} from '../utils';\nimport { afterAll, beforeAll, describe, expect, test } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('Flutter', () => {\n describe('with apple platforms', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv('flutter-test-app');\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({\n cwd: projectDir,\n debug: true,\n })\n .defineInteraction()\n .expectOutput(\n 'The Sentry Flutter Wizard will help you set up Sentry for your application',\n )\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'to analyze CPU usage and optimize performance-critical code on iOS & macOS?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to record user interactions and debug issues?')\n .respondWith(KEYS.ENTER)\n .whenAsked('to send your application logs to Sentry?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Flutter SDK!')\n .run(getWizardCommand(Integration.flutter));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('pubspec.yaml is updated.', () => {\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry_flutter:`); // dependencies\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry_dart_plugin:`); // dev_dependencies\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry:`); // gradle plugin options\n });\n\n test('sentry.properties exists and has auth token', () => {\n checkSentryProperties(projectDir);\n });\n\n test('.gitignore has sentry.properties', () => {\n checkFileContents(`${projectDir}/.gitignore`, `sentry.properties`);\n });\n\n test('lib/main.dart calls sentry init', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `import 'package:sentry_flutter/sentry_flutter.dart';`,\n );\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `await SentryFlutter.init(`,\n );\n });\n\n test('lib/main.dart enables tracing and profiling', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.tracesSampleRate = 1.0;`,\n );\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.profilesSampleRate = 1.0;`,\n );\n });\n\n test('lib/main.dart enables logs', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.enableLogs = true;`,\n );\n });\n\n test('builds correctly', async () => {\n await checkIfFlutterBuilds(projectDir, '✓ Built build/web');\n });\n });\n\n describe('without apple platforms', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv('flutter-test-app');\n\n beforeAll(async () => {\n // Remove apple platform directories to simulate non-apple setup\n if (fs.existsSync(`${projectDir}/ios`)) {\n fs.renameSync(`${projectDir}/ios`, `${projectDir}/_ios`);\n }\n if (fs.existsSync(`${projectDir}/macos`)) {\n fs.renameSync(`${projectDir}/macos`, `${projectDir}/_macos`);\n }\n\n wizardExitCode = await withEnv({\n cwd: projectDir,\n debug: true,\n })\n .defineInteraction()\n .whenAsked('Do you want to continue anyway?')\n .respondWith(KEYS.ENTER)\n .expectOutput(\n 'The Sentry Flutter Wizard will help you set up Sentry for your application',\n )\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER)\n .whenAsked('to record user interactions and debug issues?')\n .respondWith(KEYS.ENTER)\n .whenAsked('to send your application logs to Sentry?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Flutter SDK!')\n .run(getWizardCommand(Integration.flutter));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('lib/main.dart does not add profiling with missing ios and macos folder', () => {\n const fileContent = fs.readFileSync(\n `${projectDir}/lib/main.dart`,\n 'utf-8',\n );\n expect(fileContent).not.toContain(`options.profilesSampleRate = 1.0;`);\n });\n\n test('lib/main.dart enables logs', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.enableLogs = true;`,\n );\n });\n });\n\n describe('with CRLF line endings', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv('flutter-test-app');\n\n function convertToCrlf(dir: string) {\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n convertToCrlf(fullPath);\n } else if (\n /\\.(yaml|dart|properties)$/.test(entry.name) ||\n entry.name === '.gitignore'\n ) {\n const content = fs.readFileSync(fullPath, 'utf-8');\n fs.writeFileSync(\n fullPath,\n content.replace(/\\r?\\n/g, '\\r\\n'),\n 'utf-8',\n );\n }\n }\n }\n\n beforeAll(async () => {\n convertToCrlf(projectDir);\n\n wizardExitCode = await withEnv({\n cwd: projectDir,\n debug: true,\n })\n .defineInteraction()\n .whenAsked('Do you want to continue anyway?')\n .respondWith(KEYS.ENTER)\n .expectOutput(\n 'The Sentry Flutter Wizard will help you set up Sentry for your application',\n )\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'to analyze CPU usage and optimize performance-critical code on iOS & macOS?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to record user interactions and debug issues?')\n .respondWith(KEYS.ENTER)\n .whenAsked('to send your application logs to Sentry?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Flutter SDK!')\n .run(getWizardCommand(Integration.flutter));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('modified files preserve CRLF line endings', () => {\n const textFiles = fs\n .readdirSync(projectDir, { recursive: true, encoding: 'utf-8' })\n .filter(\n (f) =>\n /\\.(yaml|dart|properties)$/.test(f) || f.endsWith('.gitignore'),\n );\n\n expect(textFiles.length).toBeGreaterThan(0);\n\n const filesWithMixedEndings = textFiles.filter((file) => {\n const content = fs.readFileSync(\n path.join(projectDir, file),\n 'utf-8',\n );\n const stripped = content.replace(/\\r\\n/g, '');\n return stripped.includes('\\n');\n });\n\n expect(filesWithMixedEndings).toEqual([]);\n });\n });\n});\n"]}
@@ -25,11 +25,13 @@ const vitest_1 = require("vitest");
25
25
  [boolean] [default: false]
26
26
  --quiet Do not fallback to prompting user asking questions
27
27
  env: SENTRY_WIZARD_QUIET [boolean] [default: false]
28
+ --non-interactive Run in non-interactive mode, useful for agentic
29
+ setup [boolean] [default: false]
28
30
  -i, --integration Choose the integration to setup
29
31
  env: SENTRY_WIZARD_INTEGRATION
30
- [choices: "reactNative", "flutter", "ios", "android", "cordova", "angular",
31
- "cloudflare", "electron", "nextjs", "nuxt", "remix", "reactRouter",
32
- "sveltekit", "sourcemaps"]
32
+ [choices: "reactNative", "flutter", "ios", "appleSnapshots", "android",
33
+ "cordova", "angular", "cloudflare", "electron", "nextjs", "nuxt", "remix",
34
+ "reactRouter", "sveltekit", "sourcemaps"]
33
35
  -p, --platform Choose platform(s)
34
36
  env: SENTRY_WIZARD_PLATFORM
35
37
  [array] [choices: "ios", "android"]
@@ -52,6 +54,9 @@ const vitest_1 = require("vitest");
52
54
  --spotlight Enable Spotlight for local development. This does
53
55
  not require a Sentry account or project.
54
56
  [boolean] [default: false]
57
+ --app-target Xcode application target that hosts Swift previews.
58
+ [string]
59
+ --hosted-test-target Hosted XCTest target to configure. [string]
55
60
  --version Show version number [boolean]
56
61
  "
57
62
  `);
@@ -1 +1 @@
1
- {"version":3,"file":"help-message.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/help-message.test.ts"],"names":[],"mappings":";;AAAA,2DAA8C;AAC9C,yCAAiC;AACjC,mCAA8C;AAE9C,IAAA,iBAAQ,EAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAA,WAAE,EAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B;YACpD,CAAC,CAAC,CAAC,UAAU,EAAE,iBAAiB,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACnE,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEvB,MAAM,OAAO,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;QAExD,MAAM,MAAM,GAAG,IAAA,6BAAQ,EAAC,GAAG,OAAO,SAAS,EAAE;YAC3C,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0C/C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { execSync } from 'node:child_process';\nimport { join } from 'node:path';\nimport { describe, expect, it } from 'vitest';\n\ndescribe('--help command', () => {\n it('prints the up to date help command', () => {\n const binName = process.env.SENTRY_WIZARD_E2E_TEST_BIN\n ? ['dist-bin', `sentry-wizard-${process.platform}-${process.arch}`]\n : ['dist', 'bin.js'];\n\n const binPath = join(__dirname, '..', '..', ...binName);\n\n const output = execSync(`${binPath} --help`, {\n stdio: 'pipe',\n });\n\n expect(output.toString()).toMatchInlineSnapshot(`\n \"Options:\n --help Show help [boolean]\n --debug Enable verbose logging\n env: SENTRY_WIZARD_DEBUG [boolean] [default: false]\n --uninstall Revert project setup process\n env: SENTRY_WIZARD_UNINSTALL\n [boolean] [default: false]\n --skip-connect Skips the connection to the server\n env: SENTRY_WIZARD_SKIP_CONNECT\n [boolean] [default: false]\n --quiet Do not fallback to prompting user asking questions\n env: SENTRY_WIZARD_QUIET [boolean] [default: false]\n -i, --integration Choose the integration to setup\n env: SENTRY_WIZARD_INTEGRATION\n [choices: \"reactNative\", \"flutter\", \"ios\", \"android\", \"cordova\", \"angular\",\n \"cloudflare\", \"electron\", \"nextjs\", \"nuxt\", \"remix\", \"reactRouter\",\n \"sveltekit\", \"sourcemaps\"]\n -p, --platform Choose platform(s)\n env: SENTRY_WIZARD_PLATFORM\n [array] [choices: \"ios\", \"android\"]\n -u, --url The url to your Sentry installation\n env: SENTRY_WIZARD_URL\n --project The Sentry project slug to use\n [string] [default: Select project during setup]\n --org The Sentry org slug to use\n [string] [default: Select org during setup]\n --saas Skip the self-hosted or SaaS URL selection process\n [boolean] [default: Select self-hosted or SaaS during setup]\n -s, --signup Redirect to signup page if not logged in\n [boolean] [default: false]\n --disable-telemetry Don't send telemetry data to Sentry\n [boolean] [default: false]\n --force-install Force install the SDK NPM package\n [boolean] [default: false]\n --ignore-git-changes Ignore git changes in the project\n [boolean] [default: false]\n --spotlight Enable Spotlight for local development. This does\n not require a Sentry account or project.\n [boolean] [default: false]\n --version Show version number [boolean]\n \"\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"help-message.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/help-message.test.ts"],"names":[],"mappings":";;AAAA,2DAA8C;AAC9C,yCAAiC;AACjC,mCAA8C;AAE9C,IAAA,iBAAQ,EAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAA,WAAE,EAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B;YACpD,CAAC,CAAC,CAAC,UAAU,EAAE,iBAAiB,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACnE,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEvB,MAAM,OAAO,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;QAExD,MAAM,MAAM,GAAG,IAAA,6BAAQ,EAAC,GAAG,OAAO,SAAS,EAAE;YAC3C,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+C/C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { execSync } from 'node:child_process';\nimport { join } from 'node:path';\nimport { describe, expect, it } from 'vitest';\n\ndescribe('--help command', () => {\n it('prints the up to date help command', () => {\n const binName = process.env.SENTRY_WIZARD_E2E_TEST_BIN\n ? ['dist-bin', `sentry-wizard-${process.platform}-${process.arch}`]\n : ['dist', 'bin.js'];\n\n const binPath = join(__dirname, '..', '..', ...binName);\n\n const output = execSync(`${binPath} --help`, {\n stdio: 'pipe',\n });\n\n expect(output.toString()).toMatchInlineSnapshot(`\n \"Options:\n --help Show help [boolean]\n --debug Enable verbose logging\n env: SENTRY_WIZARD_DEBUG [boolean] [default: false]\n --uninstall Revert project setup process\n env: SENTRY_WIZARD_UNINSTALL\n [boolean] [default: false]\n --skip-connect Skips the connection to the server\n env: SENTRY_WIZARD_SKIP_CONNECT\n [boolean] [default: false]\n --quiet Do not fallback to prompting user asking questions\n env: SENTRY_WIZARD_QUIET [boolean] [default: false]\n --non-interactive Run in non-interactive mode, useful for agentic\n setup [boolean] [default: false]\n -i, --integration Choose the integration to setup\n env: SENTRY_WIZARD_INTEGRATION\n [choices: \"reactNative\", \"flutter\", \"ios\", \"appleSnapshots\", \"android\",\n \"cordova\", \"angular\", \"cloudflare\", \"electron\", \"nextjs\", \"nuxt\", \"remix\",\n \"reactRouter\", \"sveltekit\", \"sourcemaps\"]\n -p, --platform Choose platform(s)\n env: SENTRY_WIZARD_PLATFORM\n [array] [choices: \"ios\", \"android\"]\n -u, --url The url to your Sentry installation\n env: SENTRY_WIZARD_URL\n --project The Sentry project slug to use\n [string] [default: Select project during setup]\n --org The Sentry org slug to use\n [string] [default: Select org during setup]\n --saas Skip the self-hosted or SaaS URL selection process\n [boolean] [default: Select self-hosted or SaaS during setup]\n -s, --signup Redirect to signup page if not logged in\n [boolean] [default: false]\n --disable-telemetry Don't send telemetry data to Sentry\n [boolean] [default: false]\n --force-install Force install the SDK NPM package\n [boolean] [default: false]\n --ignore-git-changes Ignore git changes in the project\n [boolean] [default: false]\n --spotlight Enable Spotlight for local development. This does\n not require a Sentry account or project.\n [boolean] [default: false]\n --app-target Xcode application target that hosts Swift previews.\n [string]\n --hosted-test-target Hosted XCTest target to configure. [string]\n --version Show version number [boolean]\n \"\n `);\n });\n});\n"]}
@@ -121,9 +121,12 @@ const clifty_1 = require("clifty");
121
121
  ' integrations: [Sentry.replayIntegration()],',
122
122
  ' // Enable logs to be sent to Sentry',
123
123
  ' enableLogs: true,',
124
- ` // Enable sending of user PII (Personally Identifiable Information)`,
125
- ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#sendDefaultPii',
126
- ' sendDefaultPii: true,',
124
+ ' dataCollection: {',
125
+ ' // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:',
126
+ ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#dataCollection',
127
+ ' // userInfo: false,',
128
+ ' // httpBodies: [],',
129
+ ' },',
127
130
  " // Setting this option to true will print useful information to the console while you're setting up Sentry.",
128
131
  ' debug: false,',
129
132
  '});',
@@ -139,9 +142,12 @@ const clifty_1 = require("clifty");
139
142
  ' tracesSampleRate: 1.0,',
140
143
  ' // Enable logs to be sent to Sentry',
141
144
  ' enableLogs: true,',
142
- ' // Enable sending of user PII (Personally Identifiable Information)',
143
- ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#sendDefaultPii',
144
- ' sendDefaultPii: true,',
145
+ ' dataCollection: {',
146
+ ' // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:',
147
+ ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#dataCollection',
148
+ ' // userInfo: false,',
149
+ ' // httpBodies: [],',
150
+ ' },',
145
151
  " // Setting this option to true will print useful information to the console while you're setting up Sentry.",
146
152
  ' debug: false,',
147
153
  '});',
@@ -1 +1 @@
1
- {"version":3,"file":"nuxt-3.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nuxt-3.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,mDAAkD;AAClD,oCAUkB;AAClB,mCAAqE;AAErE,uCAAuC;AACvC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AAiB;YACjB,KAAK;SACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as path from 'node:path';\nimport { Integration } from '../../lib/Constants';\nimport {\n TEST_ARGS,\n checkEnvBuildPlugin,\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnProdMode,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n} from '../utils';\nimport { afterAll, beforeAll, describe, expect, test } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('Nuxt-3', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv('nuxt-3-test-app');\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({\n cwd: projectDir,\n })\n .defineInteraction()\n .expectOutput(\n 'The Sentry Nuxt Wizard will help you set up Sentry for your application',\n )\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .whenAsked('Do you want to add an override for @vercel/nft')\n .respondWith(KEYS.ENTER)\n .expectOutput('Installing @sentry/nuxt')\n .expectOutput('Installed @sentry/nuxt', {\n timeout: 240_000,\n })\n .expectOutput('Created .env.sentry-build-plugin')\n .whenAsked('Please select your deployment platform')\n .respondWith(KEYS.DOWN, KEYS.DOWN, KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Added Sentry Nuxt Module to nuxt.config.ts')\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to enable Session Replay')\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to enable Logs')\n .respondWith(KEYS.ENTER)\n .expectOutput('Created new sentry.server.config.ts')\n .expectOutput('Created new sentry.client.config.ts')\n .whenAsked('Do you want to create an example page')\n .respondWith(KEYS.ENTER)\n .expectOutput('Created pages/index.vue')\n .expectOutput(\n 'After building your Nuxt app, you need to --import the Sentry server config file when running your app',\n )\n .whenAsked('Do you want to open the docs?')\n .respondWith(KEYS.RIGHT, KEYS.ENTER) // no\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Nuxt SDK!')\n .run(getWizardCommand(Integration.nuxt));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/nuxt');\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.client.config.ts`);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/pages/sentry-example-page.vue`);\n checkFileExists(`${projectDir}/server/api/sentry-example-api.ts`);\n });\n\n test('nuxt config contains sentry module', () => {\n checkFileContents(path.resolve(projectDir, 'nuxt.config.ts'), [\n \"modules: ['@sentry/nuxt/module'],\",\n 'sentry: {',\n ` org: '${TEST_ARGS.ORG_SLUG}',`,\n ` project: '${TEST_ARGS.PROJECT_SLUG}'`,\n '},',\n 'sourcemap: {',\n \" client: 'hidden'\",\n '}',\n ]);\n });\n\n test('sentry.client.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.client.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ' // If set up, you can use your runtime config here',\n ' // dsn: useRuntimeConfig().public.sentry.dsn,',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n ' // This sets the sample rate to be 10%. You may want this to be 100% while',\n ' // in development and sample at a lower rate in production',\n ' replaysSessionSampleRate: 0.1,',\n ' // If the entire session is not sampled, use the below sample rate to sample',\n ' // sessions when an error occurs.',\n ' replaysOnErrorSampleRate: 1.0,',\n \" // If you don't want to use Session Replay, just remove the line below:\",\n ' integrations: [Sentry.replayIntegration()],',\n ' // Enable logs to be sent to Sentry',\n ' enableLogs: true,',\n ` // Enable sending of user PII (Personally Identifiable Information)`,\n ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#sendDefaultPii',\n ' sendDefaultPii: true,',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n\n test('sentry.server.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.server.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n ' // Enable logs to be sent to Sentry',\n ' enableLogs: true,',\n ' // Enable sending of user PII (Personally Identifiable Information)',\n ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#sendDefaultPii',\n ' sendDefaultPii: true,',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'Listening on');\n });\n});\n"]}
1
+ {"version":3,"file":"nuxt-3.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nuxt-3.test.ts"],"names":[],"mappings":";;;;;;;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C,8EAA8E;YAC9E,wBAAwB;YACxB,0BAA0B;YAC1B,uCAAuC;YACvC,qBAAqB;YACrB,qBAAqB;YACrB,sGAAsG;YACtG,sGAAsG;YACtG,yBAAyB;YACzB,wBAAwB;YACxB,MAAM;YACN,+GAA+G;YAC/G,iBAAiB;YACjB,KAAK;SACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as path from 'node:path';\nimport { Integration } from '../../lib/Constants';\nimport {\n TEST_ARGS,\n checkEnvBuildPlugin,\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnProdMode,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n} from '../utils';\nimport { afterAll, beforeAll, describe, expect, test } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('Nuxt-3', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv('nuxt-3-test-app');\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({\n cwd: projectDir,\n })\n .defineInteraction()\n .expectOutput(\n 'The Sentry Nuxt Wizard will help you set up Sentry for your application',\n )\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .whenAsked('Do you want to add an override for @vercel/nft')\n .respondWith(KEYS.ENTER)\n .expectOutput('Installing @sentry/nuxt')\n .expectOutput('Installed @sentry/nuxt', {\n timeout: 240_000,\n })\n .expectOutput('Created .env.sentry-build-plugin')\n .whenAsked('Please select your deployment platform')\n .respondWith(KEYS.DOWN, KEYS.DOWN, KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Added Sentry Nuxt Module to nuxt.config.ts')\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to enable Session Replay')\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to enable Logs')\n .respondWith(KEYS.ENTER)\n .expectOutput('Created new sentry.server.config.ts')\n .expectOutput('Created new sentry.client.config.ts')\n .whenAsked('Do you want to create an example page')\n .respondWith(KEYS.ENTER)\n .expectOutput('Created pages/index.vue')\n .expectOutput(\n 'After building your Nuxt app, you need to --import the Sentry server config file when running your app',\n )\n .whenAsked('Do you want to open the docs?')\n .respondWith(KEYS.RIGHT, KEYS.ENTER) // no\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Nuxt SDK!')\n .run(getWizardCommand(Integration.nuxt));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/nuxt');\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.client.config.ts`);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/pages/sentry-example-page.vue`);\n checkFileExists(`${projectDir}/server/api/sentry-example-api.ts`);\n });\n\n test('nuxt config contains sentry module', () => {\n checkFileContents(path.resolve(projectDir, 'nuxt.config.ts'), [\n \"modules: ['@sentry/nuxt/module'],\",\n 'sentry: {',\n ` org: '${TEST_ARGS.ORG_SLUG}',`,\n ` project: '${TEST_ARGS.PROJECT_SLUG}'`,\n '},',\n 'sourcemap: {',\n \" client: 'hidden'\",\n '}',\n ]);\n });\n\n test('sentry.client.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.client.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ' // If set up, you can use your runtime config here',\n ' // dsn: useRuntimeConfig().public.sentry.dsn,',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n ' // This sets the sample rate to be 10%. You may want this to be 100% while',\n ' // in development and sample at a lower rate in production',\n ' replaysSessionSampleRate: 0.1,',\n ' // If the entire session is not sampled, use the below sample rate to sample',\n ' // sessions when an error occurs.',\n ' replaysOnErrorSampleRate: 1.0,',\n \" // If you don't want to use Session Replay, just remove the line below:\",\n ' integrations: [Sentry.replayIntegration()],',\n ' // Enable logs to be sent to Sentry',\n ' enableLogs: true,',\n ' dataCollection: {',\n ' // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:',\n ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#dataCollection',\n ' // userInfo: false,',\n ' // httpBodies: [],',\n ' },',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n\n test('sentry.server.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.server.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n ' // Enable logs to be sent to Sentry',\n ' enableLogs: true,',\n ' dataCollection: {',\n ' // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:',\n ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#dataCollection',\n ' // userInfo: false,',\n ' // httpBodies: [],',\n ' },',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'Listening on');\n });\n});\n"]}