generator-folklore 3.0.24 → 3.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/lib/generators/css/index.js +76 -0
  2. package/lib/generators/css/templates/styles.css +31 -0
  3. package/lib/generators/css/templates/theme/colors.css +19 -0
  4. package/lib/generators/css/templates/theme/general.css +11 -0
  5. package/lib/generators/css/templates/theme/medias.css +14 -0
  6. package/lib/generators/css/templates/theme/reset.css +168 -0
  7. package/lib/generators/css/templates/theme/typography.css +12 -0
  8. package/lib/generators/css/templates/theme.css +5 -0
  9. package/lib/generators/html-project/index.js +3 -2
  10. package/lib/generators/laravel/index.js +5 -5
  11. package/lib/generators/laravel-panneau/templates/resources/assets/styles/panneau.scss +0 -1
  12. package/lib/generators/laravel-project/index.js +1 -1
  13. package/lib/generators/micromag-project/index.js +4 -4
  14. package/lib/generators/micromag-project/templates/Home.jsx +1 -1
  15. package/lib/generators/micromag-project/templates/Routes.jsx +1 -1
  16. package/lib/generators/micromag-project/templates/styles.css +3 -0
  17. package/lib/generators/prettier/templates/prettierrc.json +2 -1
  18. package/lib/generators/react-app/templates/src/components/App.jsx +1 -9
  19. package/lib/generators/react-app/templates/src/components/Routes.jsx +1 -4
  20. package/lib/generators/react-app/templates/src/components/buttons/Button.jsx +18 -39
  21. package/lib/generators/react-app/templates/src/components/layouts/Main.jsx +2 -5
  22. package/lib/generators/react-app/templates/src/components/menus/Menu.jsx +2 -8
  23. package/lib/generators/react-app/templates/src/components/pages/Error.jsx +2 -7
  24. package/lib/generators/react-app/templates/src/components/pages/Home.jsx +1 -1
  25. package/lib/generators/react-app/templates/src/components/partials/PageMeta.jsx +2 -7
  26. package/lib/generators/react-app/templates/src/contexts/KeysContext.jsx +6 -10
  27. package/lib/generators/react-app/templates/styles/buttons/button.module.css +11 -0
  28. package/lib/generators/react-app/templates/styles/layouts/{main.module.scss → main.module.css} +0 -4
  29. package/lib/generators/react-app/templates/styles/menus/menu.module.css +3 -0
  30. package/lib/generators/react-app/templates/styles/pages/error.module.css +3 -0
  31. package/lib/generators/react-app/templates/styles/pages/{home.module.scss → home.module.css} +0 -4
  32. package/lib/generators/stylelint/index.js +1 -2
  33. package/lib/generators/stylelint/templates/stylelintrc +0 -1
  34. package/package.json +4 -4
  35. package/lib/generators/micromag-project/templates/styles.scss +0 -2
  36. package/lib/generators/react-app/templates/styles/buttons/button.module.scss +0 -8
  37. package/lib/generators/react-app/templates/styles/menus/menu.module.scss +0 -7
  38. package/lib/generators/react-app/templates/styles/pages/error.module.scss +0 -7
  39. /package/lib/generators/micromag-project/templates/{home.module.scss → home.module.css} +0 -0
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ var _chalk = _interopRequireDefault(require("chalk"));
4
+ var _path = _interopRequireDefault(require("path"));
5
+ var _generator = _interopRequireDefault(require("../../lib/generator"));
6
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
+ module.exports = class CssGenerator extends _generator.default {
8
+ constructor(...args) {
9
+ super(...args);
10
+ this.argument('project-name', {
11
+ type: String,
12
+ required: false
13
+ });
14
+ this.option('path', {
15
+ type: String,
16
+ defaults: 'src/css'
17
+ });
18
+ this.stylesPath = destPath => this.destinationPath(_path.default.join(this.options.path, destPath || ''));
19
+ }
20
+ get prompting() {
21
+ return {
22
+ welcome() {
23
+ if (this.options.quiet) {
24
+ return;
25
+ }
26
+ console.log(_chalk.default.yellow('\n----------------------'));
27
+ console.log('CSS Generator');
28
+ console.log(_chalk.default.yellow('----------------------\n'));
29
+ },
30
+ prompts() {
31
+ const prompts = [];
32
+ if (!this.options['project-name']) {
33
+ prompts.push(CssGenerator.prompts.project_name);
34
+ }
35
+ if (!prompts.length) {
36
+ return null;
37
+ }
38
+ return this.prompt(prompts).then(answers => {
39
+ if (answers['project-name']) {
40
+ this.options['project-name'] = answers['project-name'];
41
+ }
42
+ });
43
+ }
44
+ };
45
+ }
46
+ get writing() {
47
+ return {
48
+ styles() {
49
+ const srcPath = this.templatePath('styles.css');
50
+ const destPath = this.stylesPath('styles.css');
51
+ this.fs.copy(srcPath, destPath);
52
+ },
53
+ theme() {
54
+ const srcPath = this.templatePath('theme.css');
55
+ const destPath = this.stylesPath('theme.css');
56
+ this.fs.copy(srcPath, destPath);
57
+ },
58
+ themes() {
59
+ const srcPath = this.templatePath('theme');
60
+ const destPath = this.stylesPath('theme');
61
+ this.fs.copy(srcPath, destPath);
62
+ },
63
+ dependencies() {
64
+ this.addDependencies({
65
+ 'sanitize.css': '^13.0.0'
66
+ });
67
+ }
68
+ };
69
+ }
70
+ async install() {
71
+ if (this.options['skip-install']) {
72
+ return;
73
+ }
74
+ await this.spawnCommand('npm', ['install']);
75
+ }
76
+ };
@@ -0,0 +1,31 @@
1
+ /* stylelint-disable selector-class-pattern */
2
+ @import 'sanitize.css';
3
+ @import './theme.css';
4
+
5
+ body {
6
+ font-family: var(--font-text);
7
+ font-size: var(--base-font-size);
8
+ font-weight: 700;
9
+ overflow-y: scroll;
10
+ }
11
+
12
+ html,
13
+ body {
14
+ overscroll-behavior: none;
15
+ overscroll-behavior-x: none;
16
+ }
17
+
18
+ /* Hide scrollbar for IE, Edge and Firefox */
19
+ .hide-scrollbar {
20
+ -ms-overflow-style: none; /* IE and Edge */
21
+ scrollbar-width: none; /* Firefox */
22
+
23
+ &::-webkit-scrollbar {
24
+ display: none;
25
+ }
26
+ }
27
+
28
+ .modal-open {
29
+ overflow: hidden;
30
+ padding-right: 0;
31
+ }
@@ -0,0 +1,19 @@
1
+ :root {
2
+ --color-white: #fff;
3
+ --color-black: #000;
4
+ --color-blue: #0000fb;
5
+ --color-purple: #90f;
6
+ --color-red: #f03;
7
+ --color-error: var(--color-red);
8
+ }
9
+
10
+
11
+ div[data-theme="light"] {
12
+ --color-text: var(--color-black);
13
+ --color-title: var(--color-white);
14
+ }
15
+
16
+ div[data-theme="dark"] {
17
+ --color-text: var(--color-white);
18
+ --color-text-alt: var(--color-black);
19
+ }
@@ -0,0 +1,11 @@
1
+ :root {
2
+ --spacing-small: 5px;
3
+ --spacing: 10px;
4
+ --spacing-medium: 20px;
5
+ --spacing-large: 30px;
6
+ --spacing-xlarge: 40px;
7
+ --border-radius: 16px;
8
+ --line-height: 1.25;
9
+ --max-page-width: 1300px;
10
+ --transition-default: 0.3s ease-out;
11
+ }
@@ -0,0 +1,14 @@
1
+
2
+ @custom-media --very-small-viewport (min-width: 360px);
3
+ @custom-media --small-viewport (min-width: 576px);
4
+ @custom-media --medium-viewport (min-width: 768px);
5
+ @custom-media --large-viewport (min-width: 1200px);
6
+ @custom-media --x-large-viewport (min-width: 1400px);
7
+
8
+ :root {
9
+ --very-small-viewport: 360px;
10
+ --small-viewport: 500px;
11
+ --medium-viewport: 768px;
12
+ --large-viewport: 1200px;
13
+ --x-large-viewport: 1400px;
14
+ }
@@ -0,0 +1,168 @@
1
+ html,
2
+ body {
3
+ min-height: 100%;
4
+ padding: 0;
5
+ margin: 0;
6
+ }
7
+
8
+ a {
9
+ color: inherit;
10
+ }
11
+
12
+ /* http://meyerweb.com/eric/tools/css/reset/
13
+ v2.0 | 20110126
14
+ License: none (public domain)
15
+ */
16
+
17
+ html,
18
+ body,
19
+ div,
20
+ span,
21
+ applet,
22
+ object,
23
+ iframe,
24
+ h1,
25
+ h2,
26
+ h3,
27
+ h4,
28
+ h5,
29
+ h6,
30
+ p,
31
+ blockquote,
32
+ pre,
33
+ a,
34
+ abbr,
35
+ acronym,
36
+ address,
37
+ big,
38
+ cite,
39
+ code,
40
+ del,
41
+ dfn,
42
+ em,
43
+ img,
44
+ ins,
45
+ kbd,
46
+ q,
47
+ s,
48
+ samp,
49
+ small,
50
+ strike,
51
+ strong,
52
+ sub,
53
+ sup,
54
+ tt,
55
+ var,
56
+ b,
57
+ u,
58
+ i,
59
+ center,
60
+ dl,
61
+ dt,
62
+ dd,
63
+ ol,
64
+ ul,
65
+ li,
66
+ fieldset,
67
+ form,
68
+ label,
69
+ legend,
70
+ table,
71
+ caption,
72
+ tbody,
73
+ tfoot,
74
+ thead,
75
+ tr,
76
+ th,
77
+ td,
78
+ article,
79
+ aside,
80
+ canvas,
81
+ details,
82
+ embed,
83
+ figure,
84
+ figcaption,
85
+ footer,
86
+ header,
87
+ hgroup,
88
+ menu,
89
+ nav,
90
+ output,
91
+ ruby,
92
+ section,
93
+ summary,
94
+ time,
95
+ mark,
96
+ audio,
97
+ video {
98
+ padding: 0;
99
+ border: 0;
100
+ margin: 0;
101
+ font: inherit;
102
+ font-size: 100%;
103
+ vertical-align: baseline;
104
+ }
105
+
106
+ /* HTML5 display-role reset for older browsers */
107
+ article,
108
+ aside,
109
+ details,
110
+ figcaption,
111
+ figure,
112
+ footer,
113
+ header,
114
+ hgroup,
115
+ menu,
116
+ nav,
117
+ section {
118
+ display: block;
119
+ }
120
+
121
+ body {
122
+ line-height: 1;
123
+ }
124
+
125
+ ol,
126
+ ul {
127
+ list-style: none;
128
+ }
129
+
130
+ blockquote,
131
+ q {
132
+ quotes: none;
133
+ }
134
+
135
+ blockquote::before,
136
+ blockquote::after,
137
+ q::before,
138
+ q::after {
139
+ content: '';
140
+ content: none;
141
+ }
142
+
143
+ table {
144
+ border-collapse: collapse;
145
+ border-spacing: 0;
146
+ }
147
+
148
+ html {
149
+ box-sizing: border-box;
150
+ }
151
+
152
+ input,
153
+ button,
154
+ a,
155
+ textarea,
156
+ select {
157
+ outline: none;
158
+ }
159
+
160
+ *,
161
+ *::before,
162
+ *::after {
163
+ box-sizing: inherit;
164
+ }
165
+
166
+ a > img {
167
+ display: block;
168
+ }
@@ -0,0 +1,12 @@
1
+ :root {
2
+ --font-title: 'Helvetica', 'Arial', sans-serif;
3
+ --font-text: 'Helvetica', 'Arial', sans-serif;
4
+ --base-font-size: 16px;
5
+ }
6
+
7
+ /* @font-face {
8
+ font-family: KodeMono;
9
+ font-style: normal;
10
+ font-weight: 400;
11
+ src: url('../../fonts/kode-mono.woff2') format('woff2');
12
+ } */
@@ -0,0 +1,5 @@
1
+ @import './theme/colors.css';
2
+ @import './theme/general.css';
3
+ @import './theme/medias.css';
4
+ @import './theme/reset.css';
5
+ @import './theme/typography.css';
@@ -30,7 +30,7 @@ module.exports = class HTMLProjectGenerator extends _generator.default {
30
30
  });
31
31
  this.option('styles-path', {
32
32
  type: String,
33
- desc: 'Path for the scss',
33
+ desc: 'Path for the css/scss',
34
34
  defaults: 'styles'
35
35
  });
36
36
  this.option('server', {
@@ -118,7 +118,7 @@ module.exports = class HTMLProjectGenerator extends _generator.default {
118
118
  'skip-install': true,
119
119
  quiet: true
120
120
  });
121
- this.composeWith('folklore:scss', {
121
+ this.composeWith('folklore:css', {
122
122
  'project-name': projectName,
123
123
  path: stylesSrcPath,
124
124
  react: true,
@@ -134,6 +134,7 @@ module.exports = class HTMLProjectGenerator extends _generator.default {
134
134
  });
135
135
  }
136
136
  console.log(srcPath, jsSrcPath, _path.default.join(jsSrcPath, 'index.js'), _path.default.join(srcPath, 'index.html.ejs'));
137
+ this.log('merging with folklore build');
137
138
  this.composeWith('folklore:build', {
138
139
  'src-path': srcPath,
139
140
  'entry-path': _path.default.join(jsSrcPath, 'index.js'),
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var _lodash = _interopRequireDefault(require("lodash"));
4
- var _yeomanRemote = _interopRequireDefault(require("yeoman-remote"));
5
- var _glob = _interopRequireDefault(require("glob"));
6
- var _path = _interopRequireDefault(require("path"));
7
3
  var _chalk = _interopRequireDefault(require("chalk"));
4
+ var _glob = _interopRequireDefault(require("glob"));
5
+ var _lodash = _interopRequireDefault(require("lodash"));
8
6
  var _passwordGenerator = _interopRequireDefault(require("password-generator"));
7
+ var _path = _interopRequireDefault(require("path"));
8
+ var _yeomanRemote = _interopRequireDefault(require("yeoman-remote"));
9
9
  var _generator = _interopRequireDefault(require("../../lib/generator"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
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; }
@@ -221,7 +221,7 @@ module.exports = class LaravelGenerator extends _generator.default {
221
221
  this.composeWith('folklore:editorconfig', {
222
222
  quiet: true
223
223
  });
224
- this.composeWith('folklore:scss', {
224
+ this.composeWith('folklore:css', {
225
225
  'project-name': this.options['project-name'],
226
226
  path: stylesSrcPath,
227
227
  react: true,
@@ -1,4 +1,3 @@
1
1
  @import '~@panneau/app/scss/styles';
2
-
3
2
  @import '~@panneau/themes/scss/styles';
4
3
  @import '~@panneau/themes/scss/vendor';
@@ -221,7 +221,7 @@ module.exports = class LaravelProjectGenerator extends _generator.default {
221
221
  quiet: true,
222
222
  'skip-install': true
223
223
  });
224
- this.composeWith('folklore:scss', {
224
+ this.composeWith('folklore:css', {
225
225
  'project-name': this.options['project-name'],
226
226
  path: stylesSrcPath,
227
227
  react: true,
@@ -76,9 +76,9 @@ module.exports = class MicromagProjectGenerator extends _generator.default {
76
76
  getRelativeStylesPath: (from, src) => _path.default.relative(this.destinationPath(_path.default.dirname(_path.default.join(srcPath, from))), this.destinationPath(_path.default.join(_path.default.join(srcPath, 'styles'), src)))
77
77
  };
78
78
  this.fs.delete(this.srcPath('components/pages/Home.jsx'));
79
- this.fs.delete(this.srcPath('styles/pages/home.module.scss'));
79
+ this.fs.delete(this.srcPath('styles/pages/home.module.css'));
80
80
  this.fs.copyTpl(this.templatePath('Home.jsx'), this.srcPath('components/pages/Home.jsx'), templateData);
81
- this.fs.copyTpl(this.templatePath('home.module.scss'), this.srcPath('styles/pages/home.module.scss'), templateData);
81
+ this.fs.copyTpl(this.templatePath('home.module.css'), this.srcPath('styles/pages/home.module.css'), templateData);
82
82
  },
83
83
  routes() {
84
84
  const {
@@ -91,8 +91,8 @@ module.exports = class MicromagProjectGenerator extends _generator.default {
91
91
  this.fs.copyTpl(this.templatePath('Routes.jsx'), this.srcPath('components/Routes.jsx'), templateData);
92
92
  },
93
93
  styles() {
94
- this.fs.delete(this.srcPath('styles/styles.scss'));
95
- this.fs.copyTpl(this.templatePath('styles.scss'), this.srcPath('styles/styles.scss'));
94
+ this.fs.delete(this.srcPath('styles/styles.css'));
95
+ this.fs.copyTpl(this.templatePath('styles.css'), this.srcPath('styles/styles.css'));
96
96
  },
97
97
  micromag() {
98
98
  this.fs.copyTpl(this.templatePath('data.json'), this.srcPath('micromag/data.json'));
@@ -6,7 +6,7 @@ import { useIntl } from 'react-intl';
6
6
  // import * as AppPropTypes from '../../lib/PropTypes';
7
7
  import story from '../../micromag/data.json';
8
8
 
9
- import styles from '<%= getRelativeStylesPath('components/pages/Home.jsx', 'pages/home.module.scss') %>';
9
+ import styles from '<%= getRelativeStylesPath('components/pages/Home.jsx', 'pages/home.module.css') %>';
10
10
 
11
11
  const propTypes = {
12
12
  // intl: AppPropTypes.intl.isRequired,
@@ -9,7 +9,7 @@ import MainLayout from './layouts/Main';
9
9
  import ErrorPage from './pages/Error';
10
10
  import HomePage from './pages/Home';
11
11
 
12
- import '<%= getRelativeStylesPath('components/App.jsx', 'styles.scss') %>';
12
+ import '<%= getRelativeStylesPath('components/App.jsx', 'styles.css') %>';
13
13
 
14
14
  const propTypes = {};
15
15
 
@@ -0,0 +1,3 @@
1
+ @import url('@micromag/core');
2
+ @import url('@micromag/viewer');
3
+
@@ -5,10 +5,11 @@
5
5
  "trailingComma": "all",
6
6
  "tabWidth": 4,
7
7
  "importOrder": [
8
+ "styles\\.s?css$",
8
9
  "<THIRD_PARTY_MODULES>",
9
10
  "^[./](.*)?/(utils|hooks|lib)",
10
11
  "^[./].*(?<!(\\.[a-z]+))$",
11
- "\\.scss$",
12
+ "\\.s?css$",
12
13
  "\\.[a-z]+$"
13
14
  ],
14
15
  "importOrderSeparation": true
@@ -18,14 +18,7 @@ const propTypes = {
18
18
  routes: PropTypes.objectOf(PropTypes.string),
19
19
  };
20
20
 
21
- const defaultProps = {
22
- intl: null,
23
- routes: {
24
- home: '/'
25
- },
26
- };
27
-
28
- function App({ intl, routes }) {
21
+ function App({ intl = null, routes = { home: '/' } }) {
29
22
  const { locale = 'fr', messages = {} } = intl || {};
30
23
  return (
31
24
  <IntlProvider locale={locale} messages={messages[locale] || messages}>
@@ -39,6 +32,5 @@ function App({ intl, routes }) {
39
32
  }
40
33
 
41
34
  App.propTypes = propTypes;
42
- App.defaultProps = defaultProps;
43
35
 
44
36
  export default App;
@@ -9,12 +9,10 @@ import MainLayout from './layouts/Main';
9
9
  import ErrorPage from './pages/Error';
10
10
  import HomePage from './pages/Home';
11
11
 
12
- import '<%= getRelativeStylesPath('components/App.jsx', 'styles.scss') %>';
12
+ import '<%= getRelativeStylesPath('components/App.jsx', 'styles.css') %>';
13
13
 
14
14
  const propTypes = {};
15
15
 
16
- const defaultProps = {};
17
-
18
16
  function Routes() {
19
17
  const routes = useRoutes() || {};
20
18
  return (
@@ -34,6 +32,5 @@ function Routes() {
34
32
  }
35
33
 
36
34
  Routes.propTypes = propTypes;
37
- Routes.defaultProps = defaultProps;
38
35
 
39
36
  export default Routes;
@@ -6,7 +6,7 @@ import { Link } from 'wouter';
6
6
 
7
7
  import * as AppPropTypes from '../../lib/PropTypes';
8
8
 
9
- import styles from '<%= getRelativeStylesPath('components/buttons/Button.jsx', 'buttons/button.module.scss') %>';
9
+ import styles from '<%= getRelativeStylesPath('components/buttons/Button.jsx', 'buttons/button.module.css') %>';
10
10
 
11
11
  const propTypes = {
12
12
  text: PropTypes.string,
@@ -28,44 +28,24 @@ const propTypes = {
28
28
  onClick: PropTypes.func,
29
29
  };
30
30
 
31
- const defaultProps = {
32
- text: null,
33
- type: 'button',
34
- href: null,
35
- external: false,
36
- direct: false,
37
- target: '_blank',
38
- label: null,
39
- children: null,
40
- icon: null,
41
- iconPosition: 'inline',
42
- disabled: false,
43
- loading: false,
44
- disableOnLoading: true,
45
- className: null,
46
- iconClassName: null,
47
- labelClassName: null,
48
- onClick: null,
49
- };
50
-
51
31
  function Button({
52
- text,
53
- type,
54
- href,
55
- external,
56
- direct,
57
- target,
58
- label,
59
- children,
60
- icon,
61
- iconPosition,
62
- disabled,
63
- loading,
64
- disableOnLoading,
65
- onClick,
66
- className,
67
- iconClassName,
68
- labelClassName,
32
+ text = null,
33
+ type = 'button',
34
+ href = null,
35
+ external = false,
36
+ direct = false,
37
+ target = '_blank',
38
+ label = null,
39
+ children = null,
40
+ icon = null,
41
+ iconPosition = 'inline',
42
+ disabled = false,
43
+ loading = false,
44
+ disableOnLoading = true,
45
+ className = null,
46
+ iconClassName = null,
47
+ labelClassName = null,
48
+ onClick = null,
69
49
  }) {
70
50
  const finalLabel = label || children;
71
51
  const hasChildren = label !== null && children !== null;
@@ -158,6 +138,5 @@ function Button({
158
138
  };
159
139
 
160
140
  Button.propTypes = propTypes;
161
- Button.defaultProps = defaultProps;
162
141
 
163
142
  export default Button;
@@ -1,15 +1,13 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- import styles from '<%= getRelativeStylesPath('components/layouts/Main.jsx', 'layouts/main.module.scss') %>';
4
+ import styles from '<%= getRelativeStylesPath('components/layouts/Main.jsx', 'layouts/main.module.css') %>';
5
5
 
6
6
  const propTypes = {
7
7
  children: PropTypes.node.isRequired,
8
8
  };
9
9
 
10
- const defaultProps = {};
11
-
12
- function MainLayout({ children }) {
10
+ function MainLayout({ children = null }) {
13
11
  return (
14
12
  <div className={styles.container}>
15
13
  <div className={styles.inner}>
@@ -20,6 +18,5 @@ function MainLayout({ children }) {
20
18
  };
21
19
 
22
20
  MainLayout.propTypes = propTypes;
23
- MainLayout.defaultProps = defaultProps;
24
21
 
25
22
  export default MainLayout;
@@ -6,19 +6,14 @@ import { Link } from 'wouter';
6
6
 
7
7
  import * as AppPropTypes from '../../lib/PropTypes';
8
8
 
9
- import styles from '<%= getRelativeStylesPath('components/menus/Menu.jsx', 'menus/menu.module.scss') %>';
9
+ import styles from '<%= getRelativeStylesPath('components/menus/Menu.jsx', 'menus/menu.module.css') %>';
10
10
 
11
11
  const propTypes = {
12
12
  items: AppPropTypes.menuItems,
13
13
  className: PropTypes.string,
14
14
  };
15
15
 
16
- const defaultProps = {
17
- items: [],
18
- className: null,
19
- };
20
-
21
- function Menu({ items, className }) {
16
+ function Menu({ items = [], className = null }) {
22
17
  return (
23
18
  <nav
24
19
  className={classNames([
@@ -56,6 +51,5 @@ function Menu({ items, className }) {
56
51
  }
57
52
 
58
53
  Menu.propTypes = propTypes;
59
- Menu.defaultProps = defaultProps;
60
54
 
61
55
  export default Menu;
@@ -8,7 +8,7 @@ import { useUrlGenerator } from '@folklore/routes';
8
8
  // import * as AppPropTypes from '../../lib/PropTypes';
9
9
  import PageMeta from '../partials/PageMeta';
10
10
 
11
- import styles from '<%= getRelativeStylesPath('components/pages/Error.jsx', 'pages/error.module.scss') %>';
11
+ import styles from '<%= getRelativeStylesPath('components/pages/Error.jsx', 'pages/error.module.css') %>';
12
12
 
13
13
  export const messages = defineMessages({
14
14
  metaTitle401: {
@@ -73,11 +73,7 @@ const propTypes = {
73
73
  statusCode: PropTypes.number,
74
74
  };
75
75
 
76
- const defaultProps = {
77
- statusCode: 404,
78
- };
79
-
80
- function ErrorPage({ statusCode }) {
76
+ function ErrorPage({ statusCode = 404 }) {
81
77
  const url = useUrlGenerator();
82
78
  return (
83
79
  <div className={styles.container}>
@@ -100,6 +96,5 @@ function ErrorPage({ statusCode }) {
100
96
  };
101
97
 
102
98
  ErrorPage.propTypes = propTypes;
103
- ErrorPage.defaultProps = defaultProps;
104
99
 
105
100
  export default ErrorPage;
@@ -5,7 +5,7 @@ import { defineMessages } from 'react-intl';
5
5
  // import * as AppPropTypes from '../../lib/PropTypes';
6
6
  import PageMeta from '../partials/PageMeta';
7
7
 
8
- import styles from '<%= getRelativeStylesPath('components/pages/Home.jsx', 'pages/home.module.scss') %>';
8
+ import styles from '<%= getRelativeStylesPath('components/pages/Home.jsx', 'pages/home.module.css') %>';
9
9
 
10
10
  const messages = defineMessages({
11
11
  metaTitle: {
@@ -17,11 +17,7 @@ const propTypes = {
17
17
  title: AppPropTypes.message,
18
18
  };
19
19
 
20
- const defaultProps = {
21
- title: messages.title,
22
- };
23
-
24
- function PageMeta({ title }) {
20
+ function PageMeta({ title = null }) {
25
21
  const intl = useIntl();
26
22
  return (
27
23
  <Helmet>
@@ -31,6 +27,5 @@ function PageMeta({ title }) {
31
27
  }
32
28
 
33
29
  PageMeta.propTypes = propTypes;
34
- PageMeta.defaultProps = defaultProps;
35
30
 
36
- export default React.memo(PageMeta);
31
+ export default PageMeta;
@@ -1,7 +1,8 @@
1
1
  /* globals GOOGLE_API_KEY: true */
2
+
2
3
  /* eslint-disable react/jsx-props-no-spreading */
3
- import React, { useContext } from 'react';
4
4
  import PropTypes from 'prop-types';
5
+ import React, { useContext } from 'react';
5
6
 
6
7
  const KeysContext = React.createContext({
7
8
  googleApiKey: typeof GOOGLE_API_KEY !== 'undefined' ? GOOGLE_API_KEY : null,
@@ -9,13 +10,13 @@ const KeysContext = React.createContext({
9
10
 
10
11
  export const useKeys = () => useContext(KeysContext);
11
12
 
12
- export const withKeys = WrappedComponent => {
13
+ export const withKeys = (WrappedComponent) => {
13
14
  const getDisplayName = ({ displayName = null, name = null }) =>
14
15
  displayName || name || 'Component';
15
16
 
16
- const WithKeysComponent = props => (
17
+ const WithKeysComponent = (props) => (
17
18
  <KeysContext.Consumer>
18
- {keys => <WrappedComponent {...keys} {...props} />}
19
+ {(keys) => <WrappedComponent {...keys} {...props} />}
19
20
  </KeysContext.Consumer>
20
21
  );
21
22
  WithKeysComponent.displayName = `WithKeys(${getDisplayName(WrappedComponent)})`;
@@ -27,15 +28,10 @@ const propTypes = {
27
28
  keys: PropTypes.objectOf(PropTypes.string),
28
29
  };
29
30
 
30
- const defaultProps = {
31
- keys: {},
32
- };
33
-
34
- export const KeysProvider = ({ children, keys }) => (
31
+ export const KeysProvider = ({ children = null, keys = null }) => (
35
32
  <KeysContext.Provider value={keys}>{children}</KeysContext.Provider>
36
33
  );
37
34
 
38
35
  KeysProvider.propTypes = propTypes;
39
- KeysProvider.defaultProps = defaultProps;
40
36
 
41
37
  export default KeysContext;
@@ -0,0 +1,11 @@
1
+ .container {
2
+ display: inline-block;
3
+ position: relative;
4
+ padding: 0;
5
+ border: 0;
6
+ background: transparent;
7
+ color: inherit;
8
+ font-family: var(--font-text);
9
+ cursor: pointer;
10
+ appearance: none;
11
+ }
@@ -1,7 +1,3 @@
1
- @import '../commons/variables';
2
- @import '../commons/placeholders';
3
- @import '../commons/mixins';
4
-
5
1
  .container {
6
2
  position: relative;
7
3
 
@@ -0,0 +1,3 @@
1
+ .container {
2
+ position: relative;
3
+ }
@@ -0,0 +1,3 @@
1
+ .container {
2
+ position: relative;
3
+ }
@@ -1,7 +1,3 @@
1
- @import '../commons/variables';
2
- @import '../commons/placeholders';
3
- @import '../commons/mixins';
4
-
5
1
  .container {
6
2
  .logo {
7
3
  position: fixed;
@@ -32,9 +32,8 @@ module.exports = class StylelintGenerator extends _generator.default {
32
32
  dependencies() {
33
33
  this.addDevDependencies({
34
34
  stylelint: '^16.2.1',
35
- 'stylelint-config-standard-scss': '^13.0.0',
36
35
  'stylelint-config-idiomatic-order': '^10.0.0',
37
- 'stylelint-config-standard': '^36.0.0'
36
+ 'stylelint-config-standard': '^37.0.0'
38
37
  });
39
38
  }
40
39
  };
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "extends": [
3
- "stylelint-config-standard-scss",
4
3
  "stylelint-config-idiomatic-order",
5
4
  "stylelint-config-standard"
6
5
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-folklore",
3
- "version": "3.0.24",
3
+ "version": "3.0.25",
4
4
  "description": "Yeoman generator for projects at Folklore",
5
5
  "keywords": [
6
6
  "yeoman-generator"
@@ -9,7 +9,7 @@
9
9
  "scripts": {
10
10
  "clean:lib": "rm -rf lib/*",
11
11
  "clean": "npm run clean:lib",
12
- "copy:dirs": "find src/ -type d | grep -E '(/templates|/instructions)$' | sed 's/src\\/\\///g' | xargs -I{} cp -r \"src/{}\" \"lib/{}\"",
12
+ "copy:dirs": "find src/ -type d | grep -E '(/templates|/instructions)$' | sed 's/src\\///g' | xargs -I{} cp -r \"./src/{}\" \"./lib/{}\"",
13
13
  "compile": "../../node_modules/.bin/babel -d lib/ src/",
14
14
  "build": "npm run compile && npm run copy:dirs",
15
15
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -37,8 +37,8 @@
37
37
  "is-utf8": "^0.2.1",
38
38
  "lodash": "^4.17.21",
39
39
  "password-generator": "^2.3.2",
40
- "yeoman-generator": "^5.7.0",
40
+ "yeoman-generator": "5.9.0",
41
41
  "yeoman-remote": "^1.0.1"
42
42
  },
43
- "gitHead": "e41d1a9c4dc805aba884403e1e7ceb24545fe4fd"
43
+ "gitHead": "6879f02e1991265ab2248de470fbf8e1240483a9"
44
44
  }
@@ -1,2 +0,0 @@
1
- @import '~@micromag/core/scss/styles';
2
- @import '~@micromag/viewer/scss/styles';
@@ -1,8 +0,0 @@
1
- @import '../commons/variables';
2
- @import '../commons/placeholders';
3
- @import '../commons/mixins';
4
-
5
- .container {
6
- @extend %reset-button;
7
- display: inline-block;
8
- }
@@ -1,7 +0,0 @@
1
- @import '../commons/variables';
2
- @import '../commons/placeholders';
3
- @import '../commons/mixins';
4
-
5
- .container {
6
- position: relative;
7
- }
@@ -1,7 +0,0 @@
1
- @import '../commons/variables';
2
- @import '../commons/placeholders';
3
- @import '../commons/mixins';
4
-
5
- .container {
6
- position: relative;
7
- }