From 08e0d77f08d6c4f265d5d8ae2acd51f6f2fe8ff9 Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Thu, 7 Sep 2023 09:47:33 +0100 Subject: [PATCH] [full ci] --- .../src/commands/AutomateSymbolicationCommand.ts | 15 ++++++++++++++- .../cli-tests/automate-symbolication.feature | 8 ++++---- .../features/fixtures/rn-cli-init-android.sh | 5 ++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/packages/react-native-cli/src/commands/AutomateSymbolicationCommand.ts b/packages/react-native-cli/src/commands/AutomateSymbolicationCommand.ts index dcbf2a04cc..3895accf66 100644 --- a/packages/react-native-cli/src/commands/AutomateSymbolicationCommand.ts +++ b/packages/react-native-cli/src/commands/AutomateSymbolicationCommand.ts @@ -26,6 +26,12 @@ const HERMES_INSTRUCTIONS = `You are running a version of React Native that we c ` +const BUGSNAG_CLI_INSTRUCTIONS = `bugsnag:upload-android task added to your package.json - run this task to upload Android source maps after a build. + + See https://docs.bugsnag.com/platforms/react-native/react-native/showing-full-stacktraces for details. + +` + export default async function run (projectRoot: string, urls: OnPremiseUrls): Promise { try { const { iosIntegration } = await prompts({ @@ -76,13 +82,20 @@ export default async function run (projectRoot: string, urls: OnPremiseUrls): Pr const { packageJsonIntegration } = await prompts({ type: 'confirm', name: 'packageJsonIntegration', - message: 'Do you want to add an NPM task to your package.json to upload Android source maps?', + message: 'Do you want to add an NPM task to your package.json that you can run to upload Android source maps?', initial: true }, { onCancel }) if (packageJsonIntegration) { await writeToPackageJson(join(projectRoot, 'package.json'), urls[UrlType.UPLOAD], urls[UrlType.BUILD]) } + + await prompts({ + type: 'text', + name: 'bugsnagCliInstructions', + message: BUGSNAG_CLI_INSTRUCTIONS, + initial: 'Hit enter to continue …' + }, { onCancel }) } return true diff --git a/test/react-native-cli/features/cli-tests/automate-symbolication.feature b/test/react-native-cli/features/cli-tests/automate-symbolication.feature index 49c7b104b3..4cd487d120 100644 --- a/test/react-native-cli/features/cli-tests/automate-symbolication.feature +++ b/test/react-native-cli/features/cli-tests/automate-symbolication.feature @@ -33,7 +33,7 @@ Scenario: successfully modify project When I input a return interactively Then I wait for the shell to output a match for the regex "@bugsnag/cli dependency is installed" to stdout When RN version is 0.68 or lower dismiss the warning message - And I wait for the current stdout line to match the regex "Do you want to add an NPM task to your package.json to upload Android source maps\?" + And I wait for the current stdout line to match the regex "Do you want to add an NPM task to your package.json that you can run to upload Android source maps\?" When I input "n" interactively Then the last interactive command exited successfully And bugsnag cli library is in the package.json file @@ -74,7 +74,7 @@ Scenario: successfully modify project, choosing source-maps version When I input "1.1.8" interactively Then I wait for the shell to output a match for the regex "@bugsnag/cli dependency is installed" to stdout When RN version is 0.68 or lower dismiss the warning message - And I wait for the current stdout line to match the regex "Do you want to add an NPM task to your package.json to upload Android source maps\?" + And I wait for the current stdout line to match the regex "Do you want to add an NPM task to your package.json that you can run to upload Android source maps\?" When I input "n" interactively Then the last interactive command exited successfully And bugsnag cli library version "^1.1.8" is in the package.json file @@ -119,7 +119,7 @@ Scenario: successfully modify project with custom endpoints When I input a return interactively Then I wait for the shell to output a match for the regex "@bugsnag/cli dependency is installed" to stdout When RN version is 0.68 or lower dismiss the warning message - And I wait for the current stdout line to match the regex "Do you want to add an NPM task to your package.json to upload Android source maps\?" + And I wait for the current stdout line to match the regex "Do you want to add an NPM task to your package.json that you can run to upload Android source maps\?" When I input "n" interactively Then the last interactive command exited successfully And bugsnag cli library is in the package.json file @@ -195,7 +195,7 @@ Scenario: opt not to modify the iOS project When I input a return interactively Then I wait for the shell to output a match for the regex "@bugsnag/cli dependency is installed" to stdout When RN version is 0.68 or lower dismiss the warning message - And I wait for the current stdout line to match the regex "Do you want to add an NPM task to your package.json to upload Android source maps\?" + And I wait for the current stdout line to match the regex "Do you want to add an NPM task to your package.json that you can run to upload Android source maps\?" When I input "n" interactively Then the last interactive command exited successfully And bugsnag cli library is in the package.json file diff --git a/test/react-native-cli/features/fixtures/rn-cli-init-android.sh b/test/react-native-cli/features/fixtures/rn-cli-init-android.sh index 7f49c62115..fa4ce730c5 100755 --- a/test/react-native-cli/features/fixtures/rn-cli-init-android.sh +++ b/test/react-native-cli/features/fixtures/rn-cli-init-android.sh @@ -67,7 +67,10 @@ if {[expr $rnVersionInt3 < 0.68]} { send -- \r } -expect "Do you want to add an NPM task to your package.json to upload Android source maps?" +expect "Do you want to add an NPM task to your package.json that you can run to upload Android source maps?" +send -- \r + +expect "See https://docs.bugsnag.com/platforms/react-native/react-native/showing-full-stacktraces for details." send -- \r expect eof