forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Fix more lint warnings in local-cli Reviewed By: davidaurelio Differential Revision: D4213265 fbshipit-source-id: a7f251f2af1e1de67a2b51908713e7a18faf6f18
- Loading branch information
Ovidiu Viorel Iepure
authored and
Facebook Github Bot
committed
Nov 21, 2016
1 parent
812591a
commit 8dbb025
Showing
4 changed files
with
58 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,26 +35,26 @@ function validateAndUpgrade() { | |
const projectName = packageJSON.name; | ||
if (!projectName) { | ||
warn( | ||
"Your project needs to have a name, declared in package.json, " + | ||
"such as \"name\": \"AwesomeApp\". Please add a project name. Aborting." | ||
'Your project needs to have a name, declared in package.json, ' + | ||
'such as "name": "AwesomeApp". Please add a project name. Aborting.' | ||
); | ||
return; | ||
} | ||
|
||
const version = packageJSON.dependencies['react-native']; | ||
if (!version) { | ||
warn( | ||
"Your 'package.json' file doesn't seem to declare 'react-native' as " + | ||
"a dependency. Nothing to upgrade. Aborting." | ||
'Your "package.json" file doesn\'t seem to declare "react-native" as ' + | ||
'a dependency. Nothing to upgrade. Aborting.' | ||
); | ||
return; | ||
} | ||
|
||
if (version === 'latest' || version === '*') { | ||
warn( | ||
"Some major releases introduce breaking changes.\n" + | ||
"Please use a caret version number in your 'package.json' file \n" + | ||
"to avoid breakage. Use e.g. react-native: ^0.38.0. Aborting." | ||
'Some major releases introduce breaking changes.\n' + | ||
'Please use a caret version number in your "package.json" file \n' + | ||
'to avoid breakage. Use e.g. react-native: ^0.38.0. Aborting.' | ||
); | ||
return; | ||
} | ||
|
@@ -68,8 +68,9 @@ function validateAndUpgrade() { | |
|
||
if (!semver.satisfies(installed.version, version)) { | ||
warn( | ||
"react-native version in 'package.json' doesn't match the installed version in 'node_modules'.\n" + | ||
"Try running 'npm install' to fix this. Aborting." | ||
'react-native version in "package.json" doesn\'t match ' + | ||
'the installed version in "node_modules".\n' + | ||
'Try running "npm install" to fix this. Aborting.' | ||
); | ||
return; | ||
} | ||
|
@@ -87,26 +88,29 @@ function validateAndUpgrade() { | |
console.log( | ||
'Upgrading project to react-native v' + installed.version + '\n' + | ||
'Check out the release notes and breaking changes: ' + | ||
'https://github.com/facebook/react-native/releases/tag/v' + semver.major(v) + '.' + semver.minor(v) + '.0' | ||
'https://github.com/facebook/react-native/releases/tag/v' + | ||
semver.major(v) + '.' + semver.minor(v) + '.0' | ||
); | ||
|
||
// >= v0.21.0, we require react to be a peer dependency | ||
if (semver.gte(v, '0.21.0') && !packageJSON.dependencies.react) { | ||
warn( | ||
"Your 'package.json' file doesn't seem to have 'react' as a dependency.\n" + | ||
"'react' was changed from a dependency to a peer dependency in react-native v0.21.0.\n" + | ||
"Therefore, it's necessary to include 'react' in your project's dependencies.\n" + | ||
"Please run 'npm install --save react', then re-run 'react-native upgrade'.\n" | ||
'Your "package.json" file doesn\'t seem to have "react" as a dependency.\n' + | ||
'"react" was changed from a dependency to a peer dependency in react-native v0.21.0.\n' + | ||
'Therefore, it\'s necessary to include "react" in your project\'s dependencies.\n' + | ||
'Please run "npm install --save react", then re-run "react-native upgrade".\n' | ||
); | ||
return; | ||
} | ||
|
||
if (semver.satisfies(v, '~0.26.0')) { | ||
warn( | ||
"React Native 0.26 introduced some breaking changes to the native files on iOS. You can\n" + | ||
"perform them manually by checking the release notes or use \'rnpm\' to do it automatically.\n" + | ||
"Just run:\n" + | ||
"\'npm install -g rnpm && npm install [email protected] --save-dev\', then run \'rnpm upgrade\'" | ||
'React Native 0.26 introduced some breaking changes to the native files on iOS. You can\n' + | ||
'perform them manually by checking the release notes or use "rnpm" ' + | ||
'to do it automatically.\n' + | ||
'Just run:\n' + | ||
'"npm install -g rnpm && npm install [email protected] --save-dev", ' + | ||
'then run "rnpm upgrade".' | ||
); | ||
} | ||
|
||
|