@sentry/wizard 4.5.0 → 4.7.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/CHANGELOG.md +25 -1
- package/README.md +23 -19
- package/dist/bin.js +22 -0
- package/dist/bin.js.map +1 -1
- package/dist/e2e-tests/tests/flutter.test.js +16 -16
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/help-message.test.js +56 -0
- package/dist/e2e-tests/tests/help-message.test.js.map +1 -0
- package/dist/e2e-tests/tests/nextjs-14.test.js +17 -16
- package/dist/e2e-tests/tests/nextjs-14.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs-15.test.js +16 -16
- package/dist/e2e-tests/tests/nextjs-15.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +13 -12
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +13 -12
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +20 -20
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit.test.js +20 -20
- 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 +35 -13
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/lib/Constants.d.ts +7 -1
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/File.d.ts +1 -1
- package/dist/lib/Helper/File.js +1 -3
- package/dist/lib/Helper/File.js.map +1 -1
- package/dist/lib/Helper/Logging.d.ts +4 -1
- package/dist/lib/Helper/Logging.js +3 -0
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/Package.d.ts +5 -3
- package/dist/lib/Helper/Package.js +2 -2
- package/dist/lib/Helper/Package.js.map +1 -1
- package/dist/lib/Helper/SentryCli.d.ts +20 -7
- package/dist/lib/Helper/SentryCli.js +21 -13
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Helper/Wizard.js +9 -5
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/lib/Helper/__tests__/File.js +9 -9
- package/dist/lib/Helper/__tests__/File.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +17 -17
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/__tests__/SentryCli.js +39 -21
- package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
- package/dist/lib/Setup.d.ts +4 -1
- package/dist/lib/Setup.js +12 -2
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/BaseStep.d.ts +1 -1
- package/dist/lib/Steps/BaseStep.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.js +1 -2
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.js +14 -10
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.d.ts +4 -1
- package/dist/lib/Steps/Integrations/Electron.js +1 -1
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.d.ts +3 -1
- package/dist/lib/Steps/Integrations/MobileProject.js +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.d.ts +4 -1
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/lib/Steps/SentryProjectSelector.d.ts +42 -1
- package/dist/lib/Steps/SentryProjectSelector.js +1 -1
- package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
- package/dist/lib/Steps/WaitForSentry.d.ts +3 -1
- package/dist/lib/Steps/WaitForSentry.js +4 -4
- package/dist/lib/Steps/WaitForSentry.js.map +1 -1
- package/dist/lib/Steps/Welcome.js +5 -0
- package/dist/lib/Steps/Welcome.js.map +1 -1
- package/dist/lib/Types.d.ts +14 -0
- package/dist/lib/Types.js +3 -0
- package/dist/lib/Types.js.map +1 -0
- package/dist/lib/__tests__/Env.js +10 -16
- package/dist/lib/__tests__/Env.js.map +1 -1
- package/dist/src/android/android-wizard.js +15 -12
- package/dist/src/android/android-wizard.js.map +1 -1
- package/dist/src/android/code-tools.js +1 -1
- package/dist/src/android/code-tools.js.map +1 -1
- package/dist/src/android/gradle.js +4 -4
- package/dist/src/android/gradle.js.map +1 -1
- package/dist/src/android/manifest.js +1 -1
- package/dist/src/android/manifest.js.map +1 -1
- package/dist/src/apple/apple-wizard.d.ts +2 -2
- package/dist/src/apple/apple-wizard.js +54 -175
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/apple/check-installed-cli.d.ts +1 -0
- package/dist/src/apple/check-installed-cli.js +60 -0
- package/dist/src/apple/check-installed-cli.js.map +1 -0
- package/dist/src/apple/cocoapod.js +1 -1
- package/dist/src/apple/cocoapod.js.map +1 -1
- package/dist/src/apple/code-tools.js +1 -1
- package/dist/src/apple/code-tools.js.map +1 -1
- package/dist/src/apple/configure-fastlane.d.ts +5 -0
- package/dist/src/apple/configure-fastlane.js +66 -0
- package/dist/src/apple/configure-fastlane.js.map +1 -0
- package/dist/src/apple/configure-package-manager.d.ts +5 -0
- package/dist/src/apple/configure-package-manager.js +68 -0
- package/dist/src/apple/configure-package-manager.js.map +1 -0
- package/dist/src/apple/configure-sentry-cli.d.ts +4 -0
- package/dist/src/apple/configure-sentry-cli.js +47 -0
- package/dist/src/apple/configure-sentry-cli.js.map +1 -0
- package/dist/src/apple/configure-xcode-project.d.ts +8 -0
- package/dist/src/apple/configure-xcode-project.js +11 -0
- package/dist/src/apple/configure-xcode-project.js.map +1 -0
- package/dist/src/apple/fastlane.d.ts +1 -1
- package/dist/src/apple/fastlane.js +5 -5
- package/dist/src/apple/fastlane.js.map +1 -1
- package/dist/src/apple/inject-code-snippet.d.ts +6 -0
- package/dist/src/apple/inject-code-snippet.js +54 -0
- package/dist/src/apple/inject-code-snippet.js.map +1 -0
- package/dist/src/apple/lookup-xcode-project.d.ts +7 -0
- package/dist/src/apple/lookup-xcode-project.js +98 -0
- package/dist/src/apple/lookup-xcode-project.js.map +1 -0
- package/dist/src/apple/options.d.ts +4 -0
- package/dist/src/apple/options.js +3 -0
- package/dist/src/apple/options.js.map +1 -0
- package/dist/src/apple/search-xcode-project-at-path.d.ts +1 -0
- package/dist/src/apple/search-xcode-project-at-path.js +70 -0
- package/dist/src/apple/search-xcode-project-at-path.js.map +1 -0
- package/dist/src/apple/templates.js +11 -7
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/apple/xcode-manager.js +4 -7
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/flutter/code-tools.js +3 -3
- package/dist/src/flutter/code-tools.js.map +1 -1
- package/dist/src/flutter/flutter-wizard.js +21 -15
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/flutter/templates.js +4 -4
- package/dist/src/flutter/templates.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +118 -43
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.d.ts +10 -1
- package/dist/src/nextjs/templates.js +192 -62
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.js +21 -16
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
- package/dist/src/nuxt/sdk-example.js +3 -3
- package/dist/src/nuxt/sdk-example.js.map +1 -1
- package/dist/src/nuxt/sdk-setup.js +9 -9
- package/dist/src/nuxt/sdk-setup.js.map +1 -1
- package/dist/src/nuxt/templates.js +173 -58
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/nuxt/utils.js +6 -3
- package/dist/src/nuxt/utils.js.map +1 -1
- package/dist/src/react-native/expo-env-file.js +1 -1
- package/dist/src/react-native/expo-env-file.js.map +1 -1
- package/dist/src/react-native/expo-metro.js +4 -4
- package/dist/src/react-native/expo-metro.js.map +1 -1
- package/dist/src/react-native/expo.js +4 -4
- package/dist/src/react-native/expo.js.map +1 -1
- package/dist/src/react-native/javascript.d.ts +6 -4
- package/dist/src/react-native/javascript.js +31 -15
- package/dist/src/react-native/javascript.js.map +1 -1
- package/dist/src/react-native/metro.js +8 -8
- package/dist/src/react-native/metro.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.d.ts +5 -1
- package/dist/src/react-native/react-native-wizard.js +66 -36
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-native/uninstall.js +8 -5
- package/dist/src/react-native/uninstall.js.map +1 -1
- package/dist/src/react-native/xcode.d.ts +9 -4
- package/dist/src/react-native/xcode.js +65 -22
- package/dist/src/react-native/xcode.js.map +1 -1
- package/dist/src/remix/codemods/handle-error.js +4 -1
- package/dist/src/remix/codemods/handle-error.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +23 -18
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/remix/sdk-example.js +163 -64
- package/dist/src/remix/sdk-example.js.map +1 -1
- package/dist/src/remix/sdk-setup.js +11 -7
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/run.d.ts +3 -1
- package/dist/src/run.js +29 -9
- package/dist/src/run.js.map +1 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.js +30 -28
- package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
- package/dist/src/sourcemaps/tools/angular.js +3 -3
- package/dist/src/sourcemaps/tools/angular.js.map +1 -1
- package/dist/src/sourcemaps/tools/create-react-app.js +3 -3
- package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -1
- package/dist/src/sourcemaps/tools/esbuild.js +6 -6
- package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
- package/dist/src/sourcemaps/tools/nextjs.js +5 -5
- package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
- package/dist/src/sourcemaps/tools/remix.js +4 -4
- package/dist/src/sourcemaps/tools/remix.js.map +1 -1
- package/dist/src/sourcemaps/tools/rollup.js +6 -6
- package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
- package/dist/src/sourcemaps/tools/sentry-cli.js +15 -15
- package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
- package/dist/src/sourcemaps/tools/tsc.js +6 -6
- package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
- package/dist/src/sourcemaps/tools/vite.js +12 -12
- package/dist/src/sourcemaps/tools/vite.js.map +1 -1
- package/dist/src/sourcemaps/tools/webpack.js +10 -10
- package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
- package/dist/src/sourcemaps/utils/detect-tool.js +2 -2
- package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -1
- package/dist/src/sourcemaps/utils/other-wizards.js +5 -5
- package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -1
- package/dist/src/sourcemaps/utils/sdk-version.js +7 -7
- package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -1
- package/dist/src/sveltekit/sdk-example.js +1 -1
- package/dist/src/sveltekit/sdk-example.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup.js +15 -14
- package/dist/src/sveltekit/sdk-setup.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +25 -20
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/sveltekit/templates.js +126 -37
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/telemetry.js +11 -0
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/utils/{clack-utils.d.ts → clack/index.d.ts} +45 -7
- package/dist/src/utils/{clack-utils.js → clack/index.js} +75 -20
- package/dist/src/utils/clack/index.js.map +1 -0
- package/dist/src/utils/debug.js +1 -1
- package/dist/src/utils/debug.js.map +1 -1
- package/dist/src/utils/find-files-with-extension.d.ts +1 -0
- package/dist/src/utils/find-files-with-extension.js +39 -0
- package/dist/src/utils/find-files-with-extension.js.map +1 -0
- package/dist/src/utils/package-manager.d.ts +8 -1
- package/dist/src/utils/package-manager.js +79 -23
- package/dist/src/utils/package-manager.js.map +1 -1
- package/dist/src/utils/sentrycli-utils.js +0 -1
- package/dist/src/utils/sentrycli-utils.js.map +1 -1
- package/dist/src/utils/types.d.ts +4 -0
- package/dist/src/utils/types.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/test/android/code-tools.test.js +13 -13
- package/dist/test/android/code-tools.test.js.map +1 -1
- package/dist/test/apple/cocoapod.test.js +78 -73
- package/dist/test/apple/cocoapod.test.js.map +1 -1
- package/dist/test/apple/code-tools.test.js +174 -167
- package/dist/test/apple/code-tools.test.js.map +1 -1
- package/dist/test/apple/fastfile.test.js +87 -84
- package/dist/test/apple/fastfile.test.js.map +1 -1
- package/dist/test/apple/templates.test.js +32 -27
- package/dist/test/apple/templates.test.js.map +1 -1
- package/dist/test/apple/xcode-manager.test.js +208 -185
- package/dist/test/apple/xcode-manager.test.js.map +1 -1
- package/dist/test/flutter/code-tools.test.js +29 -30
- package/dist/test/flutter/code-tools.test.js.map +1 -1
- package/dist/test/flutter/templates.test.js +38 -37
- package/dist/test/flutter/templates.test.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +155 -103
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +25 -24
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/react-native/expo-metro.test.js +12 -11
- package/dist/test/react-native/expo-metro.test.js.map +1 -1
- package/dist/test/react-native/expo.test.js +11 -10
- package/dist/test/react-native/expo.test.js.map +1 -1
- package/dist/test/react-native/gradle.test.js +27 -26
- package/dist/test/react-native/gradle.test.js.map +1 -1
- package/dist/test/react-native/javascript.test.js +109 -59
- package/dist/test/react-native/javascript.test.js.map +1 -1
- package/dist/test/react-native/metro.test.js +66 -65
- package/dist/test/react-native/metro.test.js.map +1 -1
- package/dist/test/react-native/xcode.test.js +138 -37
- package/dist/test/react-native/xcode.test.js.map +1 -1
- package/dist/test/remix/client-entry.test.js +8 -7
- package/dist/test/remix/client-entry.test.js.map +1 -1
- package/dist/test/remix/server-instrumentation.test.js +6 -5
- package/dist/test/remix/server-instrumentation.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/sentry-cli.test.js +21 -21
- package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/tsc.test.js +13 -14
- package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/vite.test.js +13 -14
- package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/webpack.test.js +19 -20
- package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +13 -12
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/utils/ast-utils.test.js +45 -44
- package/dist/test/utils/ast-utils.test.js.map +1 -1
- package/dist/test/utils/clack/index.test.d.ts +1 -0
- package/dist/test/utils/clack/index.test.js +375 -0
- package/dist/test/utils/clack/index.test.js.map +1 -0
- package/dist/test/utils/package-manager.test.d.ts +1 -0
- package/dist/test/utils/package-manager.test.js +30 -0
- package/dist/test/utils/package-manager.test.js.map +1 -0
- package/package.json +10 -38
- package/dist/e2e-tests/jest.config.d.ts +0 -17
- package/dist/e2e-tests/jest.config.js +0 -23
- package/dist/e2e-tests/jest.config.js.map +0 -1
- package/dist/src/utils/clack-utils.js.map +0 -1
- package/dist/test/utils/clack-utils.test.js +0 -306
- package/dist/test/utils/clack-utils.test.js.map +0 -1
- /package/dist/{test/utils/clack-utils.test.d.ts → e2e-tests/tests/help-message.test.d.ts} +0 -0
package/dist/src/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/run.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
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K,IAAA,WAAS,EACZ;gBACE,GAAG,IAAI;gBACP,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE;gBACnB,WAAW,EAAE,uBAAW,CAAC,OAAO;gBAChC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;aAC9B,EACD,aAAa,CACd,CAAC;YACF,MAAM;QAER,KAAK,UAAU;YACb,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,KAAK,IAAA,WAAS,EACZ;gBACE,GAAG,IAAI;gBACP,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE;gBACnB,WAAW,EAAE,uBAAW,CAAC,QAAQ;gBACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;aAC9B,EACD,aAAa,CACd,CAAC;YACF,MAAM;QAER;YACE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;KAChD;AACH,CAAC;AA/HD,kBA+HC","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\nimport { runReactNativeWizard } from './react-native/react-native-wizard';\nimport { abortIfCancelled } from './utils/clack';\n\nimport { Integration, type Platform } from '../lib/Constants';\nimport { readEnvironment } from '../lib/Helper/Env';\nimport { run as legacyRun } from '../lib/Setup';\nimport { runAndroidWizard } from './android/android-wizard';\nimport { runAppleWizard } from './apple/apple-wizard';\nimport { runFlutterWizard } from './flutter/flutter-wizard';\nimport { runNextjsWizard } from './nextjs/nextjs-wizard';\nimport { runNuxtWizard } from './nuxt/nuxt-wizard';\nimport { runRemixWizard } from './remix/remix-wizard';\nimport { runSourcemapsWizard } from './sourcemaps/sourcemaps-wizard';\nimport { runSvelteKitWizard } from './sveltekit/sveltekit-wizard';\nimport { enableDebugLogs } from './utils/debug';\nimport type { PreselectedProject, WizardOptions } from './utils/types';\nimport { WIZARD_VERSION } from './version';\n\ntype WizardIntegration =\n | 'reactNative'\n | 'flutter'\n | 'ios'\n | 'android'\n | 'cordova'\n | 'electron'\n | 'nextjs'\n | 'nuxt'\n | 'remix'\n | 'sveltekit'\n | 'sourcemaps';\n\ntype Args = {\n integration?: WizardIntegration;\n\n uninstall: boolean;\n signup: boolean;\n skipConnect: boolean;\n debug: boolean;\n quiet: boolean;\n disableTelemetry: boolean;\n promoCode?: string;\n preSelectedProject?: {\n authToken: string;\n selfHosted: boolean;\n dsn: string;\n projectId: string;\n projectSlug: string;\n projectName: string;\n orgId: string;\n orgName: string;\n orgSlug: string;\n };\n url?: string;\n platform?: Platform[];\n org?: string;\n project?: string;\n saas?: boolean;\n forceInstall?: boolean;\n comingFrom?: string;\n ignoreGitChanges?: boolean;\n xcodeProjectDir?: string;\n};\n\nfunction preSelectedProjectArgsToObject(\n args: Args,\n): PreselectedProject | undefined {\n if (!args.preSelectedProject) {\n return undefined;\n }\n\n return {\n authToken: args.preSelectedProject.authToken,\n selfHosted: args.preSelectedProject.selfHosted,\n project: {\n id: args.preSelectedProject.projectId,\n keys: [\n {\n dsn: {\n public: args.preSelectedProject.dsn,\n },\n },\n ],\n organization: {\n id: args.preSelectedProject.orgId,\n name: args.preSelectedProject.orgName,\n slug: args.preSelectedProject.orgSlug,\n },\n slug: args.preSelectedProject.projectSlug,\n },\n };\n}\n\nexport async function run(argv: Args) {\n const finalArgs = {\n ...argv,\n ...readEnvironment(),\n };\n\n // Enable debug logs if the user has passed the --debug flag\n if (finalArgs.debug) {\n enableDebugLogs();\n }\n\n let integration = finalArgs.integration;\n if (!integration) {\n clack.intro(`Sentry Wizard ${WIZARD_VERSION}`);\n\n integration = await abortIfCancelled(\n clack.select({\n message: 'What do you want to set up?',\n options: [\n { value: 'reactNative', label: 'React Native' },\n { value: 'flutter', label: 'Flutter' },\n { value: 'ios', label: 'iOS' },\n { value: 'android', label: 'Android' },\n { value: 'cordova', label: 'Cordova' },\n { value: 'electron', label: 'Electron' },\n { value: 'nextjs', label: 'Next.js' },\n { value: 'nuxt', label: 'Nuxt' },\n { value: 'remix', label: 'Remix' },\n { value: 'sveltekit', label: 'SvelteKit' },\n { value: 'sourcemaps', label: 'Configure Source Maps Upload' },\n ],\n }),\n );\n\n if (!integration) {\n clack.log.error('No integration selected. Exiting.');\n return;\n }\n\n clack.outro(`Starting ${integration} setup`);\n }\n\n const wizardOptions: WizardOptions = {\n telemetryEnabled: !finalArgs.disableTelemetry,\n promoCode: finalArgs.promoCode,\n url: finalArgs.url,\n orgSlug: finalArgs.org,\n projectSlug: finalArgs.project,\n saas: finalArgs.saas,\n preSelectedProject: preSelectedProjectArgsToObject(finalArgs),\n forceInstall: finalArgs.forceInstall,\n comingFrom: finalArgs.comingFrom,\n ignoreGitChanges: finalArgs.ignoreGitChanges,\n };\n\n switch (integration) {\n case 'reactNative':\n await runReactNativeWizard({\n ...wizardOptions,\n uninstall: finalArgs.uninstall,\n });\n break;\n\n case 'flutter':\n await runFlutterWizard(wizardOptions);\n break;\n\n case 'ios':\n await runAppleWizard({\n ...wizardOptions,\n projectDir: finalArgs.xcodeProjectDir,\n });\n break;\n\n case 'android':\n await runAndroidWizard(wizardOptions);\n break;\n\n case 'nextjs':\n await runNextjsWizard(wizardOptions);\n break;\n\n case 'nuxt':\n await runNuxtWizard(wizardOptions);\n break;\n\n case 'remix':\n await runRemixWizard(wizardOptions);\n break;\n\n case 'sveltekit':\n await runSvelteKitWizard(wizardOptions);\n break;\n\n case 'sourcemaps':\n await runSourcemapsWizard(wizardOptions);\n break;\n\n case 'cordova':\n argv.integration = 'cordova';\n void legacyRun(\n {\n ...argv,\n url: argv.url ?? '',\n integration: Integration.cordova,\n platform: argv.platform ?? [],\n },\n wizardOptions,\n );\n break;\n\n case 'electron':\n argv.integration = 'electron';\n void legacyRun(\n {\n ...argv,\n url: argv.url ?? '',\n integration: Integration.electron,\n platform: argv.platform ?? [],\n },\n wizardOptions,\n );\n break;\n\n default:\n clack.log.error('No setup wizard selected!');\n }\n}\n"]}
|
|
@@ -27,26 +27,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.configureCI = exports.setupCI = exports.runSourcemapsWizard = void 0;
|
|
30
|
-
// @ts-
|
|
30
|
+
// @ts-expect-error - clack is ESM and TS complains about that. It works though
|
|
31
31
|
const prompts_1 = __importDefault(require("@clack/prompts"));
|
|
32
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
33
32
|
const Sentry = __importStar(require("@sentry/node"));
|
|
34
|
-
const
|
|
33
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
34
|
+
const telemetry_1 = require("../telemetry");
|
|
35
|
+
const clack_1 = require("../utils/clack");
|
|
36
|
+
const package_manager_1 = require("../utils/package-manager");
|
|
37
|
+
const url_1 = require("../utils/url");
|
|
35
38
|
const is_unicorn_supported_1 = require("../utils/vendor/is-unicorn-supported");
|
|
36
|
-
const
|
|
39
|
+
const angular_1 = require("./tools/angular");
|
|
40
|
+
const create_react_app_1 = require("./tools/create-react-app");
|
|
41
|
+
const esbuild_1 = require("./tools/esbuild");
|
|
42
|
+
const rollup_1 = require("./tools/rollup");
|
|
37
43
|
const sentry_cli_1 = require("./tools/sentry-cli");
|
|
38
|
-
const webpack_1 = require("./tools/webpack");
|
|
39
44
|
const tsc_1 = require("./tools/tsc");
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const create_react_app_1 = require("./tools/create-react-app");
|
|
43
|
-
const sdk_version_1 = require("./utils/sdk-version");
|
|
44
|
-
const telemetry_1 = require("../telemetry");
|
|
45
|
-
const other_wizards_1 = require("./utils/other-wizards");
|
|
46
|
-
const angular_1 = require("./tools/angular");
|
|
45
|
+
const vite_1 = require("./tools/vite");
|
|
46
|
+
const webpack_1 = require("./tools/webpack");
|
|
47
47
|
const detect_tool_1 = require("./utils/detect-tool");
|
|
48
|
-
const
|
|
49
|
-
const
|
|
48
|
+
const other_wizards_1 = require("./utils/other-wizards");
|
|
49
|
+
const sdk_version_1 = require("./utils/sdk-version");
|
|
50
50
|
async function runSourcemapsWizard(options) {
|
|
51
51
|
return (0, telemetry_1.withTelemetry)({
|
|
52
52
|
enabled: options.telemetryEnabled,
|
|
@@ -56,7 +56,7 @@ async function runSourcemapsWizard(options) {
|
|
|
56
56
|
}
|
|
57
57
|
exports.runSourcemapsWizard = runSourcemapsWizard;
|
|
58
58
|
async function runSourcemapsWizardWithTelemetry(options) {
|
|
59
|
-
(0,
|
|
59
|
+
(0, clack_1.printWelcome)({
|
|
60
60
|
wizardName: 'Sentry Source Maps Upload Configuration Wizard',
|
|
61
61
|
message: `This wizard will help you upload source maps to Sentry as part of your build.
|
|
62
62
|
Thank you for using Sentry :)${options.telemetryEnabled
|
|
@@ -72,14 +72,17 @@ You can turn this off by running the wizard with the '--disable-telemetry' flag.
|
|
|
72
72
|
await (0, telemetry_1.traceStep)('run-framework-wizard', () => moreSuitableWizard(options));
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
await (0,
|
|
75
|
+
await (0, clack_1.confirmContinueIfNoOrDirtyGitRepo)({
|
|
76
|
+
ignoreGitChanges: options.ignoreGitChanges,
|
|
77
|
+
cwd: undefined,
|
|
78
|
+
});
|
|
76
79
|
await (0, telemetry_1.traceStep)('check-sdk-version', sdk_version_1.ensureMinimumSdkVersionIsInstalled);
|
|
77
|
-
const { selfHosted, selectedProject, sentryUrl, authToken } = await (0,
|
|
80
|
+
const { selfHosted, selectedProject, sentryUrl, authToken } = await (0, clack_1.getOrAskForProjectData)(options);
|
|
78
81
|
const selectedTool = await (0, telemetry_1.traceStep)('select-tool', askForUsedBundlerTool);
|
|
79
82
|
Sentry.setTag('selected-tool', selectedTool);
|
|
80
83
|
if (selectedTool === 'no-tool') {
|
|
81
84
|
prompts_1.default.log.info("No Problem! But in this case, there's nothing to configure :)");
|
|
82
|
-
await (0,
|
|
85
|
+
await (0, clack_1.abort)('Exiting, have a great day!', 0);
|
|
83
86
|
return;
|
|
84
87
|
}
|
|
85
88
|
await (0, telemetry_1.traceStep)('tool-setup', () => startToolSetupFlow(selectedTool, {
|
|
@@ -90,10 +93,10 @@ You can turn this off by running the wizard with the '--disable-telemetry' flag.
|
|
|
90
93
|
authToken,
|
|
91
94
|
}));
|
|
92
95
|
await (0, telemetry_1.traceStep)('ci-setup', () => setupCI(selectedTool, authToken, options.comingFrom));
|
|
93
|
-
(0, telemetry_1.traceStep)('outro', () => printOutro(sentryUrl, selectedProject.organization.slug, selectedProject.id));
|
|
96
|
+
await (0, telemetry_1.traceStep)('outro', () => printOutro(sentryUrl, selectedProject.organization.slug, selectedProject.id));
|
|
94
97
|
}
|
|
95
98
|
async function askForUsedBundlerTool() {
|
|
96
|
-
const selectedTool = await (0,
|
|
99
|
+
const selectedTool = await (0, clack_1.abortIfCancelled)(prompts_1.default.select({
|
|
97
100
|
message: 'Which framework, bundler or build tool are you using?',
|
|
98
101
|
options: [
|
|
99
102
|
{
|
|
@@ -185,7 +188,7 @@ async function setupCI(selectedTool, authToken, comingFrom) {
|
|
|
185
188
|
}
|
|
186
189
|
exports.setupCI = setupCI;
|
|
187
190
|
async function configureCI(selectedTool, authToken) {
|
|
188
|
-
const isUsingCI = await (0,
|
|
191
|
+
const isUsingCI = await (0, clack_1.abortIfCancelled)(prompts_1.default.select({
|
|
189
192
|
message: `Are you using a CI/CD tool to build and deploy your application?`,
|
|
190
193
|
options: [
|
|
191
194
|
{
|
|
@@ -209,8 +212,8 @@ async function configureCI(selectedTool, authToken) {
|
|
|
209
212
|
'create-react-app',
|
|
210
213
|
].includes(selectedTool);
|
|
211
214
|
const authTokenFile = isCliBasedFlowTool
|
|
212
|
-
?
|
|
213
|
-
:
|
|
215
|
+
? clack_1.SENTRY_CLI_RC_FILE
|
|
216
|
+
: clack_1.SENTRY_DOT_ENV_FILE;
|
|
214
217
|
if (!isUsingCI) {
|
|
215
218
|
prompts_1.default.log.info(`No Problem! Just make sure that the Sentry auth token from ${chalk_1.default.cyan(authTokenFile)} is available whenever you build and deploy your app.`);
|
|
216
219
|
return;
|
|
@@ -229,7 +232,7 @@ async function setupAuthTokenInCI(authToken) {
|
|
|
229
232
|
SENTRY_AUTH_TOKEN=${authToken}
|
|
230
233
|
`));
|
|
231
234
|
prompts_1.default.log.warn(chalk_1.default.yellow('DO NOT commit this auth token to your repository!'));
|
|
232
|
-
const addedEnvVarToCI = await (0,
|
|
235
|
+
const addedEnvVarToCI = await (0, clack_1.abortIfCancelled)(prompts_1.default.select({
|
|
233
236
|
message: 'Did you configure CI as shown above?',
|
|
234
237
|
options: [
|
|
235
238
|
{ label: 'Yes, continue!', value: true },
|
|
@@ -246,9 +249,8 @@ SENTRY_AUTH_TOKEN=${authToken}
|
|
|
246
249
|
prompts_1.default.log.info("Don't forget! :)");
|
|
247
250
|
}
|
|
248
251
|
}
|
|
249
|
-
function printOutro(url, orgSlug, projectId) {
|
|
250
|
-
const packageManager = (0,
|
|
251
|
-
const buildCommand = packageManager?.buildCommand ?? 'npm run build';
|
|
252
|
+
async function printOutro(url, orgSlug, projectId) {
|
|
253
|
+
const packageManager = await (0, clack_1.getPackageManager)(package_manager_1.NPM);
|
|
252
254
|
const issueStreamUrl = (0, url_1.getIssueStreamUrl)({ url, orgSlug, projectId });
|
|
253
255
|
const arrow = (0, is_unicorn_supported_1.isUnicodeSupported)() ? '→' : '->';
|
|
254
256
|
prompts_1.default.outro(`${chalk_1.default.green("That's it - everything is set up!")}
|
|
@@ -256,7 +258,7 @@ function printOutro(url, orgSlug, projectId) {
|
|
|
256
258
|
${chalk_1.default.cyan(`Test and validate your setup locally with the following Steps:
|
|
257
259
|
|
|
258
260
|
1. Build your application in ${chalk_1.default.bold('production mode')}.
|
|
259
|
-
${chalk_1.default.gray(`${arrow} For example, run ${chalk_1.default.bold(buildCommand)}.`)}
|
|
261
|
+
${chalk_1.default.gray(`${arrow} For example, run ${chalk_1.default.bold(packageManager.buildCommand)}.`)}
|
|
260
262
|
${chalk_1.default.gray(`${arrow} You should see source map upload logs in your console.`)}
|
|
261
263
|
2. Run your application and throw a test error.
|
|
262
264
|
${chalk_1.default.gray(`${arrow} The error should appear in Sentry:`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourcemaps-wizard.js","sourceRoot":"","sources":["../../../src/sourcemaps/sourcemaps-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAAyE;AACzE,6DAAmC;AACnC,kDAA0B;AAC1B,qDAAuC;AAEvC,sDAQ8B;AAC9B,+EAA0E;AAE1E,uCAAmD;AACnD,mDAA4E;AAC5E,6CAAyD;AACzD,qCAAkE;AAClE,2CAAuD;AACvD,6CAAyD;AAEzD,+DAA+E;AAC/E,qDAAyE;AACzE,4CAAwD;AACxD,yDAAyF;AACzF,6CAA0E;AAE1E,qDAAqD;AACrD,8DAA+D;AAC/D,sCAAiD;AAE1C,KAAK,UAAU,mBAAmB,CACvC,OAAsB;IAEtB,OAAO,IAAA,yBAAa,EAClB;QACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;QACjC,WAAW,EAAE,YAAY;QACzB,aAAa,EAAE,OAAO;KACvB,EACD,GAAG,EAAE,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAChD,CAAC;AACJ,CAAC;AAXD,kDAWC;AAED,KAAK,UAAU,gCAAgC,CAC7C,OAAsB;IAEtB,IAAA,0BAAY,EAAC;QACX,UAAU,EAAE,gDAAgD;QAC5D,OAAO,EAAE;+BAEP,OAAO,CAAC,gBAAgB;YACtB,CAAC,CAAC;;;kFAGwE;YAC1E,CAAC,CAAC,EACN,EAAE;QACF,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,MAAM,IAAA,qBAAS,EACxC,wBAAwB,EACxB,gEAAgD,CACjD,CAAC;IACF,IAAI,kBAAkB,EAAE;QACtB,MAAM,IAAA,qBAAS,EAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,C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-ignore - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport * as Sentry from '@sentry/node';\n\nimport {\n abort,\n abortIfCancelled,\n confirmContinueIfNoOrDirtyGitRepo,\n SENTRY_DOT_ENV_FILE,\n printWelcome,\n SENTRY_CLI_RC_FILE,\n getOrAskForProjectData,\n} from '../utils/clack-utils';\nimport { isUnicodeSupported } from '../utils/vendor/is-unicorn-supported';\nimport type { SourceMapUploadToolConfigurationOptions } from './tools/types';\nimport { configureVitePlugin } from './tools/vite';\nimport { setupNpmScriptInCI, configureSentryCLI } from './tools/sentry-cli';\nimport { configureWebPackPlugin } from './tools/webpack';\nimport { configureTscSourcemapGenerationFlow } from './tools/tsc';\nimport { configureRollupPlugin } from './tools/rollup';\nimport { configureEsbuildPlugin } from './tools/esbuild';\nimport type { WizardOptions } from '../utils/types';\nimport { configureCRASourcemapGenerationFlow } from './tools/create-react-app';\nimport { ensureMinimumSdkVersionIsInstalled } from './utils/sdk-version';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport { checkIfMoreSuitableWizardExistsAndAskForRedirect } from './utils/other-wizards';\nimport { configureAngularSourcemapGenerationFlow } from './tools/angular';\nimport type { SupportedTools } from './utils/detect-tool';\nimport { detectUsedTool } from './utils/detect-tool';\nimport { detectPackageManger } from '../utils/package-manager';\nimport { getIssueStreamUrl } from '../utils/url';\n\nexport async function runSourcemapsWizard(\n options: WizardOptions,\n): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'sourcemaps',\n wizardOptions: options,\n },\n () => runSourcemapsWizardWithTelemetry(options),\n );\n}\n\nasync function runSourcemapsWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Source Maps Upload Configuration Wizard',\n message: `This wizard will help you upload source maps to Sentry as part of your build.\nThank you for using Sentry :)${\n options.telemetryEnabled\n ? `\n\n(This setup wizard sends telemetry data and crash reports to Sentry.\nYou can turn this off by running the wizard with the '--disable-telemetry' flag.)`\n : ''\n }`,\n promoCode: options.promoCode,\n });\n\n const moreSuitableWizard = await traceStep(\n 'check-framework-wizard',\n checkIfMoreSuitableWizardExistsAndAskForRedirect,\n );\n if (moreSuitableWizard) {\n await traceStep('run-framework-wizard', () => moreSuitableWizard(options));\n return;\n }\n\n await confirmContinueIfNoOrDirtyGitRepo();\n\n await traceStep('check-sdk-version', ensureMinimumSdkVersionIsInstalled);\n\n const { selfHosted, selectedProject, sentryUrl, authToken } =\n await getOrAskForProjectData(options);\n\n const selectedTool = await traceStep('select-tool', askForUsedBundlerTool);\n\n Sentry.setTag('selected-tool', selectedTool);\n\n if (selectedTool === 'no-tool') {\n clack.log.info(\n \"No Problem! But in this case, there's nothing to configure :)\",\n );\n await abort('Exiting, have a great day!', 0);\n return;\n }\n\n await traceStep('tool-setup', () =>\n startToolSetupFlow(selectedTool, {\n orgSlug: selectedProject.organization.slug,\n projectSlug: selectedProject.slug,\n selfHosted,\n url: sentryUrl,\n authToken,\n }),\n );\n\n await traceStep('ci-setup', () =>\n setupCI(selectedTool, authToken, options.comingFrom),\n );\n\n traceStep('outro', () =>\n printOutro(\n sentryUrl,\n selectedProject.organization.slug,\n selectedProject.id,\n ),\n );\n}\n\nasync function askForUsedBundlerTool(): Promise<SupportedTools> {\n const selectedTool = await abortIfCancelled(\n clack.select({\n message: 'Which framework, bundler or build tool are you using?',\n options: [\n {\n label: 'Angular',\n value: 'angular',\n hint: 'Select this option if you are using Angular.',\n },\n {\n label: 'Create React App',\n value: 'create-react-app',\n hint: 'Select this option if you set up your app with Create React App.',\n },\n {\n label: 'Webpack',\n value: 'webpack',\n hint: 'Select this if you are using Webpack and you have access to your Webpack config.',\n },\n {\n label: 'Vite',\n value: 'vite',\n hint: 'Select this if you are using Vite and you have access to your Vite config.',\n },\n {\n label: 'esbuild',\n value: 'esbuild',\n hint: 'Select this if you are using esbuild and you have access to your esbuild config.',\n },\n {\n label: 'Rollup',\n value: 'rollup',\n hint: 'Select this if you are using Rollup and you have access to your Rollup config.',\n },\n {\n label: 'tsc',\n value: 'tsc',\n hint: 'Configure source maps when using tsc as build tool',\n },\n {\n label: 'I use another tool',\n value: 'sentry-cli',\n hint: 'This will configure source maps upload for you using sentry-cli',\n },\n {\n label: \"I don't minify, transpile or bundle my code\",\n value: 'no-tool',\n hint: 'This will exit the wizard',\n },\n ],\n initialValue: await detectUsedTool(),\n }),\n );\n\n return selectedTool;\n}\n\nasync function startToolSetupFlow(\n selctedTool: SupportedTools,\n options: SourceMapUploadToolConfigurationOptions,\n): Promise<void> {\n switch (selctedTool) {\n case 'webpack':\n await configureWebPackPlugin(options);\n break;\n case 'vite':\n await configureVitePlugin(options);\n break;\n case 'esbuild':\n await configureEsbuildPlugin(options);\n break;\n case 'rollup':\n await configureRollupPlugin(options);\n break;\n case 'tsc':\n await configureSentryCLI(options, configureTscSourcemapGenerationFlow);\n break;\n case 'create-react-app':\n await configureSentryCLI(options, configureCRASourcemapGenerationFlow);\n break;\n case 'angular':\n await configureSentryCLI(\n options,\n configureAngularSourcemapGenerationFlow,\n );\n break;\n default:\n await configureSentryCLI(options);\n break;\n }\n}\nexport async function setupCI(\n selectedTool: SupportedTools,\n authToken: string,\n comingFrom: WizardOptions['comingFrom'],\n) {\n if (comingFrom === 'vercel') {\n clack.log.info(\n 'Sentry Vercel integration is already configured. Skipping CI setup.',\n );\n Sentry.setTag('using-ci', true);\n } else {\n await traceStep('configure-ci', () => configureCI(selectedTool, authToken));\n }\n}\n\nexport async function configureCI(\n selectedTool: SupportedTools,\n authToken: string,\n): Promise<void> {\n const isUsingCI = await abortIfCancelled(\n clack.select({\n message: `Are you using a CI/CD tool to build and deploy your application?`,\n options: [\n {\n label: 'Yes',\n hint: 'I use a tool like GitHub Actions, GitLab, CircleCI, TravisCI, Jenkins, Vercel, ...',\n value: true,\n },\n {\n label: 'No',\n hint: 'I build and deploy my application manually',\n value: false,\n },\n ],\n initialValue: true,\n }),\n );\n\n Sentry.setTag('using-ci', isUsingCI);\n\n const isCliBasedFlowTool = [\n 'sentry-cli',\n 'tsc',\n 'angular',\n 'create-react-app',\n ].includes(selectedTool);\n\n const authTokenFile = isCliBasedFlowTool\n ? SENTRY_CLI_RC_FILE\n : SENTRY_DOT_ENV_FILE;\n\n if (!isUsingCI) {\n clack.log.info(\n `No Problem! Just make sure that the Sentry auth token from ${chalk.cyan(\n authTokenFile,\n )} is available whenever you build and deploy your app.`,\n );\n return;\n }\n\n if (isCliBasedFlowTool) {\n await traceStep('ci-npm-script-setup', setupNpmScriptInCI);\n }\n\n await traceStep('ci-auth-token-setup', () => setupAuthTokenInCI(authToken));\n}\n\nasync function setupAuthTokenInCI(authToken: string) {\n clack.log.step(\n 'Add the Sentry authentication token as an environment variable to your CI setup:',\n );\n\n // Intentially logging directly to console here so that the code can be copied/pasted directly\n // eslint-disable-next-line no-console\n console.log(\n chalk.greenBright(`\nSENTRY_AUTH_TOKEN=${authToken}\n`),\n );\n\n clack.log.warn(\n chalk.yellow('DO NOT commit this auth token to your repository!'),\n );\n\n const addedEnvVarToCI = await abortIfCancelled(\n clack.select({\n message: 'Did you configure CI as shown above?',\n options: [\n { label: 'Yes, continue!', value: true },\n {\n label: \"I'll do it later...\",\n value: false,\n hint: chalk.yellow(\n 'You need to set the auth token to upload source maps in CI',\n ),\n },\n ],\n initialValue: true,\n }),\n );\n\n Sentry.setTag('added-env-var-to-ci', addedEnvVarToCI);\n\n if (!addedEnvVarToCI) {\n clack.log.info(\"Don't forget! :)\");\n }\n}\n\nfunction printOutro(url: string, orgSlug: string, projectId: string) {\n const packageManager = detectPackageManger();\n const buildCommand = packageManager?.buildCommand ?? 'npm run build';\n\n const issueStreamUrl = getIssueStreamUrl({ url, orgSlug, projectId });\n\n const arrow = isUnicodeSupported() ? '→' : '->';\n\n clack.outro(`${chalk.green(\"That's it - everything is set up!\")}\n\n ${chalk.cyan(`Test and validate your setup locally with the following Steps:\n\n 1. Build your application in ${chalk.bold('production mode')}.\n ${chalk.gray(`${arrow} For example, run ${chalk.bold(buildCommand)}.`)}\n ${chalk.gray(\n `${arrow} You should see source map upload logs in your console.`,\n )}\n 2. Run your application and throw a test error.\n ${chalk.gray(`${arrow} The error should appear in Sentry:`)}\n ${chalk.gray(`${arrow} ${issueStreamUrl}`)}\n 3. Open the error in Sentry and verify that it's source-mapped.\n ${chalk.gray(\n `${arrow} The stack trace should show your original source code.`,\n )}\n `)}\n ${chalk.dim(\n `If you encounter any issues, please refer to the Troubleshooting Guide:\n https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js\n\n If the guide doesn't help or you encounter a bug, please let us know:\n https://github.com/getsentry/sentry-javascript/issues`,\n )}\n`);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sourcemaps-wizard.js","sourceRoot":"","sources":["../../../src/sourcemaps/sourcemaps-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAA+E;AAC/E,6DAAmC;AACnC,qDAAuC;AACvC,kDAA0B;AAE1B,4CAAwD;AACxD,0CASwB;AACxB,8DAA+C;AAE/C,sCAAiD;AACjD,+EAA0E;AAC1E,6CAA0E;AAC1E,+DAA+E;AAC/E,6CAAyD;AACzD,2CAAuD;AACvD,mDAA4E;AAC5E,qCAAkE;AAElE,uCAAmD;AACnD,6CAAyD;AAEzD,qDAAqD;AACrD,yDAAyF;AACzF,qDAAyE;AAElE,KAAK,UAAU,mBAAmB,CACvC,OAAsB;IAEtB,OAAO,IAAA,yBAAa,EAClB;QACE,OAAO,EAAE,OAAO,CAAC,gBAAgB;QACjC,WAAW,EAAE,YAAY;QACzB,aAAa,EAAE,OAAO;KACvB,EACD,GAAG,EAAE,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAChD,CAAC;AACJ,CAAC;AAXD,kDAWC;AAED,KAAK,UAAU,gCAAgC,CAC7C,OAAsB;IAEtB,IAAA,oBAAY,EAAC;QACX,UAAU,EAAE,gDAAgD;QAC5D,OAAO,EAAE;+BAEP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CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,CACxE;QACC,eAAK,CAAC,IAAI,CACV,GAAG,KAAK,yDAAyD,CAClE;;QAEC,eAAK,CAAC,IAAI,CAAC,GAAG,KAAK,qCAAqC,CAAC;QACzD,eAAK,CAAC,IAAI,CAAC,GAAG,KAAK,IAAI,cAAc,EAAE,CAAC;;QAExC,eAAK,CAAC,IAAI,CACV,GAAG,KAAK,yDAAyD,CAClE;IACH,CAAC;KACA,eAAK,CAAC,GAAG,CACT;;;;yDAIoD,CACrD;CACH,CAAC,CAAC;AACH,CAAC","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport * as Sentry from '@sentry/node';\nimport chalk from 'chalk';\n\nimport { traceStep, withTelemetry } from '../telemetry';\nimport {\n abort,\n abortIfCancelled,\n confirmContinueIfNoOrDirtyGitRepo,\n getOrAskForProjectData,\n getPackageManager,\n printWelcome,\n SENTRY_CLI_RC_FILE,\n SENTRY_DOT_ENV_FILE,\n} from '../utils/clack';\nimport { NPM } from '../utils/package-manager';\nimport type { WizardOptions } from '../utils/types';\nimport { getIssueStreamUrl } from '../utils/url';\nimport { isUnicodeSupported } from '../utils/vendor/is-unicorn-supported';\nimport { configureAngularSourcemapGenerationFlow } from './tools/angular';\nimport { configureCRASourcemapGenerationFlow } from './tools/create-react-app';\nimport { configureEsbuildPlugin } from './tools/esbuild';\nimport { configureRollupPlugin } from './tools/rollup';\nimport { configureSentryCLI, setupNpmScriptInCI } from './tools/sentry-cli';\nimport { configureTscSourcemapGenerationFlow } from './tools/tsc';\nimport type { SourceMapUploadToolConfigurationOptions } from './tools/types';\nimport { configureVitePlugin } from './tools/vite';\nimport { configureWebPackPlugin } from './tools/webpack';\nimport type { SupportedTools } from './utils/detect-tool';\nimport { detectUsedTool } from './utils/detect-tool';\nimport { checkIfMoreSuitableWizardExistsAndAskForRedirect } from './utils/other-wizards';\nimport { ensureMinimumSdkVersionIsInstalled } from './utils/sdk-version';\n\nexport async function runSourcemapsWizard(\n options: WizardOptions,\n): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'sourcemaps',\n wizardOptions: options,\n },\n () => runSourcemapsWizardWithTelemetry(options),\n );\n}\n\nasync function runSourcemapsWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Source Maps Upload Configuration Wizard',\n message: `This wizard will help you upload source maps to Sentry as part of your build.\nThank you for using Sentry :)${\n options.telemetryEnabled\n ? `\n\n(This setup wizard sends telemetry data and crash reports to Sentry.\nYou can turn this off by running the wizard with the '--disable-telemetry' flag.)`\n : ''\n }`,\n promoCode: options.promoCode,\n });\n\n const moreSuitableWizard = await traceStep(\n 'check-framework-wizard',\n checkIfMoreSuitableWizardExistsAndAskForRedirect,\n );\n if (moreSuitableWizard) {\n await traceStep('run-framework-wizard', () => moreSuitableWizard(options));\n return;\n }\n\n await confirmContinueIfNoOrDirtyGitRepo({\n ignoreGitChanges: options.ignoreGitChanges,\n cwd: undefined,\n });\n\n await traceStep('check-sdk-version', ensureMinimumSdkVersionIsInstalled);\n\n const { selfHosted, selectedProject, sentryUrl, authToken } =\n await getOrAskForProjectData(options);\n\n const selectedTool = await traceStep('select-tool', askForUsedBundlerTool);\n\n Sentry.setTag('selected-tool', selectedTool);\n\n if (selectedTool === 'no-tool') {\n clack.log.info(\n \"No Problem! But in this case, there's nothing to configure :)\",\n );\n await abort('Exiting, have a great day!', 0);\n return;\n }\n\n await traceStep('tool-setup', () =>\n startToolSetupFlow(selectedTool, {\n orgSlug: selectedProject.organization.slug,\n projectSlug: selectedProject.slug,\n selfHosted,\n url: sentryUrl,\n authToken,\n }),\n );\n\n await traceStep('ci-setup', () =>\n setupCI(selectedTool, authToken, options.comingFrom),\n );\n\n await traceStep('outro', () =>\n printOutro(\n sentryUrl,\n selectedProject.organization.slug,\n selectedProject.id,\n ),\n );\n}\n\nasync function askForUsedBundlerTool(): Promise<SupportedTools> {\n const selectedTool = await abortIfCancelled(\n clack.select({\n message: 'Which framework, bundler or build tool are you using?',\n options: [\n {\n label: 'Angular',\n value: 'angular',\n hint: 'Select this option if you are using Angular.',\n },\n {\n label: 'Create React App',\n value: 'create-react-app',\n hint: 'Select this option if you set up your app with Create React App.',\n },\n {\n label: 'Webpack',\n value: 'webpack',\n hint: 'Select this if you are using Webpack and you have access to your Webpack config.',\n },\n {\n label: 'Vite',\n value: 'vite',\n hint: 'Select this if you are using Vite and you have access to your Vite config.',\n },\n {\n label: 'esbuild',\n value: 'esbuild',\n hint: 'Select this if you are using esbuild and you have access to your esbuild config.',\n },\n {\n label: 'Rollup',\n value: 'rollup',\n hint: 'Select this if you are using Rollup and you have access to your Rollup config.',\n },\n {\n label: 'tsc',\n value: 'tsc',\n hint: 'Configure source maps when using tsc as build tool',\n },\n {\n label: 'I use another tool',\n value: 'sentry-cli',\n hint: 'This will configure source maps upload for you using sentry-cli',\n },\n {\n label: \"I don't minify, transpile or bundle my code\",\n value: 'no-tool',\n hint: 'This will exit the wizard',\n },\n ],\n initialValue: await detectUsedTool(),\n }),\n );\n\n return selectedTool;\n}\n\nasync function startToolSetupFlow(\n selctedTool: SupportedTools,\n options: SourceMapUploadToolConfigurationOptions,\n): Promise<void> {\n switch (selctedTool) {\n case 'webpack':\n await configureWebPackPlugin(options);\n break;\n case 'vite':\n await configureVitePlugin(options);\n break;\n case 'esbuild':\n await configureEsbuildPlugin(options);\n break;\n case 'rollup':\n await configureRollupPlugin(options);\n break;\n case 'tsc':\n await configureSentryCLI(options, configureTscSourcemapGenerationFlow);\n break;\n case 'create-react-app':\n await configureSentryCLI(options, configureCRASourcemapGenerationFlow);\n break;\n case 'angular':\n await configureSentryCLI(\n options,\n configureAngularSourcemapGenerationFlow,\n );\n break;\n default:\n await configureSentryCLI(options);\n break;\n }\n}\nexport async function setupCI(\n selectedTool: SupportedTools,\n authToken: string,\n comingFrom: WizardOptions['comingFrom'],\n) {\n if (comingFrom === 'vercel') {\n clack.log.info(\n 'Sentry Vercel integration is already configured. Skipping CI setup.',\n );\n Sentry.setTag('using-ci', true);\n } else {\n await traceStep('configure-ci', () => configureCI(selectedTool, authToken));\n }\n}\n\nexport async function configureCI(\n selectedTool: SupportedTools,\n authToken: string,\n): Promise<void> {\n const isUsingCI = await abortIfCancelled(\n clack.select({\n message: `Are you using a CI/CD tool to build and deploy your application?`,\n options: [\n {\n label: 'Yes',\n hint: 'I use a tool like GitHub Actions, GitLab, CircleCI, TravisCI, Jenkins, Vercel, ...',\n value: true,\n },\n {\n label: 'No',\n hint: 'I build and deploy my application manually',\n value: false,\n },\n ],\n initialValue: true,\n }),\n );\n\n Sentry.setTag('using-ci', isUsingCI);\n\n const isCliBasedFlowTool = [\n 'sentry-cli',\n 'tsc',\n 'angular',\n 'create-react-app',\n ].includes(selectedTool);\n\n const authTokenFile = isCliBasedFlowTool\n ? SENTRY_CLI_RC_FILE\n : SENTRY_DOT_ENV_FILE;\n\n if (!isUsingCI) {\n clack.log.info(\n `No Problem! Just make sure that the Sentry auth token from ${chalk.cyan(\n authTokenFile,\n )} is available whenever you build and deploy your app.`,\n );\n return;\n }\n\n if (isCliBasedFlowTool) {\n await traceStep('ci-npm-script-setup', setupNpmScriptInCI);\n }\n\n await traceStep('ci-auth-token-setup', () => setupAuthTokenInCI(authToken));\n}\n\nasync function setupAuthTokenInCI(authToken: string) {\n clack.log.step(\n 'Add the Sentry authentication token as an environment variable to your CI setup:',\n );\n\n // Intentially logging directly to console here so that the code can be copied/pasted directly\n // eslint-disable-next-line no-console\n console.log(\n chalk.greenBright(`\nSENTRY_AUTH_TOKEN=${authToken}\n`),\n );\n\n clack.log.warn(\n chalk.yellow('DO NOT commit this auth token to your repository!'),\n );\n\n const addedEnvVarToCI = await abortIfCancelled(\n clack.select({\n message: 'Did you configure CI as shown above?',\n options: [\n { label: 'Yes, continue!', value: true },\n {\n label: \"I'll do it later...\",\n value: false,\n hint: chalk.yellow(\n 'You need to set the auth token to upload source maps in CI',\n ),\n },\n ],\n initialValue: true,\n }),\n );\n\n Sentry.setTag('added-env-var-to-ci', addedEnvVarToCI);\n\n if (!addedEnvVarToCI) {\n clack.log.info(\"Don't forget! :)\");\n }\n}\n\nasync function printOutro(\n url: string,\n orgSlug: string,\n projectId: string,\n): Promise<void> {\n const packageManager = await getPackageManager(NPM);\n\n const issueStreamUrl = getIssueStreamUrl({ url, orgSlug, projectId });\n\n const arrow = isUnicodeSupported() ? '→' : '->';\n\n clack.outro(`${chalk.green(\"That's it - everything is set up!\")}\n\n ${chalk.cyan(`Test and validate your setup locally with the following Steps:\n\n 1. Build your application in ${chalk.bold('production mode')}.\n ${chalk.gray(\n `${arrow} For example, run ${chalk.bold(packageManager.buildCommand)}.`,\n )}\n ${chalk.gray(\n `${arrow} You should see source map upload logs in your console.`,\n )}\n 2. Run your application and throw a test error.\n ${chalk.gray(`${arrow} The error should appear in Sentry:`)}\n ${chalk.gray(`${arrow} ${issueStreamUrl}`)}\n 3. Open the error in Sentry and verify that it's source-mapped.\n ${chalk.gray(\n `${arrow} The stack trace should show your original source code.`,\n )}\n `)}\n ${chalk.dim(\n `If you encounter any issues, please refer to the Troubleshooting Guide:\n https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js\n\n If the guide doesn't help or you encounter a bug, please let us know:\n https://github.com/getsentry/sentry-javascript/issues`,\n )}\n`);\n}\n"]}
|
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.configureAngularSourcemapGenerationFlow = void 0;
|
|
7
|
-
// @ts-
|
|
7
|
+
// @ts-expect-error - clack is ESM and TS complains about that. It works though
|
|
8
8
|
const prompts_1 = __importDefault(require("@clack/prompts"));
|
|
9
9
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
-
const
|
|
10
|
+
const clack_1 = require("../../utils/clack");
|
|
11
11
|
const angularJsonTemplate = chalk_1.default.gray(`{
|
|
12
12
|
"projects": {
|
|
13
13
|
"your-project": {
|
|
@@ -26,7 +26,7 @@ async function configureAngularSourcemapGenerationFlow() {
|
|
|
26
26
|
// Intentially logging directly to console here so that the code can be copied/pasted directly
|
|
27
27
|
// eslint-disable-next-line no-console
|
|
28
28
|
console.log(angularJsonTemplate);
|
|
29
|
-
await (0,
|
|
29
|
+
await (0, clack_1.abortIfCancelled)(prompts_1.default.select({
|
|
30
30
|
message: `Verify that you are generating source maps when building your Angular app.`,
|
|
31
31
|
options: [
|
|
32
32
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/angular.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"angular.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/angular.ts"],"names":[],"mappings":";;;;;;AAAA,+EAA+E;AAC/E,6DAAmC;AACnC,kDAA0B;AAC1B,6CAAqD;AAErD,MAAM,mBAAmB,GAAG,eAAK,CAAC,IAAI,CAAC;;;;;;cAMzB,eAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC;;;;;;EAMlD,CAAC,CAAC;AAEG,KAAK,UAAU,uCAAuC;IAC3D,iBAAK,CAAC,GAAG,CAAC,IAAI,CACZ,yCAAyC,eAAK,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAC5E,CAAC;IAEF,8FAA8F;IAC9F,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAEjC,MAAM,IAAA,wBAAgB,EACpB,iBAAK,CAAC,MAAM,CAAC;QACX,OAAO,EAAE,4EAA4E;QACrF,OAAO,EAAE;YACP;gBACE,KAAK,EAAE,YAAY;gBACnB,IAAI,EAAE,8DAA8D;gBACpE,KAAK,EAAE,IAAI;aACZ;SACF;QACD,YAAY,EAAE,IAAI;KACnB,CAAC,CACH,CAAC;AACJ,CAAC;AAtBD,0FAsBC","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport { abortIfCancelled } from '../../utils/clack';\n\nconst angularJsonTemplate = chalk.gray(`{\n \"projects\": {\n \"your-project\": {\n \"architect\": {\n \"build\": {\n \"options\": {\n ${chalk.greenBright(`\"sourceMap\": true`)}\n },\n },\n }\n }\n }\n}`);\n\nexport async function configureAngularSourcemapGenerationFlow(): Promise<void> {\n clack.log.info(\n `Enable generating source maps in your ${chalk.bold('angular.json')} file:`,\n );\n\n // Intentially logging directly to console here so that the code can be copied/pasted directly\n // eslint-disable-next-line no-console\n console.log(angularJsonTemplate);\n\n await abortIfCancelled(\n clack.select({\n message: `Verify that you are generating source maps when building your Angular app.`,\n options: [\n {\n label: 'I checked!',\n hint: 'My build output folder contains .js.map files after a build.',\n value: true,\n },\n ],\n initialValue: true,\n }),\n );\n}\n"]}
|
|
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.configureCRASourcemapGenerationFlow = void 0;
|
|
7
|
-
// @ts-
|
|
7
|
+
// @ts-expect-error - clack is ESM and TS complains about that. It works though
|
|
8
8
|
const prompts_1 = __importDefault(require("@clack/prompts"));
|
|
9
|
-
const
|
|
9
|
+
const clack_1 = require("../../utils/clack");
|
|
10
10
|
async function configureCRASourcemapGenerationFlow() {
|
|
11
|
-
await (0,
|
|
11
|
+
await (0, clack_1.abortIfCancelled)(prompts_1.default.select({
|
|
12
12
|
message: `Verify that you are generating source maps when building your React app.\nGenerally this should already happen unless you set the GENERATE_SOURCEMAPS environment variable to false.`,
|
|
13
13
|
options: [
|
|
14
14
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-react-app.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/create-react-app.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"create-react-app.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/create-react-app.ts"],"names":[],"mappings":";;;;;;AAAA,+EAA+E;AAC/E,6DAAmC;AACnC,6CAAqD;AAE9C,KAAK,UAAU,mCAAmC;IACvD,MAAM,IAAA,wBAAgB,EACpB,iBAAK,CAAC,MAAM,CAAC;QACX,OAAO,EAAE,sLAAsL;QAC/L,OAAO,EAAE;YACP;gBACE,KAAK,EAAE,YAAY;gBACnB,IAAI,EAAE,8DAA8D;gBACpE,KAAK,EAAE,IAAI;aACZ;SACF;QACD,YAAY,EAAE,IAAI;KACnB,CAAC,CACH,CAAC;AACJ,CAAC;AAdD,kFAcC","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport { abortIfCancelled } from '../../utils/clack';\n\nexport async function configureCRASourcemapGenerationFlow(): Promise<void> {\n await abortIfCancelled(\n clack.select({\n message: `Verify that you are generating source maps when building your React app.\\nGenerally this should already happen unless you set the GENERATE_SOURCEMAPS environment variable to false.`,\n options: [\n {\n label: 'I checked!',\n hint: 'My build output folder contains .js.map files after a build.',\n value: true,\n },\n ],\n initialValue: true,\n }),\n );\n}\n"]}
|
|
@@ -27,10 +27,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.configureEsbuildPlugin = void 0;
|
|
30
|
-
// @ts-
|
|
30
|
+
// @ts-expect-error - clack is ESM and TS complains about that. It works though
|
|
31
31
|
const prompts_1 = __importStar(require("@clack/prompts"));
|
|
32
32
|
const chalk_1 = __importDefault(require("chalk"));
|
|
33
|
-
const
|
|
33
|
+
const clack_1 = require("../../utils/clack");
|
|
34
34
|
const package_json_1 = require("../../utils/package-json");
|
|
35
35
|
const getCodeSnippet = (options) => chalk_1.default.gray(`
|
|
36
36
|
${chalk_1.default.greenBright('const { sentryEsbuildPlugin } = require("@sentry/esbuild-plugin");')}
|
|
@@ -48,20 +48,20 @@ require("esbuild").build({
|
|
|
48
48
|
});
|
|
49
49
|
`);
|
|
50
50
|
const configureEsbuildPlugin = async (options) => {
|
|
51
|
-
await (0,
|
|
51
|
+
await (0, clack_1.installPackage)({
|
|
52
52
|
packageName: '@sentry/esbuild-plugin',
|
|
53
|
-
alreadyInstalled: (0, package_json_1.hasPackageInstalled)('@sentry/esbuild-plugin', await (0,
|
|
53
|
+
alreadyInstalled: (0, package_json_1.hasPackageInstalled)('@sentry/esbuild-plugin', await (0, clack_1.getPackageDotJson)()),
|
|
54
54
|
});
|
|
55
55
|
prompts_1.default.log.step(`Add the following code to your esbuild config:`);
|
|
56
56
|
// Intentially logging directly to console here so that the code can be copied/pasted directly
|
|
57
57
|
// eslint-disable-next-line no-console
|
|
58
58
|
console.log(getCodeSnippet(options));
|
|
59
|
-
await (0,
|
|
59
|
+
await (0, clack_1.abortIfCancelled)((0, prompts_1.select)({
|
|
60
60
|
message: 'Did you copy the snippet above?',
|
|
61
61
|
options: [{ label: 'Yes, continue!', value: true }],
|
|
62
62
|
initialValue: true,
|
|
63
63
|
}));
|
|
64
|
-
await (0,
|
|
64
|
+
await (0, clack_1.addDotEnvSentryBuildPluginFile)(options.authToken);
|
|
65
65
|
};
|
|
66
66
|
exports.configureEsbuildPlugin = configureEsbuildPlugin;
|
|
67
67
|
//# sourceMappingURL=esbuild.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esbuild.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/esbuild.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"esbuild.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/esbuild.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAA+E;AAC/E,0DAA+C;AAC/C,kDAA0B;AAC1B,6CAK2B;AAC3B,2DAA+D;AAO/D,MAAM,cAAc,GAAG,CAAC,OAAgD,EAAE,EAAE,CAC1E,eAAK,CAAC,IAAI,CAAC;EACX,eAAK,CAAC,WAAW,CACjB,oEAAoE,CACrE;;;IAGG,eAAK,CAAC,WAAW,CACjB,6DAA6D,CAC9D;;;MAGG,eAAK,CAAC,WAAW,CAAC;;cAEV,OAAO,CAAC,OAAO;kBACX,OAAO,CAAC,WAAW,KAC/B,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAC1D;QACI,CAAC;;;CAGR,CAAC,CAAC;AAEI,MAAM,sBAAsB,GACjC,KAAK,EAAE,OAAO,EAAE,EAAE;IAChB,MAAM,IAAA,sBAAc,EAAC;QACnB,WAAW,EAAE,wBAAwB;QACrC,gBAAgB,EAAE,IAAA,kCAAmB,EACnC,wBAAwB,EACxB,MAAM,IAAA,yBAAiB,GAAE,CAC1B;KACF,CAAC,CAAC;IAEH,iBAAK,CAAC,GAAG,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;IAEjE,8FAA8F;IAC9F,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAErC,MAAM,IAAA,wBAAgB,EACpB,IAAA,gBAAM,EAAC;QACL,OAAO,EAAE,iCAAiC;QAC1C,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACnD,YAAY,EAAE,IAAI;KACnB,CAAC,CACH,CAAC;IAEF,MAAM,IAAA,sCAA8B,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAC1D,CAAC,CAAC;AAzBS,QAAA,sBAAsB,0BAyB/B","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack, { select } from '@clack/prompts';\nimport chalk from 'chalk';\nimport {\n abortIfCancelled,\n addDotEnvSentryBuildPluginFile,\n getPackageDotJson,\n installPackage,\n} from '../../utils/clack';\nimport { hasPackageInstalled } from '../../utils/package-json';\n\nimport {\n SourceMapUploadToolConfigurationFunction,\n SourceMapUploadToolConfigurationOptions,\n} from './types';\n\nconst getCodeSnippet = (options: SourceMapUploadToolConfigurationOptions) =>\n chalk.gray(`\n${chalk.greenBright(\n 'const { sentryEsbuildPlugin } = require(\"@sentry/esbuild-plugin\");',\n)}\n\nrequire(\"esbuild\").build({\n ${chalk.greenBright(\n 'sourcemap: true, // Source map generation must be turned on',\n )}\n plugins: [\n // Put the Sentry esbuild plugin after all other plugins\n ${chalk.greenBright(`sentryEsbuildPlugin({\n authToken: process.env.SENTRY_AUTH_TOKEN,\n org: \"${options.orgSlug}\",\n project: \"${options.projectSlug}\",${\n options.selfHosted ? `\\n url: \"${options.url}\",` : ''\n }\n }),`)}\n ],\n});\n`);\n\nexport const configureEsbuildPlugin: SourceMapUploadToolConfigurationFunction =\n async (options) => {\n await installPackage({\n packageName: '@sentry/esbuild-plugin',\n alreadyInstalled: hasPackageInstalled(\n '@sentry/esbuild-plugin',\n await getPackageDotJson(),\n ),\n });\n\n clack.log.step(`Add the following code to your esbuild config:`);\n\n // Intentially logging directly to console here so that the code can be copied/pasted directly\n // eslint-disable-next-line no-console\n console.log(getCodeSnippet(options));\n\n await abortIfCancelled(\n select({\n message: 'Did you copy the snippet above?',\n options: [{ label: 'Yes, continue!', value: true }],\n initialValue: true,\n }),\n );\n\n await addDotEnvSentryBuildPluginFile(options.authToken);\n };\n"]}
|
|
@@ -27,12 +27,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.configureNextJsSourceMapsUpload = void 0;
|
|
30
|
-
// @ts-
|
|
30
|
+
// @ts-expect-error - clack is ESM and TS complains about that. It works though
|
|
31
31
|
const clack = __importStar(require("@clack/prompts"));
|
|
32
32
|
const chalk_1 = __importDefault(require("chalk"));
|
|
33
33
|
const nextjs_wizard_1 = require("../../nextjs/nextjs-wizard");
|
|
34
34
|
const telemetry_1 = require("../../telemetry");
|
|
35
|
-
const
|
|
35
|
+
const clack_1 = require("../../utils/clack");
|
|
36
36
|
const Sentry = __importStar(require("@sentry/node"));
|
|
37
37
|
const getCodeSnippet = (options) => chalk_1.default.grey(`
|
|
38
38
|
${chalk_1.default.greenBright('const { withSentryConfig } = require("@sentry/nextjs");')}
|
|
@@ -63,7 +63,7 @@ const configureNextJsSourceMapsUpload = async (options, wizardOptions) => {
|
|
|
63
63
|
But don't worry, we can redirect you to the wizard now!
|
|
64
64
|
|
|
65
65
|
In case you already tried the wizard, we can also show you how to configure your ${chalk_1.default.cyan('next.config.js')} file manually instead.`);
|
|
66
|
-
const shouldRedirect = await (0,
|
|
66
|
+
const shouldRedirect = await (0, clack_1.abortIfCancelled)(clack.select({
|
|
67
67
|
message: 'Do you want to run the Sentry Wizard for Next.JS now?',
|
|
68
68
|
options: [
|
|
69
69
|
{
|
|
@@ -88,12 +88,12 @@ In case you already tried the wizard, we can also show you how to configure your
|
|
|
88
88
|
// Intentionally logging directly to console here
|
|
89
89
|
// eslint-disable-next-line no-console
|
|
90
90
|
console.log(getCodeSnippet(options));
|
|
91
|
-
await (0, telemetry_1.traceStep)('nextjs-manual-nextconfigjs', () => (0,
|
|
91
|
+
await (0, telemetry_1.traceStep)('nextjs-manual-nextconfigjs', () => (0, clack_1.abortIfCancelled)(clack.select({
|
|
92
92
|
message: 'Did you copy the code above?',
|
|
93
93
|
options: [{ label: 'Yes, continue!', value: true }],
|
|
94
94
|
initialValue: true,
|
|
95
95
|
})));
|
|
96
|
-
await (0, telemetry_1.traceStep)('nextjs-manual-sentryclirc', () => (0,
|
|
96
|
+
await (0, telemetry_1.traceStep)('nextjs-manual-sentryclirc', () => (0, clack_1.addDotEnvSentryBuildPluginFile)(options.authToken));
|
|
97
97
|
}
|
|
98
98
|
clack.log
|
|
99
99
|
.info(`In case you still run into problems, check out our docs to further debug your setup:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextjs.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/nextjs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"nextjs.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/nextjs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAA+E;AAC/E,sDAAwC;AACxC,kDAA0B;AAC1B,8DAA6D;AAC7D,+CAA4C;AAC5C,6CAG2B;AAK3B,qDAAuC;AAEvC,MAAM,cAAc,GAAG,CAAC,OAAgD,EAAE,EAAE,CAC1E,eAAK,CAAC,IAAI,CAAC;IACT,eAAK,CAAC,WAAW,CACjB,yDAAyD,CAC1D;;;;;;IAMC,eAAK,CAAC,WAAW,CAAC;YACV,OAAO,CAAC,OAAO;gBACX,OAAO,CAAC,WAAW,KAC/B,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EACxD;KACG,CAAC;;IAEF,eAAK,CAAC,WAAW,CAAC;;;KAGjB,CAAC;;IAEF,eAAK,CAAC,WAAW,CAAC;;;;KAIjB,CAAC;CACL,CAAC,CAAC;AAEI,MAAM,+BAA+B,GAAG,KAAK,EAClD,OAAgD,EAChD,aAA4B,EAC5B,EAAE;IACF,KAAK,CAAC,GAAG;SACN,IAAI,CAAC;;;mFAGyE,eAAK,CAAC,IAAI,CACzF,gBAAgB,CACjB,yBAAyB,CAAC,CAAC;IAE5B,MAAM,cAAc,GAAY,MAAM,IAAA,wBAAgB,EACpD,KAAK,CAAC,MAAM,CAAC;QACX,OAAO,EAAE,uDAAuD;QAChE,OAAO,EAAE;YACP;gBACE,KAAK,EAAE,sBAAsB;gBAC7B,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,8CAA8C;aACrD;YACD;gBACE,KAAK,EAAE,0CAA0C;gBACjD,KAAK,EAAE,KAAK;aACb;SACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,MAAM,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC;IAExD,IAAI,cAAc,EAAE;QAClB,MAAM,IAAA,qBAAS,EAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,IAAA,+BAAe,EAAC,aAAa,CAAC,CAAC,CAAC;QAC3E,KAAK,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAC9D,KAAK,CAAC,GAAG,CAAC,IAAI,CACZ,+DAA+D,CAChE,CAAC;KACH;SAAM;QACL,KAAK,CAAC,GAAG,CAAC,IAAI,CACZ,kCAAkC,eAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAClE,CAAC;QAEF,iDAAiD;QACjD,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;QAErC,MAAM,IAAA,qBAAS,EAAC,4BAA4B,EAAE,GAAG,EAAE,CACjD,IAAA,wBAAgB,EACd,KAAK,CAAC,MAAM,CAAC;YACX,OAAO,EAAE,8BAA8B;YACvC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YACnD,YAAY,EAAE,IAAI;SACnB,CAAC,CACH,CACF,CAAC;QAEF,MAAM,IAAA,qBAAS,EAAC,2BAA2B,EAAE,GAAG,EAAE,CAChD,IAAA,sCAA8B,EAAC,OAAO,CAAC,SAAS,CAAC,CAClD,CAAC;KACH;IAED,KAAK,CAAC,GAAG;SACN,IAAI,CAAC;;;;;;2EAMiE,CAAC,CAAC;AAC7E,CAAC,CAAC;AArEW,QAAA,+BAA+B,mCAqE1C","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport { runNextjsWizard } from '../../nextjs/nextjs-wizard';\nimport { traceStep } from '../../telemetry';\nimport {\n abortIfCancelled,\n addDotEnvSentryBuildPluginFile,\n} from '../../utils/clack';\nimport type { WizardOptions } from '../../utils/types';\n\nimport type { SourceMapUploadToolConfigurationOptions } from './types';\n\nimport * as Sentry from '@sentry/node';\n\nconst getCodeSnippet = (options: SourceMapUploadToolConfigurationOptions) =>\n chalk.grey(`\n ${chalk.greenBright(\n 'const { withSentryConfig } = require(\"@sentry/nextjs\");',\n )}\n\n const nextConfig = {\n // your existing next config\n };\n\n ${chalk.greenBright(`const sentryWebpackPluginOptions = {\n org: \"${options.orgSlug}\",\n project: \"${options.projectSlug}\",${\n options.selfHosted ? `\\n url: \"${options.url}\",` : ''\n }\n };`)}\n\n ${chalk.greenBright(`const sentryOptions = {\n // Upload additional client files (increases upload size)\n widenClientFileUpload: true,\n };`)}\n\n ${chalk.greenBright(`module.exports = withSentryConfig(\n nextConfig,\n sentryWebpackPluginOptions,\n sentryOptions\n );`)}\n`);\n\nexport const configureNextJsSourceMapsUpload = async (\n options: SourceMapUploadToolConfigurationOptions,\n wizardOptions: WizardOptions,\n) => {\n clack.log\n .info(`Source Maps upload for Next.js is configured automatically by default if you run the Sentry Wizard for Next.JS.\nBut don't worry, we can redirect you to the wizard now!\n\nIn case you already tried the wizard, we can also show you how to configure your ${chalk.cyan(\n 'next.config.js',\n )} file manually instead.`);\n\n const shouldRedirect: boolean = await abortIfCancelled(\n clack.select({\n message: 'Do you want to run the Sentry Wizard for Next.JS now?',\n options: [\n {\n label: 'Yes, run the wizard!',\n value: true,\n hint: 'The wizard can also configure your SDK setup',\n },\n {\n label: 'No, show me how to configure it manually',\n value: false,\n },\n ],\n }),\n );\n\n Sentry.setTag('redirect-nextjs-wizard', shouldRedirect);\n\n if (shouldRedirect) {\n await traceStep('run-nextjs-wizard', () => runNextjsWizard(wizardOptions));\n clack.intro('Sentry Source Maps Upload Configuration Wizard');\n clack.log.info(\n \"Welcome back to the Source Maps wizard - we're almost done ;)\",\n );\n } else {\n clack.log.info(\n `Add the following code to your ${chalk.cyan('next.config.js')}:`,\n );\n\n // Intentionally logging directly to console here\n // eslint-disable-next-line no-console\n console.log(getCodeSnippet(options));\n\n await traceStep('nextjs-manual-nextconfigjs', () =>\n abortIfCancelled(\n clack.select({\n message: 'Did you copy the code above?',\n options: [{ label: 'Yes, continue!', value: true }],\n initialValue: true,\n }),\n ),\n );\n\n await traceStep('nextjs-manual-sentryclirc', () =>\n addDotEnvSentryBuildPluginFile(options.authToken),\n );\n }\n\n clack.log\n .info(`In case you still run into problems, check out our docs to further debug your setup:\n\nUploading Source Maps:\nhttps://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-source-maps\n\nTroubleshooting Source Maps:\nhttps://docs.sentry.io/platforms/javascript/guides/nextjs/troubleshooting/`);\n};\n"]}
|
|
@@ -27,19 +27,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.configureRemixSourceMapsUpload = void 0;
|
|
30
|
-
// @ts-
|
|
30
|
+
// @ts-expect-error - clack is ESM and TS complains about that. It works though
|
|
31
31
|
const clack = __importStar(require("@clack/prompts"));
|
|
32
32
|
const chalk_1 = __importDefault(require("chalk"));
|
|
33
33
|
const remix_wizard_1 = require("../../remix/remix-wizard");
|
|
34
34
|
const telemetry_1 = require("../../telemetry");
|
|
35
|
-
const
|
|
35
|
+
const clack_1 = require("../../utils/clack");
|
|
36
36
|
const Sentry = __importStar(require("@sentry/node"));
|
|
37
37
|
const configureRemixSourceMapsUpload = async (options, wizardOptions) => {
|
|
38
38
|
clack.log
|
|
39
39
|
.info(`Source Maps upload for Remix is configured automatically by default if you run the Sentry Wizard for Remix.
|
|
40
40
|
But don't worry, we can redirect you to the wizard now!
|
|
41
41
|
In case you already tried the wizard, we can also show you how to configure your ${chalk_1.default.cyan('remix.config.js')} file manually instead.`);
|
|
42
|
-
const shouldRedirect = await (0,
|
|
42
|
+
const shouldRedirect = await (0, clack_1.abortIfCancelled)(clack.select({
|
|
43
43
|
message: 'Do you want to run the Sentry Wizard for Remix now?',
|
|
44
44
|
options: [
|
|
45
45
|
{
|
|
@@ -69,7 +69,7 @@ In case you already tried the wizard, we can also show you how to configure your
|
|
|
69
69
|
|
|
70
70
|
To see all available options for ${chalk_1.default.cyan('sentry-upload-sourcemaps')}, run ${chalk_1.default.cyan('sentry-upload-sourcemaps --help')}
|
|
71
71
|
`);
|
|
72
|
-
await (0,
|
|
72
|
+
await (0, clack_1.abortIfCancelled)(clack.select({
|
|
73
73
|
message: 'Did you finish configuring your build and prod scripts?',
|
|
74
74
|
options: [{ label: 'Yes, continue!', value: true }],
|
|
75
75
|
initialValue: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remix.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/remix.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"remix.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/remix.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAA+E;AAC/E,sDAAwC;AACxC,kDAA0B;AAC1B,2DAA0D;AAC1D,+CAA4C;AAC5C,6CAAqD;AAIrD,qDAAuC;AAEhC,MAAM,8BAA8B,GAAG,KAAK,EACjD,OAAgD,EAChD,aAA4B,EAC5B,EAAE;IACF,KAAK,CAAC,GAAG;SACN,IAAI,CAAC;;mFAEyE,eAAK,CAAC,IAAI,CACzF,iBAAiB,CAClB,yBAAyB,CAAC,CAAC;IAE5B,MAAM,cAAc,GAAY,MAAM,IAAA,wBAAgB,EACpD,KAAK,CAAC,MAAM,CAAC;QACX,OAAO,EAAE,qDAAqD;QAC9D,OAAO,EAAE;YACP;gBACE,KAAK,EAAE,sBAAsB;gBAC7B,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,8C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F,MAAM,WAAW,GAAG,eAAK,CAAC,IAAI,CAAC;;IAE3B,eAAK,CAAC,WAAW,CACjB,gEAAgE,CACjE;;CAEF,CAAC,CAAC","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport { runRemixWizard } from '../../remix/remix-wizard';\nimport { traceStep } from '../../telemetry';\nimport { abortIfCancelled } from '../../utils/clack';\nimport type { WizardOptions } from '../../utils/types';\nimport type { SourceMapUploadToolConfigurationOptions } from './types';\n\nimport * as Sentry from '@sentry/node';\n\nexport const configureRemixSourceMapsUpload = async (\n options: SourceMapUploadToolConfigurationOptions,\n wizardOptions: WizardOptions,\n) => {\n clack.log\n .info(`Source Maps upload for Remix is configured automatically by default if you run the Sentry Wizard for Remix.\nBut don't worry, we can redirect you to the wizard now!\nIn case you already tried the wizard, we can also show you how to configure your ${chalk.cyan(\n 'remix.config.js',\n )} file manually instead.`);\n\n const shouldRedirect: boolean = await abortIfCancelled(\n clack.select({\n message: 'Do you want to run the Sentry Wizard for Remix now?',\n options: [\n {\n label: 'Yes, run the wizard!',\n value: true,\n hint: 'The wizard can also configure your SDK setup',\n },\n {\n label: 'No, show me how to configure it manually',\n value: false,\n },\n ],\n }),\n );\n\n Sentry.setTag('redirect-remix-wizard', shouldRedirect);\n\n if (shouldRedirect) {\n await traceStep('run-remix-wizard', () => runRemixWizard(wizardOptions));\n clack.intro('Sentry Source Maps Upload Configuration Wizard');\n clack.log.info(\n \"Welcome back to the Source Maps wizard - we're almost done ;)\",\n );\n } else {\n clack.log.step(\n `Build your app with ${chalk.cyan(\n 'remix build --sourcemap',\n )}, then upload your source maps using ${chalk.cyan(\n 'sentry-upload-sourcemaps',\n )} cli tool.`,\n );\n\n clack.log.step(\n `You can add ${chalk.cyan(\n 'sentry-upload-sourcemaps',\n )} to your build script in ${chalk.cyan('package.json')} like this:`,\n );\n\n // Intentially logging directly to console here so that the code can be copied/pasted directly\n // eslint-disable-next-line no-console\n console.log(codeSnippet);\n\n clack.log.step(`or run it manually after building your app.\n\nTo see all available options for ${chalk.cyan(\n 'sentry-upload-sourcemaps',\n )}, run ${chalk.cyan('sentry-upload-sourcemaps --help')}\n`);\n\n await abortIfCancelled(\n clack.select({\n message: 'Did you finish configuring your build and prod scripts?',\n options: [{ label: 'Yes, continue!', value: true }],\n initialValue: true,\n }),\n );\n }\n};\n\nconst codeSnippet = chalk.gray(`\n\"scripts\": {\n ${chalk.greenBright(\n '\"build\": \"remix build --sourcemap && sentry-upload-sourcemaps\"',\n )};\n}\n`);\n"]}
|
|
@@ -27,10 +27,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.configureRollupPlugin = void 0;
|
|
30
|
-
// @ts-
|
|
30
|
+
// @ts-expect-error - clack is ESM and TS complains about that. It works though
|
|
31
31
|
const prompts_1 = __importStar(require("@clack/prompts"));
|
|
32
32
|
const chalk_1 = __importDefault(require("chalk"));
|
|
33
|
-
const
|
|
33
|
+
const clack_1 = require("../../utils/clack");
|
|
34
34
|
const package_json_1 = require("../../utils/package-json");
|
|
35
35
|
const getCodeSnippet = (options) => chalk_1.default.gray(`
|
|
36
36
|
${chalk_1.default.greenBright('import { sentryRollupPlugin } from "@sentry/rollup-plugin";')}
|
|
@@ -50,20 +50,20 @@ export default {
|
|
|
50
50
|
};
|
|
51
51
|
`);
|
|
52
52
|
const configureRollupPlugin = async (options) => {
|
|
53
|
-
await (0,
|
|
53
|
+
await (0, clack_1.installPackage)({
|
|
54
54
|
packageName: '@sentry/rollup-plugin',
|
|
55
|
-
alreadyInstalled: (0, package_json_1.hasPackageInstalled)('@sentry/rollup-plugin', await (0,
|
|
55
|
+
alreadyInstalled: (0, package_json_1.hasPackageInstalled)('@sentry/rollup-plugin', await (0, clack_1.getPackageDotJson)()),
|
|
56
56
|
});
|
|
57
57
|
prompts_1.default.log.step(`Add the following code to your rollup config:`);
|
|
58
58
|
// Intentionally logging directly to console here so that the code can be copied/pasted directly
|
|
59
59
|
// eslint-disable-next-line no-console
|
|
60
60
|
console.log(getCodeSnippet(options));
|
|
61
|
-
await (0,
|
|
61
|
+
await (0, clack_1.abortIfCancelled)((0, prompts_1.select)({
|
|
62
62
|
message: 'Did you copy the snippet above?',
|
|
63
63
|
options: [{ label: 'Yes, continue!', value: true }],
|
|
64
64
|
initialValue: true,
|
|
65
65
|
}));
|
|
66
|
-
await (0,
|
|
66
|
+
await (0, clack_1.addDotEnvSentryBuildPluginFile)(options.authToken);
|
|
67
67
|
};
|
|
68
68
|
exports.configureRollupPlugin = configureRollupPlugin;
|
|
69
69
|
//# sourceMappingURL=rollup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/rollup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"rollup.js","sourceRoot":"","sources":["../../../../src/sourcemaps/tools/rollup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAA+E;AAC/E,0DAA+C;AAC/C,kDAA0B;AAC1B,6CAK2B;AAC3B,2DAA+D;AAO/D,MAAM,cAAc,GAAG,CAAC,OAAgD,EAAE,EAAE,CAC1E,eAAK,CAAC,IAAI,CAAC;EACX,eAAK,CAAC,WAAW,CACjB,6DAA6D,CAC9D;;;;MAIK,eAAK,CAAC,WAAW,CACjB,6DAA6D,CAC9D;;;;MAIC,eAAK,CAAC,WAAW,CAAC;;cAEV,OAAO,CAAC,OAAO;kBACX,OAAO,CAAC,WAAW,KAC/B,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAC1D;QACI,CAAC;;;CAGR,CAAC,CAAC;AAEI,MAAM,qBAAqB,GAChC,KAAK,EAAE,OAAO,EAAE,EAAE;IAChB,MAAM,IAAA,sBAAc,EAAC;QACnB,WAAW,EAAE,uBAAuB;QACpC,gBAAgB,EAAE,IAAA,kCAAmB,EACnC,uBAAuB,EACvB,MAAM,IAAA,yBAAiB,GAAE,CAC1B;KACF,CAAC,CAAC;IAEH,iBAAK,CAAC,GAAG,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IAEhE,gGAAgG;IAChG,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAErC,MAAM,IAAA,wBAAgB,EACpB,IAAA,gBAAM,EAAC;QACL,OAAO,EAAE,iCAAiC;QAC1C,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACnD,YAAY,EAAE,IAAI;KACnB,CAAC,CACH,CAAC;IAEF,MAAM,IAAA,sCAA8B,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAC1D,CAAC,CAAC;AAzBS,QAAA,qBAAqB,yBAyB9B","sourcesContent":["// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack, { select } from '@clack/prompts';\nimport chalk from 'chalk';\nimport {\n abortIfCancelled,\n addDotEnvSentryBuildPluginFile,\n getPackageDotJson,\n installPackage,\n} from '../../utils/clack';\nimport { hasPackageInstalled } from '../../utils/package-json';\n\nimport {\n SourceMapUploadToolConfigurationFunction,\n SourceMapUploadToolConfigurationOptions,\n} from './types';\n\nconst getCodeSnippet = (options: SourceMapUploadToolConfigurationOptions) =>\n chalk.gray(`\n${chalk.greenBright(\n 'import { sentryRollupPlugin } from \"@sentry/rollup-plugin\";',\n)}\n\nexport default {\n output: {\n ${chalk.greenBright(\n 'sourcemap: true, // Source map generation must be turned on',\n )}\n },\n plugins: [\n // Put the Sentry rollup plugin after all other plugins\n ${chalk.greenBright(`sentryRollupPlugin({\n authToken: process.env.SENTRY_AUTH_TOKEN,\n org: \"${options.orgSlug}\",\n project: \"${options.projectSlug}\",${\n options.selfHosted ? `\\n url: \"${options.url}\",` : ''\n }\n }),`)}\n ],\n};\n`);\n\nexport const configureRollupPlugin: SourceMapUploadToolConfigurationFunction =\n async (options) => {\n await installPackage({\n packageName: '@sentry/rollup-plugin',\n alreadyInstalled: hasPackageInstalled(\n '@sentry/rollup-plugin',\n await getPackageDotJson(),\n ),\n });\n\n clack.log.step(`Add the following code to your rollup config:`);\n\n // Intentionally logging directly to console here so that the code can be copied/pasted directly\n // eslint-disable-next-line no-console\n console.log(getCodeSnippet(options));\n\n await abortIfCancelled(\n select({\n message: 'Did you copy the snippet above?',\n options: [{ label: 'Yes, continue!', value: true }],\n initialValue: true,\n }),\n );\n\n await addDotEnvSentryBuildPluginFile(options.authToken);\n };\n"]}
|