generator-folklore 3.0.16 → 3.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. package/lib/generators/app/index.js +5 -20
  2. package/lib/generators/babel/index.js +0 -12
  3. package/lib/generators/browserslist/index.js +0 -7
  4. package/lib/generators/build/index.js +0 -17
  5. package/lib/generators/cli/index.js +0 -18
  6. package/lib/generators/docs/index.js +5 -34
  7. package/lib/generators/editorconfig/index.js +0 -6
  8. package/lib/generators/eslint/index.js +0 -11
  9. package/lib/generators/html-project/index.js +0 -30
  10. package/lib/generators/intl/index.js +0 -13
  11. package/lib/generators/laravel/index.js +5 -77
  12. package/lib/generators/laravel-auth/index.js +0 -25
  13. package/lib/generators/laravel-mediatheque/index.js +0 -28
  14. package/lib/generators/laravel-package/index.js +0 -33
  15. package/lib/generators/laravel-panneau/index.js +0 -49
  16. package/lib/generators/laravel-project/index.js +11 -78
  17. package/lib/generators/lerna-package/index.js +0 -36
  18. package/lib/generators/lerna-repository/index.js +0 -34
  19. package/lib/generators/node-project/index.js +0 -28
  20. package/lib/generators/npm-package/index.js +0 -36
  21. package/lib/generators/prettier/index.js +0 -11
  22. package/lib/generators/react-app/index.js +5 -30
  23. package/lib/generators/react-app/templates/index.js +3 -3
  24. package/lib/generators/react-app/templates/src/components/App.jsx +28 -32
  25. package/lib/generators/react-app/templates/src/components/Routes.jsx +46 -0
  26. package/lib/generators/react-app/templates/src/components/buttons/Button.jsx +3 -0
  27. package/lib/generators/react-app/templates/src/components/layouts/Main.jsx +1 -3
  28. package/lib/generators/react-app/templates/src/components/menus/Menu.jsx +2 -3
  29. package/lib/generators/react-package/index.js +0 -33
  30. package/lib/generators/rollup/index.js +0 -13
  31. package/lib/generators/sass-lint/index.js +0 -9
  32. package/lib/generators/scss/index.js +0 -16
  33. package/lib/generators/server/index.js +0 -15
  34. package/lib/generators/storybook/index.js +0 -16
  35. package/lib/generators/stylelint/index.js +0 -11
  36. package/lib/generators/stylelint/templates/stylelintrc +2 -1
  37. package/lib/generators/test/index.js +0 -16
  38. package/lib/lib/generator.js +4 -24
  39. package/lib/lib/mysql.js +0 -10
  40. package/lib/lib/utils.js +0 -4
  41. package/package.json +2 -2
  42. package/lib/generators/react-app/templates/src/components/Container.jsx +0 -42
@@ -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
  };
@@ -13,6 +13,7 @@
13
13
  "message": "Selector should be written in camel-case (selector-class-pattern)"
14
14
  }
15
15
  ],<% } %>
16
- "max-nesting-depth": 4
16
+ "max-nesting-depth": 4,
17
+ "import-notation": ["string", "url"]
17
18
  }
18
19
  }
@@ -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 TestGenerator extends _generator.default {
10
7
  constructor(...args) {
11
8
  super(...args);
@@ -15,22 +12,18 @@ module.exports = class TestGenerator extends _generator.default {
15
12
  defaults: 'jest'
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('Test 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
  directories() {
@@ -40,33 +33,26 @@ module.exports = class TestGenerator extends _generator.default {
40
33
  this.fs.copy(this.templatePath(`${type}/mocks`), this.destinationPath('__mocks__'));
41
34
  this.fs.copy(this.templatePath(`${type}/tests`), this.destinationPath('__tests__'));
42
35
  },
43
-
44
36
  jestConfig() {
45
37
  const {
46
38
  type
47
39
  } = this.options;
48
-
49
40
  if (type !== 'jest') {
50
41
  return;
51
42
  }
52
-
53
43
  const destPath = this.destinationPath('jest.config.js');
54
-
55
44
  if (!this.fs.exists(destPath)) {
56
45
  this.fs.copy(this.templatePath(`${type}/jest.config.js`), destPath);
57
46
  }
58
47
  }
59
-
60
48
  };
61
49
  }
62
-
63
50
  get install() {
64
51
  return {
65
52
  npm() {
66
53
  if (this.options['skip-install']) {
67
54
  return;
68
55
  }
69
-
70
56
  this.addDevDependencies({
71
57
  'babel-jest': 'latest',
72
58
  enzyme: 'latest',
@@ -78,8 +64,6 @@ module.exports = class TestGenerator extends _generator.default {
78
64
  sinon: 'latest'
79
65
  });
80
66
  }
81
-
82
67
  };
83
68
  }
84
-
85
69
  };
@@ -4,25 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _yeomanGenerator = _interopRequireDefault(require("yeoman-generator"));
9
-
10
8
  var _immutable = _interopRequireDefault(require("immutable"));
11
-
12
9
  var _path = _interopRequireDefault(require("path"));
13
-
14
10
  var _lodash = _interopRequireDefault(require("lodash"));
15
-
16
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
-
12
+ 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; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
+ 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); }
20
15
  class Generator extends _yeomanGenerator.default {
21
16
  static getConfigPath() {
22
17
  const home = process.env[process.platform === 'win32' ? 'USERPROFILE' : 'HOME'];
23
18
  return _path.default.join(home, '.config/yeoman-generator-folklore/config.json');
24
19
  }
25
-
26
20
  constructor(args, options) {
27
21
  super(args, options);
28
22
  this._composerJson = null;
@@ -31,45 +25,33 @@ class Generator extends _yeomanGenerator.default {
31
25
  defaults: false
32
26
  });
33
27
  }
34
-
35
28
  get composerJson() {
36
29
  if (!this._composerJson) {
37
30
  this._composerJson = this.createStorage('composer.json');
38
31
  }
39
-
40
32
  return this._composerJson;
41
33
  }
42
-
43
34
  getConfig() {
44
35
  const configPath = Generator.getConfigPath();
45
36
  return this.fs.exists(configPath) ? this.fs.readJSON(configPath) : {};
46
37
  }
47
-
48
38
  updateConfig(data, force) {
49
39
  const forceUpdate = force || false;
50
-
51
40
  const config = _immutable.default.fromJS(this.getConfig());
52
-
53
41
  let newConfig = Object.assign({}, config);
54
-
55
42
  _lodash.default.each(data, (value, key) => {
56
43
  if (forceUpdate || value && value.length && value !== _lodash.default.get(config, key)) {
57
44
  newConfig = newConfig.set(key, value);
58
45
  }
59
46
  });
60
-
61
47
  const newData = newConfig.toJS();
62
-
63
48
  if (config !== newConfig) {
64
49
  const configPath = Generator.getConfigPath();
65
50
  this.fs.writeJSON(configPath, newData);
66
51
  }
67
-
68
52
  return newData;
69
53
  }
70
-
71
54
  }
72
-
73
55
  _defineProperty(Generator, "prompts", {
74
56
  project_name: {
75
57
  type: 'input',
@@ -81,6 +63,4 @@ _defineProperty(Generator, "prompts", {
81
63
  }
82
64
  }
83
65
  });
84
-
85
- var _default = Generator;
86
- exports.default = _default;
66
+ var _default = exports.default = Generator;
package/lib/lib/mysql.js CHANGED
@@ -8,56 +8,46 @@ module.exports = connection => {
8
8
  if (err) {
9
9
  return reject(err);
10
10
  }
11
-
12
11
  return resolve(rows);
13
12
  });
14
13
  });
15
14
  },
16
-
17
15
  createUser(user, password) {
18
16
  return new Promise((resolve, reject) => {
19
17
  connection.query(`CREATE USER "${user}"@"localhost" IDENTIFIED BY "${password}"`, (err, rows) => {
20
18
  if (err) {
21
19
  return reject(err);
22
20
  }
23
-
24
21
  return resolve(rows);
25
22
  });
26
23
  });
27
24
  },
28
-
29
25
  createDatabaseUser(database, user, password) {
30
26
  return new Promise((resolve, reject) => {
31
27
  connection.query(`GRANT ALL ON \`${database}\`.* TO "${user}"@"localhost" IDENTIFIED BY "${password}"`, (err, rows) => {
32
28
  if (err) {
33
29
  return reject(err);
34
30
  }
35
-
36
31
  return resolve(rows);
37
32
  });
38
33
  });
39
34
  },
40
-
41
35
  grantPrivileges(user, database) {
42
36
  return new Promise((resolve, reject) => {
43
37
  let newDatabase = database;
44
-
45
38
  if (typeof database !== 'undefined' && database && database.length) {
46
39
  newDatabase += '.*';
47
40
  } else {
48
41
  newDatabase = '*.*';
49
42
  }
50
-
51
43
  connection.query(`GRANT ALL PRIVILEGES ON ${newDatabase} TO "${user}"@"localhost" WITH GRANT OPTION`, (err, rows) => {
52
44
  if (err) {
53
45
  return reject(err);
54
46
  }
55
-
56
47
  return resolve(rows);
57
48
  });
58
49
  });
59
50
  }
60
-
61
51
  };
62
52
  return Mysql;
63
53
  };
package/lib/lib/utils.js CHANGED
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ensureLeadingDotSlash = ensureLeadingDotSlash;
7
-
8
7
  var _lodash = require("lodash");
9
-
10
8
  var _path = _interopRequireDefault(require("path"));
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  function ensureLeadingDotSlash(filePath) {
15
11
  return (0, _lodash.isString)(filePath) && !_path.default.isAbsolute(filePath) && filePath.match(/^\./) === null ? `./${filePath}` : filePath;
16
12
  ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-folklore",
3
- "version": "3.0.16",
3
+ "version": "3.0.18",
4
4
  "description": "Yeoman generator for projects at Folklore",
5
5
  "keywords": [
6
6
  "yeoman-generator"
@@ -40,5 +40,5 @@
40
40
  "yeoman-generator": "^5.7.0",
41
41
  "yeoman-remote": "^1.0.1"
42
42
  },
43
- "gitHead": "6ec0b30e81fd5508831e2b6f7b7337fa9b69e208"
43
+ "gitHead": "ed6cc1e8b1892af42c074d566d6a4096a0bbd233"
44
44
  }
@@ -1,42 +0,0 @@
1
- import { RoutesProvider } from '@folklore/routes';
2
- import PropTypes from 'prop-types';
3
- import React from 'react';
4
- import { IntlProvider } from 'react-intl';
5
- import { BrowserRouter } from 'react-router-dom';
6
-
7
- // import * as AppPropTypes from '../lib/PropTypes';
8
- import App from './App';
9
-
10
- const propTypes = {
11
- intl: PropTypes.shape({
12
- locale: PropTypes.string,
13
- messages: PropTypes.oneOfType([
14
- PropTypes.objectOf(PropTypes.objectOf(PropTypes.string)),
15
- PropTypes.objectOf(PropTypes.string),
16
- ]),
17
- }),
18
- routes: PropTypes.objectOf(PropTypes.string),
19
- };
20
-
21
- const defaultProps = {
22
- intl: null,
23
- routes: {},
24
- };
25
-
26
- function Container({ intl, routes }) {
27
- const { locale = null, messages = null } = intl || {};
28
- return (
29
- <IntlProvider locale={locale} messages={messages[locale] || messages}>
30
- <BrowserRouter>
31
- <RoutesProvider routes={routes}>
32
- <App />
33
- </RoutesProvider>
34
- </BrowserRouter>
35
- </IntlProvider>
36
- );
37
- }
38
-
39
- Container.propTypes = propTypes;
40
- Container.defaultProps = defaultProps;
41
-
42
- export default Container;