generator-folklore 2.2.49 → 2.2.53

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. package/lib/generators/app/index.js +2 -2
  2. package/lib/generators/build/index.js +6 -5
  3. package/lib/generators/build/templates/scripts/server.js +50 -27
  4. package/lib/generators/build/templates/webpackDevServer.config.js +3 -0
  5. package/lib/generators/docs/index.js +3 -3
  6. package/lib/generators/js/templates/src/components/App.jsx +1 -1
  7. package/lib/generators/laravel/index.js +3 -3
  8. package/lib/generators/lerna-package/templates/gitignore +0 -1
  9. package/package.json +2 -2
  10. package/lib/generators/build/templates/.DS_Store +0 -0
  11. package/lib/generators/html/templates/.DS_Store +0 -0
  12. package/lib/generators/js/templates/.DS_Store +0 -0
  13. package/lib/generators/js/templates/src/.DS_Store +0 -0
  14. package/lib/generators/js/templates/src/components/.DS_Store +0 -0
  15. package/lib/generators/laravel/templates/.DS_Store +0 -0
  16. package/lib/generators/laravel/templates/laravel/.DS_Store +0 -0
  17. package/lib/generators/laravel/templates/laravel/public/.DS_Store +0 -0
  18. package/lib/generators/laravel/templates/laravel/resources/.DS_Store +0 -0
  19. package/lib/generators/laravel/templates/laravel/resources/lang/.DS_Store +0 -0
  20. package/lib/generators/laravel/templates/laravel/routes/.DS_Store +0 -0
  21. package/lib/generators/laravel-auth/templates/.DS_Store +0 -0
  22. package/lib/generators/laravel-auth/templates/app/Notifications/.DS_Store +0 -0
  23. package/lib/generators/laravel-auth/templates/resources/.DS_Store +0 -0
  24. package/lib/generators/laravel-auth/templates/resources/assets/js/components/fields/.DS_Store +0 -0
  25. package/lib/generators/laravel-auth/templates/resources/assets/styles/.DS_Store +0 -0
  26. package/lib/generators/laravel-auth/templates/resources/lang/.DS_Store +0 -0
  27. package/lib/generators/laravel-panneau/templates/.DS_Store +0 -0
  28. package/lib/generators/lerna-repository/templates/.DS_Store +0 -0
  29. package/lib/generators/test/templates/.DS_Store +0 -0
@@ -6,9 +6,9 @@ var _generator = _interopRequireDefault(require("../../lib/generator"));
6
6
 
7
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
8
 
9
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
9
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
10
10
 
11
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
11
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
12
12
 
13
13
  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; }
14
14
 
@@ -10,9 +10,9 @@ var _generator = _interopRequireDefault(require("../../lib/generator"));
10
10
 
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
 
13
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
13
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
14
14
 
15
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
15
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
16
16
 
17
17
  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; }
18
18
 
@@ -247,8 +247,8 @@ module.exports = class AppGenerator extends _generator.default {
247
247
  const destPath = this.destinationPath('package.json');
248
248
  const currentData = this.fs.exists(destPath) ? this.fs.readJSON(destPath) : {};
249
249
 
250
- const newData = _objectSpread({}, currentData, {
251
- scripts: _objectSpread({}, currentData.scripts || null, {}, scripts)
250
+ const newData = _objectSpread(_objectSpread({}, currentData), {}, {
251
+ scripts: _objectSpread(_objectSpread({}, currentData.scripts || null), scripts)
252
252
  });
253
253
 
254
254
  this.fs.writeJSON(destPath, newData);
@@ -267,7 +267,8 @@ module.exports = class AppGenerator extends _generator.default {
267
267
  const devDependencies = [// Loaders
268
268
  'babel-loader@latest', 'css-loader@latest', 'eslint-loader@latest', 'file-loader@latest', 'postcss-loader@latest', 'sass-loader@latest', 'style-loader@latest', 'url-loader@latest', // Plugins
269
269
  'html-webpack-plugin@^4.0.0-alpha.2', 'webpack-manifest-plugin@latest', 'case-sensitive-paths-webpack-plugin@latest', 'postcss-preset-env@latest', 'postcss-safe-parser@latest', 'postcss-flexbugs-fixes@latest', 'pnp-webpack-plugin@latest', 'babel-preset-react-app@^6.1.0', 'babel-plugin-named-asset-import@latest', 'terser-webpack-plugin@latest', 'mini-css-extract-plugin@latest', 'optimize-css-assets-webpack-plugin@latest', 'workbox-webpack-plugin@latest', // Others
270
- 'autoprefixer@latest', 'cssnano@latest', 'chalk@latest', 'dotenv@latest', 'dotenv-expand@latest', 'node-sass@latest', 'fs-extra@latest', 'glob@latest', 'pretty-bytes@latest', 'react-dev-utils@^6.1.1', 'webpack@^4.0'];
270
+ 'autoprefixer@latest', 'cssnano@latest', 'chalk@latest', 'dotenv@latest', 'dotenv-expand@latest', 'node-sass@latest', 'fs-extra@latest', 'glob@latest', 'pretty-bytes@latest', 'react-dev-utils@^10.0.0', 'webpack@^4.0' // TODO: update webpack 4
271
+ ];
271
272
  const dependencies = ['whatwg-fetch', 'core-js@^2.4.0', 'promise', 'raf', 'lodash@latest', 'object-assign'];
272
273
 
273
274
  if (this.options.server) {
@@ -19,7 +19,7 @@ process.env.NODE_ENV = 'development';
19
19
  // Makes the script crash on unhandled rejections instead of silently
20
20
  // ignoring them. In the future, promise rejections that are not handled will
21
21
  // terminate the Node.js process with a non-zero exit code.
22
- process.on('unhandledRejection', (err) => {
22
+ process.on('unhandledRejection', err => {
23
23
  throw err;
24
24
  });
25
25
 
@@ -49,15 +49,16 @@ const createDevServerConfig = require('../webpackDevServer.config');
49
49
  const useYarn = fs.existsSync(paths.yarnLockFile);
50
50
  const isInteractive = process.stdout.isTTY;
51
51
 
52
- const webpackConfigs = program.config !== null
53
- ? program.config.map(configPath => require(path.join(process.env.PWD, configPath)))
54
- : defaultWebpackConfig;
52
+ const webpackConfigs =
53
+ program.config !== null
54
+ ? program.config.map(configPath => require(path.join(process.env.PWD, configPath)))
55
+ : defaultWebpackConfig;
55
56
 
56
57
  const entries = isArray(webpackConfigs)
57
58
  ? webpackConfigs.reduce(
58
- (allEntries, webpackConfig) => [...allEntries, ...webpackConfig.entry],
59
- [],
60
- )
59
+ (allEntries, webpackConfig) => [...allEntries, ...webpackConfig.entry],
60
+ [],
61
+ )
61
62
  : webpackConfigs.entry;
62
63
 
63
64
  // Warn and crash if required files are missing
@@ -90,43 +91,65 @@ const { checkBrowsers } = require('react-dev-utils/browsersHelper');
90
91
 
91
92
  function mayProxy(pathname) {
92
93
  const maybePublicPath = path.resolve(paths.appPublic, pathname.slice(1));
93
- return !fs.existsSync(maybePublicPath) || fs.lstatSync(maybePublicPath).isDirectory();
94
+ return (
95
+ !pathname.startsWith('/sockjs-node') &&
96
+ (!fs.existsSync(maybePublicPath) || fs.lstatSync(maybePublicPath).isDirectory())
97
+ );
94
98
  }
95
99
 
96
100
  checkBrowsers(paths.appPath, isInteractive)
97
101
  .then(() => choosePort(HOST, DEFAULT_PORT))
98
- .then((port) => {
102
+ .then(port => {
99
103
  if (port == null) {
100
104
  // We have not found a port.
101
105
  return;
102
106
  }
107
+
103
108
  const protocol = process.env.HTTPS === 'true' || config.https ? 'https' : 'http';
104
109
  const appName = require(paths.appPackageJson).name;
105
110
  const urls = prepareUrls(protocol, HOST, port);
111
+ let devServer;
112
+ const devSocket = {
113
+ warnings: warnings => devServer.sockWrite(devServer.sockets, 'warnings', warnings),
114
+ errors: errors => devServer.sockWrite(devServer.sockets, 'errors', errors),
115
+ };
106
116
  // Create a webpack compiler that is configured with custom messages.
107
- const compiler = createCompiler(webpack, webpackConfigs, appName, urls, useYarn);
117
+ // const compiler = createCompiler(webpack, webpackConfigs, appName, urls, useYarn);
118
+ const compiler = createCompiler({
119
+ appName,
120
+ urls,
121
+ useYarn,
122
+ webpack,
123
+ devSocket,
124
+ config: webpackConfigs,
125
+ });
108
126
  // Load proxy config
109
127
  const proxySetting = config.proxy || require(paths.appPackageJson).proxy;
110
128
  const proxyConfig = prepareProxy(proxySetting, paths.appPublic) || null;
111
129
  // Serve webpack assets generated by the compiler over a web server.
112
130
  const serverConfig = createDevServerConfig(
113
- proxyConfig !== null ? [
114
- {
115
- ...proxyConfig[0],
116
- context(pathname, req) {
117
- return (
118
- req.method !== 'GET' || pathname === '/' || (mayProxy(pathname) && req.headers.accept)
119
- );
120
- },
121
- changeOrigin: false,
122
- autoRewrite: true,
123
- },
124
- ] : null,
131
+ // proxyConfig,
132
+ proxyConfig !== null
133
+ ? [
134
+ {
135
+ ...proxyConfig[0],
136
+ context(pathname, req) {
137
+ return (
138
+ req.method !== 'GET' ||
139
+ pathname === '/' ||
140
+ (mayProxy(pathname) && req.headers.accept)
141
+ );
142
+ },
143
+ changeOrigin: false,
144
+ autoRewrite: true,
145
+ },
146
+ ]
147
+ : null,
125
148
  urls.lanUrlForConfig,
126
149
  );
127
- const devServer = new WebpackDevServer(compiler, serverConfig);
150
+ devServer = new WebpackDevServer(compiler, serverConfig);
128
151
  // Launch WebpackDevServer.
129
- devServer.listen(port, HOST, (err) => {
152
+ devServer.listen(port, HOST, err => {
130
153
  if (err) {
131
154
  console.log(err);
132
155
  return;
@@ -138,16 +161,16 @@ checkBrowsers(paths.appPath, isInteractive)
138
161
  openBrowser(urls.localUrlForBrowser);
139
162
  });
140
163
 
141
- ['SIGINT', 'SIGTERM'].forEach((sig) => {
164
+ ['SIGINT', 'SIGTERM'].forEach(sig => {
142
165
  process.on(sig, () => {
143
166
  devServer.close();
144
167
  process.exit();
145
168
  });
146
169
  });
147
170
  })
148
- .catch((err) => {
171
+ .catch(err => {
149
172
  if (err && err.message) {
150
- console.log(err.message);
173
+ console.log(err);
151
174
  }
152
175
  process.exit(1);
153
176
  });
@@ -58,6 +58,9 @@ module.exports = (proxy, allowedHost) => ({
58
58
  // in the Webpack development configuration. Note that only changes
59
59
  // to CSS are currently hot reloaded. JS changes will refresh the browser.
60
60
  hot: true,
61
+ // Use 'ws' instead of 'sockjs-node' on server since we're using native
62
+ // websockets in `webpackHotDevClient`.
63
+ transportMode: 'ws',
61
64
  // It is important to tell WebpackDevServer to use the same "root" path
62
65
  // as we specified in the config. In development, we always serve from /.
63
66
  publicPath: webpackConfig.output.publicPath,
@@ -10,9 +10,9 @@ var _generator = _interopRequireDefault(require("../../lib/generator"));
10
10
 
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
 
13
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
13
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
14
14
 
15
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
15
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
16
16
 
17
17
  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; }
18
18
 
@@ -128,7 +128,7 @@ module.exports = class DocsGenerator extends _generator.default {
128
128
  };
129
129
  const destPath = this.destinationPath('package.json');
130
130
  const packageJSON = this.fs.exists(destPath) ? this.fs.readJSON(destPath) : {};
131
- packageJSON.scripts = _objectSpread({}, packageJSON.scripts, {}, scripts);
131
+ packageJSON.scripts = _objectSpread(_objectSpread({}, packageJSON.scripts), scripts);
132
132
  this.fs.writeJSON(destPath, packageJSON);
133
133
  }
134
134
 
@@ -4,7 +4,7 @@ import { connect } from 'react-redux';
4
4
  import { Route, Switch, useHistory } from 'react-router';
5
5
  import { useUrlGenerator } from '@folklore/react-container';
6
6
 
7
- import * as AppPropTypes from '../lib/PropTypes';
7
+ // import * as AppPropTypes from '../lib/PropTypes';
8
8
  import { resetRequest as resetRequestAction } from '../actions/SiteActions';
9
9
  import MainLayout from './layouts/Main';
10
10
  import HomePage from './pages/Home';
@@ -16,9 +16,9 @@ var _generator = _interopRequireDefault(require("../../lib/generator"));
16
16
 
17
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
18
 
19
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
19
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
20
20
 
21
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
22
22
 
23
23
  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; }
24
24
 
@@ -376,7 +376,7 @@ module.exports = class LaravelGenerator extends _generator.default {
376
376
  url: urlLocal
377
377
  };
378
378
 
379
- const prodTemplateData = _objectSpread({}, templateData, {
379
+ const prodTemplateData = _objectSpread(_objectSpread({}, templateData), {}, {
380
380
  url,
381
381
  db_username: this.options['db-name']
382
382
  });
@@ -34,4 +34,3 @@ publish
34
34
  /lib
35
35
  /es
36
36
  /dist
37
- /package-lock.json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-folklore",
3
- "version": "2.2.49",
3
+ "version": "2.2.53",
4
4
  "description": "Yeoman generator for projects at Folklore",
5
5
  "keywords": [
6
6
  "yeoman-generator"
@@ -39,5 +39,5 @@
39
39
  "yeoman-generator": "^2.0.3",
40
40
  "yeoman-remote": "^1.0.1"
41
41
  },
42
- "gitHead": "e60d3fecf3baf683fb8b42b9391099e80d558b64"
42
+ "gitHead": "55a5d3ae12a27c5319c5e1d6c2a8ed3b9a02cb71"
43
43
  }