Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76c70cf207 | ||
|
|
d727d3c7e6 | ||
|
|
eae5bed476 | ||
|
|
94c175664a | ||
|
|
98c6517801 | ||
|
|
9e832e69c6 | ||
|
|
93b8ef0173 | ||
|
|
604fce0372 | ||
|
|
56a7a57654 | ||
|
|
b009ff628d | ||
|
|
f770415db3 | ||
|
|
88a5fc6ad6 | ||
|
|
049943c7bd | ||
|
|
990f52d702 | ||
|
|
76e0acdb31 | ||
|
|
7947ef1d36 | ||
|
|
de9d3f0804 | ||
|
|
0ab55f4385 | ||
|
|
0b54ba54c6 | ||
|
|
9d2f745914 | ||
|
|
651d111624 | ||
|
|
cbe99e2b0f |
No files matched your search
+13
-9
@@ -1,13 +1,17 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "node"
|
- "node"
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- "node_modules"
|
|
||||||
deploy:
|
deploy:
|
||||||
on:
|
- provider: npm
|
||||||
tags: true
|
on:
|
||||||
provider: npm
|
condition: $TRAVIS_BRANCH == "master" && -n $TRAVIS_TAG
|
||||||
email: "emin@emin.ch"
|
email: "emin@emin.ch"
|
||||||
api_key: "${NPM_TOKEN}"
|
api_key: "${NPM_TOKEN}"
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
|
- provider: npm
|
||||||
|
on:
|
||||||
|
condition: $TRAVIS_BRANCH == "master-cli-v2" && -n $TRAVIS_TAG
|
||||||
|
email: "emin@emin.ch"
|
||||||
|
api_key: "${NPM_TOKEN}"
|
||||||
|
skip_cleanup: true
|
||||||
|
tag: next
|
||||||
@@ -1,51 +1,118 @@
|
|||||||
/**
|
/**
|
||||||
* Sample React Native App
|
* Sample React Native App
|
||||||
* https://github.com/facebook/react-native
|
* https://github.com/facebook/react-native
|
||||||
*
|
*
|
||||||
* Generated with the TypeScript template
|
* Generated with the TypeScript template
|
||||||
* https://github.com/emin93/react-native-template-typescript
|
* https://github.com/react-native-community/react-native-template-typescript
|
||||||
*
|
*
|
||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {Component} from 'react';
|
import React, {Fragment} from 'react';
|
||||||
import {Platform, StyleSheet, Text, View} from 'react-native';
|
import {
|
||||||
|
SafeAreaView,
|
||||||
|
StyleSheet,
|
||||||
|
ScrollView,
|
||||||
|
View,
|
||||||
|
Text,
|
||||||
|
StatusBar,
|
||||||
|
} from 'react-native';
|
||||||
|
|
||||||
const instructions = Platform.select({
|
import {
|
||||||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
Header,
|
||||||
android:
|
LearnMoreLinks,
|
||||||
'Double tap R on your keyboard to reload,\n' +
|
Colors,
|
||||||
'Shake or press menu button for dev menu',
|
DebugInstructions,
|
||||||
});
|
ReloadInstructions,
|
||||||
|
} from 'react-native/Libraries/NewAppScreen';
|
||||||
|
|
||||||
interface Props {}
|
const App = () => {
|
||||||
export default class App extends Component<Props> {
|
const usingHermes = typeof HermesInternal === 'object' && HermesInternal !== null;
|
||||||
render() {
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<Fragment>
|
||||||
<Text style={styles.welcome}>Welcome to React Native!</Text>
|
<StatusBar barStyle="dark-content" />
|
||||||
<Text style={styles.instructions}>To get started, edit App.tsx</Text>
|
<SafeAreaView>
|
||||||
<Text style={styles.instructions}>{instructions}</Text>
|
<ScrollView
|
||||||
</View>
|
contentInsetAdjustmentBehavior="automatic"
|
||||||
);
|
style={styles.scrollView}>
|
||||||
}
|
<Header />
|
||||||
}
|
{!usingHermes ? null : (
|
||||||
|
<View style={styles.engine}>
|
||||||
|
<Text style={styles.footer}>Engine: Hermes</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
<View style={styles.body}>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<Text style={styles.sectionTitle}>Step One</Text>
|
||||||
|
<Text style={styles.sectionDescription}>
|
||||||
|
Edit <Text style={styles.highlight}>App.tsx</Text> to change this
|
||||||
|
screen and then come back to see your edits.
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<Text style={styles.sectionTitle}>See Your Changes</Text>
|
||||||
|
<Text style={styles.sectionDescription}>
|
||||||
|
<ReloadInstructions />
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<Text style={styles.sectionTitle}>Debug</Text>
|
||||||
|
<Text style={styles.sectionDescription}>
|
||||||
|
<DebugInstructions />
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<Text style={styles.sectionTitle}>Learn More</Text>
|
||||||
|
<Text style={styles.sectionDescription}>
|
||||||
|
Read the docs to discover what to do next:
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<LearnMoreLinks />
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
</SafeAreaView>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
scrollView: {
|
||||||
flex: 1,
|
backgroundColor: Colors.lighter,
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
backgroundColor: '#F5FCFF',
|
|
||||||
},
|
},
|
||||||
welcome: {
|
engine: {
|
||||||
fontSize: 20,
|
position: 'absolute',
|
||||||
textAlign: 'center',
|
right: 0,
|
||||||
margin: 10,
|
|
||||||
},
|
},
|
||||||
instructions: {
|
body: {
|
||||||
textAlign: 'center',
|
backgroundColor: Colors.white,
|
||||||
color: '#333333',
|
|
||||||
marginBottom: 5,
|
|
||||||
},
|
},
|
||||||
});
|
sectionContainer: {
|
||||||
|
marginTop: 32,
|
||||||
|
paddingHorizontal: 24,
|
||||||
|
},
|
||||||
|
sectionTitle: {
|
||||||
|
fontSize: 24,
|
||||||
|
fontWeight: '600',
|
||||||
|
color: Colors.black,
|
||||||
|
},
|
||||||
|
sectionDescription: {
|
||||||
|
marginTop: 8,
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: '400',
|
||||||
|
color: Colors.dark,
|
||||||
|
},
|
||||||
|
highlight: {
|
||||||
|
fontWeight: '700',
|
||||||
|
},
|
||||||
|
footer: {
|
||||||
|
color: Colors.dark,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: '600',
|
||||||
|
padding: 4,
|
||||||
|
paddingRight: 12,
|
||||||
|
textAlign: 'right',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default App;
|
||||||
@@ -4,6 +4,8 @@ Contributing to this project should be as easy and transparent as possible.
|
|||||||
|
|
||||||
## Workflow
|
## Workflow
|
||||||
|
|
||||||
|
Right now there are two master branches in order to keep support for the old React Native CLI (for more info, check out the [related issue](https://github.com/react-native-community/react-native-template-typescript/issues/39)).
|
||||||
|
|
||||||
We use [GitHub Flow](https://guides.github.com/introduction/flow/), so all code changes happen through pull requests.
|
We use [GitHub Flow](https://guides.github.com/introduction/flow/), so all code changes happen through pull requests.
|
||||||
|
|
||||||
1. Fork the repository and create your branch from `master`.
|
1. Fork the repository and create your branch from `master`.
|
||||||
|
|||||||
@@ -1,53 +1,46 @@
|
|||||||
# :space_invader: React Native Template TypeScript · [](https://travis-ci.org/emin93/react-native-template-typescript)
|
# :space_invader: React Native Template TypeScript
|
||||||
|
|
||||||
Clean and minimalist React Native template for a quick start with TypeScript.
|
<p>
|
||||||
|
<a href="https://travis-ci.org/react-native-community/react-native-template-typescript">
|
||||||
|
<img alt="Build Status" src="https://img.shields.io/travis/react-native-community/react-native-template-typescript.svg" target="_blank" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/react-native-community/react-native-template-typescript#readme">
|
||||||
|
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" target="_blank" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/react-native-community/react-native-template-typescript/graphs/commit-activity">
|
||||||
|
<img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" target="_blank" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/react-native-community/react-native-template-typescript/blob/master/LICENSE">
|
||||||
|
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" target="_blank" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
[](https://medium.com/@emin93/react-native-typescript-b965059109d3)
|
> Clean and minimalist React Native template for a quick start with TypeScript.
|
||||||
|
|
||||||
## :star: Features
|
## :star: Features
|
||||||
|
|
||||||
- Seamlessly integrated into the React Native CLI! :sparkles:
|
- Elegant usage directly within the [React Native CLI](https://github.com/react-native-community/cli)
|
||||||
- Consistent with the default React Native template
|
- Consistent with the default React Native template
|
||||||
- Always latest dependencies :raised_hands:
|
- Minimal additional dependencies
|
||||||
|
|
||||||
## :arrow_forward: Quick Start
|
## :arrow_forward: Usage
|
||||||
|
|
||||||
```bash
|
### React Native >= 0.60
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npx react-native init MyApp --template react-native-template-typescript@next
|
||||||
|
```
|
||||||
|
|
||||||
|
### React Native <= 0.59
|
||||||
|
|
||||||
|
```sh
|
||||||
react-native init MyApp --template typescript
|
react-native init MyApp --template typescript
|
||||||
```
|
```
|
||||||
|
|
||||||
## :question: FAQ
|
|
||||||
|
|
||||||
### What additional dependencies are included in this template?
|
|
||||||
|
|
||||||
- [TypeScript](https://github.com/Microsoft/TypeScript)
|
|
||||||
- [Type definitions for React & React Native](https://github.com/DefinitelyTyped/DefinitelyTyped)
|
|
||||||
|
|
||||||
This template always uses the latest versions of the dependencies at the time when the `react-native init` command is being executed. This means you don't have to worry about old versions.
|
|
||||||
|
|
||||||
Lots of :heart: and credits to the owners and maintainers of those packages.
|
|
||||||
|
|
||||||
### Does debugging work?
|
|
||||||
|
|
||||||
Yes it does. :tada:
|
|
||||||
|
|
||||||
[](https://medium.com/@emin93/react-native-typescript-b965059109d3)
|
|
||||||
|
|
||||||
### How to do type checking?
|
|
||||||
|
|
||||||
`npx tsc`
|
|
||||||
|
|
||||||
## :globe_with_meridians: Links
|
|
||||||
|
|
||||||
- ["Using React Native with TypeScript just became simple" on Medium](https://medium.com/@emin93/react-native-typescript-b965059109d3)
|
|
||||||
- ["24 tips for React Native you probably want to know" on Albert Gao's blog](http://albertgao.xyz/2018/05/30/24-tips-for-react-native-you-probably-want-to-know/#9-For-Typescript)
|
|
||||||
- ["3 Easy Steps to Set Up React Native with TypeScript, Jest and Enzyme" on Medium by Jan Hesters](https://medium.com/@jan.hesters/3-easy-steps-to-set-up-react-native-with-typescript-jest-and-enzyme-592ca042262f)
|
|
||||||
- ["Configs to make in an existing React Native project to migrate it to Typescript" - Gist by Italo Menezes](https://gist.github.com/italomlp/4d16bf0f19d09f9fae48d272f9e6306e)
|
|
||||||
|
|
||||||
## :computer: Contributing
|
## :computer: Contributing
|
||||||
|
|
||||||
Contributions are very welcome. Please check out the [contributing document](https://github.com/emin93/react-native-template-typescript/blob/master/CONTRIBUTING.md).
|
Contributions are very welcome. Please check out the [contributing document](CONTRIBUTING.md).
|
||||||
|
|
||||||
### Donations
|
## :bookmark: License
|
||||||
|
|
||||||
I created this project in my spare time because I enjoy coding. Of course you can support me by [buying me a coffee](https://www.paypal.me/emin93) if you wish. :coffee: :relieved:
|
This project is [MIT](LICENSE) licensed.
|
||||||
@@ -58,3 +58,6 @@ buck-out/
|
|||||||
|
|
||||||
# Bundle artifact
|
# Bundle artifact
|
||||||
*.jsbundle
|
*.jsbundle
|
||||||
|
|
||||||
|
# CocoaPods
|
||||||
|
/ios/Pods/
|
||||||
Generated
+524
-360
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -25,6 +25,6 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/emin93/react-native-template-typescript#readme",
|
"homepage": "https://github.com/emin93/react-native-template-typescript#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"standard": "12.0.1"
|
"standard": "13.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user