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

fix: use none as platform for printing upgrading link #2018

Conversation

szymonrybczak
Copy link
Collaborator

Summary:

In #1882 there was introduced inherit platform, when using link.docs function, and when using this platform there is following check:

if (platform === 'inherit') {
assert.ok(
_platform !== null,
`Please report this CLI error: link.setPlatform('ios'|'android'|'none') was expected to be set before using link.${section}(${path}, 'inherit').`,
);
}

it fails, when there's no platform selected. When printing information about new release (we're doing this in info and start command), we can't really say what platform it is, so the solution for this is to use none as platform.

Before After
CleanShot 2023-07-13 at 12 52 33@2x CleanShot 2023-07-13 at 12 52 08@2x

Test Plan:

  1. Clone the repository and do all the required steps from the Contributing guide
  2. Create React Native app which is not using latest version e.g. npx react-native@latest init --version 0.72.2
  3. Run this command:
node /path/to/react-native-cli/packages/cli/build/bin.js start
  1. Link to the docs should be correctly printed.

Checklist

  • Documentation is up to date to reflect these changes.
  • Follows commit message convention described in CONTRIBUTING.md

@szymonrybczak
Copy link
Collaborator Author

FYI @thymikee I checked and we didn't released #1882 for 11.x, so we're safe :D

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

Thanks! 🙌🏼

@thymikee thymikee merged commit 8616286 into react-native-community:main Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants