Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAT-4934] Add configure command to RN CLI #1144

Merged
merged 2 commits into from
Nov 27, 2020

Conversation

bengourley
Copy link
Contributor

Adds bugsnag-react-native-cli install command.

Unit tests included for relevant parts. Interactive CLI aspects will be test via maze runner at a later point.

To test this out, use the following steps:

  • git fetch && git checkout feature/rn-cli-configure-cmd
  • npm i
  • npm run bootstrap
  • npm run build
  • cd packages/react-native-cli
  • npm link (this symlinks the local cli package to your global npm modules)

On a React Native project:

  • check that the command is linked up correctly bugsnag-react-native-cli --help
  • run bugsnag-react-native-cli configure
  • verify that the Bugsnag API key that you were prompted for is added correctly to the Info.plist/AndroidManifest.xml

@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Nov 25, 2020

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 40.57 kB 12.52 kB
After 40.57 kB 12.52 kB
± No change No change

Generated by 🚫 dangerJS against cc73e4c

name: 'apiKey',
message: 'What is your Bugsnag API key?',
validate: value => {
return value.length > 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there value in validating that the apiKey is a hexadecimal string of the correct length?

Base automatically changed from feature/rn-cli-install-cmd to integration/rn-cli November 26, 2020 10:18
@bengourley bengourley changed the title [PLAT-4934:] Add configure command to RN CLI [PLAT-4934]: Add configure command to RN CLI Nov 27, 2020
@bengourley bengourley changed the title [PLAT-4934]: Add configure command to RN CLI [PLAT-4934] Add configure command to RN CLI Nov 27, 2020
logger.warn(UNLOCATED_PROJ_MSG)
return
}
const plistPath = path.join(iosDir, xcodeprojDir.replace(/\.xcodeproj$/, ''), 'Info.plist')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works fine with react native's project template but may break if developers reorganise their project structure. Determining the path 100% correctly would involve parsing the Xcode project and finding the INFOPLIST_FILE build setting for the app target... tricky to implement, so this current solution is probably good enough!

@bengourley bengourley merged commit 010b4ed into integration/rn-cli Nov 27, 2020
@bengourley bengourley deleted the feature/rn-cli-configure-cmd branch November 27, 2020 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants