@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.
- package/CHANGELOG.md +64 -0
- package/dist/bin.js +16 -1
- package/dist/bin.js.map +1 -1
- package/dist/e2e-tests/tests/angular-17.test.js +3 -4
- package/dist/e2e-tests/tests/angular-17.test.js.map +1 -1
- package/dist/e2e-tests/tests/angular-19.test.js +3 -4
- package/dist/e2e-tests/tests/angular-19.test.js.map +1 -1
- package/dist/e2e-tests/tests/cloudflare-worker.test.js +5 -0
- package/dist/e2e-tests/tests/cloudflare-worker.test.js.map +1 -1
- package/dist/e2e-tests/tests/flutter.test.js +60 -0
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/help-message.test.js +8 -3
- package/dist/e2e-tests/tests/help-message.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +12 -6
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +12 -6
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/pnpm-workspace.test.js +8 -4
- package/dist/e2e-tests/tests/pnpm-workspace.test.js.map +1 -1
- package/dist/e2e-tests/tests/react-router-instrumentation-api.test.js +96 -0
- package/dist/e2e-tests/tests/react-router-instrumentation-api.test.js.map +1 -0
- package/dist/e2e-tests/tests/react-router.test.js +6 -7
- package/dist/e2e-tests/tests/react-router.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +2 -4
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit-hooks.test.js +24 -8
- package/dist/e2e-tests/tests/sveltekit-hooks.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit-tracing.test.js +8 -4
- package/dist/e2e-tests/tests/sveltekit-tracing.test.js.map +1 -1
- package/dist/lib/Constants.d.ts +1 -0
- package/dist/lib/Constants.js +5 -0
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.js +2 -2
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/src/android/android-wizard.js +3 -0
- package/dist/src/android/android-wizard.js.map +1 -1
- package/dist/src/angular/codemods/main.d.ts +1 -1
- package/dist/src/angular/codemods/main.js +0 -1
- package/dist/src/angular/codemods/main.js.map +1 -1
- package/dist/src/apple/apple-wizard.js +2 -3
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/apple/check-installed-cli.d.ts +1 -1
- package/dist/src/apple/check-installed-cli.js +13 -7
- package/dist/src/apple/check-installed-cli.js.map +1 -1
- package/dist/src/apple/code-tools.js +17 -3
- package/dist/src/apple/code-tools.js.map +1 -1
- package/dist/src/apple/configure-package-manager.js +18 -5
- package/dist/src/apple/configure-package-manager.js.map +1 -1
- package/dist/src/apple/configure-xcode-project.js +8 -1
- package/dist/src/apple/configure-xcode-project.js.map +1 -1
- package/dist/src/apple/lookup-xcode-project.d.ts +8 -5
- package/dist/src/apple/lookup-xcode-project.js +22 -17
- package/dist/src/apple/lookup-xcode-project.js.map +1 -1
- package/dist/src/apple/options.d.ts +5 -0
- package/dist/src/apple/options.js.map +1 -1
- package/dist/src/apple/sentry-swift-package.d.ts +4 -0
- package/dist/src/apple/sentry-swift-package.js +17 -0
- package/dist/src/apple/sentry-swift-package.js.map +1 -0
- package/dist/src/apple/snapshots/apple-snapshots-wizard.d.ts +2 -0
- package/dist/src/apple/snapshots/apple-snapshots-wizard.js +251 -0
- package/dist/src/apple/snapshots/apple-snapshots-wizard.js.map +1 -0
- package/dist/src/apple/snapshots/configure-snapshotpreviews-xcode-project.d.ts +13 -0
- package/dist/src/apple/snapshots/configure-snapshotpreviews-xcode-project.js +48 -0
- package/dist/src/apple/snapshots/configure-snapshotpreviews-xcode-project.js.map +1 -0
- package/dist/src/apple/snapshots/snapshot-test-file.d.ts +18 -0
- package/dist/src/apple/snapshots/snapshot-test-file.js +122 -0
- package/dist/src/apple/snapshots/snapshot-test-file.js.map +1 -0
- package/dist/src/apple/snapshots/snapshot-verification-scheme.d.ts +6 -0
- package/dist/src/apple/snapshots/snapshot-verification-scheme.js +147 -0
- package/dist/src/apple/snapshots/snapshot-verification-scheme.js.map +1 -0
- package/dist/src/apple/snapshots/snapshotpreviews-package.d.ts +4 -0
- package/dist/src/apple/snapshots/snapshotpreviews-package.js +8 -0
- package/dist/src/apple/snapshots/snapshotpreviews-package.js.map +1 -0
- package/dist/src/apple/snapshots/snapshots-cli-preflight.d.ts +23 -0
- package/dist/src/apple/snapshots/snapshots-cli-preflight.js +136 -0
- package/dist/src/apple/snapshots/snapshots-cli-preflight.js.map +1 -0
- package/dist/src/apple/xcode-manager.d.ts +59 -1
- package/dist/src/apple/xcode-manager.js +507 -106
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/cloudflare/cloudflare-wizard.js +5 -0
- package/dist/src/cloudflare/cloudflare-wizard.js.map +1 -1
- package/dist/src/cloudflare/sdk-setup.d.ts +1 -0
- package/dist/src/cloudflare/sdk-setup.js.map +1 -1
- package/dist/src/cloudflare/templates.d.ts +1 -0
- package/dist/src/cloudflare/templates.js +7 -1
- package/dist/src/cloudflare/templates.js.map +1 -1
- package/dist/src/cloudflare/wrap-worker.d.ts +1 -0
- package/dist/src/cloudflare/wrap-worker.js +7 -0
- package/dist/src/cloudflare/wrap-worker.js.map +1 -1
- package/dist/src/flutter/flutter-wizard.js +3 -0
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.js +12 -6
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nuxt/templates.js +12 -6
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/react-native/expo.d.ts +6 -0
- package/dist/src/react-native/expo.js +27 -1
- package/dist/src/react-native/expo.js.map +1 -1
- package/dist/src/react-native/git.d.ts +5 -0
- package/dist/src/react-native/git.js +32 -1
- package/dist/src/react-native/git.js.map +1 -1
- package/dist/src/react-native/javascript.js +3 -1
- package/dist/src/react-native/javascript.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.js +12 -6
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-router/codemods/client.entry.d.ts +1 -1
- package/dist/src/react-router/codemods/client.entry.js +124 -26
- package/dist/src/react-router/codemods/client.entry.js.map +1 -1
- package/dist/src/react-router/codemods/react-router-config.js +1 -1
- package/dist/src/react-router/codemods/react-router-config.js.map +1 -1
- package/dist/src/react-router/codemods/server-entry.d.ts +1 -1
- package/dist/src/react-router/codemods/server-entry.js +40 -4
- package/dist/src/react-router/codemods/server-entry.js.map +1 -1
- package/dist/src/react-router/codemods/vite.js +46 -1
- package/dist/src/react-router/codemods/vite.js.map +1 -1
- package/dist/src/react-router/react-router-wizard.js +62 -21
- package/dist/src/react-router/react-router-wizard.js.map +1 -1
- package/dist/src/react-router/sdk-setup.d.ts +5 -3
- package/dist/src/react-router/sdk-setup.js +44 -16
- package/dist/src/react-router/sdk-setup.js.map +1 -1
- package/dist/src/react-router/templates.d.ts +2 -4
- package/dist/src/react-router/templates.js +89 -87
- package/dist/src/react-router/templates.js.map +1 -1
- package/dist/src/remix/sdk-setup.js +1 -2
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/run.d.ts +4 -1
- package/dist/src/run.js +13 -0
- package/dist/src/run.js.map +1 -1
- package/dist/src/sourcemaps/tools/remix.js +4 -4
- package/dist/src/sourcemaps/tools/remix.js.map +1 -1
- package/dist/src/sourcemaps/tools/vite.js +1 -1
- package/dist/src/sourcemaps/tools/vite.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup/setup.js +17 -4
- package/dist/src/sveltekit/sdk-setup/setup.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup/vite.js +1 -1
- package/dist/src/sveltekit/sdk-setup/vite.js.map +1 -1
- package/dist/src/sveltekit/templates.js +12 -6
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/utils/ast-utils.d.ts +10 -0
- package/dist/src/utils/ast-utils.js +19 -1
- package/dist/src/utils/ast-utils.js.map +1 -1
- package/dist/src/utils/clack/index.d.ts +2 -1
- package/dist/src/utils/clack/index.js +17 -6
- package/dist/src/utils/clack/index.js.map +1 -1
- package/dist/src/utils/files.d.ts +2 -0
- package/dist/src/utils/files.js +58 -0
- package/dist/src/utils/files.js.map +1 -0
- package/dist/src/utils/git.d.ts +3 -1
- package/dist/src/utils/git.js +2 -1
- package/dist/src/utils/git.js.map +1 -1
- package/dist/src/utils/line-endings.d.ts +1 -0
- package/dist/src/utils/line-endings.js +76 -0
- package/dist/src/utils/line-endings.js.map +1 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/test/angular/angular-wizard.test.js +0 -5
- package/dist/test/angular/angular-wizard.test.js.map +1 -1
- package/dist/test/apple/code-tools.test.js +78 -0
- package/dist/test/apple/code-tools.test.js.map +1 -1
- package/dist/test/apple/configure-package-manager.test.d.ts +1 -0
- package/dist/test/apple/configure-package-manager.test.js +161 -0
- package/dist/test/apple/configure-package-manager.test.js.map +1 -0
- package/dist/test/apple/lookup-xcode-project.test.d.ts +1 -0
- package/dist/test/apple/lookup-xcode-project.test.js +167 -0
- package/dist/test/apple/lookup-xcode-project.test.js.map +1 -0
- package/dist/test/apple/snapshots/apple-snapshots-wizard.test.d.ts +1 -0
- package/dist/test/apple/snapshots/apple-snapshots-wizard.test.js +487 -0
- package/dist/test/apple/snapshots/apple-snapshots-wizard.test.js.map +1 -0
- package/dist/test/apple/snapshots/hosted-test-target-fixture.d.ts +24 -0
- package/dist/test/apple/snapshots/hosted-test-target-fixture.js +191 -0
- package/dist/test/apple/snapshots/hosted-test-target-fixture.js.map +1 -0
- package/dist/test/apple/snapshots/snapshot-test-file.test.d.ts +1 -0
- package/dist/test/apple/snapshots/snapshot-test-file.test.js +110 -0
- package/dist/test/apple/snapshots/snapshot-test-file.test.js.map +1 -0
- package/dist/test/apple/snapshots/snapshot-verification-scheme.test.d.ts +1 -0
- package/dist/test/apple/snapshots/snapshot-verification-scheme.test.js +146 -0
- package/dist/test/apple/snapshots/snapshot-verification-scheme.test.js.map +1 -0
- package/dist/test/apple/snapshots/snapshotpreviews-xcode-smoke.test.d.ts +1 -0
- package/dist/test/apple/snapshots/snapshotpreviews-xcode-smoke.test.js +186 -0
- package/dist/test/apple/snapshots/snapshotpreviews-xcode-smoke.test.js.map +1 -0
- package/dist/test/apple/snapshots/snapshots-cli-preflight.test.d.ts +1 -0
- package/dist/test/apple/snapshots/snapshots-cli-preflight.test.js +192 -0
- package/dist/test/apple/snapshots/snapshots-cli-preflight.test.js.map +1 -0
- package/dist/test/apple/snapshots/source-file-insertion.test.d.ts +1 -0
- package/dist/test/apple/snapshots/source-file-insertion.test.js +77 -0
- package/dist/test/apple/snapshots/source-file-insertion.test.js.map +1 -0
- package/dist/test/apple/xcode-manager.test.js +452 -43
- package/dist/test/apple/xcode-manager.test.js.map +1 -1
- package/dist/test/cloudflare/sdk-setup.test.js +20 -2
- package/dist/test/cloudflare/sdk-setup.test.js.map +1 -1
- package/dist/test/cloudflare/templates.test.js +54 -0
- package/dist/test/cloudflare/templates.test.js.map +1 -1
- package/dist/test/cloudflare/wrap-worker.test.js +74 -11
- package/dist/test/cloudflare/wrap-worker.test.js.map +1 -1
- package/dist/test/constants.test.d.ts +1 -0
- package/dist/test/constants.test.js +12 -0
- package/dist/test/constants.test.js.map +1 -0
- package/dist/test/nextjs/templates.test.js +66 -33
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +66 -36
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/react-native/expo.test.js +140 -0
- package/dist/test/react-native/expo.test.js.map +1 -1
- package/dist/test/react-native/git.test.d.ts +1 -0
- package/dist/test/react-native/git.test.js +160 -0
- package/dist/test/react-native/git.test.js.map +1 -0
- package/dist/test/react-router/codemods/client-entry.test.js +38 -5
- package/dist/test/react-router/codemods/client-entry.test.js.map +1 -1
- package/dist/test/react-router/codemods/server-entry.test.js +83 -0
- package/dist/test/react-router/codemods/server-entry.test.js.map +1 -1
- package/dist/test/react-router/codemods/vite.test.js +89 -0
- package/dist/test/react-router/codemods/vite.test.js.map +1 -1
- package/dist/test/react-router/sdk-setup.test.js +98 -6
- package/dist/test/react-router/sdk-setup.test.js.map +1 -1
- package/dist/test/react-router/templates.test.js +50 -38
- package/dist/test/react-router/templates.test.js.map +1 -1
- package/dist/test/remix/build-script.test.d.ts +1 -0
- package/dist/test/remix/build-script.test.js +124 -0
- package/dist/test/remix/build-script.test.js.map +1 -0
- package/dist/test/remix/client-entry.test.js +4 -10
- package/dist/test/remix/client-entry.test.js.map +1 -1
- package/dist/test/run.test.d.ts +1 -0
- package/dist/test/run.test.js +137 -0
- package/dist/test/run.test.js.map +1 -0
- package/dist/test/sourcemaps/tools/vite.test.js +12 -8
- package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +78 -27
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/utils/ast-utils.test.js +22 -0
- package/dist/test/utils/ast-utils.test.js.map +1 -1
- package/dist/test/utils/clack/index.test.js +101 -0
- package/dist/test/utils/clack/index.test.js.map +1 -1
- package/dist/test/utils/git.test.js +10 -0
- package/dist/test/utils/git.test.js.map +1 -1
- package/dist/test/utils/line-endings.test.d.ts +1 -0
- package/dist/test/utils/line-endings.test.js +103 -0
- package/dist/test/utils/line-endings.test.js.map +1 -0
- package/package.json +2 -2
- package/dist/src/react-router/codemods/root.d.ts +0 -1
- package/dist/src/react-router/codemods/root.js +0 -171
- package/dist/src/react-router/codemods/root.js.map +0 -1
- package/dist/test/react-router/codemods/root.test.js +0 -178
- package/dist/test/react-router/codemods/root.test.js.map +0 -1
- /package/dist/{test/react-router/codemods/root.test.d.ts → e2e-tests/tests/react-router-instrumentation-api.test.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
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
|
+
|
|
18
|
+
## 6.12.0
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- (cloudflare) Add enableLogs when setting up Cloudflare by @JPeer264 in [#1191](https://github.com/getsentry/sentry-wizard/pull/1191)
|
|
23
|
+
- (react-native) Skip patch native files when expo CNG by @uragirii in [#1211](https://github.com/getsentry/sentry-wizard/pull/1211)
|
|
24
|
+
- (react-router) Add React Router Instrumentation API support by @onurtemizkan in [#1209](https://github.com/getsentry/sentry-wizard/pull/1209)
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
#### Apple
|
|
29
|
+
|
|
30
|
+
- Show deprecation warning for CocoaPods package manager by @itaybre in [#1229](https://github.com/getsentry/sentry-wizard/pull/1229)
|
|
31
|
+
- Prevent duplicate init() in SwiftUI apps with existing initializer by @betegon in [#1188](https://github.com/getsentry/sentry-wizard/pull/1188)
|
|
32
|
+
|
|
33
|
+
#### Other
|
|
34
|
+
|
|
35
|
+
- (release) Add semver fields to changelog categories by @BYK in [#1193](https://github.com/getsentry/sentry-wizard/pull/1193)
|
|
36
|
+
- Preserve trailing newlines when modifying config files by @andreiborza in [#1208](https://github.com/getsentry/sentry-wizard/pull/1208)
|
|
37
|
+
|
|
38
|
+
### Internal Changes
|
|
39
|
+
|
|
40
|
+
#### Agents
|
|
41
|
+
|
|
42
|
+
- Init dotagents by @chargome in [#1232](https://github.com/getsentry/sentry-wizard/pull/1232)
|
|
43
|
+
- Use `AGENTS.md` with symlinks by @chargome in [#1233](https://github.com/getsentry/sentry-wizard/pull/1233)
|
|
44
|
+
|
|
45
|
+
#### Deps
|
|
46
|
+
|
|
47
|
+
- Bump devalue from 5.6.2 to 5.6.3 in /e2e-tests/test-applications/cloudflare-wrangler-sourcemaps-test-app by @dependabot in [#1228](https://github.com/getsentry/sentry-wizard/pull/1228)
|
|
48
|
+
- Bump rollup from 4.50.1 to 4.59.0 by @dependabot in [#1231](https://github.com/getsentry/sentry-wizard/pull/1231)
|
|
49
|
+
- Bump rollup from 4.41.0 to 4.59.0 in /e2e-tests/test-applications/cloudflare-wrangler-sourcemaps-test-app by @dependabot in [#1230](https://github.com/getsentry/sentry-wizard/pull/1230)
|
|
50
|
+
- Bump next from 16.0.10 to 16.1.5 in /e2e-tests/test-applications/nextjs-16-test-app by @dependabot in [#1206](https://github.com/getsentry/sentry-wizard/pull/1206)
|
|
51
|
+
- Bump next from 15.5.9 to 15.5.10 in /e2e-tests/test-applications/nextjs-15-test-app by @dependabot in [#1224](https://github.com/getsentry/sentry-wizard/pull/1224)
|
|
52
|
+
- Bump axios from 1.12.0 to 1.13.5 by @dependabot in [#1222](https://github.com/getsentry/sentry-wizard/pull/1222)
|
|
53
|
+
- Bump lodash from 4.17.21 to 4.17.23 by @dependabot in [#1204](https://github.com/getsentry/sentry-wizard/pull/1204)
|
|
54
|
+
|
|
55
|
+
#### Release
|
|
56
|
+
|
|
57
|
+
- Fix changelog-preview permissions by @BYK in [#1205](https://github.com/getsentry/sentry-wizard/pull/1205)
|
|
58
|
+
- Switch from action-prepare-release to Craft by @BYK in [#1186](https://github.com/getsentry/sentry-wizard/pull/1186)
|
|
59
|
+
|
|
60
|
+
#### Other
|
|
61
|
+
|
|
62
|
+
- (deps-dev) Bump wrangler from 4.16.0 to 4.59.1 in /e2e-tests/test-applications/cloudflare-wrangler-sourcemaps-test-app by @dependabot in [#1203](https://github.com/getsentry/sentry-wizard/pull/1203)
|
|
63
|
+
- (publish) Clean up changelog by @Lms24 in [#1234](https://github.com/getsentry/sentry-wizard/pull/1234)
|
|
64
|
+
- Add unlabeled trigger to changelog-preview by @BYK in [#1189](https://github.com/getsentry/sentry-wizard/pull/1189)
|
|
65
|
+
- Use pull_request_target for changelog preview by @BYK in [#1196](https://github.com/getsentry/sentry-wizard/pull/1196)
|
|
66
|
+
|
|
3
67
|
## 6.11.0
|
|
4
68
|
|
|
5
69
|
### New 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.
|
|
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
|
-
{"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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;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,YAAY,EAAE;QACZ,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,qDAAqD;QAC/D,IAAI,EAAE,QAAQ;KACf;IACD,oBAAoB,EAAE;QACpB,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,oCAAoC;QAC9C,IAAI,EAAE,QAAQ;KACf;IACD,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. 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',
|
|
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
|
-
|
|
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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,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,oCAWkB;AAClB,uCAAyB;AACzB,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,I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A,uBAAe,EAAC,eAAe,CAAC,CAAC;QAEjC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAEnB,CAAC;QAEzB,8DAA8D;QAC9D,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO;QACtC,8DAA8D;QAC9D,WAAW,CAAC,QAA+B,CAC5C,EAAE;YACD,IAAA,eAAM;YACJ,sEAAsE;YACtE,OAAO,EAAE,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 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',
|
|
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
|
-
|
|
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,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,EAAE;QAC7C,MAAM,WAAW,GAAG,uBAAW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A,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"]}
|
|
1
|
+
{"version":3,"file":"angular-19.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/angular-19.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAkD;AAClD,oCAWkB;AAClB,uCAAyB;AACzB,2CAA6B;AAC7B,oCAAqC;AACrC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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"]}
|
|
@@ -26,6 +26,9 @@ const clifty_1 = require("clifty");
|
|
|
26
26
|
whenAsked('Do you want to enable Tracing', {
|
|
27
27
|
timeout: 90000, // package installation can take a while in CI
|
|
28
28
|
}).respondWith(clifty_1.KEYS.ENTER);
|
|
29
|
+
whenAsked('Do you want to enable Logs', {
|
|
30
|
+
timeout: 90000, // package installation can take a while in CI
|
|
31
|
+
}).respondWith(clifty_1.KEYS.ENTER);
|
|
29
32
|
})
|
|
30
33
|
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
31
34
|
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
@@ -58,6 +61,8 @@ const clifty_1 = require("clifty");
|
|
|
58
61
|
'import * as Sentry from "@sentry/cloudflare";',
|
|
59
62
|
'export default Sentry.withSentry(env => ({',
|
|
60
63
|
'dsn: "https://public@dsn.ingest.sentry.io/1337",',
|
|
64
|
+
'tracesSampleRate: 1',
|
|
65
|
+
'enableLogs: true',
|
|
61
66
|
]);
|
|
62
67
|
});
|
|
63
68
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare-worker.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/cloudflare-worker.test.ts"],"names":[],"mappings":";;AAAA,mCAAmE;AACnE,mDAAkD;AAClD,oCAMkB;AAElB,uCAAuC;AACvC,mCAAuC;AAEvC,IAAA,iBAAQ,EAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,MAAM,WAAW,GAAG,uBAAW,CAAC,UAAU,CAAC;IAC3C,IAAI,cAAsB,CAAC;IAC3B,IAAI,yBAAiC,CAAC;IAEtC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EAAC,qBAAqB,CAAC,CAAC;IAE7E,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;QACnB,yEAAyE;QACzE,yBAAyB,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAElE,cAAc,GAAG,MAAM,IAAA,gBAAO,EAAC;YAC7B,GAAG,EAAE,UAAU;SAChB,CAAC;aACC,iBAAiB,EAAE;aACnB,YAAY,CACX,+EAA+E,CAChF;aACA,IAAI,CAAC,sBAAsB,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE;YAC5D,SAAS,CAAC,qCAAqC,CAAC,CAAC,WAAW,CAC1D,aAAI,CAAC,IAAI,EACT,aAAI,CAAC,KAAK,CACX,CAAC;YACF,YAAY,CAAC,+BAA+B,CAAC,CAAC;QAChD,CAAC,CAAC;aACD,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;YACnC,SAAS,CAAC,+BAA+B,EAAE;gBACzC,OAAO,EAAE,KAAM,EAAE,8CAA8C;aAChE,CA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integration } from '../../lib/Constants';\nimport {\n checkFileContents,\n checkIfBuilds,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n} from '../utils';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('cloudflare-worker', () => {\n const integration = Integration.cloudflare;\n let wizardExitCode: number;\n let expectedCompatibilityDate: string;\n\n const { projectDir, cleanup } = createIsolatedTestEnv('cloudflare-test-app');\n\n beforeAll(async () => {\n // Capture the date before running the wizard (wizard runs in subprocess)\n expectedCompatibilityDate = new Date().toISOString().slice(0, 10);\n\n wizardExitCode = await withEnv({\n cwd: projectDir,\n })\n .defineInteraction()\n .expectOutput(\n 'The Sentry Cloudflare Wizard will help you set up Sentry for your application',\n )\n .step('package installation', ({ expectOutput, whenAsked }) => {\n whenAsked('Please select your package manager.').respondWith(\n KEYS.DOWN,\n KEYS.ENTER,\n );\n expectOutput('Installing @sentry/cloudflare');\n })\n .step('SDK setup', ({ whenAsked }) => {\n whenAsked('Do you want to enable Tracing', {\n timeout: 90_000, // package installation can take a while in CI\n }).respondWith(KEYS.ENTER);\n whenAsked('Do you want to enable Logs', {\n timeout: 90_000, // package installation can take a while in CI\n }).respondWith(KEYS.ENTER);\n })\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput(\n 'Sentry has been successfully configured for your Cloudflare project.',\n )\n .run(getWizardCommand(integration));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n it('adds the SDK dependency to package.json', () => {\n checkPackageJson(projectDir, '@sentry/cloudflare');\n });\n\n it('builds correctly', async () => {\n await checkIfBuilds(projectDir);\n });\n\n it('wrangler.jsonc file contains Sentry configuration', () => {\n checkFileContents(`${projectDir}/wrangler.jsonc`, [\n `\"compatibility_date\": \"${expectedCompatibilityDate}\"`,\n '\"global_fetch_strictly_public\"',\n '\"nodejs_als\"',\n '\"version_metadata\": {',\n '\"binding\": \"CF_VERSION_METADATA\"',\n ]);\n });\n\n it('modifies the worker file to include Sentry initialization', () => {\n checkFileContents(`${projectDir}/src/index.ts`, [\n 'import * as Sentry from \"@sentry/cloudflare\";',\n 'export default Sentry.withSentry(env => ({',\n 'dsn: \"https://public@dsn.ingest.sentry.io/1337\",',\n 'tracesSampleRate: 1',\n 'enableLogs: true',\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,aAAI,CAAC,KAAK,CAAC;iBACvB,SAAS,CAAC,+CA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EH,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;iBACvB,SAAS,CACR,6EAA6E,CAC9E;iBACA,WA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C,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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
|
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"]}
|