@sentry/wizard 4.0.0 → 4.0.2
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 +11 -2
- package/dist/NextJs/configs/next.config.js +1 -1
- package/dist/bin.js +2 -1
- package/dist/bin.js.map +1 -1
- package/dist/bump-version.js +28 -0
- package/dist/craft-pre-release.sh +2 -0
- package/dist/lib/Steps/Initial.js +2 -12
- package/dist/lib/Steps/Initial.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.js +1 -1
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/src/nextjs/templates.js +1 -1
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/run.js +2 -18
- package/dist/src/run.js.map +1 -1
- package/dist/src/telemetry.js +2 -16
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/utils/clack-utils.d.ts +16 -0
- package/dist/src/utils/clack-utils.js +53 -45
- package/dist/src/utils/clack-utils.js.map +1 -1
- package/dist/src/version.d.ts +1 -0
- package/dist/src/version.js +7 -0
- package/dist/src/version.js.map +1 -0
- package/dist/test/nextjs/templates.test.js +4 -4
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/utils/clack-utils.test.js +52 -0
- package/dist/test/utils/clack-utils.test.js.map +1 -1
- package/package.json +5 -2
- package/.node-cache/node-v22.14.0-darwin-arm64 +0 -0
- package/.node-cache/node-v22.14.0-darwin-x64 +0 -0
- package/.node-cache/node-v22.14.0-linux-arm64 +0 -0
- package/.node-cache/node-v22.14.0-linux-x64 +0 -0
- package/.node-cache/node-v22.14.0-win-x64.exe +0 -0
- package/COPYING +0 -3575
- package/bin.ts +0 -143
- package/codecov.yml +0 -15
- 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 -456
- 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 -80
- package/lib/Helper/SentryCli.ts +0 -139
- package/lib/Helper/Wizard.ts +0 -58
- 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 -40
- package/lib/Steps/BaseStep.ts +0 -25
- package/lib/Steps/ChooseIntegration.ts +0 -144
- package/lib/Steps/ConfigureProject.ts +0 -10
- package/lib/Steps/Initial.ts +0 -35
- package/lib/Steps/Integrations/BaseIntegration.ts +0 -42
- package/lib/Steps/Integrations/Cordova.ts +0 -283
- package/lib/Steps/Integrations/Electron.ts +0 -164
- package/lib/Steps/Integrations/MobileProject.ts +0 -72
- package/lib/Steps/OpenSentry.ts +0 -80
- package/lib/Steps/PromptForParameters.ts +0 -200
- package/lib/Steps/Result.ts +0 -22
- package/lib/Steps/SentryProjectSelector.ts +0 -83
- package/lib/Steps/ShouldConfigure.ts +0 -10
- package/lib/Steps/WaitForSentry.ts +0 -56
- 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 -525
- 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 -352
- 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 -512
- package/src/react-native/uninstall.ts +0 -109
- 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 -211
- 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 -144
- package/src/utils/ast-utils.ts +0 -270
- package/src/utils/bash.ts +0 -57
- package/src/utils/clack-utils.ts +0 -1536
- 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 -310
- package/test/apple/code-tools.test.ts +0 -1042
- package/test/apple/fastfile.test.ts +0 -555
- package/test/apple/templates.test.ts +0 -191
- package/test/apple/xcode-manager.test.ts +0 -1068
- 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 -224
- package/types/read-env.d.ts +0 -3
- package/types/xcode.d.ts +0 -527
|
@@ -1,512 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-lines */
|
|
2
|
-
// @ts-ignore - clack is ESM and TS complains about that. It works though
|
|
3
|
-
import clack from '@clack/prompts';
|
|
4
|
-
import chalk from 'chalk';
|
|
5
|
-
import * as fs from 'fs';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
CliSetupConfigContent,
|
|
9
|
-
abortIfCancelled,
|
|
10
|
-
addSentryCliConfig,
|
|
11
|
-
confirmContinueIfNoOrDirtyGitRepo,
|
|
12
|
-
confirmContinueIfPackageVersionNotSupported,
|
|
13
|
-
ensurePackageIsInstalled,
|
|
14
|
-
getOrAskForProjectData,
|
|
15
|
-
getPackageDotJson,
|
|
16
|
-
installPackage,
|
|
17
|
-
printWelcome,
|
|
18
|
-
propertiesCliSetupConfig,
|
|
19
|
-
runPrettierIfInstalled,
|
|
20
|
-
abort,
|
|
21
|
-
} from '../utils/clack-utils';
|
|
22
|
-
import { getPackageVersion, hasPackageInstalled } from '../utils/package-json';
|
|
23
|
-
import { podInstall } from '../apple/cocoapod';
|
|
24
|
-
import { platform } from 'os';
|
|
25
|
-
import {
|
|
26
|
-
getValidExistingBuildPhases,
|
|
27
|
-
findBundlePhase,
|
|
28
|
-
patchBundlePhase,
|
|
29
|
-
findDebugFilesUploadPhase,
|
|
30
|
-
addDebugFilesUploadPhaseWithCli,
|
|
31
|
-
writeXcodeProject,
|
|
32
|
-
addSentryWithCliToBundleShellScript,
|
|
33
|
-
addSentryWithBundledScriptsToBundleShellScript,
|
|
34
|
-
addDebugFilesUploadPhaseWithBundledScripts,
|
|
35
|
-
} from './xcode';
|
|
36
|
-
import {
|
|
37
|
-
doesAppBuildGradleIncludeRNSentryGradlePlugin,
|
|
38
|
-
addRNSentryGradlePlugin,
|
|
39
|
-
writeAppBuildGradle,
|
|
40
|
-
} from './gradle';
|
|
41
|
-
import { runReactNativeUninstall } from './uninstall';
|
|
42
|
-
import { APP_BUILD_GRADLE, XCODE_PROJECT, getFirstMatchedPath } from './glob';
|
|
43
|
-
import { ReactNativeWizardOptions } from './options';
|
|
44
|
-
import { addSentryInit } from './javascript';
|
|
45
|
-
import { traceStep, withTelemetry } from '../telemetry';
|
|
46
|
-
import * as Sentry from '@sentry/node';
|
|
47
|
-
import { fulfillsVersionRange } from '../utils/semver';
|
|
48
|
-
import { getIssueStreamUrl } from '../utils/url';
|
|
49
|
-
import {
|
|
50
|
-
patchMetroConfigWithSentrySerializer,
|
|
51
|
-
patchMetroWithSentryConfig,
|
|
52
|
-
} from './metro';
|
|
53
|
-
import { patchExpoAppConfig, printSentryExpoMigrationOutro } from './expo';
|
|
54
|
-
import { addSentryToExpoMetroConfig } from './expo-metro';
|
|
55
|
-
import { addExpoEnvLocal } from './expo-env-file';
|
|
56
|
-
|
|
57
|
-
import xcode from 'xcode';
|
|
58
|
-
|
|
59
|
-
export const RN_SDK_PACKAGE = '@sentry/react-native';
|
|
60
|
-
export const RN_SDK_SUPPORTED_RANGE = '>=5.0.0';
|
|
61
|
-
|
|
62
|
-
export const RN_PACKAGE = 'react-native';
|
|
63
|
-
export const RN_HUMAN_NAME = 'React Native';
|
|
64
|
-
|
|
65
|
-
export const SUPPORTED_RN_RANGE = '>=0.69.0';
|
|
66
|
-
export const SUPPORTED_EXPO_RANGE = '>=50.0.0';
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* The following SDK version ship with bundled Xcode scripts
|
|
70
|
-
* which simplifies the Xcode Build Phases setup.
|
|
71
|
-
*/
|
|
72
|
-
export const XCODE_SCRIPTS_SUPPORTED_SDK_RANGE = '>=5.11.0';
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* The following SDK version ship with Sentry Metro plugin
|
|
76
|
-
*/
|
|
77
|
-
export const SENTRY_METRO_PLUGIN_SUPPORTED_SDK_RANGE = '>=5.11.0';
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* The following SDK version ship with bundled Expo plugin
|
|
81
|
-
*/
|
|
82
|
-
export const EXPO_SUPPORTED_SDK_RANGE = `>=5.16.0`;
|
|
83
|
-
|
|
84
|
-
// The following SDK version shipped `withSentryConfig`
|
|
85
|
-
export const METRO_WITH_SENTRY_CONFIG_SUPPORTED_SDK_RANGE = '>=5.17.0';
|
|
86
|
-
|
|
87
|
-
export type RNCliSetupConfigContent = Pick<
|
|
88
|
-
Required<CliSetupConfigContent>,
|
|
89
|
-
'authToken' | 'org' | 'project' | 'url'
|
|
90
|
-
>;
|
|
91
|
-
|
|
92
|
-
export async function runReactNativeWizard(
|
|
93
|
-
params: ReactNativeWizardOptions,
|
|
94
|
-
): Promise<void> {
|
|
95
|
-
return withTelemetry(
|
|
96
|
-
{
|
|
97
|
-
enabled: params.telemetryEnabled,
|
|
98
|
-
integration: 'react-native',
|
|
99
|
-
wizardOptions: params,
|
|
100
|
-
},
|
|
101
|
-
() => runReactNativeWizardWithTelemetry(params),
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export async function runReactNativeWizardWithTelemetry(
|
|
106
|
-
options: ReactNativeWizardOptions,
|
|
107
|
-
): Promise<void> {
|
|
108
|
-
if (options.uninstall) {
|
|
109
|
-
Sentry.setTag('uninstall', true);
|
|
110
|
-
return runReactNativeUninstall(options);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const { promoCode, telemetryEnabled, forceInstall } = options;
|
|
114
|
-
|
|
115
|
-
printWelcome({
|
|
116
|
-
wizardName: 'Sentry React Native Wizard',
|
|
117
|
-
promoCode,
|
|
118
|
-
telemetryEnabled,
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
await confirmContinueIfNoOrDirtyGitRepo();
|
|
122
|
-
|
|
123
|
-
const packageJson = await getPackageDotJson();
|
|
124
|
-
const hasInstalled = (dep: string) => hasPackageInstalled(dep, packageJson);
|
|
125
|
-
|
|
126
|
-
if (hasInstalled('sentry-expo')) {
|
|
127
|
-
Sentry.setTag('has-sentry-expo-installed', true);
|
|
128
|
-
printSentryExpoMigrationOutro();
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
await ensurePackageIsInstalled(packageJson, RN_PACKAGE, RN_HUMAN_NAME);
|
|
133
|
-
|
|
134
|
-
const rnVersion = getPackageVersion(RN_PACKAGE, packageJson);
|
|
135
|
-
if (rnVersion) {
|
|
136
|
-
await confirmContinueIfPackageVersionNotSupported({
|
|
137
|
-
packageName: RN_HUMAN_NAME,
|
|
138
|
-
packageVersion: rnVersion,
|
|
139
|
-
packageId: RN_PACKAGE,
|
|
140
|
-
acceptableVersions: SUPPORTED_RN_RANGE,
|
|
141
|
-
note: `Please upgrade to ${SUPPORTED_RN_RANGE} if you wish to use the Sentry Wizard.
|
|
142
|
-
Or setup using ${chalk.cyan(
|
|
143
|
-
'https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/',
|
|
144
|
-
)}`,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
await installPackage({
|
|
149
|
-
packageName: RN_SDK_PACKAGE,
|
|
150
|
-
alreadyInstalled: hasPackageInstalled(RN_SDK_PACKAGE, packageJson),
|
|
151
|
-
forceInstall,
|
|
152
|
-
});
|
|
153
|
-
const sdkVersion = getPackageVersion(
|
|
154
|
-
RN_SDK_PACKAGE,
|
|
155
|
-
await getPackageDotJson(),
|
|
156
|
-
);
|
|
157
|
-
if (sdkVersion) {
|
|
158
|
-
await confirmContinueIfPackageVersionNotSupported({
|
|
159
|
-
packageName: 'Sentry React Native SDK',
|
|
160
|
-
packageVersion: sdkVersion,
|
|
161
|
-
packageId: RN_SDK_PACKAGE,
|
|
162
|
-
acceptableVersions: RN_SDK_SUPPORTED_RANGE,
|
|
163
|
-
note: `Please upgrade to ${RN_SDK_SUPPORTED_RANGE} to continue with the wizard in this project.`,
|
|
164
|
-
});
|
|
165
|
-
} else {
|
|
166
|
-
const continueWithoutSdk = await abortIfCancelled(
|
|
167
|
-
clack.confirm({
|
|
168
|
-
message:
|
|
169
|
-
'Could not detect Sentry React Native SDK version. Do you want to continue anyway?',
|
|
170
|
-
}),
|
|
171
|
-
);
|
|
172
|
-
if (!continueWithoutSdk) {
|
|
173
|
-
await abort(undefined, 0);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
Sentry.setTag(`detected-sentry-react-native-sdk-version`, sdkVersion);
|
|
177
|
-
|
|
178
|
-
const expoVersion = getPackageVersion('expo', packageJson);
|
|
179
|
-
const isExpo = !!expoVersion;
|
|
180
|
-
if (expoVersion && sdkVersion) {
|
|
181
|
-
await confirmContinueIfPackageVersionNotSupported({
|
|
182
|
-
packageName: 'Sentry React Native SDK',
|
|
183
|
-
packageVersion: sdkVersion,
|
|
184
|
-
packageId: RN_SDK_PACKAGE,
|
|
185
|
-
acceptableVersions: EXPO_SUPPORTED_SDK_RANGE,
|
|
186
|
-
note: `Please upgrade to ${EXPO_SUPPORTED_SDK_RANGE} to continue with the wizard in this Expo project.`,
|
|
187
|
-
});
|
|
188
|
-
await confirmContinueIfPackageVersionNotSupported({
|
|
189
|
-
packageName: 'Expo SDK',
|
|
190
|
-
packageVersion: expoVersion,
|
|
191
|
-
packageId: 'expo',
|
|
192
|
-
acceptableVersions: SUPPORTED_EXPO_RANGE,
|
|
193
|
-
note: `Please upgrade to ${SUPPORTED_EXPO_RANGE} to continue with the wizard in this Expo project.`,
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
const { selectedProject, authToken, sentryUrl } =
|
|
198
|
-
await getOrAskForProjectData(options, 'react-native');
|
|
199
|
-
const orgSlug = selectedProject.organization.slug;
|
|
200
|
-
const projectSlug = selectedProject.slug;
|
|
201
|
-
const projectId = selectedProject.id;
|
|
202
|
-
const cliConfig: RNCliSetupConfigContent = {
|
|
203
|
-
authToken,
|
|
204
|
-
org: orgSlug,
|
|
205
|
-
project: projectSlug,
|
|
206
|
-
url: sentryUrl,
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
await traceStep('patch-app-js', () =>
|
|
210
|
-
addSentryInit({ dsn: selectedProject.keys[0].dsn.public }),
|
|
211
|
-
);
|
|
212
|
-
|
|
213
|
-
if (isExpo) {
|
|
214
|
-
await traceStep('patch-expo-app-config', () =>
|
|
215
|
-
patchExpoAppConfig(cliConfig),
|
|
216
|
-
);
|
|
217
|
-
await traceStep('add-expo-env-local', () => addExpoEnvLocal(cliConfig));
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
if (isExpo) {
|
|
221
|
-
await traceStep('patch-metro-config', addSentryToExpoMetroConfig);
|
|
222
|
-
} else {
|
|
223
|
-
await traceStep('patch-metro-config', () =>
|
|
224
|
-
addSentryToMetroConfig({ sdkVersion }),
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (fs.existsSync('ios')) {
|
|
229
|
-
Sentry.setTag('patch-ios', true);
|
|
230
|
-
await traceStep('patch-xcode-files', () =>
|
|
231
|
-
patchXcodeFiles(cliConfig, { sdkVersion }),
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
if (fs.existsSync('android')) {
|
|
236
|
-
Sentry.setTag('patch-android', true);
|
|
237
|
-
await traceStep('patch-android-files', () => patchAndroidFiles(cliConfig));
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
await runPrettierIfInstalled();
|
|
241
|
-
|
|
242
|
-
const confirmedFirstException = await confirmFirstSentryException(
|
|
243
|
-
sentryUrl,
|
|
244
|
-
orgSlug,
|
|
245
|
-
projectId,
|
|
246
|
-
);
|
|
247
|
-
|
|
248
|
-
Sentry.setTag('user-confirmed-first-error', confirmedFirstException);
|
|
249
|
-
|
|
250
|
-
if (confirmedFirstException) {
|
|
251
|
-
clack.outro(
|
|
252
|
-
`${chalk.green('Everything is set up!')}
|
|
253
|
-
|
|
254
|
-
${chalk.dim(
|
|
255
|
-
'If you encounter any issues, let us know here: https://github.com/getsentry/sentry-react-native/issues',
|
|
256
|
-
)}`,
|
|
257
|
-
);
|
|
258
|
-
} else {
|
|
259
|
-
clack.outro(
|
|
260
|
-
`${chalk.dim(
|
|
261
|
-
'Let us know here: https://github.com/getsentry/sentry-react-native/issues',
|
|
262
|
-
)}`,
|
|
263
|
-
);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
function addSentryToMetroConfig({
|
|
268
|
-
sdkVersion,
|
|
269
|
-
}: {
|
|
270
|
-
sdkVersion: string | undefined;
|
|
271
|
-
}) {
|
|
272
|
-
if (
|
|
273
|
-
sdkVersion &&
|
|
274
|
-
fulfillsVersionRange({
|
|
275
|
-
version: sdkVersion,
|
|
276
|
-
acceptableVersions: METRO_WITH_SENTRY_CONFIG_SUPPORTED_SDK_RANGE,
|
|
277
|
-
canBeLatest: true,
|
|
278
|
-
})
|
|
279
|
-
) {
|
|
280
|
-
return patchMetroWithSentryConfig();
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (
|
|
284
|
-
sdkVersion &&
|
|
285
|
-
fulfillsVersionRange({
|
|
286
|
-
version: sdkVersion,
|
|
287
|
-
acceptableVersions: SENTRY_METRO_PLUGIN_SUPPORTED_SDK_RANGE,
|
|
288
|
-
canBeLatest: true,
|
|
289
|
-
})
|
|
290
|
-
) {
|
|
291
|
-
return patchMetroConfigWithSentrySerializer();
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
async function confirmFirstSentryException(
|
|
296
|
-
url: string,
|
|
297
|
-
orgSlug: string,
|
|
298
|
-
projectId: string,
|
|
299
|
-
) {
|
|
300
|
-
const issuesStreamUrl = getIssueStreamUrl({ url, orgSlug, projectId });
|
|
301
|
-
|
|
302
|
-
clack.log
|
|
303
|
-
.step(`To make sure everything is set up correctly, put the following code snippet into your application.
|
|
304
|
-
The snippet will create a button that, when tapped, sends a test event to Sentry.
|
|
305
|
-
|
|
306
|
-
After that check your project issues:
|
|
307
|
-
|
|
308
|
-
${chalk.cyan(issuesStreamUrl)}`);
|
|
309
|
-
|
|
310
|
-
// We want the code snippet to be easily copy-pasteable, without any clack artifacts
|
|
311
|
-
// eslint-disable-next-line no-console
|
|
312
|
-
console.log(
|
|
313
|
-
chalk.greenBright(`
|
|
314
|
-
<Button title='Try!' onPress={ () => { Sentry.captureException(new Error('First error')) }}/>
|
|
315
|
-
`),
|
|
316
|
-
);
|
|
317
|
-
|
|
318
|
-
const firstErrorConfirmed = clack.confirm({
|
|
319
|
-
message: `Have you successfully sent a test event?`,
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
return firstErrorConfirmed;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
async function patchXcodeFiles(
|
|
326
|
-
config: RNCliSetupConfigContent,
|
|
327
|
-
context: {
|
|
328
|
-
sdkVersion: string | undefined;
|
|
329
|
-
},
|
|
330
|
-
) {
|
|
331
|
-
await addSentryCliConfig(config, {
|
|
332
|
-
...propertiesCliSetupConfig,
|
|
333
|
-
name: 'source maps and iOS debug files',
|
|
334
|
-
filename: 'ios/sentry.properties',
|
|
335
|
-
gitignore: false,
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
if (platform() === 'darwin' && (await confirmPodInstall())) {
|
|
339
|
-
await traceStep('pod-install', () => podInstall('ios'));
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
const xcodeProjectPath = traceStep('find-xcode-project', () =>
|
|
343
|
-
getFirstMatchedPath(XCODE_PROJECT),
|
|
344
|
-
);
|
|
345
|
-
Sentry.setTag(
|
|
346
|
-
'xcode-project-status',
|
|
347
|
-
xcodeProjectPath ? 'found' : 'not-found',
|
|
348
|
-
);
|
|
349
|
-
if (!xcodeProjectPath) {
|
|
350
|
-
clack.log.warn(
|
|
351
|
-
`Could not find Xcode project file using ${chalk.cyan(XCODE_PROJECT)}.`,
|
|
352
|
-
);
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
357
|
-
const [xcodeProject, buildPhasesMap] = traceStep(
|
|
358
|
-
'parse-xcode-project',
|
|
359
|
-
() => {
|
|
360
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
361
|
-
const project = xcode.project(xcodeProjectPath);
|
|
362
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
363
|
-
project.parseSync();
|
|
364
|
-
|
|
365
|
-
const map = getValidExistingBuildPhases(project);
|
|
366
|
-
return [project, map];
|
|
367
|
-
},
|
|
368
|
-
);
|
|
369
|
-
Sentry.setTag('xcode-project-status', 'parsed');
|
|
370
|
-
|
|
371
|
-
traceStep('patch-bundle-phase', () => {
|
|
372
|
-
const bundlePhase = findBundlePhase(buildPhasesMap);
|
|
373
|
-
Sentry.setTag(
|
|
374
|
-
'xcode-bundle-phase-status',
|
|
375
|
-
bundlePhase ? 'found' : 'not-found',
|
|
376
|
-
);
|
|
377
|
-
if (
|
|
378
|
-
context.sdkVersion &&
|
|
379
|
-
fulfillsVersionRange({
|
|
380
|
-
version: context.sdkVersion,
|
|
381
|
-
acceptableVersions: XCODE_SCRIPTS_SUPPORTED_SDK_RANGE,
|
|
382
|
-
canBeLatest: true,
|
|
383
|
-
})
|
|
384
|
-
) {
|
|
385
|
-
patchBundlePhase(
|
|
386
|
-
bundlePhase,
|
|
387
|
-
addSentryWithBundledScriptsToBundleShellScript,
|
|
388
|
-
);
|
|
389
|
-
} else {
|
|
390
|
-
patchBundlePhase(bundlePhase, addSentryWithCliToBundleShellScript);
|
|
391
|
-
}
|
|
392
|
-
Sentry.setTag('xcode-bundle-phase-status', 'patched');
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
traceStep('add-debug-files-upload-phase', () => {
|
|
396
|
-
const debugFilesUploadPhaseExists =
|
|
397
|
-
!!findDebugFilesUploadPhase(buildPhasesMap);
|
|
398
|
-
Sentry.setTag(
|
|
399
|
-
'xcode-debug-files-upload-phase-status',
|
|
400
|
-
debugFilesUploadPhaseExists ? 'already-exists' : undefined,
|
|
401
|
-
);
|
|
402
|
-
if (
|
|
403
|
-
context.sdkVersion &&
|
|
404
|
-
fulfillsVersionRange({
|
|
405
|
-
version: context.sdkVersion,
|
|
406
|
-
acceptableVersions: XCODE_SCRIPTS_SUPPORTED_SDK_RANGE,
|
|
407
|
-
canBeLatest: true,
|
|
408
|
-
})
|
|
409
|
-
) {
|
|
410
|
-
addDebugFilesUploadPhaseWithBundledScripts(xcodeProject, {
|
|
411
|
-
debugFilesUploadPhaseExists,
|
|
412
|
-
});
|
|
413
|
-
} else {
|
|
414
|
-
addDebugFilesUploadPhaseWithCli(xcodeProject, {
|
|
415
|
-
debugFilesUploadPhaseExists,
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
Sentry.setTag('xcode-debug-files-upload-phase-status', 'added');
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
traceStep('write-xcode-project', () => {
|
|
422
|
-
writeXcodeProject(xcodeProjectPath, xcodeProject);
|
|
423
|
-
});
|
|
424
|
-
Sentry.setTag('xcode-project-status', 'patched');
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
async function patchAndroidFiles(config: RNCliSetupConfigContent) {
|
|
428
|
-
await addSentryCliConfig(config, {
|
|
429
|
-
...propertiesCliSetupConfig,
|
|
430
|
-
name: 'source maps and iOS debug files',
|
|
431
|
-
filename: 'android/sentry.properties',
|
|
432
|
-
gitignore: false,
|
|
433
|
-
});
|
|
434
|
-
|
|
435
|
-
const appBuildGradlePath = traceStep('find-app-build-gradle', () =>
|
|
436
|
-
getFirstMatchedPath(APP_BUILD_GRADLE),
|
|
437
|
-
);
|
|
438
|
-
Sentry.setTag(
|
|
439
|
-
'app-build-gradle-status',
|
|
440
|
-
appBuildGradlePath ? 'found' : 'not-found',
|
|
441
|
-
);
|
|
442
|
-
if (!appBuildGradlePath) {
|
|
443
|
-
clack.log.warn(
|
|
444
|
-
`Could not find Android ${chalk.cyan(
|
|
445
|
-
'app/build.gradle',
|
|
446
|
-
)} file using ${chalk.cyan(APP_BUILD_GRADLE)}.`,
|
|
447
|
-
);
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
const appBuildGradle = traceStep('read-app-build-gradle', () =>
|
|
452
|
-
fs.readFileSync(appBuildGradlePath, 'utf-8'),
|
|
453
|
-
);
|
|
454
|
-
const includesSentry =
|
|
455
|
-
doesAppBuildGradleIncludeRNSentryGradlePlugin(appBuildGradle);
|
|
456
|
-
if (includesSentry) {
|
|
457
|
-
Sentry.setTag('app-build-gradle-status', 'already-includes-sentry');
|
|
458
|
-
clack.log.warn(
|
|
459
|
-
`Android ${chalk.cyan('app/build.gradle')} file already includes Sentry.`,
|
|
460
|
-
);
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
const patchedAppBuildGradle = traceStep('add-rn-sentry-gradle-plugin', () =>
|
|
465
|
-
addRNSentryGradlePlugin(appBuildGradle),
|
|
466
|
-
);
|
|
467
|
-
if (!doesAppBuildGradleIncludeRNSentryGradlePlugin(patchedAppBuildGradle)) {
|
|
468
|
-
Sentry.setTag(
|
|
469
|
-
'app-build-gradle-status',
|
|
470
|
-
'failed-to-add-rn-sentry-gradle-plugin',
|
|
471
|
-
);
|
|
472
|
-
clack.log.warn(
|
|
473
|
-
`Could not add Sentry RN Gradle Plugin to ${chalk.cyan(
|
|
474
|
-
'app/build.gradle',
|
|
475
|
-
)}.`,
|
|
476
|
-
);
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
Sentry.setTag('app-build-gradle-status', 'added-rn-sentry-gradle-plugin');
|
|
481
|
-
clack.log.success(
|
|
482
|
-
`Added Sentry RN Gradle Plugin to ${chalk.bold('app/build.gradle')}.`,
|
|
483
|
-
);
|
|
484
|
-
|
|
485
|
-
traceStep('write-app-build-gradle', () =>
|
|
486
|
-
writeAppBuildGradle(appBuildGradlePath, patchedAppBuildGradle),
|
|
487
|
-
);
|
|
488
|
-
clack.log.success(
|
|
489
|
-
chalk.green(`Android ${chalk.cyan('app/build.gradle')} saved.`),
|
|
490
|
-
);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
async function confirmPodInstall(): Promise<boolean> {
|
|
494
|
-
return traceStep('confirm-pod-install', async () => {
|
|
495
|
-
const continueWithPodInstall = await abortIfCancelled(
|
|
496
|
-
clack.select({
|
|
497
|
-
message: 'Do you want to run `pod install` now?',
|
|
498
|
-
options: [
|
|
499
|
-
{
|
|
500
|
-
value: true,
|
|
501
|
-
label: 'Yes',
|
|
502
|
-
hint: 'Recommended for smaller projects, this might take several minutes',
|
|
503
|
-
},
|
|
504
|
-
{ value: false, label: `No, I'll do it later` },
|
|
505
|
-
],
|
|
506
|
-
initialValue: true,
|
|
507
|
-
}),
|
|
508
|
-
);
|
|
509
|
-
Sentry.setTag('continue-with-pod-install', continueWithPodInstall);
|
|
510
|
-
return continueWithPodInstall;
|
|
511
|
-
});
|
|
512
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
// @ts-ignore - clack is ESM and TS complains about that. It works though
|
|
3
|
-
import clack from '@clack/prompts';
|
|
4
|
-
import chalk from 'chalk';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
confirmContinueIfNoOrDirtyGitRepo,
|
|
8
|
-
printWelcome,
|
|
9
|
-
} from '../utils/clack-utils';
|
|
10
|
-
import {
|
|
11
|
-
findBundlePhase,
|
|
12
|
-
getValidExistingBuildPhases,
|
|
13
|
-
unPatchBundlePhase,
|
|
14
|
-
unPatchDebugFilesUploadPhase,
|
|
15
|
-
writeXcodeProject,
|
|
16
|
-
} from './xcode';
|
|
17
|
-
import { APP_BUILD_GRADLE, XCODE_PROJECT, getFirstMatchedPath } from './glob';
|
|
18
|
-
import {
|
|
19
|
-
doesAppBuildGradleIncludeRNSentryGradlePlugin,
|
|
20
|
-
removeRNSentryGradlePlugin,
|
|
21
|
-
writeAppBuildGradle,
|
|
22
|
-
} from './gradle';
|
|
23
|
-
import { ReactNativeWizardOptions } from './options';
|
|
24
|
-
import { unPatchMetroConfig } from './metro';
|
|
25
|
-
|
|
26
|
-
import xcode from 'xcode';
|
|
27
|
-
|
|
28
|
-
export async function runReactNativeUninstall(
|
|
29
|
-
options: ReactNativeWizardOptions,
|
|
30
|
-
): Promise<void> {
|
|
31
|
-
printWelcome({
|
|
32
|
-
wizardName: 'Sentry React Native Uninstall Wizard',
|
|
33
|
-
message: 'This wizard will remove Sentry from your React Native project.',
|
|
34
|
-
telemetryEnabled: options.telemetryEnabled,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
await confirmContinueIfNoOrDirtyGitRepo();
|
|
38
|
-
|
|
39
|
-
await unPatchMetroConfig();
|
|
40
|
-
|
|
41
|
-
unPatchXcodeFiles();
|
|
42
|
-
|
|
43
|
-
unPatchAndroidFiles();
|
|
44
|
-
|
|
45
|
-
clack.note(
|
|
46
|
-
`To make sure your project builds after removing Sentry please run:
|
|
47
|
-
|
|
48
|
-
1. ${chalk.bold('yarn remove @sentry/react-native')}
|
|
49
|
-
2. ${chalk.bold('cd ios && pod install')}
|
|
50
|
-
3. Remove all occurrences of ${chalk.bold(
|
|
51
|
-
'@sentry/react-native',
|
|
52
|
-
)} from your application code.`,
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
clack.outro(
|
|
56
|
-
`${chalk.green('Uninstall is done!')}
|
|
57
|
-
|
|
58
|
-
${chalk.dim(
|
|
59
|
-
'If you encounter any issues, let us know here: https://github.com/getsentry/sentry-react-native/issues',
|
|
60
|
-
)}`,
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function unPatchXcodeFiles() {
|
|
65
|
-
const xcodeProjectPath = getFirstMatchedPath(XCODE_PROJECT);
|
|
66
|
-
if (!xcodeProjectPath) {
|
|
67
|
-
clack.log.warn(
|
|
68
|
-
`Could not find Xcode project file using ${chalk.bold(XCODE_PROJECT)}.`,
|
|
69
|
-
);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
74
|
-
const xcodeProject = xcode.project(xcodeProjectPath);
|
|
75
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
76
|
-
xcodeProject.parseSync();
|
|
77
|
-
const buildPhases = getValidExistingBuildPhases(xcodeProject);
|
|
78
|
-
|
|
79
|
-
const bundlePhase = findBundlePhase(buildPhases);
|
|
80
|
-
unPatchBundlePhase(bundlePhase);
|
|
81
|
-
|
|
82
|
-
unPatchDebugFilesUploadPhase(xcodeProject);
|
|
83
|
-
|
|
84
|
-
writeXcodeProject(xcodeProjectPath, xcodeProject);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function unPatchAndroidFiles() {
|
|
88
|
-
const appBuildGradlePath = getFirstMatchedPath(APP_BUILD_GRADLE);
|
|
89
|
-
if (!appBuildGradlePath) {
|
|
90
|
-
clack.log.warn(
|
|
91
|
-
`Could not find Android app/build.gradle file using ${chalk.bold(
|
|
92
|
-
APP_BUILD_GRADLE,
|
|
93
|
-
)}.`,
|
|
94
|
-
);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const appBuildGradle = fs.readFileSync(appBuildGradlePath, 'utf-8');
|
|
99
|
-
const includesSentry =
|
|
100
|
-
doesAppBuildGradleIncludeRNSentryGradlePlugin(appBuildGradle);
|
|
101
|
-
if (!includesSentry) {
|
|
102
|
-
clack.log.warn(`Sentry not found in Android app/build.gradle.`);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const patchedAppBuildGradle = removeRNSentryGradlePlugin(appBuildGradle);
|
|
107
|
-
|
|
108
|
-
writeAppBuildGradle(appBuildGradlePath, patchedAppBuildGradle);
|
|
109
|
-
}
|