@sentry/wizard 3.42.1 → 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 +26 -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 -3
- 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 -2
- 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/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,8 +1,7 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
2
|
import type { Answers } from 'inquirer';
|
|
3
3
|
import { prompt } from 'inquirer';
|
|
4
|
-
import * as
|
|
5
|
-
import * as path from 'path';
|
|
4
|
+
import * as path from 'node:path';
|
|
6
5
|
|
|
7
6
|
import type { Args } from '../../Constants';
|
|
8
7
|
import { dim, green, l, nl, red } from '../../Helper/Logging';
|
|
@@ -31,7 +30,11 @@ const Sentry = require('@sentry/electron/renderer');
|
|
|
31
30
|
|
|
32
31
|
Sentry.init({});`;
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
type PackageJSON = {
|
|
34
|
+
dependencies?: Record<string, string>;
|
|
35
|
+
devDependencies?: Record<string, string>;
|
|
36
|
+
};
|
|
37
|
+
let appPackage: PackageJSON = {};
|
|
35
38
|
|
|
36
39
|
function printExample(example: string, title = ''): void {
|
|
37
40
|
if (title) {
|
|
@@ -44,7 +47,9 @@ function printExample(example: string, title = ''): void {
|
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
try {
|
|
47
|
-
appPackage =
|
|
50
|
+
appPackage = JSON.parse(
|
|
51
|
+
fs.readFileSync(path.join(process.cwd(), 'package.json'), 'utf-8'),
|
|
52
|
+
) as PackageJSON;
|
|
48
53
|
} catch {
|
|
49
54
|
// We don't need to have this
|
|
50
55
|
}
|
|
@@ -59,7 +64,7 @@ export class Electron extends BaseIntegration {
|
|
|
59
64
|
|
|
60
65
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
61
66
|
public async emit(answers: Answers): Promise<Answers> {
|
|
62
|
-
const dsn =
|
|
67
|
+
const dsn = answers.config?.dsn?.public ?? null;
|
|
63
68
|
nl();
|
|
64
69
|
|
|
65
70
|
const sentryCliProps = this._sentryCli.convertAnswersToProperties(answers);
|
|
@@ -112,7 +117,7 @@ export class Electron extends BaseIntegration {
|
|
|
112
117
|
|
|
113
118
|
nl();
|
|
114
119
|
|
|
115
|
-
if (!
|
|
120
|
+
if (!continued?.continue) {
|
|
116
121
|
throw new Error('Please install the required dependencies to continue.');
|
|
117
122
|
}
|
|
118
123
|
|
|
@@ -123,25 +128,23 @@ export class Electron extends BaseIntegration {
|
|
|
123
128
|
|
|
124
129
|
private _checkDep(packageName: string, minVersion?: string): boolean {
|
|
125
130
|
const depVersion = parseInt(
|
|
126
|
-
|
|
131
|
+
(appPackage.dependencies?.[packageName] || '0').replace(/\D+/g, ''),
|
|
127
132
|
10,
|
|
128
133
|
);
|
|
129
134
|
const devDepVersion = parseInt(
|
|
130
|
-
|
|
131
|
-
/\D+/g,
|
|
132
|
-
'',
|
|
133
|
-
),
|
|
135
|
+
(appPackage.devDependencies?.[packageName] || '0').replace(/\D+/g, ''),
|
|
134
136
|
10,
|
|
135
137
|
);
|
|
136
138
|
|
|
137
139
|
if (
|
|
138
|
-
!
|
|
139
|
-
!
|
|
140
|
+
!appPackage.dependencies?.[packageName] &&
|
|
141
|
+
!appPackage.devDependencies?.[packageName]
|
|
140
142
|
) {
|
|
141
143
|
red(`✗ ${packageName} isn't in your dependencies`);
|
|
142
144
|
red(' please install it with yarn/npm');
|
|
143
145
|
return false;
|
|
144
|
-
}
|
|
146
|
+
}
|
|
147
|
+
if (
|
|
145
148
|
minVersion &&
|
|
146
149
|
depVersion < MIN_ELECTRON_VERSION &&
|
|
147
150
|
devDepVersion < MIN_ELECTRON_VERSION
|
|
@@ -150,12 +153,12 @@ export class Electron extends BaseIntegration {
|
|
|
150
153
|
`✗ Your installed version of ${packageName} is to old, >${MIN_ELECTRON_VERSION_STRING} needed`,
|
|
151
154
|
);
|
|
152
155
|
return false;
|
|
156
|
+
}
|
|
157
|
+
if (minVersion) {
|
|
158
|
+
green(`✓ ${packageName} > ${minVersion} is installed`);
|
|
153
159
|
} else {
|
|
154
|
-
|
|
155
|
-
minVersion
|
|
156
|
-
? green(`✓ ${packageName} > ${minVersion} is installed`)
|
|
157
|
-
: green(`✓ ${packageName} is installed`);
|
|
158
|
-
return true;
|
|
160
|
+
green(`✓ ${packageName} is installed`);
|
|
159
161
|
}
|
|
162
|
+
return true;
|
|
160
163
|
}
|
|
161
164
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Answers } from 'inquirer';
|
|
2
2
|
import { prompt } from 'inquirer';
|
|
3
|
-
import * as _ from 'lodash';
|
|
4
3
|
|
|
5
4
|
import { getPlatformChoices, Platform } from '../../Constants';
|
|
6
5
|
import { dim } from '../../Helper/Logging';
|
|
@@ -10,19 +9,24 @@ export abstract class MobileProject extends BaseIntegration {
|
|
|
10
9
|
protected _platforms: Platform[];
|
|
11
10
|
|
|
12
11
|
public getPlatforms(answers: Answers): string[] {
|
|
13
|
-
if (!
|
|
12
|
+
if (!answers.shouldConfigurePlatforms) {
|
|
14
13
|
throw new Error('No platform selected');
|
|
15
14
|
}
|
|
16
|
-
const shouldConfigurePlatforms =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const shouldConfigurePlatforms =
|
|
16
|
+
answers.shouldConfigurePlatforms as Partial<Record<Platform, boolean>>;
|
|
17
|
+
return Object.entries(shouldConfigurePlatforms)
|
|
18
|
+
.filter((pair) => pair[1])
|
|
19
|
+
.map((pair) => pair[0]); // only return the keys
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
public async shouldConfigure(answers: Answers): Promise<Answers> {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
let { shouldConfigurePlatforms } = answers as {
|
|
24
|
+
shouldConfigurePlatforms?: Partial<Record<Platform, boolean>>;
|
|
25
|
+
};
|
|
26
|
+
if (shouldConfigurePlatforms) {
|
|
27
|
+
return { shouldConfigurePlatforms };
|
|
25
28
|
}
|
|
29
|
+
|
|
26
30
|
const isPlatformSet =
|
|
27
31
|
this._argv.platform &&
|
|
28
32
|
Array.isArray(this._argv.platform) &&
|
|
@@ -32,20 +36,19 @@ export abstract class MobileProject extends BaseIntegration {
|
|
|
32
36
|
? this._argv.platform
|
|
33
37
|
: (await this._platformSelector()).platform;
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
shouldConfigurePlatforms = {};
|
|
36
40
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
37
|
-
|
|
38
|
-
shouldConfigurePlatforms[platform] =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
: false;
|
|
41
|
+
for (const platform of Object.values(Platform)) {
|
|
42
|
+
shouldConfigurePlatforms[platform] = this._platforms.includes(platform)
|
|
43
|
+
? await this._shouldConfigurePlatform(platform)
|
|
44
|
+
: false;
|
|
42
45
|
if (
|
|
43
46
|
shouldConfigurePlatforms[platform] === false &&
|
|
44
47
|
this._argv.uninstall === false
|
|
45
48
|
) {
|
|
46
49
|
dim(`will not configure ${platform}`);
|
|
47
50
|
}
|
|
48
|
-
}
|
|
51
|
+
}
|
|
49
52
|
return { shouldConfigurePlatforms };
|
|
50
53
|
}
|
|
51
54
|
|
package/lib/Steps/OpenSentry.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { URL } from 'node:url';
|
|
1
2
|
import type { Answers } from 'inquirer';
|
|
2
|
-
import { URL } from 'url';
|
|
3
3
|
|
|
4
4
|
import { mapIntegrationToPlatform } from '../Constants';
|
|
5
5
|
import { BottomBar } from '../Helper/BottomBar';
|
|
@@ -7,8 +7,7 @@ import { dim, green, l, nl, red } from '../Helper/Logging';
|
|
|
7
7
|
import { getCurrentIntegration } from '../Helper/Wizard';
|
|
8
8
|
import { BaseStep } from './BaseStep';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
const r2 = require('r2');
|
|
10
|
+
import opn from 'opn';
|
|
12
11
|
|
|
13
12
|
export class OpenSentry extends BaseStep {
|
|
14
13
|
public async emit(answers: Answers): Promise<Answers> {
|
|
@@ -27,7 +26,13 @@ export class OpenSentry extends BaseStep {
|
|
|
27
26
|
this.debug(`Loading wizard for ${baseUrl}`);
|
|
28
27
|
|
|
29
28
|
try {
|
|
30
|
-
const
|
|
29
|
+
const response = await fetch(`${baseUrl}api/0/wizard/`);
|
|
30
|
+
if (!response.ok) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`Failed to connect to Sentry: ${response.status} ${response.statusText}`,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
const data = (await response.json()) as { hash: string };
|
|
31
36
|
|
|
32
37
|
BottomBar.hide();
|
|
33
38
|
|
|
@@ -48,9 +53,9 @@ export class OpenSentry extends BaseStep {
|
|
|
48
53
|
|
|
49
54
|
const urlToOpen = urlObj.toString();
|
|
50
55
|
|
|
51
|
-
opn
|
|
52
|
-
|
|
53
|
-
});
|
|
56
|
+
// opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here
|
|
57
|
+
const noop = () => {}; // eslint-disable-line @typescript-eslint/no-empty-function
|
|
58
|
+
opn(urlToOpen, { wait: false }).then((cp) => cp.on('error', noop), noop);
|
|
54
59
|
|
|
55
60
|
nl();
|
|
56
61
|
l('Please open');
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Answers } from 'inquirer';
|
|
2
2
|
import { prompt } from 'inquirer';
|
|
3
|
-
import * as _ from 'lodash';
|
|
4
3
|
|
|
5
4
|
import { dim } from '../Helper/Logging';
|
|
6
5
|
import { getCurrentIntegration } from '../Helper/Wizard';
|
|
@@ -80,12 +79,13 @@ export class PromptForParameters extends BaseStep {
|
|
|
80
79
|
]);
|
|
81
80
|
|
|
82
81
|
return {
|
|
83
|
-
config:
|
|
82
|
+
config: {
|
|
83
|
+
...answers.config,
|
|
84
84
|
auth,
|
|
85
85
|
dsn,
|
|
86
86
|
project,
|
|
87
87
|
organization,
|
|
88
|
-
}
|
|
88
|
+
},
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -95,26 +95,19 @@ export class PromptForParameters extends BaseStep {
|
|
|
95
95
|
projectSlug?: string,
|
|
96
96
|
): string {
|
|
97
97
|
const baseUrl = this._argv.url;
|
|
98
|
-
const orgSlug =
|
|
99
|
-
answers
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
answers,
|
|
105
|
-
'config.project.slug',
|
|
106
|
-
projectSlug || 'project_slug',
|
|
107
|
-
);
|
|
98
|
+
const orgSlug =
|
|
99
|
+
answers.config?.organization?.slug ??
|
|
100
|
+
organizationSlug ??
|
|
101
|
+
'organization_slug';
|
|
102
|
+
const projSlug =
|
|
103
|
+
answers.config?.project?.slug ?? projectSlug ?? 'project_slug';
|
|
108
104
|
return `${baseUrl}${orgSlug}/${projSlug}`;
|
|
109
105
|
}
|
|
110
106
|
|
|
111
107
|
private _getDSNKeyUrl(answers: Answers, projectSlug?: string): string {
|
|
112
108
|
const baseUrl = this._argv.url;
|
|
113
|
-
const projSlug =
|
|
114
|
-
answers
|
|
115
|
-
'config.project.slug',
|
|
116
|
-
projectSlug || 'project_slug',
|
|
117
|
-
);
|
|
109
|
+
const projSlug =
|
|
110
|
+
answers.config?.project?.slug ?? projectSlug ?? 'project_slug';
|
|
118
111
|
return `${baseUrl}settings/projects/${projSlug}/keys`;
|
|
119
112
|
}
|
|
120
113
|
|
|
@@ -123,7 +116,7 @@ export class PromptForParameters extends BaseStep {
|
|
|
123
116
|
configKey: string,
|
|
124
117
|
preHook?: () => void,
|
|
125
118
|
): boolean {
|
|
126
|
-
const shouldAsk =
|
|
119
|
+
const shouldAsk = answers[configKey] != null;
|
|
127
120
|
if (shouldAsk && preHook) {
|
|
128
121
|
preHook();
|
|
129
122
|
}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import type { Answers } from 'inquirer';
|
|
2
2
|
import { prompt } from 'inquirer';
|
|
3
|
-
import * as _ from 'lodash';
|
|
4
3
|
|
|
5
4
|
import { BaseStep } from './BaseStep';
|
|
6
5
|
|
|
6
|
+
type Project = {
|
|
7
|
+
id: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
organization?: {
|
|
10
|
+
name: string;
|
|
11
|
+
slug: string;
|
|
12
|
+
};
|
|
13
|
+
keys: {
|
|
14
|
+
dsn: {
|
|
15
|
+
public: string;
|
|
16
|
+
private: string;
|
|
17
|
+
};
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
|
|
7
21
|
function sleep(n: number): Promise<void> {
|
|
8
22
|
return new Promise((resolve) => setTimeout(resolve, n));
|
|
9
23
|
}
|
|
@@ -12,23 +26,22 @@ export class SentryProjectSelector extends BaseStep {
|
|
|
12
26
|
public async emit(answers: Answers): Promise<any> {
|
|
13
27
|
this.debug(answers);
|
|
14
28
|
|
|
15
|
-
if (!
|
|
29
|
+
if (!answers.wizard) {
|
|
16
30
|
// we skip this completely because the wizard wasn't running
|
|
17
31
|
return {};
|
|
18
32
|
}
|
|
19
33
|
|
|
20
|
-
if (
|
|
21
|
-
_.has(answers, 'wizard.projects') &&
|
|
22
|
-
answers.wizard.projects.length === 0
|
|
23
|
-
) {
|
|
34
|
+
if (!answers.wizard.projects || answers.wizard.projects.length === 0) {
|
|
24
35
|
throw new Error(
|
|
25
36
|
'No Projects found. Please create a new Project in Sentry and try again.',
|
|
26
37
|
);
|
|
27
38
|
}
|
|
28
39
|
|
|
29
|
-
let selectedProject = null;
|
|
40
|
+
let selectedProject: { selectedProject: Project } | null = null;
|
|
30
41
|
if (answers.wizard.projects.length === 1) {
|
|
31
|
-
selectedProject = {
|
|
42
|
+
selectedProject = {
|
|
43
|
+
selectedProject: answers.wizard.projects[0] as Project,
|
|
44
|
+
};
|
|
32
45
|
// the wizard CLI closes too quickly when we skip the prompt
|
|
33
46
|
// as it will cause the UI to be stuck saying Waiting for wizard to connect
|
|
34
47
|
await sleep(1000);
|
|
@@ -47,34 +60,22 @@ export class SentryProjectSelector extends BaseStep {
|
|
|
47
60
|
},
|
|
48
61
|
]);
|
|
49
62
|
}
|
|
50
|
-
|
|
63
|
+
const dsn = selectedProject?.selectedProject.keys[0]?.dsn ?? {
|
|
64
|
+
public: null,
|
|
65
|
+
private: null,
|
|
66
|
+
};
|
|
51
67
|
return {
|
|
52
68
|
config: {
|
|
53
69
|
auth: {
|
|
54
|
-
token:
|
|
55
|
-
},
|
|
56
|
-
dsn: {
|
|
57
|
-
public: _.get(
|
|
58
|
-
selectedProject,
|
|
59
|
-
'selectedProject.keys.0.dsn.public',
|
|
60
|
-
null,
|
|
61
|
-
),
|
|
62
|
-
secret: _.get(
|
|
63
|
-
selectedProject,
|
|
64
|
-
'selectedProject.keys.0.dsn.secret',
|
|
65
|
-
null,
|
|
66
|
-
),
|
|
70
|
+
token: answers.wizard.apiKeys?.token ?? null,
|
|
67
71
|
},
|
|
72
|
+
dsn,
|
|
68
73
|
organization: {
|
|
69
|
-
slug:
|
|
70
|
-
selectedProject,
|
|
71
|
-
'selectedProject.organization.slug',
|
|
72
|
-
null,
|
|
73
|
-
),
|
|
74
|
+
slug: selectedProject?.selectedProject.organization?.slug ?? null,
|
|
74
75
|
},
|
|
75
76
|
project: {
|
|
76
|
-
id:
|
|
77
|
-
slug:
|
|
77
|
+
id: selectedProject?.selectedProject.id ?? null,
|
|
78
|
+
slug: selectedProject?.selectedProject.slug ?? null,
|
|
78
79
|
},
|
|
79
80
|
},
|
|
80
81
|
};
|
|
@@ -4,8 +4,6 @@ import { BottomBar } from '../Helper/BottomBar';
|
|
|
4
4
|
import { getCurrentIntegration } from '../Helper/Wizard';
|
|
5
5
|
import { BaseStep } from './BaseStep';
|
|
6
6
|
|
|
7
|
-
const r2 = require('r2');
|
|
8
|
-
|
|
9
7
|
export class WaitForSentry extends BaseStep {
|
|
10
8
|
public async emit(answers: Answers): Promise<Answers> {
|
|
11
9
|
if (!(await getCurrentIntegration(answers).shouldEmit(answers))) {
|
|
@@ -15,36 +13,44 @@ export class WaitForSentry extends BaseStep {
|
|
|
15
13
|
return {};
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
if (!answers.hash) {
|
|
17
|
+
throw new Error(`No wizard hash found ${answers}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
19
20
|
return new Promise((resolve, _reject) => {
|
|
20
21
|
this.debug(answers);
|
|
21
22
|
|
|
22
23
|
BottomBar.show('Waiting for Sentry...');
|
|
23
24
|
const baseUrl = this._argv.url;
|
|
24
25
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
const pingSentry = async (): Promise<void> => {
|
|
27
|
+
const response = await fetch(`${baseUrl}api/0/wizard/${answers.hash}/`);
|
|
28
|
+
this.debug('Polling received data');
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`Received status ${response.status} ${response.statusText}`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
const data = await response.json();
|
|
35
|
+
// Delete the wizard hash since we were able to fetch the data
|
|
36
|
+
await fetch(`${baseUrl}api/0/wizard/${answers.hash}/`, {
|
|
37
|
+
method: 'DELETE',
|
|
38
|
+
});
|
|
39
|
+
BottomBar.hide();
|
|
40
|
+
this.debug('Polling Success!');
|
|
41
|
+
resolve({ wizard: data });
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const poll = (): void => {
|
|
45
|
+
this.debug(`Polling: ${baseUrl}api/0/wizard/${answers.hash}/`);
|
|
46
|
+
pingSentry().catch((e) => {
|
|
42
47
|
this.debug('Polling received:');
|
|
43
48
|
this.debug(e);
|
|
44
|
-
setTimeout(
|
|
45
|
-
}
|
|
49
|
+
setTimeout(poll, 1000);
|
|
50
|
+
});
|
|
46
51
|
};
|
|
47
|
-
|
|
52
|
+
|
|
53
|
+
poll();
|
|
48
54
|
});
|
|
49
55
|
}
|
|
50
56
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/wizard",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"homepage": "https://github.com/getsentry/sentry-wizard",
|
|
5
5
|
"repository": "https://github.com/getsentry/sentry-wizard",
|
|
6
6
|
"description": "Sentry wizard helping you to configure your project",
|
|
@@ -25,16 +25,13 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@clack/core": "^0.3.4",
|
|
27
27
|
"@clack/prompts": "0.7.0",
|
|
28
|
-
"@sentry/cli": "^1.77.3",
|
|
29
28
|
"@sentry/node": "^7.119.2",
|
|
30
29
|
"axios": "1.7.4",
|
|
31
30
|
"chalk": "^2.4.1",
|
|
32
31
|
"glob": "9.3.5",
|
|
33
32
|
"inquirer": "^6.2.0",
|
|
34
|
-
"lodash": "^4.17.15",
|
|
35
33
|
"magicast": "^0.2.10",
|
|
36
34
|
"opn": "^5.4.0",
|
|
37
|
-
"r2": "^2.0.1",
|
|
38
35
|
"read-env": "^1.3.0",
|
|
39
36
|
"recast": "^0.23.3",
|
|
40
37
|
"semver": "^7.5.3",
|
|
@@ -43,13 +40,15 @@
|
|
|
43
40
|
"yargs": "^16.2.0"
|
|
44
41
|
},
|
|
45
42
|
"devDependencies": {
|
|
43
|
+
"@babel/types": "~7.21.4",
|
|
46
44
|
"@sentry-internal/eslint-config-sdk": "^7.48.0",
|
|
47
45
|
"@types/chai": "^4.3.17",
|
|
48
46
|
"@types/glob": "^7.2.0",
|
|
49
47
|
"@types/inquirer": "^0.0.43",
|
|
50
48
|
"@types/jest": "^29.5.0",
|
|
51
49
|
"@types/lodash": "^4.14.144",
|
|
52
|
-
"@types/node": "^
|
|
50
|
+
"@types/node": "^18.19.76",
|
|
51
|
+
"@types/opn": "5.1.0",
|
|
53
52
|
"@types/rimraf": "^3.0.2",
|
|
54
53
|
"@types/semver": "^7.3.7",
|
|
55
54
|
"@types/yargs": "^16.0.9",
|
|
@@ -59,6 +58,7 @@
|
|
|
59
58
|
"eslint": "^8.18.0",
|
|
60
59
|
"eslint-config-prettier": "^8.3.0",
|
|
61
60
|
"eslint-plugin-jest": "^25.3.0",
|
|
61
|
+
"fossilize": "^0.3.1",
|
|
62
62
|
"jest": "^29.5.0",
|
|
63
63
|
"prettier": "^2.8.7",
|
|
64
64
|
"rimraf": "^3.0.2",
|
|
@@ -67,8 +67,11 @@
|
|
|
67
67
|
"tsx": "^3.14.0",
|
|
68
68
|
"typescript": "^5.0.4"
|
|
69
69
|
},
|
|
70
|
+
"resolutions": {
|
|
71
|
+
"simple-plist": "1.4.0-0"
|
|
72
|
+
},
|
|
70
73
|
"engines": {
|
|
71
|
-
"node": ">=
|
|
74
|
+
"node": ">=18.20.6",
|
|
72
75
|
"npm": ">=3.10.7",
|
|
73
76
|
"yarn": ">=1.0.2"
|
|
74
77
|
},
|
|
@@ -86,6 +89,7 @@
|
|
|
86
89
|
"fix:eslint": "eslint . --format stylish --fix",
|
|
87
90
|
"test": "yarn build && jest",
|
|
88
91
|
"test:e2e": "yarn build && ./e2e-tests/run.sh",
|
|
92
|
+
"test:e2e:bin": "chmod +x ./dist-bin/* && SENTRY_WIZARD_E2E_TEST_BIN=1 ./e2e-tests/run.sh",
|
|
89
93
|
"try": "ts-node bin.ts",
|
|
90
94
|
"try:uninstall": "ts-node bin.ts --uninstall",
|
|
91
95
|
"test:watch": "jest --watch"
|
|
@@ -107,7 +111,7 @@
|
|
|
107
111
|
"json"
|
|
108
112
|
],
|
|
109
113
|
"modulePathIgnorePatterns": [
|
|
110
|
-
"<rootDir>/dist/
|
|
114
|
+
"<rootDir>/dist/"
|
|
111
115
|
],
|
|
112
116
|
"testPathIgnorePatterns": [
|
|
113
117
|
"/dist/",
|
|
@@ -121,7 +125,7 @@
|
|
|
121
125
|
"author": "Sentry",
|
|
122
126
|
"license": "MIT",
|
|
123
127
|
"volta": {
|
|
124
|
-
"node": "
|
|
128
|
+
"node": "18.20.6",
|
|
125
129
|
"yarn": "1.22.19"
|
|
126
130
|
},
|
|
127
131
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
5
5
|
// @ts-ignore - clack is ESM and TS complains about that. It works though
|
|
6
6
|
import clack from '@clack/prompts';
|
|
7
|
-
import * as fs from 'fs';
|
|
8
|
-
import * as path from 'path';
|
|
9
|
-
import { SentryProjectData } from '../utils/types';
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
import type { SentryProjectData } from '../utils/types';
|
|
10
10
|
import * as templates from './templates';
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
project as createXcodeProject,
|
|
14
|
-
PBXBuildFile,
|
|
15
|
-
PBXGroup,
|
|
16
|
-
PBXNativeTarget,
|
|
17
|
-
PBXObjects,
|
|
18
|
-
PBXSourcesBuildPhase,
|
|
19
|
-
Project,
|
|
20
|
-
XCConfigurationList,
|
|
14
|
+
type PBXBuildFile,
|
|
15
|
+
type PBXGroup,
|
|
16
|
+
type PBXNativeTarget,
|
|
17
|
+
type PBXObjects,
|
|
18
|
+
type PBXSourcesBuildPhase,
|
|
19
|
+
type Project,
|
|
20
|
+
type XCConfigurationList,
|
|
21
21
|
} from 'xcode';
|
|
22
22
|
|
|
23
23
|
interface ProjectFile {
|
package/src/nextjs/templates.ts
CHANGED
|
@@ -501,8 +501,8 @@ export default function GlobalError(${chalk.green(
|
|
|
501
501
|
);
|
|
502
502
|
}
|
|
503
503
|
`;
|
|
504
|
-
}
|
|
505
|
-
|
|
504
|
+
}
|
|
505
|
+
return `"use client";
|
|
506
506
|
|
|
507
507
|
${chalk.green('import * as Sentry from "@sentry/nextjs";')}
|
|
508
508
|
${chalk.green('import Error from "next/error";')}
|
|
@@ -522,5 +522,4 @@ export default function GlobalError(${chalk.green('{ error }')}) {
|
|
|
522
522
|
);
|
|
523
523
|
}
|
|
524
524
|
`;
|
|
525
|
-
}
|
|
526
525
|
}
|
package/src/nuxt/sdk-setup.ts
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
1
3
|
// @ts-expect-error - clack is ESM and TS complains about that. It works though
|
|
2
4
|
import * as clack from '@clack/prompts';
|
|
3
5
|
import * as Sentry from '@sentry/node';
|
|
4
6
|
import chalk from 'chalk';
|
|
5
|
-
import fs from 'fs';
|
|
6
7
|
// @ts-expect-error - magicast is ESM and TS complains about that. It works though
|
|
7
|
-
import {
|
|
8
|
+
import { generateCode, loadFile } from 'magicast';
|
|
8
9
|
// @ts-expect-error - magicast is ESM and TS complains about that. It works though
|
|
9
10
|
import { addNuxtModule } from 'magicast/helpers';
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
getDefaultNuxtConfig,
|
|
14
|
-
getNuxtModuleFallbackTemplate,
|
|
15
|
-
getSentryConfigContents,
|
|
16
|
-
} from './templates';
|
|
11
|
+
import opn from 'opn';
|
|
12
|
+
import { type SemVer, lt } from 'semver';
|
|
13
|
+
import { traceStep } from '../telemetry';
|
|
17
14
|
import {
|
|
18
15
|
abortIfCancelled,
|
|
19
16
|
askShouldAddPackageOverride,
|
|
@@ -21,13 +18,19 @@ import {
|
|
|
21
18
|
featureSelectionPrompt,
|
|
22
19
|
installPackage,
|
|
23
20
|
isUsingTypeScript,
|
|
24
|
-
opn,
|
|
25
21
|
} from '../utils/clack-utils';
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
type PackageDotJson,
|
|
24
|
+
hasPackageInstalled,
|
|
25
|
+
} from '../utils/package-json';
|
|
26
|
+
import { PNPM, type PackageManager } from '../utils/package-manager';
|
|
27
|
+
import {
|
|
28
|
+
getConfigBody,
|
|
29
|
+
getDefaultNuxtConfig,
|
|
30
|
+
getNuxtModuleFallbackTemplate,
|
|
31
|
+
getSentryConfigContents,
|
|
32
|
+
} from './templates';
|
|
33
|
+
import { type DeploymentPlatform, deploymentPlatforms } from './types';
|
|
31
34
|
|
|
32
35
|
const possibleNuxtConfig = [
|
|
33
36
|
'nuxt.config.js',
|
|
@@ -342,8 +345,8 @@ export async function confirmReadImportDocs(
|
|
|
342
345
|
Sentry.setTag('init-with-import-docs-opened', shouldOpenDocs);
|
|
343
346
|
|
|
344
347
|
if (shouldOpenDocs) {
|
|
345
|
-
opn
|
|
346
|
-
|
|
347
|
-
});
|
|
348
|
+
// opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here
|
|
349
|
+
const noop = () => {}; // eslint-disable-line @typescript-eslint/no-empty-function
|
|
350
|
+
opn(docsUrl, { wait: false }).then((cp) => cp.on('error', noop), noop);
|
|
348
351
|
}
|
|
349
352
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
2
|
// @ts-ignore - clack is ESM and TS complains about that. It works though
|
|
3
3
|
import * as clack from '@clack/prompts';
|
|
4
4
|
// @ts-ignore - magicast is ESM and TS complains about that. It works though
|
|
5
|
-
import { ProxifiedModule } from 'magicast';
|
|
5
|
+
import type { ProxifiedModule } from 'magicast';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
7
|
import * as Sentry from '@sentry/node';
|
|
8
8
|
|