From 153efd0929f97eb580b7203bc204868f93a82b17 Mon Sep 17 00:00:00 2001 From: tomatagolo Date: Thu, 27 Oct 2016 09:06:24 -0400 Subject: [PATCH 1/5] add _babelrc template to generator --- local-cli/generator/templates/_babelrc | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 local-cli/generator/templates/_babelrc diff --git a/local-cli/generator/templates/_babelrc b/local-cli/generator/templates/_babelrc new file mode 100644 index 000000000000..a9ce1369e617 --- /dev/null +++ b/local-cli/generator/templates/_babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["react-native"] +} From 4d36bc2e2bff0b81086233f35d40b299d7f15b94 Mon Sep 17 00:00:00 2001 From: tomatagolo Date: Thu, 27 Oct 2016 09:07:10 -0400 Subject: [PATCH 2/5] include .babelrc as part of initial generated files --- local-cli/generator/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/local-cli/generator/index.js b/local-cli/generator/index.js index 10295b68aabe..0bf880f04863 100644 --- a/local-cli/generator/index.js +++ b/local-cli/generator/index.js @@ -73,6 +73,10 @@ module.exports = yeoman.generators.NamedBase.extend({ this.templatePath('_buckconfig'), this.destinationPath('.buckconfig') ); + this.fs.copy( + this.templatePath('_babelrc'), + this.destinationPath('.babelrc') + ); }, writing: function() { From 555416f27b4dd750f9a4476c1d3a772cf593257a Mon Sep 17 00:00:00 2001 From: tomatagolo Date: Thu, 27 Oct 2016 09:09:37 -0400 Subject: [PATCH 3/5] include .babelrc in generator initial files test --- local-cli/__tests__/generators-test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/local-cli/__tests__/generators-test.js b/local-cli/__tests__/generators-test.js index f36fa7021257..0070ec721d41 100644 --- a/local-cli/__tests__/generators-test.js +++ b/local-cli/__tests__/generators-test.js @@ -52,6 +52,7 @@ xdescribe('React Yeoman Generators', function() { '.flowconfig', '.gitignore', '.watchmanconfig', + '.babelrc', 'index.ios.js', 'index.android.js' ]); From 810e1c10af15595b440eed93e8cfcfe45962b0f1 Mon Sep 17 00:00:00 2001 From: tomatagolo Date: Thu, 27 Oct 2016 12:52:32 -0400 Subject: [PATCH 4/5] add check for npm version in Getting Started docs --- docs/GettingStarted.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index e10bd410fe13..93841252db10 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -98,6 +98,14 @@ Node.js comes with npm, which lets you install the React Native command line int npm install -g react-native-cli ``` +Ensure your version of npm is greater than 3: +``` +npm --version +``` +If it is not you can update npm: +``` +npm install npm@latest -gs +``` > If you get a *permission error*, try using sudo: `sudo npm install -g react-native-cli`. > If you get an error like `Cannot find module 'npmlog'`, try installing npm directly: `curl -0 -L http://npmjs.org/install.sh | sudo sh`. From 82ac8d056afa1e5114a2e0802221d92ac7805eb3 Mon Sep 17 00:00:00 2001 From: Thomas Goldenberg Date: Thu, 27 Oct 2016 13:04:39 -0400 Subject: [PATCH 5/5] Update GettingStarted.md --- docs/GettingStarted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 93841252db10..59c3d9ffc968 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -104,7 +104,7 @@ npm --version ``` If it is not you can update npm: ``` -npm install npm@latest -gs +npm install npm@latest -g ``` > If you get a *permission error*, try using sudo: `sudo npm install -g react-native-cli`.