@dr.pogodin/react-utils 1.33.1 → 1.33.3
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/server/index.js +2 -0
- package/build/development/server/index.js.map +1 -1
- package/build/development/shared/components/Checkbox/index.js +1 -0
- package/build/development/shared/components/Checkbox/index.js.map +1 -1
- package/build/development/shared/components/selectors/Switch/index.js +3 -3
- package/build/development/shared/components/selectors/Switch/index.js.map +1 -1
- package/build/development/shared/utils/webpack.js +5 -2
- package/build/development/shared/utils/webpack.js.map +1 -1
- package/build/development/style.css +3 -3
- package/build/development/web.bundle.js +4 -4
- package/build/production/server/index.js +1 -1
- package/build/production/server/index.js.map +1 -1
- package/build/production/shared/components/Checkbox/index.js +1 -1
- package/build/production/shared/components/Checkbox/index.js.map +1 -1
- package/build/production/shared/components/selectors/Switch/index.js +1 -1
- package/build/production/shared/components/selectors/Switch/index.js.map +1 -1
- package/build/production/shared/utils/webpack.js +1 -1
- package/build/production/shared/utils/webpack.js.map +1 -1
- package/build/production/style.css +1 -1
- package/build/production/style.css.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/server/index.d.ts +5 -3
- package/build/types-code/shared/components/selectors/Switch/index.d.ts +1 -1
- package/build/types-scss/src/shared/components/selectors/Switch/theme.scss.d.ts +1 -0
- package/config/webpack/app-base.js +4 -7
- package/config/webpack/lib-base.js +4 -7
- package/package.json +3 -3
- package/src/server/index.ts +9 -5
- package/src/shared/components/Checkbox/index.tsx +1 -0
- package/src/shared/components/selectors/Switch/index.tsx +2 -2
- package/src/shared/components/selectors/Switch/theme.scss +1 -1
- package/src/shared/utils/webpack.ts +5 -2
|
@@ -4,9 +4,9 @@ import 'source-map-support/register';
|
|
|
4
4
|
import http from 'http';
|
|
5
5
|
import 'raf/polyfill';
|
|
6
6
|
import { type Configuration } from 'webpack';
|
|
7
|
-
import { type OptionsT as ServerOptionsT } from './server';
|
|
8
|
-
|
|
9
|
-
export { errors }
|
|
7
|
+
import { type OptionsT as ServerOptionsT, getDefaultCspSettings } from './server';
|
|
8
|
+
import { errors } from './utils';
|
|
9
|
+
export { errors, getDefaultCspSettings };
|
|
10
10
|
type OptionsT = ServerOptionsT & {
|
|
11
11
|
https?: {
|
|
12
12
|
cert: string;
|
|
@@ -141,5 +141,7 @@ declare function launchServer(webpackConfig: Configuration, options: OptionsT):
|
|
|
141
141
|
}>;
|
|
142
142
|
declare namespace launchServer {
|
|
143
143
|
var SCRIPT_LOCATIONS: typeof import("./renderer").SCRIPT_LOCATIONS;
|
|
144
|
+
var getDefaultCspSettings: typeof import("./server").getDefaultCspSettings;
|
|
145
|
+
var errors: typeof import("./utils/errors");
|
|
144
146
|
}
|
|
145
147
|
export default launchServer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type Theme } from '@dr.pogodin/react-themes';
|
|
3
3
|
import { type OptionsT } from '../common';
|
|
4
|
-
declare const validThemeKeys: readonly ["container", "label", "option", "
|
|
4
|
+
declare const validThemeKeys: readonly ["container", "label", "option", "options", "selected"];
|
|
5
5
|
type PropsT = {
|
|
6
6
|
label?: React.ReactNode;
|
|
7
7
|
onChange?: (value: string) => void;
|
|
@@ -282,14 +282,11 @@ function configFactory(ops) {
|
|
|
282
282
|
modules: {
|
|
283
283
|
getLocalIdent: utils_1.getLocalIdent,
|
|
284
284
|
localIdentName: o.cssLocalIdent,
|
|
285
|
-
//
|
|
286
|
-
// css-loader@7.0.0:
|
|
285
|
+
// This flag defaults `true` for ES module builds since css-loader@7.0.0:
|
|
287
286
|
// https://github.com/webpack-contrib/css-loader/releases/tag/v7.0.0
|
|
288
|
-
//
|
|
289
|
-
//
|
|
290
|
-
//
|
|
291
|
-
// imports:
|
|
292
|
-
// https://github.com/birdofpreyru/babel-plugin-react-css-modules/issues/44
|
|
287
|
+
// We'll keep it `false` to avoid a breaking change for dependant
|
|
288
|
+
// projects, and I am also not sure what are the benefits of
|
|
289
|
+
// named CSS exports anyway.
|
|
293
290
|
namedExport: false,
|
|
294
291
|
},
|
|
295
292
|
},
|
|
@@ -103,14 +103,11 @@ function configFactory(ops) {
|
|
|
103
103
|
modules: {
|
|
104
104
|
getLocalIdent: utils_1.getLocalIdent,
|
|
105
105
|
localIdentName: ops.cssLocalIdent,
|
|
106
|
-
//
|
|
107
|
-
// css-loader@7.0.0:
|
|
106
|
+
// This flag defaults `true` for ES module builds since css-loader@7.0.0:
|
|
108
107
|
// https://github.com/webpack-contrib/css-loader/releases/tag/v7.0.0
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
// imports:
|
|
113
|
-
// https://github.com/birdofpreyru/babel-plugin-react-css-modules/issues/44
|
|
108
|
+
// We'll keep it `false` to avoid a breaking change for dependant
|
|
109
|
+
// projects, and I am also not sure what are the benefits of
|
|
110
|
+
// named CSS exports anyway.
|
|
114
111
|
namedExport: false,
|
|
115
112
|
},
|
|
116
113
|
},
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.33.
|
|
2
|
+
"version": "1.33.3",
|
|
3
3
|
"bin": {
|
|
4
4
|
"react-utils-build": "bin/build.js",
|
|
5
5
|
"react-utils-setup": "bin/setup.js"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@babel/runtime": "^7.24.4",
|
|
12
|
-
"@dr.pogodin/babel-plugin-react-css-modules": "^6.13.
|
|
12
|
+
"@dr.pogodin/babel-plugin-react-css-modules": "^6.13.1",
|
|
13
13
|
"@dr.pogodin/csurf": "^1.13.0",
|
|
14
14
|
"@dr.pogodin/js-utils": "^0.0.9",
|
|
15
15
|
"@dr.pogodin/react-global-state": "^0.14.0",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
96
96
|
"eslint-import-resolver-babel-module": "^5.3.2",
|
|
97
97
|
"eslint-plugin-import": "^2.29.1",
|
|
98
|
-
"eslint-plugin-jest": "^28.
|
|
98
|
+
"eslint-plugin-jest": "^28.2.0",
|
|
99
99
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
100
100
|
"eslint-plugin-react": "^7.34.1",
|
|
101
101
|
"eslint-plugin-react-hooks": "^4.6.0",
|
package/src/server/index.ts
CHANGED
|
@@ -17,14 +17,16 @@ import 'raf/polyfill';
|
|
|
17
17
|
|
|
18
18
|
import { type Configuration } from 'webpack';
|
|
19
19
|
|
|
20
|
-
import serverFactory, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export {
|
|
20
|
+
import serverFactory, {
|
|
21
|
+
type OptionsT as ServerOptionsT,
|
|
24
22
|
getDefaultCspSettings,
|
|
25
23
|
} from './server';
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
import { SCRIPT_LOCATIONS, newDefaultLogger } from './renderer';
|
|
26
|
+
|
|
27
|
+
import { errors } from './utils';
|
|
28
|
+
|
|
29
|
+
export { errors, getDefaultCspSettings };
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* Normalizes a port into a number, string, or false.
|
|
@@ -228,3 +230,5 @@ export default async function launchServer(webpackConfig: Configuration, options
|
|
|
228
230
|
}
|
|
229
231
|
|
|
230
232
|
launchServer.SCRIPT_LOCATIONS = SCRIPT_LOCATIONS;
|
|
233
|
+
launchServer.getDefaultCspSettings = getDefaultCspSettings;
|
|
234
|
+
launchServer.errors = errors;
|
|
@@ -9,8 +9,8 @@ const validThemeKeys = [
|
|
|
9
9
|
'container',
|
|
10
10
|
'label',
|
|
11
11
|
'option',
|
|
12
|
+
'options',
|
|
12
13
|
'selected',
|
|
13
|
-
'switch',
|
|
14
14
|
] as const;
|
|
15
15
|
|
|
16
16
|
type PropsT = {
|
|
@@ -62,7 +62,7 @@ const BaseSwitch: React.FunctionComponent<PropsT> = ({
|
|
|
62
62
|
return (
|
|
63
63
|
<div className={theme.container}>
|
|
64
64
|
{label ? <div className={theme.label}>{label}</div> : null}
|
|
65
|
-
<div className={theme.
|
|
65
|
+
<div className={theme.options}>
|
|
66
66
|
{optionNodes}
|
|
67
67
|
</div>
|
|
68
68
|
</div>
|
|
@@ -23,8 +23,11 @@ export function requireWeak(
|
|
|
23
23
|
if (!def) return named;
|
|
24
24
|
|
|
25
25
|
Object.entries(named).forEach(([key, value]) => {
|
|
26
|
-
if (def[key])
|
|
27
|
-
|
|
26
|
+
if (def[key]) {
|
|
27
|
+
if (def[key] !== value) {
|
|
28
|
+
throw Error('Conflict between default and named exports');
|
|
29
|
+
}
|
|
30
|
+
} else def[key] = value;
|
|
28
31
|
});
|
|
29
32
|
return def;
|
|
30
33
|
} catch {
|