generator-reackt 0.3.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc +4 -4
- package/.stylelintrc +104 -104
- package/LICENSE +9 -7
- package/README.md +18 -18
- package/generators/app/index.js +1 -309
- package/generators/component/index.js +1 -56
- package/generators/es.regexp.flags-ccfbed60.js +1 -0
- package/generators/module/index.js +1 -117
- package/generators/util/fs.js +1 -22
- package/package.json +31 -28
- package/templates/app/.babelrc +9 -9
- package/templates/app/.browserslistrc +3 -3
- package/templates/app/.editorconfig +11 -11
- package/templates/app/.esdoc.json +23 -23
- package/templates/app/.lintstagedrc +4 -4
- package/templates/app/.prettierrc +4 -4
- package/templates/app/.storybook/addons.js +1 -1
- package/templates/app/.storybook/config.js +14 -14
- package/templates/app/.storybook/webpack.config.babel.js +7 -7
- package/templates/app/.stylelintrc +271 -277
- package/templates/app/gitignore +2 -2
- package/templates/app/jest.config.js +15 -15
- package/templates/app/jsconfig.json +8 -8
- package/templates/app/package.json +18 -18
- package/templates/app/src/components/{App/App.js → App.js} +14 -14
- package/templates/app/src/icons.js +3 -3
- package/templates/app/src/index.html +10 -10
- package/templates/app/src/index.js +50 -53
- package/templates/app/src/index.scss +16 -17
- package/templates/app/src/reducers/application.js +21 -21
- package/templates/app/src/reducers/index.js +7 -7
- package/templates/app/src/sagas/application.js +9 -9
- package/templates/app/src/sagas/index.js +7 -7
- package/templates/app/src/selectors/application.js +1 -1
- package/templates/app/src/selectors/application.test.js +13 -13
- package/templates/app/src/utils/index.js +36 -36
- package/templates/app/webpack.config.babel.js +103 -109
- package/templates/component/index.js +19 -19
- package/templates/component/index.test.js +14 -14
- package/templates/module/reducer/index.js +20 -20
- package/templates/module/saga/index.js +9 -9
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
<% if (flags.addRedux) { %>
|
|
3
|
-
import { connect } from 'react-redux';
|
|
4
|
-
<% } %>
|
|
5
|
-
|
|
6
|
-
export class <%= component.name %> extends Component {
|
|
7
|
-
render() {
|
|
8
|
-
return <h1>Hello World</h1>;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
<% if (flags.addRedux) { %>
|
|
13
|
-
export default connect(
|
|
14
|
-
null,
|
|
15
|
-
null
|
|
16
|
-
)(<%= component.name %>);
|
|
17
|
-
<% } else { %>
|
|
18
|
-
export default <%= component.name %>;
|
|
19
|
-
<% } %>
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
<% if (flags.addRedux) { %>
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
<% } %>
|
|
5
|
+
|
|
6
|
+
export class <%= component.name %> extends Component {
|
|
7
|
+
render() {
|
|
8
|
+
return <h1>Hello World</h1>;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
<% if (flags.addRedux) { %>
|
|
13
|
+
export default connect(
|
|
14
|
+
null,
|
|
15
|
+
null
|
|
16
|
+
)(<%= component.name %>);
|
|
17
|
+
<% } else { %>
|
|
18
|
+
export default <%= component.name %>;
|
|
19
|
+
<% } %>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import renderer from 'react-test-renderer';
|
|
2
|
-
|
|
3
|
-
import <%=component.name %> from './<%=component.name %>';
|
|
4
|
-
|
|
5
|
-
describe('<<%= component.name %> />', () => {
|
|
6
|
-
it('renders correctly', () => {
|
|
7
|
-
const component = renderer.create(
|
|
8
|
-
<<%=component.name %> />
|
|
9
|
-
);
|
|
10
|
-
const tree = component.toJSON();
|
|
11
|
-
|
|
12
|
-
expect(tree).toMatchSnapshot();
|
|
13
|
-
});
|
|
14
|
-
});
|
|
1
|
+
import renderer from 'react-test-renderer';
|
|
2
|
+
|
|
3
|
+
import <%=component.name %> from './<%=component.name %>';
|
|
4
|
+
|
|
5
|
+
describe('<<%= component.name %> />', () => {
|
|
6
|
+
it('renders correctly', () => {
|
|
7
|
+
const component = renderer.create(
|
|
8
|
+
<<%=component.name %> />
|
|
9
|
+
);
|
|
10
|
+
const tree = component.toJSON();
|
|
11
|
+
|
|
12
|
+
expect(tree).toMatchSnapshot();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { buildActions } from 'utils';
|
|
2
|
-
|
|
3
|
-
export const types = buildActions('<%= module.name %>', ['INIT_APP']);
|
|
4
|
-
|
|
5
|
-
const initApp = () => ({
|
|
6
|
-
type: types.INIT_APP
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const actions = {
|
|
10
|
-
initApp
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const initialState = {};
|
|
14
|
-
|
|
15
|
-
export const reducer = (state = initialState, action = {}) => {
|
|
16
|
-
switch (action.type) {
|
|
17
|
-
default:
|
|
18
|
-
return state;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
1
|
+
import { buildActions } from 'utils';
|
|
2
|
+
|
|
3
|
+
export const types = buildActions('<%= module.name %>', ['INIT_APP']);
|
|
4
|
+
|
|
5
|
+
const initApp = () => ({
|
|
6
|
+
type: types.INIT_APP
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const actions = {
|
|
10
|
+
initApp
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const initialState = {};
|
|
14
|
+
|
|
15
|
+
export const reducer = (state = initialState, action = {}) => {
|
|
16
|
+
switch (action.type) {
|
|
17
|
+
default:
|
|
18
|
+
return state;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { all } from 'redux-saga/effects';
|
|
2
|
-
|
|
3
|
-
export const workers = {};
|
|
4
|
-
|
|
5
|
-
export const watchers = {};
|
|
6
|
-
|
|
7
|
-
export default function* saga() {
|
|
8
|
-
yield all(Object.values(watchers));
|
|
9
|
-
}
|
|
1
|
+
import { all } from 'redux-saga/effects';
|
|
2
|
+
|
|
3
|
+
export const workers = {};
|
|
4
|
+
|
|
5
|
+
export const watchers = {};
|
|
6
|
+
|
|
7
|
+
export default function* saga() {
|
|
8
|
+
yield all(Object.values(watchers));
|
|
9
|
+
}
|