@sentry/wizard 3.42.1 → 4.0.1
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 +30 -0
- package/dist/bin.js +44 -35
- package/dist/bin.js.map +1 -1
- package/dist/e2e-tests/jest.config.js +1 -1
- package/dist/e2e-tests/jest.config.js.map +1 -1
- package/dist/e2e-tests/tests/flutter.test.js +62 -147
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs.test.js +77 -175
- package/dist/e2e-tests/tests/nextjs.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +61 -162
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +62 -163
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +147 -189
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit.test.js +133 -187
- package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
- package/dist/e2e-tests/utils/index.d.ts +1 -1
- package/dist/e2e-tests/utils/index.js +113 -195
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/lib/Constants.js +5 -5
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/BottomBar.d.ts +1 -1
- package/dist/lib/Helper/BottomBar.js +14 -15
- package/dist/lib/Helper/BottomBar.js.map +1 -1
- package/dist/lib/Helper/Env.js +5 -2
- package/dist/lib/Helper/Env.js.map +1 -1
- package/dist/lib/Helper/File.js +14 -27
- package/dist/lib/Helper/File.js.map +1 -1
- package/dist/lib/Helper/Git.js +24 -59
- package/dist/lib/Helper/Git.js.map +1 -1
- package/dist/lib/Helper/Logging.js +2 -2
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/MergeConfig.js +4 -4
- package/dist/lib/Helper/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/Package.d.ts +4 -1
- package/dist/lib/Helper/Package.js +12 -38
- package/dist/lib/Helper/Package.js.map +1 -1
- package/dist/lib/Helper/SentryCli.js +77 -149
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Helper/Wizard.js +29 -124
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/lib/Helper/__tests__/File.js +4 -4
- package/dist/lib/Helper/__tests__/File.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +24 -24
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/__tests__/SentryCli.js +33 -23
- package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
- package/dist/lib/Setup.js +23 -85
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/BaseStep.js +8 -8
- package/dist/lib/Steps/BaseStep.js.map +1 -1
- package/dist/lib/Steps/ChooseIntegration.js +80 -125
- package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
- package/dist/lib/Steps/ConfigureProject.js +6 -66
- package/dist/lib/Steps/ConfigureProject.js.map +1 -1
- package/dist/lib/Steps/Initial.js +16 -104
- package/dist/lib/Steps/Initial.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.js +24 -118
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.js +95 -183
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.js +87 -145
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.js +40 -148
- package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
- package/dist/lib/Steps/OpenSentry.js +63 -126
- package/dist/lib/Steps/OpenSentry.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.js +110 -206
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/lib/Steps/Result.js +19 -79
- package/dist/lib/Steps/Result.js.map +1 -1
- package/dist/lib/Steps/SentryProjectSelector.js +57 -148
- package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
- package/dist/lib/Steps/ShouldConfigure.js +6 -66
- package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
- package/dist/lib/Steps/WaitForSentry.js +43 -120
- package/dist/lib/Steps/WaitForSentry.js.map +1 -1
- package/dist/lib/Steps/Welcome.js +17 -76
- package/dist/lib/Steps/Welcome.js.map +1 -1
- package/dist/lib/__tests__/Env.js +3 -3
- package/dist/lib/__tests__/Env.js.map +1 -1
- package/dist/src/android/android-wizard.js +100 -176
- package/dist/src/android/android-wizard.js.map +1 -1
- package/dist/src/android/code-tools.js +24 -33
- package/dist/src/android/code-tools.js.map +1 -1
- package/dist/src/android/gradle.js +106 -165
- package/dist/src/android/gradle.js.map +1 -1
- package/dist/src/android/manifest.js +26 -27
- package/dist/src/android/manifest.js.map +1 -1
- package/dist/src/android/templates.js +76 -23
- package/dist/src/android/templates.js.map +1 -1
- package/dist/src/apple/apple-wizard.js +129 -225
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/apple/cocoapod.js +47 -109
- package/dist/src/apple/cocoapod.js.map +1 -1
- package/dist/src/apple/code-tools.js +32 -35
- package/dist/src/apple/code-tools.js.map +1 -1
- package/dist/src/apple/fastlane.js +51 -97
- package/dist/src/apple/fastlane.js.map +1 -1
- package/dist/src/apple/templates.js +41 -5
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/apple/xcode-manager.d.ts +2 -2
- package/dist/src/apple/xcode-manager.js +93 -108
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/flutter/code-tools.js +79 -127
- package/dist/src/flutter/code-tools.js.map +1 -1
- package/dist/src/flutter/flutter-wizard.js +75 -136
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/flutter/templates.js +48 -12
- package/dist/src/flutter/templates.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +527 -805
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.js +380 -40
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nextjs/utils.js +5 -5
- package/dist/src/nextjs/utils.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.js +91 -188
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
- package/dist/src/nuxt/sdk-example.js +68 -137
- package/dist/src/nuxt/sdk-example.js.map +1 -1
- package/dist/src/nuxt/sdk-setup.d.ts +4 -4
- package/dist/src/nuxt/sdk-setup.js +180 -336
- package/dist/src/nuxt/sdk-setup.js.map +1 -1
- package/dist/src/nuxt/templates.js +195 -18
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/nuxt/utils.js +29 -76
- package/dist/src/nuxt/utils.js.map +1 -1
- package/dist/src/react-native/expo-env-file.js +41 -94
- package/dist/src/react-native/expo-env-file.js.map +1 -1
- package/dist/src/react-native/expo-metro.d.ts +1 -1
- package/dist/src/react-native/expo-metro.js +75 -130
- package/dist/src/react-native/expo-metro.js.map +1 -1
- package/dist/src/react-native/expo.js +61 -114
- package/dist/src/react-native/expo.js.map +1 -1
- package/dist/src/react-native/git.js +23 -56
- package/dist/src/react-native/git.js.map +1 -1
- package/dist/src/react-native/glob.js +3 -3
- package/dist/src/react-native/glob.js.map +1 -1
- package/dist/src/react-native/gradle.js +4 -4
- package/dist/src/react-native/gradle.js.map +1 -1
- package/dist/src/react-native/javascript.js +51 -95
- package/dist/src/react-native/javascript.js.map +1 -1
- package/dist/src/react-native/metro.js +176 -296
- package/dist/src/react-native/metro.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.js +267 -418
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-native/uninstall.js +37 -80
- package/dist/src/react-native/uninstall.js.map +1 -1
- package/dist/src/react-native/xcode.js +57 -55
- package/dist/src/react-native/xcode.js.map +1 -1
- package/dist/src/remix/codemods/express-server.js +27 -82
- package/dist/src/remix/codemods/express-server.js.map +1 -1
- package/dist/src/remix/codemods/handle-error.js +28 -31
- package/dist/src/remix/codemods/handle-error.js.map +1 -1
- package/dist/src/remix/codemods/root-common.js +11 -11
- package/dist/src/remix/codemods/root-common.js.map +1 -1
- package/dist/src/remix/codemods/root-v1.js +17 -67
- package/dist/src/remix/codemods/root-v1.js.map +1 -1
- package/dist/src/remix/codemods/root-v2.js +89 -140
- package/dist/src/remix/codemods/root-v2.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +181 -343
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/remix/sdk-example.js +84 -66
- package/dist/src/remix/sdk-example.js.map +1 -1
- package/dist/src/remix/sdk-setup.js +161 -293
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/remix/templates.js +10 -2
- package/dist/src/remix/templates.js.map +1 -1
- package/dist/src/remix/utils.js +13 -14
- package/dist/src/remix/utils.js.map +1 -1
- package/dist/src/run.js +106 -178
- package/dist/src/run.js.map +1 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.js +248 -372
- package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
- package/dist/src/sourcemaps/tools/angular.js +32 -66
- package/dist/src/sourcemaps/tools/angular.js.map +1 -1
- package/dist/src/sourcemaps/tools/create-react-app.js +14 -59
- package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -1
- package/dist/src/sourcemaps/tools/esbuild.js +34 -77
- package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
- package/dist/src/sourcemaps/tools/nextjs.d.ts +2 -2
- package/dist/src/sourcemaps/tools/nextjs.js +75 -102
- package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
- package/dist/src/sourcemaps/tools/remix.js +53 -93
- package/dist/src/sourcemaps/tools/remix.js.map +1 -1
- package/dist/src/sourcemaps/tools/rollup.js +35 -76
- package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
- package/dist/src/sourcemaps/tools/sentry-cli.js +157 -289
- package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
- package/dist/src/sourcemaps/tools/tsc.js +68 -134
- package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
- package/dist/src/sourcemaps/tools/vite.js +111 -196
- package/dist/src/sourcemaps/tools/vite.js.map +1 -1
- package/dist/src/sourcemaps/tools/webpack.d.ts +1 -1
- package/dist/src/sourcemaps/tools/webpack.js +158 -260
- package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
- package/dist/src/sourcemaps/utils/detect-tool.js +9 -54
- package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -1
- package/dist/src/sourcemaps/utils/other-wizards.js +77 -144
- package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -1
- package/dist/src/sourcemaps/utils/sdk-version.js +112 -191
- package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -1
- package/dist/src/sveltekit/sdk-example.js +20 -70
- package/dist/src/sveltekit/sdk-example.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup.js +250 -411
- package/dist/src/sveltekit/sdk-setup.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +107 -191
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/sveltekit/templates.js +147 -13
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/sveltekit/utils.js +3 -3
- package/dist/src/sveltekit/utils.js.map +1 -1
- package/dist/src/telemetry.d.ts +2 -2
- package/dist/src/telemetry.js +58 -108
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/utils/ast-utils.js +39 -54
- package/dist/src/utils/ast-utils.js.map +1 -1
- package/dist/src/utils/bash.js +28 -75
- package/dist/src/utils/bash.js.map +1 -1
- package/dist/src/utils/clack-utils.d.ts +3 -7
- package/dist/src/utils/clack-utils.js +688 -1083
- package/dist/src/utils/clack-utils.js.map +1 -1
- package/dist/src/utils/debug.js +6 -10
- package/dist/src/utils/debug.js.map +1 -1
- package/dist/src/utils/package-json.js +5 -6
- package/dist/src/utils/package-json.js.map +1 -1
- package/dist/src/utils/package-manager.js +65 -139
- package/dist/src/utils/package-manager.js.map +1 -1
- package/dist/src/utils/release-registry.js +12 -59
- package/dist/src/utils/release-registry.js.map +1 -1
- package/dist/src/utils/semver.js +3 -4
- package/dist/src/utils/semver.js.map +1 -1
- package/dist/src/utils/sentrycli-utils.js +4 -4
- package/dist/src/utils/sentrycli-utils.js.map +1 -1
- package/dist/src/utils/url.js +5 -6
- package/dist/src/utils/url.js.map +1 -1
- package/dist/test/android/code-tools.test.js +18 -18
- package/dist/test/android/code-tools.test.js.map +1 -1
- package/dist/test/apple/cocoapod.test.js +154 -299
- package/dist/test/apple/cocoapod.test.js.map +1 -1
- package/dist/test/apple/code-tools.test.js +375 -263
- package/dist/test/apple/code-tools.test.js.map +1 -1
- package/dist/test/apple/fastfile.test.js +319 -271
- package/dist/test/apple/fastfile.test.js.map +1 -1
- package/dist/test/apple/templates.test.js +114 -30
- package/dist/test/apple/templates.test.js.map +1 -1
- package/dist/test/apple/xcode-manager.test.js +230 -234
- package/dist/test/apple/xcode-manager.test.js.map +1 -1
- package/dist/test/flutter/code-tools.test.js +119 -48
- package/dist/test/flutter/code-tools.test.js.map +1 -1
- package/dist/test/flutter/templates.test.js +63 -20
- package/dist/test/flutter/templates.test.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +332 -43
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +161 -33
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/react-native/expo-metro.test.js +61 -15
- package/dist/test/react-native/expo-metro.test.js.map +1 -1
- package/dist/test/react-native/expo.test.js +37 -17
- package/dist/test/react-native/expo.test.js.map +1 -1
- package/dist/test/react-native/gradle.test.js +260 -28
- package/dist/test/react-native/gradle.test.js.map +1 -1
- package/dist/test/react-native/javascript.test.js +85 -19
- package/dist/test/react-native/javascript.test.js.map +1 -1
- package/dist/test/react-native/metro.test.js +261 -187
- package/dist/test/react-native/metro.test.js.map +1 -1
- package/dist/test/react-native/xcode.test.js +243 -62
- package/dist/test/react-native/xcode.test.js.map +1 -1
- package/dist/test/remix/client-entry.test.js +81 -21
- package/dist/test/remix/client-entry.test.js.map +1 -1
- package/dist/test/remix/server-instrumentation.test.js +21 -8
- package/dist/test/remix/server-instrumentation.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/sentry-cli.test.js +20 -72
- package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/tsc.test.js +142 -68
- package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/vite.test.js +106 -75
- package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/webpack.test.js +226 -102
- package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +117 -18
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/utils/ast-utils.test.js +99 -58
- package/dist/test/utils/ast-utils.test.js.map +1 -1
- package/dist/test/utils/clack-utils.test.js +142 -247
- package/dist/test/utils/clack-utils.test.js.map +1 -1
- package/package.json +16 -9
- package/bin.ts +0 -138
- package/codecov.yml +0 -15
- package/dist/package.json +0 -128
- package/e2e-tests/.env.example +0 -11
- package/e2e-tests/README.md +0 -63
- package/e2e-tests/jest.config.ts +0 -22
- package/e2e-tests/package.json +0 -14
- package/e2e-tests/run.sh +0 -15
- package/e2e-tests/test-applications/apple/damaged-missing-configuration-list/Project.xcodeproj/project.pbxproj +0 -52
- package/e2e-tests/test-applications/apple/damaged-missing-configuration-list/Project.xcodeproj/xcshareddata/xcschemes/Project1.xcscheme +0 -78
- package/e2e-tests/test-applications/apple/no-targets/Project.xcodeproj/project.pbxproj +0 -62
- package/e2e-tests/test-applications/apple/no-targets/Project.xcodeproj/xcshareddata/xcschemes/Project1.xcscheme +0 -78
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project.xcodeproj/project.pbxproj +0 -470
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project.xcodeproj/xcshareddata/xcschemes/Project1.xcscheme +0 -78
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project1/ContentView.swift +0 -7
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project1/Project1App.swift +0 -10
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project2/ContentView.swift +0 -7
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project2/Project2App.swift +0 -10
- package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Project.xcodeproj/project.pbxproj +0 -382
- package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Project.xcodeproj/xcshareddata/xcschemes/Project.xcscheme +0 -78
- package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Sources/ContentView.swift +0 -7
- package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Sources/MainApp.swift +0 -10
- package/e2e-tests/test-applications/flutter-test-app/.metadata +0 -45
- package/e2e-tests/test-applications/flutter-test-app/README.md +0 -16
- package/e2e-tests/test-applications/flutter-test-app/analysis_options.yaml +0 -28
- package/e2e-tests/test-applications/flutter-test-app/android/app/build.gradle +0 -44
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/debug/AndroidManifest.xml +0 -7
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/AndroidManifest.xml +0 -45
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/kotlin/com/example/flutter_magic/MainActivity.kt +0 -5
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/drawable/launch_background.xml +0 -12
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/drawable-v21/launch_background.xml +0 -12
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/values/styles.xml +0 -18
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/values-night/styles.xml +0 -18
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/profile/AndroidManifest.xml +0 -7
- package/e2e-tests/test-applications/flutter-test-app/android/build.gradle +0 -18
- package/e2e-tests/test-applications/flutter-test-app/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/e2e-tests/test-applications/flutter-test-app/android/gradle.properties +0 -3
- package/e2e-tests/test-applications/flutter-test-app/android/settings.gradle +0 -25
- package/e2e-tests/test-applications/flutter-test-app/lib/main.dart +0 -125
- package/e2e-tests/test-applications/flutter-test-app/linux/CMakeLists.txt +0 -145
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/CMakeLists.txt +0 -88
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugin_registrant.cc +0 -11
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugin_registrant.h +0 -15
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugins.cmake +0 -23
- package/e2e-tests/test-applications/flutter-test-app/linux/main.cc +0 -6
- package/e2e-tests/test-applications/flutter-test-app/linux/my_application.cc +0 -124
- package/e2e-tests/test-applications/flutter-test-app/linux/my_application.h +0 -18
- package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/Flutter-Debug.xcconfig +0 -2
- package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/Flutter-Release.xcconfig +0 -2
- package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/GeneratedPluginRegistrant.swift +0 -10
- package/e2e-tests/test-applications/flutter-test-app/macos/Podfile +0 -43
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/AppDelegate.swift +0 -9
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -68
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Base.lproj/MainMenu.xib +0 -343
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/AppInfo.xcconfig +0 -14
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Debug.xcconfig +0 -2
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Release.xcconfig +0 -2
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Warnings.xcconfig +0 -13
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/DebugProfile.entitlements +0 -12
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Info.plist +0 -32
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/MainFlutterWindow.swift +0 -15
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Release.entitlements +0 -8
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/project.pbxproj +0 -705
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +0 -98
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcworkspace/contents.xcworkspacedata +0 -7
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/e2e-tests/test-applications/flutter-test-app/macos/RunnerTests/RunnerTests.swift +0 -12
- package/e2e-tests/test-applications/flutter-test-app/pubspec.lock +0 -213
- package/e2e-tests/test-applications/flutter-test-app/pubspec.yaml +0 -89
- package/e2e-tests/test-applications/flutter-test-app/test/widget_test.dart +0 -30
- package/e2e-tests/test-applications/flutter-test-app/web/favicon.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-192.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-512.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-maskable-192.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-maskable-512.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/index.html +0 -38
- package/e2e-tests/test-applications/flutter-test-app/web/manifest.json +0 -35
- package/e2e-tests/test-applications/flutter-test-app/windows/CMakeLists.txt +0 -108
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/CMakeLists.txt +0 -109
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugin_registrant.cc +0 -11
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugin_registrant.h +0 -15
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugins.cmake +0 -23
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/CMakeLists.txt +0 -40
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/Runner.rc +0 -121
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/flutter_window.cpp +0 -71
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/flutter_window.h +0 -33
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/main.cpp +0 -43
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/resource.h +0 -16
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/resources/app_icon.ico +0 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/runner.exe.manifest +0 -14
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/utils.cpp +0 -65
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/utils.h +0 -19
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/win32_window.cpp +0 -288
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/win32_window.h +0 -102
- package/e2e-tests/test-applications/nextjs-test-app/next.config.mjs +0 -4
- package/e2e-tests/test-applications/nextjs-test-app/package.json +0 -22
- package/e2e-tests/test-applications/nextjs-test-app/src/app/layout.tsx +0 -20
- package/e2e-tests/test-applications/nextjs-test-app/src/app/page.tsx +0 -90
- package/e2e-tests/test-applications/nuxt-3-test-app/README.md +0 -75
- package/e2e-tests/test-applications/nuxt-3-test-app/nuxt.config.ts +0 -5
- package/e2e-tests/test-applications/nuxt-3-test-app/package.json +0 -18
- package/e2e-tests/test-applications/nuxt-3-test-app/public/favicon.ico +0 -0
- package/e2e-tests/test-applications/nuxt-3-test-app/public/robots.txt +0 -1
- package/e2e-tests/test-applications/nuxt-4-test-app/README.md +0 -75
- package/e2e-tests/test-applications/nuxt-4-test-app/nuxt.config.ts +0 -6
- package/e2e-tests/test-applications/nuxt-4-test-app/package.json +0 -18
- package/e2e-tests/test-applications/nuxt-4-test-app/public/favicon.ico +0 -0
- package/e2e-tests/test-applications/nuxt-4-test-app/public/robots.txt +0 -1
- package/e2e-tests/test-applications/remix-test-app/app/entry.client.tsx +0 -18
- package/e2e-tests/test-applications/remix-test-app/app/entry.server.tsx +0 -140
- package/e2e-tests/test-applications/remix-test-app/app/root.tsx +0 -30
- package/e2e-tests/test-applications/remix-test-app/app/routes/_index.tsx +0 -48
- package/e2e-tests/test-applications/remix-test-app/app/tailwind.css +0 -3
- package/e2e-tests/test-applications/remix-test-app/package.json +0 -37
- package/e2e-tests/test-applications/remix-test-app/postcss.config.js +0 -6
- package/e2e-tests/test-applications/remix-test-app/tailwind.config.ts +0 -9
- package/e2e-tests/test-applications/remix-test-app/vite.config.ts +0 -16
- package/e2e-tests/test-applications/sveltekit-test-app/package.json +0 -21
- package/e2e-tests/test-applications/sveltekit-test-app/src/app.d.ts +0 -13
- package/e2e-tests/test-applications/sveltekit-test-app/src/app.html +0 -11
- package/e2e-tests/test-applications/sveltekit-test-app/src/lib/index.ts +0 -1
- package/e2e-tests/test-applications/sveltekit-test-app/src/routes/+page.svelte +0 -2
- package/e2e-tests/test-applications/sveltekit-test-app/svelte.config.js +0 -18
- package/e2e-tests/test-applications/sveltekit-test-app/vite.config.ts +0 -6
- package/e2e-tests/tests/flutter.test.ts +0 -127
- package/e2e-tests/tests/nextjs.test.ts +0 -161
- package/e2e-tests/tests/nuxt-3.test.ts +0 -189
- package/e2e-tests/tests/nuxt-4.test.ts +0 -188
- package/e2e-tests/tests/remix.test.ts +0 -277
- package/e2e-tests/tests/sveltekit.test.ts +0 -284
- package/e2e-tests/utils/index.ts +0 -438
- package/index.ts +0 -2
- package/lib/Constants.ts +0 -118
- package/lib/Helper/BottomBar.ts +0 -28
- package/lib/Helper/Env.ts +0 -7
- package/lib/Helper/File.ts +0 -65
- package/lib/Helper/Git.ts +0 -39
- package/lib/Helper/Logging.ts +0 -44
- package/lib/Helper/MergeConfig.ts +0 -19
- package/lib/Helper/Package.ts +0 -78
- package/lib/Helper/SentryCli.ts +0 -148
- package/lib/Helper/Wizard.ts +0 -59
- package/lib/Helper/__tests__/File.ts +0 -15
- package/lib/Helper/__tests__/MergeConfig.ts +0 -98
- package/lib/Helper/__tests__/SentryCli.ts +0 -86
- package/lib/Helper/test-fixtures/next.config.1-merged.js +0 -18
- package/lib/Helper/test-fixtures/next.config.1.js +0 -6
- package/lib/Helper/test-fixtures/next.config.2.js +0 -8
- package/lib/Helper/test-fixtures/next.config.3-merged.js +0 -21
- package/lib/Helper/test-fixtures/next.config.3.js +0 -9
- package/lib/Helper/test-fixtures/next.config.4-merged.js +0 -21
- package/lib/Helper/test-fixtures/next.config.4.js +0 -9
- package/lib/Setup.ts +0 -41
- package/lib/Steps/BaseStep.ts +0 -25
- package/lib/Steps/ChooseIntegration.ts +0 -112
- package/lib/Steps/ConfigureProject.ts +0 -10
- package/lib/Steps/Initial.ts +0 -44
- package/lib/Steps/Integrations/BaseIntegration.ts +0 -48
- package/lib/Steps/Integrations/Cordova.ts +0 -289
- package/lib/Steps/Integrations/Electron.ts +0 -161
- package/lib/Steps/Integrations/MobileProject.ts +0 -69
- package/lib/Steps/OpenSentry.ts +0 -75
- package/lib/Steps/PromptForParameters.ts +0 -207
- package/lib/Steps/Result.ts +0 -22
- package/lib/Steps/SentryProjectSelector.ts +0 -82
- package/lib/Steps/ShouldConfigure.ts +0 -10
- package/lib/Steps/WaitForSentry.ts +0 -50
- package/lib/Steps/Welcome.ts +0 -21
- package/lib/Steps/index.ts +0 -10
- package/lib/__tests__/Env.ts +0 -29
- package/scripts/NextJs/configs/_error.js +0 -39
- package/scripts/NextJs/configs/next.config.js +0 -36
- package/scripts/NextJs/configs/next.config.template.js +0 -12
- package/scripts/NextJs/configs/sentry.client.config.js +0 -17
- package/scripts/NextJs/configs/sentry.edge.config.js +0 -17
- package/scripts/NextJs/configs/sentry.server.config.js +0 -17
- package/scripts/NextJs/sentry_sample_error.js +0 -47
- package/scripts/craft-pre-release.sh +0 -10
- package/src/android/android-wizard.ts +0 -192
- package/src/android/code-tools.ts +0 -170
- package/src/android/gradle.ts +0 -250
- package/src/android/manifest.ts +0 -180
- package/src/android/templates.ts +0 -86
- package/src/apple/apple-wizard.ts +0 -269
- package/src/apple/cocoapod.ts +0 -73
- package/src/apple/code-tools.ts +0 -147
- package/src/apple/fastlane.ts +0 -170
- package/src/apple/templates.ts +0 -65
- package/src/apple/xcode-manager.ts +0 -404
- package/src/flutter/code-tools.ts +0 -284
- package/src/flutter/flutter-wizard.ts +0 -164
- package/src/flutter/templates.ts +0 -90
- package/src/nextjs/nextjs-wizard.ts +0 -1007
- package/src/nextjs/templates.ts +0 -526
- package/src/nextjs/utils.ts +0 -21
- package/src/nuxt/nuxt-wizard.ts +0 -188
- package/src/nuxt/sdk-example.ts +0 -135
- package/src/nuxt/sdk-setup.ts +0 -349
- package/src/nuxt/templates.ts +0 -303
- package/src/nuxt/types.ts +0 -8
- package/src/nuxt/utils.ts +0 -42
- package/src/react-native/expo-env-file.ts +0 -55
- package/src/react-native/expo-metro.ts +0 -212
- package/src/react-native/expo.ts +0 -175
- package/src/react-native/git.ts +0 -25
- package/src/react-native/glob.ts +0 -13
- package/src/react-native/gradle.ts +0 -26
- package/src/react-native/javascript.ts +0 -103
- package/src/react-native/metro.ts +0 -599
- package/src/react-native/options.ts +0 -5
- package/src/react-native/react-native-wizard.ts +0 -513
- package/src/react-native/uninstall.ts +0 -110
- package/src/react-native/xcode.ts +0 -302
- package/src/remix/codemods/express-server.ts +0 -44
- package/src/remix/codemods/handle-error.ts +0 -118
- package/src/remix/codemods/root-common.ts +0 -63
- package/src/remix/codemods/root-v1.ts +0 -41
- package/src/remix/codemods/root-v2.ts +0 -153
- package/src/remix/remix-wizard.ts +0 -261
- package/src/remix/sdk-example.ts +0 -120
- package/src/remix/sdk-setup.ts +0 -546
- package/src/remix/templates.ts +0 -11
- package/src/remix/utils.ts +0 -96
- package/src/run.ts +0 -204
- package/src/sourcemaps/sourcemaps-wizard.ts +0 -364
- package/src/sourcemaps/tools/angular.ts +0 -42
- package/src/sourcemaps/tools/create-react-app.ts +0 -19
- package/src/sourcemaps/tools/esbuild.ts +0 -65
- package/src/sourcemaps/tools/nextjs.ts +0 -114
- package/src/sourcemaps/tools/remix.ts +0 -90
- package/src/sourcemaps/tools/rollup.ts +0 -67
- package/src/sourcemaps/tools/sentry-cli.ts +0 -287
- package/src/sourcemaps/tools/tsc.ts +0 -144
- package/src/sourcemaps/tools/types.ts +0 -11
- package/src/sourcemaps/tools/vite.ts +0 -300
- package/src/sourcemaps/tools/webpack.ts +0 -383
- package/src/sourcemaps/utils/detect-tool.ts +0 -46
- package/src/sourcemaps/utils/other-wizards.ts +0 -167
- package/src/sourcemaps/utils/sdk-version.ts +0 -266
- package/src/sveltekit/sdk-example.ts +0 -56
- package/src/sveltekit/sdk-setup.ts +0 -667
- package/src/sveltekit/sveltekit-wizard.ts +0 -192
- package/src/sveltekit/templates.ts +0 -185
- package/src/sveltekit/utils.ts +0 -50
- package/src/telemetry.ts +0 -124
- package/src/utils/ast-utils.ts +0 -270
- package/src/utils/bash.ts +0 -57
- package/src/utils/clack-utils.ts +0 -1533
- package/src/utils/debug.ts +0 -20
- package/src/utils/package-json.ts +0 -51
- package/src/utils/package-manager.ts +0 -172
- package/src/utils/release-registry.ts +0 -19
- package/src/utils/semver.ts +0 -33
- package/src/utils/sentrycli-utils.ts +0 -24
- package/src/utils/string.ts +0 -7
- package/src/utils/types.ts +0 -77
- package/src/utils/url.ts +0 -27
- package/src/utils/vendor/is-unicorn-supported.ts +0 -29
- package/test/android/code-tools.test.ts +0 -49
- package/test/apple/cocoapod.test.ts +0 -306
- package/test/apple/code-tools.test.ts +0 -1042
- package/test/apple/fastfile.test.ts +0 -550
- package/test/apple/templates.test.ts +0 -191
- package/test/apple/xcode-manager.test.ts +0 -1066
- package/test/flutter/code-tools.test.ts +0 -212
- package/test/flutter/templates.test.ts +0 -100
- package/test/nextjs/templates.test.ts +0 -429
- package/test/nuxt/templates.test.ts +0 -255
- package/test/react-native/expo-metro.test.ts +0 -81
- package/test/react-native/expo.test.ts +0 -86
- package/test/react-native/gradle.test.ts +0 -310
- package/test/react-native/javascript.test.ts +0 -134
- package/test/react-native/metro.test.ts +0 -396
- package/test/react-native/xcode.test.ts +0 -401
- package/test/remix/client-entry.test.ts +0 -122
- package/test/remix/server-instrumentation.test.ts +0 -36
- package/test/sourcemaps/tools/sentry-cli.test.ts +0 -57
- package/test/sourcemaps/tools/tsc.test.ts +0 -181
- package/test/sourcemaps/tools/vite.test.ts +0 -149
- package/test/sourcemaps/tools/webpack.test.ts +0 -303
- package/test/sveltekit/templates.test.ts +0 -152
- package/test/utils/ast-utils.test.ts +0 -264
- package/test/utils/clack-utils.test.ts +0 -234
- package/types/xcode.d.ts +0 -526
|
@@ -1,34 +1,87 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sourceContextKts = exports.sourceContext = exports.testErrorSnippetKt = exports.testErrorSnippet = exports.sentryImportKt = exports.sentryImport = exports.manifest = exports.pluginKts = exports.plugin = exports.pluginsBlockKts = exports.pluginsBlock = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
const pluginsBlock = (version = '3.12.0') => `
|
|
5
|
+
plugins {
|
|
6
|
+
id 'io.sentry.android.gradle' version '${version}'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
`;
|
|
8
10
|
exports.pluginsBlock = pluginsBlock;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
11
|
+
const pluginsBlockKts = (version = '3.12.0') => `
|
|
12
|
+
plugins {
|
|
13
|
+
id("io.sentry.android.gradle") version "${version}"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
`;
|
|
13
17
|
exports.pluginsBlockKts = pluginsBlockKts;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
+
const plugin = (version = '3.12.0') => `
|
|
19
|
+
id 'io.sentry.android.gradle' version '${version}'
|
|
20
|
+
`;
|
|
18
21
|
exports.plugin = plugin;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
22
|
+
const pluginKts = (version = '3.12.0') => `
|
|
23
|
+
id("io.sentry.android.gradle") version "${version}"
|
|
24
|
+
`;
|
|
23
25
|
exports.pluginKts = pluginKts;
|
|
24
|
-
|
|
26
|
+
const manifest = (dsn) => `
|
|
27
|
+
<!-- Required: set your sentry.io project identifier (DSN) -->
|
|
28
|
+
<meta-data android:name="io.sentry.dsn" android:value="${dsn}" />
|
|
29
|
+
|
|
30
|
+
<!-- enable automatic breadcrumbs for user interactions (clicks, swipes, scrolls) -->
|
|
31
|
+
<meta-data android:name="io.sentry.traces.user-interaction.enable" android:value="true" />
|
|
32
|
+
<!-- enable screenshot for crashes (could contain sensitive/PII data) -->
|
|
33
|
+
<meta-data android:name="io.sentry.attach-screenshot" android:value="true" />
|
|
34
|
+
<!-- enable view hierarchy for crashes -->
|
|
35
|
+
<meta-data android:name="io.sentry.attach-view-hierarchy" android:value="true" />
|
|
36
|
+
|
|
37
|
+
<!-- enable the performance API by setting a sample-rate, adjust in production env -->
|
|
38
|
+
<meta-data android:name="io.sentry.traces.sample-rate" android:value="1.0" />
|
|
39
|
+
`;
|
|
25
40
|
exports.manifest = manifest;
|
|
26
|
-
exports.sentryImport =
|
|
27
|
-
exports.sentryImportKt =
|
|
28
|
-
exports.testErrorSnippet =
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
exports.sentryImport = `import io.sentry.Sentry;\n`;
|
|
42
|
+
exports.sentryImportKt = `import io.sentry.Sentry\n`;
|
|
43
|
+
exports.testErrorSnippet = `
|
|
44
|
+
// waiting for view to draw to better represent a captured error with a screenshot
|
|
45
|
+
findViewById(android.R.id.content).getViewTreeObserver().addOnGlobalLayoutListener(() -> {
|
|
46
|
+
try {
|
|
47
|
+
throw new Exception("This app uses Sentry! :)");
|
|
48
|
+
} catch (Exception e) {
|
|
49
|
+
Sentry.captureException(e);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
`;
|
|
53
|
+
exports.testErrorSnippetKt = `
|
|
54
|
+
// waiting for view to draw to better represent a captured error with a screenshot
|
|
55
|
+
findViewById<android.view.View>(android.R.id.content).viewTreeObserver.addOnGlobalLayoutListener {
|
|
56
|
+
try {
|
|
57
|
+
throw Exception("This app uses Sentry! :)")
|
|
58
|
+
} catch (e: Exception) {
|
|
59
|
+
Sentry.captureException(e)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
const sourceContext = (orgSlug, projectSlug) => `
|
|
64
|
+
|
|
65
|
+
sentry {
|
|
66
|
+
org = "${orgSlug}"
|
|
67
|
+
projectName = "${projectSlug}"
|
|
68
|
+
|
|
69
|
+
// this will upload your source code to Sentry to show it as part of the stack traces
|
|
70
|
+
// disable if you don't want to expose your sources
|
|
71
|
+
includeSourceContext = true
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
31
74
|
exports.sourceContext = sourceContext;
|
|
32
|
-
|
|
75
|
+
const sourceContextKts = (orgSlug, projectSlug) => `
|
|
76
|
+
|
|
77
|
+
sentry {
|
|
78
|
+
org.set("${orgSlug}")
|
|
79
|
+
projectName.set("${projectSlug}")
|
|
80
|
+
|
|
81
|
+
// this will upload your source code to Sentry to show it as part of the stack traces
|
|
82
|
+
// disable if you don't want to expose your sources
|
|
83
|
+
includeSourceContext.set(true)
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
33
86
|
exports.sourceContextKts = sourceContextKts;
|
|
34
87
|
//# sourceMappingURL=templates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/android/templates.ts"],"names":[],"mappings":";;;AAAO,
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/android/templates.ts"],"names":[],"mappings":";;;AAAO,MAAM,YAAY,GAAG,CAAC,OAAO,GAAG,QAAQ,EAAE,EAAE,CAAC;;6CAEP,OAAO;;;CAGnD,CAAC;AALW,QAAA,YAAY,gBAKvB;AAEK,MAAM,eAAe,GAAG,CAAC,OAAO,GAAG,QAAQ,EAAE,EAAE,CAAC;;8CAET,OAAO;;;CAGpD,CAAC;AALW,QAAA,eAAe,mBAK1B;AAEK,MAAM,MAAM,GAAG,CAAC,OAAO,GAAG,QAAQ,EAAE,EAAE,CAAC;6CACD,OAAO;CACnD,CAAC;AAFW,QAAA,MAAM,UAEjB;AAEK,MAAM,SAAS,GAAG,CAAC,OAAO,GAAG,QAAQ,EAAE,EAAE,CAAC;8CACH,OAAO;CACpD,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC;;6DAEoB,GAAG;;;;;;;;;;;CAW/D,CAAC;AAbW,QAAA,QAAQ,YAanB;AAEW,QAAA,YAAY,GAAG,4BAA4B,CAAC;AAE5C,QAAA,cAAc,GAAG,2BAA2B,CAAC;AAE7C,QAAA,gBAAgB,GAAG;;;;;;;;;CAS/B,CAAC;AAEW,QAAA,kBAAkB,GAAG;;;;;;;;;CASjC,CAAC;AAEK,MAAM,aAAa,GAAG,CAAC,OAAe,EAAE,WAAmB,EAAE,EAAE,CAAC;;;aAG1D,OAAO;qBACC,WAAW;;;;;;CAM/B,CAAC;AAVW,QAAA,aAAa,iBAUxB;AAEK,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAE,WAAmB,EAAE,EAAE,CAAC;;;eAG3D,OAAO;uBACC,WAAW;;;;;;CAMjC,CAAC;AAVW,QAAA,gBAAgB,oBAU3B","sourcesContent":["export const pluginsBlock = (version = '3.12.0') => `\nplugins {\n id 'io.sentry.android.gradle' version '${version}'\n}\n\n`;\n\nexport const pluginsBlockKts = (version = '3.12.0') => `\nplugins {\n id(\"io.sentry.android.gradle\") version \"${version}\"\n}\n\n`;\n\nexport const plugin = (version = '3.12.0') => `\n id 'io.sentry.android.gradle' version '${version}'\n`;\n\nexport const pluginKts = (version = '3.12.0') => `\n id(\"io.sentry.android.gradle\") version \"${version}\"\n`;\n\nexport const manifest = (dsn: string) => `\n <!-- Required: set your sentry.io project identifier (DSN) -->\n <meta-data android:name=\"io.sentry.dsn\" android:value=\"${dsn}\" />\n\n <!-- enable automatic breadcrumbs for user interactions (clicks, swipes, scrolls) -->\n <meta-data android:name=\"io.sentry.traces.user-interaction.enable\" android:value=\"true\" />\n <!-- enable screenshot for crashes (could contain sensitive/PII data) -->\n <meta-data android:name=\"io.sentry.attach-screenshot\" android:value=\"true\" />\n <!-- enable view hierarchy for crashes -->\n <meta-data android:name=\"io.sentry.attach-view-hierarchy\" android:value=\"true\" />\n\n <!-- enable the performance API by setting a sample-rate, adjust in production env -->\n <meta-data android:name=\"io.sentry.traces.sample-rate\" android:value=\"1.0\" />\n`;\n\nexport const sentryImport = `import io.sentry.Sentry;\\n`;\n\nexport const sentryImportKt = `import io.sentry.Sentry\\n`;\n\nexport const testErrorSnippet = `\n // waiting for view to draw to better represent a captured error with a screenshot\n findViewById(android.R.id.content).getViewTreeObserver().addOnGlobalLayoutListener(() -> {\n try {\n throw new Exception(\"This app uses Sentry! :)\");\n } catch (Exception e) {\n Sentry.captureException(e);\n }\n });\n`;\n\nexport const testErrorSnippetKt = `\n // waiting for view to draw to better represent a captured error with a screenshot\n findViewById<android.view.View>(android.R.id.content).viewTreeObserver.addOnGlobalLayoutListener {\n try {\n throw Exception(\"This app uses Sentry! :)\")\n } catch (e: Exception) {\n Sentry.captureException(e)\n }\n }\n`;\n\nexport const sourceContext = (orgSlug: string, projectSlug: string) => `\n\nsentry {\n org = \"${orgSlug}\"\n projectName = \"${projectSlug}\"\n\n // this will upload your source code to Sentry to show it as part of the stack traces\n // disable if you don't want to expose your sources\n includeSourceContext = true\n}\n`;\n\nexport const sourceContextKts = (orgSlug: string, projectSlug: string) => `\n\nsentry {\n org.set(\"${orgSlug}\")\n projectName.set(\"${projectSlug}\")\n\n // this will upload your source code to Sentry to show it as part of the stack traces\n // disable if you don't want to expose your sources\n includeSourceContext.set(true)\n}\n`;\n"]}
|
|
@@ -22,42 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
-
function step(op) {
|
|
39
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
-
switch (op[0]) {
|
|
44
|
-
case 0: case 1: t = op; break;
|
|
45
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
-
default:
|
|
49
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
-
if (t[2]) _.ops.pop();
|
|
54
|
-
_.trys.pop(); continue;
|
|
55
|
-
}
|
|
56
|
-
op = body.call(thisArg, _);
|
|
57
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
27
|
};
|
|
@@ -69,212 +33,152 @@ exports.runAppleWizard = void 0;
|
|
|
69
33
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
70
34
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
71
35
|
// @ts-ignore - clack is ESM and TS complains about that. It works though
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
36
|
+
const prompts_1 = __importDefault(require("@clack/prompts"));
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const xcode_manager_1 = require("./xcode-manager");
|
|
40
|
+
const codeTools = __importStar(require("./code-tools"));
|
|
41
|
+
const bash = __importStar(require("../utils/bash"));
|
|
42
|
+
const SentryUtils = __importStar(require("../utils/sentrycli-utils"));
|
|
43
|
+
const Sentry = __importStar(require("@sentry/node"));
|
|
44
|
+
const telemetry_1 = require("../telemetry");
|
|
45
|
+
const cocoapod = __importStar(require("./cocoapod"));
|
|
46
|
+
const fastlane = __importStar(require("./fastlane"));
|
|
83
47
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
84
|
-
|
|
85
|
-
function runAppleWizard(options) {
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
wizardOptions: options,
|
|
92
|
-
}, function () { return runAppleWizardWithTelementry(options); })];
|
|
93
|
-
});
|
|
94
|
-
});
|
|
48
|
+
const clack_utils_1 = require("../utils/clack-utils");
|
|
49
|
+
async function runAppleWizard(options) {
|
|
50
|
+
return (0, telemetry_1.withTelemetry)({
|
|
51
|
+
enabled: options.telemetryEnabled,
|
|
52
|
+
integration: 'ios',
|
|
53
|
+
wizardOptions: options,
|
|
54
|
+
}, () => runAppleWizardWithTelementry(options));
|
|
95
55
|
}
|
|
96
56
|
exports.runAppleWizard = runAppleWizard;
|
|
97
|
-
function runAppleWizardWithTelementry(options) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
Sentry.setTag('No-Target', true);
|
|
162
|
-
return [4 /*yield*/, (0, clack_utils_1.abort)()];
|
|
163
|
-
case 14:
|
|
164
|
-
_c.sent();
|
|
165
|
-
return [2 /*return*/];
|
|
166
|
-
case 15:
|
|
167
|
-
if (!(availableTargets.length == 1)) return [3 /*break*/, 16];
|
|
168
|
-
_b = availableTargets[0];
|
|
169
|
-
return [3 /*break*/, 18];
|
|
170
|
-
case 16: return [4 /*yield*/, (0, telemetry_1.traceStep)('Choose target', function () {
|
|
171
|
-
return (0, clack_utils_1.askForItemSelection)(availableTargets, 'Which target do you want to add Sentry to?');
|
|
172
|
-
})];
|
|
173
|
-
case 17:
|
|
174
|
-
_b = (_c.sent()).value;
|
|
175
|
-
_c.label = 18;
|
|
176
|
-
case 18:
|
|
177
|
-
target = _b;
|
|
178
|
-
SentryUtils.createSentryCLIRC(projectDir, { auth_token: apiKey.token });
|
|
179
|
-
prompts_1.default.log.info('We created a ".sentryclirc" file in your project directory in order to provide an auth token for Sentry CLI.\nIt was also added to your ".gitignore" file.\nAt your CI enviroment, you can set the SENTRY_AUTH_TOKEN environment variable instead. See https://docs.sentry.io/cli/configuration/#auth-token for more information.');
|
|
180
|
-
hasCocoa = cocoapod.usesCocoaPod(projectDir);
|
|
181
|
-
Sentry.setTag('cocoapod-exists', hasCocoa);
|
|
182
|
-
if (!hasCocoa) return [3 /*break*/, 21];
|
|
183
|
-
return [4 /*yield*/, (0, telemetry_1.traceStep)('Choose a package manager', function () {
|
|
184
|
-
return (0, clack_utils_1.askForItemSelection)(['Swift Package Manager', 'CocoaPods'], 'Which package manager would you like to use to add Sentry?');
|
|
185
|
-
})];
|
|
186
|
-
case 19:
|
|
187
|
-
pm = (_c.sent()).value;
|
|
188
|
-
hasCocoa = pm === 'CocoaPods';
|
|
189
|
-
if (!hasCocoa) return [3 /*break*/, 21];
|
|
190
|
-
return [4 /*yield*/, (0, telemetry_1.traceStep)('Add CocoaPods reference', function () {
|
|
191
|
-
return cocoapod.addCocoaPods(projectDir);
|
|
192
|
-
})];
|
|
193
|
-
case 20:
|
|
194
|
-
podAdded = _c.sent();
|
|
195
|
-
Sentry.setTag('cocoapod-added', podAdded);
|
|
196
|
-
if (!podAdded) {
|
|
197
|
-
prompts_1.default.log.warn("Could not add Sentry pod to your Podfile. You'll have to add it manually.\nPlease follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/#install");
|
|
198
|
-
}
|
|
199
|
-
_c.label = 21;
|
|
200
|
-
case 21:
|
|
201
|
-
Sentry.setTag('package-manager', hasCocoa ? 'cocoapods' : 'SPM');
|
|
202
|
-
(0, telemetry_1.traceStep)('Update Xcode project', function () {
|
|
203
|
-
xcProject.updateXcodeProject(project, target, !hasCocoa, true);
|
|
204
|
-
});
|
|
205
|
-
codeAdded = (0, telemetry_1.traceStep)('Add code snippet', function () {
|
|
206
|
-
var files = xcProject.filesForTarget(target);
|
|
207
|
-
if (files === undefined || files.length == 0)
|
|
208
|
-
return false;
|
|
209
|
-
return codeTools.addCodeSnippetToProject(projectDir, files, project.keys[0].dsn.public);
|
|
210
|
-
});
|
|
211
|
-
Sentry.setTag('Snippet-Added', codeAdded);
|
|
212
|
-
if (!codeAdded) {
|
|
213
|
-
prompts_1.default.log.warn('Added the Sentry dependency to your project but could not add the Sentry code snippet. Please add the code snipped manually by following the docs: https://docs.sentry.io/platforms/apple/guides/ios/#configure');
|
|
214
|
-
}
|
|
215
|
-
hasFastlane = fastlane.fastFile(projectDir);
|
|
216
|
-
Sentry.setTag('fastlane-exists', hasFastlane);
|
|
217
|
-
if (!hasFastlane) return [3 /*break*/, 24];
|
|
218
|
-
return [4 /*yield*/, prompts_1.default.confirm({
|
|
219
|
-
message: 'Found a Fastfile in your project. Do you want to configure a lane to upload debug symbols to Sentry?',
|
|
220
|
-
})];
|
|
221
|
-
case 22:
|
|
222
|
-
addLane = _c.sent();
|
|
223
|
-
Sentry.setTag('fastlane-desired', addLane);
|
|
224
|
-
if (!addLane) return [3 /*break*/, 24];
|
|
225
|
-
return [4 /*yield*/, (0, telemetry_1.traceStep)('Configure fastlane', function () {
|
|
226
|
-
return fastlane.addSentryToFastlane(projectDir, project.organization.slug, project.slug);
|
|
227
|
-
})];
|
|
228
|
-
case 23:
|
|
229
|
-
added = _c.sent();
|
|
230
|
-
Sentry.setTag('fastlane-added', added);
|
|
231
|
-
if (added) {
|
|
232
|
-
prompts_1.default.log.step('A new step was added to your fastlane file. Now and you build your project with fastlane, debug symbols and source context will be uploaded to Sentry.');
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
prompts_1.default.log.warn('Could not edit your fastlane file to upload debug symbols to Sentry. Please follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/dsym/#fastlane');
|
|
236
|
-
}
|
|
237
|
-
_c.label = 24;
|
|
238
|
-
case 24:
|
|
239
|
-
prompts_1.default.log.success('Sentry was successfully added to your project! Run your project to send your first event to Sentry. Go to Sentry.io to see whether everything is working fine.');
|
|
240
|
-
return [2 /*return*/];
|
|
57
|
+
async function runAppleWizardWithTelementry(options) {
|
|
58
|
+
(0, clack_utils_1.printWelcome)({
|
|
59
|
+
wizardName: 'Sentry Apple Wizard',
|
|
60
|
+
promoCode: options.promoCode,
|
|
61
|
+
});
|
|
62
|
+
await (0, clack_utils_1.confirmContinueIfNoOrDirtyGitRepo)();
|
|
63
|
+
const hasCli = bash.hasSentryCLI();
|
|
64
|
+
Sentry.setTag('has-cli', hasCli);
|
|
65
|
+
if (!hasCli) {
|
|
66
|
+
if (!(await (0, telemetry_1.traceStep)('Ask for SentryCLI', () => (0, clack_utils_1.askToInstallSentryCLI)()))) {
|
|
67
|
+
prompts_1.default.log.warn("Without sentry-cli, you won't be able to upload debug symbols to Sentry. You can install it later by following the instructions at https://docs.sentry.io/cli/");
|
|
68
|
+
Sentry.setTag('CLI-Installed', false);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
await bash.installSentryCLI();
|
|
72
|
+
Sentry.setTag('CLI-Installed', true);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const projectDir = process.cwd();
|
|
76
|
+
const xcodeProjFiles = searchXcodeProject(projectDir);
|
|
77
|
+
if (!xcodeProjFiles || xcodeProjFiles.length === 0) {
|
|
78
|
+
prompts_1.default.log.error('No Xcode project found. Please run this command from the root of your project.');
|
|
79
|
+
await (0, clack_utils_1.abort)();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
let xcodeProjFile;
|
|
83
|
+
if (xcodeProjFiles.length === 1) {
|
|
84
|
+
xcodeProjFile = xcodeProjFiles[0];
|
|
85
|
+
Sentry.setTag('multiple-projects', false);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
Sentry.setTag('multiple-projects', true);
|
|
89
|
+
xcodeProjFile = (await (0, telemetry_1.traceStep)('Choose Xcode project', () => (0, clack_utils_1.askForItemSelection)(xcodeProjFiles, 'Which project do you want to add Sentry to?'))).value;
|
|
90
|
+
}
|
|
91
|
+
const pbxproj = path.join(projectDir, xcodeProjFile, 'project.pbxproj');
|
|
92
|
+
if (!fs.existsSync(pbxproj)) {
|
|
93
|
+
prompts_1.default.log.error(`No pbxproj found at ${xcodeProjFile}`);
|
|
94
|
+
await (0, clack_utils_1.abort)();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const { project, apiKey } = await getSentryProjectAndApiKey(options);
|
|
98
|
+
const xcProject = new xcode_manager_1.XcodeProject(pbxproj);
|
|
99
|
+
const availableTargets = xcProject.getAllTargets();
|
|
100
|
+
if (availableTargets.length == 0) {
|
|
101
|
+
prompts_1.default.log.error(`No suitable target found in ${xcodeProjFile}`);
|
|
102
|
+
Sentry.setTag('No-Target', true);
|
|
103
|
+
await (0, clack_utils_1.abort)();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const target = availableTargets.length == 1
|
|
107
|
+
? availableTargets[0]
|
|
108
|
+
: (await (0, telemetry_1.traceStep)('Choose target', () => (0, clack_utils_1.askForItemSelection)(availableTargets, 'Which target do you want to add Sentry to?'))).value;
|
|
109
|
+
SentryUtils.createSentryCLIRC(projectDir, { auth_token: apiKey.token });
|
|
110
|
+
prompts_1.default.log.info('We created a ".sentryclirc" file in your project directory in order to provide an auth token for Sentry CLI.\nIt was also added to your ".gitignore" file.\nAt your CI enviroment, you can set the SENTRY_AUTH_TOKEN environment variable instead. See https://docs.sentry.io/cli/configuration/#auth-token for more information.');
|
|
111
|
+
let hasCocoa = cocoapod.usesCocoaPod(projectDir);
|
|
112
|
+
Sentry.setTag('cocoapod-exists', hasCocoa);
|
|
113
|
+
if (hasCocoa) {
|
|
114
|
+
const pm = (await (0, telemetry_1.traceStep)('Choose a package manager', () => (0, clack_utils_1.askForItemSelection)(['Swift Package Manager', 'CocoaPods'], 'Which package manager would you like to use to add Sentry?'))).value;
|
|
115
|
+
hasCocoa = pm === 'CocoaPods';
|
|
116
|
+
if (hasCocoa) {
|
|
117
|
+
const podAdded = await (0, telemetry_1.traceStep)('Add CocoaPods reference', () => cocoapod.addCocoaPods(projectDir));
|
|
118
|
+
Sentry.setTag('cocoapod-added', podAdded);
|
|
119
|
+
if (!podAdded) {
|
|
120
|
+
prompts_1.default.log.warn("Could not add Sentry pod to your Podfile. You'll have to add it manually.\nPlease follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/#install");
|
|
241
121
|
}
|
|
242
|
-
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
Sentry.setTag('package-manager', hasCocoa ? 'cocoapods' : 'SPM');
|
|
125
|
+
(0, telemetry_1.traceStep)('Update Xcode project', () => {
|
|
126
|
+
xcProject.updateXcodeProject(project, target, !hasCocoa, true);
|
|
243
127
|
});
|
|
128
|
+
const codeAdded = (0, telemetry_1.traceStep)('Add code snippet', () => {
|
|
129
|
+
const files = xcProject.filesForTarget(target);
|
|
130
|
+
if (files === undefined || files.length == 0)
|
|
131
|
+
return false;
|
|
132
|
+
return codeTools.addCodeSnippetToProject(projectDir, files, project.keys[0].dsn.public);
|
|
133
|
+
});
|
|
134
|
+
Sentry.setTag('Snippet-Added', codeAdded);
|
|
135
|
+
if (!codeAdded) {
|
|
136
|
+
prompts_1.default.log.warn('Added the Sentry dependency to your project but could not add the Sentry code snippet. Please add the code snipped manually by following the docs: https://docs.sentry.io/platforms/apple/guides/ios/#configure');
|
|
137
|
+
}
|
|
138
|
+
const hasFastlane = fastlane.fastFile(projectDir);
|
|
139
|
+
Sentry.setTag('fastlane-exists', hasFastlane);
|
|
140
|
+
if (hasFastlane) {
|
|
141
|
+
const addLane = await prompts_1.default.confirm({
|
|
142
|
+
message: 'Found a Fastfile in your project. Do you want to configure a lane to upload debug symbols to Sentry?',
|
|
143
|
+
});
|
|
144
|
+
Sentry.setTag('fastlane-desired', addLane);
|
|
145
|
+
if (addLane) {
|
|
146
|
+
const added = await (0, telemetry_1.traceStep)('Configure fastlane', () => fastlane.addSentryToFastlane(projectDir, project.organization.slug, project.slug));
|
|
147
|
+
Sentry.setTag('fastlane-added', added);
|
|
148
|
+
if (added) {
|
|
149
|
+
prompts_1.default.log.step('A new step was added to your fastlane file. Now and you build your project with fastlane, debug symbols and source context will be uploaded to Sentry.');
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
prompts_1.default.log.warn('Could not edit your fastlane file to upload debug symbols to Sentry. Please follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/dsym/#fastlane');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
prompts_1.default.log.success('Sentry was successfully added to your project! Run your project to send your first event to Sentry. Go to Sentry.io to see whether everything is working fine.');
|
|
244
157
|
}
|
|
245
158
|
//Prompt for Sentry project and API key
|
|
246
|
-
function getSentryProjectAndApiKey(options) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
return __generator(this, function (_b) {
|
|
250
|
-
switch (_b.label) {
|
|
251
|
-
case 0: return [4 /*yield*/, (0, clack_utils_1.getOrAskForProjectData)(options)];
|
|
252
|
-
case 1:
|
|
253
|
-
_a = _b.sent(), selectedProject = _a.selectedProject, authToken = _a.authToken;
|
|
254
|
-
return [2 /*return*/, { project: selectedProject, apiKey: { token: authToken } }];
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
});
|
|
159
|
+
async function getSentryProjectAndApiKey(options) {
|
|
160
|
+
const { selectedProject, authToken } = await (0, clack_utils_1.getOrAskForProjectData)(options);
|
|
161
|
+
return { project: selectedProject, apiKey: { token: authToken } };
|
|
258
162
|
}
|
|
259
163
|
function searchXcodeProject(at) {
|
|
260
|
-
|
|
164
|
+
const projs = findFilesWithExtension(at, '.xcodeproj');
|
|
261
165
|
if (projs.length > 0) {
|
|
262
166
|
return projs;
|
|
263
167
|
}
|
|
264
|
-
|
|
168
|
+
const workspace = findFilesWithExtension(at, '.xcworkspace');
|
|
265
169
|
if (workspace.length == 0) {
|
|
266
170
|
return [];
|
|
267
171
|
}
|
|
268
|
-
|
|
172
|
+
const xsworkspacedata = path.join(at, workspace[0], 'contents.xcworkspacedata');
|
|
269
173
|
if (!fs.existsSync(xsworkspacedata)) {
|
|
270
174
|
return [];
|
|
271
175
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
176
|
+
const groupRegex = /location *= *"group:([^"]+)"/gim;
|
|
177
|
+
const content = fs.readFileSync(xsworkspacedata, 'utf8');
|
|
178
|
+
let matches = groupRegex.exec(content);
|
|
275
179
|
while (matches) {
|
|
276
|
-
|
|
277
|
-
|
|
180
|
+
const group = matches[1];
|
|
181
|
+
const groupPath = path.join(at, group);
|
|
278
182
|
if (!group.endsWith('Pods.xcodeproj') &&
|
|
279
183
|
group.endsWith('.xcodeproj') &&
|
|
280
184
|
fs.existsSync(groupPath)) {
|
|
@@ -286,7 +190,7 @@ function searchXcodeProject(at) {
|
|
|
286
190
|
}
|
|
287
191
|
//find files with the given extension
|
|
288
192
|
function findFilesWithExtension(dir, extension) {
|
|
289
|
-
|
|
290
|
-
return files.filter(
|
|
193
|
+
const files = fs.readdirSync(dir);
|
|
194
|
+
return files.filter((file) => file.endsWith(extension));
|
|
291
195
|
}
|
|
292
196
|
//# sourceMappingURL=apple-wizard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apple-wizard.js","sourceRoot":"","sources":["../../../src/apple/apple-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,+DAA+D;AAC/D,4DAA4D;AAC5D,sDAAsD;AACtD,sDAAsD;AACtD,yEAAyE;AACzE,2DAAmC;AACnC,qCAAyB;AACzB,yCAA6B;AAC7B,iDAA+C;AAC/C,sDAA0C;AAC1C,kDAAsC;AACtC,oEAAwD;AAExD,mDAAuC;AACvC,0CAAwD;AACxD,mDAAuC;AACvC,mDAAuC;AAEvC,qDAAqD;AAErD,oDAO8B;AAE9B,SAAsB,cAAc,CAAC,OAAsB;;;YACzD,sBAAO,IAAA,yBAAa,EAClB;oBACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;oBACjC,WAAW,EAAE,KAAK;oBAClB,aAAa,EAAE,OAAO;iBACvB,EACD,cAAM,OAAA,4BAA4B,CAAC,OAAO,CAAC,EAArC,CAAqC,CAC5C,EAAC;;;CACH;AATD,wCASC;AAED,SAAe,4BAA4B,CACzC,OAAsB;;;;;;oBAEtB,IAAA,0BAAY,EAAC;wBACX,UAAU,EAAE,qBAAqB;wBACjC,SAAS,EAAE,OAAO,CAAC,SAAS;qBAC7B,CAAC,CAAC;oBAEH,qBAAM,IAAA,+CAAiC,GAAE,EAAA;;oBAAzC,SAAyC,CAAC;oBAEpC,MAAM,GAAG,IA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,EAAE,KAAK,CAAC,CAAC;QACvC,IACE,CAAC,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YACjC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC5B,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EACxB;YACA,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACnB;QACD,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACpC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,qCAAqC;AACrC,SAAS,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IAC5D,IAAM,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,KAAK,CAAC,MAAM,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAxB,CAAwB,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { XcodeProject } from './xcode-manager';\nimport * as codeTools from './code-tools';\nimport * as bash from '../utils/bash';\nimport * as SentryUtils from '../utils/sentrycli-utils';\nimport { SentryProjectData, WizardOptions } from '../utils/types';\nimport * as Sentry from '@sentry/node';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport * as cocoapod from './cocoapod';\nimport * as fastlane from './fastlane';\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nimport {\n askToInstallSentryCLI,\n printWelcome,\n abort,\n askForItemSelection,\n confirmContinueIfNoOrDirtyGitRepo,\n getOrAskForProjectData,\n} from '../utils/clack-utils';\n\nexport async function runAppleWizard(options: WizardOptions): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'ios',\n wizardOptions: options,\n },\n () => runAppleWizardWithTelementry(options),\n );\n}\n\nasync function runAppleWizardWithTelementry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Apple Wizard',\n promoCode: options.promoCode,\n });\n\n await confirmContinueIfNoOrDirtyGitRepo();\n\n const hasCli = bash.hasSentryCLI();\n Sentry.setTag('has-cli', hasCli);\n if (!hasCli) {\n if (\n !(await traceStep('Ask for SentryCLI', () => askToInstallSentryCLI()))\n ) {\n clack.log.warn(\n \"Without sentry-cli, you won't be able to upload debug symbols to Sentry. You can install it later by following the instructions at https://docs.sentry.io/cli/\",\n );\n Sentry.setTag('CLI-Installed', false);\n } else {\n await bash.installSentryCLI();\n Sentry.setTag('CLI-Installed', true);\n }\n }\n\n const projectDir = process.cwd();\n const xcodeProjFiles = searchXcodeProject(projectDir);\n\n if (!xcodeProjFiles || xcodeProjFiles.length === 0) {\n clack.log.error(\n 'No Xcode project found. Please run this command from the root of your project.',\n );\n await abort();\n return;\n }\n\n let xcodeProjFile;\n\n if (xcodeProjFiles.length === 1) {\n xcodeProjFile = xcodeProjFiles[0];\n Sentry.setTag('multiple-projects', false);\n } else {\n Sentry.setTag('multiple-projects', true);\n xcodeProjFile = (\n await traceStep('Choose Xcode project', () =>\n askForItemSelection(\n xcodeProjFiles,\n 'Which project do you want to add Sentry to?',\n ),\n )\n ).value;\n }\n\n const pbxproj = path.join(projectDir, xcodeProjFile, 'project.pbxproj');\n\n if (!fs.existsSync(pbxproj)) {\n clack.log.error(`No pbxproj found at ${xcodeProjFile}`);\n await abort();\n return;\n }\n\n const { project, apiKey } = await getSentryProjectAndApiKey(options);\n\n const xcProject = new XcodeProject(pbxproj);\n\n const availableTargets = xcProject.getAllTargets();\n\n if (availableTargets.length == 0) {\n clack.log.error(`No suitable target found in ${xcodeProjFile}`);\n Sentry.setTag('No-Target', true);\n await abort();\n return;\n }\n\n const target =\n availableTargets.length == 1\n ? availableTargets[0]\n : (\n await traceStep('Choose target', () =>\n askForItemSelection(\n availableTargets,\n 'Which target do you want to add Sentry to?',\n ),\n )\n ).value;\n\n SentryUtils.createSentryCLIRC(projectDir, { auth_token: apiKey.token });\n clack.log.info(\n 'We created a \".sentryclirc\" file in your project directory in order to provide an auth token for Sentry CLI.\\nIt was also added to your \".gitignore\" file.\\nAt your CI enviroment, you can set the SENTRY_AUTH_TOKEN environment variable instead. See https://docs.sentry.io/cli/configuration/#auth-token for more information.',\n );\n\n let hasCocoa = cocoapod.usesCocoaPod(projectDir);\n Sentry.setTag('cocoapod-exists', hasCocoa);\n\n if (hasCocoa) {\n const pm = (\n await traceStep('Choose a package manager', () =>\n askForItemSelection(\n ['Swift Package Manager', 'CocoaPods'],\n 'Which package manager would you like to use to add Sentry?',\n ),\n )\n ).value;\n\n hasCocoa = pm === 'CocoaPods';\n if (hasCocoa) {\n const podAdded = await traceStep('Add CocoaPods reference', () =>\n cocoapod.addCocoaPods(projectDir),\n );\n Sentry.setTag('cocoapod-added', podAdded);\n if (!podAdded) {\n clack.log.warn(\n \"Could not add Sentry pod to your Podfile. You'll have to add it manually.\\nPlease follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/#install\",\n );\n }\n }\n }\n\n Sentry.setTag('package-manager', hasCocoa ? 'cocoapods' : 'SPM');\n traceStep('Update Xcode project', () => {\n xcProject.updateXcodeProject(project, target, !hasCocoa, true);\n });\n\n const codeAdded = traceStep('Add code snippet', () => {\n const files = xcProject.filesForTarget(target);\n if (files === undefined || files.length == 0) return false;\n\n return codeTools.addCodeSnippetToProject(\n projectDir,\n files,\n project.keys[0].dsn.public,\n );\n });\n\n Sentry.setTag('Snippet-Added', codeAdded);\n\n if (!codeAdded) {\n clack.log.warn(\n 'Added the Sentry dependency to your project but could not add the Sentry code snippet. Please add the code snipped manually by following the docs: https://docs.sentry.io/platforms/apple/guides/ios/#configure',\n );\n }\n\n const hasFastlane = fastlane.fastFile(projectDir);\n Sentry.setTag('fastlane-exists', hasFastlane);\n if (hasFastlane) {\n const addLane = await clack.confirm({\n message:\n 'Found a Fastfile in your project. Do you want to configure a lane to upload debug symbols to Sentry?',\n });\n Sentry.setTag('fastlane-desired', addLane);\n if (addLane) {\n const added = await traceStep('Configure fastlane', () =>\n fastlane.addSentryToFastlane(\n projectDir,\n project.organization.slug,\n project.slug,\n ),\n );\n Sentry.setTag('fastlane-added', added);\n if (added) {\n clack.log.step(\n 'A new step was added to your fastlane file. Now and you build your project with fastlane, debug symbols and source context will be uploaded to Sentry.',\n );\n } else {\n clack.log.warn(\n 'Could not edit your fastlane file to upload debug symbols to Sentry. Please follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/dsym/#fastlane',\n );\n }\n }\n }\n\n clack.log.success(\n 'Sentry was successfully added to your project! Run your project to send your first event to Sentry. Go to Sentry.io to see whether everything is working fine.',\n );\n}\n\n//Prompt for Sentry project and API key\nasync function getSentryProjectAndApiKey(\n options: WizardOptions,\n): Promise<{ project: SentryProjectData; apiKey: { token: string } }> {\n const { selectedProject, authToken } = await getOrAskForProjectData(options);\n return { project: selectedProject, apiKey: { token: authToken } };\n}\n\nfunction searchXcodeProject(at: string): string[] {\n const projs = findFilesWithExtension(at, '.xcodeproj');\n if (projs.length > 0) {\n return projs;\n }\n\n const workspace = findFilesWithExtension(at, '.xcworkspace');\n if (workspace.length == 0) {\n return [];\n }\n\n const xsworkspacedata = path.join(\n at,\n workspace[0],\n 'contents.xcworkspacedata',\n );\n if (!fs.existsSync(xsworkspacedata)) {\n return [];\n }\n const groupRegex = /location *= *\"group:([^\"]+)\"/gim;\n const content = fs.readFileSync(xsworkspacedata, 'utf8');\n let matches = groupRegex.exec(content);\n\n while (matches) {\n const group = matches[1];\n const groupPath = path.join(at, group);\n if (\n !group.endsWith('Pods.xcodeproj') &&\n group.endsWith('.xcodeproj') &&\n fs.existsSync(groupPath)\n ) {\n projs.push(group);\n }\n matches = groupRegex.exec(content);\n }\n return projs;\n}\n\n//find files with the given extension\nfunction findFilesWithExtension(dir: string, extension: string): string[] {\n const files = fs.readdirSync(dir);\n return files.filter((file) => file.endsWith(extension));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"apple-wizard.js","sourceRoot":"","sources":["../../../src/apple/apple-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,+DAA+D;AAC/D,4DAA4D;AAC5D,sDAAsD;AACtD,sDAAsD;AACtD,yEAAyE;AACzE,6DAAmC;AACnC,uCAAyB;AACzB,2CAA6B;AAC7B,mDAA+C;AAC/C,wDAA0C;AAC1C,oDAAsC;AACtC,sEAAwD;AAExD,qDAAuC;AACvC,4CAAwD;AACxD,qDAAuC;AACvC,qDAAuC;AAEvC,qDAAqD;AAErD,sDAO8B;AAEvB,KAAK,UAAU,cAAc,CAAC,OAAsB;IACzD,OAAO,IAAA,yBAAa,EAClB;QACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;QACjC,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,OAAO;KACvB,EACD,GAAG,EAAE,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAC5C,CAAC;AACJ,CAAC;AATD,wCASC;AAED,KAAK,UAAU,4BAA4B,CACzC,OAAsB;IAEtB,IAAA,0BAAY,EAAC;QACX,UAAU,EAAE,qBAAqB;QACjC,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAC,CAAC;IAEH,MAAM,IAAA,+CAAiC,GAAE,CAAC;IAE1C,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IACnC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,MAAM,EAAE;QACX,IACE,CAAC,CAAC,MAAM,IAAA,qBAAS,EAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,IAAA,mCAAqB,GAAE,CAAC,CAAC,EACtE;YAC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1D,CAAC","sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { XcodeProject } from './xcode-manager';\nimport * as codeTools from './code-tools';\nimport * as bash from '../utils/bash';\nimport * as SentryUtils from '../utils/sentrycli-utils';\nimport { SentryProjectData, WizardOptions } from '../utils/types';\nimport * as Sentry from '@sentry/node';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport * as cocoapod from './cocoapod';\nimport * as fastlane from './fastlane';\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nimport {\n askToInstallSentryCLI,\n printWelcome,\n abort,\n askForItemSelection,\n confirmContinueIfNoOrDirtyGitRepo,\n getOrAskForProjectData,\n} from '../utils/clack-utils';\n\nexport async function runAppleWizard(options: WizardOptions): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'ios',\n wizardOptions: options,\n },\n () => runAppleWizardWithTelementry(options),\n );\n}\n\nasync function runAppleWizardWithTelementry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Apple Wizard',\n promoCode: options.promoCode,\n });\n\n await confirmContinueIfNoOrDirtyGitRepo();\n\n const hasCli = bash.hasSentryCLI();\n Sentry.setTag('has-cli', hasCli);\n if (!hasCli) {\n if (\n !(await traceStep('Ask for SentryCLI', () => askToInstallSentryCLI()))\n ) {\n clack.log.warn(\n \"Without sentry-cli, you won't be able to upload debug symbols to Sentry. You can install it later by following the instructions at https://docs.sentry.io/cli/\",\n );\n Sentry.setTag('CLI-Installed', false);\n } else {\n await bash.installSentryCLI();\n Sentry.setTag('CLI-Installed', true);\n }\n }\n\n const projectDir = process.cwd();\n const xcodeProjFiles = searchXcodeProject(projectDir);\n\n if (!xcodeProjFiles || xcodeProjFiles.length === 0) {\n clack.log.error(\n 'No Xcode project found. Please run this command from the root of your project.',\n );\n await abort();\n return;\n }\n\n let xcodeProjFile;\n\n if (xcodeProjFiles.length === 1) {\n xcodeProjFile = xcodeProjFiles[0];\n Sentry.setTag('multiple-projects', false);\n } else {\n Sentry.setTag('multiple-projects', true);\n xcodeProjFile = (\n await traceStep('Choose Xcode project', () =>\n askForItemSelection(\n xcodeProjFiles,\n 'Which project do you want to add Sentry to?',\n ),\n )\n ).value;\n }\n\n const pbxproj = path.join(projectDir, xcodeProjFile, 'project.pbxproj');\n\n if (!fs.existsSync(pbxproj)) {\n clack.log.error(`No pbxproj found at ${xcodeProjFile}`);\n await abort();\n return;\n }\n\n const { project, apiKey } = await getSentryProjectAndApiKey(options);\n\n const xcProject = new XcodeProject(pbxproj);\n\n const availableTargets = xcProject.getAllTargets();\n\n if (availableTargets.length == 0) {\n clack.log.error(`No suitable target found in ${xcodeProjFile}`);\n Sentry.setTag('No-Target', true);\n await abort();\n return;\n }\n\n const target =\n availableTargets.length == 1\n ? availableTargets[0]\n : (\n await traceStep('Choose target', () =>\n askForItemSelection(\n availableTargets,\n 'Which target do you want to add Sentry to?',\n ),\n )\n ).value;\n\n SentryUtils.createSentryCLIRC(projectDir, { auth_token: apiKey.token });\n clack.log.info(\n 'We created a \".sentryclirc\" file in your project directory in order to provide an auth token for Sentry CLI.\\nIt was also added to your \".gitignore\" file.\\nAt your CI enviroment, you can set the SENTRY_AUTH_TOKEN environment variable instead. See https://docs.sentry.io/cli/configuration/#auth-token for more information.',\n );\n\n let hasCocoa = cocoapod.usesCocoaPod(projectDir);\n Sentry.setTag('cocoapod-exists', hasCocoa);\n\n if (hasCocoa) {\n const pm = (\n await traceStep('Choose a package manager', () =>\n askForItemSelection(\n ['Swift Package Manager', 'CocoaPods'],\n 'Which package manager would you like to use to add Sentry?',\n ),\n )\n ).value;\n\n hasCocoa = pm === 'CocoaPods';\n if (hasCocoa) {\n const podAdded = await traceStep('Add CocoaPods reference', () =>\n cocoapod.addCocoaPods(projectDir),\n );\n Sentry.setTag('cocoapod-added', podAdded);\n if (!podAdded) {\n clack.log.warn(\n \"Could not add Sentry pod to your Podfile. You'll have to add it manually.\\nPlease follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/#install\",\n );\n }\n }\n }\n\n Sentry.setTag('package-manager', hasCocoa ? 'cocoapods' : 'SPM');\n traceStep('Update Xcode project', () => {\n xcProject.updateXcodeProject(project, target, !hasCocoa, true);\n });\n\n const codeAdded = traceStep('Add code snippet', () => {\n const files = xcProject.filesForTarget(target);\n if (files === undefined || files.length == 0) return false;\n\n return codeTools.addCodeSnippetToProject(\n projectDir,\n files,\n project.keys[0].dsn.public,\n );\n });\n\n Sentry.setTag('Snippet-Added', codeAdded);\n\n if (!codeAdded) {\n clack.log.warn(\n 'Added the Sentry dependency to your project but could not add the Sentry code snippet. Please add the code snipped manually by following the docs: https://docs.sentry.io/platforms/apple/guides/ios/#configure',\n );\n }\n\n const hasFastlane = fastlane.fastFile(projectDir);\n Sentry.setTag('fastlane-exists', hasFastlane);\n if (hasFastlane) {\n const addLane = await clack.confirm({\n message:\n 'Found a Fastfile in your project. Do you want to configure a lane to upload debug symbols to Sentry?',\n });\n Sentry.setTag('fastlane-desired', addLane);\n if (addLane) {\n const added = await traceStep('Configure fastlane', () =>\n fastlane.addSentryToFastlane(\n projectDir,\n project.organization.slug,\n project.slug,\n ),\n );\n Sentry.setTag('fastlane-added', added);\n if (added) {\n clack.log.step(\n 'A new step was added to your fastlane file. Now and you build your project with fastlane, debug symbols and source context will be uploaded to Sentry.',\n );\n } else {\n clack.log.warn(\n 'Could not edit your fastlane file to upload debug symbols to Sentry. Please follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/dsym/#fastlane',\n );\n }\n }\n }\n\n clack.log.success(\n 'Sentry was successfully added to your project! Run your project to send your first event to Sentry. Go to Sentry.io to see whether everything is working fine.',\n );\n}\n\n//Prompt for Sentry project and API key\nasync function getSentryProjectAndApiKey(\n options: WizardOptions,\n): Promise<{ project: SentryProjectData; apiKey: { token: string } }> {\n const { selectedProject, authToken } = await getOrAskForProjectData(options);\n return { project: selectedProject, apiKey: { token: authToken } };\n}\n\nfunction searchXcodeProject(at: string): string[] {\n const projs = findFilesWithExtension(at, '.xcodeproj');\n if (projs.length > 0) {\n return projs;\n }\n\n const workspace = findFilesWithExtension(at, '.xcworkspace');\n if (workspace.length == 0) {\n return [];\n }\n\n const xsworkspacedata = path.join(\n at,\n workspace[0],\n 'contents.xcworkspacedata',\n );\n if (!fs.existsSync(xsworkspacedata)) {\n return [];\n }\n const groupRegex = /location *= *\"group:([^\"]+)\"/gim;\n const content = fs.readFileSync(xsworkspacedata, 'utf8');\n let matches = groupRegex.exec(content);\n\n while (matches) {\n const group = matches[1];\n const groupPath = path.join(at, group);\n if (\n !group.endsWith('Pods.xcodeproj') &&\n group.endsWith('.xcodeproj') &&\n fs.existsSync(groupPath)\n ) {\n projs.push(group);\n }\n matches = groupRegex.exec(content);\n }\n return projs;\n}\n\n//find files with the given extension\nfunction findFilesWithExtension(dir: string, extension: string): string[] {\n const files = fs.readdirSync(dir);\n return files.filter((file) => file.endsWith(extension));\n}\n"]}
|