generator-folklore 3.0.17 → 3.0.18
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/generators/app/index.js +2 -2
- package/lib/generators/docs/index.js +2 -2
- package/lib/generators/laravel/index.js +2 -2
- package/lib/generators/laravel-project/index.js +2 -2
- package/lib/generators/react-app/index.js +2 -2
- package/lib/generators/react-app/templates/index.js +3 -3
- package/lib/generators/react-app/templates/src/components/App.jsx +28 -32
- package/lib/generators/react-app/templates/src/components/Routes.jsx +46 -0
- package/lib/generators/react-app/templates/src/components/buttons/Button.jsx +3 -0
- package/lib/generators/react-app/templates/src/components/layouts/Main.jsx +1 -3
- package/lib/generators/react-app/templates/src/components/menus/Menu.jsx +2 -3
- package/lib/lib/generator.js +1 -2
- package/package.json +2 -2
- package/lib/generators/react-app/templates/src/components/Container.jsx +0 -42
@@ -3,8 +3,8 @@
|
|
3
3
|
var _chalk = _interopRequireDefault(require("chalk"));
|
4
4
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
5
5
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6
|
-
function ownKeys(
|
7
|
-
function _objectSpread(
|
6
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
7
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
8
8
|
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; }
|
9
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
10
10
|
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); }
|
@@ -5,8 +5,8 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
5
5
|
var _path = _interopRequireDefault(require("path"));
|
6
6
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
7
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
-
function ownKeys(
|
9
|
-
function _objectSpread(
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
10
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
11
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
12
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); }
|
@@ -8,8 +8,8 @@ var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
8
|
var _passwordGenerator = _interopRequireDefault(require("password-generator"));
|
9
9
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
-
function ownKeys(
|
12
|
-
function _objectSpread(
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
13
13
|
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; }
|
14
14
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
15
15
|
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); }
|
@@ -8,8 +8,8 @@ var _path = _interopRequireDefault(require("path"));
|
|
8
8
|
var _yeomanRemote = _interopRequireDefault(require("yeoman-remote"));
|
9
9
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
-
function ownKeys(
|
12
|
-
function _objectSpread(
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
13
13
|
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; }
|
14
14
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
15
15
|
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); }
|
@@ -5,8 +5,8 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
5
5
|
var _path = _interopRequireDefault(require("path"));
|
6
6
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
7
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
-
function ownKeys(
|
9
|
-
function _objectSpread(
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
10
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
11
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
12
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); }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { createRoot } from 'react-dom/client';
|
3
3
|
|
4
|
-
import
|
4
|
+
import App from './components/App';
|
5
5
|
import shouldPolyfill from './polyfills/should';
|
6
6
|
|
7
7
|
function getAppProps() {
|
@@ -10,8 +10,8 @@ function getAppProps() {
|
|
10
10
|
|
11
11
|
function renderApp(props) {
|
12
12
|
const element = document.getElementById('app');
|
13
|
-
const
|
14
|
-
const strictMode = React.createElement(React.StrictMode, {},
|
13
|
+
const app = React.createElement(App, props);
|
14
|
+
const strictMode = React.createElement(React.StrictMode, {}, app);
|
15
15
|
const root = createRoot(element);
|
16
16
|
root.render(strictMode);
|
17
17
|
}
|
@@ -1,42 +1,38 @@
|
|
1
|
+
import { RoutesProvider } from '@folklore/routes';
|
2
|
+
import PropTypes from 'prop-types';
|
1
3
|
import React from 'react';
|
2
|
-
|
3
|
-
import {
|
4
|
-
import { useRoutes } from '@folklore/routes';
|
4
|
+
import { IntlProvider } from 'react-intl';
|
5
|
+
import { BrowserRouter } from 'react-router-dom';
|
5
6
|
|
6
|
-
// import { useUrlGenerator } from '@folklore/routes';
|
7
7
|
// import * as AppPropTypes from '../lib/PropTypes';
|
8
|
-
import
|
9
|
-
import ErrorPage from './pages/Error';
|
10
|
-
import HomePage from './pages/Home';
|
8
|
+
import Routes from './Routes';
|
11
9
|
|
12
|
-
|
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
|
+
};
|
13
20
|
|
14
|
-
const
|
21
|
+
const defaultProps = {
|
22
|
+
intl: null,
|
23
|
+
routes: {},
|
24
|
+
};
|
15
25
|
|
16
|
-
|
17
|
-
|
18
|
-
function App() {
|
19
|
-
const routes = useRoutes() || {};
|
26
|
+
function App({ intl, routes }) {
|
27
|
+
const { locale = 'fr', messages = {} } = intl || {};
|
20
28
|
return (
|
21
|
-
<
|
22
|
-
<
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
</MainLayout>
|
29
|
-
}
|
30
|
-
/>
|
31
|
-
<Route
|
32
|
-
path="*"
|
33
|
-
element={
|
34
|
-
<MainLayout>
|
35
|
-
<ErrorPage />
|
36
|
-
</MainLayout>
|
37
|
-
}
|
38
|
-
/>
|
39
|
-
</Routes>
|
29
|
+
<IntlProvider locale={locale} messages={messages[locale] || messages}>
|
30
|
+
<BrowserRouter>
|
31
|
+
<RoutesProvider routes={routes}>
|
32
|
+
<Routes />
|
33
|
+
</RoutesProvider>
|
34
|
+
</BrowserRouter>
|
35
|
+
</IntlProvider>
|
40
36
|
);
|
41
37
|
}
|
42
38
|
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
// import PropTypes from 'prop-types';
|
3
|
+
import { Route, Routes } from 'react-router-dom';
|
4
|
+
import { useRoutes } from '@folklore/routes';
|
5
|
+
|
6
|
+
// import { useUrlGenerator } from '@folklore/routes';
|
7
|
+
// import * as AppPropTypes from '../lib/PropTypes';
|
8
|
+
import MainLayout from './layouts/Main';
|
9
|
+
import ErrorPage from './pages/Error';
|
10
|
+
import HomePage from './pages/Home';
|
11
|
+
|
12
|
+
import '<%= getRelativeStylesPath('components/App.jsx', 'styles.scss') %>';
|
13
|
+
|
14
|
+
const propTypes = {};
|
15
|
+
|
16
|
+
const defaultProps = {};
|
17
|
+
|
18
|
+
function Routes() {
|
19
|
+
const routes = useRoutes() || {};
|
20
|
+
return (
|
21
|
+
<Routes>
|
22
|
+
<Route
|
23
|
+
path={routes.home || '/'}
|
24
|
+
exact
|
25
|
+
element={
|
26
|
+
<MainLayout>
|
27
|
+
<HomePage />
|
28
|
+
</MainLayout>
|
29
|
+
}
|
30
|
+
/>
|
31
|
+
<Route
|
32
|
+
path="*"
|
33
|
+
element={
|
34
|
+
<MainLayout>
|
35
|
+
<ErrorPage />
|
36
|
+
</MainLayout>
|
37
|
+
}
|
38
|
+
/>
|
39
|
+
</Routes>
|
40
|
+
);
|
41
|
+
}
|
42
|
+
|
43
|
+
Routes.propTypes = propTypes;
|
44
|
+
Routes.defaultProps = defaultProps;
|
45
|
+
|
46
|
+
export default Routes;
|
@@ -9,6 +9,7 @@ import * as AppPropTypes from '../../lib/PropTypes';
|
|
9
9
|
import styles from '<%= getRelativeStylesPath('components/buttons/Button.jsx', 'buttons/button.module.scss') %>';
|
10
10
|
|
11
11
|
const propTypes = {
|
12
|
+
text: PropTypes.string,
|
12
13
|
type: PropTypes.string,
|
13
14
|
href: PropTypes.string,
|
14
15
|
external: PropTypes.bool,
|
@@ -28,6 +29,7 @@ const propTypes = {
|
|
28
29
|
};
|
29
30
|
|
30
31
|
const defaultProps = {
|
32
|
+
text: null,
|
31
33
|
type: 'button',
|
32
34
|
href: null,
|
33
35
|
external: false,
|
@@ -47,6 +49,7 @@ const defaultProps = {
|
|
47
49
|
};
|
48
50
|
|
49
51
|
function Button({
|
52
|
+
text,
|
50
53
|
type,
|
51
54
|
href,
|
52
55
|
external,
|
@@ -5,7 +5,6 @@ import classNames from 'classnames';
|
|
5
5
|
import { Link } from 'react-router-dom';
|
6
6
|
|
7
7
|
import * as AppPropTypes from '../../lib/PropTypes';
|
8
|
-
import Label from '../partials/Label';
|
9
8
|
|
10
9
|
import styles from '<%= getRelativeStylesPath('components/menus/Menu.jsx', 'menus/menu.module.scss') %>';
|
11
10
|
|
@@ -42,11 +41,11 @@ function Menu({ items, className }) {
|
|
42
41
|
>
|
43
42
|
{external ? (
|
44
43
|
<a href={url} target={target} className={styles.link}>
|
45
|
-
|
44
|
+
{label}
|
46
45
|
</a>
|
47
46
|
) : (
|
48
47
|
<Link to={url} className={styles.link}>
|
49
|
-
|
48
|
+
{label}
|
50
49
|
</Link>
|
51
50
|
)}
|
52
51
|
</li>
|
package/lib/lib/generator.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "generator-folklore",
|
3
|
-
"version": "3.0.
|
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": "
|
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;
|