generator-folklore 3.0.16 → 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/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,17 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _lodash = _interopRequireDefault(require("lodash"));
|
4
|
-
|
5
4
|
var _chalk = _interopRequireDefault(require("chalk"));
|
6
|
-
|
7
5
|
var _path = _interopRequireDefault(require("path"));
|
8
|
-
|
9
6
|
var _changeCase = require("change-case");
|
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 ComposerPackageGenerator extends _generator.default {
|
16
10
|
constructor(...args) {
|
17
11
|
super(...args);
|
@@ -35,22 +29,18 @@ module.exports = class ComposerPackageGenerator extends _generator.default {
|
|
35
29
|
defaults: './src'
|
36
30
|
});
|
37
31
|
}
|
38
|
-
|
39
32
|
get prompting() {
|
40
33
|
return {
|
41
34
|
welcome() {
|
42
35
|
if (this.options.quiet) {
|
43
36
|
return;
|
44
37
|
}
|
45
|
-
|
46
38
|
console.log(_chalk.default.yellow('\n----------------------'));
|
47
39
|
console.log('Composer Package Generator');
|
48
40
|
console.log(_chalk.default.yellow('----------------------\n'));
|
49
41
|
},
|
50
|
-
|
51
42
|
prompts() {
|
52
43
|
const prompts = [];
|
53
|
-
|
54
44
|
if (!this.options['package-name']) {
|
55
45
|
prompts.push({
|
56
46
|
type: 'input',
|
@@ -62,7 +52,6 @@ module.exports = class ComposerPackageGenerator extends _generator.default {
|
|
62
52
|
}
|
63
53
|
});
|
64
54
|
}
|
65
|
-
|
66
55
|
if (!this.options['package-namespace']) {
|
67
56
|
prompts.push({
|
68
57
|
type: 'input',
|
@@ -75,25 +64,20 @@ module.exports = class ComposerPackageGenerator extends _generator.default {
|
|
75
64
|
}
|
76
65
|
});
|
77
66
|
}
|
78
|
-
|
79
67
|
if (!prompts.length) {
|
80
68
|
return null;
|
81
69
|
}
|
82
|
-
|
83
70
|
return this.prompt(prompts).then(answers => {
|
84
71
|
if (answers['package-name']) {
|
85
72
|
this.options['package-name'] = answers['package-name'];
|
86
73
|
}
|
87
|
-
|
88
74
|
if (answers['package-namespace']) {
|
89
75
|
this.options['package-namespace'] = answers['package-namespace'];
|
90
76
|
}
|
91
77
|
});
|
92
78
|
}
|
93
|
-
|
94
79
|
};
|
95
80
|
}
|
96
|
-
|
97
81
|
configuring() {
|
98
82
|
const namespaceParts = this.options['package-namespace'].split('\\');
|
99
83
|
const baseName = namespaceParts[1];
|
@@ -109,7 +93,6 @@ module.exports = class ComposerPackageGenerator extends _generator.default {
|
|
109
93
|
quiet: true
|
110
94
|
});
|
111
95
|
}
|
112
|
-
|
113
96
|
get writing() {
|
114
97
|
return {
|
115
98
|
src() {
|
@@ -117,13 +100,11 @@ module.exports = class ComposerPackageGenerator extends _generator.default {
|
|
117
100
|
const destPath = this.destinationPath('src');
|
118
101
|
this.fs.copyTpl(srcPath, destPath, this.templateData);
|
119
102
|
},
|
120
|
-
|
121
103
|
testsDirectory() {
|
122
104
|
const srcPath = this.templatePath('tests');
|
123
105
|
const destPath = this.destinationPath('tests');
|
124
106
|
this.fs.copyTpl(srcPath, destPath, this.templateData);
|
125
107
|
},
|
126
|
-
|
127
108
|
serviceProvider() {
|
128
109
|
const {
|
129
110
|
namespacePath,
|
@@ -133,7 +114,6 @@ module.exports = class ComposerPackageGenerator extends _generator.default {
|
|
133
114
|
const destPath = this.destinationPath(`src/${namespacePath}/${baseClassName}ServiceProvider.php`);
|
134
115
|
this.fs.copyTpl(srcPath, destPath, this.templateData);
|
135
116
|
},
|
136
|
-
|
137
117
|
tests() {
|
138
118
|
const featureSrcPath = this.templatePath('Test.php');
|
139
119
|
const featureDestPath = this.destinationPath('tests/Feature/FeatureTest.php');
|
@@ -146,43 +126,36 @@ module.exports = class ComposerPackageGenerator extends _generator.default {
|
|
146
126
|
baseClassName: 'Unit'
|
147
127
|
});
|
148
128
|
},
|
149
|
-
|
150
129
|
gitignore() {
|
151
130
|
const srcPath = this.templatePath('gitignore');
|
152
131
|
const destPath = this.destinationPath('.gitignore');
|
153
132
|
this.fs.copy(srcPath, destPath);
|
154
133
|
},
|
155
|
-
|
156
134
|
coveralls() {
|
157
135
|
const srcPath = this.templatePath('coveralls.yml');
|
158
136
|
const destPath = this.destinationPath('.coveralls.yml');
|
159
137
|
this.fs.copy(srcPath, destPath);
|
160
138
|
},
|
161
|
-
|
162
139
|
travis() {
|
163
140
|
const srcPath = this.templatePath('travis.yml');
|
164
141
|
const destPath = this.destinationPath('.travis.yml');
|
165
142
|
this.fs.copy(srcPath, destPath);
|
166
143
|
},
|
167
|
-
|
168
144
|
phpcs() {
|
169
145
|
const srcPath = this.templatePath('phpcs.xml');
|
170
146
|
const destPath = this.destinationPath('phpcs.xml');
|
171
147
|
this.fs.copy(srcPath, destPath);
|
172
148
|
},
|
173
|
-
|
174
149
|
phpunit() {
|
175
150
|
const srcPath = this.templatePath('phpunit.xml');
|
176
151
|
const destPath = this.destinationPath('phpunit.xml');
|
177
152
|
this.fs.copyTpl(srcPath, destPath, this.templateData);
|
178
153
|
},
|
179
|
-
|
180
154
|
readme() {
|
181
155
|
const srcPath = this.templatePath('Readme.md');
|
182
156
|
const destPath = this.destinationPath('Readme.md');
|
183
157
|
this.fs.copy(srcPath, destPath);
|
184
158
|
},
|
185
|
-
|
186
159
|
composerJSON() {
|
187
160
|
const {
|
188
161
|
packageName,
|
@@ -200,24 +173,18 @@ module.exports = class ComposerPackageGenerator extends _generator.default {
|
|
200
173
|
const currentJson = this.fs.exists(destPath) ? this.fs.readJSON(destPath) : {};
|
201
174
|
this.fs.writeJSON(destPath, _lodash.default.merge(newJson, currentJson));
|
202
175
|
}
|
203
|
-
|
204
176
|
};
|
205
177
|
}
|
206
|
-
|
207
178
|
get install() {
|
208
179
|
return {
|
209
180
|
composer() {
|
210
181
|
const skipInstall = _lodash.default.get(this.options, 'skip-install', false);
|
211
|
-
|
212
182
|
if (skipInstall) {
|
213
183
|
return;
|
214
184
|
}
|
215
|
-
|
216
185
|
const done = this.async();
|
217
186
|
this.spawnCommand('composer', ['install']).on('close', done);
|
218
187
|
}
|
219
|
-
|
220
188
|
};
|
221
189
|
}
|
222
|
-
|
223
190
|
};
|
@@ -1,21 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
-
|
5
4
|
var _cliHighlight = require("cli-highlight");
|
6
|
-
|
7
5
|
var _fs = _interopRequireDefault(require("fs"));
|
8
|
-
|
9
6
|
var _glob = _interopRequireDefault(require("glob"));
|
10
|
-
|
11
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
12
|
-
|
13
8
|
var _path = _interopRequireDefault(require("path"));
|
14
|
-
|
15
9
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
16
|
-
|
17
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
18
|
-
|
19
11
|
module.exports = class LaravelPanneauGenerator extends _generator.default {
|
20
12
|
constructor(...args) {
|
21
13
|
super(...args);
|
@@ -24,40 +16,32 @@ module.exports = class LaravelPanneauGenerator extends _generator.default {
|
|
24
16
|
required: false
|
25
17
|
});
|
26
18
|
}
|
27
|
-
|
28
19
|
get prompting() {
|
29
20
|
return {
|
30
21
|
welcome() {
|
31
22
|
if (this.options.quiet) {
|
32
23
|
return;
|
33
24
|
}
|
34
|
-
|
35
25
|
console.log(_chalk.default.yellow('\n----------------------'));
|
36
26
|
console.log('Laravel Panneau Generator');
|
37
27
|
console.log(_chalk.default.yellow('----------------------\n'));
|
38
28
|
},
|
39
|
-
|
40
29
|
prompts() {
|
41
30
|
const prompts = [];
|
42
|
-
|
43
31
|
if (!this.options['project-name']) {
|
44
32
|
prompts.push(_generator.default.prompts.project_name);
|
45
33
|
}
|
46
|
-
|
47
34
|
if (!prompts.length) {
|
48
35
|
return null;
|
49
36
|
}
|
50
|
-
|
51
37
|
return this.prompt(prompts).then(answers => {
|
52
38
|
if (answers['project-name']) {
|
53
39
|
this.options['project-name'] = answers['project-name'];
|
54
40
|
}
|
55
41
|
});
|
56
42
|
}
|
57
|
-
|
58
43
|
};
|
59
44
|
}
|
60
|
-
|
61
45
|
get writing() {
|
62
46
|
return {
|
63
47
|
composerJSON() {
|
@@ -67,7 +51,6 @@ module.exports = class LaravelPanneauGenerator extends _generator.default {
|
|
67
51
|
}
|
68
52
|
});
|
69
53
|
},
|
70
|
-
|
71
54
|
packageJSON() {
|
72
55
|
this.addDependencies({
|
73
56
|
'@panneau/app': '^2.0.0',
|
@@ -77,72 +60,55 @@ module.exports = class LaravelPanneauGenerator extends _generator.default {
|
|
77
60
|
'@panneau/field-localized': '^2.0.0'
|
78
61
|
});
|
79
62
|
},
|
80
|
-
|
81
63
|
config() {
|
82
64
|
const source = this.templatePath('config.php');
|
83
65
|
const destination = this.destinationPath('config/panneau.php');
|
84
|
-
|
85
66
|
if (this.fs.exists(destination)) {
|
86
67
|
this.fs.delete(destination);
|
87
68
|
}
|
88
|
-
|
89
69
|
this.fs.copyTpl(source, destination, {});
|
90
70
|
},
|
91
|
-
|
92
71
|
routes() {
|
93
72
|
const source = this.templatePath('routes.php');
|
94
73
|
const destination = this.destinationPath('routes/panneau.php');
|
95
|
-
|
96
74
|
if (this.fs.exists(destination)) {
|
97
75
|
this.fs.delete(destination);
|
98
76
|
}
|
99
|
-
|
100
77
|
this.fs.copyTpl(source, destination, {});
|
101
78
|
},
|
102
|
-
|
103
79
|
layout() {
|
104
80
|
const source = this.templatePath('layout.blade.php');
|
105
81
|
const destination = this.destinationPath('resources/views/vendor/panneau/layout.blade.php');
|
106
|
-
|
107
82
|
if (this.fs.exists(destination)) {
|
108
83
|
this.fs.delete(destination);
|
109
84
|
}
|
110
|
-
|
111
85
|
this.fs.copyTpl(source, destination, {});
|
112
86
|
},
|
113
|
-
|
114
87
|
app() {
|
115
88
|
const source = this.templatePath('app.blade.php');
|
116
89
|
const destination = this.destinationPath('resources/views/vendor/panneau/app.blade.php');
|
117
|
-
|
118
90
|
if (this.fs.exists(destination)) {
|
119
91
|
this.fs.delete(destination);
|
120
92
|
}
|
121
|
-
|
122
93
|
this.fs.copyTpl(source, destination, {});
|
123
94
|
},
|
124
|
-
|
125
95
|
indexJs() {
|
126
96
|
const source = this.templatePath('index.js');
|
127
97
|
const destination = this.destinationPath('resources/assets/js/index.js');
|
128
98
|
this.fs.copyTpl(source, destination, {});
|
129
99
|
},
|
130
|
-
|
131
100
|
files() {
|
132
101
|
const folders = ['app', 'resources', 'lang'];
|
133
102
|
folders.forEach(folder => {
|
134
103
|
const templatePath = this.templatePath(folder);
|
135
104
|
const destinationPath = this.destinationPath(folder);
|
136
|
-
|
137
105
|
_glob.default.sync('**', {
|
138
106
|
dot: true,
|
139
107
|
nodir: true,
|
140
108
|
cwd: templatePath
|
141
109
|
}).forEach(file => {
|
142
110
|
const source = _path.default.join(templatePath, file);
|
143
|
-
|
144
111
|
const destination = _path.default.join(destinationPath, file);
|
145
|
-
|
146
112
|
if (file.match(/\.(jpg|jpeg|gif|png)$/i)) {
|
147
113
|
this.fs.copy(source, destination);
|
148
114
|
} else {
|
@@ -153,66 +119,51 @@ module.exports = class LaravelPanneauGenerator extends _generator.default {
|
|
153
119
|
});
|
154
120
|
});
|
155
121
|
}
|
156
|
-
|
157
122
|
};
|
158
123
|
}
|
159
|
-
|
160
124
|
get install() {
|
161
125
|
return {
|
162
126
|
async npm() {
|
163
127
|
if (this.options['skip-install']) {
|
164
128
|
return;
|
165
129
|
}
|
166
|
-
|
167
130
|
await this.spawnCommand('npm', ['install']);
|
168
131
|
},
|
169
|
-
|
170
132
|
async composer() {
|
171
133
|
if (this.options['skip-install']) {
|
172
134
|
return;
|
173
135
|
}
|
174
|
-
|
175
136
|
await this.spawnCommand('composer', ['install']);
|
176
137
|
},
|
177
|
-
|
178
138
|
async vendorPublish() {
|
179
139
|
if (this.options['skip-install']) {
|
180
140
|
return;
|
181
141
|
}
|
182
|
-
|
183
142
|
await this.spawnCommand('php', ['artisan', 'vendor:publish', '--provider=Panneau\\ServiceProvider']);
|
184
143
|
}
|
185
|
-
|
186
144
|
};
|
187
145
|
}
|
188
|
-
|
189
146
|
end() {
|
190
147
|
if (this.options.quiet) {
|
191
148
|
return;
|
192
149
|
}
|
193
|
-
|
194
150
|
console.log('\n\n');
|
195
151
|
console.log(_chalk.default.yellow('\n----------------------'));
|
196
152
|
console.log(_chalk.default.bold('Instructions'));
|
197
153
|
console.log(_chalk.default.yellow('----------------------\n\n'));
|
198
154
|
console.log(`1. Add to ${_chalk.default.bold.yellow('app/Providers/AppServiceProvider.php')}:`);
|
199
|
-
|
200
155
|
const serviceProvider = _fs.default.readFileSync(_path.default.join(__dirname, './instructions/ServiceProvider.php'));
|
201
|
-
|
202
156
|
console.log('---');
|
203
157
|
console.log((0, _cliHighlight.highlight)(serviceProvider.toString('utf-8'), {
|
204
158
|
language: 'php',
|
205
159
|
ignoreIllegals: true
|
206
160
|
}));
|
207
161
|
console.log(`\n2. Add to ${_chalk.default.bold.yellow('config/app.php')}:`);
|
208
|
-
|
209
162
|
const config = _fs.default.readFileSync(_path.default.join(__dirname, './instructions/config.php'));
|
210
|
-
|
211
163
|
console.log('---');
|
212
164
|
console.log((0, _cliHighlight.highlight)(config.toString('utf-8'), {
|
213
165
|
language: 'php',
|
214
166
|
ignoreIllegals: true
|
215
167
|
}));
|
216
168
|
}
|
217
|
-
|
218
169
|
};
|