@sentry/wizard 3.42.0 → 4.0.0
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/.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/CHANGELOG.md +30 -0
- package/COPYING +3575 -0
- package/bin.ts +85 -80
- package/dist/bin.js +44 -35
- package/dist/bin.js.map +1 -1
- package/dist/e2e-tests/jest.config.js +1 -1
- package/dist/e2e-tests/jest.config.js.map +1 -1
- package/dist/e2e-tests/tests/flutter.test.js +62 -147
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs.test.js +77 -175
- package/dist/e2e-tests/tests/nextjs.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +61 -162
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +62 -163
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +147 -189
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit.test.js +133 -187
- package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
- package/dist/e2e-tests/utils/index.d.ts +1 -1
- package/dist/e2e-tests/utils/index.js +113 -195
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/lib/Constants.js +5 -5
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/BottomBar.d.ts +1 -1
- package/dist/lib/Helper/BottomBar.js +14 -15
- package/dist/lib/Helper/BottomBar.js.map +1 -1
- package/dist/lib/Helper/Env.js +5 -2
- package/dist/lib/Helper/Env.js.map +1 -1
- package/dist/lib/Helper/File.js +14 -27
- package/dist/lib/Helper/File.js.map +1 -1
- package/dist/lib/Helper/Git.js +24 -59
- package/dist/lib/Helper/Git.js.map +1 -1
- package/dist/lib/Helper/Logging.js +2 -2
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/MergeConfig.js +4 -4
- package/dist/lib/Helper/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/Package.d.ts +4 -1
- package/dist/lib/Helper/Package.js +12 -38
- package/dist/lib/Helper/Package.js.map +1 -1
- package/dist/lib/Helper/SentryCli.js +77 -149
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Helper/Wizard.js +29 -124
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/lib/Helper/__tests__/File.js +4 -4
- package/dist/lib/Helper/__tests__/File.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +24 -24
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/__tests__/SentryCli.js +33 -23
- package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
- package/dist/lib/Setup.js +23 -85
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/BaseStep.js +8 -8
- package/dist/lib/Steps/BaseStep.js.map +1 -1
- package/dist/lib/Steps/ChooseIntegration.js +80 -125
- package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
- package/dist/lib/Steps/ConfigureProject.js +6 -66
- package/dist/lib/Steps/ConfigureProject.js.map +1 -1
- package/dist/lib/Steps/Initial.js +16 -104
- package/dist/lib/Steps/Initial.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.js +24 -118
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.js +95 -183
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.js +87 -145
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.js +40 -148
- package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
- package/dist/lib/Steps/OpenSentry.js +63 -126
- package/dist/lib/Steps/OpenSentry.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.js +110 -206
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/lib/Steps/Result.js +19 -79
- package/dist/lib/Steps/Result.js.map +1 -1
- package/dist/lib/Steps/SentryProjectSelector.js +57 -148
- package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
- package/dist/lib/Steps/ShouldConfigure.js +6 -66
- package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
- package/dist/lib/Steps/WaitForSentry.js +43 -120
- package/dist/lib/Steps/WaitForSentry.js.map +1 -1
- package/dist/lib/Steps/Welcome.js +17 -76
- package/dist/lib/Steps/Welcome.js.map +1 -1
- package/dist/lib/__tests__/Env.js +3 -3
- package/dist/lib/__tests__/Env.js.map +1 -1
- package/dist/src/android/android-wizard.js +100 -176
- package/dist/src/android/android-wizard.js.map +1 -1
- package/dist/src/android/code-tools.js +24 -33
- package/dist/src/android/code-tools.js.map +1 -1
- package/dist/src/android/gradle.js +106 -165
- package/dist/src/android/gradle.js.map +1 -1
- package/dist/src/android/manifest.js +26 -27
- package/dist/src/android/manifest.js.map +1 -1
- package/dist/src/android/templates.js +76 -23
- package/dist/src/android/templates.js.map +1 -1
- package/dist/src/apple/apple-wizard.js +129 -225
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/apple/cocoapod.js +47 -109
- package/dist/src/apple/cocoapod.js.map +1 -1
- package/dist/src/apple/code-tools.js +32 -35
- package/dist/src/apple/code-tools.js.map +1 -1
- package/dist/src/apple/fastlane.js +51 -97
- package/dist/src/apple/fastlane.js.map +1 -1
- package/dist/src/apple/templates.js +41 -5
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/apple/xcode-manager.d.ts +2 -2
- package/dist/src/apple/xcode-manager.js +93 -108
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/flutter/code-tools.js +79 -127
- package/dist/src/flutter/code-tools.js.map +1 -1
- package/dist/src/flutter/flutter-wizard.js +75 -136
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/flutter/templates.js +48 -12
- package/dist/src/flutter/templates.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +527 -805
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.js +380 -40
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nextjs/utils.js +5 -5
- package/dist/src/nextjs/utils.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.js +91 -188
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
- package/dist/src/nuxt/sdk-example.js +68 -137
- package/dist/src/nuxt/sdk-example.js.map +1 -1
- package/dist/src/nuxt/sdk-setup.d.ts +4 -4
- package/dist/src/nuxt/sdk-setup.js +180 -336
- package/dist/src/nuxt/sdk-setup.js.map +1 -1
- package/dist/src/nuxt/templates.js +195 -18
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/nuxt/utils.js +29 -76
- package/dist/src/nuxt/utils.js.map +1 -1
- package/dist/src/react-native/expo-env-file.js +41 -94
- package/dist/src/react-native/expo-env-file.js.map +1 -1
- package/dist/src/react-native/expo-metro.d.ts +1 -1
- package/dist/src/react-native/expo-metro.js +75 -130
- package/dist/src/react-native/expo-metro.js.map +1 -1
- package/dist/src/react-native/expo.js +61 -114
- package/dist/src/react-native/expo.js.map +1 -1
- package/dist/src/react-native/git.js +23 -56
- package/dist/src/react-native/git.js.map +1 -1
- package/dist/src/react-native/glob.js +3 -3
- package/dist/src/react-native/glob.js.map +1 -1
- package/dist/src/react-native/gradle.js +4 -4
- package/dist/src/react-native/gradle.js.map +1 -1
- package/dist/src/react-native/javascript.js +51 -95
- package/dist/src/react-native/javascript.js.map +1 -1
- package/dist/src/react-native/metro.js +176 -296
- package/dist/src/react-native/metro.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.js +267 -418
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-native/uninstall.js +37 -80
- package/dist/src/react-native/uninstall.js.map +1 -1
- package/dist/src/react-native/xcode.js +57 -55
- package/dist/src/react-native/xcode.js.map +1 -1
- package/dist/src/remix/codemods/express-server.js +27 -82
- package/dist/src/remix/codemods/express-server.js.map +1 -1
- package/dist/src/remix/codemods/handle-error.js +28 -31
- package/dist/src/remix/codemods/handle-error.js.map +1 -1
- package/dist/src/remix/codemods/root-common.js +11 -11
- package/dist/src/remix/codemods/root-common.js.map +1 -1
- package/dist/src/remix/codemods/root-v1.js +17 -67
- package/dist/src/remix/codemods/root-v1.js.map +1 -1
- package/dist/src/remix/codemods/root-v2.js +89 -140
- package/dist/src/remix/codemods/root-v2.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +181 -343
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/remix/sdk-example.js +84 -66
- package/dist/src/remix/sdk-example.js.map +1 -1
- package/dist/src/remix/sdk-setup.js +161 -293
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/remix/templates.js +10 -2
- package/dist/src/remix/templates.js.map +1 -1
- package/dist/src/remix/utils.js +13 -14
- package/dist/src/remix/utils.js.map +1 -1
- package/dist/src/run.js +106 -178
- package/dist/src/run.js.map +1 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.js +248 -372
- package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
- package/dist/src/sourcemaps/tools/angular.js +32 -66
- package/dist/src/sourcemaps/tools/angular.js.map +1 -1
- package/dist/src/sourcemaps/tools/create-react-app.js +14 -59
- package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -1
- package/dist/src/sourcemaps/tools/esbuild.js +34 -77
- package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
- package/dist/src/sourcemaps/tools/nextjs.d.ts +2 -2
- package/dist/src/sourcemaps/tools/nextjs.js +75 -102
- package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
- package/dist/src/sourcemaps/tools/remix.js +53 -93
- package/dist/src/sourcemaps/tools/remix.js.map +1 -1
- package/dist/src/sourcemaps/tools/rollup.js +35 -76
- package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
- package/dist/src/sourcemaps/tools/sentry-cli.js +157 -289
- package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
- package/dist/src/sourcemaps/tools/tsc.js +68 -134
- package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
- package/dist/src/sourcemaps/tools/vite.js +111 -196
- package/dist/src/sourcemaps/tools/vite.js.map +1 -1
- package/dist/src/sourcemaps/tools/webpack.d.ts +1 -1
- package/dist/src/sourcemaps/tools/webpack.js +158 -260
- package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
- package/dist/src/sourcemaps/utils/detect-tool.js +9 -54
- package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -1
- package/dist/src/sourcemaps/utils/other-wizards.js +77 -144
- package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -1
- package/dist/src/sourcemaps/utils/sdk-version.js +112 -191
- package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -1
- package/dist/src/sveltekit/sdk-example.js +20 -70
- package/dist/src/sveltekit/sdk-example.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup.js +250 -411
- package/dist/src/sveltekit/sdk-setup.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +107 -191
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/sveltekit/templates.js +147 -13
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/sveltekit/utils.js +3 -3
- package/dist/src/sveltekit/utils.js.map +1 -1
- package/dist/src/telemetry.d.ts +2 -2
- package/dist/src/telemetry.js +58 -108
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/utils/ast-utils.js +39 -54
- package/dist/src/utils/ast-utils.js.map +1 -1
- package/dist/src/utils/bash.js +28 -75
- package/dist/src/utils/bash.js.map +1 -1
- package/dist/src/utils/clack-utils.d.ts +3 -7
- package/dist/src/utils/clack-utils.js +688 -1083
- package/dist/src/utils/clack-utils.js.map +1 -1
- package/dist/src/utils/debug.js +6 -10
- package/dist/src/utils/debug.js.map +1 -1
- package/dist/src/utils/package-json.js +5 -6
- package/dist/src/utils/package-json.js.map +1 -1
- package/dist/src/utils/package-manager.js +65 -139
- package/dist/src/utils/package-manager.js.map +1 -1
- package/dist/src/utils/release-registry.js +12 -59
- package/dist/src/utils/release-registry.js.map +1 -1
- package/dist/src/utils/semver.js +3 -4
- package/dist/src/utils/semver.js.map +1 -1
- package/dist/src/utils/sentrycli-utils.js +4 -4
- package/dist/src/utils/sentrycli-utils.js.map +1 -1
- package/dist/src/utils/url.js +5 -6
- package/dist/src/utils/url.js.map +1 -1
- package/dist/test/android/code-tools.test.js +18 -18
- package/dist/test/android/code-tools.test.js.map +1 -1
- package/dist/test/apple/cocoapod.test.js +154 -299
- package/dist/test/apple/cocoapod.test.js.map +1 -1
- package/dist/test/apple/code-tools.test.js +375 -263
- package/dist/test/apple/code-tools.test.js.map +1 -1
- package/dist/test/apple/fastfile.test.js +319 -271
- package/dist/test/apple/fastfile.test.js.map +1 -1
- package/dist/test/apple/templates.test.js +114 -30
- package/dist/test/apple/templates.test.js.map +1 -1
- package/dist/test/apple/xcode-manager.test.js +230 -234
- package/dist/test/apple/xcode-manager.test.js.map +1 -1
- package/dist/test/flutter/code-tools.test.js +119 -48
- package/dist/test/flutter/code-tools.test.js.map +1 -1
- package/dist/test/flutter/templates.test.js +63 -20
- package/dist/test/flutter/templates.test.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +332 -43
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +161 -33
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/react-native/expo-metro.test.js +61 -15
- package/dist/test/react-native/expo-metro.test.js.map +1 -1
- package/dist/test/react-native/expo.test.js +37 -17
- package/dist/test/react-native/expo.test.js.map +1 -1
- package/dist/test/react-native/gradle.test.js +260 -28
- package/dist/test/react-native/gradle.test.js.map +1 -1
- package/dist/test/react-native/javascript.test.js +85 -19
- package/dist/test/react-native/javascript.test.js.map +1 -1
- package/dist/test/react-native/metro.test.js +261 -187
- package/dist/test/react-native/metro.test.js.map +1 -1
- package/dist/test/react-native/xcode.test.js +243 -62
- package/dist/test/react-native/xcode.test.js.map +1 -1
- package/dist/test/remix/client-entry.test.js +81 -21
- package/dist/test/remix/client-entry.test.js.map +1 -1
- package/dist/test/remix/server-instrumentation.test.js +21 -8
- package/dist/test/remix/server-instrumentation.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/sentry-cli.test.js +20 -72
- package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/tsc.test.js +142 -68
- package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/vite.test.js +106 -75
- package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/webpack.test.js +226 -102
- package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +117 -18
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/utils/ast-utils.test.js +99 -58
- package/dist/test/utils/ast-utils.test.js.map +1 -1
- package/dist/test/utils/clack-utils.test.js +142 -247
- package/dist/test/utils/clack-utils.test.js.map +1 -1
- package/e2e-tests/package.json +1 -1
- package/e2e-tests/tests/flutter.test.ts +20 -20
- package/e2e-tests/tests/nextjs.test.ts +2 -2
- package/e2e-tests/tests/nuxt-3.test.ts +4 -4
- package/e2e-tests/tests/nuxt-4.test.ts +3 -3
- package/e2e-tests/tests/remix.test.ts +3 -3
- package/e2e-tests/tests/sveltekit.test.ts +3 -3
- package/e2e-tests/utils/index.ts +33 -15
- package/lib/Helper/BottomBar.ts +1 -1
- package/lib/Helper/Env.ts +1 -1
- package/lib/Helper/Package.ts +12 -10
- package/lib/Helper/SentryCli.ts +18 -27
- package/lib/Helper/Wizard.ts +1 -2
- package/lib/Setup.ts +4 -5
- package/lib/Steps/ChooseIntegration.ts +40 -8
- package/lib/Steps/Initial.ts +17 -26
- package/lib/Steps/Integrations/BaseIntegration.ts +2 -8
- package/lib/Steps/Integrations/Cordova.ts +9 -15
- package/lib/Steps/Integrations/Electron.ts +23 -20
- package/lib/Steps/Integrations/MobileProject.ts +18 -15
- package/lib/Steps/OpenSentry.ts +12 -7
- package/lib/Steps/PromptForParameters.ts +12 -19
- package/lib/Steps/SentryProjectSelector.ts +30 -29
- package/lib/Steps/WaitForSentry.ts +29 -23
- package/package.json +12 -8
- package/src/apple/xcode-manager.ts +10 -10
- package/src/nextjs/templates.ts +2 -6
- package/src/nuxt/sdk-setup.ts +21 -18
- package/src/react-native/expo-metro.ts +2 -2
- package/src/react-native/react-native-wizard.ts +1 -2
- package/src/react-native/uninstall.ts +1 -2
- package/src/react-native/xcode.ts +1 -1
- package/src/run.ts +12 -5
- package/src/sourcemaps/tools/nextjs.ts +2 -5
- package/src/sourcemaps/tools/webpack.ts +3 -3
- package/src/telemetry.ts +27 -7
- package/src/utils/clack-utils.ts +50 -47
- package/test/apple/cocoapod.test.ts +4 -0
- package/test/apple/fastfile.test.ts +12 -7
- package/test/apple/xcode-manager.test.ts +13 -11
- package/test/nextjs/templates.test.ts +0 -12
- package/test/utils/clack-utils.test.ts +40 -50
- package/types/read-env.d.ts +3 -0
- package/types/xcode.d.ts +1 -0
- package/dist/package.json +0 -128
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MergeConfig.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/MergeConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"MergeConfig.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/MergeConfig.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,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,gDAAgD,EAAE,GAAG,EAAE;QAC1D,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;QAC1C,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAExC,MAAM,CAAC,IAAA,6BAAe,EAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC9C,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;QACtD,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAExC,IAAA,6BAAe,EAAC,UAAU,EAAE,YAAY,CAAC,CAAC;QAE1C,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CACjD,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CACpC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/// <reference types=\"jest\" />\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nimport { mergeConfigFile } from '../MergeConfig';\n\nconst configPath = path.join(__dirname, '..', 'test-fixtures/next.config.js');\nconst templatePath = path.join(\n __dirname,\n '..',\n '..',\n '..',\n 'scripts/NextJs/configs/next.config.template.js',\n);\n\nfunction configFileNames(num: number): {\n sourcePath: string;\n mergedPath: string;\n} {\n const sourcePath = path.join(\n __dirname,\n '..',\n `test-fixtures/next.config.${num}.js`,\n );\n const mergedPath = path.join(\n __dirname,\n '..',\n `test-fixtures/next.config.${num}-merged.js`,\n );\n return { sourcePath, mergedPath };\n}\n\ndescribe('Merging next.config.js', () => {\n afterEach(() => {\n fs.unlinkSync(configPath);\n });\n\n test('merge basic next.config.js return true', () => {\n const { sourcePath } = configFileNames(1);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge basic next.config.js', () => {\n const { sourcePath, mergedPath } = configFileNames(1);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(\n fs.readFileSync(mergedPath, 'utf8'),\n );\n });\n\n test('merge invalid javascript config return false', () => {\n const { sourcePath } = configFileNames(2);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(false);\n });\n\n test('merge more complicated next.config.js return true', () => {\n const { sourcePath } = configFileNames(3);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge more complicated next.config.js', () => {\n const { sourcePath, mergedPath } = configFileNames(3);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(\n fs.readFileSync(mergedPath, 'utf8'),\n );\n });\n\n test('merge next.config.js with function return true', () => {\n const { sourcePath } = configFileNames(4);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge next.config.js with function', () => {\n const { sourcePath, mergedPath } = configFileNames(4);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(\n fs.readFileSync(mergedPath, 'utf8'),\n );\n });\n});\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const Constants_1 = require("../../Constants");
|
|
4
|
+
const SentryCli_1 = require("../SentryCli");
|
|
5
|
+
const args = {
|
|
6
6
|
debug: false,
|
|
7
7
|
integration: Constants_1.Integration.reactNative,
|
|
8
8
|
platform: [Constants_1.Platform.ios],
|
|
@@ -13,7 +13,7 @@ var args = {
|
|
|
13
13
|
signup: false,
|
|
14
14
|
disableTelemetry: false,
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
const demoAnswers = {
|
|
17
17
|
config: {
|
|
18
18
|
auth: {
|
|
19
19
|
token: 'abcd',
|
|
@@ -26,44 +26,54 @@ var demoAnswers = {
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
|
-
describe('SentryCli',
|
|
30
|
-
test('convertAnswersToProperties',
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
describe('SentryCli', () => {
|
|
30
|
+
test('convertAnswersToProperties', () => {
|
|
31
|
+
const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');
|
|
32
|
+
const sentry = new SentryCli_1.SentryCli(args);
|
|
33
33
|
sentry.setResolveFunction(resolveFunc);
|
|
34
|
-
|
|
34
|
+
const props = sentry.convertAnswersToProperties(demoAnswers);
|
|
35
35
|
expect(props['defaults/url']).toBe('https://localhost:1234');
|
|
36
36
|
expect(props['defaults/org']).toBe('test_org');
|
|
37
37
|
expect(props['defaults/project']).toBe('test_proj');
|
|
38
38
|
expect(props['auth/token']).toBe('abcd');
|
|
39
39
|
expect(props['cli/executable']).toBe('node_modules/sentry/cli');
|
|
40
40
|
});
|
|
41
|
-
test('dump properties',
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
test('dump properties', () => {
|
|
42
|
+
const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');
|
|
43
|
+
const sentry = new SentryCli_1.SentryCli(args);
|
|
44
44
|
sentry.setResolveFunction(resolveFunc);
|
|
45
|
-
|
|
45
|
+
const props = sentry.convertAnswersToProperties(demoAnswers);
|
|
46
46
|
expect(sentry.dumpProperties(props))
|
|
47
|
-
.toBe(
|
|
47
|
+
.toBe(`defaults.url=https://localhost:1234
|
|
48
|
+
defaults.org=test_org
|
|
49
|
+
defaults.project=test_proj
|
|
50
|
+
auth.token=abcd
|
|
51
|
+
cli.executable=node_modules/sentry/cli
|
|
52
|
+
`);
|
|
48
53
|
});
|
|
49
|
-
test('convertAnswersToProperties windows',
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
test('convertAnswersToProperties windows', () => {
|
|
55
|
+
const resolveFunc = jest.fn().mockReturnValue('node_modules\\sentry\\cli');
|
|
56
|
+
const sentry = new SentryCli_1.SentryCli(args);
|
|
52
57
|
sentry.setResolveFunction(resolveFunc);
|
|
53
|
-
|
|
58
|
+
const props = sentry.convertAnswersToProperties(demoAnswers);
|
|
54
59
|
expect(props['defaults/url']).toBe('https://localhost:1234');
|
|
55
60
|
expect(props['defaults/org']).toBe('test_org');
|
|
56
61
|
expect(props['defaults/project']).toBe('test_proj');
|
|
57
62
|
expect(props['auth/token']).toBe('abcd');
|
|
58
63
|
expect(props['cli/executable']).toBe('node_modules\\\\sentry\\\\cli');
|
|
59
64
|
});
|
|
60
|
-
test('dump properties windows',
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
test('dump properties windows', () => {
|
|
66
|
+
const resolveFunc = jest.fn().mockReturnValue('node_modules\\sentry\\cli');
|
|
67
|
+
const sentry = new SentryCli_1.SentryCli(args);
|
|
63
68
|
sentry.setResolveFunction(resolveFunc);
|
|
64
|
-
|
|
69
|
+
const props = sentry.convertAnswersToProperties(demoAnswers);
|
|
65
70
|
expect(sentry.dumpProperties(props))
|
|
66
|
-
.toBe(
|
|
71
|
+
.toBe(`defaults.url=https://localhost:1234
|
|
72
|
+
defaults.org=test_org
|
|
73
|
+
defaults.project=test_proj
|
|
74
|
+
auth.token=abcd
|
|
75
|
+
cli.executable=node_modules\\\\sentry\\\\cli
|
|
76
|
+
`);
|
|
67
77
|
});
|
|
68
78
|
});
|
|
69
79
|
//# sourceMappingURL=SentryCli.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/SentryCli.ts"],"names":[],"mappings":";;AAIA
|
|
1
|
+
{"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/SentryCli.ts"],"names":[],"mappings":";;AAIA,+CAAwD;AACxD,4CAAyC;AAEzC,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,uBAAW,CAAC,WAAW;IACpC,QAAQ,EAAE,CAAC,oBAAQ,CAAC,GAAG,CAAC;IACxB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,GAAG,EAAE,wBAAwB;IAC7B,MAAM,EAAE,KAAK;IACb,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF,MAAM,WAAW,GAAY;IAC3B,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;SACd;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,UAAU;SACjB;QACD,OAAO,EAAE;YACP,IAAI,EAAE,WAAW;SAClB;KACF;CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAI,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACtC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;QACzE,MAAM,MAAM,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,MAAM,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CA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,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACnC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,2BAA2B,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,MAAM,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;QAC7D,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;aACjC,IAAI,CAAC;;;;;CAKX,CAAC,CAAC;IACD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/// <reference types=\"jest\" />\nimport type { Answers } from 'inquirer';\n\nimport type { Args } from '../../Constants';\nimport { Integration, Platform } from '../../Constants';\nimport { SentryCli } from '../SentryCli';\n\nconst args: Args = {\n debug: false,\n integration: Integration.reactNative,\n platform: [Platform.ios],\n quiet: false,\n skipConnect: false,\n uninstall: false,\n url: 'https://localhost:1234',\n signup: false,\n disableTelemetry: false,\n};\n\nconst demoAnswers: Answers = {\n config: {\n auth: {\n token: 'abcd',\n },\n organization: {\n slug: 'test_org',\n },\n project: {\n slug: 'test_proj',\n },\n },\n};\n\ndescribe('SentryCli', () => {\n test('convertAnswersToProperties', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(props['defaults/url']).toBe('https://localhost:1234');\n expect(props['defaults/org']).toBe('test_org');\n expect(props['defaults/project']).toBe('test_proj');\n expect(props['auth/token']).toBe('abcd');\n expect(props['cli/executable']).toBe('node_modules/sentry/cli');\n });\n\n test('dump properties', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(sentry.dumpProperties(props))\n .toBe(`defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules/sentry/cli\n`);\n });\n\n test('convertAnswersToProperties windows', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules\\\\sentry\\\\cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(props['defaults/url']).toBe('https://localhost:1234');\n expect(props['defaults/org']).toBe('test_org');\n expect(props['defaults/project']).toBe('test_proj');\n expect(props['auth/token']).toBe('abcd');\n expect(props['cli/executable']).toBe('node_modules\\\\\\\\sentry\\\\\\\\cli');\n });\n\n test('dump properties windows', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules\\\\sentry\\\\cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(sentry.dumpProperties(props))\n .toBe(`defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules\\\\\\\\sentry\\\\\\\\cli\n`);\n });\n});\n"]}
|
package/dist/lib/Setup.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -33,88 +22,37 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
33
22
|
__setModuleDefault(result, mod);
|
|
34
23
|
return result;
|
|
35
24
|
};
|
|
36
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
-
function step(op) {
|
|
50
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
52
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
53
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
-
switch (op[0]) {
|
|
55
|
-
case 0: case 1: t = op; break;
|
|
56
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
-
default:
|
|
60
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
-
if (t[2]) _.ops.pop();
|
|
65
|
-
_.trys.pop(); continue;
|
|
66
|
-
}
|
|
67
|
-
op = body.call(thisArg, _);
|
|
68
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
73
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
74
|
-
if (ar || !(i in from)) {
|
|
75
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
76
|
-
ar[i] = from[i];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
80
|
-
};
|
|
81
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
82
26
|
exports.run = void 0;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var Step = __importStar(require("./Steps"));
|
|
27
|
+
const debug_1 = require("../src/utils/debug");
|
|
28
|
+
const Env_1 = require("./Helper/Env");
|
|
29
|
+
const Wizard_1 = require("./Helper/Wizard");
|
|
30
|
+
const Step = __importStar(require("./Steps"));
|
|
88
31
|
/**
|
|
89
32
|
* @deprecated this function is the entry point to the old, step-based wizards located in `lib`.
|
|
90
33
|
* When creating new wizards, we now add them to clack-based wizards under `src`.
|
|
91
34
|
* Therefor, do not call this function anymore.
|
|
92
35
|
* Use `run` from {@link ../src/run.ts} instead.
|
|
93
36
|
*/
|
|
94
|
-
function run(argv) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
steps = _.concat(steps, Step.ConfigureProject, Step.Result);
|
|
115
|
-
return [2 /*return*/, Wizard_1.startWizard.apply(void 0, __spreadArray([args], steps, false))];
|
|
116
|
-
});
|
|
117
|
-
});
|
|
37
|
+
async function run(argv) {
|
|
38
|
+
const args = { ...argv, ...(0, Env_1.readEnvironment)() };
|
|
39
|
+
if (argv.debug) {
|
|
40
|
+
(0, debug_1.enableDebugLogs)();
|
|
41
|
+
}
|
|
42
|
+
if (args.uninstall === undefined) {
|
|
43
|
+
args.uninstall = false;
|
|
44
|
+
}
|
|
45
|
+
const steps = [
|
|
46
|
+
Step.Initial,
|
|
47
|
+
Step.Welcome,
|
|
48
|
+
Step.ChooseIntegration,
|
|
49
|
+
Step.ShouldConfigure,
|
|
50
|
+
];
|
|
51
|
+
if (args.uninstall === false) {
|
|
52
|
+
steps.push(Step.OpenSentry, Step.WaitForSentry, Step.SentryProjectSelector, Step.PromptForParameters);
|
|
53
|
+
}
|
|
54
|
+
steps.push(Step.ConfigureProject, Step.Result);
|
|
55
|
+
return (0, Wizard_1.startWizard)(args, ...steps);
|
|
118
56
|
}
|
|
119
57
|
exports.run = run;
|
|
120
58
|
//# sourceMappingURL=Setup.js.map
|
package/dist/lib/Setup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Setup.js","sourceRoot":"","sources":["../../lib/Setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Setup.js","sourceRoot":"","sources":["../../lib/Setup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAqD;AAErD,sCAA+C;AAC/C,4CAA8C;AAC9C,8CAAgC;AAEhC;;;;;GAKG;AACI,KAAK,UAAU,GAAG,CAAC,IAAS;IACjC,MAAM,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,IAAA,qBAAe,GAAE,EAAE,CAAC;IAE/C,IAAI,IAAI,CAAC,KAAK,EAAE;QACd,IAAA,uBAAe,GAAE,CAAC;KACnB;IAED,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;QAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;KACxB;IACD,MAAM,KAAK,GAAG;QACZ,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,iBAAiB;QACtB,IAAI,CAAC,eAAe;KACrB,CAAC;IACF,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,EAAE;QAC5B,KAAK,CAAC,IAAI,CACR,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,qBAAqB,EAC1B,IAAI,CAAC,mBAAmB,CACzB,CAAC;KACH;IACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAE/C,OAAO,IAAA,oBAAW,EAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;AACrC,CAAC;AA3BD,kBA2BC","sourcesContent":["import { enableDebugLogs } from '../src/utils/debug';\n\nimport { readEnvironment } from './Helper/Env';\nimport { startWizard } from './Helper/Wizard';\nimport * as Step from './Steps';\n\n/**\n * @deprecated this function is the entry point to the old, step-based wizards located in `lib`.\n * When creating new wizards, we now add them to clack-based wizards under `src`.\n * Therefor, do not call this function anymore.\n * Use `run` from {@link ../src/run.ts} instead.\n */\nexport async function run(argv: any): Promise<any> {\n const args = { ...argv, ...readEnvironment() };\n\n if (argv.debug) {\n enableDebugLogs();\n }\n\n if (args.uninstall === undefined) {\n args.uninstall = false;\n }\n const steps = [\n Step.Initial,\n Step.Welcome,\n Step.ChooseIntegration,\n Step.ShouldConfigure,\n ];\n if (args.uninstall === false) {\n steps.push(\n Step.OpenSentry,\n Step.WaitForSentry,\n Step.SentryProjectSelector,\n Step.PromptForParameters,\n );\n }\n steps.push(Step.ConfigureProject, Step.Result);\n\n return startWizard(args, ...steps);\n}\n"]}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseStep = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const Logging_1 = require("../Helper/Logging");
|
|
5
|
+
class BaseStep {
|
|
6
|
+
_argv;
|
|
7
|
+
_isDebug = false;
|
|
8
|
+
constructor(_argv) {
|
|
7
9
|
this._argv = _argv;
|
|
8
|
-
this._isDebug = false;
|
|
9
10
|
this._isDebug = _argv.debug;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
debug(msg) {
|
|
12
13
|
if (this._isDebug) {
|
|
13
14
|
(0, Logging_1.nl)();
|
|
14
15
|
(0, Logging_1.debug)(msg);
|
|
15
16
|
(0, Logging_1.nl)();
|
|
16
17
|
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
}());
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
20
|
exports.BaseStep = BaseStep;
|
|
21
21
|
//# sourceMappingURL=BaseStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseStep.js","sourceRoot":"","sources":["../../../lib/Steps/BaseStep.ts"],"names":[],"mappings":";;;AAGA
|
|
1
|
+
{"version":3,"file":"BaseStep.js","sourceRoot":"","sources":["../../../lib/Steps/BaseStep.ts"],"names":[],"mappings":";;;AAGA,+CAA8C;AAE9C,MAAsB,QAAQ;IAEC;IADnB,QAAQ,GAAG,KAAK,CAAC;IAC3B,YAA6B,KAAW;QAAX,UAAK,GAAL,KAAK,CAAM;QACtC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;IAC9B,CAAC;IAEM,KAAK,CAAC,GAAQ;QACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAA,YAAE,GAAE,CAAC;YACL,IAAA,eAAK,EAAC,GAAG,CAAC,CAAC;YACX,IAAA,YAAE,GAAE,CAAC;SACN;IACH,CAAC;CAGF;AAfD,4BAeC","sourcesContent":["import type { Answers } from 'inquirer';\n\nimport type { Args } from '../Constants';\nimport { debug, nl } from '../Helper/Logging';\n\nexport abstract class BaseStep implements IStep {\n protected _isDebug = false;\n public constructor(protected _argv: Args) {\n this._isDebug = _argv.debug;\n }\n\n public debug(msg: any): void {\n if (this._isDebug) {\n nl();\n debug(msg);\n nl();\n }\n }\n\n public abstract emit(answers: Answers): Promise<Answers>;\n}\n\nexport interface IStep {\n emit(answers?: Answers): Promise<Answers>;\n}\n"]}
|
|
@@ -1,100 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
3
|
exports.ChooseIntegration = void 0;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
4
|
+
const inquirer_1 = require("inquirer");
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const package_json_1 = require("../../src/utils/package-json");
|
|
7
|
+
const Constants_1 = require("../Constants");
|
|
8
|
+
const Logging_1 = require("../Helper/Logging");
|
|
9
|
+
const BaseStep_1 = require("./BaseStep");
|
|
10
|
+
const Cordova_1 = require("./Integrations/Cordova");
|
|
11
|
+
const Electron_1 = require("./Integrations/Electron");
|
|
12
|
+
function getProjectPackage() {
|
|
13
|
+
let projectPackage = {};
|
|
14
|
+
const projectPackagePathCandidates = [
|
|
15
|
+
// If we run directly in setup-wizard
|
|
16
|
+
'../../package.json',
|
|
17
|
+
// If we run from the CLI
|
|
18
|
+
`${process.cwd()}/package.json`,
|
|
19
|
+
];
|
|
20
|
+
for (const pathCandidate of projectPackagePathCandidates) {
|
|
21
|
+
let data;
|
|
22
|
+
try {
|
|
23
|
+
data = (0, node_fs_1.readFileSync)(pathCandidate, 'utf-8');
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
// If the file does not exist, continue to the next candidate
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
projectPackage = JSON.parse(data);
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
// If the file exists but is not valid JSON, log an error and continue.
|
|
35
|
+
// Note: we don't want to crash the wizard if the package.json is invalid,
|
|
36
|
+
// because it is only use by the integration detection logic.
|
|
37
|
+
// Furthmore other package managers, i.e. bun, allow JSON-with-comments which might
|
|
38
|
+
// throw errors with JSON.parse, and will require a different JSON parser in the future.
|
|
39
|
+
(0, Logging_1.red)(`Failed to parse JSON from ${pathCandidate}, is your file a valid package.json?`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return projectPackage;
|
|
69
43
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
44
|
+
class ChooseIntegration extends BaseStep_1.BaseStep {
|
|
45
|
+
async emit(_answers) {
|
|
46
|
+
const integrationPrompt = await this._getIntegrationPromptSelection();
|
|
47
|
+
let integration = null;
|
|
48
|
+
switch (integrationPrompt.integration) {
|
|
49
|
+
case Constants_1.Integration.cordova:
|
|
50
|
+
integration = new Cordova_1.Cordova(sanitizeUrl(this._argv));
|
|
51
|
+
break;
|
|
52
|
+
case Constants_1.Integration.electron:
|
|
53
|
+
integration = new Electron_1.Electron(sanitizeUrl(this._argv));
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
return { integration };
|
|
74
57
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var integrationPrompt, integration;
|
|
78
|
-
return __generator(this, function (_a) {
|
|
79
|
-
switch (_a.label) {
|
|
80
|
-
case 0: return [4 /*yield*/, this._getIntegrationPromptSelection()];
|
|
81
|
-
case 1:
|
|
82
|
-
integrationPrompt = _a.sent();
|
|
83
|
-
integration = null;
|
|
84
|
-
switch (integrationPrompt.integration) {
|
|
85
|
-
case Constants_1.Integration.cordova:
|
|
86
|
-
integration = new Cordova_1.Cordova(sanitizeUrl(this._argv));
|
|
87
|
-
break;
|
|
88
|
-
case Constants_1.Integration.electron:
|
|
89
|
-
integration = new Electron_1.Electron(sanitizeUrl(this._argv));
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
return [2 /*return*/, { integration: integration }];
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
ChooseIntegration.prototype.tryDetectingIntegration = function () {
|
|
58
|
+
tryDetectingIntegration() {
|
|
59
|
+
const projectPackage = getProjectPackage();
|
|
98
60
|
if ((0, package_json_1.hasPackageInstalled)('react-native', projectPackage)) {
|
|
99
61
|
return Constants_1.Integration.reactNative;
|
|
100
62
|
}
|
|
@@ -114,37 +76,30 @@ var ChooseIntegration = /** @class */ (function (_super) {
|
|
|
114
76
|
return Constants_1.Integration.sveltekit;
|
|
115
77
|
}
|
|
116
78
|
return;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
return [2 /*return*/];
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
return ChooseIntegration;
|
|
147
|
-
}(BaseStep_1.BaseStep));
|
|
79
|
+
}
|
|
80
|
+
async _getIntegrationPromptSelection() {
|
|
81
|
+
// If we receive project type as an arg we skip asking
|
|
82
|
+
if (this._argv.integration) {
|
|
83
|
+
return { integration: this._argv.integration };
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
if (this._argv.quiet) {
|
|
87
|
+
throw new Error('You need to choose a platform');
|
|
88
|
+
}
|
|
89
|
+
const detectedDefaultSelection = this.tryDetectingIntegration();
|
|
90
|
+
return (0, inquirer_1.prompt)([
|
|
91
|
+
{
|
|
92
|
+
choices: (0, Constants_1.getIntegrationChoices)(),
|
|
93
|
+
default: detectedDefaultSelection,
|
|
94
|
+
message: 'What platform do you want to set up?',
|
|
95
|
+
name: 'integration',
|
|
96
|
+
type: 'list',
|
|
97
|
+
pageSize: 10,
|
|
98
|
+
},
|
|
99
|
+
]);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
148
103
|
exports.ChooseIntegration = ChooseIntegration;
|
|
149
104
|
/**
|
|
150
105
|
* For the `clack`-based wizard flows, which we only shim here, we don't set
|
|
@@ -154,10 +109,10 @@ exports.ChooseIntegration = ChooseIntegration;
|
|
|
154
109
|
function sanitizeUrl(argv) {
|
|
155
110
|
if (!argv.url) {
|
|
156
111
|
argv.url = Constants_1.DEFAULT_URL;
|
|
157
|
-
(0, Logging_1.dim)(
|
|
112
|
+
(0, Logging_1.dim)(`no URL provided, fallback to ${argv.url}`);
|
|
158
113
|
return argv;
|
|
159
114
|
}
|
|
160
|
-
|
|
115
|
+
let baseUrl = argv.url;
|
|
161
116
|
baseUrl += baseUrl.endsWith('/') ? '' : '/';
|
|
162
117
|
baseUrl = baseUrl.replace(/:\/(?!\/)/g, '://');
|
|
163
118
|
argv.url = baseUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChooseIntegration.js","sourceRoot":"","sources":["../../../lib/Steps/ChooseIntegration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChooseIntegration.js","sourceRoot":"","sources":["../../../lib/Steps/ChooseIntegration.ts"],"names":[],"mappings":";;;AACA,uCAAkC;AAElC,qCAAuC;AACvC,+DAAmE;AACnE,4CAKsB;AACtB,+CAA6C;AAC7C,yCAAsC;AACtC,oDAAiD;AACjD,sDAAmD;AAEnD,SAAS,iBAAiB;IACxB,IAAI,cAAc,GAA4B,EAAE,CAAC;IAEjD,MAAM,4BAA4B,GAAG;QACnC,qCAAqC;QACrC,oBAAoB;QAEpB,yBAAyB;QACzB,GAAG,OAAO,CAAC,GAAG,EAAE,eAAe;KAChC,CAAC;IAEF,KAAK,MAAM,aAAa,IAAI,4BAA4B,EAAE;QACxD,IAAI,IAAY,CAAC;QACjB,IAAI;YACF,IAAI,GAAG,IAAA,sBAAY,EAAC,aAAa,EAAE,OAAO,CAAC,CAAC;SAC7C;QAAC,OAAO,KAAK,EAAE;YACd,6DAA6D;YAC7D,SAAS;SACV;QAED,IAAI;YACF,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAA4B,CAAC;YAC7D,MAAM;SACP;QAAC,OAAO,KAAK,EAAE;YACd,uEAAuE;YACvE,0EAA0E;YAC1E,6DAA6D;YAC7D,mFAAmF;YACnF,wFAAwF;YACxF,IAAA,aAAG,EACD,6BAA6B,aAAa,sCAAsC,CACjF,CAAC;SACH;KACF;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AAMD,MAAa,iBAAkB,SAAQ,mBAAQ;IACtC,KAAK,CAAC,IAAI,CAAC,QAAiB;QACjC,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,8BAA8B,EAAE,CAAC;QAEtE,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,Q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SAChD;aAAM;YACL,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;gBACpB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;aAClD;YAED,MAAM,wBAAwB,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC;YAEhE,OAAO,IAAA,iBAAM,EAAC;gBACZ;oBACE,OAAO,EAAE,IAAA,iCAAqB,GAAE;oBAChC,OAAO,EAAE,wBAAwB;oBACjC,OAAO,EAAE,sCAAsC;oBAC/C,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,EAAE;iBACb;aACF,CAAC,CAAC;SACJ;IACH,CAAC;CACF;AAjED,8CAiEC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAU;IAC7B,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,GAAG,uBAAW,CAAC;QACvB,IAAA,aAAG,EAAC,gCAAgC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;IACvB,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC;IAEnB,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\n\nimport { readFileSync } from 'node:fs';\nimport { hasPackageInstalled } from '../../src/utils/package-json';\nimport {\n Args,\n DEFAULT_URL,\n getIntegrationChoices,\n Integration,\n} from '../Constants';\nimport { dim, red } from '../Helper/Logging';\nimport { BaseStep } from './BaseStep';\nimport { Cordova } from './Integrations/Cordova';\nimport { Electron } from './Integrations/Electron';\n\nfunction getProjectPackage(): Record<string, unknown> {\n let projectPackage: Record<string, unknown> = {};\n\n const projectPackagePathCandidates = [\n // If we run directly in setup-wizard\n '../../package.json',\n\n // If we run from the CLI\n `${process.cwd()}/package.json`,\n ];\n\n for (const pathCandidate of projectPackagePathCandidates) {\n let data: string;\n try {\n data = readFileSync(pathCandidate, 'utf-8');\n } catch (error) {\n // If the file does not exist, continue to the next candidate\n continue;\n }\n\n try {\n projectPackage = JSON.parse(data) as Record<string, unknown>;\n break;\n } catch (error) {\n // If the file exists but is not valid JSON, log an error and continue.\n // Note: we don't want to crash the wizard if the package.json is invalid,\n // because it is only use by the integration detection logic.\n // Furthmore other package managers, i.e. bun, allow JSON-with-comments which might\n // throw errors with JSON.parse, and will require a different JSON parser in the future.\n red(\n `Failed to parse JSON from ${pathCandidate}, is your file a valid package.json?`,\n );\n }\n }\n\n return projectPackage;\n}\n\ntype IntegrationPromptAnswer = {\n integration: Integration;\n};\n\nexport class ChooseIntegration extends BaseStep {\n public async emit(_answers: Answers): Promise<Answers> {\n const integrationPrompt = await this._getIntegrationPromptSelection();\n\n let integration = null;\n switch (integrationPrompt.integration) {\n case Integration.cordova:\n integration = new Cordova(sanitizeUrl(this._argv));\n break;\n case Integration.electron:\n integration = new Electron(sanitizeUrl(this._argv));\n break;\n }\n\n return { integration };\n }\n\n public tryDetectingIntegration(): Integration | undefined {\n const projectPackage = getProjectPackage();\n\n if (hasPackageInstalled('react-native', projectPackage)) {\n return Integration.reactNative;\n }\n if (hasPackageInstalled('cordova', projectPackage)) {\n return Integration.cordova;\n }\n if (hasPackageInstalled('electron', projectPackage)) {\n return Integration.electron;\n }\n if (hasPackageInstalled('next', projectPackage)) {\n return Integration.nextjs;\n }\n if (hasPackageInstalled('remix-run', projectPackage)) {\n return Integration.remix;\n }\n if (hasPackageInstalled('@sveltejs/kit', projectPackage)) {\n return Integration.sveltekit;\n }\n\n return;\n }\n\n private async _getIntegrationPromptSelection(): Promise<IntegrationPromptAnswer> {\n // If we receive project type as an arg we skip asking\n if (this._argv.integration) {\n return { integration: this._argv.integration };\n } else {\n if (this._argv.quiet) {\n throw new Error('You need to choose a platform');\n }\n\n const detectedDefaultSelection = this.tryDetectingIntegration();\n\n return prompt([\n {\n choices: getIntegrationChoices(),\n default: detectedDefaultSelection,\n message: 'What platform do you want to set up?',\n name: 'integration',\n type: 'list',\n pageSize: 10,\n },\n ]);\n }\n }\n}\n\n/**\n * For the `clack`-based wizard flows, which we only shim here, we don't set\n * a default url value. For backwards-compatibility with the other flows,\n * we fill it here and sanitize a user-enterd url.\n */\nfunction sanitizeUrl(argv: Args): Args {\n if (!argv.url) {\n argv.url = DEFAULT_URL;\n dim(`no URL provided, fallback to ${argv.url}`);\n return argv;\n }\n\n let baseUrl = argv.url;\n baseUrl += baseUrl.endsWith('/') ? '' : '/';\n baseUrl = baseUrl.replace(/:\\/(?!\\/)/g, '://');\n argv.url = baseUrl;\n\n return argv;\n}\n"]}
|