Compare commits

...
3 Commits
Author SHA1 Message Date
Emin Khateeb 184b3e3963 added jest dependencies 2018-03-06 22:14:06 +01:00
Emin Khateeb e0c02f0427 fixed issue with npm start failing 2018-03-06 21:59:05 +01:00
Emin Khateeb 901e2315e6 minor refactoring in readme 2018-03-06 21:58:55 +01:00
5 changed files with 19 additions and 5 deletions

No files matched your search

+2 -2
View File
@@ -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)
+9
View File
@@ -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" />);
});
+3 -1
View File
@@ -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 -1
View File
@@ -1,4 +1,4 @@
import { AppRegistry } from 'react-native';
import App from './lib/App';
import App from './src/App';
AppRegistry.registerComponent('HelloWorld', () => App);
+4 -1
View File
@@ -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');