Compare commits

...
4 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
Emin Khateeb 87e29d3d66 minor refactoring 2018-03-06 19:06:03 +01:00
6 changed files with 19 additions and 9 deletions

No files matched your search

-4
View File
@@ -34,10 +34,6 @@ local.properties
# #
.vscode/ .vscode/
# TypeScript
#
lib/
# node.js # node.js
# #
node_modules/ node_modules/
+2 -2
View File
@@ -17,8 +17,8 @@ node setup.js
### What is included in this template? ### What is included in this template?
- [TypeScript](https://github.com/Microsoft/TypeScript) - [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](https://github.com/palantir/tslint)
- [TSLint React](https://github.com/palantir/tslint-react) - [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", "typescript",
"tslint", "tslint",
"tslint-react", "tslint-react",
"react-native-typescript-transformer",
"ts-jest",
"@types/react", "@types/react",
"@types/react-native", "@types/react-native",
"react-native-typescript-transformer" "@types/jest"
] ]
+1 -1
View File
@@ -1,4 +1,4 @@
import { AppRegistry } from 'react-native'; import { AppRegistry } from 'react-native';
import App from './lib/App'; import App from './src/App';
AppRegistry.registerComponent('HelloWorld', () => 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 deleteFile = (fileName) => fs.unlinkSync(path.join(process.cwd(), fileName));
const writeFile = (fileName, data) => fs.writeFileSync(path.join(process.cwd(), fileName), data); const writeFile = (fileName, data) => fs.writeFileSync(path.join(process.cwd(), fileName), data);
packageJson.scripts.start = `${packageJson.scripts.start} --config ${path.join(process.cwd(), '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}"'; packageJson.scripts.lint = 'tslint -c tslint.json "src/**/*.{ts,tsx}"';
writeFile('package.json', JSON.stringify(packageJson, null, 2)); writeFile('package.json', JSON.stringify(packageJson, null, 2));
execSync(`npm i ${devDependencies.join(' ')} --save-dev --save-exact`); execSync(`npm i ${devDependencies.join(' ')} --save-dev --save-exact`);
execSync(`npm uninstall babel-jest babel-preset-react-native --save`);
deleteFile('App.js'); deleteFile('App.js');
deleteFile('__tests__/App.js');
deleteFile('.flowconfig'); deleteFile('.flowconfig');
deleteFile('.babelrc');
deleteFile('devDependencies.json'); deleteFile('devDependencies.json');
deleteFile('README.md'); deleteFile('README.md');
deleteFile('LICENSE'); deleteFile('LICENSE');