@sentry/wizard 6.11.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 (245) hide show
  1. package/CHANGELOG.md +64 -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/cloudflare-worker.test.js +5 -0
  9. package/dist/e2e-tests/tests/cloudflare-worker.test.js.map +1 -1
  10. package/dist/e2e-tests/tests/flutter.test.js +60 -0
  11. package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
  12. package/dist/e2e-tests/tests/help-message.test.js +8 -3
  13. package/dist/e2e-tests/tests/help-message.test.js.map +1 -1
  14. package/dist/e2e-tests/tests/nuxt-3.test.js +12 -6
  15. package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
  16. package/dist/e2e-tests/tests/nuxt-4.test.js +12 -6
  17. package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
  18. package/dist/e2e-tests/tests/pnpm-workspace.test.js +8 -4
  19. package/dist/e2e-tests/tests/pnpm-workspace.test.js.map +1 -1
  20. package/dist/e2e-tests/tests/react-router-instrumentation-api.test.js +96 -0
  21. package/dist/e2e-tests/tests/react-router-instrumentation-api.test.js.map +1 -0
  22. package/dist/e2e-tests/tests/react-router.test.js +6 -7
  23. package/dist/e2e-tests/tests/react-router.test.js.map +1 -1
  24. package/dist/e2e-tests/tests/remix.test.js +2 -4
  25. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  26. package/dist/e2e-tests/tests/sveltekit-hooks.test.js +24 -8
  27. package/dist/e2e-tests/tests/sveltekit-hooks.test.js.map +1 -1
  28. package/dist/e2e-tests/tests/sveltekit-tracing.test.js +8 -4
  29. package/dist/e2e-tests/tests/sveltekit-tracing.test.js.map +1 -1
  30. package/dist/lib/Constants.d.ts +1 -0
  31. package/dist/lib/Constants.js +5 -0
  32. package/dist/lib/Constants.js.map +1 -1
  33. package/dist/lib/Steps/Integrations/Electron.js +2 -2
  34. package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
  35. package/dist/src/android/android-wizard.js +3 -0
  36. package/dist/src/android/android-wizard.js.map +1 -1
  37. package/dist/src/angular/codemods/main.d.ts +1 -1
  38. package/dist/src/angular/codemods/main.js +0 -1
  39. package/dist/src/angular/codemods/main.js.map +1 -1
  40. package/dist/src/apple/apple-wizard.js +2 -3
  41. package/dist/src/apple/apple-wizard.js.map +1 -1
  42. package/dist/src/apple/check-installed-cli.d.ts +1 -1
  43. package/dist/src/apple/check-installed-cli.js +13 -7
  44. package/dist/src/apple/check-installed-cli.js.map +1 -1
  45. package/dist/src/apple/code-tools.js +17 -3
  46. package/dist/src/apple/code-tools.js.map +1 -1
  47. package/dist/src/apple/configure-package-manager.js +18 -5
  48. package/dist/src/apple/configure-package-manager.js.map +1 -1
  49. package/dist/src/apple/configure-xcode-project.js +8 -1
  50. package/dist/src/apple/configure-xcode-project.js.map +1 -1
  51. package/dist/src/apple/lookup-xcode-project.d.ts +8 -5
  52. package/dist/src/apple/lookup-xcode-project.js +22 -17
  53. package/dist/src/apple/lookup-xcode-project.js.map +1 -1
  54. package/dist/src/apple/options.d.ts +5 -0
  55. package/dist/src/apple/options.js.map +1 -1
  56. package/dist/src/apple/sentry-swift-package.d.ts +4 -0
  57. package/dist/src/apple/sentry-swift-package.js +17 -0
  58. package/dist/src/apple/sentry-swift-package.js.map +1 -0
  59. package/dist/src/apple/snapshots/apple-snapshots-wizard.d.ts +2 -0
  60. package/dist/src/apple/snapshots/apple-snapshots-wizard.js +251 -0
  61. package/dist/src/apple/snapshots/apple-snapshots-wizard.js.map +1 -0
  62. package/dist/src/apple/snapshots/configure-snapshotpreviews-xcode-project.d.ts +13 -0
  63. package/dist/src/apple/snapshots/configure-snapshotpreviews-xcode-project.js +48 -0
  64. package/dist/src/apple/snapshots/configure-snapshotpreviews-xcode-project.js.map +1 -0
  65. package/dist/src/apple/snapshots/snapshot-test-file.d.ts +18 -0
  66. package/dist/src/apple/snapshots/snapshot-test-file.js +122 -0
  67. package/dist/src/apple/snapshots/snapshot-test-file.js.map +1 -0
  68. package/dist/src/apple/snapshots/snapshot-verification-scheme.d.ts +6 -0
  69. package/dist/src/apple/snapshots/snapshot-verification-scheme.js +147 -0
  70. package/dist/src/apple/snapshots/snapshot-verification-scheme.js.map +1 -0
  71. package/dist/src/apple/snapshots/snapshotpreviews-package.d.ts +4 -0
  72. package/dist/src/apple/snapshots/snapshotpreviews-package.js +8 -0
  73. package/dist/src/apple/snapshots/snapshotpreviews-package.js.map +1 -0
  74. package/dist/src/apple/snapshots/snapshots-cli-preflight.d.ts +23 -0
  75. package/dist/src/apple/snapshots/snapshots-cli-preflight.js +136 -0
  76. package/dist/src/apple/snapshots/snapshots-cli-preflight.js.map +1 -0
  77. package/dist/src/apple/xcode-manager.d.ts +59 -1
  78. package/dist/src/apple/xcode-manager.js +507 -106
  79. package/dist/src/apple/xcode-manager.js.map +1 -1
  80. package/dist/src/cloudflare/cloudflare-wizard.js +5 -0
  81. package/dist/src/cloudflare/cloudflare-wizard.js.map +1 -1
  82. package/dist/src/cloudflare/sdk-setup.d.ts +1 -0
  83. package/dist/src/cloudflare/sdk-setup.js.map +1 -1
  84. package/dist/src/cloudflare/templates.d.ts +1 -0
  85. package/dist/src/cloudflare/templates.js +7 -1
  86. package/dist/src/cloudflare/templates.js.map +1 -1
  87. package/dist/src/cloudflare/wrap-worker.d.ts +1 -0
  88. package/dist/src/cloudflare/wrap-worker.js +7 -0
  89. package/dist/src/cloudflare/wrap-worker.js.map +1 -1
  90. package/dist/src/flutter/flutter-wizard.js +3 -0
  91. package/dist/src/flutter/flutter-wizard.js.map +1 -1
  92. package/dist/src/nextjs/templates.js +12 -6
  93. package/dist/src/nextjs/templates.js.map +1 -1
  94. package/dist/src/nuxt/templates.js +12 -6
  95. package/dist/src/nuxt/templates.js.map +1 -1
  96. package/dist/src/react-native/expo.d.ts +6 -0
  97. package/dist/src/react-native/expo.js +27 -1
  98. package/dist/src/react-native/expo.js.map +1 -1
  99. package/dist/src/react-native/git.d.ts +5 -0
  100. package/dist/src/react-native/git.js +32 -1
  101. package/dist/src/react-native/git.js.map +1 -1
  102. package/dist/src/react-native/javascript.js +3 -1
  103. package/dist/src/react-native/javascript.js.map +1 -1
  104. package/dist/src/react-native/react-native-wizard.js +12 -6
  105. package/dist/src/react-native/react-native-wizard.js.map +1 -1
  106. package/dist/src/react-router/codemods/client.entry.d.ts +1 -1
  107. package/dist/src/react-router/codemods/client.entry.js +124 -26
  108. package/dist/src/react-router/codemods/client.entry.js.map +1 -1
  109. package/dist/src/react-router/codemods/react-router-config.js +1 -1
  110. package/dist/src/react-router/codemods/react-router-config.js.map +1 -1
  111. package/dist/src/react-router/codemods/server-entry.d.ts +1 -1
  112. package/dist/src/react-router/codemods/server-entry.js +40 -4
  113. package/dist/src/react-router/codemods/server-entry.js.map +1 -1
  114. package/dist/src/react-router/codemods/vite.js +46 -1
  115. package/dist/src/react-router/codemods/vite.js.map +1 -1
  116. package/dist/src/react-router/react-router-wizard.js +62 -21
  117. package/dist/src/react-router/react-router-wizard.js.map +1 -1
  118. package/dist/src/react-router/sdk-setup.d.ts +5 -3
  119. package/dist/src/react-router/sdk-setup.js +44 -16
  120. package/dist/src/react-router/sdk-setup.js.map +1 -1
  121. package/dist/src/react-router/templates.d.ts +2 -4
  122. package/dist/src/react-router/templates.js +89 -87
  123. package/dist/src/react-router/templates.js.map +1 -1
  124. package/dist/src/remix/sdk-setup.js +1 -2
  125. package/dist/src/remix/sdk-setup.js.map +1 -1
  126. package/dist/src/run.d.ts +4 -1
  127. package/dist/src/run.js +13 -0
  128. package/dist/src/run.js.map +1 -1
  129. package/dist/src/sourcemaps/tools/remix.js +4 -4
  130. package/dist/src/sourcemaps/tools/remix.js.map +1 -1
  131. package/dist/src/sourcemaps/tools/vite.js +1 -1
  132. package/dist/src/sourcemaps/tools/vite.js.map +1 -1
  133. package/dist/src/sveltekit/sdk-setup/setup.js +17 -4
  134. package/dist/src/sveltekit/sdk-setup/setup.js.map +1 -1
  135. package/dist/src/sveltekit/sdk-setup/vite.js +1 -1
  136. package/dist/src/sveltekit/sdk-setup/vite.js.map +1 -1
  137. package/dist/src/sveltekit/templates.js +12 -6
  138. package/dist/src/sveltekit/templates.js.map +1 -1
  139. package/dist/src/utils/ast-utils.d.ts +10 -0
  140. package/dist/src/utils/ast-utils.js +19 -1
  141. package/dist/src/utils/ast-utils.js.map +1 -1
  142. package/dist/src/utils/clack/index.d.ts +2 -1
  143. package/dist/src/utils/clack/index.js +17 -6
  144. package/dist/src/utils/clack/index.js.map +1 -1
  145. package/dist/src/utils/files.d.ts +2 -0
  146. package/dist/src/utils/files.js +58 -0
  147. package/dist/src/utils/files.js.map +1 -0
  148. package/dist/src/utils/git.d.ts +3 -1
  149. package/dist/src/utils/git.js +2 -1
  150. package/dist/src/utils/git.js.map +1 -1
  151. package/dist/src/utils/line-endings.d.ts +1 -0
  152. package/dist/src/utils/line-endings.js +76 -0
  153. package/dist/src/utils/line-endings.js.map +1 -0
  154. package/dist/src/version.d.ts +1 -1
  155. package/dist/src/version.js +1 -1
  156. package/dist/src/version.js.map +1 -1
  157. package/dist/test/angular/angular-wizard.test.js +0 -5
  158. package/dist/test/angular/angular-wizard.test.js.map +1 -1
  159. package/dist/test/apple/code-tools.test.js +78 -0
  160. package/dist/test/apple/code-tools.test.js.map +1 -1
  161. package/dist/test/apple/configure-package-manager.test.d.ts +1 -0
  162. package/dist/test/apple/configure-package-manager.test.js +161 -0
  163. package/dist/test/apple/configure-package-manager.test.js.map +1 -0
  164. package/dist/test/apple/lookup-xcode-project.test.d.ts +1 -0
  165. package/dist/test/apple/lookup-xcode-project.test.js +167 -0
  166. package/dist/test/apple/lookup-xcode-project.test.js.map +1 -0
  167. package/dist/test/apple/snapshots/apple-snapshots-wizard.test.d.ts +1 -0
  168. package/dist/test/apple/snapshots/apple-snapshots-wizard.test.js +487 -0
  169. package/dist/test/apple/snapshots/apple-snapshots-wizard.test.js.map +1 -0
  170. package/dist/test/apple/snapshots/hosted-test-target-fixture.d.ts +24 -0
  171. package/dist/test/apple/snapshots/hosted-test-target-fixture.js +191 -0
  172. package/dist/test/apple/snapshots/hosted-test-target-fixture.js.map +1 -0
  173. package/dist/test/apple/snapshots/snapshot-test-file.test.d.ts +1 -0
  174. package/dist/test/apple/snapshots/snapshot-test-file.test.js +110 -0
  175. package/dist/test/apple/snapshots/snapshot-test-file.test.js.map +1 -0
  176. package/dist/test/apple/snapshots/snapshot-verification-scheme.test.d.ts +1 -0
  177. package/dist/test/apple/snapshots/snapshot-verification-scheme.test.js +146 -0
  178. package/dist/test/apple/snapshots/snapshot-verification-scheme.test.js.map +1 -0
  179. package/dist/test/apple/snapshots/snapshotpreviews-xcode-smoke.test.d.ts +1 -0
  180. package/dist/test/apple/snapshots/snapshotpreviews-xcode-smoke.test.js +186 -0
  181. package/dist/test/apple/snapshots/snapshotpreviews-xcode-smoke.test.js.map +1 -0
  182. package/dist/test/apple/snapshots/snapshots-cli-preflight.test.d.ts +1 -0
  183. package/dist/test/apple/snapshots/snapshots-cli-preflight.test.js +192 -0
  184. package/dist/test/apple/snapshots/snapshots-cli-preflight.test.js.map +1 -0
  185. package/dist/test/apple/snapshots/source-file-insertion.test.d.ts +1 -0
  186. package/dist/test/apple/snapshots/source-file-insertion.test.js +77 -0
  187. package/dist/test/apple/snapshots/source-file-insertion.test.js.map +1 -0
  188. package/dist/test/apple/xcode-manager.test.js +452 -43
  189. package/dist/test/apple/xcode-manager.test.js.map +1 -1
  190. package/dist/test/cloudflare/sdk-setup.test.js +20 -2
  191. package/dist/test/cloudflare/sdk-setup.test.js.map +1 -1
  192. package/dist/test/cloudflare/templates.test.js +54 -0
  193. package/dist/test/cloudflare/templates.test.js.map +1 -1
  194. package/dist/test/cloudflare/wrap-worker.test.js +74 -11
  195. package/dist/test/cloudflare/wrap-worker.test.js.map +1 -1
  196. package/dist/test/constants.test.d.ts +1 -0
  197. package/dist/test/constants.test.js +12 -0
  198. package/dist/test/constants.test.js.map +1 -0
  199. package/dist/test/nextjs/templates.test.js +66 -33
  200. package/dist/test/nextjs/templates.test.js.map +1 -1
  201. package/dist/test/nuxt/templates.test.js +66 -36
  202. package/dist/test/nuxt/templates.test.js.map +1 -1
  203. package/dist/test/react-native/expo.test.js +140 -0
  204. package/dist/test/react-native/expo.test.js.map +1 -1
  205. package/dist/test/react-native/git.test.d.ts +1 -0
  206. package/dist/test/react-native/git.test.js +160 -0
  207. package/dist/test/react-native/git.test.js.map +1 -0
  208. package/dist/test/react-router/codemods/client-entry.test.js +38 -5
  209. package/dist/test/react-router/codemods/client-entry.test.js.map +1 -1
  210. package/dist/test/react-router/codemods/server-entry.test.js +83 -0
  211. package/dist/test/react-router/codemods/server-entry.test.js.map +1 -1
  212. package/dist/test/react-router/codemods/vite.test.js +89 -0
  213. package/dist/test/react-router/codemods/vite.test.js.map +1 -1
  214. package/dist/test/react-router/sdk-setup.test.js +98 -6
  215. package/dist/test/react-router/sdk-setup.test.js.map +1 -1
  216. package/dist/test/react-router/templates.test.js +50 -38
  217. package/dist/test/react-router/templates.test.js.map +1 -1
  218. package/dist/test/remix/build-script.test.d.ts +1 -0
  219. package/dist/test/remix/build-script.test.js +124 -0
  220. package/dist/test/remix/build-script.test.js.map +1 -0
  221. package/dist/test/remix/client-entry.test.js +4 -10
  222. package/dist/test/remix/client-entry.test.js.map +1 -1
  223. package/dist/test/run.test.d.ts +1 -0
  224. package/dist/test/run.test.js +137 -0
  225. package/dist/test/run.test.js.map +1 -0
  226. package/dist/test/sourcemaps/tools/vite.test.js +12 -8
  227. package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
  228. package/dist/test/sveltekit/templates.test.js +78 -27
  229. package/dist/test/sveltekit/templates.test.js.map +1 -1
  230. package/dist/test/utils/ast-utils.test.js +22 -0
  231. package/dist/test/utils/ast-utils.test.js.map +1 -1
  232. package/dist/test/utils/clack/index.test.js +101 -0
  233. package/dist/test/utils/clack/index.test.js.map +1 -1
  234. package/dist/test/utils/git.test.js +10 -0
  235. package/dist/test/utils/git.test.js.map +1 -1
  236. package/dist/test/utils/line-endings.test.d.ts +1 -0
  237. package/dist/test/utils/line-endings.test.js +103 -0
  238. package/dist/test/utils/line-endings.test.js.map +1 -0
  239. package/package.json +2 -2
  240. package/dist/src/react-router/codemods/root.d.ts +0 -1
  241. package/dist/src/react-router/codemods/root.js +0 -171
  242. package/dist/src/react-router/codemods/root.js.map +0 -1
  243. package/dist/test/react-router/codemods/root.test.js +0 -178
  244. package/dist/test/react-router/codemods/root.test.js.map +0 -1
  245. /package/dist/{test/react-router/codemods/root.test.d.ts → e2e-tests/tests/react-router-instrumentation-api.test.d.ts} +0 -0
@@ -40,8 +40,7 @@ const vitest_1 = require("vitest");
40
40
  })],
41
41
 
42
42
  replaysSessionSampleRate: 0.1,
43
- replaysOnErrorSampleRate: 1,
44
- sendDefaultPii: true
43
+ replaysOnErrorSampleRate: 1
45
44
  })"
46
45
  `);
47
46
  });
@@ -67,8 +66,7 @@ const vitest_1 = require("vitest");
67
66
  })],
68
67
 
69
68
  replaysSessionSampleRate: 0.1,
70
- replaysOnErrorSampleRate: 1,
71
- sendDefaultPii: true
69
+ replaysOnErrorSampleRate: 1
72
70
  })"
73
71
  `);
74
72
  });
@@ -100,9 +98,7 @@ const vitest_1 = require("vitest");
100
98
  useEffect,
101
99
  useLocation,
102
100
  useMatches
103
- })],
104
-
105
- sendDefaultPii: true
101
+ })]
106
102
  })"
107
103
  `);
108
104
  });
@@ -154,9 +150,7 @@ const vitest_1 = require("vitest");
154
150
  useEffect,
155
151
  useLocation,
156
152
  useMatches
157
- })],
158
-
159
- sendDefaultPii: true
153
+ })]
160
154
  })"
161
155
  `);
162
156
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ACpC,MAAM,gBAAgB,GAAG;YACvB,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;SACX,CAAC;QAEF,MAAM,MAAM,GAAG,IAAA,gCAAoB,EACjC,sBAAsB,EACtB,GAAG,EACH,gBAAgB,CACjB,CAAC;QAEF,IAAA,eAAM,EAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;KAuBpD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// @ts-expect-error - magicast is ESM and TS complains about that. It works though\nimport { parseModule } from 'magicast';\nimport { updateEntryClientMod } from '../../src/remix/sdk-setup';\nimport { describe, expect, it } from 'vitest';\n\ndescribe('initializeSentryOnEntryClient', () => {\n it('should initialize Sentry on client entry with all features enabled', () => {\n // Empty entry.client.tsx file for testing\n const originalEntryClientMod = parseModule('');\n\n const dsn = 'https://sentry.io/123';\n const selectedFeatures = {\n performance: true,\n replay: true,\n logs: true,\n };\n\n const result = updateEntryClientMod(\n originalEntryClientMod,\n dsn,\n selectedFeatures,\n );\n\n expect(result.generate().code).toMatchInlineSnapshot(`\n \"import { useEffect,} from \"react\";\n\n import {\n useLocation,\n useMatches,\n } from \"@remix-run/react\";\n\n import { init, replayIntegration, browserTracingIntegration,} from \"@sentry/remix\";\n\n init({\n dsn: \"https://sentry.io/123\",\n tracesSampleRate: 1,\n enableLogs: true,\n\n integrations: [browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n }), replayIntegration({\n maskAllText: true,\n blockAllMedia: true\n })],\n\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1,\n sendDefaultPii: true\n })\"\n `);\n });\n\n it('should initialize Sentry on client entry when performance disabled', () => {\n // Empty entry.client.tsx file for testing\n const originalEntryClientMod = parseModule('');\n\n const dsn = 'https://sentry.io/123';\n const selectedFeatures = {\n performance: false,\n replay: true,\n logs: false,\n };\n\n const result = updateEntryClientMod(\n originalEntryClientMod,\n dsn,\n selectedFeatures,\n );\n\n expect(result.generate().code).toMatchInlineSnapshot(`\n \"import { init, replayIntegration,} from \"@sentry/remix\";\n\n init({\n dsn: \"https://sentry.io/123\",\n\n integrations: [replayIntegration({\n maskAllText: true,\n blockAllMedia: true\n })],\n\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1,\n sendDefaultPii: true\n })\"\n `);\n });\n\n it('should initialize Sentry on client entry when replay disabled', () => {\n // Empty entry.client.tsx file for testing\n const originalEntryClientMod = parseModule('');\n\n const dsn = 'https://sentry.io/123';\n const selectedFeatures = {\n performance: true,\n replay: false,\n logs: false,\n };\n\n const result = updateEntryClientMod(\n originalEntryClientMod,\n dsn,\n selectedFeatures,\n );\n\n expect(result.generate().code).toMatchInlineSnapshot(`\n \"import { useEffect,} from \"react\";\n\n import {\n useLocation,\n useMatches,\n } from \"@remix-run/react\";\n\n import { init, browserTracingIntegration,} from \"@sentry/remix\";\n\n init({\n dsn: \"https://sentry.io/123\",\n tracesSampleRate: 1,\n\n integrations: [browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n })],\n\n sendDefaultPii: true\n })\"\n `);\n });\n\n it('should initialize Sentry on client entry with only logs enabled', () => {\n // Empty entry.client.tsx file for testing\n const originalEntryClientMod = parseModule('');\n\n const dsn = 'https://sentry.io/123';\n const selectedFeatures = {\n performance: false,\n replay: false,\n logs: true,\n };\n\n const result = updateEntryClientMod(\n originalEntryClientMod,\n dsn,\n selectedFeatures,\n );\n\n expect(result.generate().code).toMatchInlineSnapshot(`\n \"import { init,} from \"@sentry/remix\";\n\n init({\n dsn: \"https://sentry.io/123\",\n enableLogs: true\n })\"\n `);\n });\n\n it('should initialize Sentry on client entry with performance and logs enabled', () => {\n // Empty entry.client.tsx file for testing\n const originalEntryClientMod = parseModule('');\n\n const dsn = 'https://sentry.io/123';\n const selectedFeatures = {\n performance: true,\n replay: false,\n logs: true,\n };\n\n const result = updateEntryClientMod(\n originalEntryClientMod,\n dsn,\n selectedFeatures,\n );\n\n expect(result.generate().code).toMatchInlineSnapshot(`\n \"import { useEffect,} from \"react\";\n\n import {\n useLocation,\n useMatches,\n } from \"@remix-run/react\";\n\n import { init, browserTracingIntegration,} from \"@sentry/remix\";\n\n init({\n dsn: \"https://sentry.io/123\",\n tracesSampleRate: 1,\n enableLogs: true,\n\n integrations: [browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n })],\n\n sendDefaultPii: true\n })\"\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"client-entry.test.js","sourceRoot":"","sources":["../../../test/remix/client-entry.test.ts"],"names":[],"mappings":";;AAAA,kFAAkF;AAClF,uCAAuC;AACvC,yDAAiE;AACjE,mCAA8C;AAE9C,IAAA,iBAAQ,EAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,IAAA,WAAE,EAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,0CAA0C;QAC1C,MAAM,sBAAsB,GAAG,IAAA,sBAAW,EAAC,EAAE,CAAC,CAAC;QAE/C,MAAM,GAAG,GAAG,uBAAuB,CAAC;QACpC,MAAM,gBAAgB,GAAG;YACvB,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,IAAI;YACZ,IAAI,EAAE,IAAI;SACX,CAAC;QAEF,MAAM,MAAM,GAAG,IAAA,gCAAoB,EACjC,sBAAsB,EACtB,GAAG,EACH,gBAAgB,CACjB,CAAC;QAEF,IAAA,eAAM,EAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BpD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,0CAA0C;QAC1C,MAAM,sBAAsB,GAAG,IAAA,sBAAW,EAAC,EAAE,CAAC,CAAC;QAE/C,MAAM,GAAG,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,EACH,gBAAgB,CACjB,CAAC;QAEF,IAAA,eAAM,EAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,qBAAqB,CAAC;;;;;;;KAOpD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,4EAA4E,EAAE,GAAG,EAAE;QACpF,0CAA0C;QAC1C,MAAM,sBAAsB,GAAG,IAAA,sBAAW,EAAC,EAAE,CAAC,CAAC;QAE/C,MAAM,GAAG,GAAG,uBAAuB,CAAC;QACpC,MAAM,gBAAgB,GAAG;YACvB,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;SACX,CAAC;QAEF,MAAM,MAAM,GAAG,IAAA,gCAAoB,EACjC,sBAAsB,EACtB,GAAG,EACH,gBAAgB,CACjB,CAAC;QAEF,IAAA,eAAM,EAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;KAqBpD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// @ts-expect-error - magicast is ESM and TS complains about that. It works though\nimport { parseModule } from 'magicast';\nimport { updateEntryClientMod } from '../../src/remix/sdk-setup';\nimport { describe, expect, it } from 'vitest';\n\ndescribe('initializeSentryOnEntryClient', () => {\n it('should initialize Sentry on client entry with all features enabled', () => {\n // Empty entry.client.tsx file for testing\n const originalEntryClientMod = parseModule('');\n\n const dsn = 'https://sentry.io/123';\n const selectedFeatures = {\n performance: true,\n replay: true,\n logs: true,\n };\n\n const result = updateEntryClientMod(\n originalEntryClientMod,\n dsn,\n selectedFeatures,\n );\n\n expect(result.generate().code).toMatchInlineSnapshot(`\n \"import { useEffect,} from \"react\";\n\n import {\n useLocation,\n useMatches,\n } from \"@remix-run/react\";\n\n import { init, replayIntegration, browserTracingIntegration,} from \"@sentry/remix\";\n\n init({\n dsn: \"https://sentry.io/123\",\n tracesSampleRate: 1,\n enableLogs: true,\n\n integrations: [browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n }), replayIntegration({\n maskAllText: true,\n blockAllMedia: true\n })],\n\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1\n })\"\n `);\n });\n\n it('should initialize Sentry on client entry when performance disabled', () => {\n // Empty entry.client.tsx file for testing\n const originalEntryClientMod = parseModule('');\n\n const dsn = 'https://sentry.io/123';\n const selectedFeatures = {\n performance: false,\n replay: true,\n logs: false,\n };\n\n const result = updateEntryClientMod(\n originalEntryClientMod,\n dsn,\n selectedFeatures,\n );\n\n expect(result.generate().code).toMatchInlineSnapshot(`\n \"import { init, replayIntegration,} from \"@sentry/remix\";\n\n init({\n dsn: \"https://sentry.io/123\",\n\n integrations: [replayIntegration({\n maskAllText: true,\n blockAllMedia: true\n })],\n\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1\n })\"\n `);\n });\n\n it('should initialize Sentry on client entry when replay disabled', () => {\n // Empty entry.client.tsx file for testing\n const originalEntryClientMod = parseModule('');\n\n const dsn = 'https://sentry.io/123';\n const selectedFeatures = {\n performance: true,\n replay: false,\n logs: false,\n };\n\n const result = updateEntryClientMod(\n originalEntryClientMod,\n dsn,\n selectedFeatures,\n );\n\n expect(result.generate().code).toMatchInlineSnapshot(`\n \"import { useEffect,} from \"react\";\n\n import {\n useLocation,\n useMatches,\n } from \"@remix-run/react\";\n\n import { init, browserTracingIntegration,} from \"@sentry/remix\";\n\n init({\n dsn: \"https://sentry.io/123\",\n tracesSampleRate: 1,\n\n integrations: [browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n })]\n })\"\n `);\n });\n\n it('should initialize Sentry on client entry with only logs enabled', () => {\n // Empty entry.client.tsx file for testing\n const originalEntryClientMod = parseModule('');\n\n const dsn = 'https://sentry.io/123';\n const selectedFeatures = {\n performance: false,\n replay: false,\n logs: true,\n };\n\n const result = updateEntryClientMod(\n originalEntryClientMod,\n dsn,\n selectedFeatures,\n );\n\n expect(result.generate().code).toMatchInlineSnapshot(`\n \"import { init,} from \"@sentry/remix\";\n\n init({\n dsn: \"https://sentry.io/123\",\n enableLogs: true\n })\"\n `);\n });\n\n it('should initialize Sentry on client entry with performance and logs enabled', () => {\n // Empty entry.client.tsx file for testing\n const originalEntryClientMod = parseModule('');\n\n const dsn = 'https://sentry.io/123';\n const selectedFeatures = {\n performance: true,\n replay: false,\n logs: true,\n };\n\n const result = updateEntryClientMod(\n originalEntryClientMod,\n dsn,\n selectedFeatures,\n );\n\n expect(result.generate().code).toMatchInlineSnapshot(`\n \"import { useEffect,} from \"react\";\n\n import {\n useLocation,\n useMatches,\n } from \"@remix-run/react\";\n\n import { init, browserTracingIntegration,} from \"@sentry/remix\";\n\n init({\n dsn: \"https://sentry.io/123\",\n tracesSampleRate: 1,\n enableLogs: true,\n\n integrations: [browserTracingIntegration({\n useEffect,\n useLocation,\n useMatches\n })]\n })\"\n `);\n });\n});\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const vitest_1 = require("vitest");
4
+ const wizardMocks = vitest_1.vi.hoisted(() => ({
5
+ legacyRun: vitest_1.vi.fn(),
6
+ readEnvironment: vitest_1.vi.fn(() => ({})),
7
+ runAndroidWizard: vitest_1.vi.fn(),
8
+ runAngularWizard: vitest_1.vi.fn(),
9
+ runAppleSnapshotsWizard: vitest_1.vi.fn(),
10
+ runAppleWizard: vitest_1.vi.fn(),
11
+ runCloudflareWizard: vitest_1.vi.fn(),
12
+ runFlutterWizard: vitest_1.vi.fn(),
13
+ runNextjsWizard: vitest_1.vi.fn(),
14
+ runNuxtWizard: vitest_1.vi.fn(),
15
+ runReactNativeWizard: vitest_1.vi.fn(),
16
+ runReactRouterWizard: vitest_1.vi.fn(),
17
+ runRemixWizard: vitest_1.vi.fn(),
18
+ runSourcemapsWizard: vitest_1.vi.fn(),
19
+ runSvelteKitWizard: vitest_1.vi.fn(),
20
+ }));
21
+ vitest_1.vi.mock('@clack/prompts', () => ({
22
+ intro: vitest_1.vi.fn(),
23
+ log: {
24
+ error: vitest_1.vi.fn(),
25
+ },
26
+ outro: vitest_1.vi.fn(),
27
+ select: vitest_1.vi.fn(),
28
+ }));
29
+ vitest_1.vi.mock('../lib/Helper/Env', () => ({
30
+ readEnvironment: wizardMocks.readEnvironment,
31
+ }));
32
+ vitest_1.vi.mock('../lib/Setup', () => ({
33
+ run: wizardMocks.legacyRun,
34
+ }));
35
+ vitest_1.vi.mock('../src/android/android-wizard', () => ({
36
+ runAndroidWizard: wizardMocks.runAndroidWizard,
37
+ }));
38
+ vitest_1.vi.mock('../src/angular/angular-wizard', () => ({
39
+ runAngularWizard: wizardMocks.runAngularWizard,
40
+ }));
41
+ vitest_1.vi.mock('../src/apple/apple-wizard', () => ({
42
+ runAppleWizard: wizardMocks.runAppleWizard,
43
+ }));
44
+ vitest_1.vi.mock('../src/apple/snapshots/apple-snapshots-wizard', () => ({
45
+ runAppleSnapshotsWizard: wizardMocks.runAppleSnapshotsWizard,
46
+ }));
47
+ vitest_1.vi.mock('../src/cloudflare/cloudflare-wizard', () => ({
48
+ runCloudflareWizard: wizardMocks.runCloudflareWizard,
49
+ }));
50
+ vitest_1.vi.mock('../src/flutter/flutter-wizard', () => ({
51
+ runFlutterWizard: wizardMocks.runFlutterWizard,
52
+ }));
53
+ vitest_1.vi.mock('../src/nextjs/nextjs-wizard', () => ({
54
+ runNextjsWizard: wizardMocks.runNextjsWizard,
55
+ }));
56
+ vitest_1.vi.mock('../src/nuxt/nuxt-wizard', () => ({
57
+ runNuxtWizard: wizardMocks.runNuxtWizard,
58
+ }));
59
+ vitest_1.vi.mock('../src/react-native/react-native-wizard', () => ({
60
+ runReactNativeWizard: wizardMocks.runReactNativeWizard,
61
+ }));
62
+ vitest_1.vi.mock('../src/react-router/react-router-wizard', () => ({
63
+ runReactRouterWizard: wizardMocks.runReactRouterWizard,
64
+ }));
65
+ vitest_1.vi.mock('../src/remix/remix-wizard', () => ({
66
+ runRemixWizard: wizardMocks.runRemixWizard,
67
+ }));
68
+ vitest_1.vi.mock('../src/sourcemaps/sourcemaps-wizard', () => ({
69
+ runSourcemapsWizard: wizardMocks.runSourcemapsWizard,
70
+ }));
71
+ vitest_1.vi.mock('../src/sveltekit/sveltekit-wizard', () => ({
72
+ runSvelteKitWizard: wizardMocks.runSvelteKitWizard,
73
+ }));
74
+ vitest_1.vi.mock('../src/utils/debug', () => ({
75
+ enableDebugLogs: vitest_1.vi.fn(),
76
+ }));
77
+ vitest_1.vi.mock('../src/utils/clack', () => ({
78
+ abortIfCancelled: async (input) => await input,
79
+ }));
80
+ const run_1 = require("../src/run");
81
+ function getBaseArgs(integration) {
82
+ return {
83
+ integration,
84
+ uninstall: false,
85
+ signup: false,
86
+ skipConnect: false,
87
+ debug: false,
88
+ quiet: false,
89
+ nonInteractive: false,
90
+ disableTelemetry: true,
91
+ };
92
+ }
93
+ (0, vitest_1.describe)('run', () => {
94
+ (0, vitest_1.beforeEach)(() => {
95
+ vitest_1.vi.clearAllMocks();
96
+ wizardMocks.readEnvironment.mockReturnValue({});
97
+ });
98
+ (0, vitest_1.it)('routes appleSnapshots to the Apple Snapshots wizard with Apple target options', async () => {
99
+ await (0, run_1.run)({
100
+ ...getBaseArgs('appleSnapshots'),
101
+ appTarget: 'App',
102
+ hostedTestTarget: 'AppTests',
103
+ nonInteractive: true,
104
+ xcodeProjectDir: '/tmp/MyApp',
105
+ });
106
+ (0, vitest_1.expect)(wizardMocks.runAppleSnapshotsWizard).toHaveBeenCalledWith(vitest_1.expect.objectContaining({
107
+ appTarget: 'App',
108
+ hostedTestTarget: 'AppTests',
109
+ nonInteractive: true,
110
+ telemetryEnabled: false,
111
+ projectDir: '/tmp/MyApp',
112
+ }));
113
+ (0, vitest_1.expect)(wizardMocks.runAppleWizard).not.toHaveBeenCalled();
114
+ });
115
+ (0, vitest_1.it)('passes quiet through to the existing Cordova wizard', async () => {
116
+ await (0, run_1.run)({
117
+ ...getBaseArgs('cordova'),
118
+ quiet: true,
119
+ });
120
+ (0, vitest_1.expect)(wizardMocks.legacyRun).toHaveBeenCalledWith(vitest_1.expect.objectContaining({
121
+ integration: 'cordova',
122
+ quiet: true,
123
+ }), vitest_1.expect.any(Object));
124
+ });
125
+ (0, vitest_1.it)('keeps ios routing on the existing Apple wizard', async () => {
126
+ await (0, run_1.run)({
127
+ ...getBaseArgs('ios'),
128
+ xcodeProjectDir: '/tmp/MyApp',
129
+ });
130
+ (0, vitest_1.expect)(wizardMocks.runAppleWizard).toHaveBeenCalledWith(vitest_1.expect.objectContaining({
131
+ telemetryEnabled: false,
132
+ projectDir: '/tmp/MyApp',
133
+ }));
134
+ (0, vitest_1.expect)(wizardMocks.runAppleSnapshotsWizard).not.toHaveBeenCalled();
135
+ });
136
+ });
137
+ //# sourceMappingURL=run.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.test.js","sourceRoot":"","sources":["../../test/run.test.ts"],"names":[],"mappings":";;AAAA,mCAA8D;AAE9D,MAAM,WAAW,GAAG,WAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACpC,SAAS,EAAE,WAAE,CAAC,EAAE,EAAE;IAClB,eAAe,EAAE,WAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAClC,gBAAgB,EAAE,WAAE,CAAC,EAAE,EAAE;IACzB,gBAAgB,EAAE,WAAE,CAAC,EAAE,EAAE;IACzB,uBAAuB,EAAE,WAAE,CAAC,EAAE,EAAE;IAChC,cAAc,EAAE,WAAE,CAAC,EAAE,EAAE;IACvB,mBAAmB,EAAE,WAAE,CAAC,EAAE,EAAE;IAC5B,gBAAgB,EAAE,WAAE,CAAC,EAAE,EAAE;IACzB,eAAe,EAAE,WAAE,CAAC,EAAE,EAAE;IACxB,aAAa,EAAE,WAAE,CAAC,EAAE,EAA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AAE,UAAU;YAC5B,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,KAAK;YACvB,UAAU,EAAE,YAAY;SACzB,CAAC,CACH,CAAC;QACF,IAAA,eAAM,EAAC,WAAW,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,IAAA,SAAG,EAAC;YACR,GAAG,WAAW,CAAC,SAAS,CAAC;YACzB,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,WAAW,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAChD,eAAM,CAAC,gBAAgB,CAAC;YACtB,WAAW,EAAE,SAAS;YACtB,KAAK,EAAE,IAAI;SACZ,CAAC,EACF,eAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CACnB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,gDAAgD,EAAE,KAAK,IAAI,EAAE;QAC9D,MAAM,IAAA,SAAG,EAAC;YACR,GAAG,WAAW,CAAC,KAAK,CAAC;YACrB,eAAe,EAAE,YAAY;SAC9B,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,WAAW,CAAC,cAAc,CAAC,CAAC,oBAAoB,CACrD,eAAM,CAAC,gBAAgB,CAAC;YACtB,gBAAgB,EAAE,KAAK;YACvB,UAAU,EAAE,YAAY;SACzB,CAAC,CACH,CAAC;QACF,IAAA,eAAM,EAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACrE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { beforeEach, describe, expect, it, vi } from 'vitest';\n\nconst wizardMocks = vi.hoisted(() => ({\n legacyRun: vi.fn(),\n readEnvironment: vi.fn(() => ({})),\n runAndroidWizard: vi.fn(),\n runAngularWizard: vi.fn(),\n runAppleSnapshotsWizard: vi.fn(),\n runAppleWizard: vi.fn(),\n runCloudflareWizard: vi.fn(),\n runFlutterWizard: vi.fn(),\n runNextjsWizard: vi.fn(),\n runNuxtWizard: vi.fn(),\n runReactNativeWizard: vi.fn(),\n runReactRouterWizard: vi.fn(),\n runRemixWizard: vi.fn(),\n runSourcemapsWizard: vi.fn(),\n runSvelteKitWizard: vi.fn(),\n}));\n\nvi.mock('@clack/prompts', () => ({\n intro: vi.fn(),\n log: {\n error: vi.fn(),\n },\n outro: vi.fn(),\n select: vi.fn(),\n}));\n\nvi.mock('../lib/Helper/Env', () => ({\n readEnvironment: wizardMocks.readEnvironment,\n}));\n\nvi.mock('../lib/Setup', () => ({\n run: wizardMocks.legacyRun,\n}));\n\nvi.mock('../src/android/android-wizard', () => ({\n runAndroidWizard: wizardMocks.runAndroidWizard,\n}));\n\nvi.mock('../src/angular/angular-wizard', () => ({\n runAngularWizard: wizardMocks.runAngularWizard,\n}));\n\nvi.mock('../src/apple/apple-wizard', () => ({\n runAppleWizard: wizardMocks.runAppleWizard,\n}));\n\nvi.mock('../src/apple/snapshots/apple-snapshots-wizard', () => ({\n runAppleSnapshotsWizard: wizardMocks.runAppleSnapshotsWizard,\n}));\n\nvi.mock('../src/cloudflare/cloudflare-wizard', () => ({\n runCloudflareWizard: wizardMocks.runCloudflareWizard,\n}));\n\nvi.mock('../src/flutter/flutter-wizard', () => ({\n runFlutterWizard: wizardMocks.runFlutterWizard,\n}));\n\nvi.mock('../src/nextjs/nextjs-wizard', () => ({\n runNextjsWizard: wizardMocks.runNextjsWizard,\n}));\n\nvi.mock('../src/nuxt/nuxt-wizard', () => ({\n runNuxtWizard: wizardMocks.runNuxtWizard,\n}));\n\nvi.mock('../src/react-native/react-native-wizard', () => ({\n runReactNativeWizard: wizardMocks.runReactNativeWizard,\n}));\n\nvi.mock('../src/react-router/react-router-wizard', () => ({\n runReactRouterWizard: wizardMocks.runReactRouterWizard,\n}));\n\nvi.mock('../src/remix/remix-wizard', () => ({\n runRemixWizard: wizardMocks.runRemixWizard,\n}));\n\nvi.mock('../src/sourcemaps/sourcemaps-wizard', () => ({\n runSourcemapsWizard: wizardMocks.runSourcemapsWizard,\n}));\n\nvi.mock('../src/sveltekit/sveltekit-wizard', () => ({\n runSvelteKitWizard: wizardMocks.runSvelteKitWizard,\n}));\n\nvi.mock('../src/utils/debug', () => ({\n enableDebugLogs: vi.fn(),\n}));\n\nvi.mock('../src/utils/clack', () => ({\n abortIfCancelled: async <T>(input: T | Promise<T>): Promise<T> => await input,\n}));\n\nimport { run } from '../src/run';\n\ntype RunArgs = Parameters<typeof run>[0];\n\nfunction getBaseArgs(integration: RunArgs['integration']): RunArgs {\n return {\n integration,\n uninstall: false,\n signup: false,\n skipConnect: false,\n debug: false,\n quiet: false,\n nonInteractive: false,\n disableTelemetry: true,\n };\n}\n\ndescribe('run', () => {\n beforeEach(() => {\n vi.clearAllMocks();\n wizardMocks.readEnvironment.mockReturnValue({});\n });\n\n it('routes appleSnapshots to the Apple Snapshots wizard with Apple target options', async () => {\n await run({\n ...getBaseArgs('appleSnapshots'),\n appTarget: 'App',\n hostedTestTarget: 'AppTests',\n nonInteractive: true,\n xcodeProjectDir: '/tmp/MyApp',\n });\n\n expect(wizardMocks.runAppleSnapshotsWizard).toHaveBeenCalledWith(\n expect.objectContaining({\n appTarget: 'App',\n hostedTestTarget: 'AppTests',\n nonInteractive: true,\n telemetryEnabled: false,\n projectDir: '/tmp/MyApp',\n }),\n );\n expect(wizardMocks.runAppleWizard).not.toHaveBeenCalled();\n });\n\n it('passes quiet through to the existing Cordova wizard', async () => {\n await run({\n ...getBaseArgs('cordova'),\n quiet: true,\n });\n\n expect(wizardMocks.legacyRun).toHaveBeenCalledWith(\n expect.objectContaining({\n integration: 'cordova',\n quiet: true,\n }),\n expect.any(Object),\n );\n });\n\n it('keeps ios routing on the existing Apple wizard', async () => {\n await run({\n ...getBaseArgs('ios'),\n xcodeProjectDir: '/tmp/MyApp',\n });\n\n expect(wizardMocks.runAppleWizard).toHaveBeenCalledWith(\n expect.objectContaining({\n telemetryEnabled: false,\n projectDir: '/tmp/MyApp',\n }),\n );\n expect(wizardMocks.runAppleSnapshotsWizard).not.toHaveBeenCalled();\n });\n});\n"]}
@@ -67,7 +67,8 @@ export default defineConfig({
67
67
  build: {
68
68
  sourcemap: true
69
69
  }
70
- })`,
70
+ })
71
+ `,
71
72
  ],
72
73
  [
73
74
  'no build.sourcemap options',
@@ -77,10 +78,10 @@ export default defineConfig({
77
78
  vue(),
78
79
  ],
79
80
  build: {
80
- test: 1,
81
+ test: 1,
81
82
  }
82
83
  })
83
- `,
84
+ `,
84
85
  `import { sentryVitePlugin } from "@sentry/vite-plugin";
85
86
  export default defineConfig({
86
87
  plugins: [vue(), sentryVitePlugin({
@@ -91,7 +92,8 @@ export default defineConfig({
91
92
  test: 1,
92
93
  sourcemap: true
93
94
  }
94
- })`,
95
+ })
96
+ `,
95
97
  ],
96
98
  [
97
99
  'keep sourcemap: "hidden"',
@@ -104,7 +106,7 @@ export default {
104
106
  sourcemap: "hidden",
105
107
  }
106
108
  }
107
- `,
109
+ `,
108
110
  `import { sentryVitePlugin } from "@sentry/vite-plugin";
109
111
  export default {
110
112
  plugins: [vue(), sentryVitePlugin({
@@ -114,7 +116,8 @@ export default {
114
116
  build: {
115
117
  sourcemap: "hidden",
116
118
  }
117
- }`,
119
+ }
120
+ `,
118
121
  ],
119
122
  [
120
123
  'rewrite sourcemap: false to true',
@@ -129,7 +132,7 @@ const cfg = {
129
132
  }
130
133
 
131
134
  export default cfg;
132
- `,
135
+ `,
133
136
  `import { sentryVitePlugin } from "@sentry/vite-plugin";
134
137
  const cfg = {
135
138
  plugins: [vue(), sentryVitePlugin({
@@ -142,7 +145,8 @@ const cfg = {
142
145
  }
143
146
  }
144
147
 
145
- export default cfg;`,
148
+ export default cfg;
149
+ `,
146
150
  ],
147
151
  ])('adds the plugin and enables source maps generation (%s)', async (_, originalCode, expectedCode) => {
148
152
  updateFileContent(originalCode);
@@ -1 +1 @@
1
- {"version":3,"file":"vite.test.js","sourceRoot":"","sources":["../../../../test/sourcemaps/tools/vite.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,6DAA2E;AAE3E,mCAA6D;AAE7D,SAAS,iBAAiB,CAAC,OAAe;IACxC,WAAW,GAAG,OAAO,CAAC;AACxB,CAAC;AAED,IAAI,WAAW,GAAG,EAAE,CAAC;AAErB,WAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC7B,OAAO;QACL,GAAG,EAAE;YACH,IAAI,EAAE,WAAE,CAAC,EAAE,EAAE;YACb,OAAO,EAAE,WAAE,CAAC,EAAE,EAAE;SACjB;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAE,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,CACxD,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAC7B,CAAC;AAEF,MAAM,YAAY,GAAG,WAAE;KACpB,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;KAC/B,kBAAkB,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAErD,IAAA,iBAAQ,EAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,IAAA,kBAAS,EAAC,GAAG,EAAE;QACb,WAAW,GAAG,EAAE,CAAC;QACjB,WAAE,CAAC,aAAa,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,WAAE,CAAC,IAAI,CAAC;QACN;YACE,kBAAkB;YAClB;;;;;;CAML;YACK;;;;;;;;;;GAUH;SACE;QACD;YACE,4BAA4B;YAC5B;;;;;;;;;GASH;YACG;;;;;;;;;;GAUH;SACE;QACD;YACE,0BAA0B;YAC1B;;;;;;;;;KASD;YACC;;;;;;;;;EASJ;SACG;QACD;YACE,kCAAkC;YAClC;;;;;;;;;;;OAWC;YACD;;;;;;;;;;;;oBAYc;SACf;KACF,CAAC,CACA,yDAAyD,EACzD,KAAK,EAAE,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE;QACtC,iBAAiB,CAAC,YAAY,CAAC,CAAC;QAEhC,MAAM,SAAS,GAAG,MAAM,IAAA,4BAAqB,EAAC,EAAE,EAAE;YAChD,SAAS,EAAE,EAAE;YACb,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,YAAY;YACzB,UAAU,EAAE,KAAK;YACjB,GAAG,EAAE,oBAAoB;SAC1B,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;QAClD,IAAA,eAAM,EAAC,WAAW,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACvC,IAAA,eAAM,EAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as fs from 'fs';\nimport { addVitePluginToConfig } from '../../../src/sourcemaps/tools/vite';\n\nimport { vi, it, describe, expect, afterEach } from 'vitest';\n\nfunction updateFileContent(content: string): void {\n fileContent = content;\n}\n\nlet fileContent = '';\n\nvi.mock('@clack/prompts', () => {\n return {\n log: {\n info: vi.fn(),\n success: vi.fn(),\n },\n };\n});\n\nvi.spyOn(fs.promises, 'readFile').mockImplementation(() =>\n Promise.resolve(fileContent),\n);\n\nconst writeFileSpy = vi\n .spyOn(fs.promises, 'writeFile')\n .mockImplementation(() => Promise.resolve(void 0));\n\ndescribe('addVitePluginToConfig', () => {\n afterEach(() => {\n fileContent = '';\n vi.clearAllMocks();\n });\n\n it.each([\n [\n 'no build options',\n `\nexport default defineConfig({\n plugins: [\n vue(),\n ],\n})\n`,\n `import { sentryVitePlugin } from \"@sentry/vite-plugin\";\nexport default defineConfig({\n plugins: [vue(), sentryVitePlugin({\n org: \"my-org\",\n project: \"my-project\"\n })],\n\n build: {\n sourcemap: true\n }\n})`,\n ],\n [\n 'no build.sourcemap options',\n `\nexport default defineConfig({\n plugins: [\n vue(),\n ],\n build: {\n test: 1, \n }\n})\n `,\n `import { sentryVitePlugin } from \"@sentry/vite-plugin\";\nexport default defineConfig({\n plugins: [vue(), sentryVitePlugin({\n org: \"my-org\",\n project: \"my-project\"\n })],\n build: {\n test: 1,\n sourcemap: true\n }\n})`,\n ],\n [\n 'keep sourcemap: \"hidden\"',\n `\nexport default {\n plugins: [\n vue(),\n ],\n build: {\n sourcemap: \"hidden\",\n }\n}\n `,\n `import { sentryVitePlugin } from \"@sentry/vite-plugin\";\nexport default {\n plugins: [vue(), sentryVitePlugin({\n org: \"my-org\",\n project: \"my-project\"\n })],\n build: {\n sourcemap: \"hidden\",\n }\n}`,\n ],\n [\n 'rewrite sourcemap: false to true',\n `\nconst cfg = {\n plugins: [\n vue(),\n ],\n build: {\n sourcemap: false,\n }\n}\n\nexport default cfg;\n `,\n `import { sentryVitePlugin } from \"@sentry/vite-plugin\";\nconst cfg = {\n plugins: [vue(), sentryVitePlugin({\n org: \"my-org\",\n project: \"my-project\"\n })],\n\n build: {\n sourcemap: true,\n }\n}\n\nexport default cfg;`,\n ],\n ])(\n 'adds the plugin and enables source maps generation (%s)',\n async (_, originalCode, expectedCode) => {\n updateFileContent(originalCode);\n\n const addedCode = await addVitePluginToConfig('', {\n authToken: '',\n orgSlug: 'my-org',\n projectSlug: 'my-project',\n selfHosted: false,\n url: 'https://sentry.io/',\n });\n\n expect(writeFileSpy).toHaveBeenCalledTimes(1);\n const [[, fileContent]] = writeFileSpy.mock.calls;\n expect(fileContent).toBe(expectedCode);\n expect(addedCode).toBe(true);\n },\n );\n});\n"]}
1
+ {"version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;;;;;;;;;;;CAWL;YACK;;;;;;;;;;;;;CAaL;SACI;KACF,CAAC,CACA,yDAAyD,EACzD,KAAK,EAAE,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE;QACtC,iBAAiB,CAAC,YAAY,CAAC,CAAC;QAEhC,MAAM,SAAS,GAAG,MAAM,IAAA,4BAAqB,EAAC,EAAE,EAAE;YAChD,SAAS,EAAE,EAAE;YACb,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,YAAY;YACzB,UAAU,EAAE,KAAK;YACjB,GAAG,EAAE,oBAAoB;SAC1B,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;QAClD,IAAA,eAAM,EAAC,WAAW,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACvC,IAAA,eAAM,EAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as fs from 'fs';\nimport { addVitePluginToConfig } from '../../../src/sourcemaps/tools/vite';\n\nimport { vi, it, describe, expect, afterEach } from 'vitest';\n\nfunction updateFileContent(content: string): void {\n fileContent = content;\n}\n\nlet fileContent = '';\n\nvi.mock('@clack/prompts', () => {\n return {\n log: {\n info: vi.fn(),\n success: vi.fn(),\n },\n };\n});\n\nvi.spyOn(fs.promises, 'readFile').mockImplementation(() =>\n Promise.resolve(fileContent),\n);\n\nconst writeFileSpy = vi\n .spyOn(fs.promises, 'writeFile')\n .mockImplementation(() => Promise.resolve(void 0));\n\ndescribe('addVitePluginToConfig', () => {\n afterEach(() => {\n fileContent = '';\n vi.clearAllMocks();\n });\n\n it.each([\n [\n 'no build options',\n `\nexport default defineConfig({\n plugins: [\n vue(),\n ],\n})\n`,\n `import { sentryVitePlugin } from \"@sentry/vite-plugin\";\nexport default defineConfig({\n plugins: [vue(), sentryVitePlugin({\n org: \"my-org\",\n project: \"my-project\"\n })],\n\n build: {\n sourcemap: true\n }\n})\n`,\n ],\n [\n 'no build.sourcemap options',\n `\nexport default defineConfig({\n plugins: [\n vue(),\n ],\n build: {\n test: 1,\n }\n})\n`,\n `import { sentryVitePlugin } from \"@sentry/vite-plugin\";\nexport default defineConfig({\n plugins: [vue(), sentryVitePlugin({\n org: \"my-org\",\n project: \"my-project\"\n })],\n build: {\n test: 1,\n sourcemap: true\n }\n})\n`,\n ],\n [\n 'keep sourcemap: \"hidden\"',\n `\nexport default {\n plugins: [\n vue(),\n ],\n build: {\n sourcemap: \"hidden\",\n }\n}\n`,\n `import { sentryVitePlugin } from \"@sentry/vite-plugin\";\nexport default {\n plugins: [vue(), sentryVitePlugin({\n org: \"my-org\",\n project: \"my-project\"\n })],\n build: {\n sourcemap: \"hidden\",\n }\n}\n`,\n ],\n [\n 'rewrite sourcemap: false to true',\n `\nconst cfg = {\n plugins: [\n vue(),\n ],\n build: {\n sourcemap: false,\n }\n}\n\nexport default cfg;\n`,\n `import { sentryVitePlugin } from \"@sentry/vite-plugin\";\nconst cfg = {\n plugins: [vue(), sentryVitePlugin({\n org: \"my-org\",\n project: \"my-project\"\n })],\n\n build: {\n sourcemap: true,\n }\n}\n\nexport default cfg;\n`,\n ],\n ])(\n 'adds the plugin and enables source maps generation (%s)',\n async (_, originalCode, expectedCode) => {\n updateFileContent(originalCode);\n\n const addedCode = await addVitePluginToConfig('', {\n authToken: '',\n orgSlug: 'my-org',\n projectSlug: 'my-project',\n selfHosted: false,\n url: 'https://sentry.io/',\n });\n\n expect(writeFileSpy).toHaveBeenCalledTimes(1);\n const [[, fileContent]] = writeFileSpy.mock.calls;\n expect(fileContent).toBe(expectedCode);\n expect(addedCode).toBe(true);\n },\n );\n});\n"]}
@@ -38,9 +38,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
38
38
  // If you don't want to use Session Replay, just remove the line below:
39
39
  integrations: [replayIntegration()],
40
40
 
41
- // Enable sending user PII (Personally Identifiable Information)
42
- // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
43
- sendDefaultPii: true,
41
+ dataCollection: {
42
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
43
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
44
+ // userInfo: false,
45
+ // httpBodies: [],
46
+ },
44
47
  });
45
48
 
46
49
  // If you have a custom error handler, pass it to \`handleErrorWithSentry\`
@@ -73,9 +76,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
73
76
  // If you don't want to use Session Replay, just remove the line below:
74
77
  integrations: [replayIntegration()],
75
78
 
76
- // Enable sending user PII (Personally Identifiable Information)
77
- // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
78
- sendDefaultPii: true,
79
+ dataCollection: {
80
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
81
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
82
+ // userInfo: false,
83
+ // httpBodies: [],
84
+ },
79
85
  });
80
86
 
81
87
  // If you have a custom error handler, pass it to \`handleErrorWithSentry\`
@@ -101,9 +107,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
101
107
 
102
108
 
103
109
 
104
- // Enable sending user PII (Personally Identifiable Information)
105
- // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
106
- sendDefaultPii: true,
110
+ dataCollection: {
111
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
112
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
113
+ // userInfo: false,
114
+ // httpBodies: [],
115
+ },
107
116
  });
108
117
 
109
118
  // If you have a custom error handler, pass it to \`handleErrorWithSentry\`
@@ -129,9 +138,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
129
138
 
130
139
 
131
140
 
132
- // Enable sending user PII (Personally Identifiable Information)
133
- // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
134
- sendDefaultPii: true,
141
+ dataCollection: {
142
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
143
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
144
+ // userInfo: false,
145
+ // httpBodies: [],
146
+ },
135
147
  });
136
148
 
137
149
  // If you have a custom error handler, pass it to \`handleErrorWithSentry\`
@@ -161,9 +173,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
161
173
  enableLogs: true,
162
174
 
163
175
 
164
- // Enable sending user PII (Personally Identifiable Information)
165
- // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
166
- sendDefaultPii: true,
176
+ dataCollection: {
177
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
178
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
179
+ // userInfo: false,
180
+ // httpBodies: [],
181
+ },
167
182
 
168
183
  // uncomment the line below to enable Spotlight (https://spotlightjs.com)
169
184
  // spotlight: import.meta.env.DEV,
@@ -193,9 +208,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
193
208
 
194
209
 
195
210
 
196
- // Enable sending user PII (Personally Identifiable Information)
197
- // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
198
- sendDefaultPii: true,
211
+ dataCollection: {
212
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
213
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
214
+ // userInfo: false,
215
+ // httpBodies: [],
216
+ },
199
217
 
200
218
  // uncomment the line below to enable Spotlight (https://spotlightjs.com)
201
219
  // spotlight: import.meta.env.DEV,
@@ -227,9 +245,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
227
245
  enableLogs: true,
228
246
 
229
247
 
230
- // Enable sending user PII (Personally Identifiable Information)
231
- // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
232
- sendDefaultPii: true,
248
+ dataCollection: {
249
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
250
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
251
+ // userInfo: false,
252
+ // httpBodies: [],
253
+ },
233
254
 
234
255
  // uncomment the line below to enable Spotlight (https://spotlightjs.com)
235
256
  // spotlight: import.meta.env.DEV,
@@ -364,7 +385,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
364
385
  replaysOnErrorSampleRate: 1,
365
386
  integrations: [Sentry.replayIntegration()],
366
387
  enableLogs: true,
367
- sendDefaultPii: true
388
+ dataCollection: {
389
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
390
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
391
+ // userInfo: false,
392
+ // httpBodies: [],
393
+ },
368
394
  })
369
395
 
370
396
  export const handleError = handleErrorWithSentry();"
@@ -394,7 +420,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
394
420
  replaysSessionSampleRate: 0.1,
395
421
  replaysOnErrorSampleRate: 1,
396
422
  integrations: [Sentry.replayIntegration()],
397
- sendDefaultPii: true
423
+ dataCollection: {
424
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
425
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
426
+ // userInfo: false,
427
+ // httpBodies: [],
428
+ },
398
429
  })
399
430
 
400
431
  export const handleError = handleErrorWithSentry();"
@@ -423,7 +454,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
423
454
  dsn: "https://sentry.io/789",
424
455
  tracesSampleRate: 1,
425
456
  enableLogs: true,
426
- sendDefaultPii: true
457
+ dataCollection: {
458
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
459
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
460
+ // userInfo: false,
461
+ // httpBodies: [],
462
+ },
427
463
  })
428
464
 
429
465
  export const handleError = handleErrorWithSentry();"
@@ -451,7 +487,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
451
487
  Sentry.init({
452
488
  dsn: "https://sentry.io/xyz",
453
489
  enableLogs: true,
454
- sendDefaultPii: true
490
+ dataCollection: {
491
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
492
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
493
+ // userInfo: false,
494
+ // httpBodies: [],
495
+ },
455
496
  })
456
497
 
457
498
  export const handleError = handleErrorWithSentry();"
@@ -478,7 +519,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
478
519
  // \`replaysSessionSampleRate\` and \`replaysOnErrorSampleRate\` options.
479
520
  Sentry.init({
480
521
  dsn: "https://sentry.io/minimal",
481
- sendDefaultPii: true
522
+ dataCollection: {
523
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
524
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
525
+ // userInfo: false,
526
+ // httpBodies: [],
527
+ },
482
528
  })
483
529
 
484
530
  export const handleError = handleErrorWithSentry();"
@@ -509,7 +555,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
509
555
  Sentry.init({
510
556
  dsn: "https://sentry.io/order-test",
511
557
  tracesSampleRate: 1,
512
- sendDefaultPii: true
558
+ dataCollection: {
559
+ // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
560
+ // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#dataCollection
561
+ // userInfo: false,
562
+ // httpBodies: [],
563
+ },
513
564
  })
514
565
 
515
566
  export const handleError = handleErrorWithSentry();