Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
184b3e3963 | ||
|
|
e0c02f0427 | ||
|
|
901e2315e6 |
No files matched your search
@@ -17,8 +17,8 @@ node setup.js
|
||||
### What is included in this template?
|
||||
|
||||
- [TypeScript](https://github.com/Microsoft/TypeScript)
|
||||
- [TypeScript type definitions for React & React Native](https://github.com/DefinitelyTyped/DefinitelyTyped)
|
||||
- [React Native Typescript Transformer](https://github.com/ds300/react-native-typescript-transformer)
|
||||
- [React Native TypeScript Transformer](https://github.com/ds300/react-native-typescript-transformer)
|
||||
- [Type definitions for React & React Native](https://github.com/DefinitelyTyped/DefinitelyTyped)
|
||||
- [TSLint](https://github.com/palantir/tslint)
|
||||
- [TSLint React](https://github.com/palantir/tslint-react)
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as React from "react";
|
||||
import "react-native";
|
||||
import renderer from "react-test-renderer";
|
||||
|
||||
import App from "../src/App";
|
||||
|
||||
it("renders correctly", () => {
|
||||
const tree = renderer.create(<App exampleProp="helloWorld" />);
|
||||
});
|
||||
@@ -2,7 +2,9 @@
|
||||
"typescript",
|
||||
"tslint",
|
||||
"tslint-react",
|
||||
"react-native-typescript-transformer",
|
||||
"ts-jest",
|
||||
"@types/react",
|
||||
"@types/react-native",
|
||||
"react-native-typescript-transformer"
|
||||
"@types/jest"
|
||||
]
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AppRegistry } from 'react-native';
|
||||
import App from './lib/App';
|
||||
import App from './src/App';
|
||||
|
||||
AppRegistry.registerComponent('HelloWorld', () => App);
|
||||
@@ -8,14 +8,17 @@ const devDependencies = require('./devDependencies.json');
|
||||
const deleteFile = (fileName) => fs.unlinkSync(path.join(process.cwd(), fileName));
|
||||
const writeFile = (fileName, data) => fs.writeFileSync(path.join(process.cwd(), fileName), data);
|
||||
|
||||
packageJson.scripts.start = `${packageJson.scripts.start} --config ../../../../rn-cli.config.js')}`;
|
||||
packageJson.scripts.start = `${packageJson.scripts.start} --config ../../../../rn-cli.config.js`;
|
||||
packageJson.scripts.lint = 'tslint -c tslint.json "src/**/*.{ts,tsx}"';
|
||||
writeFile('package.json', JSON.stringify(packageJson, null, 2));
|
||||
|
||||
execSync(`npm i ${devDependencies.join(' ')} --save-dev --save-exact`);
|
||||
execSync(`npm uninstall babel-jest babel-preset-react-native --save`);
|
||||
|
||||
deleteFile('App.js');
|
||||
deleteFile('__tests__/App.js');
|
||||
deleteFile('.flowconfig');
|
||||
deleteFile('.babelrc');
|
||||
deleteFile('devDependencies.json');
|
||||
deleteFile('README.md');
|
||||
deleteFile('LICENSE');
|
||||
|
||||
Reference in new issue
Block a user