arui-scripts 0.0.0-client-only-envs-20250408153713

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 (222) hide show
  1. package/.browserslistrc +5 -0
  2. package/.eslintignore +2 -0
  3. package/.eslintrc.js +17 -0
  4. package/.turbo/turbo-build.log +0 -0
  5. package/.turbo/turbo-test.log +23 -0
  6. package/CHANGELOG.md +1571 -0
  7. package/README.md +47 -0
  8. package/bin/build.sh +2 -0
  9. package/build/bin/index.d.ts +3 -0
  10. package/build/bin/index.js +29 -0
  11. package/build/commands/archive-build/index.d.ts +1 -0
  12. package/build/commands/archive-build/index.js +80 -0
  13. package/build/commands/build/build-wrapper.d.ts +8 -0
  14. package/build/commands/build/build-wrapper.js +42 -0
  15. package/build/commands/build/client.d.ts +1 -0
  16. package/build/commands/build/client.js +41 -0
  17. package/build/commands/build/index.d.ts +1 -0
  18. package/build/commands/build/index.js +15 -0
  19. package/build/commands/build/server.d.ts +1 -0
  20. package/build/commands/build/server.js +29 -0
  21. package/build/commands/bundle-analyze/index.d.ts +1 -0
  22. package/build/commands/bundle-analyze/index.js +40 -0
  23. package/build/commands/changelog/index.d.ts +5 -0
  24. package/build/commands/changelog/index.js +113 -0
  25. package/build/commands/docker-build/index.d.ts +1 -0
  26. package/build/commands/docker-build/index.js +73 -0
  27. package/build/commands/docker-build-compiled/index.d.ts +1 -0
  28. package/build/commands/docker-build-compiled/index.js +54 -0
  29. package/build/commands/ensure-yarn/index.d.ts +0 -0
  30. package/build/commands/ensure-yarn/index.js +8 -0
  31. package/build/commands/start/client.d.ts +1 -0
  32. package/build/commands/start/client.js +8 -0
  33. package/build/commands/start/index.d.ts +1 -0
  34. package/build/commands/start/index.js +17 -0
  35. package/build/commands/start/print-compiler-output.d.ts +1 -0
  36. package/build/commands/start/print-compiler-output.js +16 -0
  37. package/build/commands/start/server.d.ts +1 -0
  38. package/build/commands/start/server.js +8 -0
  39. package/build/commands/start-prod/client.d.ts +1 -0
  40. package/build/commands/start-prod/client.js +8 -0
  41. package/build/commands/start-prod/index.d.ts +1 -0
  42. package/build/commands/start-prod/index.js +17 -0
  43. package/build/commands/start-prod/server.d.ts +1 -0
  44. package/build/commands/start-prod/server.js +8 -0
  45. package/build/commands/test/get-config.d.ts +1 -0
  46. package/build/commands/test/get-config.js +104 -0
  47. package/build/commands/test/index.d.ts +1 -0
  48. package/build/commands/test/index.js +60 -0
  49. package/build/commands/util/client-assets-sizes.d.ts +26 -0
  50. package/build/commands/util/client-assets-sizes.js +82 -0
  51. package/build/commands/util/docker-build.d.ts +23 -0
  52. package/build/commands/util/docker-build.js +127 -0
  53. package/build/commands/util/exec.d.ts +2 -0
  54. package/build/commands/util/exec.js +20 -0
  55. package/build/commands/util/format-webpack-messages.d.ts +11 -0
  56. package/build/commands/util/format-webpack-messages.js +95 -0
  57. package/build/commands/util/make-tmp-dir.d.ts +6 -0
  58. package/build/commands/util/make-tmp-dir.js +29 -0
  59. package/build/commands/util/run-client-dev-server.d.ts +2 -0
  60. package/build/commands/util/run-client-dev-server.js +46 -0
  61. package/build/commands/util/run-compilers.d.ts +1 -0
  62. package/build/commands/util/run-compilers.js +37 -0
  63. package/build/commands/util/run-server-watch-compiler.d.ts +2 -0
  64. package/build/commands/util/run-server-watch-compiler.js +19 -0
  65. package/build/commands/util/tsc.d.ts +1 -0
  66. package/build/commands/util/tsc.js +13 -0
  67. package/build/commands/util/yarn.d.ts +5 -0
  68. package/build/commands/util/yarn.js +55 -0
  69. package/build/configs/app-configs/calculate-dependent-config.d.ts +9 -0
  70. package/build/configs/app-configs/calculate-dependent-config.js +38 -0
  71. package/build/configs/app-configs/get-defaults.d.ts +5 -0
  72. package/build/configs/app-configs/get-defaults.js +139 -0
  73. package/build/configs/app-configs/index.d.ts +6 -0
  74. package/build/configs/app-configs/index.js +24 -0
  75. package/build/configs/app-configs/read-config-file.d.ts +2 -0
  76. package/build/configs/app-configs/read-config-file.js +28 -0
  77. package/build/configs/app-configs/types.d.ts +126 -0
  78. package/build/configs/app-configs/types.js +2 -0
  79. package/build/configs/app-configs/update-with-config-file.d.ts +2 -0
  80. package/build/configs/app-configs/update-with-config-file.js +17 -0
  81. package/build/configs/app-configs/update-with-env.d.ts +2 -0
  82. package/build/configs/app-configs/update-with-env.js +23 -0
  83. package/build/configs/app-configs/update-with-package.d.ts +2 -0
  84. package/build/configs/app-configs/update-with-package.js +13 -0
  85. package/build/configs/app-configs/update-with-presets.d.ts +3 -0
  86. package/build/configs/app-configs/update-with-presets.js +41 -0
  87. package/build/configs/app-configs/validate-settings-keys.d.ts +4 -0
  88. package/build/configs/app-configs/validate-settings-keys.js +13 -0
  89. package/build/configs/app-configs/warn-about-deprecations.d.ts +2 -0
  90. package/build/configs/app-configs/warn-about-deprecations.js +20 -0
  91. package/build/configs/babel-client.d.ts +32 -0
  92. package/build/configs/babel-client.js +72 -0
  93. package/build/configs/babel-dependencies.d.ts +14 -0
  94. package/build/configs/babel-dependencies.js +39 -0
  95. package/build/configs/babel-server.d.ts +27 -0
  96. package/build/configs/babel-server.js +48 -0
  97. package/build/configs/client-env-config/add-env-to-html-template.d.ts +1 -0
  98. package/build/configs/client-env-config/add-env-to-html-template.js +7 -0
  99. package/build/configs/client-env-config/client-config-plugin.d.ts +5 -0
  100. package/build/configs/client-env-config/client-config-plugin.js +26 -0
  101. package/build/configs/client-env-config/constants.d.ts +1 -0
  102. package/build/configs/client-env-config/constants.js +4 -0
  103. package/build/configs/client-env-config/get-env-config.d.ts +2 -0
  104. package/build/configs/client-env-config/get-env-config.js +28 -0
  105. package/build/configs/client-env-config/index.d.ts +3 -0
  106. package/build/configs/client-env-config/index.js +9 -0
  107. package/build/configs/config-extras/minimizers/imagemin/imagemin.d.ts +28 -0
  108. package/build/configs/config-extras/minimizers/imagemin/imagemin.js +65 -0
  109. package/build/configs/config-extras/minimizers/imagemin/index.d.ts +1 -0
  110. package/build/configs/config-extras/minimizers/imagemin/index.js +17 -0
  111. package/build/configs/config-extras/minimizers/index.d.ts +1 -0
  112. package/build/configs/config-extras/minimizers/index.js +17 -0
  113. package/build/configs/dev-server.d.ts +2 -0
  114. package/build/configs/dev-server.js +73 -0
  115. package/build/configs/jest/babel-transform.d.ts +2 -0
  116. package/build/configs/jest/babel-transform.js +6 -0
  117. package/build/configs/jest/css-mock.d.ts +1 -0
  118. package/build/configs/jest/css-mock.js +2 -0
  119. package/build/configs/jest/file-transform.d.ts +3 -0
  120. package/build/configs/jest/file-transform.js +11 -0
  121. package/build/configs/jest/settings.d.ts +21 -0
  122. package/build/configs/jest/settings.js +58 -0
  123. package/build/configs/modules.d.ts +16 -0
  124. package/build/configs/modules.js +149 -0
  125. package/build/configs/mq.css +22 -0
  126. package/build/configs/postcss.config.d.ts +36 -0
  127. package/build/configs/postcss.config.js +71 -0
  128. package/build/configs/postcss.d.ts +2 -0
  129. package/build/configs/postcss.js +11 -0
  130. package/build/configs/process-assets-plugin-output.d.ts +2 -0
  131. package/build/configs/process-assets-plugin-output.js +45 -0
  132. package/build/configs/server-externals-exemptions.d.ts +1 -0
  133. package/build/configs/server-externals-exemptions.js +21 -0
  134. package/build/configs/stats-options.d.ts +3 -0
  135. package/build/configs/stats-options.js +49 -0
  136. package/build/configs/supporting-browsers.d.ts +2 -0
  137. package/build/configs/supporting-browsers.js +8 -0
  138. package/build/configs/swc.d.ts +4 -0
  139. package/build/configs/swc.js +35 -0
  140. package/build/configs/util/apply-overrides.d.ts +76 -0
  141. package/build/configs/util/apply-overrides.js +52 -0
  142. package/build/configs/util/check-node-version.d.ts +2 -0
  143. package/build/configs/util/check-node-version.js +7 -0
  144. package/build/configs/util/find-loader.d.ts +2 -0
  145. package/build/configs/util/find-loader.js +24 -0
  146. package/build/configs/util/find-plugin.d.ts +85 -0
  147. package/build/configs/util/find-plugin.js +22 -0
  148. package/build/configs/util/get-entry.d.ts +9 -0
  149. package/build/configs/util/get-entry.js +22 -0
  150. package/build/configs/util/get-polyfills.d.ts +2 -0
  151. package/build/configs/util/get-polyfills.js +26 -0
  152. package/build/configs/util/get-webpack-cache-dependencies.d.ts +1 -0
  153. package/build/configs/util/get-webpack-cache-dependencies.js +18 -0
  154. package/build/configs/util/install-sourcemap-support.d.ts +1 -0
  155. package/build/configs/util/install-sourcemap-support.js +11 -0
  156. package/build/configs/util/node-assets-ignore.d.ts +0 -0
  157. package/build/configs/util/node-assets-ignore.js +33 -0
  158. package/build/configs/util/noop.d.ts +1 -0
  159. package/build/configs/util/noop.js +2 -0
  160. package/build/configs/util/register-ts-node.d.ts +0 -0
  161. package/build/configs/util/register-ts-node.js +18 -0
  162. package/build/configs/util/resolve.d.ts +12 -0
  163. package/build/configs/util/resolve.js +29 -0
  164. package/build/configs/webpack.client.d.ts +10 -0
  165. package/build/configs/webpack.client.dev.d.ts +2 -0
  166. package/build/configs/webpack.client.dev.js +15 -0
  167. package/build/configs/webpack.client.js +475 -0
  168. package/build/configs/webpack.client.prod.d.ts +2 -0
  169. package/build/configs/webpack.client.prod.js +15 -0
  170. package/build/configs/webpack.server.d.ts +2 -0
  171. package/build/configs/webpack.server.dev.d.ts +2 -0
  172. package/build/configs/webpack.server.dev.js +11 -0
  173. package/build/configs/webpack.server.js +256 -0
  174. package/build/configs/webpack.server.prod.d.ts +2 -0
  175. package/build/configs/webpack.server.prod.js +11 -0
  176. package/build/index.d.ts +5 -0
  177. package/build/index.js +9 -0
  178. package/build/plugins/arui-runtime/arui-runtime-module.d.ts +7 -0
  179. package/build/plugins/arui-runtime/arui-runtime-module.js +20 -0
  180. package/build/plugins/arui-runtime/index.d.ts +11 -0
  181. package/build/plugins/arui-runtime/index.js +47 -0
  182. package/build/plugins/postcss-global-variables/postcss-global-variables.d.ts +6 -0
  183. package/build/plugins/postcss-global-variables/postcss-global-variables.js +38 -0
  184. package/build/plugins/postcss-global-variables/utils/utils.d.ts +7 -0
  185. package/build/plugins/postcss-global-variables/utils/utils.js +91 -0
  186. package/build/plugins/postcss-prefix-selector.d.ts +6 -0
  187. package/build/plugins/postcss-prefix-selector.js +62 -0
  188. package/build/plugins/reload-server-plugin.d.ts +10 -0
  189. package/build/plugins/reload-server-plugin.js +44 -0
  190. package/build/plugins/turn-off-split-remote-entry.d.ts +11 -0
  191. package/build/plugins/turn-off-split-remote-entry.js +71 -0
  192. package/build/plugins/watch-missing-node-modules-plugin.d.ts +6 -0
  193. package/build/plugins/watch-missing-node-modules-plugin.js +20 -0
  194. package/build/templates/base-nginx.conf.template.d.ts +2 -0
  195. package/build/templates/base-nginx.conf.template.js +61 -0
  196. package/build/templates/dockerfile-compiled.template.d.ts +2 -0
  197. package/build/templates/dockerfile-compiled.template.js +52 -0
  198. package/build/templates/dockerfile.template.d.ts +2 -0
  199. package/build/templates/dockerfile.template.js +41 -0
  200. package/build/templates/html.template.d.ts +1 -0
  201. package/build/templates/html.template.js +25 -0
  202. package/build/templates/nginx.conf.template.d.ts +2 -0
  203. package/build/templates/nginx.conf.template.js +39 -0
  204. package/build/templates/start.template.d.ts +2 -0
  205. package/build/templates/start.template.js +69 -0
  206. package/build/tsconfig-local.tsbuildinfo +1 -0
  207. package/docs/artifact.md +58 -0
  208. package/docs/caveats.md +41 -0
  209. package/docs/client-only.md +77 -0
  210. package/docs/commands.md +125 -0
  211. package/docs/compilers.md +18 -0
  212. package/docs/examples.md +100 -0
  213. package/docs/modules.md +780 -0
  214. package/docs/overrides.md +167 -0
  215. package/docs/presets.md +65 -0
  216. package/docs/settings.md +287 -0
  217. package/jest-preset.js +5 -0
  218. package/package.json +180 -0
  219. package/stylelint.config.js +11 -0
  220. package/tsconfig-local.json +16 -0
  221. package/tsconfig.eslint.json +5 -0
  222. package/tsconfig.json +71 -0
@@ -0,0 +1,28 @@
1
+ import ImageMinimizerPlugin from 'image-minimizer-webpack-plugin';
2
+ export declare function getImageMinLoader(): false | {
3
+ test: RegExp;
4
+ type: string;
5
+ use: {
6
+ loader: string;
7
+ options: {
8
+ minimizer: {
9
+ implementation: typeof ImageMinimizerPlugin.imageminMinify;
10
+ options: {
11
+ plugins: (false | (string | {
12
+ quality: number;
13
+ progressive: boolean;
14
+ })[] | (string | {
15
+ optimizationLevel: number | undefined;
16
+ bitDepthReduction: boolean | undefined;
17
+ colorTypeReduction: boolean | undefined;
18
+ paletteReduction: boolean | undefined;
19
+ interlaced: boolean | undefined;
20
+ })[] | (string | {
21
+ optimizationLevel: number | undefined;
22
+ interlaced: boolean;
23
+ })[] | undefined)[];
24
+ };
25
+ };
26
+ };
27
+ }[];
28
+ };
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getImageMinLoader = getImageMinLoader;
7
+ const image_minimizer_webpack_plugin_1 = __importDefault(require("image-minimizer-webpack-plugin"));
8
+ const app_configs_1 = require("../../../app-configs");
9
+ function getImageMinLoader() {
10
+ var _a;
11
+ const { svg, gif, jpg, png } = (_a = app_configs_1.configs.imageMinimizer) !== null && _a !== void 0 ? _a : {};
12
+ const doesAnyMinificationEnabled = (svg === null || svg === void 0 ? void 0 : svg.enabled) || (gif === null || gif === void 0 ? void 0 : gif.enabled) || (jpg === null || jpg === void 0 ? void 0 : jpg.enabled) || (png === null || png === void 0 ? void 0 : png.enabled);
13
+ if (!doesAnyMinificationEnabled) {
14
+ return false;
15
+ }
16
+ const loaderExtensions = [
17
+ (svg === null || svg === void 0 ? void 0 : svg.enabled) && 'svg',
18
+ (gif === null || gif === void 0 ? void 0 : gif.enabled) && 'gif',
19
+ (jpg === null || jpg === void 0 ? void 0 : jpg.enabled) && 'jpe?g',
20
+ (png === null || png === void 0 ? void 0 : png.enabled) && 'png',
21
+ ].filter(Boolean);
22
+ return {
23
+ test: new RegExp(`\\.(${loaderExtensions.join('|')})$`),
24
+ type: 'assets',
25
+ use: [
26
+ {
27
+ loader: image_minimizer_webpack_plugin_1.default.loader,
28
+ options: {
29
+ minimizer: {
30
+ implementation: image_minimizer_webpack_plugin_1.default.imageminMinify,
31
+ options: {
32
+ plugins: [
33
+ (jpg === null || jpg === void 0 ? void 0 : jpg.enabled) && [
34
+ 'mozjpeg',
35
+ {
36
+ quality: jpg === null || jpg === void 0 ? void 0 : jpg.quality,
37
+ progressive: true,
38
+ },
39
+ ],
40
+ (png === null || png === void 0 ? void 0 : png.enabled) && [
41
+ 'optipng',
42
+ {
43
+ optimizationLevel: png === null || png === void 0 ? void 0 : png.optimizationLevel,
44
+ bitDepthReduction: png === null || png === void 0 ? void 0 : png.bitDepthReduction,
45
+ colorTypeReduction: png === null || png === void 0 ? void 0 : png.colorTypeReduction,
46
+ paletteReduction: png === null || png === void 0 ? void 0 : png.paletteReduction,
47
+ interlaced: png === null || png === void 0 ? void 0 : png.interlaced,
48
+ },
49
+ ],
50
+ (svg === null || svg === void 0 ? void 0 : svg.enabled) && ['svgo'],
51
+ (gif === null || gif === void 0 ? void 0 : gif.enabled) && [
52
+ 'gifsicle',
53
+ {
54
+ optimizationLevel: gif === null || gif === void 0 ? void 0 : gif.optimizationLevel,
55
+ interlaced: true,
56
+ },
57
+ ],
58
+ ].filter(Boolean),
59
+ },
60
+ },
61
+ },
62
+ },
63
+ ],
64
+ };
65
+ }
@@ -0,0 +1 @@
1
+ export * from './imagemin';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./imagemin"), exports);
@@ -0,0 +1 @@
1
+ export * from './imagemin';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./imagemin"), exports);
@@ -0,0 +1,2 @@
1
+ declare const devServerConfig: import("webpack-dev-server").Configuration;
2
+ export default devServerConfig;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
8
+ const app_configs_1 = require("./app-configs");
9
+ const client_env_config_1 = require("./client-env-config");
10
+ const serverProxyConfig = Object.assign({ context: ['/**'], target: `http://127.0.0.1:${app_configs_1.configs.serverPort}`, bypass: (req) => {
11
+ var _a;
12
+ const assetsRoot = path_1.default.normalize(`/${app_configs_1.configs.publicPath}`).replace(/\\/g, '/');
13
+ if ((_a = req === null || req === void 0 ? void 0 : req.url) === null || _a === void 0 ? void 0 : _a.startsWith(assetsRoot)) {
14
+ return req.url;
15
+ }
16
+ return null;
17
+ } }, (app_configs_1.configs.devSourceMaps && app_configs_1.configs.devSourceMaps.includes('eval') || app_configs_1.configs.devServerCors
18
+ ? {
19
+ onProxyRes: (proxyRes) => {
20
+ // Для дев режима, когда мы используем в качестве соурсмапов что-то, основанное на eval - нужно
21
+ // разрешить браузеру исполнять наш код, даже когда content-security-policy приложения не позволяет этого делать.
22
+ if (app_configs_1.configs.devSourceMaps && app_configs_1.configs.devSourceMaps.includes('eval')) {
23
+ const cspHeader = proxyRes.headers['content-security-policy'];
24
+ if (typeof cspHeader === 'string' &&
25
+ !cspHeader.includes('unsafe-eval')) {
26
+ proxyRes.headers['content-security-policy'] = cspHeader.replace(/script-src/, "script-src 'unsafe-eval'");
27
+ }
28
+ }
29
+ // если включен devServerCors, то нужно принудительно менять статус ответа на 200, чтобы
30
+ // браузер не отклонял ответы с CORS
31
+ if (app_configs_1.configs.devServerCors && proxyRes.method === 'OPTIONS') {
32
+ proxyRes.statusCode = 200;
33
+ }
34
+ },
35
+ }
36
+ : {}));
37
+ const devServerConfig = (0, apply_overrides_1.default)('devServer', {
38
+ port: app_configs_1.configs.clientServerPort,
39
+ liveReload: false,
40
+ client: {
41
+ overlay: {
42
+ errors: true,
43
+ warnings: false,
44
+ },
45
+ },
46
+ devMiddleware: {
47
+ publicPath: `/${app_configs_1.configs.publicPath}`,
48
+ // dev-сервер не может корректно обработать файлы, которые лежат на уровень выше чем publicPath, а html,
49
+ // создаваемый для client-only режима как раз такой. Так же работает и env-config.json
50
+ writeToDisk: (filename) => filename.endsWith('.html') || filename.endsWith(client_env_config_1.ENV_CONFIG_FILENAME),
51
+ },
52
+ static: [app_configs_1.configs.serverOutputPath, app_configs_1.configs.clientOutputPath],
53
+ proxy: getProxyConfig(),
54
+ headers: app_configs_1.configs.devServerCors
55
+ ? {
56
+ 'Access-Control-Allow-Origin': '*',
57
+ 'Access-Control-Allow-Headers': '*',
58
+ 'Access-Control-Allow-Methods': '*',
59
+ }
60
+ : {},
61
+ });
62
+ function getProxyConfig() {
63
+ const proxyConfig = [];
64
+ const userProxyConfig = app_configs_1.configs.proxy;
65
+ if (!app_configs_1.configs.clientOnly) {
66
+ proxyConfig.push(serverProxyConfig);
67
+ }
68
+ if (Array.isArray(userProxyConfig)) {
69
+ proxyConfig.push(...userProxyConfig);
70
+ }
71
+ return proxyConfig;
72
+ }
73
+ exports.default = devServerConfig;
@@ -0,0 +1,2 @@
1
+ declare const _exports: import("@jest/transform").SyncTransformer<babel.TransformOptions>;
2
+ export = _exports;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // TODO: remove eslint-disable-next-line
3
+ /* eslint-disable @typescript-eslint/no-var-requires */
4
+ const babelJest = require('babel-jest');
5
+ const babelPresets = require('../babel-server');
6
+ module.exports = babelJest.createTransformer(babelPresets.default);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ export function process(src: any, filename: any): {
2
+ code: string;
3
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // TODO: remove eslint-disable-next-line
3
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
4
+ const path = require('path');
5
+ // This is a custom Jest transformer turning file imports into filenames.
6
+ // http://facebook.github.io/jest/docs/en/webpack.html
7
+ module.exports = {
8
+ process(src, filename) {
9
+ return { code: `module.exports = ${JSON.stringify(path.basename(filename))};` };
10
+ },
11
+ };
@@ -0,0 +1,21 @@
1
+ export let testRegex: string;
2
+ export let moduleFileExtensions: string[];
3
+ export let collectCoverageFrom: string[];
4
+ export namespace testEnvironmentOptions {
5
+ let url: string;
6
+ }
7
+ export let transform: {
8
+ '^.+\\.jsx?$': string | (string | import("@swc/types").Options)[];
9
+ '^.+\\.mjs$': string | (string | import("@swc/types").Options)[];
10
+ '^.+\\.tsx?$': string | (string | import("@swc/types").Options)[];
11
+ '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': string;
12
+ };
13
+ export let moduleNameMapper: {
14
+ '\\.css$': string;
15
+ };
16
+ export let snapshotSerializers: string[];
17
+ export let globals: {
18
+ 'ts-jest': {
19
+ tsconfig: string | null;
20
+ };
21
+ };
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-var-requires */
3
+ // Мы используем эти настройки сразу в двух местах - в jest-presets и в настройках jest-а, которые мы загружаем в самих скриптах
4
+ // jest-presets могут использоваться внешними утилитами, которые используют разработчики, настройки в скриптах
5
+ // используются при запуске `arui-scripts test`. Посколько в jest жестко зафиксировано где именно должен лежать файл с пресетами
6
+ // нам приходится отвязывать его от основного кода скриптов
7
+ const fs = require('fs');
8
+ const { pathsToModuleNameMapper } = require('ts-jest');
9
+ const { parseConfigFileTextToJson } = require('typescript');
10
+ const { swcJestConfig } = require('../swc');
11
+ const configs = require('../app-configs').default;
12
+ module.exports = {
13
+ testRegex: 'src/.*(((/__test__/|/__tests__/).*)|(test|spec|tests)).(jsx?|tsx?)$',
14
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
15
+ collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
16
+ testEnvironmentOptions: {
17
+ url: 'http://localhost',
18
+ },
19
+ transform: {
20
+ '^.+\\.jsx?$': getJsTransformer(),
21
+ '^.+\\.mjs$': getJsTransformer(),
22
+ '^.+\\.tsx?$': getTsTransformer(),
23
+ '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': require.resolve('./file-transform'),
24
+ },
25
+ moduleNameMapper: Object.assign({
26
+ // replace all css files with simple empty exports
27
+ '\\.css$': require.resolve('./css-mock') }, pathsToModuleNameMapper(getPathMapping(), { prefix: '<rootDir>/' })),
28
+ snapshotSerializers: [require.resolve('jest-snapshot-serializer-class-name-to-string')],
29
+ globals: {
30
+ 'ts-jest': {
31
+ tsconfig: configs.tsconfig,
32
+ },
33
+ },
34
+ };
35
+ function getPathMapping() {
36
+ var _a;
37
+ if (!configs.tsconfig) {
38
+ return {};
39
+ }
40
+ const tsConfigText = fs.readFileSync(configs.tsconfig, 'utf8');
41
+ const tsConfig = parseConfigFileTextToJson(configs.tsconfig, tsConfigText);
42
+ return ((_a = tsConfig.config.compilerOptions) === null || _a === void 0 ? void 0 : _a.paths) || {};
43
+ }
44
+ function getTsTransformer() {
45
+ if (configs.jestCodeTransformer === 'tsc') {
46
+ return require.resolve('ts-jest');
47
+ }
48
+ if (configs.jestCodeTransformer === 'swc') {
49
+ return [require.resolve('@swc/jest'), swcJestConfig];
50
+ }
51
+ return require.resolve('./babel-transform');
52
+ }
53
+ function getJsTransformer() {
54
+ if (configs.jestCodeTransformer === 'swc') {
55
+ return [require.resolve('@swc/jest'), swcJestConfig];
56
+ }
57
+ return require.resolve('./babel-transform');
58
+ }
@@ -0,0 +1,16 @@
1
+ import * as rspack from '@rspack/core';
2
+ import { CompatModuleConfig } from './app-configs/types';
3
+ export declare function haveExposedDefaultModules(): Record<string, string> | undefined;
4
+ export declare const MODULES_ENTRY_NAME = "remoteEntry.js";
5
+ export declare function patchMainWebpackConfigForModules(webpackConf: rspack.Configuration): rspack.RspackOptions;
6
+ export declare function getCssPrefixForModule(module: CompatModuleConfig): string | undefined;
7
+ export declare function getExposeLoadersFormCompatModules(): {
8
+ test: string;
9
+ use: {
10
+ loader: string;
11
+ options: {
12
+ exposes: string[];
13
+ };
14
+ }[];
15
+ }[];
16
+ export declare function patchWebpackConfigForCompat(module: CompatModuleConfig, webpackConf: rspack.Configuration): rspack.RspackOptions;
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.MODULES_ENTRY_NAME = void 0;
27
+ exports.haveExposedDefaultModules = haveExposedDefaultModules;
28
+ exports.patchMainWebpackConfigForModules = patchMainWebpackConfigForModules;
29
+ exports.getCssPrefixForModule = getCssPrefixForModule;
30
+ exports.getExposeLoadersFormCompatModules = getExposeLoadersFormCompatModules;
31
+ exports.patchWebpackConfigForCompat = patchWebpackConfigForCompat;
32
+ // TODO: remove eslint-disable
33
+ /* eslint-disable no-param-reassign */
34
+ const rspack = __importStar(require("@rspack/core"));
35
+ const postcss_prefix_selector_1 = require("../plugins/postcss-prefix-selector");
36
+ const turn_off_split_remote_entry_1 = require("../plugins/turn-off-split-remote-entry");
37
+ const find_loader_1 = require("./util/find-loader");
38
+ const app_configs_1 = require("./app-configs");
39
+ function haveExposedDefaultModules() {
40
+ var _a;
41
+ return (_a = app_configs_1.configs.modules) === null || _a === void 0 ? void 0 : _a.exposes;
42
+ }
43
+ exports.MODULES_ENTRY_NAME = 'remoteEntry.js';
44
+ function patchMainWebpackConfigForModules(webpackConf) {
45
+ var _a;
46
+ if (app_configs_1.configs.disableModulesSupport) {
47
+ // проект хочет сам разбираться с WMF и прочими вещами, полностью отключаем обработку модулей на своей стороне
48
+ return webpackConf;
49
+ }
50
+ if (!((_a = webpackConf.module) === null || _a === void 0 ? void 0 : _a.rules) || !webpackConf.plugins) {
51
+ // делаем TS счастливым, на самом деле module и plugins у нас будут всегда
52
+ return webpackConf;
53
+ }
54
+ // Добавляем expose loader для библиотек, которые мы хотим вынести в глобальную область видимости
55
+ webpackConf.module.rules.unshift(...getExposeLoadersFormCompatModules());
56
+ if (!app_configs_1.configs.modules || !webpackConf.output || !webpackConf.plugins) {
57
+ // webpack по умолчанию всегда добавлял runtime для шаринга, даже когда модули не включены.
58
+ // Rspack этого больше не делает, поэтому добавляем плагин для рантайма самостоятельно
59
+ webpackConf.plugins.push(new rspack.sharing.ProvideSharedPlugin({ provides: {} }));
60
+ return webpackConf;
61
+ }
62
+ const { cssPrefix } = app_configs_1.configs.modules.options || {};
63
+ if (cssPrefix) {
64
+ addCssPrefix(webpackConf, cssPrefix);
65
+ }
66
+ webpackConf.output.publicPath = haveExposedDefaultModules()
67
+ ? 'auto' // Для того чтобы модули могли подключаться из разных мест, нам необходимо использовать auto. Для корректной работы в IE надо подключaть https://github.com/amiller-gh/currentScript-polyfill
68
+ : app_configs_1.configs.publicPath;
69
+ webpackConf.plugins.push(new rspack.container.ModuleFederationPlugin({
70
+ name: app_configs_1.configs.modules.name || app_configs_1.configs.normalizedName,
71
+ filename: app_configs_1.configs.modules.exposes ? exports.MODULES_ENTRY_NAME : undefined,
72
+ shared: app_configs_1.configs.modules.shared,
73
+ exposes: app_configs_1.configs.modules.exposes,
74
+ }), new turn_off_split_remote_entry_1.TurnOffSplitRemoteEntry(app_configs_1.configs.modules.name || app_configs_1.configs.normalizedName));
75
+ return webpackConf;
76
+ }
77
+ function getCssPrefixForModule(module) {
78
+ if (module.cssPrefix) {
79
+ return module.cssPrefix;
80
+ }
81
+ if (module.cssPrefix === false) {
82
+ return undefined;
83
+ }
84
+ return `.module-${module.name}`;
85
+ }
86
+ function getExposeLoadersFormCompatModules() {
87
+ var _a;
88
+ const shared = (_a = app_configs_1.configs.compatModules) === null || _a === void 0 ? void 0 : _a.shared;
89
+ if (!shared) {
90
+ return [];
91
+ }
92
+ return Object.keys(shared).map((libraryName) => {
93
+ const globalVarName = shared[libraryName];
94
+ return {
95
+ test: require.resolve(libraryName),
96
+ use: [
97
+ {
98
+ loader: require.resolve('expose-loader'),
99
+ options: {
100
+ exposes: [globalVarName],
101
+ },
102
+ },
103
+ ],
104
+ };
105
+ });
106
+ }
107
+ function addCssPrefix(webpackConf, cssPrefix) {
108
+ const cssRule = (0, find_loader_1.findLoader)(webpackConf, '/\\.css$/');
109
+ const cssModulesRule = (0, find_loader_1.findLoader)(webpackConf, '/\\.module\\.css$/');
110
+ addPrefixCssRule(cssRule, cssPrefix);
111
+ addPrefixCssRule(cssModulesRule, `:global(${cssPrefix})`);
112
+ }
113
+ function addPrefixCssRule(rule, prefix) {
114
+ if (!rule || !rule.use || !Array.isArray(rule.use)) {
115
+ return;
116
+ }
117
+ const postCssLoader = rule.use.find((loaderConfig) => {
118
+ var _a;
119
+ if (typeof loaderConfig === 'string' ||
120
+ typeof loaderConfig === 'function' ||
121
+ !loaderConfig) {
122
+ return false;
123
+ }
124
+ return ((_a = loaderConfig.loader) === null || _a === void 0 ? void 0 : _a.indexOf('postcss-loader')) !== -1;
125
+ });
126
+ if (!postCssLoader ||
127
+ typeof postCssLoader !== 'object' ||
128
+ !postCssLoader.options ||
129
+ typeof postCssLoader.options !== 'object') {
130
+ return;
131
+ }
132
+ postCssLoader.options.postcssOptions.plugins = [
133
+ ...postCssLoader.options.postcssOptions.plugins,
134
+ (0, postcss_prefix_selector_1.postCssPrefix)({ prefix: `${prefix} ` }),
135
+ ];
136
+ }
137
+ function patchWebpackConfigForCompat(module, webpackConf) {
138
+ webpackConf.externals = Object.assign(Object.assign({}, (webpackConf.externals || {})), (module.externals || {}));
139
+ // Название переменной вебпака, которую он будет использовать для загрузки чанков. Важно чтобы для разных модулей они отличались,
140
+ // иначе несколько модулей из одного приложения будут конфликтовать между собой
141
+ const uniqueName = module.name;
142
+ // Для того чтобы модули могли подключаться из разных мест, нам необходимо использовать publicPath = auto. Для корректной работы в IE надо подключaть https://github.com/amiller-gh/currentScript-polyfill
143
+ webpackConf.output = Object.assign(Object.assign({}, webpackConf.output), { publicPath: 'auto', uniqueName });
144
+ const cssPrefix = getCssPrefixForModule(module);
145
+ if (cssPrefix) {
146
+ addCssPrefix(webpackConf, cssPrefix);
147
+ }
148
+ return webpackConf;
149
+ }
@@ -0,0 +1,22 @@
1
+ @custom-media --small screen;
2
+ @custom-media --small-only screen and (max-width: 47.9375em);
3
+ @custom-media --medium screen and (min-width: 48em);
4
+ @custom-media --medium-only screen and (min-width: 48em) and (max-width: 63.9375em);
5
+ @custom-media --large screen and (min-width 64em);
6
+ @custom-media --large-only screen and (min-width: 64em) and (max-width: 89.9375em);
7
+ @custom-media --xlarge screen and (min-width 90em);
8
+ @custom-media --xlarge-only screen and (min-width: 90em) and (max-width: 119.9375em);
9
+ @custom-media --xxlarge screen and (min-width 120em);
10
+ @custom-media --xxlarge-only screen and (min-width: 120em) and (max-width: 99999999em);
11
+ @custom-media --mobile-s (min-width: 320px);
12
+ @custom-media --mobile-m (min-width: 375px);
13
+ @custom-media --mobile-l (min-width: 412px);
14
+ @custom-media --mobile (max-width: 599px);
15
+ @custom-media --tablet-s (min-width: 600px);
16
+ @custom-media --tablet-m (min-width: 768px);
17
+ @custom-media --tablet (min-width: 600px) and (max-width: 1023px);
18
+ @custom-media --desktop-s (min-width: 1024px);
19
+ @custom-media --desktop-m (min-width: 1280px);
20
+ @custom-media --desktop-l (min-width: 1440px);
21
+ @custom-media --desktop-xl (min-width: 1920px);
22
+ @custom-media --desktop (min-width: 1024px);
@@ -0,0 +1,36 @@
1
+ import type { PluginCreator } from 'postcss';
2
+ type PostCssPluginName = string | PluginCreator<any>;
3
+ type PostcssPlugin = string | [string, unknown] | {
4
+ name: string;
5
+ plugin: PluginCreator<any>;
6
+ options?: unknown;
7
+ };
8
+ /**
9
+ * Функция для создания конфигурационного файла postcss
10
+ * @param {PostCssPluginName[]} plugins список плагинов
11
+ * @param {Object} options коллекция конфигураций плагинов, где ключ - название плагина, а значение - аргумент для инициализации
12
+ * @returns {*}
13
+ */
14
+ export declare function createPostcssConfig(plugins: PostCssPluginName[], options: Record<string, unknown>): PostcssPlugin[];
15
+ export declare const postcssPlugins: PostCssPluginName[];
16
+ export declare const postcssPluginsOptions: {
17
+ 'postcss-import': {
18
+ path: string[];
19
+ };
20
+ postCssGlobalVariables: {
21
+ files: string[];
22
+ };
23
+ 'postcss-url': {
24
+ url: string;
25
+ };
26
+ 'postcss-color-mod-function': {
27
+ unresolved: string;
28
+ };
29
+ 'postcss-custom-properties': {
30
+ preserve: boolean;
31
+ };
32
+ autoprefixer: {
33
+ overrideBrowserslist: string[];
34
+ };
35
+ };
36
+ export {};
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.postcssPluginsOptions = exports.postcssPlugins = void 0;
7
+ exports.createPostcssConfig = createPostcssConfig;
8
+ const path_1 = __importDefault(require("path"));
9
+ const postcss_global_variables_1 = require("../plugins/postcss-global-variables/postcss-global-variables");
10
+ const app_configs_1 = __importDefault(require("./app-configs"));
11
+ const supporting_browsers_1 = __importDefault(require("./supporting-browsers"));
12
+ /**
13
+ * Функция для создания конфигурационного файла postcss
14
+ * @param {PostCssPluginName[]} plugins список плагинов
15
+ * @param {Object} options коллекция конфигураций плагинов, где ключ - название плагина, а значение - аргумент для инициализации
16
+ * @returns {*}
17
+ */
18
+ function createPostcssConfig(plugins, options) {
19
+ return plugins.map((pluginName) => {
20
+ if (typeof pluginName === 'string') {
21
+ return pluginName in options
22
+ ? [pluginName, options[pluginName]]
23
+ : pluginName;
24
+ }
25
+ return {
26
+ name: pluginName.name,
27
+ plugin: pluginName,
28
+ options: options[pluginName.name]
29
+ };
30
+ });
31
+ }
32
+ exports.postcssPlugins = [
33
+ 'postcss-omit-import-tilde',
34
+ 'postcss-import',
35
+ 'postcss-url',
36
+ 'postcss-mixins',
37
+ 'postcss-for',
38
+ 'postcss-each',
39
+ postcss_global_variables_1.postCssGlobalVariables,
40
+ 'postcss-custom-media',
41
+ 'postcss-color-mod-function',
42
+ !app_configs_1.default.keepCssVars && 'postcss-custom-properties',
43
+ !app_configs_1.default.keepCssVars && 'postcss-remove-root',
44
+ 'postcss-strip-units',
45
+ 'postcss-calc',
46
+ 'postcss-color-function',
47
+ 'postcss-nested',
48
+ 'autoprefixer',
49
+ 'postcss-inherit',
50
+ 'postcss-discard-comments',
51
+ ].filter(Boolean);
52
+ exports.postcssPluginsOptions = {
53
+ 'postcss-import': {
54
+ path: ['./src'],
55
+ },
56
+ 'postCssGlobalVariables': {
57
+ files: [path_1.default.join(__dirname, 'mq.css'), app_configs_1.default.componentsTheme].filter(Boolean),
58
+ },
59
+ 'postcss-url': {
60
+ url: 'rebase',
61
+ },
62
+ 'postcss-color-mod-function': {
63
+ unresolved: 'warn',
64
+ },
65
+ 'postcss-custom-properties': {
66
+ preserve: false,
67
+ },
68
+ autoprefixer: {
69
+ overrideBrowserslist: supporting_browsers_1.default,
70
+ },
71
+ };
@@ -0,0 +1,2 @@
1
+ declare const postcssConfig: (string | import("postcss").Processor | import("postcss").Plugin | [string, unknown])[];
2
+ export default postcssConfig;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
7
+ const postcss_config_1 = require("./postcss.config");
8
+ const postcssConfig = (0, apply_overrides_1.default)('postcss', (0, postcss_config_1.createPostcssConfig)(postcss_config_1.postcssPlugins, postcss_config_1.postcssPluginsOptions)).map((plugin) => typeof plugin === 'string' || Array.isArray(plugin)
9
+ ? plugin
10
+ : plugin.plugin(plugin.options));
11
+ exports.default = postcssConfig;
@@ -0,0 +1,2 @@
1
+ import { Assets } from 'assets-webpack-plugin';
2
+ export declare function processAssetsPluginOutput(assets: Assets): string;