@dr.pogodin/react-utils 1.26.3 → 1.26.5
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.
- package/build/development/shared/components/Button/index.js +3 -1
- package/build/development/shared/components/Button/index.js.map +1 -1
- package/build/development/shared/components/Throbber/index.js +4 -4
- package/build/development/shared/components/Throbber/index.js.map +1 -1
- package/build/development/web.bundle.js +3 -3
- package/build/production/shared/components/Button/index.js +1 -1
- package/build/production/shared/components/Button/index.js.map +1 -1
- package/build/production/shared/components/Throbber/index.js +1 -1
- package/build/production/shared/components/Throbber/index.js.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/config/webpack/app-development.d.ts +2 -0
- package/config/webpack/app-development.js +1 -4
- package/config/webpack/app-production.d.ts +4 -1
- package/config/webpack/app-production.js +1 -4
- package/config/webpack/lib-base.d.ts +2 -0
- package/config/webpack/lib-base.js +1 -1
- package/config/webpack/lib-development.js +2 -1
- package/config/webpack/lib-production.js +2 -1
- package/package.json +41 -41
- package/src/shared/components/Button/index.tsx +4 -1
- package/src/shared/components/Throbber/index.tsx +4 -4
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
1
2
|
import webpack from 'webpack';
|
|
2
3
|
import { type OptionsT as BaseOptionsT } from './app-base';
|
|
3
4
|
type OptionsT = BaseOptionsT & {
|
|
4
5
|
dontUseHmr?: boolean;
|
|
5
6
|
dontUseReactGlobalStateDebugging?: boolean;
|
|
7
|
+
cssExtractionOptions?: MiniCssExtractPlugin.PluginOptions;
|
|
6
8
|
};
|
|
7
9
|
/**
|
|
8
10
|
* @param ops
|
|
@@ -28,10 +28,7 @@ function configFactory(ops) {
|
|
|
28
28
|
entry.push('webpack-hot-middleware/client?reload=true');
|
|
29
29
|
entry.push(...Array.isArray(o.entry) ? o.entry : [o.entry]);
|
|
30
30
|
const plugins = [
|
|
31
|
-
new mini_css_extract_plugin_1.default({
|
|
32
|
-
chunkFilename: '[id].css',
|
|
33
|
-
filename: '[id].css',
|
|
34
|
-
}),
|
|
31
|
+
new mini_css_extract_plugin_1.default(Object.assign({ chunkFilename: '[id].css', filename: '[id].css' }, ops.cssExtractionOptions)),
|
|
35
32
|
new webpack_1.default.DefinePlugin({
|
|
36
33
|
'process.env.BABEL_ENV': JSON.stringify('development'),
|
|
37
34
|
'process.env.DEV_TOOLS': JSON.stringify(true),
|
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
* @module webpack/app-production
|
|
4
4
|
* @desc Production Webpack configuration for applications.
|
|
5
5
|
*/
|
|
6
|
+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
6
7
|
import { type Configuration } from 'webpack';
|
|
7
8
|
import { type OptionsT as BaseOptionsT } from './app-base';
|
|
8
|
-
type OptionsT = BaseOptionsT
|
|
9
|
+
type OptionsT = BaseOptionsT & {
|
|
10
|
+
cssExtractionOptions?: MiniCssExtractPlugin.PluginOptions;
|
|
11
|
+
};
|
|
9
12
|
/**
|
|
10
13
|
* @param {object} ops
|
|
11
14
|
* @param {string} ops.context Base URL for resolution of relative config paths.
|
|
@@ -46,10 +46,7 @@ function configFactory(ops) {
|
|
|
46
46
|
'process.env.BABEL_ENV': JSON.stringify('production'),
|
|
47
47
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
48
48
|
}),
|
|
49
|
-
new mini_css_extract_plugin_1.default({
|
|
50
|
-
chunkFilename: '[contenthash].css',
|
|
51
|
-
filename: '[contenthash].css',
|
|
52
|
-
}),
|
|
49
|
+
new mini_css_extract_plugin_1.default(Object.assign({ chunkFilename: '[contenthash].css', filename: '[contenthash].css' }, ops.cssExtractionOptions)),
|
|
53
50
|
],
|
|
54
51
|
});
|
|
55
52
|
return res;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
1
2
|
import { type Configuration } from 'webpack';
|
|
2
3
|
export type OptionsT = {
|
|
3
4
|
babelEnv: string;
|
|
4
5
|
babelLoaderOptions?: object;
|
|
5
6
|
context: string;
|
|
7
|
+
cssExtractionOptions?: MiniCssExtractPlugin.PluginOptions;
|
|
6
8
|
cssLocalIdent?: string;
|
|
7
9
|
dontUseProgressPlugin?: boolean;
|
|
8
10
|
entry: string | string[];
|
|
@@ -17,7 +17,7 @@ const utils_1 = require("@dr.pogodin/babel-plugin-react-css-modules/utils");
|
|
|
17
17
|
*/
|
|
18
18
|
function configFactory(ops) {
|
|
19
19
|
const plugins = [
|
|
20
|
-
new mini_css_extract_plugin_1.default({ filename: 'style.css' }),
|
|
20
|
+
new mini_css_extract_plugin_1.default(Object.assign({ filename: 'style.css' }, ops.cssExtractionOptions)),
|
|
21
21
|
];
|
|
22
22
|
if (!ops.dontUseProgressPlugin)
|
|
23
23
|
plugins.push(new webpack_1.ProgressPlugin());
|
|
@@ -9,7 +9,8 @@ const webpack_1 = __importDefault(require("webpack"));
|
|
|
9
9
|
const webpack_merge_1 = require("webpack-merge");
|
|
10
10
|
const lib_base_1 = __importDefault(require("./lib-base"));
|
|
11
11
|
function configFactory(ops) {
|
|
12
|
-
|
|
12
|
+
const { outputPath = 'build/development' } = ops;
|
|
13
|
+
return (0, webpack_merge_1.merge)((0, lib_base_1.default)(Object.assign(Object.assign({}, ops), { babelEnv: 'development', cssLocalIdent: '[package]___[path][name]___[local]___[hash:base64:6]', mode: 'development', outputPath: path_1.default.resolve(__dirname, ops.context, outputPath) })), {
|
|
13
14
|
plugins: [
|
|
14
15
|
new webpack_1.default.DefinePlugin({
|
|
15
16
|
// Dev. build of the library wraps modules inside eval() statements,
|
|
@@ -10,7 +10,8 @@ const webpack_1 = __importDefault(require("webpack"));
|
|
|
10
10
|
const webpack_merge_1 = require("webpack-merge");
|
|
11
11
|
const lib_base_1 = __importDefault(require("./lib-base"));
|
|
12
12
|
function configFactory(ops) {
|
|
13
|
-
const
|
|
13
|
+
const { outputPath = 'build/production' } = ops;
|
|
14
|
+
const baseConfig = (0, lib_base_1.default)(Object.assign(Object.assign({}, ops), { babelEnv: 'production', cssLocalIdent: '[hash:base64:6]', mode: 'production', outputPath: path_1.default.resolve(__dirname, ops.context, outputPath) }));
|
|
14
15
|
return (0, webpack_merge_1.merge)(baseConfig, {
|
|
15
16
|
devtool: 'source-map',
|
|
16
17
|
optimization: {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.26.
|
|
2
|
+
"version": "1.26.5",
|
|
3
3
|
"bin": {
|
|
4
4
|
"react-utils-build": "bin/build.js",
|
|
5
5
|
"react-utils-setup": "bin/setup.js"
|
|
@@ -12,19 +12,19 @@
|
|
|
12
12
|
"@dr.pogodin/babel-plugin-react-css-modules": "^6.12.0",
|
|
13
13
|
"@dr.pogodin/csurf": "^1.13.0",
|
|
14
14
|
"@dr.pogodin/js-utils": "^0.0.6",
|
|
15
|
-
"@dr.pogodin/react-global-state": "^0.
|
|
15
|
+
"@dr.pogodin/react-global-state": "^0.11.0",
|
|
16
16
|
"@dr.pogodin/react-themes": "^1.5.1",
|
|
17
17
|
"@jest/environment": "^29.7.0",
|
|
18
|
-
"axios": "^1.
|
|
18
|
+
"axios": "^1.6.2",
|
|
19
19
|
"commander": "^11.1.0",
|
|
20
20
|
"compression": "^1.7.4",
|
|
21
21
|
"config": "^3.3.9",
|
|
22
|
-
"cookie": "^0.
|
|
22
|
+
"cookie": "^0.6.0",
|
|
23
23
|
"cookie-parser": "^1.4.6",
|
|
24
24
|
"cross-env": "^7.0.3",
|
|
25
25
|
"dayjs": "^1.11.10",
|
|
26
26
|
"express": "^4.18.2",
|
|
27
|
-
"helmet": "^7.
|
|
27
|
+
"helmet": "^7.1.0",
|
|
28
28
|
"http-status-codes": "^2.3.0",
|
|
29
29
|
"joi": "^17.11.0",
|
|
30
30
|
"lodash": "^4.17.21",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react": "^18.2.0",
|
|
37
37
|
"react-dom": "^18.2.0",
|
|
38
38
|
"react-helmet": "^6.1.0",
|
|
39
|
-
"react-router-dom": "^6.
|
|
39
|
+
"react-router-dom": "^6.19.0",
|
|
40
40
|
"request-ip": "^3.3.0",
|
|
41
41
|
"rimraf": "^5.0.5",
|
|
42
42
|
"serialize-javascript": "^6.0.1",
|
|
@@ -48,57 +48,57 @@
|
|
|
48
48
|
"description": "Collection of generic ReactJS components and utils",
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/cli": "^7.23.0",
|
|
51
|
-
"@babel/core": "^7.23.
|
|
52
|
-
"@babel/eslint-parser": "^7.
|
|
51
|
+
"@babel/core": "^7.23.3",
|
|
52
|
+
"@babel/eslint-parser": "^7.23.3",
|
|
53
53
|
"@babel/eslint-plugin": "^7.22.10",
|
|
54
54
|
"@babel/node": "^7.22.19",
|
|
55
|
-
"@babel/plugin-transform-runtime": "^7.23.
|
|
56
|
-
"@babel/preset-env": "^7.23.
|
|
57
|
-
"@babel/preset-react": "^7.
|
|
58
|
-
"@babel/preset-typescript": "^7.23.
|
|
55
|
+
"@babel/plugin-transform-runtime": "^7.23.3",
|
|
56
|
+
"@babel/preset-env": "^7.23.3",
|
|
57
|
+
"@babel/preset-react": "^7.23.3",
|
|
58
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
59
59
|
"@babel/register": "^7.22.15",
|
|
60
60
|
"@dr.pogodin/babel-plugin-transform-assets": "^1.2.2",
|
|
61
61
|
"@dr.pogodin/babel-preset-svgr": "^1.8.0",
|
|
62
62
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
|
|
63
63
|
"@tsconfig/recommended": "^1.0.2",
|
|
64
64
|
"@tsd/typescript": "^5.1.6",
|
|
65
|
-
"@types/compression": "^1.7.
|
|
66
|
-
"@types/config": "^3.3.
|
|
67
|
-
"@types/cookie": "^0.5.
|
|
68
|
-
"@types/cookie-parser": "^1.4.
|
|
69
|
-
"@types/csurf": "^1.11.
|
|
70
|
-
"@types/express": "^4.17.
|
|
71
|
-
"@types/jest": "^29.5.
|
|
72
|
-
"@types/lodash": "^4.14.
|
|
73
|
-
"@types/morgan": "^1.9.
|
|
74
|
-
"@types/node-forge": "^1.3.
|
|
75
|
-
"@types/pretty": "^2.0.
|
|
76
|
-
"@types/react": "^18.2.
|
|
77
|
-
"@types/react-dom": "^18.2.
|
|
78
|
-
"@types/react-helmet": "^6.1.
|
|
79
|
-
"@types/react-test-renderer": "^18.0.
|
|
80
|
-
"@types/request-ip": "^0.0.
|
|
81
|
-
"@types/serialize-javascript": "^5.0.
|
|
82
|
-
"@types/serve-favicon": "^2.5.
|
|
83
|
-
"@types/supertest": "^2.0.
|
|
84
|
-
"@types/uuid": "^9.0.
|
|
85
|
-
"@types/webpack": "^5.28.
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
87
|
-
"@typescript-eslint/parser": "^6.
|
|
65
|
+
"@types/compression": "^1.7.5",
|
|
66
|
+
"@types/config": "^3.3.3",
|
|
67
|
+
"@types/cookie": "^0.5.4",
|
|
68
|
+
"@types/cookie-parser": "^1.4.6",
|
|
69
|
+
"@types/csurf": "^1.11.5",
|
|
70
|
+
"@types/express": "^4.17.21",
|
|
71
|
+
"@types/jest": "^29.5.8",
|
|
72
|
+
"@types/lodash": "^4.14.201",
|
|
73
|
+
"@types/morgan": "^1.9.9",
|
|
74
|
+
"@types/node-forge": "^1.3.9",
|
|
75
|
+
"@types/pretty": "^2.0.3",
|
|
76
|
+
"@types/react": "^18.2.37",
|
|
77
|
+
"@types/react-dom": "^18.2.15",
|
|
78
|
+
"@types/react-helmet": "^6.1.9",
|
|
79
|
+
"@types/react-test-renderer": "^18.0.6",
|
|
80
|
+
"@types/request-ip": "^0.0.41",
|
|
81
|
+
"@types/serialize-javascript": "^5.0.4",
|
|
82
|
+
"@types/serve-favicon": "^2.5.7",
|
|
83
|
+
"@types/supertest": "^2.0.16",
|
|
84
|
+
"@types/uuid": "^9.0.7",
|
|
85
|
+
"@types/webpack": "^5.28.5",
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
|
87
|
+
"@typescript-eslint/parser": "^6.11.0",
|
|
88
88
|
"autoprefixer": "^10.4.16",
|
|
89
89
|
"babel-jest": "^29.7.0",
|
|
90
90
|
"babel-loader": "^9.1.3",
|
|
91
91
|
"babel-plugin-module-resolver": "^5.0.0",
|
|
92
|
-
"core-js": "^3.33.
|
|
92
|
+
"core-js": "^3.33.3",
|
|
93
93
|
"css-loader": "^6.8.1",
|
|
94
94
|
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
95
|
-
"eslint": "^8.
|
|
95
|
+
"eslint": "^8.54.0",
|
|
96
96
|
"eslint-config-airbnb": "^19.0.4",
|
|
97
97
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
98
98
|
"eslint-import-resolver-babel-module": "^5.3.2",
|
|
99
99
|
"eslint-plugin-import": "^2.29.0",
|
|
100
|
-
"eslint-plugin-jest": "^27.
|
|
101
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
100
|
+
"eslint-plugin-jest": "^27.6.0",
|
|
101
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
102
102
|
"eslint-plugin-react": "^7.33.2",
|
|
103
103
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
104
104
|
"identity-obj-proxy": "^3.0.0",
|
|
@@ -116,11 +116,11 @@
|
|
|
116
116
|
"react-test-renderer": "^18.2.0",
|
|
117
117
|
"regenerator-runtime": "^0.14.0",
|
|
118
118
|
"resolve-url-loader": "^5.0.0",
|
|
119
|
-
"sass": "^1.69.
|
|
119
|
+
"sass": "^1.69.5",
|
|
120
120
|
"sass-loader": "^13.3.2",
|
|
121
121
|
"sitemap": "^7.1.1",
|
|
122
122
|
"stylelint": "^15.11.0",
|
|
123
|
-
"stylelint-config-standard-scss": "^11.
|
|
123
|
+
"stylelint-config-standard-scss": "^11.1.0",
|
|
124
124
|
"supertest": "^6.3.3",
|
|
125
125
|
"tsc-alias": "^1.8.8",
|
|
126
126
|
"typed-scss-modules": "^7.1.4",
|
|
@@ -65,11 +65,14 @@ const BaseButton: React.FunctionComponent<PropsT> = ({
|
|
|
65
65
|
</Link>
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
+
|
|
68
69
|
return (
|
|
69
70
|
<div
|
|
70
71
|
className={className}
|
|
71
72
|
onClick={onClick}
|
|
72
|
-
onKeyDown={onClick
|
|
73
|
+
onKeyDown={onClick && ((e) => {
|
|
74
|
+
if (e.key === 'Enter') onClick(e);
|
|
75
|
+
})}
|
|
73
76
|
onMouseDown={onMouseDown}
|
|
74
77
|
role="button"
|
|
75
78
|
tabIndex={0}
|
|
@@ -20,10 +20,10 @@ type PropsT = {
|
|
|
20
20
|
* [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)
|
|
21
21
|
*/
|
|
22
22
|
const Throbber: React.FunctionComponent<PropsT> = ({ theme }) => (
|
|
23
|
-
<span className={theme.container}
|
|
24
|
-
<span className={theme.circle}
|
|
25
|
-
<span className={theme.circle}
|
|
26
|
-
<span className={theme.circle}
|
|
23
|
+
<span className={theme.container}>
|
|
24
|
+
<span className={theme.circle} />
|
|
25
|
+
<span className={theme.circle} />
|
|
26
|
+
<span className={theme.circle} />
|
|
27
27
|
</span>
|
|
28
28
|
);
|
|
29
29
|
|