Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions packages/cli/src/commands/doctor/doctor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import chalk from 'chalk';
import {logger} from '@react-native-community/cli-tools';
import semver from 'semver';
import {getHealthchecks, HEALTHCHECK_TYPES} from './healthchecks';
import {getLoader} from '../../tools/loader';
import printFixOptions, {KEYS} from './printFixOptions';
Expand Down Expand Up @@ -36,22 +35,17 @@ const printIssue = ({
: chalk.yellow('●')
: chalk.green('✓');

const descriptionToShow = description ? `- ${description}` : '';
const descriptionToShow = description ? ` - ${description}` : '';

logger.log(` ${symbol} ${label}${descriptionToShow}`);

if (needsToBeFixed && versionRange) {
const versionToShow = version && version !== 'Not Found' ? version : 'N/A';
const cleanedVersionRange = semver.valid(semver.coerce(versionRange)!);

if (cleanedVersionRange) {
logMessage(`- Version found: ${chalk.red(versionToShow)}`);
logMessage(
`- Minimum version required: ${chalk.green(cleanedVersionRange)}`,
);
logMessage(`- Version found: ${chalk.red(versionToShow)}`);
logMessage(`- Version supported: ${chalk.green(versionRange)}`);
Copy link
Member

@thymikee thymikee Nov 19, 2019

Choose a reason for hiding this comment

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

We can show the version range instead of semver coerced version. Here's a sample output how it looks now:
image


return;
}
return;
}
};

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/doctor/versionRanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export default {
ANDROID_SDK: '>= 26.x',
ANDROID_NDK: '>= 19.x',
// iOS
XCODE: '10.x',
XCODE: '>= 10.x',
};