generator-folklore 3.0.15 → 3.0.17
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/generators/app/index.js +3 -18
- package/lib/generators/babel/index.js +0 -12
- package/lib/generators/browserslist/index.js +0 -7
- package/lib/generators/build/index.js +0 -17
- package/lib/generators/cli/index.js +0 -18
- package/lib/generators/docs/index.js +3 -32
- package/lib/generators/editorconfig/index.js +0 -6
- package/lib/generators/eslint/index.js +0 -11
- package/lib/generators/html-project/index.js +0 -30
- package/lib/generators/intl/index.js +0 -13
- package/lib/generators/laravel/index.js +3 -75
- package/lib/generators/laravel-auth/index.js +0 -25
- package/lib/generators/laravel-mediatheque/index.js +0 -28
- package/lib/generators/laravel-package/index.js +0 -33
- package/lib/generators/laravel-panneau/index.js +0 -49
- package/lib/generators/laravel-project/index.js +9 -76
- package/lib/generators/laravel-project/templates/laravel/config/app.php +1 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/auth.php +18 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/pagination.php +17 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/passwords.php +20 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/validation.php +167 -0
- package/lib/generators/lerna-package/index.js +0 -36
- package/lib/generators/lerna-repository/index.js +0 -34
- package/lib/generators/node-project/index.js +0 -28
- package/lib/generators/npm-package/index.js +0 -36
- package/lib/generators/prettier/index.js +0 -11
- package/lib/generators/react-app/index.js +3 -28
- package/lib/generators/react-package/index.js +0 -33
- package/lib/generators/rollup/index.js +0 -13
- package/lib/generators/sass-lint/index.js +0 -9
- package/lib/generators/scss/index.js +0 -16
- package/lib/generators/server/index.js +0 -15
- package/lib/generators/storybook/index.js +0 -16
- package/lib/generators/stylelint/index.js +0 -11
- package/lib/generators/stylelint/templates/stylelintrc +2 -1
- package/lib/generators/test/index.js +0 -16
- package/lib/lib/generator.js +3 -22
- package/lib/lib/mysql.js +0 -10
- package/lib/lib/utils.js +0 -4
- package/package.json +2 -2
@@ -1,21 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
-
|
5
4
|
var _lodash = _interopRequireDefault(require("lodash"));
|
6
|
-
|
7
5
|
var _path = _interopRequireDefault(require("path"));
|
8
|
-
|
9
6
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
10
|
-
|
11
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
|
-
|
13
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
14
|
-
|
15
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
16
|
-
|
17
|
-
function
|
18
|
-
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
12
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
19
13
|
module.exports = class ReactAppGenerator extends _generator.default {
|
20
14
|
// The name `constructor` is important here
|
21
15
|
constructor(...args) {
|
@@ -32,44 +26,35 @@ module.exports = class ReactAppGenerator extends _generator.default {
|
|
32
26
|
type: String
|
33
27
|
});
|
34
28
|
}
|
35
|
-
|
36
29
|
initializing() {
|
37
30
|
this.react_features = [];
|
38
31
|
}
|
39
|
-
|
40
32
|
get prompting() {
|
41
33
|
return {
|
42
34
|
welcome() {
|
43
35
|
if (this.options.quiet) {
|
44
36
|
return;
|
45
37
|
}
|
46
|
-
|
47
38
|
console.log(_chalk.default.yellow('\n----------------------'));
|
48
39
|
console.log('React App Generator');
|
49
40
|
console.log(_chalk.default.yellow('----------------------\n'));
|
50
41
|
},
|
51
|
-
|
52
42
|
prompts() {
|
53
43
|
const prompts = [];
|
54
|
-
|
55
44
|
if (!this.options['project-name']) {
|
56
45
|
prompts.push(_generator.default.prompts.project_name);
|
57
46
|
}
|
58
|
-
|
59
47
|
if (!prompts.length) {
|
60
48
|
return null;
|
61
49
|
}
|
62
|
-
|
63
50
|
return this.prompt(prompts).then(answers => {
|
64
51
|
if (answers['project-name']) {
|
65
52
|
this.options['project-name'] = answers['project-name'];
|
66
53
|
}
|
67
54
|
});
|
68
55
|
}
|
69
|
-
|
70
56
|
};
|
71
57
|
}
|
72
|
-
|
73
58
|
get writing() {
|
74
59
|
return {
|
75
60
|
directory() {
|
@@ -82,22 +67,17 @@ module.exports = class ReactAppGenerator extends _generator.default {
|
|
82
67
|
const srcPath = this.templatePath('src');
|
83
68
|
this.fs.copyTpl(srcPath, destPath, templateData);
|
84
69
|
},
|
85
|
-
|
86
70
|
index() {
|
87
71
|
const jsPath = this.options.path;
|
88
72
|
this.fs.copyTpl(this.templatePath('index.js'), this.destinationPath(_path.default.join(jsPath, 'index.js')));
|
89
73
|
},
|
90
|
-
|
91
74
|
styles() {
|
92
75
|
const templateData = {};
|
93
|
-
|
94
76
|
const stylesPath = this.options['styles-path'] || _path.default.join(this.options.path, 'styles');
|
95
|
-
|
96
77
|
const srcPath = this.templatePath('styles');
|
97
78
|
const destPath = this.destinationPath(stylesPath);
|
98
79
|
this.fs.copyTpl(srcPath, destPath, templateData);
|
99
80
|
},
|
100
|
-
|
101
81
|
packageJSON() {
|
102
82
|
const srcPath = this.templatePath('_package.json');
|
103
83
|
const destPath = this.destinationPath('package.json');
|
@@ -106,7 +86,6 @@ module.exports = class ReactAppGenerator extends _generator.default {
|
|
106
86
|
name: this.options['project-name']
|
107
87
|
}));
|
108
88
|
},
|
109
|
-
|
110
89
|
dependencies() {
|
111
90
|
this.addDependencies({
|
112
91
|
react: '^18.0.0',
|
@@ -131,16 +110,12 @@ module.exports = class ReactAppGenerator extends _generator.default {
|
|
131
110
|
'resize-observer-polyfill': '^1.5.1'
|
132
111
|
});
|
133
112
|
}
|
134
|
-
|
135
113
|
};
|
136
114
|
}
|
137
|
-
|
138
115
|
async install() {
|
139
116
|
if (this.options['skip-install']) {
|
140
117
|
return;
|
141
118
|
}
|
142
|
-
|
143
119
|
await this.spawnCommand('npm', ['install']);
|
144
120
|
}
|
145
|
-
|
146
121
|
};
|
@@ -1,17 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
-
|
5
4
|
var _changeCase = require("change-case");
|
6
|
-
|
7
5
|
var _lodash = _interopRequireDefault(require("lodash"));
|
8
|
-
|
9
6
|
var _path = _interopRequireDefault(require("path"));
|
10
|
-
|
11
7
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
12
|
-
|
13
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
|
-
|
15
9
|
module.exports = class ReactPackageGenerator extends _generator.default {
|
16
10
|
constructor(...args) {
|
17
11
|
super(...args);
|
@@ -49,22 +43,18 @@ module.exports = class ReactPackageGenerator extends _generator.default {
|
|
49
43
|
defaults: './examples'
|
50
44
|
});
|
51
45
|
}
|
52
|
-
|
53
46
|
get prompting() {
|
54
47
|
return {
|
55
48
|
welcome() {
|
56
49
|
if (this.options.quiet) {
|
57
50
|
return;
|
58
51
|
}
|
59
|
-
|
60
52
|
console.log(_chalk.default.yellow('\n----------------------'));
|
61
53
|
console.log('React Package Generator');
|
62
54
|
console.log(_chalk.default.yellow('----------------------\n'));
|
63
55
|
},
|
64
|
-
|
65
56
|
prompts() {
|
66
57
|
const prompts = [];
|
67
|
-
|
68
58
|
if (!this.options['package-name']) {
|
69
59
|
prompts.push({
|
70
60
|
type: 'input',
|
@@ -76,7 +66,6 @@ module.exports = class ReactPackageGenerator extends _generator.default {
|
|
76
66
|
}
|
77
67
|
});
|
78
68
|
}
|
79
|
-
|
80
69
|
if (!this.options['component-name']) {
|
81
70
|
prompts.push({
|
82
71
|
type: 'input',
|
@@ -88,38 +77,27 @@ module.exports = class ReactPackageGenerator extends _generator.default {
|
|
88
77
|
}
|
89
78
|
});
|
90
79
|
}
|
91
|
-
|
92
80
|
if (!prompts.length) {
|
93
81
|
return null;
|
94
82
|
}
|
95
|
-
|
96
83
|
return this.prompt(prompts).then(answers => {
|
97
84
|
if (answers['package-name']) {
|
98
85
|
this.options['package-name'] = answers['package-name'];
|
99
86
|
}
|
100
|
-
|
101
87
|
if (answers['component-name']) {
|
102
88
|
this.options['component-name'] = answers['component-name'];
|
103
89
|
}
|
104
90
|
});
|
105
91
|
}
|
106
|
-
|
107
92
|
};
|
108
93
|
}
|
109
|
-
|
110
94
|
configuring() {
|
111
95
|
const srcPath = _lodash.default.get(this.options, 'src-path');
|
112
|
-
|
113
96
|
const destPath = _lodash.default.get(this.options, 'dest-path');
|
114
|
-
|
115
97
|
const tmpPath = _lodash.default.get(this.options, 'tmp-path');
|
116
|
-
|
117
98
|
const buildPath = _lodash.default.get(this.options, 'build-path');
|
118
|
-
|
119
99
|
const examplesPath = _lodash.default.get(this.options, 'examples-path');
|
120
|
-
|
121
100
|
const skipInstall = _lodash.default.get(this.options, 'skip-install', false);
|
122
|
-
|
123
101
|
this.composeWith('folklore:npm-package', {
|
124
102
|
'package-name': this.options['package-name'],
|
125
103
|
src: false,
|
@@ -142,7 +120,6 @@ module.exports = class ReactPackageGenerator extends _generator.default {
|
|
142
120
|
quiet: true
|
143
121
|
});
|
144
122
|
}
|
145
|
-
|
146
123
|
get writing() {
|
147
124
|
return {
|
148
125
|
examples() {
|
@@ -150,7 +127,6 @@ module.exports = class ReactPackageGenerator extends _generator.default {
|
|
150
127
|
const destPath = this.destinationPath('examples');
|
151
128
|
this.fs.copyTpl(srcPath, destPath, this);
|
152
129
|
},
|
153
|
-
|
154
130
|
src() {
|
155
131
|
const srcPath = this.templatePath('src');
|
156
132
|
const destPath = this.destinationPath('src');
|
@@ -158,13 +134,11 @@ module.exports = class ReactPackageGenerator extends _generator.default {
|
|
158
134
|
componentName: this.options['component-name']
|
159
135
|
});
|
160
136
|
},
|
161
|
-
|
162
137
|
storybook() {
|
163
138
|
const srcPath = this.templatePath('storybook');
|
164
139
|
const destPath = this.destinationPath('.storybook');
|
165
140
|
this.fs.copyTpl(srcPath, destPath, {});
|
166
141
|
},
|
167
|
-
|
168
142
|
packageJSON() {
|
169
143
|
const packagePath = this.destinationPath('package.json');
|
170
144
|
this.fs.extendJSON(packagePath, {
|
@@ -173,25 +147,20 @@ module.exports = class ReactPackageGenerator extends _generator.default {
|
|
173
147
|
}
|
174
148
|
});
|
175
149
|
}
|
176
|
-
|
177
150
|
};
|
178
151
|
}
|
179
|
-
|
180
152
|
get install() {
|
181
153
|
return {
|
182
154
|
npmInstall() {
|
183
155
|
if (this.options['skip-install']) {
|
184
156
|
return;
|
185
157
|
}
|
186
|
-
|
187
158
|
this.addDependencies(['react@latest', 'prop-types@latest', 'react-dom@latest']);
|
188
159
|
},
|
189
|
-
|
190
160
|
npmInstallDev() {
|
191
161
|
if (this.options['skip-install']) {
|
192
162
|
return;
|
193
163
|
}
|
194
|
-
|
195
164
|
this.addDevDependencies({
|
196
165
|
domready: 'latest',
|
197
166
|
jquery: 'latest',
|
@@ -203,8 +172,6 @@ module.exports = class ReactPackageGenerator extends _generator.default {
|
|
203
172
|
'html-webpack-plugin': 'latest'
|
204
173
|
});
|
205
174
|
}
|
206
|
-
|
207
175
|
};
|
208
176
|
}
|
209
|
-
|
210
177
|
};
|
@@ -1,33 +1,25 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
-
|
5
4
|
var _path = _interopRequireDefault(require("path"));
|
6
|
-
|
7
5
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
8
|
-
|
9
6
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
|
-
|
11
7
|
module.exports = class RollupGenerator extends _generator.default {
|
12
8
|
constructor(...args) {
|
13
9
|
super(...args);
|
14
10
|
}
|
15
|
-
|
16
11
|
get prompting() {
|
17
12
|
return {
|
18
13
|
welcome() {
|
19
14
|
if (this.options.quiet) {
|
20
15
|
return;
|
21
16
|
}
|
22
|
-
|
23
17
|
console.log(_chalk.default.yellow('\n----------------------'));
|
24
18
|
console.log('Rollup Generator');
|
25
19
|
console.log(_chalk.default.yellow('----------------------\n'));
|
26
20
|
}
|
27
|
-
|
28
21
|
};
|
29
22
|
}
|
30
|
-
|
31
23
|
get writing() {
|
32
24
|
return {
|
33
25
|
config() {
|
@@ -35,7 +27,6 @@ module.exports = class RollupGenerator extends _generator.default {
|
|
35
27
|
const destPath = this.destinationPath('rollup.config.js');
|
36
28
|
this.fs.copyTpl(srcPath, destPath);
|
37
29
|
},
|
38
|
-
|
39
30
|
dependencies() {
|
40
31
|
this.addDevDependencies({
|
41
32
|
'@rollup/plugin-babel': 'latest',
|
@@ -46,16 +37,12 @@ module.exports = class RollupGenerator extends _generator.default {
|
|
46
37
|
rollup: '^2.79.1'
|
47
38
|
});
|
48
39
|
}
|
49
|
-
|
50
40
|
};
|
51
41
|
}
|
52
|
-
|
53
42
|
async install() {
|
54
43
|
if (this.options['skip-install']) {
|
55
44
|
return;
|
56
45
|
}
|
57
|
-
|
58
46
|
await this.spawnCommand('npm', ['install']);
|
59
47
|
}
|
60
|
-
|
61
48
|
};
|
@@ -1,11 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
-
|
5
4
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
6
|
-
|
7
5
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
-
|
9
6
|
module.exports = class SassLintGenerator extends _generator.default {
|
10
7
|
constructor(...args) {
|
11
8
|
super(...args);
|
@@ -15,22 +12,18 @@ module.exports = class SassLintGenerator extends _generator.default {
|
|
15
12
|
defaults: false
|
16
13
|
});
|
17
14
|
}
|
18
|
-
|
19
15
|
get prompting() {
|
20
16
|
return {
|
21
17
|
welcome() {
|
22
18
|
if (this.options.quiet) {
|
23
19
|
return;
|
24
20
|
}
|
25
|
-
|
26
21
|
console.log(_chalk.default.yellow('\n----------------------'));
|
27
22
|
console.log('Sass lint Generator');
|
28
23
|
console.log(_chalk.default.yellow('----------------------\n'));
|
29
24
|
}
|
30
|
-
|
31
25
|
};
|
32
26
|
}
|
33
|
-
|
34
27
|
get writing() {
|
35
28
|
return {
|
36
29
|
eslintrc() {
|
@@ -40,8 +33,6 @@ module.exports = class SassLintGenerator extends _generator.default {
|
|
40
33
|
camelCase: this.options['camel-case']
|
41
34
|
});
|
42
35
|
}
|
43
|
-
|
44
36
|
};
|
45
37
|
}
|
46
|
-
|
47
38
|
};
|
@@ -1,13 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
-
|
5
4
|
var _path = _interopRequireDefault(require("path"));
|
6
|
-
|
7
5
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
8
|
-
|
9
6
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
|
-
|
11
7
|
module.exports = class ScssGenerator extends _generator.default {
|
12
8
|
constructor(...args) {
|
13
9
|
super(...args);
|
@@ -19,43 +15,34 @@ module.exports = class ScssGenerator extends _generator.default {
|
|
19
15
|
type: String,
|
20
16
|
defaults: 'src/scss'
|
21
17
|
});
|
22
|
-
|
23
18
|
this.stylesPath = destPath => this.destinationPath(_path.default.join(this.options.path, destPath || ''));
|
24
19
|
}
|
25
|
-
|
26
20
|
get prompting() {
|
27
21
|
return {
|
28
22
|
welcome() {
|
29
23
|
if (this.options.quiet) {
|
30
24
|
return;
|
31
25
|
}
|
32
|
-
|
33
26
|
console.log(_chalk.default.yellow('\n----------------------'));
|
34
27
|
console.log('SCSS Generator');
|
35
28
|
console.log(_chalk.default.yellow('----------------------\n'));
|
36
29
|
},
|
37
|
-
|
38
30
|
prompts() {
|
39
31
|
const prompts = [];
|
40
|
-
|
41
32
|
if (!this.options['project-name']) {
|
42
33
|
prompts.push(ScssGenerator.prompts.project_name);
|
43
34
|
}
|
44
|
-
|
45
35
|
if (!prompts.length) {
|
46
36
|
return null;
|
47
37
|
}
|
48
|
-
|
49
38
|
return this.prompt(prompts).then(answers => {
|
50
39
|
if (answers['project-name']) {
|
51
40
|
this.options['project-name'] = answers['project-name'];
|
52
41
|
}
|
53
42
|
});
|
54
43
|
}
|
55
|
-
|
56
44
|
};
|
57
45
|
}
|
58
|
-
|
59
46
|
get writing() {
|
60
47
|
return {
|
61
48
|
styles() {
|
@@ -63,14 +50,11 @@ module.exports = class ScssGenerator extends _generator.default {
|
|
63
50
|
const destPath = this.stylesPath('styles.scss');
|
64
51
|
this.fs.copy(srcPath, destPath);
|
65
52
|
},
|
66
|
-
|
67
53
|
commmons() {
|
68
54
|
const srcPath = this.templatePath('commons');
|
69
55
|
const destPath = this.stylesPath('commons');
|
70
56
|
this.fs.copy(srcPath, destPath);
|
71
57
|
}
|
72
|
-
|
73
58
|
};
|
74
59
|
}
|
75
|
-
|
76
60
|
};
|
@@ -1,15 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
-
|
5
4
|
var _lodash = _interopRequireDefault(require("lodash"));
|
6
|
-
|
7
5
|
var _path = _interopRequireDefault(require("path"));
|
8
|
-
|
9
6
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
10
|
-
|
11
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
|
-
|
13
8
|
module.exports = class ServerGenerator extends _generator.default {
|
14
9
|
// The name `constructor` is important here
|
15
10
|
constructor(...args) {
|
@@ -27,22 +22,18 @@ module.exports = class ServerGenerator extends _generator.default {
|
|
27
22
|
defaults: false
|
28
23
|
});
|
29
24
|
}
|
30
|
-
|
31
25
|
get prompting() {
|
32
26
|
return {
|
33
27
|
welcome() {
|
34
28
|
if (this.options.quiet) {
|
35
29
|
return;
|
36
30
|
}
|
37
|
-
|
38
31
|
console.log(_chalk.default.yellow('\n----------------------'));
|
39
32
|
console.log('Server Generator');
|
40
33
|
console.log(_chalk.default.yellow('----------------------\n'));
|
41
34
|
}
|
42
|
-
|
43
35
|
};
|
44
36
|
}
|
45
|
-
|
46
37
|
get writing() {
|
47
38
|
return {
|
48
39
|
index() {
|
@@ -55,7 +46,6 @@ module.exports = class ServerGenerator extends _generator.default {
|
|
55
46
|
socketIo
|
56
47
|
});
|
57
48
|
},
|
58
|
-
|
59
49
|
dependencies() {
|
60
50
|
const {
|
61
51
|
'socket-io': socketIo
|
@@ -66,23 +56,18 @@ module.exports = class ServerGenerator extends _generator.default {
|
|
66
56
|
ejs: 'latest',
|
67
57
|
express: 'latest'
|
68
58
|
});
|
69
|
-
|
70
59
|
if (socketIo) {
|
71
60
|
this.addDependencies({
|
72
61
|
'socket.io': 'latest'
|
73
62
|
});
|
74
63
|
}
|
75
64
|
}
|
76
|
-
|
77
65
|
};
|
78
66
|
}
|
79
|
-
|
80
67
|
async install() {
|
81
68
|
if (this.options['skip-install']) {
|
82
69
|
return;
|
83
70
|
}
|
84
|
-
|
85
71
|
await this.spawnCommand('npm', ['install']);
|
86
72
|
}
|
87
|
-
|
88
73
|
};
|
@@ -1,13 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
-
|
5
4
|
var _path = _interopRequireDefault(require("path"));
|
6
|
-
|
7
5
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
8
|
-
|
9
6
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
|
-
|
11
7
|
module.exports = class StorybookGenerator extends _generator.default {
|
12
8
|
constructor(...args) {
|
13
9
|
super(...args);
|
@@ -21,25 +17,20 @@ module.exports = class StorybookGenerator extends _generator.default {
|
|
21
17
|
required: false,
|
22
18
|
defaults: '../src/__stories__/*.story.jsx'
|
23
19
|
});
|
24
|
-
|
25
20
|
this.storybookPath = destPath => this.destinationPath(_path.default.join(this.options.path, destPath));
|
26
21
|
}
|
27
|
-
|
28
22
|
get prompting() {
|
29
23
|
return {
|
30
24
|
welcome() {
|
31
25
|
if (this.options.quiet) {
|
32
26
|
return;
|
33
27
|
}
|
34
|
-
|
35
28
|
console.log(_chalk.default.yellow('\n----------------------'));
|
36
29
|
console.log('Storybook Generator');
|
37
30
|
console.log(_chalk.default.yellow('----------------------\n'));
|
38
31
|
}
|
39
|
-
|
40
32
|
};
|
41
33
|
}
|
42
|
-
|
43
34
|
get writing() {
|
44
35
|
return {
|
45
36
|
staticFiles() {
|
@@ -52,13 +43,11 @@ module.exports = class StorybookGenerator extends _generator.default {
|
|
52
43
|
this.fs.copy(this.templatePath('preview-head.html'), this.storybookPath('preview-head.html'));
|
53
44
|
this.fs.copy(this.templatePath('storiesOf.jsx'), this.storybookPath('storiesOf.jsx'));
|
54
45
|
},
|
55
|
-
|
56
46
|
storiesPattern() {
|
57
47
|
this.fs.copyTpl(this.templatePath('stories.pattern'), this.storybookPath('stories.pattern'), {
|
58
48
|
pattern: this.options.pattern
|
59
49
|
});
|
60
50
|
},
|
61
|
-
|
62
51
|
packageJSON() {
|
63
52
|
const packageJSON = this.fs.exists(destPath) ? this.fs.readJSON(destPath) : {};
|
64
53
|
packageJSON['storybook-deployer'] = {
|
@@ -68,17 +57,14 @@ module.exports = class StorybookGenerator extends _generator.default {
|
|
68
57
|
};
|
69
58
|
this.packageJson.merge(packageJSON);
|
70
59
|
}
|
71
|
-
|
72
60
|
};
|
73
61
|
}
|
74
|
-
|
75
62
|
get install() {
|
76
63
|
return {
|
77
64
|
npm() {
|
78
65
|
if (this.options['skip-install']) {
|
79
66
|
return;
|
80
67
|
}
|
81
|
-
|
82
68
|
this.addDevDependencies({
|
83
69
|
'@storybook/addon-actions': 'latest',
|
84
70
|
'@storybook/addon-info': 'latest',
|
@@ -89,8 +75,6 @@ module.exports = class StorybookGenerator extends _generator.default {
|
|
89
75
|
'glob-loader': 'latest'
|
90
76
|
});
|
91
77
|
}
|
92
|
-
|
93
78
|
};
|
94
79
|
}
|
95
|
-
|
96
80
|
};
|
@@ -1,11 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
-
|
5
4
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
6
|
-
|
7
5
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
-
|
9
6
|
module.exports = class StylelintGenerator extends _generator.default {
|
10
7
|
constructor(...args) {
|
11
8
|
super(...args);
|
@@ -15,17 +12,14 @@ module.exports = class StylelintGenerator extends _generator.default {
|
|
15
12
|
defaults: true
|
16
13
|
});
|
17
14
|
}
|
18
|
-
|
19
15
|
prompting() {
|
20
16
|
if (this.options.quiet) {
|
21
17
|
return;
|
22
18
|
}
|
23
|
-
|
24
19
|
console.log(_chalk.default.yellow('\n----------------------'));
|
25
20
|
console.log('Stylelint Generator');
|
26
21
|
console.log(_chalk.default.yellow('----------------------\n'));
|
27
22
|
}
|
28
|
-
|
29
23
|
get writing() {
|
30
24
|
return {
|
31
25
|
stylelintrc() {
|
@@ -35,7 +29,6 @@ module.exports = class StylelintGenerator extends _generator.default {
|
|
35
29
|
camelCase: this.options['camel-case']
|
36
30
|
});
|
37
31
|
},
|
38
|
-
|
39
32
|
dependencies() {
|
40
33
|
this.addDevDependencies({
|
41
34
|
stylelint: '^15.0.0',
|
@@ -44,16 +37,12 @@ module.exports = class StylelintGenerator extends _generator.default {
|
|
44
37
|
'stylelint-config-standard': '^30.0.1'
|
45
38
|
});
|
46
39
|
}
|
47
|
-
|
48
40
|
};
|
49
41
|
}
|
50
|
-
|
51
42
|
async install() {
|
52
43
|
if (this.options['skip-install']) {
|
53
44
|
return;
|
54
45
|
}
|
55
|
-
|
56
46
|
await this.spawnCommand('npm', ['install']);
|
57
47
|
}
|
58
|
-
|
59
48
|
};
|