Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
184b3e3963 | ||
|
|
e0c02f0427 | ||
|
|
901e2315e6 | ||
|
|
87e29d3d66 |
No files matched your search
@@ -34,10 +34,6 @@ local.properties
|
|||||||
#
|
#
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
# TypeScript
|
|
||||||
#
|
|
||||||
lib/
|
|
||||||
|
|
||||||
# node.js
|
# node.js
|
||||||
#
|
#
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -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",
|
"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,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);
|
||||||
@@ -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');
|
||||||
|
|||||||
Reference in new issue
Block a user