@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
package/e2e-tests/utils/index.ts
DELETED
|
@@ -1,456 +0,0 @@
|
|
|
1
|
-
import * as fs from 'node:fs';
|
|
2
|
-
import * as path from 'node:path';
|
|
3
|
-
|
|
4
|
-
import type { Integration } from '../../lib/Constants';
|
|
5
|
-
import { spawn, execSync } from 'node:child_process';
|
|
6
|
-
import type { ChildProcess } from 'node:child_process';
|
|
7
|
-
import { dim, green, red } from '../../lib/Helper/Logging';
|
|
8
|
-
|
|
9
|
-
export const KEYS = {
|
|
10
|
-
UP: '\u001b[A',
|
|
11
|
-
DOWN: '\u001b[B',
|
|
12
|
-
LEFT: '\u001b[D',
|
|
13
|
-
RIGHT: '\u001b[C',
|
|
14
|
-
ENTER: '\r',
|
|
15
|
-
SPACE: ' ',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const TEST_ARGS = {
|
|
19
|
-
AUTH_TOKEN: process.env.SENTRY_TEST_AUTH_TOKEN || 'TEST_AUTH_TOKEN',
|
|
20
|
-
PROJECT_DSN:
|
|
21
|
-
process.env.SENTRY_TEST_DSN || 'https://public@dsn.ingest.sentry.io/1337',
|
|
22
|
-
ORG_SLUG: process.env.SENTRY_TEST_ORG || 'TEST_ORG_SLUG',
|
|
23
|
-
PROJECT_SLUG: process.env.SENTRY_TEST_PROJECT || 'TEST_PROJECT_SLUG',
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const log = {
|
|
27
|
-
success: (message: string) => {
|
|
28
|
-
green(`[SUCCESS] ${message}`);
|
|
29
|
-
},
|
|
30
|
-
info: (message: string) => {
|
|
31
|
-
dim(`[INFO] ${message}`);
|
|
32
|
-
},
|
|
33
|
-
error: (message: string) => {
|
|
34
|
-
red(`[ERROR] ${message}`);
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export class WizardTestEnv {
|
|
39
|
-
taskHandle: ChildProcess;
|
|
40
|
-
|
|
41
|
-
constructor(
|
|
42
|
-
cmd: string,
|
|
43
|
-
args: string[],
|
|
44
|
-
opts?: {
|
|
45
|
-
cwd?: string;
|
|
46
|
-
debug?: boolean;
|
|
47
|
-
},
|
|
48
|
-
) {
|
|
49
|
-
this.taskHandle = spawn(cmd, args, { cwd: opts?.cwd, stdio: 'pipe' });
|
|
50
|
-
|
|
51
|
-
if (opts?.debug) {
|
|
52
|
-
this.taskHandle.stdout?.pipe(process.stdout);
|
|
53
|
-
this.taskHandle.stderr?.pipe(process.stderr);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
sendStdin(input: string) {
|
|
58
|
-
this.taskHandle.stdin?.write(input);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Sends the input and waits for the output.
|
|
63
|
-
* @returns a promise that resolves when the output was found
|
|
64
|
-
* @throws an error when the output was not found within the timeout
|
|
65
|
-
*/
|
|
66
|
-
sendStdinAndWaitForOutput(
|
|
67
|
-
input: string | string[],
|
|
68
|
-
output: string,
|
|
69
|
-
options?: { timeout?: number; optional?: boolean },
|
|
70
|
-
) {
|
|
71
|
-
const outputPromise = this.waitForOutput(output, options);
|
|
72
|
-
|
|
73
|
-
if (Array.isArray(input)) {
|
|
74
|
-
for (const i of input) {
|
|
75
|
-
this.sendStdin(i);
|
|
76
|
-
}
|
|
77
|
-
} else {
|
|
78
|
-
this.sendStdin(input);
|
|
79
|
-
}
|
|
80
|
-
return outputPromise;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Waits for the task to exit with a given `statusCode`.
|
|
85
|
-
*
|
|
86
|
-
* @returns a promise that resolves to `true` if the run ends with the status
|
|
87
|
-
* code, or it rejects when the `timeout` was reached.
|
|
88
|
-
*/
|
|
89
|
-
waitForStatusCode(
|
|
90
|
-
statusCode: number | null,
|
|
91
|
-
options: {
|
|
92
|
-
/** Timeout in ms */
|
|
93
|
-
timeout?: number;
|
|
94
|
-
} = {},
|
|
95
|
-
) {
|
|
96
|
-
const { timeout } = {
|
|
97
|
-
timeout: 60_000,
|
|
98
|
-
...options,
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
return new Promise<boolean>((resolve, reject) => {
|
|
102
|
-
const timeoutId = setTimeout(() => {
|
|
103
|
-
this.kill();
|
|
104
|
-
reject(new Error(`Timeout waiting for status code: ${statusCode}`));
|
|
105
|
-
}, timeout);
|
|
106
|
-
|
|
107
|
-
this.taskHandle.on('error', (err: Error) => {
|
|
108
|
-
clearTimeout(timeoutId);
|
|
109
|
-
reject(err);
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
this.taskHandle.on('exit', (code: number | null) => {
|
|
113
|
-
clearTimeout(timeoutId);
|
|
114
|
-
resolve(code === statusCode);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Waits for the provided output with `.includes()` logic.
|
|
121
|
-
*
|
|
122
|
-
* @returns a promise that resolves to `true` if the output was found, `false` if the output was not found within the
|
|
123
|
-
* timeout and `optional: true` is set, or it rejects when the timeout was reached with `optional: false`
|
|
124
|
-
*/
|
|
125
|
-
waitForOutput(
|
|
126
|
-
output: string,
|
|
127
|
-
options: {
|
|
128
|
-
/** Timeout in ms */
|
|
129
|
-
timeout?: number;
|
|
130
|
-
/** Whether to always resolve after the timeout, no matter whether the input was actually found or not. */
|
|
131
|
-
optional?: boolean;
|
|
132
|
-
} = {},
|
|
133
|
-
) {
|
|
134
|
-
const { timeout, optional } = {
|
|
135
|
-
timeout: 60_000,
|
|
136
|
-
optional: false,
|
|
137
|
-
...options,
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
return new Promise<boolean>((resolve, reject) => {
|
|
141
|
-
let outputBuffer = '';
|
|
142
|
-
const timeoutId = setTimeout(() => {
|
|
143
|
-
this.kill();
|
|
144
|
-
if (optional) {
|
|
145
|
-
// The output is not found but it's optional so we can resolve the promise with false
|
|
146
|
-
resolve(false);
|
|
147
|
-
} else {
|
|
148
|
-
reject(
|
|
149
|
-
new Error(
|
|
150
|
-
`Timeout waiting for output: ${output}. Got the following instead: ${outputBuffer}`,
|
|
151
|
-
),
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
}, timeout);
|
|
155
|
-
|
|
156
|
-
this.taskHandle.on('error', (err: Error) => {
|
|
157
|
-
clearTimeout(timeoutId);
|
|
158
|
-
reject(err);
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
this.taskHandle.stdout?.on('data', (data) => {
|
|
162
|
-
outputBuffer += data;
|
|
163
|
-
if (outputBuffer.includes(output)) {
|
|
164
|
-
clearTimeout(timeoutId);
|
|
165
|
-
// The output is found so we can resolve the promise with true
|
|
166
|
-
resolve(true);
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
kill() {
|
|
173
|
-
this.taskHandle.stdin?.destroy();
|
|
174
|
-
this.taskHandle.stderr?.destroy();
|
|
175
|
-
this.taskHandle.stdout?.destroy();
|
|
176
|
-
this.taskHandle.kill('SIGINT');
|
|
177
|
-
this.taskHandle.unref();
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Initialize a git repository in the given directory
|
|
183
|
-
* @param projectDir
|
|
184
|
-
*/
|
|
185
|
-
export function initGit(projectDir: string): void {
|
|
186
|
-
try {
|
|
187
|
-
execSync('git init', { cwd: projectDir });
|
|
188
|
-
// Add all files to the git repo
|
|
189
|
-
execSync('git add -A', { cwd: projectDir });
|
|
190
|
-
// Add author info to avoid git commit error
|
|
191
|
-
execSync('git config user.email test@test.sentry.io', { cwd: projectDir });
|
|
192
|
-
execSync('git config user.name Test', { cwd: projectDir });
|
|
193
|
-
execSync('git commit -m init', { cwd: projectDir });
|
|
194
|
-
} catch (e) {
|
|
195
|
-
log.error('Error initializing git');
|
|
196
|
-
log.error(e);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Cleanup the git repository in the given directory
|
|
202
|
-
*
|
|
203
|
-
* Caution! Make sure `projectDir` is a test project directory,
|
|
204
|
-
* if in doubt, please commit your local non-test changes first!
|
|
205
|
-
* @param projectDir
|
|
206
|
-
*/
|
|
207
|
-
export function cleanupGit(projectDir: string): void {
|
|
208
|
-
try {
|
|
209
|
-
// Remove the .git directory
|
|
210
|
-
execSync(`rm -rf ${projectDir}/.git`);
|
|
211
|
-
} catch (e) {
|
|
212
|
-
log.error('Error cleaning up git');
|
|
213
|
-
log.error(e);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Revert local changes in the given directory
|
|
219
|
-
*
|
|
220
|
-
* Caution! Make sure `projectDir` is a test project directory,
|
|
221
|
-
* if in doubt, please commit your local non-test changes first!
|
|
222
|
-
*
|
|
223
|
-
* @param projectDir
|
|
224
|
-
*/
|
|
225
|
-
export function revertLocalChanges(projectDir: string): void {
|
|
226
|
-
try {
|
|
227
|
-
// Revert tracked files
|
|
228
|
-
execSync('git checkout .', { cwd: projectDir });
|
|
229
|
-
// Revert untracked files
|
|
230
|
-
execSync('git clean -fd .', { cwd: projectDir });
|
|
231
|
-
} catch (e) {
|
|
232
|
-
log.error('Error reverting local changes');
|
|
233
|
-
log.error(e);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Start the wizard instance with the given integration and project directory
|
|
239
|
-
* @param integration
|
|
240
|
-
* @param projectDir
|
|
241
|
-
*
|
|
242
|
-
* @returns WizardTestEnv
|
|
243
|
-
*/
|
|
244
|
-
export function startWizardInstance(
|
|
245
|
-
integration: Integration,
|
|
246
|
-
projectDir: string,
|
|
247
|
-
debug = false,
|
|
248
|
-
): WizardTestEnv {
|
|
249
|
-
const binName = process.env.SENTRY_WIZARD_E2E_TEST_BIN
|
|
250
|
-
? ['dist-bin', `sentry-wizard-${process.platform}-${process.arch}`]
|
|
251
|
-
: ['dist', 'bin.js'];
|
|
252
|
-
const binPath = path.join(__dirname, '..', '..', ...binName);
|
|
253
|
-
|
|
254
|
-
revertLocalChanges(projectDir);
|
|
255
|
-
cleanupGit(projectDir);
|
|
256
|
-
initGit(projectDir);
|
|
257
|
-
|
|
258
|
-
return new WizardTestEnv(
|
|
259
|
-
binPath,
|
|
260
|
-
[
|
|
261
|
-
'--debug',
|
|
262
|
-
'-i',
|
|
263
|
-
integration,
|
|
264
|
-
'--preSelectedProject.authToken',
|
|
265
|
-
TEST_ARGS.AUTH_TOKEN,
|
|
266
|
-
'--preSelectedProject.dsn',
|
|
267
|
-
TEST_ARGS.PROJECT_DSN,
|
|
268
|
-
'--preSelectedProject.orgSlug',
|
|
269
|
-
TEST_ARGS.ORG_SLUG,
|
|
270
|
-
'--preSelectedProject.projectSlug',
|
|
271
|
-
TEST_ARGS.PROJECT_SLUG,
|
|
272
|
-
],
|
|
273
|
-
{ cwd: projectDir, debug },
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Create a file with the given content
|
|
279
|
-
*
|
|
280
|
-
* @param filePath
|
|
281
|
-
* @param content
|
|
282
|
-
*/
|
|
283
|
-
export function createFile(filePath: string, content?: string) {
|
|
284
|
-
return fs.writeFileSync(filePath, content || '');
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Modify the file with the new content
|
|
289
|
-
*
|
|
290
|
-
* @param filePath
|
|
291
|
-
* @param oldContent
|
|
292
|
-
* @param newContent
|
|
293
|
-
*/
|
|
294
|
-
export function modifyFile(
|
|
295
|
-
filePath: string,
|
|
296
|
-
replaceMap: Record<string, string>,
|
|
297
|
-
) {
|
|
298
|
-
const fileContent = fs.readFileSync(filePath, 'utf-8');
|
|
299
|
-
let newFileContent = fileContent;
|
|
300
|
-
|
|
301
|
-
for (const [oldContent, newContent] of Object.entries(replaceMap)) {
|
|
302
|
-
newFileContent = newFileContent.replace(oldContent, newContent);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
fs.writeFileSync(filePath, newFileContent);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Read the file contents and check if it contains the given content
|
|
310
|
-
*
|
|
311
|
-
* @param {string} filePath
|
|
312
|
-
* @param {(string | string[])} content
|
|
313
|
-
*/
|
|
314
|
-
export function checkFileContents(
|
|
315
|
-
filePath: string,
|
|
316
|
-
content: string | string[],
|
|
317
|
-
) {
|
|
318
|
-
const fileContent = fs.readFileSync(filePath, 'utf-8');
|
|
319
|
-
const contentArray = Array.isArray(content) ? content : [content];
|
|
320
|
-
|
|
321
|
-
for (const c of contentArray) {
|
|
322
|
-
expect(fileContent).toContain(c);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Check if the file exists
|
|
328
|
-
*
|
|
329
|
-
* @param filePath
|
|
330
|
-
*/
|
|
331
|
-
export function checkFileExists(filePath: string) {
|
|
332
|
-
expect(fs.existsSync(filePath)).toBe(true);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Check if the package.json contains the given integration
|
|
337
|
-
*
|
|
338
|
-
* @param projectDir
|
|
339
|
-
* @param integration
|
|
340
|
-
*/
|
|
341
|
-
export function checkPackageJson(projectDir: string, integration: Integration) {
|
|
342
|
-
checkFileContents(`${projectDir}/package.json`, `@sentry/${integration}`);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Check if the .sentryclirc contains the auth token
|
|
347
|
-
*
|
|
348
|
-
* @param projectDir
|
|
349
|
-
*/
|
|
350
|
-
export function checkSentryCliRc(projectDir: string) {
|
|
351
|
-
checkFileContents(
|
|
352
|
-
`${projectDir}/.sentryclirc`,
|
|
353
|
-
`token=${TEST_ARGS.AUTH_TOKEN}`,
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* Check if the .env.sentry-build-plugin contains the auth token
|
|
359
|
-
* @param projectDir
|
|
360
|
-
*/
|
|
361
|
-
export function checkEnvBuildPlugin(projectDir: string) {
|
|
362
|
-
checkFileContents(
|
|
363
|
-
`${projectDir}/.env.sentry-build-plugin`,
|
|
364
|
-
`SENTRY_AUTH_TOKEN=${TEST_ARGS.AUTH_TOKEN}`,
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Check if the sentry.properties contains the auth token
|
|
370
|
-
* @param projectDir
|
|
371
|
-
*/
|
|
372
|
-
export function checkSentryProperties(projectDir: string) {
|
|
373
|
-
checkFileContents(
|
|
374
|
-
`${projectDir}/sentry.properties`,
|
|
375
|
-
`auth_token=${TEST_ARGS.AUTH_TOKEN}`,
|
|
376
|
-
);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* Check if the project builds
|
|
381
|
-
* Check if the project builds and ends with status code 0.
|
|
382
|
-
* @param projectDir
|
|
383
|
-
*/
|
|
384
|
-
export async function checkIfBuilds(projectDir: string) {
|
|
385
|
-
const testEnv = new WizardTestEnv('npm', ['run', 'build'], {
|
|
386
|
-
cwd: projectDir,
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
await expect(
|
|
390
|
-
testEnv.waitForStatusCode(0, {
|
|
391
|
-
timeout: 120_000,
|
|
392
|
-
}),
|
|
393
|
-
).resolves.toBe(true);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* Check if the flutter project builds
|
|
398
|
-
* @param projectDir
|
|
399
|
-
*/
|
|
400
|
-
export async function checkIfFlutterBuilds(
|
|
401
|
-
projectDir: string,
|
|
402
|
-
expectedOutput: string,
|
|
403
|
-
debug = false,
|
|
404
|
-
) {
|
|
405
|
-
const testEnv = new WizardTestEnv('flutter', ['build', 'web'], {
|
|
406
|
-
cwd: projectDir,
|
|
407
|
-
debug: debug,
|
|
408
|
-
});
|
|
409
|
-
|
|
410
|
-
await expect(
|
|
411
|
-
testEnv.waitForOutput(expectedOutput, {
|
|
412
|
-
timeout: 120_000,
|
|
413
|
-
}),
|
|
414
|
-
).resolves.toBe(true);
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Check if the project runs on dev mode
|
|
419
|
-
* @param projectDir
|
|
420
|
-
* @param expectedOutput
|
|
421
|
-
*/
|
|
422
|
-
export async function checkIfRunsOnDevMode(
|
|
423
|
-
projectDir: string,
|
|
424
|
-
expectedOutput: string,
|
|
425
|
-
) {
|
|
426
|
-
const testEnv = new WizardTestEnv('npm', ['run', 'dev'], { cwd: projectDir });
|
|
427
|
-
|
|
428
|
-
await expect(
|
|
429
|
-
testEnv.waitForOutput(expectedOutput, {
|
|
430
|
-
timeout: 120_000,
|
|
431
|
-
}),
|
|
432
|
-
).resolves.toBe(true);
|
|
433
|
-
testEnv.kill();
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* Check if the project runs on prod mode
|
|
438
|
-
* @param projectDir
|
|
439
|
-
* @param expectedOutput
|
|
440
|
-
*/
|
|
441
|
-
export async function checkIfRunsOnProdMode(
|
|
442
|
-
projectDir: string,
|
|
443
|
-
expectedOutput: string,
|
|
444
|
-
startCommand = 'start',
|
|
445
|
-
) {
|
|
446
|
-
const testEnv = new WizardTestEnv('npm', ['run', startCommand], {
|
|
447
|
-
cwd: projectDir,
|
|
448
|
-
});
|
|
449
|
-
|
|
450
|
-
await expect(
|
|
451
|
-
testEnv.waitForOutput(expectedOutput, {
|
|
452
|
-
timeout: 120_000,
|
|
453
|
-
}),
|
|
454
|
-
).resolves.toBe(true);
|
|
455
|
-
testEnv.kill();
|
|
456
|
-
}
|
package/index.ts
DELETED
package/lib/Constants.ts
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/** Key value should be the same here */
|
|
2
|
-
export enum Integration {
|
|
3
|
-
reactNative = 'reactNative',
|
|
4
|
-
flutter = 'flutter',
|
|
5
|
-
ios = 'ios',
|
|
6
|
-
android = 'android',
|
|
7
|
-
cordova = 'cordova',
|
|
8
|
-
electron = 'electron',
|
|
9
|
-
nextjs = 'nextjs',
|
|
10
|
-
nuxt = 'nuxt',
|
|
11
|
-
remix = 'remix',
|
|
12
|
-
sveltekit = 'sveltekit',
|
|
13
|
-
sourcemaps = 'sourcemaps',
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** Key value should be the same here */
|
|
17
|
-
export enum Platform {
|
|
18
|
-
ios = 'ios',
|
|
19
|
-
android = 'android',
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function getPlatformChoices(): any[] {
|
|
23
|
-
return Object.keys(Platform).map((platform: string) => ({
|
|
24
|
-
checked: true,
|
|
25
|
-
name: getPlatformDescription(platform),
|
|
26
|
-
value: platform,
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function getPlatformDescription(type: string): string {
|
|
31
|
-
switch (type) {
|
|
32
|
-
case Platform.ios:
|
|
33
|
-
return 'iOS';
|
|
34
|
-
default:
|
|
35
|
-
return 'Android';
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function getIntegrationDescription(type: string): string {
|
|
40
|
-
switch (type) {
|
|
41
|
-
case Integration.android:
|
|
42
|
-
return 'Android';
|
|
43
|
-
case Integration.reactNative:
|
|
44
|
-
return 'React Native';
|
|
45
|
-
case Integration.flutter:
|
|
46
|
-
return 'Flutter';
|
|
47
|
-
case Integration.cordova:
|
|
48
|
-
return 'Cordova';
|
|
49
|
-
case Integration.electron:
|
|
50
|
-
return 'Electron';
|
|
51
|
-
case Integration.nextjs:
|
|
52
|
-
return 'Next.js';
|
|
53
|
-
case Integration.remix:
|
|
54
|
-
return 'Remix';
|
|
55
|
-
case Integration.sveltekit:
|
|
56
|
-
return 'SvelteKit';
|
|
57
|
-
case Integration.sourcemaps:
|
|
58
|
-
return 'Configure Source Maps Upload';
|
|
59
|
-
case Integration.ios:
|
|
60
|
-
return 'iOS';
|
|
61
|
-
default:
|
|
62
|
-
return 'React Native';
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function mapIntegrationToPlatform(type: string): string | undefined {
|
|
67
|
-
switch (type) {
|
|
68
|
-
case Integration.android:
|
|
69
|
-
return 'android';
|
|
70
|
-
case Integration.reactNative:
|
|
71
|
-
return 'react-native';
|
|
72
|
-
case Integration.flutter:
|
|
73
|
-
return 'flutter';
|
|
74
|
-
case Integration.cordova:
|
|
75
|
-
return 'cordova';
|
|
76
|
-
case Integration.electron:
|
|
77
|
-
return 'javascript-electron';
|
|
78
|
-
case Integration.nextjs:
|
|
79
|
-
return 'javascript-nextjs';
|
|
80
|
-
case Integration.remix:
|
|
81
|
-
return 'javascript-remix';
|
|
82
|
-
case Integration.sveltekit:
|
|
83
|
-
return 'javascript-sveltekit';
|
|
84
|
-
case Integration.sourcemaps:
|
|
85
|
-
return undefined;
|
|
86
|
-
case Integration.ios:
|
|
87
|
-
return 'iOS';
|
|
88
|
-
default:
|
|
89
|
-
throw new Error(`Unknown integration ${type}`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
type IntegrationChoice = {
|
|
94
|
-
name: string;
|
|
95
|
-
value: string;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export function getIntegrationChoices(): IntegrationChoice[] {
|
|
99
|
-
return Object.keys(Integration).map((type: string) => ({
|
|
100
|
-
name: getIntegrationDescription(type),
|
|
101
|
-
value: type,
|
|
102
|
-
}));
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface Args {
|
|
106
|
-
url: string;
|
|
107
|
-
debug: boolean;
|
|
108
|
-
uninstall: boolean;
|
|
109
|
-
integration: Integration;
|
|
110
|
-
platform: Platform[];
|
|
111
|
-
skipConnect: boolean;
|
|
112
|
-
quiet: boolean;
|
|
113
|
-
signup: boolean;
|
|
114
|
-
promoCode?: string;
|
|
115
|
-
disableTelemetry?: boolean;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export const DEFAULT_URL = 'https://sentry.io/';
|
package/lib/Helper/BottomBar.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ui } from 'inquirer';
|
|
2
|
-
|
|
3
|
-
import { nl } from './Logging';
|
|
4
|
-
|
|
5
|
-
export class BottomBar {
|
|
6
|
-
public static bar: typeof ui.BottomBar;
|
|
7
|
-
public static interval: NodeJS.Timeout;
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
10
|
-
public static show(msg: string): void {
|
|
11
|
-
const loader = ['/', '|', '\\', '-'];
|
|
12
|
-
let i = 4;
|
|
13
|
-
BottomBar.bar = new ui.BottomBar({ bottomBar: loader[i % 4] });
|
|
14
|
-
BottomBar.interval = setInterval(() => {
|
|
15
|
-
// eslint-disable-next-line no-plusplus
|
|
16
|
-
BottomBar.bar.updateBottomBar(`${loader[i++ % 4]} ${msg}`);
|
|
17
|
-
}, 100);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
public static hide(): void {
|
|
21
|
-
clearInterval(BottomBar.interval);
|
|
22
|
-
if (BottomBar.bar) {
|
|
23
|
-
BottomBar.bar.updateBottomBar('');
|
|
24
|
-
nl();
|
|
25
|
-
BottomBar.bar.close();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
package/lib/Helper/Env.ts
DELETED
package/lib/Helper/File.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as glob from 'glob';
|
|
3
|
-
|
|
4
|
-
const IGNORE_PATTERN = ['node_modules/**', 'ios/Pods/**', '**/Pods/**'];
|
|
5
|
-
|
|
6
|
-
export function patchMatchingFile(
|
|
7
|
-
globPattern: string,
|
|
8
|
-
func: any,
|
|
9
|
-
...args: any[]
|
|
10
|
-
): Promise<void> {
|
|
11
|
-
const matches = glob.sync(globPattern, {
|
|
12
|
-
ignore: IGNORE_PATTERN,
|
|
13
|
-
});
|
|
14
|
-
let rv = Promise.resolve();
|
|
15
|
-
matches.forEach((match: string) => {
|
|
16
|
-
const contents = fs.readFileSync(match, {
|
|
17
|
-
encoding: 'utf-8',
|
|
18
|
-
});
|
|
19
|
-
rv = rv
|
|
20
|
-
.then(() => func(contents, match, ...args))
|
|
21
|
-
.then((newContents) => {
|
|
22
|
-
if (
|
|
23
|
-
newContents !== null &&
|
|
24
|
-
newContents !== undefined &&
|
|
25
|
-
contents !== newContents
|
|
26
|
-
) {
|
|
27
|
-
fs.writeFileSync(match, newContents);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
return rv;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function matchFiles(globPattern: string): string[] {
|
|
35
|
-
return glob.sync(globPattern, {
|
|
36
|
-
ignore: IGNORE_PATTERN,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function exists(globPattern: string): boolean {
|
|
41
|
-
const matches = glob.sync(globPattern, {
|
|
42
|
-
ignore: IGNORE_PATTERN,
|
|
43
|
-
});
|
|
44
|
-
if (matches.length === 0) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
return matches.reduce((prev: boolean, match: string) => {
|
|
48
|
-
return prev && fs.existsSync(match);
|
|
49
|
-
}, true);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function matchesContent(
|
|
53
|
-
globPattern: string,
|
|
54
|
-
contentPattern: RegExp,
|
|
55
|
-
): boolean {
|
|
56
|
-
const matches = glob.sync(globPattern, {
|
|
57
|
-
ignore: IGNORE_PATTERN,
|
|
58
|
-
});
|
|
59
|
-
if (matches.length === 0) {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
return matches.reduce((prev: boolean, match: string) => {
|
|
63
|
-
return !!(prev && fs.readFileSync(match).toString().match(contentPattern));
|
|
64
|
-
}, true);
|
|
65
|
-
}
|
package/lib/Helper/Git.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
|
|
3
|
-
import { green, red } from './Logging';
|
|
4
|
-
|
|
5
|
-
const GITIGNORE_FILENAME = '.gitignore';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Adds the given file to the .gitignore file.
|
|
9
|
-
*
|
|
10
|
-
* @param filepath the file(path) to add to the .gitignore file
|
|
11
|
-
* @param errorMsg the error message to display if the file couldn't be added
|
|
12
|
-
*/
|
|
13
|
-
export async function addToGitignore(
|
|
14
|
-
filepath: string,
|
|
15
|
-
errorMsg: string,
|
|
16
|
-
): Promise<void> {
|
|
17
|
-
/**
|
|
18
|
-
* Don't check whether the given file is ignored because:
|
|
19
|
-
* 1. It's tricky to check it without git.
|
|
20
|
-
* 2. Git might not be installed or accessible.
|
|
21
|
-
* 3. It's convenient to use a module to interact with git, but it would
|
|
22
|
-
* increase the size x2 approximately. Docs say to run the Wizard without
|
|
23
|
-
* installing it, and duplicating the size would slow the set-up down.
|
|
24
|
-
* 4. The Wizard is meant to be run once.
|
|
25
|
-
* 5. A message is logged informing users it's been added to the gitignore.
|
|
26
|
-
* 6. It will be added to the gitignore as many times as it runs - not a big
|
|
27
|
-
* deal.
|
|
28
|
-
* 7. It's straightforward to remove it from the gitignore.
|
|
29
|
-
*/
|
|
30
|
-
try {
|
|
31
|
-
await fs.promises.appendFile(
|
|
32
|
-
GITIGNORE_FILENAME,
|
|
33
|
-
`\n# Sentry\n${filepath}\n`,
|
|
34
|
-
);
|
|
35
|
-
green(`✓ ${filepath} added to ${GITIGNORE_FILENAME}`);
|
|
36
|
-
} catch {
|
|
37
|
-
red(errorMsg);
|
|
38
|
-
}
|
|
39
|
-
}
|