generator-reackt 0.5.0 → 0.6.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 +5 -5
- package/.stylelintrc +188 -104
- package/LICENSE +7 -9
- package/README.md +18 -18
- package/generators/app/index.js +392 -1
- package/generators/component/index.js +51 -1
- package/generators/module/index.js +127 -1
- package/generators/util/fs.js +34 -1
- package/package.json +63 -69
- package/templates/app/.babelrc +4 -9
- package/templates/app/.browserslistrc +3 -3
- package/templates/app/.editorconfig +11 -11
- package/templates/app/.esdoc.json +23 -23
- package/templates/app/.eslintrc.js +46 -185
- 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 +188 -271
- package/templates/app/gitignore +2 -2
- package/templates/app/jest.config.js +15 -15
- package/templates/app/jsconfig.json +7 -8
- package/templates/app/package.json +18 -18
- package/templates/app/src/components/App.js +14 -14
- package/templates/app/src/index.html +10 -10
- package/templates/app/src/index.js +47 -50
- package/templates/app/src/index.scss +16 -16
- 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 -103
- 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
- package/generators/es.regexp.flags-ccfbed60.js +0 -1
- package/templates/app/src/icons.js +0 -4
package/package.json
CHANGED
|
@@ -1,69 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "generator-reackt",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Create an opinionated React-based web
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
".
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"generator",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"gulp-
|
|
40
|
-
"
|
|
41
|
-
"inquirer": "
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"yeoman-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"@babel/
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"prettier": "^2.8.8",
|
|
65
|
-
"rollup": "^3.21.7",
|
|
66
|
-
"rollup-plugin-auto-external": "^2.0.0",
|
|
67
|
-
"rollup-plugin-multi-input": "^1.4.1"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "generator-reackt",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Create an opinionated React-based web applcication",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"generators",
|
|
8
|
+
"templates",
|
|
9
|
+
".prettierrc",
|
|
10
|
+
".stylelintrc"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "ssh://git@git.codecube.xyz:7999/web/generator-reackt.git"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"yeoman-generator",
|
|
18
|
+
"generator",
|
|
19
|
+
"scaffold",
|
|
20
|
+
"frontend",
|
|
21
|
+
"reactjs",
|
|
22
|
+
"webpack",
|
|
23
|
+
"redux"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"version": "auto-changelog -l false -p --hide-credit && git add CHANGELOG.md",
|
|
27
|
+
"prepare": "husky"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=16"
|
|
31
|
+
},
|
|
32
|
+
"author": "ayan4m1 <andrew@bulletlogic.com>",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"chalk": "^5.3.0",
|
|
36
|
+
"date-fns": "^3.6.0",
|
|
37
|
+
"got": "^14.4.1",
|
|
38
|
+
"gulp-if": "^3.0.0",
|
|
39
|
+
"gulp-prettier": "^6.0.0",
|
|
40
|
+
"inquirer": "9.3.5",
|
|
41
|
+
"inquirer-autocomplete-prompt": "^3.0.1",
|
|
42
|
+
"jsonfile": "^6.1.0",
|
|
43
|
+
"mkdirp": "^3.0.1",
|
|
44
|
+
"spdx-license-ids": "^3.0.18",
|
|
45
|
+
"yeoman-generator": "^4.13.0",
|
|
46
|
+
"yeoman-stylelint": "^1.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@babel/eslint-parser": "^7.24.7",
|
|
50
|
+
"@babel/plugin-syntax-import-assertions": "^7.24.7",
|
|
51
|
+
"auto-changelog": "^2.4.0",
|
|
52
|
+
"eslint": "8.57.0",
|
|
53
|
+
"eslint-config-prettier": "^9.1.0",
|
|
54
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
55
|
+
"husky": "^9.0.11",
|
|
56
|
+
"lint-staged": "^15.2.7",
|
|
57
|
+
"postcss": "^8.4.39",
|
|
58
|
+
"postcss-scss": "^4.0.9",
|
|
59
|
+
"prettier": "^3.3.2",
|
|
60
|
+
"stylelint": "^16.6.1",
|
|
61
|
+
"stylelint-config-recommended": "^14.0.1"
|
|
62
|
+
}
|
|
63
|
+
}
|
package/templates/app/.babelrc
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": ["@babel/preset-env", ["@babel/preset-react", { "runtime": "automatic" }]],
|
|
3
|
-
"plugins": [
|
|
4
|
-
|
|
5
|
-
"@babel/plugin-proposal-object-rest-spread",
|
|
6
|
-
"@babel/plugin-transform-runtime",
|
|
7
|
-
"@babel/plugin-transform-regenerator"
|
|
8
|
-
]
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"presets": ["@babel/preset-env", ["@babel/preset-react", { "runtime": "automatic" }]],
|
|
3
|
+
"plugins": ["@babel/plugin-transform-runtime"]
|
|
4
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
last 2 versions
|
|
2
|
-
not dead
|
|
3
|
-
> 1%
|
|
1
|
+
last 2 versions
|
|
2
|
+
not dead
|
|
3
|
+
> 1%
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
root = true
|
|
2
|
-
|
|
3
|
-
[*]
|
|
4
|
-
indent_style = space
|
|
5
|
-
indent_size = 2
|
|
6
|
-
charset = utf-8
|
|
7
|
-
trim_trailing_whitespace = true
|
|
8
|
-
insert_final_newline = true
|
|
9
|
-
|
|
10
|
-
[{*.md,*.snap}]
|
|
11
|
-
trim_trailing_whitespace = false
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
indent_style = space
|
|
5
|
+
indent_size = 2
|
|
6
|
+
charset = utf-8
|
|
7
|
+
trim_trailing_whitespace = true
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
|
|
10
|
+
[{*.md,*.snap}]
|
|
11
|
+
trim_trailing_whitespace = false
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"source": "./src",
|
|
3
|
-
"destination": "./docs",
|
|
4
|
-
"plugins": [
|
|
5
|
-
{
|
|
6
|
-
"name": "esdoc-standard-plugin",
|
|
7
|
-
"option": {
|
|
8
|
-
"test": {
|
|
9
|
-
"source": "./src/",
|
|
10
|
-
"interfaces": ["describe", "it", "context", "suite", "test"],
|
|
11
|
-
"includes": ["test\\.js$"]
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
{ "name": "esdoc-jsx-plugin" },
|
|
16
|
-
{
|
|
17
|
-
"name": "esdoc-ecmascript-proposal-plugin",
|
|
18
|
-
"option": {
|
|
19
|
-
"all": true
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"source": "./src",
|
|
3
|
+
"destination": "./docs",
|
|
4
|
+
"plugins": [
|
|
5
|
+
{
|
|
6
|
+
"name": "esdoc-standard-plugin",
|
|
7
|
+
"option": {
|
|
8
|
+
"test": {
|
|
9
|
+
"source": "./src/",
|
|
10
|
+
"interfaces": ["describe", "it", "context", "suite", "test"],
|
|
11
|
+
"includes": ["test\\.js$"]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{ "name": "esdoc-jsx-plugin" },
|
|
16
|
+
{
|
|
17
|
+
"name": "esdoc-ecmascript-proposal-plugin",
|
|
18
|
+
"option": {
|
|
19
|
+
"all": true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -1,185 +1,46 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
"env": {
|
|
5
|
-
"browser": true,
|
|
6
|
-
"es2020": true,
|
|
7
|
-
<% if (flags.addJest) { %>
|
|
8
|
-
"jest": true,
|
|
9
|
-
<% } %>
|
|
10
|
-
"node": true
|
|
11
|
-
},
|
|
12
|
-
"extends": [
|
|
13
|
-
"eslint:recommended",
|
|
14
|
-
"plugin:react/recommended",
|
|
15
|
-
"plugin:prettier/recommended",
|
|
16
|
-
"plugin:jsx-a11y/recommended",
|
|
17
|
-
"plugin:import/recommended",
|
|
18
|
-
"plugin:react-hooks/recommended",
|
|
19
|
-
<% if (flags.addJest) { %>
|
|
20
|
-
"plugin:jest/recommended"
|
|
21
|
-
<% } %>
|
|
22
|
-
],
|
|
23
|
-
"parser": "@babel/eslint-parser",
|
|
24
|
-
"parserOptions": {
|
|
25
|
-
"requireConfigFile": false,
|
|
26
|
-
"ecmaFeatures": {
|
|
27
|
-
"jsx": true
|
|
28
|
-
},
|
|
29
|
-
"ecmaVersion": 12
|
|
30
|
-
},
|
|
31
|
-
"rules": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"guard-for-in": 2,
|
|
48
|
-
"handle-callback-err": 0,
|
|
49
|
-
"id-length": 0,
|
|
50
|
-
"id-match": 0,
|
|
51
|
-
"indent": [0, 4],
|
|
52
|
-
"init-declarations": 0,
|
|
53
|
-
"linebreak-style": 0,
|
|
54
|
-
"lines-around-comment": 0,
|
|
55
|
-
"max-depth": 0,
|
|
56
|
-
"max-len": 0,
|
|
57
|
-
"max-nested-callbacks": 0,
|
|
58
|
-
"max-params": 0,
|
|
59
|
-
"max-statements": 0,
|
|
60
|
-
"new-cap": [2, { "properties": false }],
|
|
61
|
-
"newline-after-var": 1,
|
|
62
|
-
"no-alert": 2,
|
|
63
|
-
"no-array-constructor": 2,
|
|
64
|
-
"no-bitwise": 2,
|
|
65
|
-
"no-caller": 2,
|
|
66
|
-
"no-catch-shadow": 0,
|
|
67
|
-
"no-class-assign": 2,
|
|
68
|
-
"no-cond-assign": 2,
|
|
69
|
-
"no-const-assign": 2,
|
|
70
|
-
"no-constant-condition": 2,
|
|
71
|
-
"no-continue": 2,
|
|
72
|
-
"no-control-regex": 2,
|
|
73
|
-
"no-delete-var": 2,
|
|
74
|
-
"no-div-regex": 2,
|
|
75
|
-
"no-dupe-args": 2,
|
|
76
|
-
"no-dupe-keys": 2,
|
|
77
|
-
"no-duplicate-case": 2,
|
|
78
|
-
"no-else-return": 0,
|
|
79
|
-
"no-empty-character-class": 2,
|
|
80
|
-
"no-empty": 2,
|
|
81
|
-
"no-eq-null": 2,
|
|
82
|
-
"no-eval": 2,
|
|
83
|
-
"no-ex-assign": 2,
|
|
84
|
-
"no-extend-native": 2,
|
|
85
|
-
"no-extra-bind": 2,
|
|
86
|
-
"no-extra-boolean-cast": 2,
|
|
87
|
-
"no-extra-parens": 0,
|
|
88
|
-
"no-fallthrough": 2,
|
|
89
|
-
"no-floating-decimal": 2,
|
|
90
|
-
"no-func-assign": 2,
|
|
91
|
-
"no-implicit-coercion": 2,
|
|
92
|
-
"no-implied-eval": 2,
|
|
93
|
-
"no-inline-comments": 0,
|
|
94
|
-
"no-inner-declarations": 2,
|
|
95
|
-
"no-invalid-regexp": 2,
|
|
96
|
-
"no-invalid-this": 2,
|
|
97
|
-
"no-irregular-whitespace": 1,
|
|
98
|
-
"no-iterator": 2,
|
|
99
|
-
"no-label-var": 2,
|
|
100
|
-
"no-labels": 2,
|
|
101
|
-
"no-lone-blocks": 2,
|
|
102
|
-
"no-lonely-if": 2,
|
|
103
|
-
"no-loop-func": 2,
|
|
104
|
-
"no-mixed-requires": 2,
|
|
105
|
-
"no-multi-str": 2,
|
|
106
|
-
"no-native-reassign": 2,
|
|
107
|
-
"no-negated-in-lhs": 2,
|
|
108
|
-
"no-nested-ternary": 2,
|
|
109
|
-
"no-new-func": 2,
|
|
110
|
-
"no-new-object": 2,
|
|
111
|
-
"no-new-require": 2,
|
|
112
|
-
"no-new-wrappers": 2,
|
|
113
|
-
"no-new": 2,
|
|
114
|
-
"no-obj-calls": 2,
|
|
115
|
-
"no-octal-escape": 2,
|
|
116
|
-
"no-octal": 2,
|
|
117
|
-
"no-param-reassign": 0,
|
|
118
|
-
"no-path-concat": 2,
|
|
119
|
-
"no-plusplus": 0,
|
|
120
|
-
"no-process-env": 0,
|
|
121
|
-
"no-process-exit": 2,
|
|
122
|
-
"no-proto": 2,
|
|
123
|
-
"no-redeclare": 2,
|
|
124
|
-
"no-regex-spaces": 2,
|
|
125
|
-
"no-restricted-modules": 2,
|
|
126
|
-
"no-return-assign": 2,
|
|
127
|
-
"no-script-url": 2,
|
|
128
|
-
"no-self-compare": 2,
|
|
129
|
-
"no-sequences": 2,
|
|
130
|
-
"no-shadow-restricted-names": 0,
|
|
131
|
-
"no-shadow": 2,
|
|
132
|
-
"no-sparse-arrays": 2,
|
|
133
|
-
"no-sync": 2,
|
|
134
|
-
"no-ternary": 0,
|
|
135
|
-
"no-this-before-super": 2,
|
|
136
|
-
"no-throw-literal": 2,
|
|
137
|
-
"no-undef-init": 2,
|
|
138
|
-
"no-undef": 2,
|
|
139
|
-
"no-undefined": 0,
|
|
140
|
-
"no-underscore-dangle": 2,
|
|
141
|
-
"no-unexpected-multiline": 2,
|
|
142
|
-
"no-unneeded-ternary": 0,
|
|
143
|
-
"no-unreachable": 2,
|
|
144
|
-
"no-unused-expressions": 2,
|
|
145
|
-
"no-unused-vars": 2,
|
|
146
|
-
"no-use-before-define": 2,
|
|
147
|
-
"no-useless-call": 2,
|
|
148
|
-
"no-var": 0,
|
|
149
|
-
"no-void": 0,
|
|
150
|
-
"no-warning-comments": 1,
|
|
151
|
-
"no-with": 2,
|
|
152
|
-
"object-shorthand": 0,
|
|
153
|
-
"one-var": 0,
|
|
154
|
-
"operator-assignment": 2,
|
|
155
|
-
"prefer-const": 2,
|
|
156
|
-
"prefer-spread": 0,
|
|
157
|
-
"radix": 2,
|
|
158
|
-
"require-yield": 2,
|
|
159
|
-
"sort-vars": 0,
|
|
160
|
-
"space-return-throw-case": 0,
|
|
161
|
-
"spaced-comment": 1,
|
|
162
|
-
"strict": [2, "function"],
|
|
163
|
-
"use-isnan": 2,
|
|
164
|
-
"valid-jsdoc": 0,
|
|
165
|
-
"valid-typeof": 2,
|
|
166
|
-
"vars-on-top": 2,
|
|
167
|
-
"yoda": 2,
|
|
168
|
-
"no-console": 2,
|
|
169
|
-
"no-debugger": 2,
|
|
170
|
-
"prettier/prettier": 2,
|
|
171
|
-
"jsx-a11y/label-has-for": 0,
|
|
172
|
-
"react/jsx-uses-react": 0,
|
|
173
|
-
"react/react-in-jsx-scope": 0
|
|
174
|
-
},
|
|
175
|
-
"settings": {
|
|
176
|
-
"react": {
|
|
177
|
-
"version": "detect"
|
|
178
|
-
},
|
|
179
|
-
"import/resolver": {
|
|
180
|
-
"webpack": {
|
|
181
|
-
"config": path.join(__dirname, 'webpack.config.babel.js')
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
};
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
"env": {
|
|
5
|
+
"browser": true,
|
|
6
|
+
"es2020": true,
|
|
7
|
+
<% if (flags.addJest) { %>
|
|
8
|
+
"jest": true,
|
|
9
|
+
<% } %>
|
|
10
|
+
"node": true
|
|
11
|
+
},
|
|
12
|
+
"extends": [
|
|
13
|
+
"eslint:recommended",
|
|
14
|
+
"plugin:react/recommended",
|
|
15
|
+
"plugin:prettier/recommended",
|
|
16
|
+
"plugin:jsx-a11y/recommended",
|
|
17
|
+
"plugin:import/recommended",
|
|
18
|
+
"plugin:react-hooks/recommended",
|
|
19
|
+
<% if (flags.addJest) { %>
|
|
20
|
+
"plugin:jest/recommended"
|
|
21
|
+
<% } %>
|
|
22
|
+
],
|
|
23
|
+
"parser": "@babel/eslint-parser",
|
|
24
|
+
"parserOptions": {
|
|
25
|
+
"requireConfigFile": false,
|
|
26
|
+
"ecmaFeatures": {
|
|
27
|
+
"jsx": true
|
|
28
|
+
},
|
|
29
|
+
"ecmaVersion": 12
|
|
30
|
+
},
|
|
31
|
+
"rules": {
|
|
32
|
+
"jsx-a11y/label-has-for": 0,
|
|
33
|
+
"react/jsx-uses-react": 0,
|
|
34
|
+
"react/react-in-jsx-scope": 0
|
|
35
|
+
},
|
|
36
|
+
"settings": {
|
|
37
|
+
"react": {
|
|
38
|
+
"version": "detect"
|
|
39
|
+
},
|
|
40
|
+
"import/resolver": {
|
|
41
|
+
"webpack": {
|
|
42
|
+
"config": path.join(__dirname, 'webpack.config.babel.js')
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"*.js": "eslint",
|
|
3
|
-
"*.scss": "stylelint"
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"*.js": "eslint",
|
|
3
|
+
"*.scss": "stylelint"
|
|
4
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"singleQuote": true,
|
|
3
|
-
"trailingComma": "none",
|
|
4
|
-
"endOfLine": "auto"
|
|
1
|
+
{
|
|
2
|
+
"singleQuote": true,
|
|
3
|
+
"trailingComma": "none",
|
|
4
|
+
"endOfLine": "auto"
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@storybook/addon-knobs/register';
|
|
1
|
+
import '@storybook/addon-knobs/register';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
|
-
import { configure, addDecorator } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import '../src/index.scss';
|
|
5
|
-
|
|
6
|
-
function loadStories() {
|
|
7
|
-
const req = require.context('../src/components', true, /\.stories\.js$/);
|
|
8
|
-
|
|
9
|
-
req.keys().forEach(filename => req(filename));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
addDecorator(withKnobs);
|
|
13
|
-
|
|
14
|
-
configure(loadStories, module);
|
|
1
|
+
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
|
+
import { configure, addDecorator } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import '../src/index.scss';
|
|
5
|
+
|
|
6
|
+
function loadStories() {
|
|
7
|
+
const req = require.context('../src/components', true, /\.stories\.js$/);
|
|
8
|
+
|
|
9
|
+
req.keys().forEach(filename => req(filename));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
addDecorator(withKnobs);
|
|
13
|
+
|
|
14
|
+
configure(loadStories, module);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import webpack from '../webpack.config.babel';
|
|
2
|
-
|
|
3
|
-
export default async ({ config }) => ({
|
|
4
|
-
...config,
|
|
5
|
-
module: webpack.module,
|
|
6
|
-
resolve: webpack.resolve
|
|
7
|
-
});
|
|
1
|
+
import webpack from '../webpack.config.babel';
|
|
2
|
+
|
|
3
|
+
export default async ({ config }) => ({
|
|
4
|
+
...config,
|
|
5
|
+
module: webpack.module,
|
|
6
|
+
resolve: webpack.resolve
|
|
7
|
+
});
|