@dr.pogodin/react-utils 1.43.25 → 1.43.27
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/bin/build.js +3 -3
- package/bin/setup.js +3 -3
- package/build/development/index.js +14 -0
- package/build/development/index.js.map +1 -1
- package/build/development/server/index.js +4 -4
- package/build/development/server/index.js.map +1 -1
- package/build/development/server/renderer.js +12 -12
- package/build/development/server/renderer.js.map +1 -1
- package/build/development/server/server.js +3 -3
- package/build/development/server/server.js.map +1 -1
- package/build/development/shared/components/Input/index.js.map +1 -1
- package/build/development/shared/components/PageLayout/index.js.map +1 -1
- package/build/development/shared/components/TextArea/index.js.map +1 -1
- package/build/development/shared/components/Throbber/index.js.map +1 -1
- package/build/development/shared/components/WithTooltip/Tooltip.js.map +1 -1
- package/build/development/shared/components/selectors/Switch/index.js.map +1 -1
- package/build/development/shared/components/selectors/common.js.map +1 -1
- package/build/development/shared/utils/index.js +6 -0
- package/build/development/shared/utils/index.js.map +1 -1
- package/build/development/shared/utils/jest/E2eSsrEnv.js +4 -4
- package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
- package/build/development/shared/utils/jest/index.js.map +1 -1
- package/build/development/shared/utils/webpack.js.map +1 -1
- package/build/development/web.bundle.js +2 -2
- package/build/production/index.js +1 -1
- package/build/production/index.js.map +1 -1
- package/build/production/server/index.js +2 -2
- package/build/production/server/index.js.map +1 -1
- package/build/production/server/renderer.js +7 -7
- package/build/production/server/renderer.js.map +1 -1
- package/build/production/server/server.js +2 -2
- package/build/production/server/server.js.map +1 -1
- package/build/production/shared/components/Input/index.js.map +1 -1
- package/build/production/shared/components/PageLayout/index.js.map +1 -1
- package/build/production/shared/components/TextArea/index.js.map +1 -1
- package/build/production/shared/components/Throbber/index.js.map +1 -1
- package/build/production/shared/components/WithTooltip/Tooltip.js.map +1 -1
- package/build/production/shared/components/selectors/Switch/index.js.map +1 -1
- package/build/production/shared/components/selectors/common.js.map +1 -1
- package/build/production/shared/utils/index.js +1 -1
- package/build/production/shared/utils/index.js.map +1 -1
- package/build/production/shared/utils/jest/E2eSsrEnv.js +4 -4
- package/build/production/shared/utils/jest/E2eSsrEnv.js.map +1 -1
- package/build/production/shared/utils/jest/index.js.map +1 -1
- package/build/production/shared/utils/webpack.js.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/index.d.ts +1 -1
- package/build/types-code/server/index.d.ts +1 -1
- package/build/types-code/shared/utils/index.d.ts +1 -1
- package/config/jest/default.js +1 -1
- package/config/webpack/app-base.d.ts +1 -1
- package/config/webpack/app-base.js +14 -14
- package/config/webpack/lib-base.js +5 -5
- package/config/webpack/lib-development.js +2 -2
- package/config/webpack/lib-production.js +2 -2
- package/package.json +8 -8
- package/src/index.ts +5 -2
- package/src/server/index.ts +5 -5
- package/src/server/renderer.tsx +8 -6
- package/src/server/server.ts +3 -4
- package/src/shared/components/Input/index.tsx +1 -4
- package/src/shared/components/PageLayout/index.tsx +1 -5
- package/src/shared/components/TextArea/index.tsx +1 -5
- package/src/shared/components/Throbber/index.tsx +1 -4
- package/src/shared/components/WithTooltip/Tooltip.ts +1 -5
- package/src/shared/components/selectors/Switch/index.tsx +1 -6
- package/src/shared/components/selectors/common.ts +1 -2
- package/src/shared/utils/index.ts +2 -0
- package/src/shared/utils/jest/E2eSsrEnv.ts +1 -1
- package/src/shared/utils/jest/index.ts +3 -2
- package/src/shared/utils/webpack.ts +2 -2
|
@@ -6,5 +6,5 @@ declare const client: typeof ClientM.default | undefined;
|
|
|
6
6
|
export { type AsyncCollectionT, type AsyncCollectionLoaderT, type AsyncDataEnvelopeT, type AsyncDataLoaderT, type ForceT, type UseAsyncDataOptionsT, type UseAsyncDataResT, type UseGlobalStateResT, type ValueOrInitializerT, getGlobalState, GlobalStateProvider, newAsyncDataEnvelope, useAsyncCollection, useAsyncData, useGlobalState, withGlobalStateType, } from '@dr.pogodin/react-global-state';
|
|
7
7
|
export * from './shared/components';
|
|
8
8
|
export { type BeforeRenderResT, type BeforeRenderT, type ConfigT, type ServerSsrContext, type ServerT, } from './server';
|
|
9
|
-
export {
|
|
9
|
+
export { assertEmptyObject, config, Barrier, Cached, Emitter, isomorphy, getSsrContext, type Listener, type ObjectKey, Semaphore, splitComponent, type Theme, themed, ThemeProvider, time, webpack, withRetries, } from './shared/utils';
|
|
10
10
|
export { client, server };
|
|
@@ -3,7 +3,7 @@ import config from './config';
|
|
|
3
3
|
import * as isomorphy from './isomorphy';
|
|
4
4
|
import time from './time';
|
|
5
5
|
import * as webpack from './webpack';
|
|
6
|
-
export { type Listener, Barrier, Cached, Emitter, Semaphore, withRetries, } from '@dr.pogodin/js-utils';
|
|
6
|
+
export { assertEmptyObject, type Listener, type ObjectKey, Barrier, Cached, Emitter, Semaphore, withRetries, } from '@dr.pogodin/js-utils';
|
|
7
7
|
export { getSsrContext } from './globalState';
|
|
8
8
|
export { default as splitComponent } from './splitComponent';
|
|
9
9
|
type ThemedT = typeof themedImpl & {
|
package/config/jest/default.js
CHANGED
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.default = configFactory;
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const sitemap_1 = __importDefault(require("sitemap"));
|
|
11
11
|
const lodash_1 = require("lodash");
|
|
12
12
|
const autoprefixer_1 = __importDefault(require("autoprefixer"));
|
|
@@ -132,13 +132,13 @@ function configFactory(ops) {
|
|
|
132
132
|
outputPath: 'build/web-public',
|
|
133
133
|
publicPath: '',
|
|
134
134
|
});
|
|
135
|
-
const fs = (_a = ops.fs) !== null && _a !== void 0 ? _a :
|
|
135
|
+
const fs = (_a = ops.fs) !== null && _a !== void 0 ? _a : node_fs_1.default;
|
|
136
136
|
// TODO: Should it be improved and re-validated? Are we using it in any project
|
|
137
137
|
// as is?
|
|
138
138
|
/* TODO: This works in practice, but being async and not awaited it is a bad
|
|
139
139
|
* pattern. */
|
|
140
140
|
if (o.sitemap) {
|
|
141
|
-
const sitemapUrl =
|
|
141
|
+
const sitemapUrl = node_path_1.default.resolve(o.context, o.sitemap);
|
|
142
142
|
// eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-require-imports
|
|
143
143
|
let source = require(sitemapUrl);
|
|
144
144
|
if ((0, lodash_1.isFunction)(source))
|
|
@@ -147,10 +147,10 @@ function configFactory(ops) {
|
|
|
147
147
|
source.forEach((item) => sm.write(item));
|
|
148
148
|
sm.end();
|
|
149
149
|
void sitemap_1.default.streamToPromise(sm).then((sitemap) => {
|
|
150
|
-
const outUrl =
|
|
150
|
+
const outUrl = node_path_1.default.resolve(o.context, o.outputPath);
|
|
151
151
|
if (!fs.existsSync(outUrl))
|
|
152
152
|
fs.mkdirSync(outUrl);
|
|
153
|
-
fs.writeFileSync(
|
|
153
|
+
fs.writeFileSync(node_path_1.default.resolve(o.context, o.outputPath, 'sitemap.xml'), new DataView(sitemap.buffer));
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
// TODO: Once all assets are named by hashes, we probably don't need build
|
|
@@ -159,7 +159,7 @@ function configFactory(ops) {
|
|
|
159
159
|
// timestamp, and any other similar information to the actual app, so it
|
|
160
160
|
// can be used in some scenarious.
|
|
161
161
|
let buildInfo;
|
|
162
|
-
const buildInfoUrl =
|
|
162
|
+
const buildInfoUrl = node_path_1.default.resolve(o.context, '.build-info');
|
|
163
163
|
if (o.keepBuildInfo) {
|
|
164
164
|
// If "true" - attempt to load from the filesystem.
|
|
165
165
|
if (o.keepBuildInfo === true) {
|
|
@@ -209,7 +209,7 @@ function configFactory(ops) {
|
|
|
209
209
|
if (o.workbox) {
|
|
210
210
|
if (!(0, lodash_1.isObject)(o.workbox))
|
|
211
211
|
o.workbox = {};
|
|
212
|
-
plugins.push(new workbox_webpack_plugin_1.default.InjectManifest(Object.assign(Object.assign({ swSrc:
|
|
212
|
+
plugins.push(new workbox_webpack_plugin_1.default.InjectManifest(Object.assign(Object.assign({ swSrc: node_path_1.default.resolve(__dirname, '../workbox/default.js') }, o.workbox), { swDest: '__service-worker.js' })));
|
|
213
213
|
}
|
|
214
214
|
return {
|
|
215
215
|
context: o.context,
|
|
@@ -296,7 +296,7 @@ function configFactory(ops) {
|
|
|
296
296
|
output: {
|
|
297
297
|
chunkFilename: '[contenthash].js',
|
|
298
298
|
filename: '[contenthash].js',
|
|
299
|
-
path:
|
|
299
|
+
path: node_path_1.default.resolve(__dirname, o.context, o.outputPath),
|
|
300
300
|
publicPath: `${o.publicPath}/`,
|
|
301
301
|
},
|
|
302
302
|
plugins,
|
|
@@ -307,12 +307,12 @@ function configFactory(ops) {
|
|
|
307
307
|
// (without this alias it is resolved to
|
|
308
308
|
// @babel/runtime/helpers/esm/interopRequireDefault, which has
|
|
309
309
|
// the hepler function attached to "default" export).
|
|
310
|
-
'@babel/runtime/helpers/interopRequireDefault':
|
|
310
|
+
'@babel/runtime/helpers/interopRequireDefault': node_path_1.default.resolve(o.context, 'node_modules/@babel/runtime/helpers/interopRequireDefault'),
|
|
311
311
|
// Aliases to JS an JSX files are handled by Babel.
|
|
312
|
-
assets:
|
|
313
|
-
components:
|
|
314
|
-
fonts:
|
|
315
|
-
styles:
|
|
312
|
+
assets: node_path_1.default.resolve(o.context, 'src/assets'),
|
|
313
|
+
components: node_path_1.default.resolve(o.context, 'src/shared/components'),
|
|
314
|
+
fonts: node_path_1.default.resolve(o.context, 'src/assets/fonts'),
|
|
315
|
+
styles: node_path_1.default.resolve(o.context, 'src/styles'),
|
|
316
316
|
},
|
|
317
317
|
// NOTE: This is primarily motivated by the issue #413
|
|
318
318
|
// https://github.com/birdofpreyru/react-utils/issues/413
|
|
@@ -6,7 +6,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.default = configFactory;
|
|
8
8
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
9
|
-
const
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const autoprefixer_1 = __importDefault(require("autoprefixer"));
|
|
11
11
|
const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
|
|
12
12
|
const webpack_1 = require("webpack");
|
|
@@ -148,10 +148,10 @@ function configFactory(ops) {
|
|
|
148
148
|
resolve: {
|
|
149
149
|
alias: {
|
|
150
150
|
/* Aliases to JS an JSX files are handled by Babel. */
|
|
151
|
-
assets:
|
|
152
|
-
components:
|
|
153
|
-
fonts:
|
|
154
|
-
styles:
|
|
151
|
+
assets: node_path_1.default.resolve(ops.context, 'src/assets'),
|
|
152
|
+
components: node_path_1.default.resolve(ops.context, 'src/shared/components'),
|
|
153
|
+
fonts: node_path_1.default.resolve(ops.context, 'src/assets/fonts'),
|
|
154
|
+
styles: node_path_1.default.resolve(ops.context, 'src/styles'),
|
|
155
155
|
},
|
|
156
156
|
extensions: [
|
|
157
157
|
'.ts',
|
|
@@ -6,13 +6,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.default = configFactory;
|
|
8
8
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
9
|
-
const
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const webpack_1 = __importDefault(require("webpack"));
|
|
11
11
|
const webpack_merge_1 = require("webpack-merge");
|
|
12
12
|
const lib_base_1 = __importDefault(require("./lib-base"));
|
|
13
13
|
function configFactory(ops) {
|
|
14
14
|
const { outputPath = 'build/development' } = ops;
|
|
15
|
-
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:
|
|
15
|
+
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: node_path_1.default.resolve(__dirname, ops.context, outputPath) })), {
|
|
16
16
|
plugins: [
|
|
17
17
|
new webpack_1.default.DefinePlugin({
|
|
18
18
|
// Dev. build of the library wraps modules inside eval() statements,
|
|
@@ -6,14 +6,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.default = configFactory;
|
|
8
8
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
9
|
-
const
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const css_minimizer_webpack_plugin_1 = __importDefault(require("css-minimizer-webpack-plugin"));
|
|
11
11
|
const webpack_1 = __importDefault(require("webpack"));
|
|
12
12
|
const webpack_merge_1 = require("webpack-merge");
|
|
13
13
|
const lib_base_1 = __importDefault(require("./lib-base"));
|
|
14
14
|
function configFactory(ops) {
|
|
15
15
|
const { outputPath = 'build/production' } = ops;
|
|
16
|
-
const baseConfig = (0, lib_base_1.default)(Object.assign(Object.assign({}, ops), { babelEnv: 'production', cssLocalIdent: '[hash:base64:6]', mode: 'production', outputPath:
|
|
16
|
+
const baseConfig = (0, lib_base_1.default)(Object.assign(Object.assign({}, ops), { babelEnv: 'production', cssLocalIdent: '[hash:base64:6]', mode: 'production', outputPath: node_path_1.default.resolve(__dirname, ops.context, outputPath) }));
|
|
17
17
|
return (0, webpack_merge_1.merge)(baseConfig, {
|
|
18
18
|
devtool: 'source-map',
|
|
19
19
|
optimization: {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.43.
|
|
2
|
+
"version": "1.43.27",
|
|
3
3
|
"bin": {
|
|
4
4
|
"react-utils-build": "bin/build.js",
|
|
5
5
|
"react-utils-setup": "bin/setup.js"
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"@babel/runtime": "^7.27.4",
|
|
12
12
|
"@dr.pogodin/babel-plugin-react-css-modules": "^6.13.6",
|
|
13
13
|
"@dr.pogodin/csurf": "^1.16.5",
|
|
14
|
-
"@dr.pogodin/js-utils": "^0.1.
|
|
15
|
-
"@dr.pogodin/react-global-state": "^0.19.
|
|
14
|
+
"@dr.pogodin/js-utils": "^0.1.1",
|
|
15
|
+
"@dr.pogodin/react-global-state": "^0.19.3",
|
|
16
16
|
"@dr.pogodin/react-helmet": "^3.0.2",
|
|
17
17
|
"@dr.pogodin/react-themes": "^1.9.2",
|
|
18
|
-
"@jest/environment": "^30.0.
|
|
18
|
+
"@jest/environment": "^30.0.5",
|
|
19
19
|
"axios": "^1.10.0",
|
|
20
20
|
"commander": "^14.0.0",
|
|
21
21
|
"compression": "^1.8.1",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@babel/register": "^7.27.1",
|
|
57
57
|
"@dr.pogodin/babel-plugin-transform-assets": "^1.2.5",
|
|
58
58
|
"@dr.pogodin/babel-preset-svgr": "^1.9.1",
|
|
59
|
-
"@dr.pogodin/eslint-configs": "^0.0.
|
|
59
|
+
"@dr.pogodin/eslint-configs": "^0.0.9",
|
|
60
60
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.1",
|
|
61
61
|
"@testing-library/dom": "^10.4.0",
|
|
62
62
|
"@testing-library/react": "^16.3.0",
|
|
@@ -81,15 +81,15 @@
|
|
|
81
81
|
"@types/webpack": "^5.28.5",
|
|
82
82
|
"@types/webpack-hot-middleware": "^2.25.9",
|
|
83
83
|
"autoprefixer": "^10.4.21",
|
|
84
|
-
"babel-jest": "^30.0.
|
|
84
|
+
"babel-jest": "^30.0.5",
|
|
85
85
|
"babel-loader": "^10.0.0",
|
|
86
86
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
87
87
|
"core-js": "^3.44.0",
|
|
88
88
|
"css-loader": "^7.1.2",
|
|
89
89
|
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
90
90
|
"identity-obj-proxy": "^3.0.0",
|
|
91
|
-
"jest": "^30.0.
|
|
92
|
-
"jest-environment-jsdom": "^30.0.
|
|
91
|
+
"jest": "^30.0.5",
|
|
92
|
+
"jest-environment-jsdom": "^30.0.5",
|
|
93
93
|
"memfs": "^4.17.2",
|
|
94
94
|
"mini-css-extract-plugin": "^2.9.2",
|
|
95
95
|
"mockdate": "^3.0.5",
|
package/src/index.ts
CHANGED
|
@@ -51,15 +51,18 @@ export {
|
|
|
51
51
|
} from './server';
|
|
52
52
|
|
|
53
53
|
export {
|
|
54
|
-
|
|
55
|
-
type Theme,
|
|
54
|
+
assertEmptyObject,
|
|
56
55
|
config,
|
|
57
56
|
Barrier,
|
|
57
|
+
Cached,
|
|
58
58
|
Emitter,
|
|
59
59
|
isomorphy,
|
|
60
60
|
getSsrContext,
|
|
61
|
+
type Listener,
|
|
62
|
+
type ObjectKey,
|
|
61
63
|
Semaphore,
|
|
62
64
|
splitComponent,
|
|
65
|
+
type Theme,
|
|
63
66
|
themed,
|
|
64
67
|
ThemeProvider,
|
|
65
68
|
time,
|
package/src/server/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-unassigned-import
|
|
2
2
|
import 'source-map-support/register';
|
|
3
3
|
|
|
4
|
-
import http from 'http';
|
|
5
|
-
import https from 'https';
|
|
4
|
+
import http from 'node:http';
|
|
5
|
+
import https from 'node:https';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
cloneDeep,
|
|
@@ -184,9 +184,9 @@ export default async function launchServer(
|
|
|
184
184
|
webpackConfig: Configuration,
|
|
185
185
|
options: OptionsT = {},
|
|
186
186
|
): Promise<{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
expressServer: ServerT;
|
|
188
|
+
httpServer: http.Server;
|
|
189
|
+
}> {
|
|
190
190
|
/* Options normalization. */
|
|
191
191
|
const ops = cloneDeep(options);
|
|
192
192
|
|
package/src/server/renderer.tsx
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* ExpressJS middleware for server-side rendering of a ReactJS app.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import fs from 'fs';
|
|
6
|
-
import path from 'path';
|
|
7
|
-
import { Writable } from 'stream';
|
|
8
|
-
import { brotliCompress, brotliDecompress } from 'zlib';
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { Writable } from 'node:stream';
|
|
8
|
+
import { brotliCompress, brotliDecompress } from 'node:zlib';
|
|
9
9
|
|
|
10
10
|
import type { Request, RequestHandler } from 'express';
|
|
11
11
|
import type { ComponentType } from 'react';
|
|
@@ -255,8 +255,10 @@ export type BeforeRenderResT = {
|
|
|
255
255
|
initialState?: unknown;
|
|
256
256
|
};
|
|
257
257
|
|
|
258
|
-
export type BeforeRenderT =
|
|
259
|
-
|
|
258
|
+
export type BeforeRenderT = (
|
|
259
|
+
req: Request,
|
|
260
|
+
config: ConfigT,
|
|
261
|
+
) => BeforeRenderResT | Promise<BeforeRenderResT>;
|
|
260
262
|
|
|
261
263
|
type CacheRefT = {
|
|
262
264
|
key: string;
|
package/src/server/server.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Creation of standard ExpressJS server for ReactJS apps.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { sep } from 'path';
|
|
6
|
-
import { pathToFileURL } from 'url';
|
|
5
|
+
import { sep } from 'node:path';
|
|
6
|
+
import { pathToFileURL } from 'node:url';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
cloneDeep,
|
|
@@ -43,8 +43,7 @@ import {
|
|
|
43
43
|
newError,
|
|
44
44
|
} from './utils/errors';
|
|
45
45
|
|
|
46
|
-
export type CspOptionsT =
|
|
47
|
-
Exclude<HelmetOptions['contentSecurityPolicy'], boolean | undefined>;
|
|
46
|
+
export type CspOptionsT = Exclude<HelmetOptions['contentSecurityPolicy'], boolean | undefined>;
|
|
48
47
|
|
|
49
48
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
50
49
|
interface RequestT extends Request {
|
|
@@ -4,10 +4,7 @@ import themed, { type Theme } from '@dr.pogodin/react-themes';
|
|
|
4
4
|
|
|
5
5
|
import defaultTheme from './theme.scss';
|
|
6
6
|
|
|
7
|
-
type ThemeKeyT =
|
|
8
|
-
| 'container'
|
|
9
|
-
| 'input'
|
|
10
|
-
| 'label';
|
|
7
|
+
type ThemeKeyT = 'container' | 'input' | 'label';
|
|
11
8
|
|
|
12
9
|
type PropsT = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
13
10
|
label?: React.ReactNode;
|
|
@@ -4,11 +4,7 @@ import themed, { type Theme } from '@dr.pogodin/react-themes';
|
|
|
4
4
|
|
|
5
5
|
import baseTheme from './base-theme.scss';
|
|
6
6
|
|
|
7
|
-
type ThemeKeyT =
|
|
8
|
-
| 'container'
|
|
9
|
-
| 'leftSidePanel'
|
|
10
|
-
| 'mainPanel'
|
|
11
|
-
| 'rightSidePanel'
|
|
7
|
+
type ThemeKeyT = 'container' | 'leftSidePanel' | 'mainPanel' | 'rightSidePanel'
|
|
12
8
|
| 'sidePanel';
|
|
13
9
|
|
|
14
10
|
type PropsT = {
|
|
@@ -13,11 +13,7 @@ import themed, { type Theme } from '@dr.pogodin/react-themes';
|
|
|
13
13
|
|
|
14
14
|
import defaultTheme from './style.scss';
|
|
15
15
|
|
|
16
|
-
type ThemeKeyT =
|
|
17
|
-
| 'container'
|
|
18
|
-
| 'hidden'
|
|
19
|
-
| 'label'
|
|
20
|
-
| 'textarea';
|
|
16
|
+
type ThemeKeyT = 'container' | 'hidden' | 'label' | 'textarea';
|
|
21
17
|
|
|
22
18
|
type Props = {
|
|
23
19
|
disabled?: boolean;
|
|
@@ -2,10 +2,7 @@ import themed, { type Theme } from '@dr.pogodin/react-themes';
|
|
|
2
2
|
|
|
3
3
|
import defaultTheme from './theme.scss';
|
|
4
4
|
|
|
5
|
-
type ThemeKeyT =
|
|
6
|
-
| 'bouncing'
|
|
7
|
-
| 'circle'
|
|
8
|
-
| 'container';
|
|
5
|
+
type ThemeKeyT = 'bouncing' | 'circle' | 'container';
|
|
9
6
|
|
|
10
7
|
type PropsT = {
|
|
11
8
|
theme: Theme<ThemeKeyT>;
|
|
@@ -54,11 +54,7 @@ type HeapT = {
|
|
|
54
54
|
lastPlacement?: PLACEMENTS | undefined;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
export type ThemeKeysT =
|
|
58
|
-
| 'appearance'
|
|
59
|
-
| 'arrow'
|
|
60
|
-
| 'content'
|
|
61
|
-
| 'container';
|
|
57
|
+
export type ThemeKeysT = 'appearance' | 'arrow' | 'content' | 'container';
|
|
62
58
|
|
|
63
59
|
type TooltipThemeT = Theme<ThemeKeysT>;
|
|
64
60
|
|
|
@@ -8,12 +8,7 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import defaultTheme from './theme.scss';
|
|
10
10
|
|
|
11
|
-
type ThemeKeyT =
|
|
12
|
-
| 'container'
|
|
13
|
-
| 'label'
|
|
14
|
-
| 'option'
|
|
15
|
-
| 'options'
|
|
16
|
-
| 'selected';
|
|
11
|
+
type ThemeKeyT = 'container' | 'label' | 'option' | 'options' | 'selected';
|
|
17
12
|
|
|
18
13
|
type PropsT = {
|
|
19
14
|
label?: React.ReactNode;
|
|
@@ -55,8 +55,9 @@ export function getMockUuid(seed = 0): string {
|
|
|
55
55
|
return `${x.slice(0, 8)}-${x.slice(8, 12)}-${x.slice(12, 16)}-${x.slice(16, 20)}-${x.slice(20)}`;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export type AxiosRequestHandlerT =
|
|
59
|
-
|
|
58
|
+
export type AxiosRequestHandlerT = (
|
|
59
|
+
config: AxiosRequestConfig,
|
|
60
|
+
) => Partial<AxiosResponse> | null | undefined;
|
|
60
61
|
|
|
61
62
|
export function mockAxios(handlers: AxiosRequestHandlerT[]): AxiosStatic {
|
|
62
63
|
const axios: AxiosStatic = jest.requireActual('axios');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type PathNS from 'node:path';
|
|
2
2
|
|
|
3
3
|
import { IS_CLIENT_SIDE } from './isomorphy';
|
|
4
4
|
|
|
@@ -30,7 +30,7 @@ export function requireWeak<T extends object>(
|
|
|
30
30
|
const req = eval('require') as (path: string) => unknown;
|
|
31
31
|
|
|
32
32
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
33
|
-
const { resolve } = req('path') as typeof
|
|
33
|
+
const { resolve } = req('path') as typeof PathNS;
|
|
34
34
|
|
|
35
35
|
const path = basePath ? resolve(basePath, modulePath) : modulePath;
|
|
36
36
|
const module = req(path) as T;
|