@sentry/wizard 4.0.0 → 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 +6 -2
- package/dist/lib/Steps/Integrations/Electron.js +1 -1
- package/dist/lib/Steps/Integrations/Electron.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,284 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
import * as Sentry from '@sentry/node';
|
|
4
|
-
// @ts-ignore - clack is ESM and TS complains about that. It works though
|
|
5
|
-
import * as clack from '@clack/prompts';
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
import {
|
|
8
|
-
sentryImport,
|
|
9
|
-
pubspecOptions,
|
|
10
|
-
sentryProperties,
|
|
11
|
-
initSnippet,
|
|
12
|
-
} from './templates';
|
|
13
|
-
import { featureSelectionPrompt } from '../utils/clack-utils';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Recursively finds a file per name in subfolders.
|
|
17
|
-
* @param dir - The directory to start searching.
|
|
18
|
-
* @param name - The name of the file including path extension.
|
|
19
|
-
* @returns The path to the main.dart file or null if not found.
|
|
20
|
-
*/
|
|
21
|
-
export function findFile(dir: string, name: string): string | null {
|
|
22
|
-
const files: string[] = fs.readdirSync(dir);
|
|
23
|
-
|
|
24
|
-
for (const file of files) {
|
|
25
|
-
const fullPath: string = path.join(dir, file);
|
|
26
|
-
const stats: fs.Stats = fs.statSync(fullPath);
|
|
27
|
-
|
|
28
|
-
if (stats.isDirectory()) {
|
|
29
|
-
const result: string | null = findFile(fullPath, name);
|
|
30
|
-
if (result) {
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
} else if (file === name) {
|
|
34
|
-
return fullPath;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function patchPubspec(
|
|
42
|
-
pubspecFile: string | null,
|
|
43
|
-
sentryDartFlutterVersion: string,
|
|
44
|
-
sentryDartPluginVersion: string,
|
|
45
|
-
project: string,
|
|
46
|
-
org: string,
|
|
47
|
-
): boolean {
|
|
48
|
-
try {
|
|
49
|
-
if (!pubspecFile) {
|
|
50
|
-
throw new Error('pubspec.yaml is not provided or invalid.');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
let pubspecContent = fs.readFileSync(pubspecFile, 'utf8');
|
|
54
|
-
|
|
55
|
-
if (!pubspecContent.includes('sentry_flutter:')) {
|
|
56
|
-
const dependenciesIndex = getDependenciesLocation(pubspecContent);
|
|
57
|
-
|
|
58
|
-
pubspecContent =
|
|
59
|
-
pubspecContent.slice(0, dependenciesIndex) +
|
|
60
|
-
` sentry_flutter: ${sentryDartFlutterVersion}\n` +
|
|
61
|
-
pubspecContent.slice(dependenciesIndex);
|
|
62
|
-
|
|
63
|
-
clack.log.success(
|
|
64
|
-
chalk.greenBright(
|
|
65
|
-
`${chalk.bold('sentry_flutter')} added to pubspec.yaml`,
|
|
66
|
-
),
|
|
67
|
-
);
|
|
68
|
-
} else {
|
|
69
|
-
clack.log.success(
|
|
70
|
-
chalk.greenBright(
|
|
71
|
-
`${chalk.bold('sentry_flutter')} is already included in pubspec.yaml`,
|
|
72
|
-
),
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (!pubspecContent.includes('sentry_dart_plugin:')) {
|
|
77
|
-
const devDependenciesIndex = getDevDependenciesLocation(pubspecContent);
|
|
78
|
-
pubspecContent =
|
|
79
|
-
pubspecContent.slice(0, devDependenciesIndex) +
|
|
80
|
-
` sentry_dart_plugin: ${sentryDartPluginVersion}\n` +
|
|
81
|
-
pubspecContent.slice(devDependenciesIndex);
|
|
82
|
-
|
|
83
|
-
clack.log.success(
|
|
84
|
-
chalk.greenBright(
|
|
85
|
-
`${chalk.bold('sentry_dart_plugin')} added to pubspec.yaml`,
|
|
86
|
-
),
|
|
87
|
-
);
|
|
88
|
-
} else {
|
|
89
|
-
clack.log.success(
|
|
90
|
-
chalk.greenBright(
|
|
91
|
-
`${chalk.bold(
|
|
92
|
-
'sentry_dart_plugin',
|
|
93
|
-
)} is already included in pubspec.yaml`,
|
|
94
|
-
),
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (!pubspecContent.includes('sentry:')) {
|
|
99
|
-
pubspecContent += '\n';
|
|
100
|
-
pubspecContent += pubspecOptions(project, org);
|
|
101
|
-
|
|
102
|
-
clack.log.success(
|
|
103
|
-
chalk.greenBright(
|
|
104
|
-
`${chalk.bold('sentry plugin configuration')} added to pubspec.yaml`,
|
|
105
|
-
),
|
|
106
|
-
);
|
|
107
|
-
} else {
|
|
108
|
-
clack.log.success(
|
|
109
|
-
chalk.greenBright(
|
|
110
|
-
`${chalk.bold(
|
|
111
|
-
'sentry plugin configuration',
|
|
112
|
-
)} is already included in pubspec.yaml`,
|
|
113
|
-
),
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
fs.writeFileSync(pubspecFile, pubspecContent, 'utf8');
|
|
118
|
-
|
|
119
|
-
return true;
|
|
120
|
-
} catch (error) {
|
|
121
|
-
clack.log.warn(`Failed to read/write ${chalk.cyan('pubspec.yaml')} file.`);
|
|
122
|
-
Sentry.captureException(error);
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export function addProperties(pubspecFile: string | null, authToken: string) {
|
|
128
|
-
try {
|
|
129
|
-
if (!pubspecFile) {
|
|
130
|
-
throw new Error('pubspec.yaml is not provided or invalid.');
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
const pubspecDir = path.dirname(pubspecFile);
|
|
134
|
-
const sentryPropertiesFileName = 'sentry.properties';
|
|
135
|
-
const sentryPropertiesFile = path.join(
|
|
136
|
-
pubspecDir,
|
|
137
|
-
sentryPropertiesFileName,
|
|
138
|
-
);
|
|
139
|
-
const sentryPropertiesContent = sentryProperties(authToken);
|
|
140
|
-
|
|
141
|
-
fs.writeFileSync(sentryPropertiesFile, sentryPropertiesContent, 'utf8');
|
|
142
|
-
|
|
143
|
-
const gitignoreFile = path.join(pubspecDir, '.gitignore');
|
|
144
|
-
if (fs.existsSync(gitignoreFile)) {
|
|
145
|
-
fs.appendFileSync(gitignoreFile, `\n${sentryPropertiesFileName}\n`);
|
|
146
|
-
} else {
|
|
147
|
-
fs.writeFileSync(gitignoreFile, `${sentryPropertiesFileName}\n`, 'utf8');
|
|
148
|
-
}
|
|
149
|
-
return true;
|
|
150
|
-
} catch (error) {
|
|
151
|
-
clack.log.warn(`Failed to read/write ${chalk.cyan('pubspec.yaml')} file.`);
|
|
152
|
-
Sentry.captureException(error);
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export async function patchMain(
|
|
158
|
-
mainFile: string | null,
|
|
159
|
-
dsn: string,
|
|
160
|
-
canEnableProfiling: boolean,
|
|
161
|
-
): Promise<boolean> {
|
|
162
|
-
try {
|
|
163
|
-
if (!mainFile) {
|
|
164
|
-
throw new Error('pubspec.yaml is not provided or invalid.');
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
let mainContent = fs.readFileSync(mainFile, 'utf8');
|
|
168
|
-
if (
|
|
169
|
-
/import\s+['"]package[:]sentry_flutter\/sentry_flutter\.dart['"];?/i.test(
|
|
170
|
-
mainContent,
|
|
171
|
-
)
|
|
172
|
-
) {
|
|
173
|
-
// sentry is already configured
|
|
174
|
-
clack.log.success(
|
|
175
|
-
chalk.greenBright(
|
|
176
|
-
`${chalk.bold('main.dart')} already has Sentry configured.`,
|
|
177
|
-
),
|
|
178
|
-
);
|
|
179
|
-
return true;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const features = [
|
|
183
|
-
{
|
|
184
|
-
id: 'tracing',
|
|
185
|
-
prompt: `Do you want to enable ${chalk.bold(
|
|
186
|
-
'Tracing',
|
|
187
|
-
)} to track the performance of your application?`,
|
|
188
|
-
enabledHint: 'recommended',
|
|
189
|
-
},
|
|
190
|
-
];
|
|
191
|
-
if (canEnableProfiling) {
|
|
192
|
-
features.push({
|
|
193
|
-
id: 'profiling',
|
|
194
|
-
prompt: `Do you want to enable ${chalk.bold(
|
|
195
|
-
'Profiling',
|
|
196
|
-
)} to analyze CPU usage and optimize performance-critical code on iOS & macOS?`,
|
|
197
|
-
enabledHint: 'recommended, tracing must be enabled',
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
const selectedFeatures = await featureSelectionPrompt(features);
|
|
202
|
-
const normalizedSelectedFeatures = {
|
|
203
|
-
tracing: selectedFeatures.tracing ?? false,
|
|
204
|
-
profiling: selectedFeatures.profiling ?? false,
|
|
205
|
-
};
|
|
206
|
-
mainContent = patchMainContent(
|
|
207
|
-
dsn,
|
|
208
|
-
mainContent,
|
|
209
|
-
normalizedSelectedFeatures,
|
|
210
|
-
);
|
|
211
|
-
|
|
212
|
-
fs.writeFileSync(mainFile, mainContent, 'utf8');
|
|
213
|
-
|
|
214
|
-
clack.log.success(
|
|
215
|
-
chalk.greenBright(
|
|
216
|
-
`Patched ${chalk.bold(
|
|
217
|
-
'main.dart',
|
|
218
|
-
)} with the Sentry setup and test error snippet.`,
|
|
219
|
-
),
|
|
220
|
-
);
|
|
221
|
-
|
|
222
|
-
return true;
|
|
223
|
-
} catch (error) {
|
|
224
|
-
clack.log.warn(`Failed to read/write ${chalk.cyan('main.dart')} file.`);
|
|
225
|
-
Sentry.captureException(error);
|
|
226
|
-
return false;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export function patchMainContent(
|
|
231
|
-
dsn: string,
|
|
232
|
-
mainContent: string,
|
|
233
|
-
selectedFeatures: {
|
|
234
|
-
tracing: boolean;
|
|
235
|
-
profiling: boolean;
|
|
236
|
-
},
|
|
237
|
-
): string {
|
|
238
|
-
const importIndex = getLastImportLineLocation(mainContent);
|
|
239
|
-
mainContent =
|
|
240
|
-
mainContent.slice(0, importIndex) +
|
|
241
|
-
sentryImport +
|
|
242
|
-
mainContent.slice(importIndex);
|
|
243
|
-
|
|
244
|
-
// Find and replace `runApp(...)`
|
|
245
|
-
mainContent = mainContent.replace(
|
|
246
|
-
/runApp\(([\s\S]*?)\);/g, // Match the `runApp(...)` invocation
|
|
247
|
-
(_, runAppArgs) => initSnippet(dsn, selectedFeatures, runAppArgs as string),
|
|
248
|
-
);
|
|
249
|
-
|
|
250
|
-
// Make the `main` function async if it's not already
|
|
251
|
-
mainContent = mainContent.replace(
|
|
252
|
-
/void\s+main\(\)\s*\{/g,
|
|
253
|
-
'Future<void> main() async {',
|
|
254
|
-
);
|
|
255
|
-
|
|
256
|
-
return mainContent;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export function getLastImportLineLocation(sourceCode: string): number {
|
|
260
|
-
const importRegex = /import\s+['"].*['"].*;/gim;
|
|
261
|
-
return getLastReqExpLocation(sourceCode, importRegex);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
export function getDependenciesLocation(sourceCode: string): number {
|
|
265
|
-
const dependencyRegex = /^dependencies:\s*$/gim;
|
|
266
|
-
return getLastReqExpLocation(sourceCode, dependencyRegex);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
export function getDevDependenciesLocation(sourceCode: string): number {
|
|
270
|
-
const dependencyRegex = /^dev_dependencies:\s*$/gim;
|
|
271
|
-
return getLastReqExpLocation(sourceCode, dependencyRegex);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// Helper
|
|
275
|
-
|
|
276
|
-
function getLastReqExpLocation(sourceCode: string, regExp: RegExp): number {
|
|
277
|
-
let match = regExp.exec(sourceCode);
|
|
278
|
-
let importIndex = 0;
|
|
279
|
-
while (match) {
|
|
280
|
-
importIndex = match.index + match[0].length + 1;
|
|
281
|
-
match = regExp.exec(sourceCode);
|
|
282
|
-
}
|
|
283
|
-
return importIndex;
|
|
284
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { WizardOptions } from '../utils/types';
|
|
2
|
-
import * as Sentry from '@sentry/node';
|
|
3
|
-
import * as codetools from './code-tools';
|
|
4
|
-
import * as fs from 'fs';
|
|
5
|
-
import * as path from 'path';
|
|
6
|
-
import { showCopyPasteInstructions } from '../utils/clack-utils';
|
|
7
|
-
import { pubspecSnippetColored, initSnippetColored } from './templates';
|
|
8
|
-
import { fetchSdkVersion } from '../utils/release-registry';
|
|
9
|
-
// @ts-ignore - clack is ESM and TS complains about that. It works though
|
|
10
|
-
import * as clack from '@clack/prompts';
|
|
11
|
-
import chalk from 'chalk';
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
confirmContinueIfNoOrDirtyGitRepo,
|
|
15
|
-
getOrAskForProjectData,
|
|
16
|
-
printWelcome,
|
|
17
|
-
} from '../utils/clack-utils';
|
|
18
|
-
|
|
19
|
-
import { traceStep, withTelemetry } from '../telemetry';
|
|
20
|
-
import { findFile } from './code-tools';
|
|
21
|
-
|
|
22
|
-
export async function runFlutterWizard(options: WizardOptions): Promise<void> {
|
|
23
|
-
return withTelemetry(
|
|
24
|
-
{
|
|
25
|
-
enabled: options.telemetryEnabled,
|
|
26
|
-
integration: 'flutter',
|
|
27
|
-
wizardOptions: options,
|
|
28
|
-
},
|
|
29
|
-
() => runFlutterWizardWithTelemetry(options),
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async function runFlutterWizardWithTelemetry(
|
|
34
|
-
options: WizardOptions,
|
|
35
|
-
): Promise<void> {
|
|
36
|
-
printWelcome({
|
|
37
|
-
wizardName: 'Sentry Flutter Wizard',
|
|
38
|
-
promoCode: options.promoCode,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
await confirmContinueIfNoOrDirtyGitRepo();
|
|
42
|
-
|
|
43
|
-
const { selectedProject, selfHosted, sentryUrl, authToken } =
|
|
44
|
-
await getOrAskForProjectData(options, 'flutter');
|
|
45
|
-
|
|
46
|
-
const projectDir = process.cwd();
|
|
47
|
-
const pubspecFile = path.join(projectDir, 'pubspec.yaml');
|
|
48
|
-
if (!fs.existsSync(pubspecFile)) {
|
|
49
|
-
clack.log.error(
|
|
50
|
-
`Could not find ${chalk.cyan(
|
|
51
|
-
'pubspec.yaml',
|
|
52
|
-
)}. Make sure you run the wizard in the projects root folder.`,
|
|
53
|
-
);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// ======== STEP 1. Add sentry_flutter and sentry_dart_plugin to pubspec.yaml ============
|
|
58
|
-
|
|
59
|
-
clack.log.step(
|
|
60
|
-
`Adding ${chalk.bold('Sentry')} to your apps ${chalk.cyan(
|
|
61
|
-
'pubspec.yaml',
|
|
62
|
-
)} file.`,
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
const flutterVersion = await fetchSdkVersion('sentry.dart.flutter');
|
|
66
|
-
const flutterVersionOrAny = flutterVersion ? `^${flutterVersion}` : 'any';
|
|
67
|
-
|
|
68
|
-
const pluginVersion = await fetchSdkVersion('sentry.dart.plugin');
|
|
69
|
-
const pluginVersionOrAny = pluginVersion ? `^${pluginVersion}` : 'any';
|
|
70
|
-
|
|
71
|
-
const pubspecPatched = traceStep('Patch pubspec.yaml', () =>
|
|
72
|
-
codetools.patchPubspec(
|
|
73
|
-
pubspecFile,
|
|
74
|
-
flutterVersionOrAny,
|
|
75
|
-
pluginVersionOrAny,
|
|
76
|
-
selectedProject.slug,
|
|
77
|
-
selectedProject.organization.slug,
|
|
78
|
-
),
|
|
79
|
-
);
|
|
80
|
-
if (!pubspecPatched) {
|
|
81
|
-
clack.log.warn(
|
|
82
|
-
`Could not patch ${chalk.cyan(
|
|
83
|
-
'pubspec.yaml',
|
|
84
|
-
)}. Add the dependencies to it.`,
|
|
85
|
-
);
|
|
86
|
-
await showCopyPasteInstructions(
|
|
87
|
-
'pubspec.yaml',
|
|
88
|
-
pubspecSnippetColored(
|
|
89
|
-
flutterVersionOrAny,
|
|
90
|
-
pluginVersionOrAny,
|
|
91
|
-
selectedProject.slug,
|
|
92
|
-
selectedProject.organization.slug,
|
|
93
|
-
),
|
|
94
|
-
'This ensures the Sentry SDK and plugin can be imported.',
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
Sentry.setTag('pubspec-patched', pubspecPatched);
|
|
98
|
-
|
|
99
|
-
// ======== STEP 2. Add sentry.properties with auth token ============
|
|
100
|
-
|
|
101
|
-
const propertiesAdded = traceStep('Add sentry.properties', () =>
|
|
102
|
-
codetools.addProperties(pubspecFile, authToken),
|
|
103
|
-
);
|
|
104
|
-
if (!propertiesAdded) {
|
|
105
|
-
clack.log.warn(
|
|
106
|
-
`We could not add ${chalk.cyan(
|
|
107
|
-
'sentry.properties',
|
|
108
|
-
)} file in your project directory in order to provide an auth token for Sentry CLI. You'll have to add it manually, or you can set the SENTRY_AUTH_TOKEN environment variable instead. See https://docs.sentry.io/cli/configuration/#auth-token for more information.`,
|
|
109
|
-
);
|
|
110
|
-
} else {
|
|
111
|
-
clack.log.info(
|
|
112
|
-
`We created ${chalk.cyan(
|
|
113
|
-
'sentry.properties',
|
|
114
|
-
)} 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.`,
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
Sentry.setTag('sentry-properties-added', pubspecPatched);
|
|
118
|
-
|
|
119
|
-
// ======== STEP 3. Patch main.dart with setup and a test error snippet ============
|
|
120
|
-
|
|
121
|
-
clack.log.step(
|
|
122
|
-
`Patching ${chalk.cyan('main.dart')} with setup and test error snippet.`,
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
const mainFile = findFile(`${projectDir}/lib`, 'main.dart');
|
|
126
|
-
const dsn = selectedProject.keys[0].dsn.public;
|
|
127
|
-
const canEnableProfiling =
|
|
128
|
-
fs.existsSync(`${projectDir}/ios`) || fs.existsSync(`${projectDir}/macos`);
|
|
129
|
-
|
|
130
|
-
const mainPatched = await traceStep('Patch main.dart', () =>
|
|
131
|
-
codetools.patchMain(mainFile, dsn, canEnableProfiling),
|
|
132
|
-
);
|
|
133
|
-
if (!mainPatched) {
|
|
134
|
-
clack.log.warn(
|
|
135
|
-
`Could not patch ${chalk.cyan(
|
|
136
|
-
'main.dart',
|
|
137
|
-
)} file. Place the following code snippet within the apps main function.`,
|
|
138
|
-
);
|
|
139
|
-
await showCopyPasteInstructions(
|
|
140
|
-
'main.dart',
|
|
141
|
-
initSnippetColored(dsn),
|
|
142
|
-
'This ensures the Sentry SDK is ready to capture errors.',
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
Sentry.setTag('main-patched', mainPatched);
|
|
146
|
-
|
|
147
|
-
// ======== OUTRO ========
|
|
148
|
-
|
|
149
|
-
const issuesPageLink = selfHosted
|
|
150
|
-
? `${sentryUrl}organizations/${selectedProject.organization.slug}/issues/?project=${selectedProject.id}`
|
|
151
|
-
: `https://${selectedProject.organization.slug}.sentry.io/issues/?project=${selectedProject.id}`;
|
|
152
|
-
|
|
153
|
-
clack.outro(`
|
|
154
|
-
${chalk.greenBright('Successfully installed the Sentry Flutter SDK!')}
|
|
155
|
-
|
|
156
|
-
${chalk.cyan(
|
|
157
|
-
`You can validate your setup by launching your application and checking Sentry issues page afterwards
|
|
158
|
-
${issuesPageLink}`,
|
|
159
|
-
)}
|
|
160
|
-
|
|
161
|
-
Check out the SDK documentation for further configuration:
|
|
162
|
-
https://docs.sentry.io/platforms/flutter/
|
|
163
|
-
`);
|
|
164
|
-
}
|
package/src/flutter/templates.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { makeCodeSnippet } from '../utils/clack-utils';
|
|
2
|
-
|
|
3
|
-
export const sentryImport = `import 'package:sentry_flutter/sentry_flutter.dart';\n`;
|
|
4
|
-
|
|
5
|
-
export function pubspecOptions(project: string, org: string): string {
|
|
6
|
-
return `sentry:
|
|
7
|
-
upload_debug_symbols: true
|
|
8
|
-
upload_source_maps: true
|
|
9
|
-
project: ${project}
|
|
10
|
-
org: ${org}
|
|
11
|
-
`;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function sentryProperties(authToken: string): string {
|
|
15
|
-
return `auth_token=${authToken}`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function initSnippet(
|
|
19
|
-
dsn: string,
|
|
20
|
-
selectedFeaturesMap: {
|
|
21
|
-
tracing: boolean;
|
|
22
|
-
profiling: boolean;
|
|
23
|
-
},
|
|
24
|
-
runApp: string,
|
|
25
|
-
): string {
|
|
26
|
-
let snippet = `await SentryFlutter.init(
|
|
27
|
-
(options) {
|
|
28
|
-
options.dsn = '${dsn}';`;
|
|
29
|
-
|
|
30
|
-
if (selectedFeaturesMap.tracing) {
|
|
31
|
-
snippet += `
|
|
32
|
-
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
|
|
33
|
-
// We recommend adjusting this value in production.
|
|
34
|
-
options.tracesSampleRate = 1.0;`;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (selectedFeaturesMap.profiling && selectedFeaturesMap.tracing) {
|
|
38
|
-
snippet += `
|
|
39
|
-
// The sampling rate for profiling is relative to tracesSampleRate
|
|
40
|
-
// Setting to 1.0 will profile 100% of sampled transactions:
|
|
41
|
-
options.profilesSampleRate = 1.0;`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
snippet += `
|
|
45
|
-
},
|
|
46
|
-
appRunner: () => runApp(SentryWidget(child: ${runApp})),
|
|
47
|
-
);
|
|
48
|
-
// TODO: Remove this line after sending the first sample event to sentry.
|
|
49
|
-
await Sentry.captureException(Exception('This is a sample exception.'));`;
|
|
50
|
-
|
|
51
|
-
return snippet;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function pubspecSnippetColored(
|
|
55
|
-
sentryVersion: string,
|
|
56
|
-
pluginVersion: string,
|
|
57
|
-
project: string,
|
|
58
|
-
org: string,
|
|
59
|
-
): string {
|
|
60
|
-
const snippet = `dependencies:
|
|
61
|
-
sentry_flutter: ${sentryVersion}
|
|
62
|
-
|
|
63
|
-
dev_dependencies:
|
|
64
|
-
sentry_dart_plugin: ${pluginVersion}
|
|
65
|
-
|
|
66
|
-
${pubspecOptions(project, org)}`;
|
|
67
|
-
|
|
68
|
-
return makeCodeSnippet(true, (_unchanged, plus, _minus) => {
|
|
69
|
-
return plus(snippet);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function initSnippetColored(dsn: string): string {
|
|
74
|
-
const snippet = `import 'package:sentry_flutter/sentry_flutter.dart';
|
|
75
|
-
|
|
76
|
-
Future<void>main() async {
|
|
77
|
-
await SentryFlutter.init(
|
|
78
|
-
(options) {
|
|
79
|
-
options.dsn = '${dsn}';
|
|
80
|
-
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
|
|
81
|
-
// We recommend adjusting this value in production.
|
|
82
|
-
options.tracesSampleRate = 1.0;
|
|
83
|
-
},
|
|
84
|
-
appRunner: () => runApp(SentryWidget(child: YourApp())),
|
|
85
|
-
)
|
|
86
|
-
}`;
|
|
87
|
-
return makeCodeSnippet(true, (_unchanged, plus, _minus) => {
|
|
88
|
-
return plus(snippet);
|
|
89
|
-
});
|
|
90
|
-
}
|