arui-scripts 19.0.8 → 20.0.0

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 (99) hide show
  1. package/.turbo/turbo-test.log +7 -7
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +1 -1
  4. package/build/bin/index.js +0 -5
  5. package/build/commands/archive-build/index.js +18 -18
  6. package/build/commands/build/build-wrapper.js +3 -5
  7. package/build/commands/build/client.js +5 -7
  8. package/build/commands/build/index.js +1 -3
  9. package/build/commands/build/server.js +2 -4
  10. package/build/commands/bundle-analyze/index.js +7 -9
  11. package/build/commands/changelog/index.js +27 -9
  12. package/build/commands/docker-build/index.js +18 -18
  13. package/build/commands/docker-build-compiled/index.js +14 -14
  14. package/build/commands/ensure-yarn/index.js +0 -1
  15. package/build/commands/start/client.js +2 -5
  16. package/build/commands/start/index.js +1 -3
  17. package/build/commands/start/print-compiler-output.d.ts +2 -1
  18. package/build/commands/start/print-compiler-output.js +3 -3
  19. package/build/commands/start/server.js +2 -5
  20. package/build/commands/start-prod/client.js +2 -5
  21. package/build/commands/start-prod/index.js +1 -3
  22. package/build/commands/start-prod/server.js +2 -5
  23. package/build/commands/test/index.js +0 -2
  24. package/build/commands/util/client-assets-sizes.js +0 -1
  25. package/build/commands/util/docker-build.js +14 -14
  26. package/build/commands/util/exec.d.ts +1 -2
  27. package/build/commands/util/exec.js +2 -4
  28. package/build/commands/util/format-webpack-messages.d.ts +4 -10
  29. package/build/commands/util/format-webpack-messages.js +21 -22
  30. package/build/commands/util/make-tmp-dir.d.ts +1 -2
  31. package/build/commands/util/make-tmp-dir.js +1 -1
  32. package/build/commands/util/run-client-dev-server.js +7 -9
  33. package/build/commands/util/run-server-watch-compiler.js +4 -7
  34. package/build/configs/app-configs/index.d.ts +0 -1
  35. package/build/configs/app-configs/index.js +0 -1
  36. package/build/configs/app-configs/types.d.ts +2 -2
  37. package/build/configs/app-configs/warn-about-deprecations.js +5 -3
  38. package/build/configs/babel-client.d.ts +1 -2
  39. package/build/configs/babel-client.js +5 -8
  40. package/build/configs/babel-dependencies.js +4 -7
  41. package/build/configs/babel-server.d.ts +1 -2
  42. package/build/configs/babel-server.js +7 -10
  43. package/build/configs/dev-server.d.ts +1 -2
  44. package/build/configs/dev-server.js +7 -6
  45. package/build/configs/jest/babel-transform.js +1 -1
  46. package/build/configs/jest/settings.js +1 -1
  47. package/build/configs/modules.js +5 -3
  48. package/build/configs/postcss.config.d.ts +2 -2
  49. package/build/configs/postcss.config.js +9 -11
  50. package/build/configs/postcss.d.ts +1 -2
  51. package/build/configs/postcss.js +3 -8
  52. package/build/configs/process-assets-plugin-output.js +8 -8
  53. package/build/configs/server-externals-exemptions.js +2 -6
  54. package/build/configs/stats-options.d.ts +1 -2
  55. package/build/configs/stats-options.js +3 -6
  56. package/build/configs/supporting-browsers.d.ts +1 -2
  57. package/build/configs/supporting-browsers.js +3 -6
  58. package/build/configs/swc.js +5 -10
  59. package/build/configs/util/apply-overrides.d.ts +2 -2
  60. package/build/configs/util/apply-overrides.js +5 -9
  61. package/build/configs/util/check-node-version.d.ts +1 -2
  62. package/build/configs/util/check-node-version.js +1 -1
  63. package/build/configs/util/find-loader.js +3 -3
  64. package/build/configs/util/get-entry.d.ts +1 -2
  65. package/build/configs/util/get-entry.js +1 -1
  66. package/build/configs/util/get-polyfills.d.ts +1 -1
  67. package/build/configs/util/get-polyfills.js +1 -14
  68. package/build/configs/util/get-webpack-cache-dependencies.js +4 -7
  69. package/build/configs/util/install-sourcemap-support.js +0 -1
  70. package/build/configs/util/register-ts-node.js +0 -1
  71. package/build/configs/webpack.client.dev.d.ts +1 -2
  72. package/build/configs/webpack.client.dev.js +3 -6
  73. package/build/configs/webpack.client.js +23 -71
  74. package/build/configs/webpack.client.prod.d.ts +1 -2
  75. package/build/configs/webpack.client.prod.js +3 -6
  76. package/build/configs/webpack.server.dev.d.ts +1 -2
  77. package/build/configs/webpack.server.dev.js +3 -6
  78. package/build/configs/webpack.server.js +35 -39
  79. package/build/configs/webpack.server.prod.d.ts +1 -2
  80. package/build/configs/webpack.server.prod.js +3 -6
  81. package/build/plugins/arui-runtime/index.js +2 -2
  82. package/build/plugins/postcss-global-variables/utils/utils.js +4 -4
  83. package/build/plugins/postcss-prefix-selector.js +5 -2
  84. package/build/templates/base-nginx.conf.template.d.ts +1 -2
  85. package/build/templates/base-nginx.conf.template.js +3 -5
  86. package/build/templates/dockerfile-compiled.template.d.ts +1 -2
  87. package/build/templates/dockerfile-compiled.template.js +7 -9
  88. package/build/templates/dockerfile.template.d.ts +1 -2
  89. package/build/templates/dockerfile.template.js +10 -8
  90. package/build/templates/html.template.js +2 -5
  91. package/build/templates/nginx.conf.template.d.ts +1 -2
  92. package/build/templates/nginx.conf.template.js +3 -5
  93. package/build/templates/start.template.d.ts +1 -2
  94. package/build/templates/start.template.js +3 -5
  95. package/build/tsconfig-local.tsbuildinfo +1 -1
  96. package/docs/modules.md +1 -2
  97. package/docs/settings.md +1 -1
  98. package/package.json +2 -2
  99. package/tsconfig.json +2 -1
@@ -1,11 +1,6 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
3
+ exports.postcssConfig = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
7
5
  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;
6
+ exports.postcssConfig = (0, apply_overrides_1.applyOverrides)('postcss', (0, postcss_config_1.createPostcssConfig)(postcss_config_1.postcssPlugins, postcss_config_1.postcssPluginsOptions)).map((plugin) => typeof plugin === 'string' || Array.isArray(plugin) ? plugin : plugin.plugin(plugin.options));
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.processAssetsPluginOutput = processAssetsPluginOutput;
7
7
  const path_1 = __importDefault(require("path"));
8
- const app_configs_1 = __importDefault(require("./app-configs"));
8
+ const app_configs_1 = require("./app-configs");
9
9
  const modules_1 = require("./modules");
10
10
  function processAssetsPluginOutput(assets) {
11
11
  var _a;
@@ -18,19 +18,19 @@ function processAssetsPluginOutput(assets) {
18
18
  };
19
19
  });
20
20
  // добавляем в манифест js-файлы для модулей
21
- Object.keys(((_a = app_configs_1.default.modules) === null || _a === void 0 ? void 0 : _a.exposes) || {}).forEach((moduleName) => {
21
+ Object.keys(((_a = app_configs_1.configs.modules) === null || _a === void 0 ? void 0 : _a.exposes) || {}).forEach((moduleName) => {
22
22
  var _a, _b;
23
- if ((_b = (_a = app_configs_1.default.compatModules) === null || _a === void 0 ? void 0 : _a.exposes) === null || _b === void 0 ? void 0 : _b[moduleName]) {
23
+ if ((_b = (_a = app_configs_1.configs.compatModules) === null || _a === void 0 ? void 0 : _a.exposes) === null || _b === void 0 ? void 0 : _b[moduleName]) {
24
24
  throw new Error(`Модуль ${moduleName} определен как module и как compat. Поменяйте название одного из модулей или удалите его`);
25
25
  }
26
26
  adjustedAssets[moduleName] = {
27
27
  mode: 'default',
28
- js: path_1.default.join(app_configs_1.default.publicPath, modules_1.MODULES_ENTRY_NAME),
28
+ js: path_1.default.join(app_configs_1.configs.publicPath, modules_1.MODULES_ENTRY_NAME),
29
29
  };
30
30
  });
31
31
  const result = Object.assign(Object.assign({}, adjustedAssets), { __metadata__: {
32
- version: app_configs_1.default.version,
33
- name: app_configs_1.default.normalizedName,
32
+ version: app_configs_1.configs.version,
33
+ name: app_configs_1.configs.normalizedName,
34
34
  } });
35
35
  return JSON.stringify(result);
36
36
  }
@@ -39,7 +39,7 @@ function replaceAutoPath(assets) {
39
39
  return assets;
40
40
  }
41
41
  if (Array.isArray(assets)) {
42
- return assets.map((asset) => asset.replace(/^auto\//, app_configs_1.default.publicPath));
42
+ return assets.map((asset) => asset.replace(/^auto\//, app_configs_1.configs.publicPath));
43
43
  }
44
- return assets.replace(/^auto\//, app_configs_1.default.publicPath);
44
+ return assets.replace(/^auto\//, app_configs_1.configs.publicPath);
45
45
  }
@@ -1,12 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.serverExternalsExemptions = void 0;
7
- const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
8
- exports.serverExternalsExemptions = (0, apply_overrides_1.default)('serverExternalsExemptions', [
9
- /^arui-feather/,
4
+ const apply_overrides_1 = require("./util/apply-overrides");
5
+ exports.serverExternalsExemptions = (0, apply_overrides_1.applyOverrides)('serverExternalsExemptions', [
10
6
  /^arui-ft-private/,
11
7
  /^arui-private/,
12
8
  /^alfaform-core-ui/,
@@ -1,3 +1,2 @@
1
1
  import type { RspackOptionsNormalized } from '@rspack/core';
2
- declare const statsOptions: RspackOptionsNormalized['stats'];
3
- export default statsOptions;
2
+ export declare const statsOptions: RspackOptionsNormalized['stats'];
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
7
- const statsOptions = (0, apply_overrides_1.default)('stats', {
3
+ exports.statsOptions = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
5
+ exports.statsOptions = (0, apply_overrides_1.applyOverrides)('stats', {
8
6
  // Add asset Information
9
7
  assets: false,
10
8
  // Add information about cached (not built) modules
@@ -46,4 +44,3 @@ const statsOptions = (0, apply_overrides_1.default)('stats', {
46
44
  // ignore warning from missing types
47
45
  warningsFilter: /export .* was not found in/,
48
46
  });
49
- exports.default = statsOptions;
@@ -1,2 +1 @@
1
- declare const supportingBrowsers: string[];
2
- export default supportingBrowsers;
1
+ export declare const supportingBrowsers: string[];
@@ -1,8 +1,5 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
7
- const supportingBrowsers = (0, apply_overrides_1.default)(['browsers', 'supportingBrowsers'], ['last 2 versions', 'not dead', 'Android >= 6', 'iOS >= 14']);
8
- exports.default = supportingBrowsers;
3
+ exports.supportingBrowsers = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
5
+ exports.supportingBrowsers = (0, apply_overrides_1.applyOverrides)(['browsers', 'supportingBrowsers'], ['last 2 versions', 'not dead', 'Android >= 6', 'iOS >= 14']);
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.swcJestConfig = exports.swcServerConfig = exports.swcClientConfig = void 0;
7
- const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
4
+ const apply_overrides_1 = require("./util/apply-overrides");
8
5
  const app_configs_1 = require("./app-configs");
9
6
  const swcConfig = {
10
7
  env: { coreJs: '3', mode: 'entry' },
@@ -23,13 +20,11 @@ const swcConfig = {
23
20
  },
24
21
  experimental: app_configs_1.configs.collectCoverage
25
22
  ? {
26
- plugins: [
27
- ['swc-plugin-coverage-instrument', {}],
28
- ],
23
+ plugins: [['swc-plugin-coverage-instrument', {}]],
29
24
  }
30
25
  : {},
31
26
  },
32
27
  };
33
- exports.swcClientConfig = (0, apply_overrides_1.default)(['swc', 'swcClient'], swcConfig);
34
- exports.swcServerConfig = (0, apply_overrides_1.default)(['swc', 'swcServer'], swcConfig);
35
- exports.swcJestConfig = (0, apply_overrides_1.default)(['swc', 'swcJest'], swcConfig);
28
+ exports.swcClientConfig = (0, apply_overrides_1.applyOverrides)(['swc', 'swcClient'], swcConfig);
29
+ exports.swcServerConfig = (0, apply_overrides_1.applyOverrides)(['swc', 'swcServer'], swcConfig);
30
+ exports.swcJestConfig = (0, apply_overrides_1.applyOverrides)(['swc', 'swcJest'], swcConfig);
@@ -72,5 +72,5 @@ export type OverrideFile = {
72
72
  * @param args Дополнительные аргументы, которые будут переданы в функцию оверрайда
73
73
  * @returns {*}
74
74
  */
75
- declare function applyOverrides<T extends Overrides[Key], Key extends keyof Overrides, Args = Key extends keyof OverridesAdditionalArgs ? OverridesAdditionalArgs[Key] : undefined>(overridesKey: Key | Key[], config: T, args?: any): T;
76
- export default applyOverrides;
75
+ export declare function applyOverrides<T extends Overrides[Key], Key extends keyof Overrides, Args = Key extends keyof OverridesAdditionalArgs ? OverridesAdditionalArgs[Key] : undefined>(overridesKey: Key | Key[], config: T, args?: any): T;
76
+ export {};
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const app_configs_1 = __importDefault(require("../app-configs"));
3
+ exports.applyOverrides = applyOverrides;
4
+ const app_configs_1 = require("../app-configs");
7
5
  let overrides = [];
8
- overrides = app_configs_1.default.overridesPath.map((path) => {
6
+ overrides = app_configs_1.configs.overridesPath.map((path) => {
9
7
  try {
10
8
  // eslint-disable-next-line import/no-dynamic-require, global-require, @typescript-eslint/no-var-requires
11
9
  const requireResult = require(path);
@@ -36,17 +34,15 @@ function applyOverrides(overridesKey, config, args) {
36
34
  }
37
35
  overridesKey.forEach((key) => {
38
36
  overrides.forEach((override) => {
39
- // eslint-disable-next-line no-prototype-builtins
40
- if (override.hasOwnProperty(key)) {
37
+ if (Object.prototype.hasOwnProperty.call(override, key)) {
41
38
  const overrideFn = override[key];
42
39
  if (typeof overrideFn !== 'function') {
43
40
  throw new TypeError(`Override ${key} must be a function`);
44
41
  }
45
42
  // eslint-disable-next-line no-param-reassign
46
- config = overrideFn(config, app_configs_1.default, args);
43
+ config = overrideFn(config, app_configs_1.configs, args);
47
44
  }
48
45
  });
49
46
  });
50
47
  return config;
51
48
  }
52
- exports.default = applyOverrides;
@@ -1,2 +1 @@
1
- declare function checkNodeVersion(majorVersion: number): boolean;
2
- export default checkNodeVersion;
1
+ export declare function checkNodeVersion(majorVersion: number): boolean;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkNodeVersion = checkNodeVersion;
3
4
  function checkNodeVersion(majorVersion) {
4
5
  const actualVersion = process.versions.node.split('.');
5
6
  return parseInt(actualVersion[0], 10) >= majorVersion;
6
7
  }
7
- exports.default = checkNodeVersion;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.findLoader = findLoader;
4
4
  function findLoader(config, testRule) {
5
- var _a;
6
- for (const rule of config.module.rules) {
5
+ var _a, _b, _c;
6
+ for (const rule of (_b = (_a = config.module) === null || _a === void 0 ? void 0 : _a.rules) !== null && _b !== void 0 ? _b : []) {
7
7
  if (rule === '...' || !rule) {
8
8
  // Webpack имеет странный тип для rules, который позволяет в него положить строку '...'. Успокаиваем TS
9
9
  // eslint-disable-next-line no-continue
@@ -14,7 +14,7 @@ function findLoader(config, testRule) {
14
14
  }
15
15
  if (rule.oneOf) {
16
16
  for (const oneOfRule of rule.oneOf) {
17
- if (oneOfRule && oneOfRule.test && ((_a = oneOfRule === null || oneOfRule === void 0 ? void 0 : oneOfRule.test) === null || _a === void 0 ? void 0 : _a.toString()) === testRule) {
17
+ if (oneOfRule && oneOfRule.test && ((_c = oneOfRule === null || oneOfRule === void 0 ? void 0 : oneOfRule.test) === null || _c === void 0 ? void 0 : _c.toString()) === testRule) {
18
18
  return oneOfRule;
19
19
  }
20
20
  }
@@ -5,5 +5,4 @@ export type Entry = string | string[] | Record<string, string | string[]>;
5
5
  * @param args Дополнительные аргументы, которые будут переданы в getSingleEntry функцию
6
6
  * @returns {*}
7
7
  */
8
- declare function getEntry<AdditionalArgs extends unknown[]>(entryPoint: Entry, getSingleEntry: (entry: string[], ...args: AdditionalArgs) => string[], ...args: AdditionalArgs): string[] | Record<string, string | string[]>;
9
- export default getEntry;
8
+ export declare function getEntry<AdditionalArgs extends unknown[]>(entryPoint: Entry, getSingleEntry: (entry: string[], ...args: AdditionalArgs) => string[], ...args: AdditionalArgs): string[] | Record<string, string | string[]>;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEntry = getEntry;
3
4
  /**
4
5
  * @param {string|string[]|object} entryPoint Строка, массив строк или объект с энтрипоинтами
5
6
  * @param {Function} getSingleEntry Функция, возвращающая конфигурацию для одного entryPoint
@@ -19,4 +20,3 @@ function getEntry(entryPoint, getSingleEntry, ...args) {
19
20
  return Object.assign(Object.assign({}, result), { [entryPointName]: entry });
20
21
  }, {});
21
22
  }
22
- exports.default = getEntry;
@@ -1,2 +1,2 @@
1
1
  import { AppConfigs } from '../app-configs/types';
2
- export declare function getPolyfills(config: AppConfigs, requireResolve?: RequireResolve): string[];
2
+ export declare function getPolyfills(config: AppConfigs): string[];
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPolyfills = getPolyfills;
4
- // require.resolve вынесен как параметр функции для того, чтоб это можно было протестировать.
5
- // на данный момент jest не дает возможности мокать require.resolve https://github.com/facebook/jest/issues/9543
6
- function getPolyfills(config, requireResolve = require.resolve) {
4
+ function getPolyfills(config) {
7
5
  const polyfills = [];
8
6
  if (config.clientPolyfillsEntry && Array.isArray(config.clientPolyfillsEntry)) {
9
7
  polyfills.push(...config.clientPolyfillsEntry);
@@ -11,16 +9,5 @@ function getPolyfills(config, requireResolve = require.resolve) {
11
9
  else if (config.clientPolyfillsEntry) {
12
10
  polyfills.push(config.clientPolyfillsEntry);
13
11
  }
14
- else {
15
- // Для сохранения обратной совместимости нам надо добавлять полифилы из физера только тогда, когда пользователь
16
- // не задал свои кастомные полифилы.
17
- try {
18
- const aruiPolyfills = requireResolve('arui-feather/polyfills');
19
- polyfills.push(aruiPolyfills);
20
- }
21
- catch (error) {
22
- // just ignore it
23
- }
24
- }
25
12
  return polyfills;
26
13
  }
@@ -1,18 +1,15 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.getWebpackCacheDependencies = getWebpackCacheDependencies;
7
- const app_configs_1 = __importDefault(require("../app-configs"));
4
+ const app_configs_1 = require("../app-configs");
8
5
  const read_config_file_1 = require("../app-configs/read-config-file");
9
6
  const update_with_presets_1 = require("../app-configs/update-with-presets");
10
7
  function getWebpackCacheDependencies() {
11
8
  return {
12
- overrides: app_configs_1.default.overridesPath,
9
+ overrides: app_configs_1.configs.overridesPath,
13
10
  appConfigs: [
14
- (0, read_config_file_1.getConfigFilePath)(app_configs_1.default.cwd),
15
- (0, update_with_presets_1.getPresetsConfigPath)(app_configs_1.default, app_configs_1.default.cwd),
11
+ (0, read_config_file_1.getConfigFilePath)(app_configs_1.configs.cwd),
12
+ (0, update_with_presets_1.getPresetsConfigPath)(app_configs_1.configs, app_configs_1.configs.cwd),
16
13
  ].filter(Boolean),
17
14
  };
18
15
  }
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- // TODO: remove eslint-disable or add override to .eslintrc.js
3
2
  /* eslint-disable global-require */
4
3
  /* eslint-disable import/no-extraneous-dependencies */
5
4
  /* eslint-disable @typescript-eslint/no-var-requires */
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- // TODO: remove eslint-disable
3
2
  /* eslint-disable @typescript-eslint/no-var-requires */
4
3
  // Мы используем ts-node для работы c конфигами, описаными на ts
5
4
  require('ts-node').register({
@@ -1,2 +1 @@
1
- declare const config: import("@rspack/core").RspackOptions | import("@rspack/core").RspackOptions[];
2
- export default config;
1
+ export declare const config: import("@rspack/core").RspackOptions | import("@rspack/core").RspackOptions[];
@@ -1,15 +1,12 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
3
+ exports.config = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
7
5
  const find_loader_1 = require("./util/find-loader");
8
6
  const find_plugin_1 = require("./util/find-plugin");
9
7
  const webpack_client_1 = require("./webpack.client");
10
- const config = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webpackDev', 'webpackClientDev'], (0, webpack_client_1.createClientWebpackConfig)('dev'), {
8
+ exports.config = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackClient', 'webpackDev', 'webpackClientDev'], (0, webpack_client_1.createClientWebpackConfig)('dev'), {
11
9
  createSingleClientWebpackConfig: webpack_client_1.createSingleClientWebpackConfig.bind(null, 'dev'),
12
10
  findLoader: find_loader_1.findLoader,
13
11
  findPlugin: (0, find_plugin_1.findPlugin)(),
14
12
  });
15
- exports.default = config;
@@ -4,9 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createClientWebpackConfig = exports.createSingleClientWebpackConfig = void 0;
7
- // TODO: remove eslint-disable and eslint-disable-next-line
8
- /* eslint-disable global-require */
9
- /* eslint-disable @typescript-eslint/no-var-requires */
10
7
  const path_1 = __importDefault(require("path"));
11
8
  const getCSSModuleLocalIdent_1 = __importDefault(require("react-dev-utils/getCSSModuleLocalIdent"));
12
9
  const react_refresh_typescript_1 = __importDefault(require("react-refresh-typescript"));
@@ -15,6 +12,7 @@ const plugin_react_refresh_1 = __importDefault(require("@rspack/plugin-react-ref
15
12
  const assets_webpack_plugin_1 = __importDefault(require("assets-webpack-plugin"));
16
13
  const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sensitive-paths-webpack-plugin"));
17
14
  const compression_webpack_plugin_1 = __importDefault(require("compression-webpack-plugin"));
15
+ const css_minimizer_webpack_plugin_1 = __importDefault(require("css-minimizer-webpack-plugin"));
18
16
  const fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
19
17
  const html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
20
18
  const mini_svg_data_uri_1 = __importDefault(require("mini-svg-data-uri"));
@@ -24,17 +22,16 @@ const webpack_deduplication_plugin_1 = require("webpack-deduplication-plugin");
24
22
  const arui_runtime_1 = require("../plugins/arui-runtime");
25
23
  const html_template_1 = require("../templates/html.template");
26
24
  const minimizers_1 = require("./config-extras/minimizers");
27
- const check_node_version_1 = __importDefault(require("./util/check-node-version"));
28
- const get_entry_1 = __importDefault(require("./util/get-entry"));
25
+ const check_node_version_1 = require("./util/check-node-version");
26
+ const get_entry_1 = require("./util/get-entry");
29
27
  const app_configs_1 = require("./app-configs");
30
- const babel_client_1 = __importDefault(require("./babel-client"));
28
+ const babel_client_1 = require("./babel-client");
31
29
  const babel_dependencies_1 = require("./babel-dependencies");
32
30
  const client_env_config_1 = require("./client-env-config");
33
31
  const modules_1 = require("./modules");
34
- const postcss_1 = __importDefault(require("./postcss"));
32
+ const postcss_1 = require("./postcss");
35
33
  const process_assets_plugin_output_1 = require("./process-assets-plugin-output");
36
34
  const swc_1 = require("./swc");
37
- const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
38
35
  const noopPath = require.resolve('./util/noop');
39
36
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
40
37
  function getSingleEntry(entryPoint, mode) {
@@ -61,45 +58,8 @@ function getMinimizeConfig(mode) {
61
58
  return {
62
59
  minimize: true,
63
60
  minimizer: [
64
- new terser_webpack_plugin_1.default({
65
- terserOptions: {
66
- parse: {
67
- // we want terser to parse ecma 8 code. However, we don't want it
68
- // to apply any minfication steps that turns valid ecma 5 code
69
- // into invalid ecma 5 code. This is why the 'compress' and 'output'
70
- // sections only apply transformations that are ecma 5 safe
71
- // https://github.com/facebook/create-react-app/pull/4234
72
- ecma: 2017,
73
- },
74
- compress: {
75
- ecma: 5,
76
- // Disabled because of an issue with Uglify breaking seemingly valid code:
77
- // https://github.com/facebook/create-react-app/issues/2376
78
- // Pending further investigation:
79
- // https://github.com/mishoo/UglifyJS2/issues/2011
80
- comparisons: false,
81
- // Disabled because of an issue with Terser breaking valid code:
82
- // https://github.com/facebook/create-react-app/issues/5250
83
- // Pending futher investigation:
84
- // https://github.com/terser-js/terser/issues/120
85
- inline: 2,
86
- },
87
- mangle: {
88
- safari10: true,
89
- },
90
- output: {
91
- ecma: 5,
92
- comments: false,
93
- // Turned on because emoji and regex is not minified properly using default
94
- // https://github.com/facebook/create-react-app/issues/2488
95
- ascii_only: true,
96
- },
97
- },
98
- // Use multi-process parallel running to improve the build speed
99
- // Default number of concurrent runs: os.cpus().length - 1
100
- parallel: true,
101
- }),
102
- new CssMinimizerPlugin(),
61
+ new terser_webpack_plugin_1.default(),
62
+ new css_minimizer_webpack_plugin_1.default(),
103
63
  ].filter(Boolean),
104
64
  };
105
65
  }
@@ -109,11 +69,13 @@ function getMinimizeConfig(mode) {
109
69
  return {
110
70
  minimize: true,
111
71
  minimizer: [
112
- new CssMinimizerPlugin({
72
+ new css_minimizer_webpack_plugin_1.default({
113
73
  minimizerOptions: {
114
- preset: () => ({
74
+ preset: (() => ({
75
+ // eslint-disable-next-line global-require
115
76
  plugins: [require('postcss-discard-duplicates')],
116
- }),
77
+ // некорректные типы у cssMinimizerPlugin
78
+ })), // eslint-disable-line @typescript-eslint/no-explicit-any
117
79
  },
118
80
  }),
119
81
  ],
@@ -131,7 +93,7 @@ function getMinimizeConfig(mode) {
131
93
  * @param configName Имя конфигурации, если не указано, то используется имя по умолчанию
132
94
  */
133
95
  // eslint-disable-next-line complexity
134
- const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.assign(Object.assign({}, (configName ? { name: configName } : {})), { target: 'web', mode: mode === 'dev' ? 'development' : 'production', devtool: mode === 'dev' ? app_configs_1.configs.devSourceMaps : 'source-map', entry: (0, get_entry_1.default)(entry, getSingleEntry, mode),
96
+ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.assign(Object.assign({}, (configName ? { name: configName } : {})), { target: 'web', mode: mode === 'dev' ? 'development' : 'production', devtool: mode === 'dev' ? app_configs_1.configs.devSourceMaps : 'source-map', entry: (0, get_entry_1.getEntry)(entry, getSingleEntry, mode),
135
97
  // in production mode we need to fail on first error
136
98
  bail: mode === 'prod', context: app_configs_1.configs.cwd, experiments: {
137
99
  css: false,
@@ -222,7 +184,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
222
184
  loader: require.resolve('postcss-loader'),
223
185
  options: {
224
186
  postcssOptions: {
225
- plugins: postcss_1.default,
187
+ plugins: postcss_1.postcssConfig,
226
188
  },
227
189
  },
228
190
  },
@@ -250,7 +212,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
250
212
  loader: require.resolve('postcss-loader'),
251
213
  options: {
252
214
  postcssOptions: {
253
- plugins: postcss_1.default,
215
+ plugins: postcss_1.postcssConfig,
254
216
  },
255
217
  },
256
218
  },
@@ -334,9 +296,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
334
296
  new arui_runtime_1.AruiRuntimePlugin(),
335
297
  app_configs_1.configs.clientOnly &&
336
298
  new html_webpack_plugin_1.default({
337
- templateContent: mode === 'dev'
338
- ? (0, client_env_config_1.addEnvToHtmlTemplate)(html_template_1.htmlTemplate)
339
- : html_template_1.htmlTemplate, // оставляем env шаблоны как есть для прод сборки - их будет менять start.sh
299
+ templateContent: mode === 'dev' ? (0, client_env_config_1.addEnvToHtmlTemplate)(html_template_1.htmlTemplate) : html_template_1.htmlTemplate, // оставляем env шаблоны как есть для прод сборки - их будет менять start.sh
340
300
  filename: '../index.html',
341
301
  }),
342
302
  mode === 'dev' && app_configs_1.configs.clientOnly && new client_env_config_1.ClientConfigPlugin(),
@@ -351,7 +311,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
351
311
  minRatio: 0.8,
352
312
  }),
353
313
  mode === 'prod' &&
354
- (0, check_node_version_1.default)(10) &&
314
+ (0, check_node_version_1.checkNodeVersion)(10) &&
355
315
  new compression_webpack_plugin_1.default({
356
316
  filename: '[file].br',
357
317
  algorithm: 'brotliCompress',
@@ -410,18 +370,13 @@ function getCodeLoader(mode) {
410
370
  };
411
371
  }
412
372
  return {
413
- test: app_configs_1.configs.codeLoader === 'tsc'
414
- ? /\.(js|jsx|mjs|cjs)$/
415
- : /\.(js|jsx|mjs|ts|tsx|cjs)$/,
373
+ test: app_configs_1.configs.codeLoader === 'tsc' ? /\.(js|jsx|mjs|cjs)$/ : /\.(js|jsx|mjs|ts|tsx|cjs)$/,
416
374
  include: app_configs_1.configs.appSrc,
417
375
  loader: require.resolve('babel-loader'),
418
- options: Object.assign(Object.assign({}, babel_client_1.default), { cacheDirectory: mode === 'dev', cacheCompression: false, plugins: [
419
- ...babel_client_1.default.plugins,
376
+ options: Object.assign(Object.assign({}, babel_client_1.babelClientConfig), { cacheDirectory: mode === 'dev', cacheCompression: false, plugins: [
377
+ ...babel_client_1.babelClientConfig.plugins,
420
378
  mode === 'dev'
421
- ? [
422
- require.resolve('react-refresh/babel'),
423
- { skipEnvCheck: true },
424
- ]
379
+ ? [require.resolve('react-refresh/babel'), { skipEnvCheck: true }]
425
380
  : undefined,
426
381
  ].filter(Boolean) }),
427
382
  };
@@ -435,11 +390,8 @@ function getTsLoaderIfEnabled(mode) {
435
390
  use: [
436
391
  {
437
392
  loader: require.resolve('babel-loader'),
438
- options: Object.assign(Object.assign({}, babel_client_1.default), { cacheDirectory: mode === 'dev', cacheCompression: false, plugins: mode === 'dev'
439
- ? [
440
- require.resolve('react-refresh/babel'),
441
- { skipEnvCheck: true },
442
- ]
393
+ options: Object.assign(Object.assign({}, babel_client_1.babelClientConfig), { cacheDirectory: mode === 'dev', cacheCompression: false, plugins: mode === 'dev'
394
+ ? [require.resolve('react-refresh/babel'), { skipEnvCheck: true }]
443
395
  : undefined }),
444
396
  },
445
397
  {
@@ -1,2 +1 @@
1
- declare const config: import("@rspack/core").RspackOptions | import("@rspack/core").RspackOptions[];
2
- export default config;
1
+ export declare const webpackClientConfig: import("@rspack/core").RspackOptions | import("@rspack/core").RspackOptions[];
@@ -1,15 +1,12 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
3
+ exports.webpackClientConfig = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
7
5
  const find_loader_1 = require("./util/find-loader");
8
6
  const find_plugin_1 = require("./util/find-plugin");
9
7
  const webpack_client_1 = require("./webpack.client");
10
- const config = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webpackProd', 'webpackClientProd'], (0, webpack_client_1.createClientWebpackConfig)('prod'), {
8
+ exports.webpackClientConfig = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackClient', 'webpackProd', 'webpackClientProd'], (0, webpack_client_1.createClientWebpackConfig)('prod'), {
11
9
  createSingleClientWebpackConfig: webpack_client_1.createSingleClientWebpackConfig.bind(null, 'prod'),
12
10
  findLoader: find_loader_1.findLoader,
13
11
  findPlugin: (0, find_plugin_1.findPlugin)(),
14
12
  });
15
- exports.default = config;
@@ -1,2 +1 @@
1
- declare const config: import("@rspack/core").RspackOptions;
2
- export default config;
1
+ export declare const webpackServerConfig: import("@rspack/core").RspackOptions;
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
3
+ exports.webpackServerConfig = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
7
5
  const find_loader_1 = require("./util/find-loader");
8
6
  const find_plugin_1 = require("./util/find-plugin");
9
7
  const webpack_server_1 = require("./webpack.server");
10
- const config = (0, apply_overrides_1.default)(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], (0, webpack_server_1.createServerConfig)('dev'), { findLoader: find_loader_1.findLoader, findPlugin: (0, find_plugin_1.findPlugin)() });
11
- exports.default = config;
8
+ exports.webpackServerConfig = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], (0, webpack_server_1.createServerConfig)('dev'), { findLoader: find_loader_1.findLoader, findPlugin: (0, find_plugin_1.findPlugin)() });