@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
package/src/utils/ast-utils.ts
DELETED
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
|
|
3
|
-
import * as recast from 'recast';
|
|
4
|
-
import x = recast.types;
|
|
5
|
-
import t = x.namedTypes;
|
|
6
|
-
|
|
7
|
-
const b = recast.types.builders;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Checks if a file where we don't know its concrete file type yet exists
|
|
11
|
-
* and returns the full path to the file with the correct file type.
|
|
12
|
-
*/
|
|
13
|
-
export function findFile(
|
|
14
|
-
filePath: string,
|
|
15
|
-
fileTypes: string[] = ['.js', '.ts', '.mjs', '.cjs'],
|
|
16
|
-
): string | undefined {
|
|
17
|
-
return fileTypes
|
|
18
|
-
.map((type) => `${filePath}${type}`)
|
|
19
|
-
.find((file) => fs.existsSync(file));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* checks for require('@sentry/*') syntax
|
|
24
|
-
*/
|
|
25
|
-
export function hasSentryContent(program: t.Program): boolean {
|
|
26
|
-
let foundSentry: boolean | undefined = false;
|
|
27
|
-
recast.visit(program, {
|
|
28
|
-
visitStringLiteral(path) {
|
|
29
|
-
foundSentry = foundSentry || path.node.value.startsWith('@sentry/');
|
|
30
|
-
this.traverse(path);
|
|
31
|
-
},
|
|
32
|
-
visitLiteral(path) {
|
|
33
|
-
foundSentry =
|
|
34
|
-
foundSentry || path.node.value?.toString().startsWith('@sentry/');
|
|
35
|
-
this.traverse(path);
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
return !!foundSentry;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Searches for a property of an ObjectExpression by name
|
|
44
|
-
*
|
|
45
|
-
* @param object the ObjectExpression to search in
|
|
46
|
-
* @param name the name of the property to search for
|
|
47
|
-
*
|
|
48
|
-
* @returns the property if it exists
|
|
49
|
-
*/
|
|
50
|
-
export function getObjectProperty(
|
|
51
|
-
object: t.ObjectExpression,
|
|
52
|
-
name: string,
|
|
53
|
-
): t.Property | undefined {
|
|
54
|
-
return object.properties.find((p): p is t.Property => {
|
|
55
|
-
const isObjectProp = p.type === 'Property' || p.type === 'ObjectProperty';
|
|
56
|
-
|
|
57
|
-
if (!isObjectProp) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const hasMatchingLiteralKey =
|
|
62
|
-
isObjectProp &&
|
|
63
|
-
(p.key.type === 'Literal' || p.key.type === 'StringLiteral') &&
|
|
64
|
-
p.key.value === name;
|
|
65
|
-
|
|
66
|
-
if (hasMatchingLiteralKey) {
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// has matching identifier key
|
|
71
|
-
return isObjectProp && p.key.type === 'Identifier' && p.key.name === name;
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Attempts to find a property of an ObjectExpression by name. If it doesn't exist,
|
|
77
|
-
* the property will be added to the ObjectExpression with the provided default value.
|
|
78
|
-
*
|
|
79
|
-
* @param object the parent object expression to search in
|
|
80
|
-
* @param name the name of the property to search for
|
|
81
|
-
* @param defaultValue the default value to set if the property doesn't exist
|
|
82
|
-
*
|
|
83
|
-
* @returns the
|
|
84
|
-
*/
|
|
85
|
-
export function getOrSetObjectProperty(
|
|
86
|
-
object: t.ObjectExpression,
|
|
87
|
-
name: string,
|
|
88
|
-
defaultValue:
|
|
89
|
-
| t.Literal
|
|
90
|
-
| t.BooleanLiteral
|
|
91
|
-
| t.StringLiteral
|
|
92
|
-
| t.ObjectExpression,
|
|
93
|
-
): t.Property {
|
|
94
|
-
const existingProperty = getObjectProperty(object, name);
|
|
95
|
-
|
|
96
|
-
if (existingProperty) {
|
|
97
|
-
return existingProperty;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const newProperty = b.property.from({
|
|
101
|
-
kind: 'init',
|
|
102
|
-
key: b.stringLiteral(name),
|
|
103
|
-
value: defaultValue,
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
object.properties.push(newProperty);
|
|
107
|
-
|
|
108
|
-
return newProperty;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Sets a property of an ObjectExpression if it exists, otherwise adds it
|
|
113
|
-
* to the ObjectExpression. Optionally, a comment can be added to the
|
|
114
|
-
* property.
|
|
115
|
-
*
|
|
116
|
-
* @param object the ObjectExpression to set the property on
|
|
117
|
-
* @param name the name of the property to set
|
|
118
|
-
* @param value the value of the property to set
|
|
119
|
-
* @param comment (optional) a comment to add to the property
|
|
120
|
-
*/
|
|
121
|
-
export function setOrUpdateObjectProperty(
|
|
122
|
-
object: t.ObjectExpression,
|
|
123
|
-
name: string,
|
|
124
|
-
value: t.Literal | t.BooleanLiteral | t.StringLiteral | t.ObjectExpression,
|
|
125
|
-
comment?: string,
|
|
126
|
-
) {
|
|
127
|
-
const newComments =
|
|
128
|
-
comment &&
|
|
129
|
-
comment.split('\n').map((c) => b.commentLine(` ${c}`, true, false));
|
|
130
|
-
|
|
131
|
-
const existingProperty = getObjectProperty(object, name);
|
|
132
|
-
|
|
133
|
-
if (existingProperty) {
|
|
134
|
-
existingProperty.value = value;
|
|
135
|
-
if (newComments) {
|
|
136
|
-
existingProperty.comments = [
|
|
137
|
-
...(existingProperty?.comments || []),
|
|
138
|
-
...newComments,
|
|
139
|
-
];
|
|
140
|
-
}
|
|
141
|
-
} else {
|
|
142
|
-
object.properties.push(
|
|
143
|
-
b.objectProperty.from({
|
|
144
|
-
key: b.stringLiteral(name),
|
|
145
|
-
value,
|
|
146
|
-
...(newComments && {
|
|
147
|
-
comments: newComments,
|
|
148
|
-
}),
|
|
149
|
-
}),
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
type JsonCParseResult =
|
|
155
|
-
| {
|
|
156
|
-
jsonObject: t.ObjectExpression;
|
|
157
|
-
ast: t.Program;
|
|
158
|
-
}
|
|
159
|
-
| {
|
|
160
|
-
jsonObject: undefined;
|
|
161
|
-
ast: undefined;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Parses a JSON string with (potential) comments (JSON-C) and returns the JS AST
|
|
166
|
-
* that can be walked and modified with recast like a normal JS AST.
|
|
167
|
-
*
|
|
168
|
-
* This is done by wrapping the JSON-C string in parentheses, thereby making it
|
|
169
|
-
* a JS `Program` with an `ExpressionStatement` as its body. The expression is then
|
|
170
|
-
* extracted from the AST and returned alongside the AST.
|
|
171
|
-
*
|
|
172
|
-
* To preserve as much original formatting as possible, the returned `ast`
|
|
173
|
-
* property should be passed to {@link `printJsonC`} to get the JSON-C string back.
|
|
174
|
-
*
|
|
175
|
-
* If the input is not valid JSON-C, the result will be undefined.
|
|
176
|
-
*
|
|
177
|
-
* @see {@link JsonCParseResult}
|
|
178
|
-
*
|
|
179
|
-
* @param jsonString a JSON-C string
|
|
180
|
-
*
|
|
181
|
-
* @returns a {@link JsonCParseResult}, containing either the JSON-C object and the AST or undefined in both cases
|
|
182
|
-
*/
|
|
183
|
-
export function parseJsonC(jsonString: string): JsonCParseResult {
|
|
184
|
-
try {
|
|
185
|
-
const jsTsConfig = `(${jsonString})`;
|
|
186
|
-
// no idea why recast returns any here, this is dumb :/
|
|
187
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
188
|
-
const ast = recast.parse(jsTsConfig.toString()).program as t.Program;
|
|
189
|
-
|
|
190
|
-
const jsonObject =
|
|
191
|
-
(ast.body[0].type === 'ExpressionStatement' &&
|
|
192
|
-
ast.body[0].expression.type === 'ObjectExpression' &&
|
|
193
|
-
ast.body[0].expression) ||
|
|
194
|
-
undefined;
|
|
195
|
-
|
|
196
|
-
if (jsonObject) {
|
|
197
|
-
return { jsonObject, ast };
|
|
198
|
-
}
|
|
199
|
-
} catch {
|
|
200
|
-
/* empty */
|
|
201
|
-
}
|
|
202
|
-
return { jsonObject: undefined, ast: undefined };
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Takes the AST of a parsed JSON-C "program" and returns the JSON-C string without
|
|
207
|
-
* any of the temporary JS wrapper code that was previously applied.
|
|
208
|
-
*
|
|
209
|
-
* Only use this in conjunction with {@link `parseJsonC`}
|
|
210
|
-
*
|
|
211
|
-
* @param ast the `ast` returned from {@link `parseJsonC`}
|
|
212
|
-
*
|
|
213
|
-
* @returns the JSON-C string
|
|
214
|
-
*/
|
|
215
|
-
export function printJsonC(ast: t.Program): string {
|
|
216
|
-
const js = recast.print(ast).code;
|
|
217
|
-
return js.substring(1, js.length - 1);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Walks the program body and returns index of the last variable assignment initialized by require statement.
|
|
222
|
-
* Only counts top level require statements.
|
|
223
|
-
*
|
|
224
|
-
* @returns index of the last `const foo = require('bar');` statement or -1 if none was found.
|
|
225
|
-
*/
|
|
226
|
-
export function getLastRequireIndex(program: t.Program): number {
|
|
227
|
-
let lastRequireIdex = -1;
|
|
228
|
-
program.body.forEach((s, i) => {
|
|
229
|
-
if (
|
|
230
|
-
s.type === 'VariableDeclaration' &&
|
|
231
|
-
s.declarations[0].type === 'VariableDeclarator' &&
|
|
232
|
-
s.declarations[0].init !== null &&
|
|
233
|
-
typeof s.declarations[0].init !== 'undefined' &&
|
|
234
|
-
s.declarations[0].init.type === 'CallExpression' &&
|
|
235
|
-
s.declarations[0].init.callee.type === 'Identifier' &&
|
|
236
|
-
s.declarations[0].init.callee.name === 'require'
|
|
237
|
-
) {
|
|
238
|
-
lastRequireIdex = i;
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
return lastRequireIdex;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Walks the statements and removes require statements which first argument includes the predicate.
|
|
246
|
-
* Only removes top level require statements like `const foo = require('bar');`
|
|
247
|
-
*
|
|
248
|
-
* @returns True if any require statement was removed.
|
|
249
|
-
*/
|
|
250
|
-
export function removeRequire(program: t.Program, predicate: string): boolean {
|
|
251
|
-
let removedAtLeastOne = false;
|
|
252
|
-
program.body = program.body.filter((s) => {
|
|
253
|
-
if (
|
|
254
|
-
s.type === 'VariableDeclaration' &&
|
|
255
|
-
s.declarations[0].type === 'VariableDeclarator' &&
|
|
256
|
-
s.declarations[0].init !== null &&
|
|
257
|
-
typeof s.declarations[0].init !== 'undefined' &&
|
|
258
|
-
s.declarations[0].init.type === 'CallExpression' &&
|
|
259
|
-
s.declarations[0].init.callee.type === 'Identifier' &&
|
|
260
|
-
s.declarations[0].init.callee.name === 'require' &&
|
|
261
|
-
s.declarations[0].init.arguments[0].type === 'StringLiteral' &&
|
|
262
|
-
s.declarations[0].init.arguments[0].value.includes(predicate)
|
|
263
|
-
) {
|
|
264
|
-
removedAtLeastOne = true;
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
|
-
return true;
|
|
268
|
-
});
|
|
269
|
-
return removedAtLeastOne;
|
|
270
|
-
}
|
package/src/utils/bash.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as child_process from 'child_process';
|
|
2
|
-
import * as https from 'https';
|
|
3
|
-
import * as fs from 'fs';
|
|
4
|
-
|
|
5
|
-
export function hasSentryCLI(): boolean {
|
|
6
|
-
try {
|
|
7
|
-
child_process.execSync('sentry-cli --version');
|
|
8
|
-
return true;
|
|
9
|
-
} catch (e) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export async function installSentryCLI(): Promise<void> {
|
|
15
|
-
const httpAsync = new Promise((resolve, reject) => {
|
|
16
|
-
const file = fs.createWriteStream('installcli.sh');
|
|
17
|
-
https.get('https://sentry.io/get-cli/', (response) => {
|
|
18
|
-
response.pipe(file);
|
|
19
|
-
file.on('finish', () => {
|
|
20
|
-
file.close();
|
|
21
|
-
try {
|
|
22
|
-
child_process.execSync('bash ./installcli.sh');
|
|
23
|
-
} catch (e) {
|
|
24
|
-
reject(e);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
fs.unlinkSync('installcli.sh');
|
|
28
|
-
resolve(null);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
file.on('error', (err) => {
|
|
32
|
-
fs.unlinkSync('installcli.sh');
|
|
33
|
-
reject(err);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
await httpAsync;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function executeSync(command: string): string {
|
|
42
|
-
const output = child_process.execSync(command);
|
|
43
|
-
return output.toString();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function execute(command: string): Promise<string> {
|
|
47
|
-
return new Promise((resolve, reject) => {
|
|
48
|
-
child_process.exec(command, (error, stdout, _) => {
|
|
49
|
-
if (error) {
|
|
50
|
-
reject(error);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
resolve(stdout);
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
}
|