-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from emin93/react-native-0.59
React Native 0.59 support
- Loading branch information
Showing
10 changed files
with
23 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,4 +48,4 @@ const styles = StyleSheet.create({ | |
color: '#333333', | ||
marginBottom: 5, | ||
}, | ||
}); | ||
}); |
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 |
---|---|---|
|
@@ -11,4 +11,4 @@ import renderer from 'react-test-renderer'; | |
|
||
it('renders correctly', () => { | ||
renderer.create(<App />); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
preset: 'react-native', | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
} |
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 |
---|---|---|
@@ -1,29 +1,17 @@ | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const packageJson = require('./package.json') | ||
const jestConfig = require('./jest.json') | ||
|
||
if (!packageJson.jest) { | ||
if (fs.existsSync(path.join(__dirname, '.travis.yml'))) { | ||
process.exit() | ||
} | ||
|
||
const deleteFile = fileName => fs.unlinkSync(path.join(__dirname, fileName)) | ||
const writeFile = (fileName, data) => fs.writeFileSync(path.join(__dirname, fileName), data) | ||
|
||
console.log('🔄 Setting up...') | ||
|
||
packageJson.scripts.tsc = 'tsc' | ||
packageJson.jest = Object.assign(packageJson.jest, jestConfig) | ||
const projectFilesToDelete = ['.flowconfig', 'App.js', '__tests__/App-test.js'] | ||
|
||
writeFile('package.json', JSON.stringify(packageJson, null, 2)) | ||
const templateFilesToDelete = ['setup.js', 'README.md', 'LICENSE'] | ||
|
||
deleteFile('.flowconfig') | ||
deleteFile('App.js') | ||
deleteFile('__tests__/App.js') | ||
deleteFile('jest.json') | ||
deleteFile('LICENSE') | ||
deleteFile('README.md') | ||
deleteFile('setup.js') | ||
const projectPath = path.join(__dirname, '..', '..') | ||
const deleteProjectFile = fileName => fs.unlinkSync(path.join(projectPath, fileName)) | ||
const deleteTemplateFile = fileName => fs.unlinkSync(path.join(__dirname, fileName)) | ||
|
||
console.log(`✅ Setup completed!`) | ||
projectFilesToDelete.forEach(deleteProjectFile) | ||
templateFilesToDelete.forEach(deleteTemplateFile) |
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