Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator improvements #210

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Not all of the below is yet fully implemented
* [React Navigation](https://reactnavigation.org/) for awesome navigation with 60fps transitions
* Disk-persisted application state caching for offline support and snappy startup performance
* Clean and testable service layer for interacting with RESTful APIs
* Super simple generators with [Plop](https://github.com/amwmedia/plop)
* :warning: Sample app to show how to wire it all together
* :star: JSON Web Token authentication
* :star: Multi-environment configuration (dev, staging, production) for iOS and Android
Expand Down Expand Up @@ -96,6 +97,13 @@ $ react-native run-ios
$ react-native run-android
```

##### Use plop generators to create new modules quickly
```
$ npm run plop
```

[Learn more about Plop](https://github.com/amwmedia/plop)

##### Run unit tests
```
$ npm test
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"test:watch": "jest --watch",
"lint": "eslint src test",
"coverage": "rimraf coverage && jest --coverage",
"version": "support/version-ios.sh"
"version": "support/version-ios.sh",
"plop": "plop"
},
"jest": {
"preset": "react-native",
Expand Down Expand Up @@ -68,7 +69,7 @@
"fetch-mock": "^5.5.0",
"istanbul": "1.0.0-alpha.2",
"jest": "^17.0.2",
"plop": "^1.7.4",
"plop": "^1.8.0",
"react-addons-test-utils": "~15.4.2",
"react-native-mock": "~0.2.5",
"react-test-renderer": "~15.4.2",
Expand Down
4 changes: 2 additions & 2 deletions plopfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ module.exports = function (plop) {
type: 'modify',
path: 'src/redux/reducer.js',
pattern: /\/\/ ## Generator Reducer Imports/gi,
template: '// ## Generator Reducer Imports\r\nimport {{properCase name}}Reducer from \'../modules/{{camelCase name}}/{{properCase name}}State\';'
template: '// ## Generator Reducer Imports\nimport {{properCase name}}Reducer from \'../modules/{{camelCase name}}/{{properCase name}}State\';'
},
{
type: 'modify',
path: 'src/redux/reducer.js',
pattern: /\/\/ ## Generator Reducers/gi,
template: '// ## Generator Reducers\r\n {{camelCase name}}: {{properCase name}}Reducer,'
template: '// ## Generator Reducers\n\n {{camelCase name}}: {{properCase name}}Reducer,'
}
]
});
Expand Down
3 changes: 2 additions & 1 deletion src/redux/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import SessionStateReducer, {RESET_STATE} from '../modules/session/SessionState'
// ## Generator Reducer Imports

const reducers = {
// ## Generator Reducers

// Counter sample app state. This can be removed in a live application
counter: CounterStateReducer,
// ## Generator Reducers

// Navigator states
navigatorState: NavigatorStateReducer,
Expand Down
Loading