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.
Files changed (41) hide show
  1. package/.prettierrc +4 -4
  2. package/.stylelintrc +104 -104
  3. package/LICENSE +9 -7
  4. package/README.md +18 -18
  5. package/generators/app/index.js +1 -309
  6. package/generators/component/index.js +1 -56
  7. package/generators/es.regexp.flags-ccfbed60.js +1 -0
  8. package/generators/module/index.js +1 -117
  9. package/generators/util/fs.js +1 -22
  10. package/package.json +31 -28
  11. package/templates/app/.babelrc +9 -9
  12. package/templates/app/.browserslistrc +3 -3
  13. package/templates/app/.editorconfig +11 -11
  14. package/templates/app/.esdoc.json +23 -23
  15. package/templates/app/.lintstagedrc +4 -4
  16. package/templates/app/.prettierrc +4 -4
  17. package/templates/app/.storybook/addons.js +1 -1
  18. package/templates/app/.storybook/config.js +14 -14
  19. package/templates/app/.storybook/webpack.config.babel.js +7 -7
  20. package/templates/app/.stylelintrc +271 -277
  21. package/templates/app/gitignore +2 -2
  22. package/templates/app/jest.config.js +15 -15
  23. package/templates/app/jsconfig.json +8 -8
  24. package/templates/app/package.json +18 -18
  25. package/templates/app/src/components/{App/App.js → App.js} +14 -14
  26. package/templates/app/src/icons.js +3 -3
  27. package/templates/app/src/index.html +10 -10
  28. package/templates/app/src/index.js +50 -53
  29. package/templates/app/src/index.scss +16 -17
  30. package/templates/app/src/reducers/application.js +21 -21
  31. package/templates/app/src/reducers/index.js +7 -7
  32. package/templates/app/src/sagas/application.js +9 -9
  33. package/templates/app/src/sagas/index.js +7 -7
  34. package/templates/app/src/selectors/application.js +1 -1
  35. package/templates/app/src/selectors/application.test.js +13 -13
  36. package/templates/app/src/utils/index.js +36 -36
  37. package/templates/app/webpack.config.babel.js +103 -109
  38. package/templates/component/index.js +19 -19
  39. package/templates/component/index.test.js +14 -14
  40. package/templates/module/reducer/index.js +20 -20
  41. 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
+ }