Skip to content

Commit ef59d8f

Browse files
author
Ahmed Elshaabany
committed
Fix project name
1 parent 958f3cb commit ef59d8f

File tree

6 files changed

+83
-58
lines changed

6 files changed

+83
-58
lines changed

README.md

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,65 @@
1-
21
# react-native typescript TDD template
32
This template is a react-native boilerplate project template to start with for new projects.
43

4+
55
## Features
6-
* [] **Typescript ready:** This template based on the typescript template [here](https://github.com/react-native-community/react-native-template-typescript
7-
)
8-
* [] **React Navigation ready:** Includes [react navigation](https://reactnavigation.org/) with basic working functionality out-of-the-box to work with.
9-
* [] **TDD ready:** Includes setup for [Jest](https://jestjs.io/), [Enzyme](https://enzymejs.github.io/enzyme/), [Detox](https://github.com/wix/Detox) for component and e2e testing.
10-
* [] **Lint ready:** ESlint.
6+
7+
* [] **Typescript ready:** This template based on the typescript template [here](https://github.com/react-native-community/react-native-template-typescript)
8+
9+
* [] **React Navigation ready:** Includes [react navigation](https://reactnavigation.org/) with basic working functionality out-of-the-box to work with.
10+
11+
* [] **TDD ready:** Includes setup for [Jest](https://jestjs.io/), [Enzyme](https://enzymejs.github.io/enzyme/), [Detox](https://github.com/wix/Detox) for component and e2e testing.
12+
13+
* [] **Lint ready:** ESlint.
14+
1115

1216
## Installation
1317
In the desired folder where you want to create the project, open command line and type:
1418

15-
>`npx react-native init {PROJECT_NAME} --template react-native-template-typescript-tdd`
1619

20+
>`npx react-native init {PROJECT_NAME} --template react-native-template-typescript-tdd`
1721
1822
or if you want to install it from Github directly, type:
23+
1924
>`react-native init {PROJECT_NAME} --template https://github.com/zaprogrammer/react-native-template-typescript-tdd.git`
2025
2126

2227
## How to use
2328
This template uses functional components and [React Hooks](https://reactjs.org/docs/hooks-intro.html), but feel free to use class components, or use your preferred state-management library.
2429

30+
2531
### Structure
2632
The template structure is as follows:
2733

34+
2835
#### src
29-
The `src` folder is where all our development files/folders reside.
3036

31-
- ##### App.tsx
32-
App entry point and starting screen, where your App function is defined.
37+
The `src` folder is where all our development files/folders reside.
3338

34-
- ##### Navigation.tsx
35-
Contains basic navigation stack for main -> details screens.
39+
- **App.tsx**
40+
App entry point and starting screen, where your App function is defined.
3641

37-
- ##### screens
38-
Folder to contains app screens (pages). I structured it to contain each screen in its separate folder, like **main, detail** folders where the screen.tsx and screenStyle.ts files exist.
42+
- **Navigation.tsx**
43+
Contains basic navigation stack for main -> details screens.
3944

40-
- ##### model
41-
Contains data objects so to map data retrieved from server or DB to those objects.
45+
- **screens**
46+
Folder to contains app screens (pages). I structured it to contain each screen in its separate folder, like **main, detail** folders where the screen.tsx and screenStyle.ts files exist.
4247

43-
- ##### services
44-
Contains API or server calling related classes, and includes an API.ts file as an abstract class to retrieve data from server.
48+
- **model**
49+
Contains data objects so to map data retrieved from server or DB to those objects.
4550

46-
- ##### helper
47-
Other helper classes or functions like abstract DB layer.
51+
- **services**
52+
Contains API or server calling related classes, and includes an API.ts file as an abstract class to retrieve data from server.
4853

49-
- ##### commons
50-
To contain any shared components or app generic functionality like app common styles.
54+
- **helper**
55+
Other helper classes or functions like abstract DB layer.
5156

57+
- **commons**
58+
To contain any shared components or app generic functionality like app common styles.
5259

5360
#### TDD
54-
There are a very good tutorials ([here](https://learntdd.in/react-native/)) covering how to use TDD with react-native so you can apply on this template.
5561

62+
There are very good tutorials ([here](https://learntdd.in/react-native/)) covering how to use TDD with react-native so you can apply on this template.
5663

5764

58-
Official documentation for creating custom project templates can be found [here](https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template
59-
).
65+
Official documentation for creating custom project templates can be found [here](https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template).

package.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
{
2-
"name": "@zaprogrammer/react-native-template-typescript-tdd",
3-
"version": "1.0.3",
2+
"name": "react-native-template-typescript-tdd",
3+
"version": "1.0.102",
44
"description": "A react native template, with support for TDD and typescript out of the box.",
5+
"files": [
6+
"template",
7+
"template.config.js"
8+
],
59
"repository": "git+https://github.com/zaprogrammer/react-native-template-typescript-tdd.git",
10+
"keywords": [
11+
"react-native",
12+
"typescript",
13+
"template",
14+
"boilerplate",
15+
"navigation",
16+
"TDD",
17+
"jest",
18+
"detox"
19+
],
620
"author": "Ahmed Elshaabany",
721
"license": "MIT"
822
}

template.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
// Placeholder name that will be replaced in package.json, index.json, android/, ios/ for a project name.
3-
placeholderName: 'HelloTDD',
3+
placeholderName: 'HelloWorld',
44

55
// Placeholder title that will be replaced in values.xml and Info.plist with title provided by the user.
66
// We default this value to 'Hello App Display Name', which is default placeholder in react-native template.
@@ -11,4 +11,4 @@ module.exports = {
1111

1212
// Path to script, which will be executed after initialization process, but before installing all the dependencies specified in the template. This script runs as a shell script but you can change that (e.g. to Node) by using a shebang (see example custom template).
1313
// postInitScript: './script.js',
14-
};
14+
}

template/README.md

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,65 @@
1-
21
# react-native typescript TDD template
32
This template is a react-native boilerplate project template to start with for new projects.
43

4+
55
## Features
6-
* [] **Typescript ready:** This template based on the typescript template [here](https://github.com/react-native-community/react-native-template-typescript
7-
)
8-
* [] **React Navigation ready:** Includes [react navigation](https://reactnavigation.org/) with basic working functionality out-of-the-box to work with.
9-
* [] **TDD ready:** Includes setup for [Jest](https://jestjs.io/), [Enzyme](https://enzymejs.github.io/enzyme/), [Detox](https://github.com/wix/Detox) for component and e2e testing.
10-
* [] **Lint ready:** ESlint.
6+
7+
* [] **Typescript ready:** This template based on the typescript template [here](https://github.com/react-native-community/react-native-template-typescript)
8+
9+
* [] **React Navigation ready:** Includes [react navigation](https://reactnavigation.org/) with basic working functionality out-of-the-box to work with.
10+
11+
* [] **TDD ready:** Includes setup for [Jest](https://jestjs.io/), [Enzyme](https://enzymejs.github.io/enzyme/), [Detox](https://github.com/wix/Detox) for component and e2e testing.
12+
13+
* [] **Lint ready:** ESlint.
14+
1115

1216
## Installation
1317
In the desired folder where you want to create the project, open command line and type:
1418

15-
>`npx react-native init {PROJECT_NAME} --template react-native-template-typescript-tdd`
1619

20+
>`npx react-native init {PROJECT_NAME} --template react-native-template-typescript-tdd`
1721
1822
or if you want to install it from Github directly, type:
23+
1924
>`react-native init {PROJECT_NAME} --template https://github.com/zaprogrammer/react-native-template-typescript-tdd.git`
2025
2126

2227
## How to use
2328
This template uses functional components and [React Hooks](https://reactjs.org/docs/hooks-intro.html), but feel free to use class components, or use your preferred state-management library.
2429

30+
2531
### Structure
2632
The template structure is as follows:
2733

34+
2835
#### src
29-
The `src` folder is where all our development files/folders reside.
3036

31-
- ##### App.tsx
32-
App entry point and starting screen, where your App function is defined.
37+
The `src` folder is where all our development files/folders reside.
3338

34-
- ##### Navigation.tsx
35-
Contains basic navigation stack for main -> details screens.
39+
- **App.tsx**
40+
App entry point and starting screen, where your App function is defined.
3641

37-
- ##### screens
38-
Folder to contains app screens (pages). I structured it to contain each screen in its separate folder, like **main, detail** folders where the screen.tsx and screenStyle.ts files exist.
42+
- **Navigation.tsx**
43+
Contains basic navigation stack for main -> details screens.
3944

40-
- ##### model
41-
Contains data objects so to map data retrieved from server or DB to those objects.
45+
- **screens**
46+
Folder to contains app screens (pages). I structured it to contain each screen in its separate folder, like **main, detail** folders where the screen.tsx and screenStyle.ts files exist.
4247

43-
- ##### services
44-
Contains API or server calling related classes, and includes an API.ts file as an abstract class to retrieve data from server.
48+
- **model**
49+
Contains data objects so to map data retrieved from server or DB to those objects.
4550

46-
- ##### helper
47-
Other helper classes or functions like abstract DB layer.
51+
- **services**
52+
Contains API or server calling related classes, and includes an API.ts file as an abstract class to retrieve data from server.
4853

49-
- ##### commons
50-
To contain any shared components or app generic functionality like app common styles.
54+
- **helper**
55+
Other helper classes or functions like abstract DB layer.
5156

57+
- **commons**
58+
To contain any shared components or app generic functionality like app common styles.
5259

5360
#### TDD
54-
There are a very good tutorials ([here](https://learntdd.in/react-native/)) covering how to use TDD with react-native so you can apply on this template.
5561

62+
There are very good tutorials ([here](https://learntdd.in/react-native/)) covering how to use TDD with react-native so you can apply on this template.
5663

5764

58-
Official documentation for creating custom project templates can be found [here](https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template
59-
).
65+
Official documentation for creating custom project templates can be found [here](https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template).

template/app.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"name": "HelloTDD",
3-
"displayName": "HelloTDD"
2+
"name": "HelloWorld",
3+
"displayName": "HelloWorld"
44
}

template/src/screens/home/HomeController.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, {useEffect} from "react";
22
import {SafeAreaView, Text} from "react-native";
3-
import {homeStyles} from "screens/home/styles";
43
import {appStyles} from "commons/styles";
54
import {detailStyles} from "screens/detail/styles";
65

@@ -10,7 +9,7 @@ const HomeScreenController = ({navigation}: any) => {
109
}, [])
1110

1211
return (
13-
<SafeAreaView style={homeStyles.safeArea}>
12+
<SafeAreaView style={appStyles.safeArea}>
1413
<Text style={[detailStyles.cardText, detailStyles.title]}>Hello Main screen</Text>
1514
</SafeAreaView>
1615
)

0 commit comments

Comments
 (0)