@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.
Files changed (72) hide show
  1. package/bin/build.js +3 -3
  2. package/bin/setup.js +3 -3
  3. package/build/development/index.js +14 -0
  4. package/build/development/index.js.map +1 -1
  5. package/build/development/server/index.js +4 -4
  6. package/build/development/server/index.js.map +1 -1
  7. package/build/development/server/renderer.js +12 -12
  8. package/build/development/server/renderer.js.map +1 -1
  9. package/build/development/server/server.js +3 -3
  10. package/build/development/server/server.js.map +1 -1
  11. package/build/development/shared/components/Input/index.js.map +1 -1
  12. package/build/development/shared/components/PageLayout/index.js.map +1 -1
  13. package/build/development/shared/components/TextArea/index.js.map +1 -1
  14. package/build/development/shared/components/Throbber/index.js.map +1 -1
  15. package/build/development/shared/components/WithTooltip/Tooltip.js.map +1 -1
  16. package/build/development/shared/components/selectors/Switch/index.js.map +1 -1
  17. package/build/development/shared/components/selectors/common.js.map +1 -1
  18. package/build/development/shared/utils/index.js +6 -0
  19. package/build/development/shared/utils/index.js.map +1 -1
  20. package/build/development/shared/utils/jest/E2eSsrEnv.js +4 -4
  21. package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
  22. package/build/development/shared/utils/jest/index.js.map +1 -1
  23. package/build/development/shared/utils/webpack.js.map +1 -1
  24. package/build/development/web.bundle.js +2 -2
  25. package/build/production/index.js +1 -1
  26. package/build/production/index.js.map +1 -1
  27. package/build/production/server/index.js +2 -2
  28. package/build/production/server/index.js.map +1 -1
  29. package/build/production/server/renderer.js +7 -7
  30. package/build/production/server/renderer.js.map +1 -1
  31. package/build/production/server/server.js +2 -2
  32. package/build/production/server/server.js.map +1 -1
  33. package/build/production/shared/components/Input/index.js.map +1 -1
  34. package/build/production/shared/components/PageLayout/index.js.map +1 -1
  35. package/build/production/shared/components/TextArea/index.js.map +1 -1
  36. package/build/production/shared/components/Throbber/index.js.map +1 -1
  37. package/build/production/shared/components/WithTooltip/Tooltip.js.map +1 -1
  38. package/build/production/shared/components/selectors/Switch/index.js.map +1 -1
  39. package/build/production/shared/components/selectors/common.js.map +1 -1
  40. package/build/production/shared/utils/index.js +1 -1
  41. package/build/production/shared/utils/index.js.map +1 -1
  42. package/build/production/shared/utils/jest/E2eSsrEnv.js +4 -4
  43. package/build/production/shared/utils/jest/E2eSsrEnv.js.map +1 -1
  44. package/build/production/shared/utils/jest/index.js.map +1 -1
  45. package/build/production/shared/utils/webpack.js.map +1 -1
  46. package/build/production/web.bundle.js +1 -1
  47. package/build/production/web.bundle.js.map +1 -1
  48. package/build/types-code/index.d.ts +1 -1
  49. package/build/types-code/server/index.d.ts +1 -1
  50. package/build/types-code/shared/utils/index.d.ts +1 -1
  51. package/config/jest/default.js +1 -1
  52. package/config/webpack/app-base.d.ts +1 -1
  53. package/config/webpack/app-base.js +14 -14
  54. package/config/webpack/lib-base.js +5 -5
  55. package/config/webpack/lib-development.js +2 -2
  56. package/config/webpack/lib-production.js +2 -2
  57. package/package.json +8 -8
  58. package/src/index.ts +5 -2
  59. package/src/server/index.ts +5 -5
  60. package/src/server/renderer.tsx +8 -6
  61. package/src/server/server.ts +3 -4
  62. package/src/shared/components/Input/index.tsx +1 -4
  63. package/src/shared/components/PageLayout/index.tsx +1 -5
  64. package/src/shared/components/TextArea/index.tsx +1 -5
  65. package/src/shared/components/Throbber/index.tsx +1 -4
  66. package/src/shared/components/WithTooltip/Tooltip.ts +1 -5
  67. package/src/shared/components/selectors/Switch/index.tsx +1 -6
  68. package/src/shared/components/selectors/common.ts +1 -2
  69. package/src/shared/utils/index.ts +2 -0
  70. package/src/shared/utils/jest/E2eSsrEnv.ts +1 -1
  71. package/src/shared/utils/jest/index.ts +3 -2
  72. 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 { type Listener, type Theme, config, Barrier, Emitter, isomorphy, getSsrContext, Semaphore, splitComponent, themed, ThemeProvider, time, webpack, withRetries, } from './shared/utils';
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 };
@@ -1,5 +1,5 @@
1
1
  import 'source-map-support/register';
2
- import http from 'http';
2
+ import http from 'node:http';
3
3
  import 'raf/polyfill';
4
4
  import type { Configuration } from 'webpack';
5
5
  import { type OptionsT as ServerOptionsT, type ServerT, getDefaultCspSettings } from './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 & {
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable import/no-commonjs */
2
2
  /* global __dirname, module, process, require */
3
3
 
4
- const path = require('path');
4
+ const path = require('node:path');
5
5
 
6
6
  const globalLibDir = path.resolve(process.execPath, '../../lib/node_modules');
7
7
 
@@ -1,4 +1,4 @@
1
- import nodeFs from 'fs';
1
+ import nodeFs from 'node:fs';
2
2
  import { type Configuration, type RuleSetRule } from 'webpack';
3
3
  export type BuildInfoT = {
4
4
  key: string;
@@ -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 fs_1 = __importDefault(require("fs"));
9
- const path_1 = __importDefault(require("path"));
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 : fs_1.default;
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 = path_1.default.resolve(o.context, o.sitemap);
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 = path_1.default.resolve(o.context, o.outputPath);
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(path_1.default.resolve(o.context, o.outputPath, 'sitemap.xml'), new DataView(sitemap.buffer));
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 = path_1.default.resolve(o.context, '.build-info');
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: path_1.default.resolve(__dirname, '../workbox/default.js') }, o.workbox), { swDest: '__service-worker.js' })));
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: path_1.default.resolve(__dirname, o.context, o.outputPath),
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': path_1.default.resolve(o.context, 'node_modules/@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: path_1.default.resolve(o.context, 'src/assets'),
313
- components: path_1.default.resolve(o.context, 'src/shared/components'),
314
- fonts: path_1.default.resolve(o.context, 'src/assets/fonts'),
315
- styles: path_1.default.resolve(o.context, 'src/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 path_1 = __importDefault(require("path"));
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: path_1.default.resolve(ops.context, 'src/assets'),
152
- components: path_1.default.resolve(ops.context, 'src/shared/components'),
153
- fonts: path_1.default.resolve(ops.context, 'src/assets/fonts'),
154
- styles: path_1.default.resolve(ops.context, 'src/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 path_1 = __importDefault(require("path"));
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: path_1.default.resolve(__dirname, ops.context, 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 path_1 = __importDefault(require("path"));
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: path_1.default.resolve(__dirname, ops.context, 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.25",
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.0",
15
- "@dr.pogodin/react-global-state": "^0.19.2",
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.4",
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.8",
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.4",
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.4",
92
- "jest-environment-jsdom": "^30.0.4",
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
- type Listener,
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,
@@ -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
- expressServer: ServerT;
188
- httpServer: http.Server;
189
- }> {
187
+ expressServer: ServerT;
188
+ httpServer: http.Server;
189
+ }> {
190
190
  /* Options normalization. */
191
191
  const ops = cloneDeep(options);
192
192
 
@@ -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
- (req: Request, config: ConfigT) => BeforeRenderResT | Promise<BeforeRenderResT>;
258
+ export type BeforeRenderT = (
259
+ req: Request,
260
+ config: ConfigT,
261
+ ) => BeforeRenderResT | Promise<BeforeRenderResT>;
260
262
 
261
263
  type CacheRefT = {
262
264
  key: string;
@@ -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;
@@ -2,8 +2,7 @@
2
2
 
3
3
  import type { Theme } from '@dr.pogodin/react-themes';
4
4
 
5
- type ThemeKeyT =
6
- | 'active'
5
+ type ThemeKeyT = 'active'
7
6
  | 'arrow'
8
7
  | 'container'
9
8
  | 'dropdown'
@@ -11,7 +11,9 @@ import time from './time';
11
11
  import * as webpack from './webpack';
12
12
 
13
13
  export {
14
+ assertEmptyObject,
14
15
  type Listener,
16
+ type ObjectKey,
15
17
  Barrier,
16
18
  Cached,
17
19
  Emitter,
@@ -16,7 +16,7 @@
16
16
 
17
17
  // TODO: We need to add correct typing for environment options.
18
18
 
19
- import path from 'path';
19
+ import path from 'node:path';
20
20
 
21
21
  import type { Request, Response } from 'express';
22
22
  import { defaults, noop, set } from 'lodash';
@@ -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
- (config: AxiosRequestConfig) => Partial<AxiosResponse> | null | undefined;
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 PathT from 'path';
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 PathT;
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;