Skip to content

Commit 93a514c

Browse files
committed
[RELEASE] Version v0.0.3. Subgenerators moved down into /app folder to match main generator. Documentation updated to match change.
1 parent b12e11a commit 93a514c

File tree

6 files changed

+31
-28
lines changed

6 files changed

+31
-28
lines changed

Diff for: README.md

+20-17
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ To create a react component class named *Test* run: `yo webpack-redux-react:comp
3030
Creates a folder within `/components` that matches the name provided. Below is the result of the command above being run:
3131

3232
```
33-
/components
34-
--/Car
35-
----Car.js
36-
----Car.scss
33+
/app
34+
--/components
35+
----/Car
36+
------Car.js
37+
------Car.scss
3738
```
38-
/components/Car.js:
39+
/app/components/Car.js:
3940
```javascript
4041
import React, {Component, PropTypes} from 'react';
4142
import './Car.scss';
@@ -65,13 +66,14 @@ To create a container named *Cars* run: `yo webpack-redux-react:container Cars`
6566
Creates a folder within `/containers` that matches the name provided. Below is the result of the command above being run:
6667

6768
```
68-
/conatiners
69-
--/Cars
70-
----Cars.js
71-
----Cars.scss
69+
/app
70+
--/conatiners
71+
----/Cars
72+
------Cars.js
73+
------Cars.scss
7274
```
7375

74-
containers/Cars.js:
76+
/app/containers/Cars.js:
7577
```javascript
7678
import React, {Component, PropTypes} from 'react';
7779
import {bindActionCreators} from 'redux';
@@ -116,11 +118,12 @@ To create a set of actions (add, update, remove) for cars run: `yo webpack-redux
116118
Creates a folder within `/actions` that matches the name provided. Below is the result of the command above being run:
117119

118120
```
119-
/actions
120-
--cars.js
121+
/app
122+
--/actions
123+
----cars.js
121124
```
122125

123-
**/actions/cars.js**
126+
/app/actions/cars.js:
124127
```javascript
125128
export const ADD_CARS = 'ADD_CARS';
126129
export const REMOVE_CARS = 'REMOVE_CARS';
@@ -151,12 +154,12 @@ export function updateCars(cars) {
151154
[Reducers](http://redux.js.org/docs/basics/Reducers.html) listen for actions and modify specific pieces of the state accordingly. In this example we are creating a cars reducer that manages state.cars, which is stored as an array.
152155
`yo webpack-redux-react:reducer cars` then select array
153156
```
154-
/reducers
155-
--cars.js
157+
app/
158+
--/reducers
159+
----cars.js
156160
```
157161

158-
**reducers/cars.js**:
159-
162+
/app/reducers/cars.js:
160163
```javascript
161164
import {
162165
ADD_CAR,

Diff for: generators/action/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ module.exports = yeoman.generators.Base.extend({
1515
},
1616

1717
writing: function () {
18-
this.template('_main.js', 'actions/' + this.name.toLowerCase() + '.js', this.templateContext);
18+
this.template('_main.js', 'app/actions/' + this.name.toLowerCase() + '.js', this.templateContext);
1919
}
2020
});

Diff for: generators/component/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ module.exports = yeoman.generators.Base.extend({
3030
},
3131
writing: function () {
3232
if(this.props.addStyle){
33-
this.template('_style.js', 'components/'+ this.name + '/' + this.name + '.js', this.templateContext);
34-
this.template('_main.scss', 'components/'+ this.name + '/' + this.name + '.scss', this.templateContext);
33+
this.template('_style.js', 'app/components/'+ this.name + '/' + this.name + '.js', this.templateContext);
34+
this.template('_main.scss', 'app/components/'+ this.name + '/' + this.name + '.scss', this.templateContext);
3535
} else {
36-
this.template('_noStyle.js', 'components/'+ this.name + '/' + this.name + '.js', this.templateContext);
36+
this.template('_noStyle.js', 'app/components/'+ this.name + '/' + this.name + '.js', this.templateContext);
3737
}
3838
}
3939
});

Diff for: generators/container/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ module.exports = yeoman.generators.Base.extend({
3232
},
3333
writing: function () {
3434
if(this.props.addAction){
35-
this.template('_action.js', 'actions/' + this.name.toLowerCase() + '.js', this.templateContext);
35+
this.template('_action.js', 'app/actions/' + this.name.toLowerCase() + '.js', this.templateContext);
3636
}
37-
this.template('_main.js', 'containers/'+ this.name + '/' + this.name + '.js', this.templateContext);
38-
this.template('_main.scss', 'containers/'+ this.name + '/' + this.name + '.scss',this.templateContext);
37+
this.template('_main.js', 'app/containers/'+ this.name + '/' + this.name + '.js', this.templateContext);
38+
this.template('_main.scss', 'app/containers/'+ this.name + '/' + this.name + '.scss',this.templateContext);
3939
}
4040
});

Diff for: generators/reducer/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ module.exports = yeoman.generators.Base.extend({
4040

4141
switch(this.props.stateType){
4242
case 'array':
43-
this.template('_array.js', 'reducers/' + this.name.toLowerCase() + '.js', this.templateContext);
43+
this.template('_array.js', 'app/reducers/' + this.name.toLowerCase() + '.js', this.templateContext);
4444
break;
4545
case 'object':
46-
this.template('_object.js', 'reducers/' + this.name.toLowerCase() + '.js', this.templateContext);
46+
this.template('_object.js', 'app/reducers/' + this.name.toLowerCase() + '.js', this.templateContext);
4747
break;
4848
default :
49-
this.template('_array.js', 'reducers/' + this.name.toLowerCase() + '.js', this.templateContext);
49+
this.template('_array.js', 'app/reducers/' + this.name.toLowerCase() + '.js', this.templateContext);
5050
}
5151
}
5252
});

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-webpack-redux-react",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "Yeoman generator for React/Redux projects.",
55
"license": "MIT",
66
"main": "generators/app/index.js",

0 commit comments

Comments
 (0)