generator-folklore 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. package/lib/generators/app/index.js +3 -51
  2. package/lib/generators/babel/index.js +28 -101
  3. package/lib/generators/babel/templates/config.js +16 -0
  4. package/lib/generators/browserslist/index.js +4 -9
  5. package/lib/generators/build/index.js +40 -29
  6. package/lib/generators/cli/index.js +92 -0
  7. package/lib/generators/cli/templates/cli.js +22 -0
  8. package/lib/generators/cli/templates/commands/default.js +16 -0
  9. package/lib/generators/docs/index.js +1 -2
  10. package/lib/generators/editorconfig/index.js +12 -22
  11. package/lib/generators/eslint/index.js +12 -13
  12. package/lib/generators/{html → html-project}/index.js +60 -73
  13. package/lib/generators/{html → html-project}/templates/folklore.png +0 -0
  14. package/lib/generators/{html → html-project}/templates/gitignore +0 -0
  15. package/lib/generators/{html → html-project}/templates/index.html.ejs +4 -1
  16. package/lib/generators/laravel/index.js +5 -5
  17. package/lib/generators/lerna-package/index.js +1 -3
  18. package/lib/generators/lerna-repository/index.js +1 -3
  19. package/lib/generators/node-project/index.js +164 -0
  20. package/lib/generators/{js/templates/src/lib/.gitkeep → node-project/templates/index.js} +0 -0
  21. package/lib/generators/npm-package/index.js +3 -5
  22. package/lib/generators/prettier/index.js +19 -6
  23. package/lib/generators/prettier/templates/prettierrc.json +3 -1
  24. package/lib/generators/{js → react-app}/index.js +22 -52
  25. package/lib/generators/{js → react-app}/templates/_package.json +0 -0
  26. package/lib/generators/react-app/templates/index.js +22 -0
  27. package/lib/generators/react-app/templates/src/components/App.jsx +42 -0
  28. package/lib/generators/react-app/templates/src/components/Routes.jsx +43 -0
  29. package/lib/generators/{js → react-app}/templates/src/components/buttons/Button.jsx +4 -18
  30. package/lib/generators/react-app/templates/src/components/layouts/Main.jsx +27 -0
  31. package/lib/generators/react-app/templates/src/components/menus/Menu.jsx +62 -0
  32. package/lib/generators/{js → react-app}/templates/src/components/pages/Error.jsx +8 -12
  33. package/lib/generators/react-app/templates/src/components/pages/Home.jsx +32 -0
  34. package/lib/generators/{js → react-app}/templates/src/components/partials/PageMeta.jsx +11 -11
  35. package/lib/generators/{js → react-app}/templates/src/contexts/KeysContext.jsx +0 -0
  36. package/lib/generators/{js/templates/styles → react-app/templates/src/lib}/.gitkeep +0 -0
  37. package/lib/generators/{js → react-app}/templates/src/lib/PropTypes.js +0 -0
  38. package/lib/generators/{js → react-app}/templates/src/lib/utils.js +0 -0
  39. package/lib/generators/react-app/templates/src/polyfills/index.js +6 -0
  40. package/lib/generators/react-app/templates/src/polyfills/intl-en.js +2 -0
  41. package/lib/generators/react-app/templates/src/polyfills/intl-fr.js +2 -0
  42. package/lib/generators/react-app/templates/src/polyfills/should.js +14 -0
  43. package/lib/generators/react-app/templates/styles/.gitkeep +0 -0
  44. package/lib/generators/{js/templates/styles/buttons/button.scss → react-app/templates/styles/buttons/button.module.scss} +1 -0
  45. package/lib/generators/{js/templates/styles/layouts/main.scss → react-app/templates/styles/layouts/main.module.scss} +0 -0
  46. package/lib/generators/{js/templates/styles/menus/menu.scss → react-app/templates/styles/menus/menu.module.scss} +0 -0
  47. package/lib/generators/{js/templates/styles/pages/error.scss → react-app/templates/styles/pages/error.module.scss} +0 -0
  48. package/lib/generators/{js/templates/styles/pages/home.scss → react-app/templates/styles/pages/home.module.scss} +0 -0
  49. package/lib/generators/rollup/index.js +54 -0
  50. package/lib/generators/rollup/templates/config.js +47 -0
  51. package/lib/generators/scss/index.js +3 -16
  52. package/lib/generators/scss/templates/{main.scss → styles.scss} +0 -0
  53. package/lib/generators/server/index.js +81 -0
  54. package/lib/generators/server/templates/server.js +59 -0
  55. package/lib/generators/storybook/index.js +1 -7
  56. package/lib/generators/stylelint/index.js +13 -14
  57. package/lib/lib/utils.js +17 -0
  58. package/package.json +2 -2
  59. package/lib/generators/babel/templates/babel-preset-react.js +0 -7
  60. package/lib/generators/babel/templates/babel-preset.js +0 -57
  61. package/lib/generators/babel/templates/babelrc +0 -5
  62. package/lib/generators/babel/templates/utils/processScss.js +0 -10
  63. package/lib/generators/babel/templates/utils/transformRequireIgnore.js +0 -80
  64. package/lib/generators/html/templates/index.js +0 -9
  65. package/lib/generators/html/templates/root.js +0 -23
  66. package/lib/generators/html/templates/utils.js +0 -7
  67. package/lib/generators/js/templates/browserslistrc +0 -9
  68. package/lib/generators/js/templates/config.js +0 -33
  69. package/lib/generators/js/templates/index.js +0 -41
  70. package/lib/generators/js/templates/src/actions/LayoutActions.js +0 -12
  71. package/lib/generators/js/templates/src/actions/SiteActions.js +0 -22
  72. package/lib/generators/js/templates/src/components/App.jsx +0 -52
  73. package/lib/generators/js/templates/src/components/Root.jsx +0 -70
  74. package/lib/generators/js/templates/src/components/layouts/Main.jsx +0 -52
  75. package/lib/generators/js/templates/src/components/menus/Menu.jsx +0 -60
  76. package/lib/generators/js/templates/src/components/messages/Success.jsx +0 -36
  77. package/lib/generators/js/templates/src/components/pages/Home.jsx +0 -32
  78. package/lib/generators/js/templates/src/components/partials/Label.jsx +0 -32
  79. package/lib/generators/js/templates/src/reducers/LayoutReducer.js +0 -32
  80. package/lib/generators/js/templates/src/reducers/SiteReducer.js +0 -36
  81. package/lib/generators/js/templates/src/reducers/index.js +0 -7
  82. package/lib/generators/js/templates/src/vendor/polyfills/intl-en.js +0 -2
  83. package/lib/generators/js/templates/src/vendor/polyfills/intl-fr.js +0 -2
@@ -52,58 +52,10 @@ module.exports = class AppGenerator extends _generator.default {
52
52
  message: 'What type of project?',
53
53
  choices: [{
54
54
  name: 'HTML',
55
- value: 'html'
55
+ value: 'html-project'
56
56
  }, {
57
- name: 'Laravel',
58
- value: 'laravel'
59
- }, {
60
- name: 'Javascript',
61
- value: 'js'
62
- }, {
63
- name: 'SCSS',
64
- value: 'scss'
65
- }, {
66
- name: 'NPM Package',
67
- value: 'npm-package'
68
- }, {
69
- name: 'React Package',
70
- value: 'react-package'
71
- }, {
72
- name: 'Laravel Package',
73
- value: 'laravel-package'
74
- }, {
75
- name: 'Lerna repository',
76
- value: 'lerna-repository'
77
- }, {
78
- name: 'Lerna package',
79
- value: 'lerna-package'
80
- }, {
81
- name: 'Build tools',
82
- value: 'build'
83
- }, {
84
- name: 'Babel',
85
- value: 'babel'
86
- }, {
87
- name: 'Eslint',
88
- value: 'eslint'
89
- }, {
90
- name: 'Stylelint',
91
- value: 'stylelint'
92
- }, {
93
- name: 'SASS Lint',
94
- value: 'sass-lint'
95
- }, {
96
- name: 'Test',
97
- value: 'test'
98
- }, {
99
- name: 'Storybook',
100
- value: 'storybook'
101
- }, {
102
- name: 'Editorconfig',
103
- value: 'editorconfig'
104
- }, {
105
- name: 'Documentation',
106
- value: 'docs'
57
+ name: 'Node',
58
+ value: 'node-project'
107
59
  }]
108
60
  });
109
61
  }
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _path = _interopRequireDefault(require("path"));
4
-
5
3
  var _chalk = _interopRequireDefault(require("chalk"));
6
4
 
5
+ var _path = _interopRequireDefault(require("path"));
6
+
7
7
  var _generator = _interopRequireDefault(require("../../lib/generator"));
8
8
 
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -11,12 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
  module.exports = class BabelGenerator extends _generator.default {
12
12
  constructor(...args) {
13
13
  super(...args);
14
- this.option('build-path', {
15
- type: String,
16
- required: false,
17
- defaults: './build'
18
- });
19
- this.option('react-app', {
14
+ this.option('react', {
20
15
  type: Boolean,
21
16
  required: false,
22
17
  defaults: false
@@ -26,121 +21,53 @@ module.exports = class BabelGenerator extends _generator.default {
26
21
  required: false,
27
22
  defaults: false
28
23
  });
29
- this.option('compile', {
30
- type: Boolean,
31
- required: false,
32
- defaults: false
33
- });
34
24
  this.option('react-intl', {
35
25
  type: Boolean,
36
26
  required: false,
37
27
  defaults: false
38
28
  });
39
-
40
- this.buildPath = filePath => this.destinationPath(_path.default.join(this.options['build-path'], filePath));
41
29
  }
42
30
 
43
- get prompting() {
44
- return {
45
- welcome() {
46
- if (this.options.quiet) {
47
- return;
48
- }
49
-
50
- console.log(_chalk.default.yellow('\n----------------------'));
51
- console.log('Babel Generator');
52
- console.log(_chalk.default.yellow('----------------------\n'));
53
- }
31
+ prompting() {
32
+ if (this.options.quiet) {
33
+ return;
34
+ }
54
35
 
55
- };
36
+ console.log(_chalk.default.yellow('\n----------------------'));
37
+ console.log('Babel Generator');
38
+ console.log(_chalk.default.yellow('----------------------\n'));
56
39
  }
57
40
 
58
41
  get writing() {
59
42
  return {
60
- babelrc() {
61
- const presetPath = this.destinationPath(_path.default.join(this.options['build-path'], 'babel-preset.js'));
62
- const projectPath = this.destinationPath();
63
- const srcPath = this.templatePath('babelrc');
64
- const destPath = this.destinationPath('.babelrc');
43
+ config() {
44
+ const {
45
+ react,
46
+ 'transform-runtime': transformRuntime,
47
+ 'react-intl': reactIntl
48
+ } = this.options;
49
+ const srcPath = this.templatePath('config');
50
+ const destPath = this.destinationPath('babel.config.js');
65
51
  this.fs.copyTpl(srcPath, destPath, {
66
- presetPath: `./${_path.default.relative(projectPath, presetPath)}`
52
+ react,
53
+ transformRuntime,
54
+ reactIntl
67
55
  });
68
56
  },
69
57
 
70
- preset() {
71
- const srcPath = this.templatePath(this.options['react-app'] ? 'babel-preset-react.js' : 'babel-preset.js');
72
- const destPath = this.buildPath('babel-preset.js');
73
- this.fs.copyTpl(srcPath, destPath, {
74
- hasTransformRuntime: this.options['transform-runtime'],
75
- hasReactIntl: this.options['react-intl'],
76
- hasCompile: this.options.compile
77
- });
78
- },
79
-
80
- utils() {
81
- if (!this.options.compile) {
82
- return;
83
- }
84
-
85
- const srcPath = this.templatePath('utils');
86
- const destPath = this.buildPath('utils');
87
- this.fs.copyTpl(srcPath, destPath, {});
88
- },
89
-
90
- getLocalIdent() {
91
- if (!this.options.compile) {
92
- return;
93
- }
94
-
95
- const destPath = this.buildPath('utils/getLocalIdent.js');
96
-
97
- if (this.fs.exists(destPath)) {
98
- return;
99
- }
100
-
101
- const srcPath = _path.default.join(this.templatePath(), '../../build/templates/utils/getLocalIdent.js');
102
-
103
- this.fs.copy(srcPath, destPath);
58
+ dependencies() {
59
+ this.addDevDependencies(['@babel/cli', '@babel/core', '@babel/node', '@babel/plugin-transform-runtime', '@babel/preset-env', '@babel/preset-react']);
104
60
  }
105
61
 
106
62
  };
107
63
  }
108
64
 
109
- get install() {
110
- return {
111
- npm() {
112
- if (this.options['skip-install']) {
113
- return;
114
- }
65
+ async install() {
66
+ if (this.options['skip-install']) {
67
+ return;
68
+ }
115
69
 
116
- const dependencies = [];
117
- const devDependencies = this.options['react-app'] ? ['@babel/cli@latest', '@babel/core@latest', '@babel/polyfill@latest', '@babel/register@latest', 'babel-preset-react-app@latest'] : ['@babel/cli@latest', '@babel/core@latest', '@babel/polyfill@latest', '@babel/register@latest', 'babel-plugin-dynamic-import-node@latest', '@babel/plugin-syntax-dynamic-import@latest', '@babel/plugin-proposal-object-rest-spread@latest', 'babel-plugin-css-modules-transform@latest', '@babel/preset-env@latest', '@babel/preset-react@latest'];
118
-
119
- if (this.options['transform-runtime']) {
120
- dependencies.push('@babel/runtime@latest');
121
- devDependencies.push('@babel/plugin-transform-runtime@latest');
122
- }
123
-
124
- if (this.options['react-intl']) {
125
- devDependencies.push('babel-plugin-react-intl@latest');
126
- }
127
-
128
- if (this.options.compile) {
129
- devDependencies.push('node-sass@latest');
130
- }
131
-
132
- if (dependencies.length > 0) {
133
- this.addDependencies(dependencies, {
134
- save: true
135
- });
136
- }
137
-
138
- if (devDependencies.length > 0) {
139
- this.addDevDependencies(devDependencies);
140
- }
141
- }
142
-
143
- };
70
+ await this.spawnCommand('npm', ['install']);
144
71
  }
145
72
 
146
73
  };
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ presets: [
3
+ [
4
+ require.resolve('@babel/preset-env'),
5
+ {
6
+ useBuiltIns: false
7
+ },
8
+ ],
9
+ ],
10
+
11
+ plugins: [
12
+ <% if (transformRuntime) { %>
13
+ [require.resolve('@babel/plugin-transform-runtime'), {}],
14
+ <% } %>
15
+ ],
16
+ };
@@ -22,15 +22,10 @@ module.exports = class BrowsersListGenerator extends _generator.default {
22
22
  };
23
23
  }
24
24
 
25
- get writing() {
26
- return {
27
- editorconfig() {
28
- const srcPath = this.templatePath('browserslistrc');
29
- const destPath = this.destinationPath('.browserslistrc');
30
- this.fs.copy(srcPath, destPath);
31
- }
32
-
33
- };
25
+ writing() {
26
+ const srcPath = this.templatePath('browserslistrc');
27
+ const destPath = this.destinationPath('.browserslistrc');
28
+ this.fs.copy(srcPath, destPath);
34
29
  }
35
30
 
36
31
  };
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
 
3
- var _path = _interopRequireDefault(require("path"));
4
-
5
3
  var _chalk = _interopRequireDefault(require("chalk"));
6
4
 
7
5
  var _isArray = _interopRequireDefault(require("lodash/isArray"));
8
6
 
7
+ var _path = _interopRequireDefault(require("path"));
8
+
9
9
  var _generator = _interopRequireDefault(require("../../lib/generator"));
10
10
 
11
+ var _utils = require("../../lib/utils");
12
+
11
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
14
 
13
15
  module.exports = class AppGenerator extends _generator.default {
@@ -44,7 +46,7 @@ module.exports = class AppGenerator extends _generator.default {
44
46
  defaults: true
45
47
  });
46
48
 
47
- this.scriptsPath = filePath => this.destinationPath(_path.default.join(this.options.scriptsPath, filePath));
49
+ this.ensureLeadingDotSlash = filePath => !_path.default.isAbsolute(filePath) && filePath.match(/^\./) === null ? `./${filePath}` : filePath;
48
50
  }
49
51
 
50
52
  prompting() {
@@ -57,34 +59,43 @@ module.exports = class AppGenerator extends _generator.default {
57
59
  console.log(_chalk.default.yellow('----------------------\n'));
58
60
  }
59
61
 
60
- writing() {
61
- const {
62
- 'entry-path': entryPath,
63
- 'src-path': srcPath,
64
- 'build-path': buildPath,
65
- 'public-path': publicPath,
66
- 'html-path': htmlPath,
67
- server
68
- } = this.options;
69
- const scripts = {
70
- build: `flklr build --load-env ${entryPath}`
71
- };
62
+ get writing() {
63
+ return {
64
+ packageJSON() {
65
+ const {
66
+ 'entry-path': entryPath,
67
+ 'src-path': srcPath,
68
+ 'build-path': buildPath,
69
+ 'public-path': publicPath,
70
+ 'html-path': htmlPath,
71
+ server
72
+ } = this.options;
73
+ const scripts = {
74
+ build: `flklr build --load-env ${(0, _utils.ensureLeadingDotSlash)(entryPath)}`
75
+ };
72
76
 
73
- if (server) {
74
- scripts.server = `flklr serve --load-env ${entryPath}`;
75
- scripts.start = 'npm run server';
76
- }
77
+ if (server) {
78
+ scripts.server = `flklr serve --load-env ${(0, _utils.ensureLeadingDotSlash)(entryPath)}`;
79
+ scripts.start = 'npm run server';
80
+ }
81
+
82
+ this.packageJson.merge({
83
+ scripts,
84
+ build: {
85
+ outputPath: (0, _utils.ensureLeadingDotSlash)(buildPath),
86
+ srcPath: (0, _utils.ensureLeadingDotSlash)(srcPath),
87
+ htmlPath: (0, _utils.ensureLeadingDotSlash)(htmlPath),
88
+ publicPath: (0, _utils.ensureLeadingDotSlash)(publicPath),
89
+ disableImageOptimization: true
90
+ }
91
+ });
92
+ },
77
93
 
78
- this.packageJson.merge({
79
- scripts,
80
- build: {
81
- outputPath: buildPath,
82
- srcPath,
83
- htmlPath,
84
- publicPath,
85
- disableImageOptimization: true
94
+ dependencies() {
95
+ this.addDevDependencies(['@folklore/cli']);
86
96
  }
87
- });
97
+
98
+ };
88
99
  }
89
100
 
90
101
  async install() {
@@ -92,7 +103,7 @@ module.exports = class AppGenerator extends _generator.default {
92
103
  return;
93
104
  }
94
105
 
95
- await this.addDevDependencies(['@folklore/cli']);
106
+ await this.spawnCommand('npm', ['install']);
96
107
  }
97
108
 
98
109
  };
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ var _chalk = _interopRequireDefault(require("chalk"));
4
+
5
+ var _lodash = _interopRequireDefault(require("lodash"));
6
+
7
+ var _path = _interopRequireDefault(require("path"));
8
+
9
+ var _generator = _interopRequireDefault(require("../../lib/generator"));
10
+
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+
13
+ module.exports = class CliGenerator extends _generator.default {
14
+ // The name `constructor` is important here
15
+ constructor(...args) {
16
+ super(...args);
17
+ this.option('path', {
18
+ type: String,
19
+ defaults: 'src'
20
+ });
21
+ this.option('filename', {
22
+ type: String,
23
+ defaults: 'cli.js'
24
+ });
25
+ this.option('commands', {
26
+ type: Boolean,
27
+ defaults: false
28
+ });
29
+ this.option('commands-path', {
30
+ type: String,
31
+ defaults: './commands'
32
+ });
33
+ }
34
+
35
+ get prompting() {
36
+ return {
37
+ welcome() {
38
+ if (this.options.quiet) {
39
+ return;
40
+ }
41
+
42
+ console.log(_chalk.default.yellow('\n----------------------'));
43
+ console.log('CLI Generator');
44
+ console.log(_chalk.default.yellow('----------------------\n'));
45
+ }
46
+
47
+ };
48
+ }
49
+
50
+ get writing() {
51
+ return {
52
+ index() {
53
+ const {
54
+ filename,
55
+ path: cliPath,
56
+ commands
57
+ } = this.options;
58
+ this.fs.copyTpl(this.templatePath('cli.js'), this.destinationPath(_path.default.join(cliPath, filename)), {
59
+ commands
60
+ });
61
+ },
62
+
63
+ commands() {
64
+ if (!this.options.commands) {
65
+ return;
66
+ }
67
+
68
+ const templateData = {};
69
+
70
+ const commandsPath = this.options['commands-path'] || _path.default.join(this.options.path, 'commands');
71
+
72
+ const srcPath = this.templatePath('commands');
73
+ const destPath = this.destinationPath(commandsPath);
74
+ this.fs.copyTpl(srcPath, destPath, templateData);
75
+ },
76
+
77
+ dependencies() {
78
+ this.addDependencies(['commander', 'debug']);
79
+ }
80
+
81
+ };
82
+ }
83
+
84
+ async install() {
85
+ if (this.options['skip-install']) {
86
+ return;
87
+ }
88
+
89
+ await this.spawnCommand('npm', ['install']);
90
+ }
91
+
92
+ };
@@ -0,0 +1,22 @@
1
+ import { program } from 'commander';<% if (commands) { %>
2
+
3
+ import defaultCommand from './commands/default';
4
+
5
+ program
6
+ .description('Description')
7
+ .addCommand(defaultCommand, {
8
+ isDefault: true,
9
+ });<% } else { %>
10
+
11
+ program
12
+ .description('Description')
13
+ .option('-t, --test', 'Test option', 'test')
14
+
15
+ <% } %>
16
+
17
+ program.parse();<% if(!commands) { %>
18
+
19
+ const { test } = program.opts();
20
+
21
+ console.log(test);
22
+ <% } %>
@@ -0,0 +1,16 @@
1
+ import { Command } from 'commander';
2
+
3
+ const command = new Command('default');
4
+
5
+ command
6
+ .description('Description of default command')
7
+ .argument('<arg>', 'Argument 1')
8
+ .option('-t, --test', 'Test option', 'test')
9
+ .action(async (arg) => {
10
+ const { test } = program.opts();
11
+ console.log('This is default command');
12
+ console.log(`Argument: ${arg}`);
13
+ console.log(`Option: ${test}`);
14
+ });
15
+
16
+ export default command;
@@ -126,10 +126,9 @@ module.exports = class DocsGenerator extends _generator.default {
126
126
  'docs:serve': 'npm run docs:prepare && npm run docs:api && gitbook serve',
127
127
  'build:docs': 'npm run docs:prepare && npm run docs:api'
128
128
  };
129
- const destPath = this.destinationPath('package.json');
130
129
  const packageJSON = this.fs.exists(destPath) ? this.fs.readJSON(destPath) : {};
131
130
  packageJSON.scripts = _objectSpread(_objectSpread({}, packageJSON.scripts), scripts);
132
- this.fs.writeJSON(destPath, packageJSON);
131
+ this.packageJson.merge(packageJSON);
133
132
  }
134
133
 
135
134
  };
@@ -7,30 +7,20 @@ var _generator = _interopRequireDefault(require("../../lib/generator"));
7
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
8
 
9
9
  module.exports = class EditorConfigGenerator extends _generator.default {
10
- get prompting() {
11
- return {
12
- welcome() {
13
- if (this.options.quiet) {
14
- return;
15
- }
16
-
17
- console.log(_chalk.default.yellow('\n----------------------'));
18
- console.log('Editor Config Generator');
19
- console.log(_chalk.default.yellow('----------------------\n'));
20
- }
21
-
22
- };
10
+ prompting() {
11
+ if (this.options.quiet) {
12
+ return;
13
+ }
14
+
15
+ console.log(_chalk.default.yellow('\n----------------------'));
16
+ console.log('Editor Config Generator');
17
+ console.log(_chalk.default.yellow('----------------------\n'));
23
18
  }
24
19
 
25
- get writing() {
26
- return {
27
- editorconfig() {
28
- const srcPath = this.templatePath('editorconfig');
29
- const destPath = this.destinationPath('.editorconfig');
30
- this.fs.copy(srcPath, destPath);
31
- }
32
-
33
- };
20
+ writing() {
21
+ const srcPath = this.templatePath('editorconfig');
22
+ const destPath = this.destinationPath('.editorconfig');
23
+ this.fs.copy(srcPath, destPath);
34
24
  }
35
25
 
36
26
  };
@@ -7,19 +7,14 @@ var _generator = _interopRequireDefault(require("../../lib/generator"));
7
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
8
 
9
9
  module.exports = class EslintGenerator extends _generator.default {
10
- get prompting() {
11
- return {
12
- welcome() {
13
- if (this.options.quiet) {
14
- return;
15
- }
16
-
17
- console.log(_chalk.default.yellow('\n----------------------'));
18
- console.log('Eslint Generator');
19
- console.log(_chalk.default.yellow('----------------------\n'));
20
- }
10
+ prompting() {
11
+ if (this.options.quiet) {
12
+ return;
13
+ }
21
14
 
22
- };
15
+ console.log(_chalk.default.yellow('\n----------------------'));
16
+ console.log('Eslint Generator');
17
+ console.log(_chalk.default.yellow('----------------------\n'));
23
18
  }
24
19
 
25
20
  get writing() {
@@ -34,6 +29,10 @@ module.exports = class EslintGenerator extends _generator.default {
34
29
  const srcPath = this.templatePath('eslintignore');
35
30
  const destPath = this.destinationPath('.eslintignore');
36
31
  this.fs.copy(srcPath, destPath);
32
+ },
33
+
34
+ dependencies() {
35
+ this.addDevDependencies(['babel-preset-airbnb', '@babel/eslint-parser', 'eslint', 'eslint-config-airbnb', 'eslint-config-prettier', 'eslint-plugin-prettier', 'eslint-plugin-import', 'eslint-plugin-jsx-a11y', 'eslint-plugin-react', 'eslint-plugin-formatjs']);
37
36
  }
38
37
 
39
38
  };
@@ -44,7 +43,7 @@ module.exports = class EslintGenerator extends _generator.default {
44
43
  return;
45
44
  }
46
45
 
47
- await this.addDevDependencies(['babel-preset-airbnb', '@babel/eslint-parser', 'eslint', 'eslint-config-airbnb', 'eslint-config-prettier', 'eslint-plugin-prettier', 'eslint-plugin-import', 'eslint-plugin-jsx-a11y', 'eslint-plugin-react', 'eslint-plugin-formatjs']);
46
+ await this.spawnCommand('npm', ['install']);
48
47
  }
49
48
 
50
49
  };