@dr.pogodin/react-utils 1.46.2 → 1.47.0-alpha.1
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/babel.config.js +1 -0
- package/babel.libweb.config.js +16 -0
- package/bin/build.js +16 -10
- package/bin/setup.js +11 -8
- package/build/development/client/getInj.js.map +1 -1
- package/build/development/client/index.js.map +1 -1
- package/build/development/client/init.js.map +1 -1
- package/build/development/index.js +7 -1
- package/build/development/index.js.map +1 -1
- package/build/development/server/Cache.js.map +1 -1
- package/build/development/server/index.js +13 -8
- package/build/development/server/index.js.map +1 -1
- package/build/development/server/renderer.js +15 -8
- package/build/development/server/renderer.js.map +1 -1
- package/build/development/server/server.js +7 -5
- package/build/development/server/server.js.map +1 -1
- package/build/development/shared/components/Button/index.js +6 -6
- package/build/development/shared/components/Button/index.js.map +1 -1
- package/build/development/shared/components/Checkbox/index.js +8 -8
- package/build/development/shared/components/Checkbox/index.js.map +1 -1
- package/build/development/shared/components/GenericLink/index.js +5 -1
- package/build/development/shared/components/GenericLink/index.js.map +1 -1
- package/build/development/shared/components/Input/index.js +10 -9
- package/build/development/shared/components/Input/index.js.map +1 -1
- package/build/development/shared/components/Link.js.map +1 -1
- package/build/development/shared/components/Modal/index.js +8 -6
- package/build/development/shared/components/Modal/index.js.map +1 -1
- package/build/development/shared/components/NavLink.js.map +1 -1
- package/build/development/shared/components/PageLayout/index.js +6 -6
- package/build/development/shared/components/PageLayout/index.js.map +1 -1
- package/build/development/shared/components/TextArea/index.js +13 -9
- package/build/development/shared/components/TextArea/index.js.map +1 -1
- package/build/development/shared/components/Throbber/index.js +6 -6
- package/build/development/shared/components/Throbber/index.js.map +1 -1
- package/build/development/shared/components/WithTooltip/Tooltip.js +1 -0
- package/build/development/shared/components/WithTooltip/Tooltip.js.map +1 -1
- package/build/development/shared/components/WithTooltip/index.js +7 -7
- package/build/development/shared/components/WithTooltip/index.js.map +1 -1
- package/build/development/shared/components/YouTubeVideo/index.js +9 -9
- package/build/development/shared/components/YouTubeVideo/index.js.map +1 -1
- package/build/development/shared/components/index.js.map +1 -1
- package/build/development/shared/components/selectors/CustomDropdown/Options/index.js +1 -1
- package/build/development/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
- package/build/development/shared/components/selectors/CustomDropdown/index.js +11 -11
- package/build/development/shared/components/selectors/CustomDropdown/index.js.map +1 -1
- package/build/development/shared/components/selectors/NativeDropdown/index.js +12 -12
- package/build/development/shared/components/selectors/NativeDropdown/index.js.map +1 -1
- package/build/development/shared/components/selectors/Switch/index.js +7 -7
- package/build/development/shared/components/selectors/Switch/index.js.map +1 -1
- package/build/development/shared/utils/config.js.map +1 -1
- package/build/development/shared/utils/globalState.js.map +1 -1
- package/build/development/shared/utils/index.js.map +1 -1
- package/build/development/shared/utils/jest/E2eSsrEnv.js +14 -10
- package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
- package/build/development/shared/utils/splitComponent.js +1 -0
- package/build/development/shared/utils/splitComponent.js.map +1 -1
- package/build/development/shared/utils/time.js.map +1 -1
- package/build/production/client/getInj.js.map +1 -1
- package/build/production/client/index.js.map +1 -1
- package/build/production/client/init.js.map +1 -1
- package/build/production/index.js +4 -1
- package/build/production/index.js.map +1 -1
- package/build/production/server/Cache.js.map +1 -1
- package/build/production/server/index.js +5 -5
- 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 +4 -4
- package/build/production/server/server.js.map +1 -1
- 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/Checkbox/index.js +1 -1
- package/build/production/shared/components/Checkbox/index.js.map +1 -1
- package/build/production/shared/components/GenericLink/index.js +2 -2
- package/build/production/shared/components/GenericLink/index.js.map +1 -1
- package/build/production/shared/components/Input/index.js +1 -1
- package/build/production/shared/components/Input/index.js.map +1 -1
- package/build/production/shared/components/Link.js.map +1 -1
- package/build/production/shared/components/Modal/index.js +1 -1
- package/build/production/shared/components/Modal/index.js.map +1 -1
- package/build/production/shared/components/NavLink.js.map +1 -1
- package/build/production/shared/components/PageLayout/index.js +1 -1
- package/build/production/shared/components/PageLayout/index.js.map +1 -1
- package/build/production/shared/components/TextArea/index.js +1 -1
- package/build/production/shared/components/TextArea/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/shared/components/WithTooltip/Tooltip.js.map +1 -1
- package/build/production/shared/components/WithTooltip/index.js +1 -1
- package/build/production/shared/components/WithTooltip/index.js.map +1 -1
- package/build/production/shared/components/YouTubeVideo/index.js +1 -1
- package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
- package/build/production/shared/components/index.js.map +1 -1
- package/build/production/shared/components/selectors/CustomDropdown/Options/index.js +1 -1
- package/build/production/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
- package/build/production/shared/components/selectors/CustomDropdown/index.js +1 -1
- package/build/production/shared/components/selectors/CustomDropdown/index.js.map +1 -1
- package/build/production/shared/components/selectors/NativeDropdown/index.js +1 -1
- package/build/production/shared/components/selectors/NativeDropdown/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/config.js.map +1 -1
- package/build/production/shared/utils/globalState.js.map +1 -1
- package/build/production/shared/utils/index.js.map +1 -1
- package/build/production/shared/utils/jest/E2eSsrEnv.js +8 -7
- package/build/production/shared/utils/jest/E2eSsrEnv.js.map +1 -1
- package/build/production/shared/utils/splitComponent.js.map +1 -1
- package/build/production/shared/utils/time.js.map +1 -1
- package/build/web/client/getInj.js +54 -0
- package/build/web/client/getInj.js.map +1 -0
- package/build/web/client/index.js +38 -0
- package/build/web/client/index.js.map +1 -0
- package/build/web/client/init.js +49 -0
- package/build/web/client/init.js.map +1 -0
- package/build/web/index.js +25 -0
- package/build/web/index.js.map +1 -0
- package/build/web/server/Cache.js +54 -0
- package/build/web/server/Cache.js.map +1 -0
- package/build/web/server/index.js +211 -0
- package/build/web/server/index.js.map +1 -0
- package/build/web/server/renderer.js +516 -0
- package/build/web/server/renderer.js.map +1 -0
- package/build/web/server/server.js +231 -0
- package/build/web/server/server.js.map +1 -0
- package/build/web/server/utils/errors.js +103 -0
- package/build/web/server/utils/errors.js.map +1 -0
- package/build/web/server/utils/index.js +4 -0
- package/build/web/server/utils/index.js.map +1 -0
- package/build/web/shared/components/Button/index.js +90 -0
- package/build/web/shared/components/Button/index.js.map +1 -0
- package/build/web/shared/components/Button/style.scss +54 -0
- package/build/web/shared/components/Checkbox/index.js +35 -0
- package/build/web/shared/components/Checkbox/index.js.map +1 -0
- package/build/web/shared/components/Checkbox/theme.scss +63 -0
- package/build/web/shared/components/GenericLink/index.js +107 -0
- package/build/web/shared/components/GenericLink/index.js.map +1 -0
- package/build/web/shared/components/GenericLink/style.scss +3 -0
- package/build/web/shared/components/Input/index.js +71 -0
- package/build/web/shared/components/Input/index.js.map +1 -0
- package/build/web/shared/components/Input/theme.scss +52 -0
- package/build/web/shared/components/Link.js +20 -0
- package/build/web/shared/components/Link.js.map +1 -0
- package/build/web/shared/components/Modal/base-theme.scss +38 -0
- package/build/web/shared/components/Modal/index.js +128 -0
- package/build/web/shared/components/Modal/index.js.map +1 -0
- package/build/web/shared/components/Modal/styles.scss +3 -0
- package/build/web/shared/components/NavLink.js +13 -0
- package/build/web/shared/components/NavLink.js.map +1 -0
- package/build/web/shared/components/PageLayout/base-theme.scss +30 -0
- package/build/web/shared/components/PageLayout/index.js +38 -0
- package/build/web/shared/components/PageLayout/index.js.map +1 -0
- package/build/web/shared/components/TextArea/index.js +106 -0
- package/build/web/shared/components/TextArea/index.js.map +1 -0
- package/build/web/shared/components/TextArea/style.scss +68 -0
- package/build/web/shared/components/Throbber/index.js +26 -0
- package/build/web/shared/components/Throbber/index.js.map +1 -0
- package/build/web/shared/components/Throbber/theme.scss +26 -0
- package/build/web/shared/components/WithTooltip/Tooltip.js +226 -0
- package/build/web/shared/components/WithTooltip/Tooltip.js.map +1 -0
- package/build/web/shared/components/WithTooltip/default-theme.scss +36 -0
- package/build/web/shared/components/WithTooltip/index.js +117 -0
- package/build/web/shared/components/WithTooltip/index.js.map +1 -0
- package/build/web/shared/components/YouTubeVideo/base.scss +15 -0
- package/build/web/shared/components/YouTubeVideo/index.js +56 -0
- package/build/web/shared/components/YouTubeVideo/index.js.map +1 -0
- package/build/web/shared/components/YouTubeVideo/throbber.scss +11 -0
- package/build/web/shared/components/index.js +18 -0
- package/build/web/shared/components/index.js.map +1 -0
- package/build/web/shared/components/selectors/CustomDropdown/Options/index.js +79 -0
- package/build/web/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -0
- package/build/web/shared/components/selectors/CustomDropdown/Options/style.scss +6 -0
- package/build/web/shared/components/selectors/CustomDropdown/index.js +120 -0
- package/build/web/shared/components/selectors/CustomDropdown/index.js.map +1 -0
- package/build/web/shared/components/selectors/CustomDropdown/theme.scss +118 -0
- package/build/web/shared/components/selectors/NativeDropdown/index.js +82 -0
- package/build/web/shared/components/selectors/NativeDropdown/index.js.map +1 -0
- package/build/web/shared/components/selectors/NativeDropdown/theme.scss +81 -0
- package/build/web/shared/components/selectors/Switch/index.js +49 -0
- package/build/web/shared/components/selectors/Switch/index.js.map +1 -0
- package/build/web/shared/components/selectors/Switch/theme.scss +39 -0
- package/build/web/shared/components/selectors/common.js +12 -0
- package/build/web/shared/components/selectors/common.js.map +1 -0
- package/build/web/shared/components/selectors/index.js +4 -0
- package/build/web/shared/components/selectors/index.js.map +1 -0
- package/build/web/shared/utils/config.js +21 -0
- package/build/web/shared/utils/config.js.map +1 -0
- package/build/web/shared/utils/globalState.js +15 -0
- package/build/web/shared/utils/globalState.js.map +1 -0
- package/build/web/shared/utils/index.js +13 -0
- package/build/web/shared/utils/index.js.map +1 -0
- package/build/web/shared/utils/isomorphy/buildInfo.js +44 -0
- package/build/web/shared/utils/isomorphy/buildInfo.js.map +1 -0
- package/build/web/shared/utils/isomorphy/environment-check.js +17 -0
- package/build/web/shared/utils/isomorphy/environment-check.js.map +1 -0
- package/build/web/shared/utils/isomorphy/index.js +36 -0
- package/build/web/shared/utils/isomorphy/index.js.map +1 -0
- package/build/web/shared/utils/jest/E2eSsrEnv.js +230 -0
- package/build/web/shared/utils/jest/E2eSsrEnv.js.map +1 -0
- package/build/web/shared/utils/jest/global.js +4 -0
- package/build/web/shared/utils/jest/global.js.map +1 -0
- package/build/web/shared/utils/jest/index.js +165 -0
- package/build/web/shared/utils/jest/index.js.map +1 -0
- package/build/web/shared/utils/splitComponent.js +221 -0
- package/build/web/shared/utils/splitComponent.js.map +1 -0
- package/build/web/shared/utils/time.js +85 -0
- package/build/web/shared/utils/time.js.map +1 -0
- package/build/web/shared/utils/webpack.js +61 -0
- package/build/web/shared/utils/webpack.js.map +1 -0
- package/build/web/styles/_global/reset.css +52 -0
- package/build/web/styles/_mixins/fonts.scss +40 -0
- package/build/web/styles/_mixins/media.scss +150 -0
- package/build/web/styles/_mixins/typography.scss +83 -0
- package/build/web/styles/global.scss +11 -0
- package/build/web/styles/mixins.scss +6 -0
- package/config/babel/node-ssr.js +5 -2
- package/config/webpack/app-base.js +10 -7
- package/config/webpack/app-development.js +3 -2
- package/package.json +16 -27
- package/src/index.ts +7 -1
- package/src/server/index.ts +6 -8
- package/src/server/renderer.tsx +7 -9
- package/src/server/server.ts +3 -5
- package/src/shared/components/Modal/base-theme.scss +1 -1
- package/src/shared/components/PageLayout/base-theme.scss +1 -1
- package/src/shared/utils/jest/E2eSsrEnv.ts +8 -1
- package/build/development/__chunk_groups__.json +0 -6
- package/build/development/style.css +0 -909
- package/build/development/web.bundle.js +0 -752
- package/build/production/__chunk_groups__.json +0 -6
- package/build/production/style.css +0 -2
- package/build/production/style.css.map +0 -1
- package/build/production/web.bundle.js +0 -3
- package/build/production/web.bundle.js.LICENSE.txt +0 -9
- package/build/production/web.bundle.js.map +0 -1
- package/dev-styles.js +0 -1
- package/null.js +0 -1
- package/prod-styles.js +0 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { IS_CLIENT_SIDE } from "./isomorphy";
|
|
2
|
+
/**
|
|
3
|
+
* Requires the specified module without including it into the bundle during
|
|
4
|
+
* Webpack build.
|
|
5
|
+
* @param modulePath
|
|
6
|
+
* @param [basePath]
|
|
7
|
+
* @return Required module.
|
|
8
|
+
*/
|
|
9
|
+
export function requireWeak(modulePath,
|
|
10
|
+
// TODO: For now `basePath` can be provided directly as a string here,
|
|
11
|
+
// for backward compatibility. Deprecate it in future, if any other
|
|
12
|
+
// breaking changes are done for requireWeak().
|
|
13
|
+
basePathOrOptions) {
|
|
14
|
+
if (IS_CLIENT_SIDE) return null;
|
|
15
|
+
let basePath;
|
|
16
|
+
let ops;
|
|
17
|
+
if (typeof basePathOrOptions === 'string') {
|
|
18
|
+
basePath = basePathOrOptions;
|
|
19
|
+
} else {
|
|
20
|
+
ops = basePathOrOptions ?? {};
|
|
21
|
+
({
|
|
22
|
+
basePath
|
|
23
|
+
} = ops);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line no-eval
|
|
27
|
+
const req = eval('require');
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
30
|
+
const {
|
|
31
|
+
resolve
|
|
32
|
+
} = req('path');
|
|
33
|
+
const path = basePath ? resolve(basePath, modulePath) : modulePath;
|
|
34
|
+
const module = req(path);
|
|
35
|
+
if (!('default' in module) || !module.default) return module;
|
|
36
|
+
const {
|
|
37
|
+
default: def,
|
|
38
|
+
...named
|
|
39
|
+
} = module;
|
|
40
|
+
const res = def;
|
|
41
|
+
Object.entries(named).forEach(([name, value]) => {
|
|
42
|
+
const assigned = res[name];
|
|
43
|
+
if (assigned) res[name] = value;else if (assigned !== value) {
|
|
44
|
+
throw Error('Conflict between default and named exports');
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return res;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Resolves specified module path with help of Babel's module resolver.
|
|
52
|
+
* Yes, the function itself just returns its argument to the caller, but Babel
|
|
53
|
+
* is configured to resolve the first argument of resolveWeak(..) function, thus
|
|
54
|
+
* the result will be the resolved path.
|
|
55
|
+
* @param {string} modulePath
|
|
56
|
+
* @return {string} Absolute or relative path to the module.
|
|
57
|
+
*/
|
|
58
|
+
export function resolveWeak(modulePath) {
|
|
59
|
+
return modulePath;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=webpack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack.js","names":["IS_CLIENT_SIDE","requireWeak","modulePath","basePathOrOptions","basePath","ops","req","eval","resolve","path","module","default","def","named","res","Object","entries","forEach","name","value","assigned","Error","resolveWeak"],"sources":["../../../../src/shared/utils/webpack.ts"],"sourcesContent":["import type PathNS from 'node:path';\n\nimport { IS_CLIENT_SIDE } from './isomorphy';\n\ntype RequireWeakOptionsT = {\n basePath?: string;\n};\n\ntype RequireWeakResT<T> = T extends { default: infer D }\n ? (D extends null | undefined ? T : D & Omit<T, 'default'>)\n : T;\n\n/**\n * Requires the specified module without including it into the bundle during\n * Webpack build.\n * @param modulePath\n * @param [basePath]\n * @return Required module.\n */\nexport function requireWeak<T extends object>(\n modulePath: string,\n\n // TODO: For now `basePath` can be provided directly as a string here,\n // for backward compatibility. Deprecate it in future, if any other\n // breaking changes are done for requireWeak().\n basePathOrOptions?: string | RequireWeakOptionsT,\n): RequireWeakResT<T> | null {\n if (IS_CLIENT_SIDE) return null;\n\n let basePath: string | undefined;\n let ops: RequireWeakOptionsT;\n if (typeof basePathOrOptions === 'string') {\n basePath = basePathOrOptions;\n } else {\n ops = basePathOrOptions ?? {};\n ({ basePath } = ops);\n }\n\n // eslint-disable-next-line no-eval\n const req = eval('require') as (path: string) => unknown;\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { resolve } = req('path') as typeof PathNS;\n\n const path = basePath ? resolve(basePath, modulePath) : modulePath;\n const module = req(path) as T;\n\n if (!('default' in module) || !module.default) return module as RequireWeakResT<T>;\n\n const { default: def, ...named } = module;\n\n const res = def as RequireWeakResT<T>;\n\n Object.entries(named).forEach(([name, value]) => {\n const assigned = res[name as keyof RequireWeakResT<T>];\n if (assigned) (res[name as keyof RequireWeakResT<T>] as unknown) = value;\n else if (assigned !== value) {\n throw Error('Conflict between default and named exports');\n }\n });\n return res;\n}\n\n/**\n * Resolves specified module path with help of Babel's module resolver.\n * Yes, the function itself just returns its argument to the caller, but Babel\n * is configured to resolve the first argument of resolveWeak(..) function, thus\n * the result will be the resolved path.\n * @param {string} modulePath\n * @return {string} Absolute or relative path to the module.\n */\nexport function resolveWeak(modulePath: string): string {\n return modulePath;\n}\n"],"mappings":"AAEA,SAASA,cAAc;AAUvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CACzBC,UAAkB;AAElB;AACA;AACA;AACAC,iBAAgD,EACrB;EAC3B,IAAIH,cAAc,EAAE,OAAO,IAAI;EAE/B,IAAII,QAA4B;EAChC,IAAIC,GAAwB;EAC5B,IAAI,OAAOF,iBAAiB,KAAK,QAAQ,EAAE;IACzCC,QAAQ,GAAGD,iBAAiB;EAC9B,CAAC,MAAM;IACLE,GAAG,GAAGF,iBAAiB,IAAI,CAAC,CAAC;IAC7B,CAAC;MAAEC;IAAS,CAAC,GAAGC,GAAG;EACrB;;EAEA;EACA,MAAMC,GAAG,GAAGC,IAAI,CAAC,SAAS,CAA8B;;EAExD;EACA,MAAM;IAAEC;EAAQ,CAAC,GAAGF,GAAG,CAAC,MAAM,CAAkB;EAEhD,MAAMG,IAAI,GAAGL,QAAQ,GAAGI,OAAO,CAACJ,QAAQ,EAAEF,UAAU,CAAC,GAAGA,UAAU;EAClE,MAAMQ,MAAM,GAAGJ,GAAG,CAACG,IAAI,CAAM;EAE7B,IAAI,EAAE,SAAS,IAAIC,MAAM,CAAC,IAAI,CAACA,MAAM,CAACC,OAAO,EAAE,OAAOD,MAAM;EAE5D,MAAM;IAAEC,OAAO,EAAEC,GAAG;IAAE,GAAGC;EAAM,CAAC,GAAGH,MAAM;EAEzC,MAAMI,GAAG,GAAGF,GAAyB;EAErCG,MAAM,CAACC,OAAO,CAACH,KAAK,CAAC,CAACI,OAAO,CAAC,CAAC,CAACC,IAAI,EAAEC,KAAK,CAAC,KAAK;IAC/C,MAAMC,QAAQ,GAAGN,GAAG,CAACI,IAAI,CAA6B;IACtD,IAAIE,QAAQ,EAAGN,GAAG,CAACI,IAAI,CAA6B,GAAeC,KAAK,CAAC,KACpE,IAAIC,QAAQ,KAAKD,KAAK,EAAE;MAC3B,MAAME,KAAK,CAAC,4CAA4C,CAAC;IAC3D;EACF,CAAC,CAAC;EACF,OAAOP,GAAG;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASQ,WAAWA,CAACpB,UAAkB,EAAU;EACtD,OAAOA,UAAU;AACnB","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* Eric Meyer's "Reset CSS" 2.0 */
|
|
2
|
+
|
|
3
|
+
/* http://meyerweb.com/eric/tools/css/reset/
|
|
4
|
+
v2.0 | 20110126
|
|
5
|
+
License: none (public domain)
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* Having all selectors at individual lines is unreadable in the case of this
|
|
9
|
+
* style reset sheet. */
|
|
10
|
+
/* stylelint-disable selector-list-comma-newline-after */
|
|
11
|
+
a, abbr, acronym, address, applet, article, aside, audio, b, big, blockquote,
|
|
12
|
+
body, canvas, caption, center, cite, code, dd, del, details, dfn, div, dl, dt,
|
|
13
|
+
em, embed, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6,
|
|
14
|
+
header, hgroup, html, i, iframe, img, ins, kbd, label, legend, li, mark, menu,
|
|
15
|
+
nav, object, ol, output, p, pre, q, ruby, s, samp, section, small, span,
|
|
16
|
+
strike, strong,sub, summary, sup, table, tbody, td, tfoot, th, thead, time, tr,
|
|
17
|
+
tt, u, ul, var, video {
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
border: 0;
|
|
21
|
+
font: inherit;
|
|
22
|
+
font-size: 100%;
|
|
23
|
+
vertical-align: baseline;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* HTML5 display-role reset for older browsers */
|
|
27
|
+
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav,
|
|
28
|
+
section {
|
|
29
|
+
display: block;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
body {
|
|
33
|
+
line-height: 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ol, ul {
|
|
37
|
+
list-style: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
blockquote, q {
|
|
41
|
+
quotes: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
blockquote::before, blockquote::after, q::before, q::after {
|
|
45
|
+
content: "";
|
|
46
|
+
content: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
table {
|
|
50
|
+
border-collapse: collapse;
|
|
51
|
+
border-spacing: 0;
|
|
52
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* Auxiliary mixins for fonts inclusion. */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Includes a font, provided as a set of alternative files in EOT, WOFF, TTF,
|
|
5
|
+
* SVG formats into the app.
|
|
6
|
+
* $font-name {String}
|
|
7
|
+
* $font-weight {Number}
|
|
8
|
+
* $font-style {String}
|
|
9
|
+
* $font-url {String} Path to the font file, without the filename itself.
|
|
10
|
+
* $font-file {String} Font filename, without extension (should be the same for
|
|
11
|
+
* each version of the font in different formats.
|
|
12
|
+
*/
|
|
13
|
+
@mixin font-family($font-name, $font-weight, $font-style, $font-url, $font-file) {
|
|
14
|
+
@font-face {
|
|
15
|
+
font-family: "#{$font-name}";
|
|
16
|
+
font-display: block;
|
|
17
|
+
font-weight: $font-weight;
|
|
18
|
+
font-style: $font-style;
|
|
19
|
+
src: url("#{$font-url}#{$font-file}.eot");
|
|
20
|
+
src: url("#{$font-url}#{$font-file}.eot?#iefix") format("embedded-opentype"), url("#{$font-url}#{$font-file}.woff") format("woff"), url("#{$font-url}#{$font-file}.ttf") format("truetype");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Includes a font, provided in the TTF format only.
|
|
26
|
+
* $font-name {String}
|
|
27
|
+
* $font-weight {Number}
|
|
28
|
+
* $font-style {String}
|
|
29
|
+
* $font-url {String}
|
|
30
|
+
*/
|
|
31
|
+
@mixin font-family-ttf(
|
|
32
|
+
$font-name, $font-weight, $font-style, $font-url) {
|
|
33
|
+
@font-face {
|
|
34
|
+
font-family: $font-name;
|
|
35
|
+
font-display: block;
|
|
36
|
+
font-style: $font-style;
|
|
37
|
+
font-weight: $font-weight;
|
|
38
|
+
src: url("#{$font-url}.ttf") format("truetype");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mixins for different layout sizes: xs, sm, md, lg.
|
|
3
|
+
* Breaking points are defined in _variables.scss
|
|
4
|
+
* The range mixins A-to-B all means "for the sizes from A to B, both
|
|
5
|
+
* inclusive", in particular it means that mixin A-to-lg is equivalent to
|
|
6
|
+
* all sizes from A (inclusive) and larger.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: For convenience, these mixins are sorted not alphabetically, but,
|
|
9
|
+
* first, by increase of the first size; second, by increase of the second size.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* Break points. */
|
|
13
|
+
|
|
14
|
+
$screen-xs: 320px !default;
|
|
15
|
+
$screen-sm: 495px !default;
|
|
16
|
+
$screen-mm: 768px !default;
|
|
17
|
+
$screen-md: 1024px !default;
|
|
18
|
+
$screen-lg: 1280px !default;
|
|
19
|
+
|
|
20
|
+
/* XS */
|
|
21
|
+
|
|
22
|
+
@mixin xs {
|
|
23
|
+
@media (max-width: #{$screen-xs}) {
|
|
24
|
+
@content;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin xs-to-sm {
|
|
29
|
+
@media (max-width: #{$screen-sm}) {
|
|
30
|
+
@content;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@mixin xs-to-mm {
|
|
35
|
+
@media (max-width: #{$screen-mm}) {
|
|
36
|
+
@content;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@mixin xs-to-md {
|
|
41
|
+
@media (max-width: #{$screen-md}) {
|
|
42
|
+
@content;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@mixin xs-to-lg {
|
|
47
|
+
@media (max-width: #{$screen-lg}) {
|
|
48
|
+
@content;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* SM */
|
|
53
|
+
|
|
54
|
+
@mixin sm {
|
|
55
|
+
@media (min-width: #{$screen-xs + 1px}) and (max-width: #{$screen-sm}) {
|
|
56
|
+
@content;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@mixin sm-to-mm {
|
|
61
|
+
@media (min-width: #{$screen-xs + 1px}) and (max-width: #{$screen-mm}) {
|
|
62
|
+
@content;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@mixin sm-to-md {
|
|
67
|
+
@media (min-width: #{$screen-xs + 1px}) and (max-width: #{$screen-md}) {
|
|
68
|
+
@content;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@mixin sm-to-lg {
|
|
73
|
+
@media (min-width: #{$screen-xs + 1px}) and (max-width: #{$screen-lg}) {
|
|
74
|
+
@content;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@mixin sm-to-xl {
|
|
79
|
+
@media (min-width: #{$screen-xs + 1px}) {
|
|
80
|
+
@content;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* MM */
|
|
85
|
+
|
|
86
|
+
@mixin mm {
|
|
87
|
+
@media (min-width: #{$screen-sm + 1px}) and (max-width: #{$screen-mm}) {
|
|
88
|
+
@content;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@mixin mm-to-md {
|
|
93
|
+
@media (min-width: #{$screen-sm + 1px}) and (max-width: #{$screen-md}) {
|
|
94
|
+
@content;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@mixin mm-to-lg {
|
|
99
|
+
@media (min-width: #{$screen-sm + 1px}) and (max-width: #{$screen-lg}) {
|
|
100
|
+
@content;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@mixin mm-to-xl {
|
|
105
|
+
@media (min-width: #{$screen-sm + 1px}) {
|
|
106
|
+
@content;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* MD */
|
|
111
|
+
|
|
112
|
+
@mixin md {
|
|
113
|
+
@media (min-width: #{$screen-mm + 1px}) and (max-width: #{$screen-md}) {
|
|
114
|
+
@content;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@mixin md-to-lg {
|
|
119
|
+
@media (min-width: #{$screen-mm + 1px}) and (max-width: #{$screen-lg}) {
|
|
120
|
+
@content;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@mixin md-to-xl {
|
|
125
|
+
@media (min-width: #{$screen-mm + 1px}) {
|
|
126
|
+
@content;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* LG */
|
|
131
|
+
|
|
132
|
+
@mixin lg {
|
|
133
|
+
@media (min-width: #{$screen-md + 1px}) and (max-width: #{$screen-lg}) {
|
|
134
|
+
@content;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@mixin lg-to-xl {
|
|
139
|
+
@media (min-width: #{$screen-md + 1px}) {
|
|
140
|
+
@content;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* XL */
|
|
145
|
+
|
|
146
|
+
@mixin xl {
|
|
147
|
+
@media (min-width: #{$screen-lg + 1px}) {
|
|
148
|
+
@content;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A simple drop-in typography mixin.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@mixin typography {
|
|
6
|
+
font: 14pt/1.5 Arial, Helvetica, sans-serif;
|
|
7
|
+
|
|
8
|
+
code {
|
|
9
|
+
font-family: monospace;
|
|
10
|
+
font-size: 0.9em;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
em { font-style: italic; }
|
|
14
|
+
|
|
15
|
+
h1 {
|
|
16
|
+
font-size: 2.4em;
|
|
17
|
+
margin-top: 0.6em;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
h2 {
|
|
21
|
+
font-size: 2.1em;
|
|
22
|
+
margin-top: 0.6em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
h3 {
|
|
26
|
+
font-size: 1.8em;
|
|
27
|
+
margin-top: 0.6em;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
h4 {
|
|
31
|
+
font-size: 1.6em;
|
|
32
|
+
margin-top: 0.6em;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
h5 {
|
|
36
|
+
font-size: 1.4em;
|
|
37
|
+
margin-top: 0.6em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
h6 {
|
|
41
|
+
font-size: 1.2em;
|
|
42
|
+
margin-top: 0.6em;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
strong { font-weight: bold; }
|
|
46
|
+
sub { bottom: -0.25em; }
|
|
47
|
+
sup { top: -0.5em; }
|
|
48
|
+
|
|
49
|
+
ol {
|
|
50
|
+
list-style-type: decimal;
|
|
51
|
+
padding-left: 1.2em;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
ul {
|
|
55
|
+
list-style-type: disc;
|
|
56
|
+
padding-left: 1.2em;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
li,
|
|
60
|
+
ol,
|
|
61
|
+
p,
|
|
62
|
+
pre,
|
|
63
|
+
ul {
|
|
64
|
+
margin: 0.3em 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
pre {
|
|
68
|
+
background: whitesmoke;
|
|
69
|
+
font-family: monospace;
|
|
70
|
+
font-size: 0.9em;
|
|
71
|
+
overflow: auto;
|
|
72
|
+
padding: 0.3em 0.6em;
|
|
73
|
+
white-space: pre-wrap;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
sub,
|
|
77
|
+
sup {
|
|
78
|
+
font-size: 0.75em;
|
|
79
|
+
line-height: 0;
|
|
80
|
+
position: relative;
|
|
81
|
+
vertical-align: baseline;
|
|
82
|
+
}
|
|
83
|
+
}
|
package/config/babel/node-ssr.js
CHANGED
|
@@ -32,9 +32,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
35
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
39
|
exports.default = getConfig;
|
|
37
|
-
const
|
|
40
|
+
const pull_1 = __importDefault(require("lodash/pull"));
|
|
38
41
|
const webpack_1 = __importStar(require("./webpack"));
|
|
39
42
|
/**
|
|
40
43
|
* Creates a new base config.
|
|
@@ -62,7 +65,7 @@ function newBase(babel, options = {}) {
|
|
|
62
65
|
'webpack.resolveWeak',
|
|
63
66
|
];
|
|
64
67
|
if (babel.env() === webpack_1.ENVIRONMENTS.DEV) {
|
|
65
|
-
(0,
|
|
68
|
+
(0, pull_1.default)(config.plugins, 'react-refresh/babel');
|
|
66
69
|
}
|
|
67
70
|
return config;
|
|
68
71
|
}
|
|
@@ -8,7 +8,10 @@ exports.default = configFactory;
|
|
|
8
8
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const sitemap_1 = __importDefault(require("sitemap"));
|
|
11
|
-
const
|
|
11
|
+
const clone_1 = __importDefault(require("lodash/clone"));
|
|
12
|
+
const defaults_1 = __importDefault(require("lodash/defaults"));
|
|
13
|
+
const isFunction_1 = __importDefault(require("lodash/isFunction"));
|
|
14
|
+
const isObject_1 = __importDefault(require("lodash/isObject"));
|
|
12
15
|
const autoprefixer_1 = __importDefault(require("autoprefixer"));
|
|
13
16
|
const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
|
|
14
17
|
const node_forge_1 = __importDefault(require("node-forge"));
|
|
@@ -125,8 +128,8 @@ const utils_1 = require("@dr.pogodin/babel-plugin-react-css-modules/utils");
|
|
|
125
128
|
* - **`timestamp`** — The value set for `BUILD_TIMESTAMP`.
|
|
126
129
|
*/
|
|
127
130
|
function configFactory(ops) {
|
|
128
|
-
var _a, _b
|
|
129
|
-
const o = (0,
|
|
131
|
+
var _a, _b;
|
|
132
|
+
const o = (0, defaults_1.default)((0, clone_1.default)(ops), {
|
|
130
133
|
babelLoaderOptions: {},
|
|
131
134
|
cssLocalIdent: '[hash:base64:6]',
|
|
132
135
|
outputPath: 'build/web-public',
|
|
@@ -141,7 +144,7 @@ function configFactory(ops) {
|
|
|
141
144
|
const sitemapUrl = node_path_1.default.resolve(o.context, o.sitemap);
|
|
142
145
|
// eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-require-imports
|
|
143
146
|
let source = require(sitemapUrl);
|
|
144
|
-
if ((0,
|
|
147
|
+
if ((0, isFunction_1.default)(source))
|
|
145
148
|
source = source();
|
|
146
149
|
const sm = new sitemap_1.default.SitemapStream();
|
|
147
150
|
source.forEach((item) => sm.write(item));
|
|
@@ -207,7 +210,7 @@ function configFactory(ops) {
|
|
|
207
210
|
plugins.push(new webpack_1.ProgressPlugin());
|
|
208
211
|
/* Adds InjectManifest plugin from WorkBox, if opted to. */
|
|
209
212
|
if (o.workbox) {
|
|
210
|
-
if (!(0,
|
|
213
|
+
if (!(0, isObject_1.default)(o.workbox))
|
|
211
214
|
o.workbox = {};
|
|
212
215
|
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
216
|
}
|
|
@@ -232,7 +235,7 @@ function configFactory(ops) {
|
|
|
232
235
|
// Loads JS modules (.cjs, .js, .jsx, .mjs); TS modules (.ts, .tsx);
|
|
233
236
|
// and SVG assets (.svg).
|
|
234
237
|
test: /\.(cjs|js|jsx|mjs|svg|ts|tsx)$/,
|
|
235
|
-
exclude:
|
|
238
|
+
exclude: ops.babelLoaderExclude,
|
|
236
239
|
loader: 'babel-loader',
|
|
237
240
|
options: Object.assign({ babelrc: false, configFile: false, envName: o.babelEnv, presets: [['@dr.pogodin/react-utils/config/babel/webpack', {
|
|
238
241
|
typescript: ops.typescript,
|
|
@@ -338,7 +341,7 @@ function configFactory(ops) {
|
|
|
338
341
|
// @babel/runtime/helpers/esm/interopRequireDefault, which has
|
|
339
342
|
// the hepler function attached to "default" export).
|
|
340
343
|
if (process.env.NODE_ENV !== 'test') {
|
|
341
|
-
const aliases = (
|
|
344
|
+
const aliases = (_b = res.resolve) === null || _b === void 0 ? void 0 : _b.alias;
|
|
342
345
|
aliases['@babel/runtime/helpers/defineProperty']
|
|
343
346
|
= node_path_1.default.resolve(o.context, 'node_modules/@babel/runtime/helpers/defineProperty');
|
|
344
347
|
aliases['@babel/runtime/helpers/interopRequireDefault']
|
|
@@ -5,7 +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
|
|
8
|
+
const clone_1 = __importDefault(require("lodash/clone"));
|
|
9
|
+
const defaults_1 = __importDefault(require("lodash/defaults"));
|
|
9
10
|
const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
|
|
10
11
|
const react_refresh_webpack_plugin_1 = __importDefault(require("@pmmmwh/react-refresh-webpack-plugin"));
|
|
11
12
|
const webpack_1 = __importDefault(require("webpack"));
|
|
@@ -17,7 +18,7 @@ const app_base_1 = __importDefault(require("./app-base"));
|
|
|
17
18
|
* @param [ops.dontUseHmr]
|
|
18
19
|
*/
|
|
19
20
|
function configFactory(ops) {
|
|
20
|
-
const o = (0,
|
|
21
|
+
const o = (0, defaults_1.default)((0, clone_1.default)(ops), {
|
|
21
22
|
cssLocalIdent: '[package]___[path][name]___[local]___[hash:base64:6]',
|
|
22
23
|
});
|
|
23
24
|
const entry = ['@dr.pogodin/react-utils/build/development/client/init'];
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.47.0-alpha.1",
|
|
3
3
|
"bin": {
|
|
4
4
|
"react-utils-build": "bin/build.js",
|
|
5
5
|
"react-utils-setup": "bin/setup.js"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@dr.pogodin/react-helmet": "^3.0.4",
|
|
17
17
|
"@dr.pogodin/react-themes": "^1.9.3",
|
|
18
18
|
"@jest/environment": "^30.2.0",
|
|
19
|
-
"axios": "^1.
|
|
19
|
+
"axios": "^1.13.1",
|
|
20
20
|
"commander": "^14.0.2",
|
|
21
21
|
"compression": "^1.8.1",
|
|
22
22
|
"config": "^4.1.1",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"raf": "^3.4.1",
|
|
35
35
|
"react": "^19.2.0",
|
|
36
36
|
"react-dom": "^19.2.0",
|
|
37
|
-
"react-router": "^7.9.
|
|
37
|
+
"react-router": "^7.9.5",
|
|
38
38
|
"request-ip": "^3.3.0",
|
|
39
39
|
"rimraf": "^6.0.0",
|
|
40
40
|
"serialize-javascript": "^7.0.0",
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
"@testing-library/dom": "^10.4.1",
|
|
62
62
|
"@testing-library/react": "^16.3.0",
|
|
63
63
|
"@testing-library/user-event": "^14.6.1",
|
|
64
|
-
"@tsconfig/recommended": "^1.0.
|
|
64
|
+
"@tsconfig/recommended": "^1.0.11",
|
|
65
65
|
"@types/compression": "^1.8.1",
|
|
66
66
|
"@types/config": "^3.3.5",
|
|
67
67
|
"@types/cookie": "^0.6.0",
|
|
68
68
|
"@types/cookie-parser": "^1.4.10",
|
|
69
|
-
"@types/express": "^5.0.
|
|
69
|
+
"@types/express": "^5.0.5",
|
|
70
70
|
"@types/jest": "^30.0.0",
|
|
71
71
|
"@types/lodash": "^4.17.20",
|
|
72
72
|
"@types/morgan": "^1.9.10",
|
|
@@ -84,13 +84,14 @@
|
|
|
84
84
|
"babel-jest": "^30.2.0",
|
|
85
85
|
"babel-loader": "^10.0.0",
|
|
86
86
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
87
|
+
"babel-plugin-transform-import-meta": "^2.3.3",
|
|
87
88
|
"core-js": "^3.46.0",
|
|
88
89
|
"css-loader": "^7.1.2",
|
|
89
90
|
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
90
91
|
"identity-obj-proxy": "^3.0.0",
|
|
91
92
|
"jest": "^30.2.0",
|
|
92
93
|
"jest-environment-jsdom": "^30.2.0",
|
|
93
|
-
"memfs": "^4.
|
|
94
|
+
"memfs": "^4.50.0",
|
|
94
95
|
"mini-css-extract-plugin": "^2.9.4",
|
|
95
96
|
"mockdate": "^3.0.5",
|
|
96
97
|
"nodelist-foreach-polyfill": "^1.2.0",
|
|
@@ -103,7 +104,7 @@
|
|
|
103
104
|
"resolve-url-loader": "^5.0.0",
|
|
104
105
|
"sass": "^1.93.2",
|
|
105
106
|
"sass-loader": "^16.0.6",
|
|
106
|
-
"sitemap": "^8.0.
|
|
107
|
+
"sitemap": "^8.0.2",
|
|
107
108
|
"source-map-loader": "^5.0.0",
|
|
108
109
|
"stylelint": "^16.25.0",
|
|
109
110
|
"stylelint-config-standard-scss": "^16.0.0",
|
|
@@ -129,13 +130,9 @@
|
|
|
129
130
|
"types": "./build/types-code/index.d.ts",
|
|
130
131
|
"exports": {
|
|
131
132
|
".": {
|
|
132
|
-
"browser":
|
|
133
|
-
"development": "./build/development/web.bundle.js",
|
|
134
|
-
"production": "./build/production/web.bundle.js",
|
|
135
|
-
"default": "./build/production/web.bundle.js"
|
|
136
|
-
},
|
|
133
|
+
"browser": "./build/web/index.js",
|
|
137
134
|
"node": {
|
|
138
|
-
"webpack": "./build/
|
|
135
|
+
"webpack": "./build/web/index.js",
|
|
139
136
|
"default": "./node-entry.js"
|
|
140
137
|
},
|
|
141
138
|
"react-native": {
|
|
@@ -146,18 +143,9 @@
|
|
|
146
143
|
"./config/*": "./config/*.js",
|
|
147
144
|
"./config/eslint/*": "./config/eslint/*.mjs",
|
|
148
145
|
"./config/*.json": "./config/*.json",
|
|
146
|
+
"./global-styles": "./build/web/styles/global.scss",
|
|
149
147
|
"./jest": "./build/production/shared/utils/jest/index.js",
|
|
150
|
-
"./mixins": "./
|
|
151
|
-
"./dev-styles": {
|
|
152
|
-
"node": "./null.js",
|
|
153
|
-
"browser": "./build/development/style.css"
|
|
154
|
-
},
|
|
155
|
-
"./dev-styles-forced": "./build/development/style.css",
|
|
156
|
-
"./prod-styles": {
|
|
157
|
-
"node": "./null.js",
|
|
158
|
-
"browser": "./build/production/style.css"
|
|
159
|
-
},
|
|
160
|
-
"./prod-styles-forced": "./build/production/style.css",
|
|
148
|
+
"./mixins": "./build/web/styles/mixins.scss",
|
|
161
149
|
"./build/development/client/init": "./build/development/client/init.js",
|
|
162
150
|
"./build/production/client/init": "./build/production/client/init.js",
|
|
163
151
|
"./jest-e2e-ssr-env": "./build/production/shared/utils/jest/E2eSsrEnv.js"
|
|
@@ -186,12 +174,13 @@
|
|
|
186
174
|
"url": "git+https://github.com/birdofpreyru/react-utils.git"
|
|
187
175
|
},
|
|
188
176
|
"scripts": {
|
|
189
|
-
"build": "rimraf build && npm run build:configs && npm run build:types-scss && npm run build:types-code && npm run build:dev && npm run build:prod",
|
|
177
|
+
"build": "rimraf build && npm run build:configs && npm run build:types-scss && npm run build:types-code && npm run build:web && npm run build:dev && npm run build:prod",
|
|
190
178
|
"build:configs": "tsc --project tsconfig.configs.json",
|
|
191
|
-
"build:dev": "node bin/build -t development --lib --webpack-config webpack.config.ts",
|
|
192
|
-
"build:prod": "node bin/build -t production --lib --webpack-config webpack.config.ts",
|
|
179
|
+
"build:dev": "node bin/build -i build/web -t development --lib --webpack-config webpack.config.ts --no-webpack",
|
|
180
|
+
"build:prod": "node bin/build -i build/web -t production --lib --webpack-config webpack.config.ts --no-webpack",
|
|
193
181
|
"build:types-code": "rimraf build/types-code && tsc --project tsconfig.types.json && tsc-alias -p tsconfig.types.json",
|
|
194
182
|
"build:types-scss": "rimraf build/types-scss && typed-scss-modules .",
|
|
183
|
+
"build:web": "rimraf build/web && babel ./src --config-file ./babel.libweb.config.js --out-dir build/web -x .js,.jsx,.ts,.tsx --source-maps --copy-files",
|
|
195
184
|
"jest:1": "NODE_CONFIG_ENV=test jest --no-cache -w 1 --config config/jest/default.js --shard=1/2",
|
|
196
185
|
"jest:2": "NODE_CONFIG_ENV=test jest --no-cache -w 1 --config config/jest/default.js --shard=2/2",
|
|
197
186
|
"jest:types": "tstyche",
|
package/src/index.ts
CHANGED
|
@@ -13,7 +13,13 @@ if (global.REACT_UTILS_LIBRARY_LOADED) {
|
|
|
13
13
|
throw Error('React utils library is already loaded');
|
|
14
14
|
} else global.REACT_UTILS_LIBRARY_LOADED = true;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
// TODO: This is a rapid workaround to get rid of __dirname. I guess, later
|
|
17
|
+
// we'll re-implement requireWeak() to accept import.meta.url directly, and
|
|
18
|
+
// this workaround won't be needed.
|
|
19
|
+
let dirname = import.meta.url;
|
|
20
|
+
dirname = dirname.slice(5, dirname.lastIndexOf('/'));
|
|
21
|
+
|
|
22
|
+
const server = webpack.requireWeak<typeof ServerFactoryM>('./server', dirname);
|
|
17
23
|
|
|
18
24
|
const client = server
|
|
19
25
|
? undefined
|
package/src/server/index.ts
CHANGED
|
@@ -4,14 +4,12 @@ import 'source-map-support/register';
|
|
|
4
4
|
import http from 'node:http';
|
|
5
5
|
import https from 'node:https';
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
toNumber,
|
|
14
|
-
} from 'lodash';
|
|
7
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
8
|
+
import defaults from 'lodash/defaults';
|
|
9
|
+
import isFinite from 'lodash/isFinite';
|
|
10
|
+
import isNumber from 'lodash/isNumber';
|
|
11
|
+
import isString from 'lodash/isString';
|
|
12
|
+
import toNumber from 'lodash/toNumber';
|
|
15
13
|
|
|
16
14
|
// Polyfill required by ReactJS.
|
|
17
15
|
// TODO: Double-check, if it is still required by React v19?
|