@dr.pogodin/react-utils 1.10.2 → 1.12.0

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 (82) hide show
  1. package/bin/build.js +1 -3
  2. package/bin/setup.js +2 -2
  3. package/build/development/client/index.js.map +1 -1
  4. package/build/development/index.js +0 -9
  5. package/build/development/index.js.map +1 -1
  6. package/build/development/server/index.js +9 -12
  7. package/build/development/server/index.js.map +1 -1
  8. package/build/development/server/renderer.js +13 -16
  9. package/build/development/server/renderer.js.map +1 -1
  10. package/build/development/shared/components/Button/index.js +6 -6
  11. package/build/development/shared/components/Checkbox/index.js +6 -6
  12. package/build/development/shared/components/CodeSplit/ServerSide.js +2 -3
  13. package/build/development/shared/components/CodeSplit/ServerSide.js.map +1 -1
  14. package/build/development/shared/components/Dropdown/index.js +9 -9
  15. package/build/development/shared/components/GenericLink/index.js +1 -1
  16. package/build/development/shared/components/Input/index.js +6 -6
  17. package/build/development/shared/components/MetaTags.js +10 -9
  18. package/build/development/shared/components/MetaTags.js.map +1 -1
  19. package/build/development/shared/components/Modal/index.js +5 -5
  20. package/build/development/shared/components/PageLayout/index.js +6 -6
  21. package/build/development/shared/components/ScalableRect/index.js +2 -2
  22. package/build/development/shared/components/Throbber/index.js +10 -10
  23. package/build/development/shared/components/WithTooltip/index.js +7 -7
  24. package/build/development/shared/components/YouTubeVideo/index.js +9 -9
  25. package/build/development/shared/utils/index.js +1 -5
  26. package/build/development/shared/utils/index.js.map +1 -1
  27. package/build/development/shared/utils/time.js +3 -1
  28. package/build/development/shared/utils/time.js.map +1 -1
  29. package/build/development/style.css +149 -149
  30. package/build/development/web.bundle.js +19 -29
  31. package/build/production/client/index.js.map +1 -1
  32. package/build/production/index.js +1 -1
  33. package/build/production/index.js.map +1 -1
  34. package/build/production/server/index.js +3 -3
  35. package/build/production/server/index.js.map +1 -1
  36. package/build/production/server/renderer.js +8 -7
  37. package/build/production/server/renderer.js.map +1 -1
  38. package/build/production/shared/components/Button/index.js +1 -1
  39. package/build/production/shared/components/Button/index.js.map +1 -1
  40. package/build/production/shared/components/Checkbox/index.js +1 -1
  41. package/build/production/shared/components/Checkbox/index.js.map +1 -1
  42. package/build/production/shared/components/CodeSplit/ServerSide.js +2 -2
  43. package/build/production/shared/components/CodeSplit/ServerSide.js.map +1 -1
  44. package/build/production/shared/components/Dropdown/index.js +1 -1
  45. package/build/production/shared/components/Dropdown/index.js.map +1 -1
  46. package/build/production/shared/components/GenericLink/index.js +1 -1
  47. package/build/production/shared/components/GenericLink/index.js.map +1 -1
  48. package/build/production/shared/components/Input/index.js +1 -1
  49. package/build/production/shared/components/Input/index.js.map +1 -1
  50. package/build/production/shared/components/MetaTags.js +1 -1
  51. package/build/production/shared/components/MetaTags.js.map +1 -1
  52. package/build/production/shared/components/Modal/index.js +1 -1
  53. package/build/production/shared/components/Modal/index.js.map +1 -1
  54. package/build/production/shared/components/PageLayout/index.js +1 -1
  55. package/build/production/shared/components/PageLayout/index.js.map +1 -1
  56. package/build/production/shared/components/ScalableRect/index.js +1 -1
  57. package/build/production/shared/components/ScalableRect/index.js.map +1 -1
  58. package/build/production/shared/components/Throbber/index.js +2 -2
  59. package/build/production/shared/components/Throbber/index.js.map +1 -1
  60. package/build/production/shared/components/WithTooltip/index.js +1 -1
  61. package/build/production/shared/components/WithTooltip/index.js.map +1 -1
  62. package/build/production/shared/components/YouTubeVideo/index.js +1 -1
  63. package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
  64. package/build/production/shared/utils/index.js +1 -1
  65. package/build/production/shared/utils/index.js.map +1 -1
  66. package/build/production/shared/utils/time.js +1 -1
  67. package/build/production/shared/utils/time.js.map +1 -1
  68. package/build/production/style.css +1 -1
  69. package/build/production/style.css.map +1 -1
  70. package/build/production/web.bundle.js +1 -1
  71. package/build/production/web.bundle.js.map +1 -1
  72. package/config/babel/node-ssr.js +3 -3
  73. package/config/babel/webpack.js +2 -2
  74. package/config/eslint/default.json +6 -1
  75. package/config/stylelint/default.js +1 -0
  76. package/config/webpack/app-base.js +10 -4
  77. package/config/webpack/app-development.js +2 -2
  78. package/package.json +30 -29
  79. package/build/development/shared/utils/url.js +0 -41
  80. package/build/development/shared/utils/url.js.map +0 -1
  81. package/build/production/shared/utils/url.js +0 -23
  82. package/build/production/shared/utils/url.js.map +0 -1
@@ -5,7 +5,13 @@
5
5
  * Base [Webpack](https://webpack.js.org/) configuration for apps.
6
6
  */
7
7
 
8
- const _ = require('lodash');
8
+ const {
9
+ clone,
10
+ defaults,
11
+ isFunction,
12
+ isObject,
13
+ } = require('lodash');
14
+
9
15
  const autoprefixer = require('autoprefixer');
10
16
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
11
17
  const forge = require('node-forge');
@@ -122,7 +128,7 @@ const {
122
128
  * - **`timestamp`** — The value set for `BUILD_TIMESTAMP`.
123
129
  */
124
130
  module.exports = function configFactory(ops) {
125
- const o = _.defaults(_.clone(ops), {
131
+ const o = defaults(clone(ops), {
126
132
  babelLoaderOptions: {},
127
133
  cssLocalIdent: '[hash:base64:6]',
128
134
  outputPath: 'build/web-public',
@@ -135,7 +141,7 @@ module.exports = function configFactory(ops) {
135
141
  const sitemapUrl = path.resolve(o.context, o.sitemap);
136
142
  /* eslint-disable global-require, import/no-dynamic-require */
137
143
  let source = require(sitemapUrl);
138
- if (_.isFunction(source)) source = source();
144
+ if (isFunction(source)) source = source();
139
145
  /* eslint-enable global-require, import/no-dynamic-require */
140
146
  const sm = new SM.SitemapStream();
141
147
  source.forEach((item) => sm.write(item));
@@ -192,7 +198,7 @@ module.exports = function configFactory(ops) {
192
198
 
193
199
  /* Adds InjectManifest plugin from WorkBox, if opted to. */
194
200
  if (o.workbox) {
195
- if (!_.isObject(o.workbox)) o.workbox = {};
201
+ if (!isObject(o.workbox)) o.workbox = {};
196
202
  plugins.push(new WorkboxPlugin.InjectManifest({
197
203
  swSrc: path.resolve(__dirname, '../workbox/default.js'),
198
204
  ...o.workbox,
@@ -3,7 +3,7 @@
3
3
  * @module webpack/app-development
4
4
  * @desc development Webpack configuration for applications.
5
5
  */
6
- const _ = require('lodash');
6
+ const { clone, defaults } = require('lodash');
7
7
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
8
8
 
9
9
  const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
@@ -14,7 +14,7 @@ const { merge } = require('webpack-merge');
14
14
  const baseFactory = require('./app-base');
15
15
 
16
16
  module.exports = function configFactory(ops) {
17
- const o = _.defaults(_.clone(ops), {
17
+ const o = defaults(clone(ops), {
18
18
  cssLocalIdent: '[package]___[path][name]___[local]___[hash:base64:6]',
19
19
  });
20
20
 
package/package.json CHANGED
@@ -7,8 +7,8 @@
7
7
  "url": "https://github.com/birdofpreyru/react-utils/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@babel/runtime": "^7.16.0",
11
- "@dr.pogodin/babel-plugin-react-css-modules": "^6.4.1",
10
+ "@babel/runtime": "^7.16.3",
11
+ "@dr.pogodin/babel-plugin-react-css-modules": "^6.5.3",
12
12
  "@dr.pogodin/react-global-state": "^0.6.4",
13
13
  "@dr.pogodin/react-themes": "^1.3.3",
14
14
  "autoprefix": "^1.0.1",
@@ -16,7 +16,7 @@
16
16
  "commander": "^8.3.0",
17
17
  "compression": "^1.7.4",
18
18
  "config": "^3.3.6",
19
- "cookie-parser": "^1.4.5",
19
+ "cookie-parser": "^1.4.6",
20
20
  "cross-env": "^7.0.3",
21
21
  "dayjs": "^1.10.7",
22
22
  "express": "^4.17.1",
@@ -32,12 +32,12 @@
32
32
  "react": "^17.0.2",
33
33
  "react-dom": "^17.0.2",
34
34
  "react-helmet": "^6.1.0",
35
- "react-router-dom": "^5.3.0",
35
+ "react-router-dom": "^6.0.2",
36
36
  "request-ip": "^2.1.3",
37
37
  "rimraf": "^3.0.2",
38
38
  "serialize-javascript": "^6.0.0",
39
39
  "serve-favicon": "^2.5.0",
40
- "source-map-support": "^0.5.20",
40
+ "source-map-support": "^0.5.21",
41
41
  "url-parse": "^1.5.3",
42
42
  "uuid": "^8.3.2",
43
43
  "winston": "^3.3.3"
@@ -46,58 +46,59 @@
46
46
  "devDependencies": {
47
47
  "@babel/cli": "^7.16.0",
48
48
  "@babel/core": "^7.16.0",
49
+ "@babel/eslint-parser": "^7.16.3",
50
+ "@babel/eslint-plugin": "^7.14.5",
49
51
  "@babel/node": "^7.16.0",
50
52
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
51
- "@babel/plugin-transform-runtime": "^7.16.0",
52
- "@babel/preset-env": "^7.16.0",
53
+ "@babel/plugin-transform-runtime": "^7.16.4",
54
+ "@babel/preset-env": "^7.16.4",
53
55
  "@babel/preset-react": "^7.16.0",
54
56
  "@babel/types": "^7.16.0",
55
57
  "@dr.pogodin/babel-plugin-css-modules-transform": "^1.10.0",
56
58
  "@dr.pogodin/babel-plugin-transform-assets": "^1.1.1",
57
59
  "@dr.pogodin/babel-preset-svgr": "^1.3.1",
58
- "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
60
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.2",
59
61
  "autoprefixer": "^10.4.0",
60
- "babel-eslint": "^10.1.0",
61
62
  "babel-jest": "^27.3.1",
62
63
  "babel-loader": "^8.2.3",
63
64
  "babel-plugin-module-resolver": "^4.1.0",
64
- "core-js": "^3.19.0",
65
- "css-loader": "^6.5.0",
66
- "css-minimizer-webpack-plugin": "^3.1.1",
67
- "eslint": "^7.32.0",
68
- "eslint-config-airbnb": "^18.2.1",
65
+ "core-js": "^3.19.1",
66
+ "css-loader": "^6.5.1",
67
+ "css-minimizer-webpack-plugin": "^3.1.4",
68
+ "eslint": "^8.3.0",
69
+ "eslint-config-airbnb": "^19.0.0",
69
70
  "eslint-import-resolver-babel-module": "^5.3.1",
70
- "eslint-plugin-import": "^2.25.2",
71
- "eslint-plugin-jest": "^25.2.2",
72
- "eslint-plugin-jsx-a11y": "^6.4.1",
73
- "eslint-plugin-react": "^7.26.1",
74
- "eslint-plugin-react-hooks": "^4.2.0",
71
+ "eslint-plugin-import": "^2.25.3",
72
+ "eslint-plugin-jest": "^25.2.4",
73
+ "eslint-plugin-jsx-a11y": "^6.5.1",
74
+ "eslint-plugin-react": "^7.27.1",
75
+ "eslint-plugin-react-hooks": "^4.3.0",
75
76
  "identity-obj-proxy": "^3.0.0",
76
77
  "jest": "^27.3.1",
77
- "mini-css-extract-plugin": "^2.4.3",
78
+ "mini-css-extract-plugin": "^2.4.5",
78
79
  "mockdate": "^3.0.5",
79
80
  "nodelist-foreach-polyfill": "^1.2.0",
80
81
  "postcss": "^8.3.11",
81
82
  "postcss-loader": "^6.2.0",
82
83
  "postcss-scss": "^4.0.2",
83
84
  "pretty": "^2.0.0",
84
- "react-refresh": "^0.10.0",
85
+ "react-refresh": "^0.11.0",
85
86
  "react-test-renderer": "^17.0.2",
86
87
  "regenerator-runtime": "^0.13.9",
87
88
  "resolve-url-loader": "^4.0.0",
88
89
  "sass": "^1.43.4",
89
90
  "sass-loader": "^12.3.0",
90
91
  "sitemap": "^7.0.0",
91
- "stylelint": "^14.0.1",
92
- "stylelint-config-standard-scss": "^2.0.1",
92
+ "stylelint": "^14.1.0",
93
+ "stylelint-config-standard-scss": "^3.0.0",
93
94
  "supertest": "^6.1.6",
94
- "webpack": "^5.61.0",
95
- "webpack-dev-middleware": "^5.2.1",
95
+ "webpack": "^5.64.0",
96
+ "webpack-dev-middleware": "^5.2.2",
96
97
  "webpack-hot-middleware": "^2.25.1",
97
98
  "webpack-merge": "^5.8.0",
98
- "workbox-core": "^6.3.0",
99
- "workbox-precaching": "^6.3.0",
100
- "workbox-webpack-plugin": "^6.3.0"
99
+ "workbox-core": "^6.4.1",
100
+ "workbox-precaching": "^6.4.1",
101
+ "workbox-webpack-plugin": "^6.4.1"
101
102
  },
102
103
  "engines": {
103
104
  "node": ">=14.x",
@@ -131,5 +132,5 @@
131
132
  "lint:scss": "stylelint -- **/*.{css,scss}",
132
133
  "test": "npm run lint && npm run jest"
133
134
  },
134
- "version": "1.10.2"
135
+ "version": "1.12.0"
135
136
  }
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- exports.parent = parent;
8
-
9
- var _lodash = require("lodash");
10
-
11
- /**
12
- * @category Utilities
13
- * @module url
14
- * @desc
15
- * ```jsx
16
- * import { url } from '@dr.pogodin/react-utils';
17
- * ```
18
- * URL utilities.
19
- */
20
-
21
- /**
22
- * ```js
23
- * import { url } from '@dr.pogodin/react-utils';
24
- * const { parent } = url;
25
- * ```
26
- * Given an URL, returns the parent URL.
27
- *
28
- * Namely, this function trims any `/` symbols at the given `url` end, then cuts
29
- * out the last path segment of the result. The exact logic might be enhanced
30
- * later. The overall intent is: if you have the current URL, and need the URL
31
- * for going one level up, calling `url.parent(url)` will give you that.
32
- * @param {string} url
33
- * @return {string}
34
- */
35
- function parent(path) {
36
- return path.slice(0, (0, _lodash.trimEnd)(path, '/').lastIndexOf('/'));
37
- }
38
-
39
- var _default = null;
40
- exports.default = _default;
41
- //# sourceMappingURL=url.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shared/utils/url.js"],"names":["parent","path","slice","lastIndexOf"],"mappings":";;;;;;;;AAUA;;AAVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,MAAT,CAAgBC,IAAhB,EAAsB;AAC3B,SAAOA,IAAI,CAACC,KAAL,CAAW,CAAX,EAAc,qBAAQD,IAAR,EAAc,GAAd,EAAmBE,WAAnB,CAA+B,GAA/B,CAAd,CAAP;AACD;;eAEc,I","sourcesContent":["/**\n * @category Utilities\n * @module url\n * @desc\n * ```jsx\n * import { url } from '@dr.pogodin/react-utils';\n * ```\n * URL utilities.\n */\n\nimport { trimEnd } from 'lodash';\n\n/**\n * ```js\n * import { url } from '@dr.pogodin/react-utils';\n * const { parent } = url;\n * ```\n * Given an URL, returns the parent URL.\n *\n * Namely, this function trims any `/` symbols at the given `url` end, then cuts\n * out the last path segment of the result. The exact logic might be enhanced\n * later. The overall intent is: if you have the current URL, and need the URL\n * for going one level up, calling `url.parent(url)` will give you that.\n * @param {string} url\n * @return {string}\n */\nexport function parent(path) {\n return path.slice(0, trimEnd(path, '/').lastIndexOf('/'));\n}\n\nexport default null;\n"],"file":"url.js"}
@@ -1,23 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;exports.parent=parent;var _lodash=require("lodash");/**
2
- * @category Utilities
3
- * @module url
4
- * @desc
5
- * ```jsx
6
- * import { url } from '@dr.pogodin/react-utils';
7
- * ```
8
- * URL utilities.
9
- */ /**
10
- * ```js
11
- * import { url } from '@dr.pogodin/react-utils';
12
- * const { parent } = url;
13
- * ```
14
- * Given an URL, returns the parent URL.
15
- *
16
- * Namely, this function trims any `/` symbols at the given `url` end, then cuts
17
- * out the last path segment of the result. The exact logic might be enhanced
18
- * later. The overall intent is: if you have the current URL, and need the URL
19
- * for going one level up, calling `url.parent(url)` will give you that.
20
- * @param {string} url
21
- * @return {string}
22
- */function parent(path){return path.slice(0,(0,_lodash.trimEnd)(path,"/").lastIndexOf("/"))}var _default=null;exports.default=_default;
23
- //# sourceMappingURL=url.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shared/utils/url.js"],"names":["parent","path","slice","lastIndexOf"],"mappings":"mHAUA,8BAVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G,CAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAASA,CAAAA,MAAT,CAAgBC,IAAhB,CAAsB,CAC3B,MAAOA,CAAAA,IAAI,CAACC,KAAL,CAAW,CAAX,CAAc,oBAAQD,IAAR,CAAc,GAAd,EAAmBE,WAAnB,CAA+B,GAA/B,CAAd,CACR,C,aAEc,I","sourcesContent":["/**\n * @category Utilities\n * @module url\n * @desc\n * ```jsx\n * import { url } from '@dr.pogodin/react-utils';\n * ```\n * URL utilities.\n */\n\nimport { trimEnd } from 'lodash';\n\n/**\n * ```js\n * import { url } from '@dr.pogodin/react-utils';\n * const { parent } = url;\n * ```\n * Given an URL, returns the parent URL.\n *\n * Namely, this function trims any `/` symbols at the given `url` end, then cuts\n * out the last path segment of the result. The exact logic might be enhanced\n * later. The overall intent is: if you have the current URL, and need the URL\n * for going one level up, calling `url.parent(url)` will give you that.\n * @param {string} url\n * @return {string}\n */\nexport function parent(path) {\n return path.slice(0, trimEnd(path, '/').lastIndexOf('/'));\n}\n\nexport default null;\n"],"file":"url.js"}