diff --git a/local-cli/.npmignore b/local-cli/.npmignore index e40506d719b298..f6521c7e3f2e85 100644 --- a/local-cli/.npmignore +++ b/local-cli/.npmignore @@ -1,2 +1,3 @@ __fixtures__ __tests__ +!/templates/HelloWorld/__tests__ diff --git a/local-cli/generator/copyProjectTemplateAndReplace.js b/local-cli/generator/copyProjectTemplateAndReplace.js index 8f04b439faeb30..552b1c80175cd0 100644 --- a/local-cli/generator/copyProjectTemplateAndReplace.js +++ b/local-cli/generator/copyProjectTemplateAndReplace.js @@ -127,6 +127,7 @@ function translateFilePath(path) { .replace('_BUCK', 'BUCK') .replace('_gitignore', '.gitignore') .replace('_gitattributes', '.gitattributes') + .replace('_babel.config.js', 'babel.config.js') .replace('_babelrc', '.babelrc') .replace('_flowconfig', '.flowconfig') .replace('_buckconfig', '.buckconfig') diff --git a/local-cli/init/init.js b/local-cli/init/init.js index cbb189533438bb..dec823b52be365 100644 --- a/local-cli/init/init.js +++ b/local-cli/init/init.js @@ -90,7 +90,7 @@ function generateProject(destinationRoot, newProjectName, options) { }); } if (!options['skip-jest']) { - const jestDeps = `jest babel-jest metro-react-native-babel-preset react-test-renderer@${reactVersion}`; + const jestDeps = `jest babel-core@^7.0.0-bridge.0 babel-jest metro-react-native-babel-preset react-test-renderer@${reactVersion}`; if (yarnVersion) { console.log('Adding Jest...'); execSync(`yarn add ${jestDeps} --dev --exact`, {stdio: 'inherit'}); diff --git a/local-cli/templates/HelloWorld/_babel.config.js b/local-cli/templates/HelloWorld/_babel.config.js new file mode 100644 index 00000000000000..b66a04a3617e7c --- /dev/null +++ b/local-cli/templates/HelloWorld/_babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: ["module:metro-react-native-babel-preset"] +} diff --git a/local-cli/templates/HelloWorld/_babelrc b/local-cli/templates/HelloWorld/_babelrc deleted file mode 100644 index d4b74b5be7b43d..00000000000000 --- a/local-cli/templates/HelloWorld/_babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["module:metro-react-native-babel-preset"] -}