arui-scripts 14.4.1 → 14.5.0-feat-modules.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -0
  3. package/build/bin/index.js +1 -0
  4. package/build/commands/build/build-wrapper.d.ts +2 -2
  5. package/build/commands/build/client.js +3 -3
  6. package/build/commands/build/index.js +5 -30
  7. package/build/commands/bundle-analyze/index.js +5 -7
  8. package/build/commands/changelog/index.js +2 -2
  9. package/build/commands/start/client.js +2 -30
  10. package/build/commands/start/index.js +5 -27
  11. package/build/commands/start/server.js +2 -11
  12. package/build/commands/start-prod/client.d.ts +1 -0
  13. package/build/commands/start-prod/client.js +8 -0
  14. package/build/commands/start-prod/index.d.ts +1 -0
  15. package/build/commands/start-prod/index.js +8 -0
  16. package/build/commands/start-prod/server.d.ts +1 -0
  17. package/build/commands/start-prod/server.js +8 -0
  18. package/build/commands/util/run-client-dev-derver.d.ts +2 -0
  19. package/build/commands/util/run-client-dev-derver.js +47 -0
  20. package/build/commands/util/run-compilers.d.ts +1 -0
  21. package/build/commands/util/run-compilers.js +31 -0
  22. package/build/commands/util/run-server-watch-compiler.d.ts +2 -0
  23. package/build/commands/util/run-server-watch-compiler.js +21 -0
  24. package/build/configs/app-configs/calculate-dependent-config.d.ts +48 -8
  25. package/build/configs/app-configs/calculate-dependent-config.js +11 -13
  26. package/build/configs/app-configs/get-defaults.d.ts +3 -2
  27. package/build/configs/app-configs/get-defaults.js +49 -34
  28. package/build/configs/app-configs/index.d.ts +5 -3
  29. package/build/configs/app-configs/index.js +13 -7
  30. package/build/configs/app-configs/types.d.ts +60 -26
  31. package/build/configs/app-configs/update-with-config-file.d.ts +2 -2
  32. package/build/configs/app-configs/update-with-config-file.js +5 -7
  33. package/build/configs/app-configs/update-with-env.js +3 -8
  34. package/build/configs/app-configs/update-with-package.d.ts +2 -2
  35. package/build/configs/app-configs/update-with-package.js +5 -10
  36. package/build/configs/app-configs/update-with-presets.d.ts +2 -2
  37. package/build/configs/app-configs/update-with-presets.js +8 -15
  38. package/build/configs/app-configs/validate-settings-keys.d.ts +2 -5
  39. package/build/configs/app-configs/validate-settings-keys.js +6 -7
  40. package/build/configs/babel-client.d.ts +33 -1
  41. package/build/configs/babel-dependencies.d.ts +14 -1
  42. package/build/configs/babel-server.d.ts +26 -1
  43. package/build/configs/dev-server.d.ts +15 -2
  44. package/build/configs/jest/index.d.ts +33 -1
  45. package/build/configs/modules.d.ts +15 -0
  46. package/build/configs/modules.js +78 -0
  47. package/build/configs/server-externals-exemptions.d.ts +1 -1
  48. package/build/configs/server-externals-exemptions.js +1 -0
  49. package/build/configs/util/apply-overrides.d.ts +6 -6
  50. package/build/configs/util/get-entry.d.ts +2 -1
  51. package/build/configs/webpack.client.d.ts +5 -2
  52. package/build/configs/webpack.client.dev.d.ts +1 -1
  53. package/build/configs/webpack.client.js +71 -17
  54. package/build/configs/webpack.client.prod.d.ts +1 -1
  55. package/build/index.d.ts +1 -1
  56. package/build/tsconfig-local.tsbuildinfo +1 -1
  57. package/docs/modules.md +423 -0
  58. package/package.json +3 -2
  59. package/build/configs/app-configs/available-package-settings.d.ts +0 -8
  60. package/build/configs/app-configs/available-package-settings.js +0 -32
@@ -1,4 +1,6 @@
1
1
  import '../util/register-ts-node';
2
- import { AppConfigs } from './types';
3
- declare let config: AppConfigs;
4
- export default config;
2
+ import { AppConfigs, AppContext, AppContextWithConfigs } from './types';
3
+ export declare const appContext: AppContext;
4
+ export declare const appConfigs: AppConfigs;
5
+ export declare const configs: AppContextWithConfigs;
6
+ export default configs;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.configs = exports.appConfigs = exports.appContext = void 0;
3
4
  require("../util/register-ts-node");
4
5
  const get_defaults_1 = require("./get-defaults");
5
6
  const update_with_env_1 = require("./update-with-env");
@@ -7,10 +8,15 @@ const update_with_package_1 = require("./update-with-package");
7
8
  const update_with_presets_1 = require("./update-with-presets");
8
9
  const calculate_dependent_config_1 = require("./calculate-dependent-config");
9
10
  const update_with_config_file_1 = require("./update-with-config-file");
10
- let config = (0, get_defaults_1.getDefaults)();
11
- config = (0, update_with_presets_1.updateWithPresets)(config);
12
- config = (0, update_with_package_1.updateWithPackage)(config);
13
- config = (0, update_with_config_file_1.updateWithConfigFile)(config);
14
- config = (0, update_with_env_1.updateWithEnv)(config);
15
- config = (0, calculate_dependent_config_1.calculateDependentConfig)(config);
16
- exports.default = config;
11
+ let tmpConfig = (0, get_defaults_1.getDefaultAppConfig)();
12
+ let tmpContext = (0, get_defaults_1.getDefaultAppContext)();
13
+ tmpConfig = (0, update_with_presets_1.updateWithPresets)(tmpConfig, tmpContext);
14
+ tmpConfig = (0, update_with_package_1.updateWithPackage)(tmpConfig, tmpContext);
15
+ tmpConfig = (0, update_with_config_file_1.updateWithConfigFile)(tmpConfig, tmpContext);
16
+ tmpConfig = (0, update_with_env_1.updateWithEnv)(tmpConfig);
17
+ tmpConfig = (0, calculate_dependent_config_1.calculateDependentConfig)(tmpConfig);
18
+ tmpContext = (0, calculate_dependent_config_1.calculateDependentContext)(tmpConfig, tmpContext);
19
+ exports.appContext = tmpContext;
20
+ exports.appConfigs = tmpConfig;
21
+ exports.configs = Object.assign(Object.assign({}, exports.appConfigs), exports.appContext);
22
+ exports.default = exports.configs;
@@ -1,43 +1,74 @@
1
+ /**
2
+ * Конфигурация arui-scripts, которая может быть переопределена приложением
3
+ */
1
4
  export type AppConfigs = {
2
- appPackage: any;
3
- name: string;
4
- version: string;
5
- dockerRegistry: string;
6
- baseDockerImage: string;
7
- cwd: string;
8
- appSrc: string;
9
- appNodeModules: string;
10
- appNodeModulesBin: string;
5
+ clientServerPort: number;
6
+ serverPort: number;
7
+ debug: boolean;
8
+ devSourceMaps: string;
9
+ useServerHMR: boolean;
10
+ presets: string | null;
11
11
  buildPath: string;
12
12
  assetsPath: string;
13
13
  additionalBuildPath: string[];
14
- nginxRootPath: string;
15
- runFromNonRootUser: boolean;
16
- archiveName: string;
17
- babelRuntimeVersion: string;
14
+ statsOutputFilename: string;
18
15
  serverEntry: string | string[] | Record<string, string | string[]>;
19
16
  serverOutput: string;
20
17
  clientPolyfillsEntry: null | string | string[];
21
18
  clientEntry: string;
19
+ dockerRegistry: string;
20
+ baseDockerImage: string;
21
+ nginxRootPath: string;
22
+ runFromNonRootUser: boolean;
23
+ removeDevDependenciesDuringDockerBuild: boolean;
24
+ archiveName: string;
22
25
  keepPropTypes: boolean;
23
- tsconfig: string | null;
24
- localNginxConf: string | null;
25
- localDockerfile: string | null;
26
- localStartScript: string | null;
27
- devSourceMaps: string;
28
26
  useTscLoader: boolean;
29
- useServerHMR: boolean;
30
27
  webpack4Compatibility: boolean;
31
- useYarn: boolean;
32
- clientServerPort: number;
33
- serverPort: number;
34
28
  installServerSourceMaps: boolean;
35
- debug: boolean;
36
- overridesPath: string[];
37
- statsOutputFilename: string;
38
- removeDevDependenciesDuringDockerBuild: boolean;
39
29
  componentsTheme: string | undefined;
40
30
  keepCssVars: boolean;
31
+ embeddedModules: {
32
+ shared?: {
33
+ [libraryName: string]: string;
34
+ };
35
+ exposes?: {
36
+ [moduleId: string]: EmbeddedModuleConfigBase;
37
+ };
38
+ } | null;
39
+ mfModules: {
40
+ name?: string;
41
+ shared: any;
42
+ exposes?: Record<string, string>;
43
+ } | null;
44
+ };
45
+ type EmbeddedModuleConfigBase = {
46
+ entry: string;
47
+ embeddedConfig?: Record<string, string>;
48
+ cssPrefix?: false | string;
49
+ };
50
+ export type EmbeddedModuleConfig = EmbeddedModuleConfigBase & {
51
+ name: string;
52
+ };
53
+ /**
54
+ * Внутренний контекст arui-scripts
55
+ */
56
+ export type AppContext = {
57
+ appPackage: any;
58
+ name: string;
59
+ normalizedName: string;
60
+ version: string;
61
+ cwd: string;
62
+ appSrc: string;
63
+ appNodeModules: string;
64
+ appNodeModulesBin: string;
65
+ babelRuntimeVersion: string;
66
+ useYarn: boolean;
67
+ tsconfig: string | null;
68
+ localNginxConf: string | null;
69
+ localDockerfile: string | null;
70
+ localStartScript: string | null;
71
+ overridesPath: string[];
41
72
  publicPath: string;
42
73
  serverOutputPath: string;
43
74
  clientOutputPath: string;
@@ -49,3 +80,6 @@ export type AppConfigs = {
49
80
  changelogBugfixesPath: string;
50
81
  changelogBreakingChangesPath: string;
51
82
  };
83
+ export type AppContextWithConfigs = AppContext & AppConfigs;
84
+ export type PackageSettings = Partial<AppConfigs>;
85
+ export {};
@@ -1,2 +1,2 @@
1
- import { AppConfigs } from './types';
2
- export declare function updateWithConfigFile(config: AppConfigs): AppConfigs;
1
+ import { AppConfigs, AppContext } from './types';
2
+ export declare function updateWithConfigFile(config: AppConfigs, context: AppContext): any;
@@ -5,20 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.updateWithConfigFile = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const lodash_merge_1 = __importDefault(require("lodash.merge"));
9
8
  const resolve_1 = require("../util/resolve");
10
- const validate_settings_keys_1 = __importDefault(require("./validate-settings-keys"));
11
- const available_package_settings_1 = require("./available-package-settings");
12
- function updateWithConfigFile(config) {
13
- const appConfigPath = (0, resolve_1.tryResolve)(path_1.default.join(config.cwd, '/arui-scripts.config'));
9
+ const validate_settings_keys_1 = require("./validate-settings-keys");
10
+ function updateWithConfigFile(config, context) {
11
+ const appConfigPath = (0, resolve_1.tryResolve)(path_1.default.join(context.cwd, '/arui-scripts.config'));
14
12
  if (appConfigPath) {
15
13
  let appSettings = require(appConfigPath);
16
14
  if (appSettings.__esModule) {
17
15
  // ts-node импортирует esModules, из них надо вытягивать default именно так
18
16
  appSettings = appSettings.default;
19
17
  }
20
- (0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, appSettings);
21
- config = (0, lodash_merge_1.default)(config, appSettings);
18
+ (0, validate_settings_keys_1.validateSettingsKeys)(config, appSettings, appConfigPath);
19
+ return Object.assign(Object.assign({}, config), appSettings);
22
20
  }
23
21
  return config;
24
22
  }
@@ -1,12 +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.updateWithEnv = void 0;
7
- const lodash_merge_1 = __importDefault(require("lodash.merge"));
8
- const validate_settings_keys_1 = __importDefault(require("./validate-settings-keys"));
9
- const available_package_settings_1 = require("./available-package-settings");
4
+ const validate_settings_keys_1 = require("./validate-settings-keys");
10
5
  function updateWithEnv(config) {
11
6
  if (!process.env.ARUI_SCRIPTS_CONFIG) {
12
7
  return config;
@@ -14,8 +9,8 @@ function updateWithEnv(config) {
14
9
  try {
15
10
  console.warn('Используйте ARUI_SCRIPTS_CONFIG только для отладки');
16
11
  const envSettings = JSON.parse(process.env.ARUI_SCRIPTS_CONFIG);
17
- (0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, envSettings);
18
- return (0, lodash_merge_1.default)(config, envSettings);
12
+ (0, validate_settings_keys_1.validateSettingsKeys)(config, envSettings, 'ENV');
13
+ return Object.assign(Object.assign({}, config), envSettings);
19
14
  }
20
15
  catch (e) {
21
16
  console.error(e);
@@ -1,2 +1,2 @@
1
- import { AppConfigs } from './types';
2
- export declare function updateWithPackage(config: AppConfigs): any;
1
+ import { AppConfigs, AppContext } from './types';
2
+ export declare function updateWithPackage(config: AppConfigs, context: AppContext): any;
@@ -1,15 +1,10 @@
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.updateWithPackage = void 0;
7
- const lodash_merge_1 = __importDefault(require("lodash.merge"));
8
- const validate_settings_keys_1 = __importDefault(require("./validate-settings-keys"));
9
- const available_package_settings_1 = require("./available-package-settings");
10
- function updateWithPackage(config) {
11
- const packageSettings = config.appPackage.aruiScripts || {};
12
- (0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, packageSettings);
13
- return (0, lodash_merge_1.default)(config, packageSettings);
4
+ const validate_settings_keys_1 = require("./validate-settings-keys");
5
+ function updateWithPackage(config, context) {
6
+ const packageSettings = context.appPackage.aruiScripts || {};
7
+ (0, validate_settings_keys_1.validateSettingsKeys)(config, packageSettings, 'package.json');
8
+ return Object.assign(Object.assign({}, config), packageSettings);
14
9
  }
15
10
  exports.updateWithPackage = updateWithPackage;
@@ -1,2 +1,2 @@
1
- import { AppConfigs } from './types';
2
- export declare function updateWithPresets(config: AppConfigs): AppConfigs;
1
+ import { AppConfigs, AppContext } from './types';
2
+ export declare function updateWithPresets(config: AppConfigs, context: AppContext): AppConfigs;
@@ -1,33 +1,26 @@
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.updateWithPresets = void 0;
7
- const lodash_merge_1 = __importDefault(require("lodash.merge"));
8
4
  const resolve_1 = require("../util/resolve");
9
- const validate_settings_keys_1 = __importDefault(require("./validate-settings-keys"));
10
- const available_package_settings_1 = require("./available-package-settings");
11
- function updateWithPresets(config) {
12
- const packageSettings = config.appPackage.aruiScripts || {};
13
- if (!packageSettings.presets) {
5
+ const validate_settings_keys_1 = require("./validate-settings-keys");
6
+ function updateWithPresets(config, context) {
7
+ if (!config.presets) {
14
8
  return config;
15
9
  }
16
- const presetsConfigPath = (0, resolve_1.tryResolve)(`${packageSettings.presets}/arui-scripts.config`, { paths: [config.cwd] });
17
- const presetsOverridesPath = (0, resolve_1.tryResolve)(`${packageSettings.presets}/arui-scripts.overrides`, { paths: [config.cwd] });
10
+ const presetsConfigPath = (0, resolve_1.tryResolve)(`${config.presets}/arui-scripts.config`, { paths: [context.cwd] });
11
+ const presetsOverridesPath = (0, resolve_1.tryResolve)(`${config.presets}/arui-scripts.overrides`, { paths: [context.cwd] });
18
12
  if (presetsConfigPath) {
19
13
  let presetsSettings = require(presetsConfigPath);
20
14
  if (presetsSettings.__esModule) {
21
15
  // ts-node импортирует esModules, из них надо вытягивать default именно так
22
16
  presetsSettings = presetsSettings.default;
23
17
  }
24
- (0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, presetsSettings);
25
- config = (0, lodash_merge_1.default)(config, presetsSettings);
18
+ (0, validate_settings_keys_1.validateSettingsKeys)(config, presetsSettings, presetsConfigPath);
19
+ config = Object.assign(Object.assign({}, config), presetsSettings);
26
20
  }
27
21
  if (presetsOverridesPath) {
28
- config.overridesPath.unshift(presetsOverridesPath);
22
+ context.overridesPath.unshift(presetsOverridesPath);
29
23
  }
30
- delete packageSettings.presets;
31
24
  return config;
32
25
  }
33
26
  exports.updateWithPresets = updateWithPresets;
@@ -1,7 +1,4 @@
1
1
  /**
2
- * Функция проверяет что все ключи объекта settingsObject есть в массиве availableKeys
3
- * @param {string[]} availableKeys Массив допустимых настроек
4
- * @param settingsObject Объект с настройками
2
+ * Функция проверяет что все ключи объекта settingsObject есть в уже существующей конфигурации
5
3
  */
6
- declare function validateSettingsKeys(availableKeys: ReadonlyArray<string>, settingsObject: Record<string, unknown>): void;
7
- export default validateSettingsKeys;
4
+ export declare function validateSettingsKeys(existingConfig: Record<string, unknown>, settingsObject: Record<string, unknown>, source?: string): void;
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateSettingsKeys = void 0;
3
4
  /**
4
- * Функция проверяет что все ключи объекта settingsObject есть в массиве availableKeys
5
- * @param {string[]} availableKeys Массив допустимых настроек
6
- * @param settingsObject Объект с настройками
5
+ * Функция проверяет что все ключи объекта settingsObject есть в уже существующей конфигурации
7
6
  */
8
- function validateSettingsKeys(availableKeys, settingsObject) {
7
+ function validateSettingsKeys(existingConfig, settingsObject, source) {
9
8
  Object.keys(settingsObject).forEach((setting) => {
10
- if (!availableKeys.includes(setting)) {
11
- console.warn('\x1b[33m', `Setting`, '\x1b[31m', setting, '\x1b[33m', 'is not supported!');
9
+ if (typeof existingConfig[setting] === 'undefined') {
10
+ console.warn(`Неизвестная настройка "${setting}" в ${source || 'конфигурации'}`);
12
11
  }
13
12
  });
14
13
  }
15
- exports.default = validateSettingsKeys;
14
+ exports.validateSettingsKeys = validateSettingsKeys;
@@ -1,2 +1,34 @@
1
- declare const babelClientConfig: any;
1
+ declare const babelClientConfig: {
2
+ presets: (string | false | (string | {
3
+ targets: {
4
+ browsers: string[];
5
+ };
6
+ loose: boolean;
7
+ useBuiltIns: string;
8
+ corejs: number;
9
+ exclude: string[];
10
+ })[])[];
11
+ plugins: (string | (string | {
12
+ legacy: boolean;
13
+ })[] | (string | {
14
+ loose: boolean;
15
+ })[] | (string | {
16
+ useBuiltIns: boolean;
17
+ })[] | (string | {
18
+ corejs: boolean;
19
+ helpers: boolean;
20
+ version: string;
21
+ regenerator: boolean;
22
+ })[])[];
23
+ env: {
24
+ production: {
25
+ plugins: (string | (string | {
26
+ removeImport: boolean;
27
+ })[])[];
28
+ };
29
+ test: {
30
+ plugins: string[];
31
+ };
32
+ };
33
+ };
2
34
  export default babelClientConfig;
@@ -1 +1,14 @@
1
- export declare const babelDependencies: any;
1
+ export declare const babelDependencies: {
2
+ sourceType: string;
3
+ presets: (string | {
4
+ useBuiltIns: string;
5
+ corejs: number;
6
+ exclude: string[];
7
+ })[][];
8
+ plugins: (string | {
9
+ corejs: boolean;
10
+ helpers: boolean;
11
+ version: string;
12
+ regenerator: boolean;
13
+ })[][];
14
+ };
@@ -1,2 +1,27 @@
1
- declare const config: any;
1
+ declare const config: {
2
+ presets: (string | false | (string | {
3
+ modules: boolean;
4
+ targets: {
5
+ node: string;
6
+ };
7
+ loose: boolean;
8
+ })[])[];
9
+ plugins: (string | (string | {
10
+ legacy: boolean;
11
+ })[] | (string | {
12
+ loose: boolean;
13
+ })[] | (string | {
14
+ useBuiltIns: boolean;
15
+ })[] | (string | {
16
+ helpers: boolean;
17
+ })[])[];
18
+ env: {
19
+ production: {
20
+ plugins: string[];
21
+ };
22
+ test: {
23
+ plugins: string[];
24
+ };
25
+ };
26
+ };
2
27
  export default config;
@@ -1,3 +1,16 @@
1
- /// <reference types="webpack-dev-server" />
2
- declare const devServerConfig: import("webpack-dev-server").Configuration;
1
+ declare const devServerConfig: {
2
+ port: number;
3
+ liveReload: boolean;
4
+ client: {
5
+ overlay: {
6
+ errors: boolean;
7
+ warnings: boolean;
8
+ };
9
+ };
10
+ devMiddleware: {
11
+ publicPath: string;
12
+ };
13
+ static: string[];
14
+ proxy: any;
15
+ };
3
16
  export default devServerConfig;
@@ -14,6 +14,38 @@ export const snapshotSerializers: string[];
14
14
  export const globals: {
15
15
  'ts-jest': {
16
16
  tsconfig: string | null;
17
- babelConfig: any;
17
+ babelConfig: {
18
+ presets: (string | false | (string | {
19
+ targets: {
20
+ browsers: string[];
21
+ };
22
+ loose: boolean;
23
+ useBuiltIns: string;
24
+ corejs: number;
25
+ exclude: string[];
26
+ })[])[];
27
+ plugins: (string | (string | {
28
+ legacy: boolean;
29
+ })[] | (string | {
30
+ loose: boolean;
31
+ })[] | (string | {
32
+ useBuiltIns: boolean;
33
+ })[] | (string | {
34
+ corejs: boolean;
35
+ helpers: boolean;
36
+ version: string;
37
+ regenerator: boolean;
38
+ })[])[];
39
+ env: {
40
+ production: {
41
+ plugins: (string | (string | {
42
+ removeImport: boolean;
43
+ })[])[];
44
+ };
45
+ test: {
46
+ plugins: string[];
47
+ };
48
+ };
49
+ };
18
50
  };
19
51
  };
@@ -0,0 +1,15 @@
1
+ import { Assets } from 'assets-webpack-plugin';
2
+ import { EmbeddedModuleConfig } from './app-configs/types';
3
+ export declare function processAssetsPluginOutput(assets: Assets): string;
4
+ export declare function haveExposedMfModules(): Record<string, string> | undefined;
5
+ export declare function getCssPrefixForModule(module: EmbeddedModuleConfig): string | undefined;
6
+ export declare function getChunkNamePrefix(module?: EmbeddedModuleConfig): string;
7
+ export declare function getExposeLoadersFormEmbeddedModules(module?: EmbeddedModuleConfig): {
8
+ test: string;
9
+ use: {
10
+ loader: string;
11
+ options: {
12
+ exposes: string[];
13
+ };
14
+ }[];
15
+ }[];
@@ -0,0 +1,78 @@
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.getExposeLoadersFormEmbeddedModules = exports.getChunkNamePrefix = exports.getCssPrefixForModule = exports.haveExposedMfModules = exports.processAssetsPluginOutput = void 0;
7
+ const app_configs_1 = __importDefault(require("./app-configs"));
8
+ function processAssetsPluginOutput(assets) {
9
+ var _a;
10
+ let adjustedAssets = assets;
11
+ if (haveExposedMfModules()) { // для mf модулей мы делаем publicPath 'auto', но в самом манифесте нам все равно хочется видеть нормальный путь
12
+ Object.keys(adjustedAssets).forEach((key) => {
13
+ adjustedAssets[key] = {
14
+ css: replaceAutoPath(adjustedAssets[key].css),
15
+ js: replaceAutoPath(adjustedAssets[key].js),
16
+ };
17
+ });
18
+ }
19
+ const result = Object.assign(Object.assign({}, adjustedAssets), { __metadata__: {
20
+ version: app_configs_1.default.version,
21
+ name: ((_a = app_configs_1.default.mfModules) === null || _a === void 0 ? void 0 : _a.name) || app_configs_1.default.normalizedName,
22
+ } });
23
+ return JSON.stringify(result);
24
+ }
25
+ exports.processAssetsPluginOutput = processAssetsPluginOutput;
26
+ function replaceAutoPath(assets) {
27
+ if (!assets) {
28
+ return assets;
29
+ }
30
+ if (Array.isArray(assets)) {
31
+ return assets.map((asset) => asset.replace(/^auto\//, app_configs_1.default.publicPath));
32
+ }
33
+ return assets.replace(/^auto\//, app_configs_1.default.publicPath);
34
+ }
35
+ function haveExposedMfModules() {
36
+ var _a;
37
+ return (_a = app_configs_1.default.mfModules) === null || _a === void 0 ? void 0 : _a.exposes;
38
+ }
39
+ exports.haveExposedMfModules = haveExposedMfModules;
40
+ function getCssPrefixForModule(module) {
41
+ if (module.cssPrefix) {
42
+ return module.cssPrefix;
43
+ }
44
+ if (module.cssPrefix === false) {
45
+ return undefined;
46
+ }
47
+ return `.module-${module.name}`;
48
+ }
49
+ exports.getCssPrefixForModule = getCssPrefixForModule;
50
+ function getChunkNamePrefix(module) {
51
+ if (!module) {
52
+ return '';
53
+ }
54
+ return `${module.name}-`;
55
+ }
56
+ exports.getChunkNamePrefix = getChunkNamePrefix;
57
+ function getExposeLoadersFormEmbeddedModules(module) {
58
+ var _a;
59
+ const shared = (_a = app_configs_1.default.embeddedModules) === null || _a === void 0 ? void 0 : _a.shared;
60
+ if (!shared || module) {
61
+ return [];
62
+ }
63
+ return Object.keys(shared).map((libraryName) => {
64
+ const globalVarName = shared[libraryName];
65
+ return {
66
+ test: require.resolve(libraryName),
67
+ use: [
68
+ {
69
+ loader: require.resolve('expose-loader'),
70
+ options: {
71
+ exposes: [globalVarName],
72
+ },
73
+ },
74
+ ],
75
+ };
76
+ });
77
+ }
78
+ exports.getExposeLoadersFormEmbeddedModules = getExposeLoadersFormEmbeddedModules;
@@ -1 +1 @@
1
- export declare const serverExternalsExemptions: (string | RegExp)[];
1
+ export declare const serverExternalsExemptions: RegExp[];
@@ -17,4 +17,5 @@ exports.serverExternalsExemptions = (0, apply_overrides_1.default)('serverExtern
17
17
  /^date-fns/,
18
18
  /^@corp-front\//,
19
19
  /^corp-sign-ui-react/,
20
+ /^arui-sciprts-utils/,
20
21
  ]);
@@ -2,14 +2,14 @@ import type { Configuration as WebpackConfiguration, WebpackOptionsNormalized }
2
2
  import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
3
3
  import { AppConfigs } from '../app-configs/types';
4
4
  type Overrides = {
5
- webpack: WebpackConfiguration;
6
- webpackClient: WebpackConfiguration;
7
- webpackDev: WebpackConfiguration;
8
- webpackClientDev: WebpackConfiguration;
5
+ webpack: WebpackConfiguration | WebpackConfiguration[];
6
+ webpackClient: WebpackConfiguration | WebpackConfiguration[];
7
+ webpackDev: WebpackConfiguration | WebpackConfiguration[];
8
+ webpackClientDev: WebpackConfiguration | WebpackConfiguration[];
9
9
  webpackServer: WebpackConfiguration;
10
10
  webpackServerDev: WebpackConfiguration;
11
11
  webpackProd: WebpackConfiguration;
12
- webpackClientProd: WebpackConfiguration;
12
+ webpackClientProd: WebpackConfiguration | WebpackConfiguration[];
13
13
  webpackServerProd: WebpackConfiguration;
14
14
  devServer: WebpackDevServerConfiguration;
15
15
  stats: WebpackOptionsNormalized['stats'];
@@ -36,5 +36,5 @@ export type OverrideFile = {
36
36
  * @param {Object} config Конфиг, к которому нужно применить оверрайды
37
37
  * @returns {*}
38
38
  */
39
- declare function applyOverrides<Key extends keyof Overrides>(overridesKey: Key | Key[], config: Overrides[Key]): Overrides[Key];
39
+ declare function applyOverrides<T extends Overrides[Key], Key extends keyof Overrides>(overridesKey: Key | Key[], config: T): T;
40
40
  export default applyOverrides;
@@ -1,8 +1,9 @@
1
+ export type Entry = string | string[] | Record<string, string | string[]>;
1
2
  /**
2
3
  * @param {string|string[]|object} entryPoint Строка, массив строк или объект с энтрипоинтами
3
4
  * @param {Function} getSingleEntry Функция, возвращающая конфигурацию для одного entryPoint
4
5
  * @param args Дополнительные аргументы, которые будут переданы в getSingleEntry функцию
5
6
  * @returns {*}
6
7
  */
7
- declare function getEntry<AdditionalArgs extends unknown[]>(entryPoint: string | string[] | Record<string, string | string[]>, getSingleEntry: (entry: string[], ...args: AdditionalArgs) => string[], ...args: AdditionalArgs): string[] | Record<string, string | string[]>;
8
+ declare function getEntry<AdditionalArgs extends unknown[]>(entryPoint: Entry, getSingleEntry: (entry: string[], ...args: AdditionalArgs) => string[], ...args: AdditionalArgs): string[] | Record<string, string | string[]>;
8
9
  export default getEntry;
@@ -1,2 +1,5 @@
1
- import { Configuration } from 'webpack';
2
- export declare const createClientWebpackConfig: (mode: 'dev' | 'prod') => Configuration;
1
+ import webpack, { Configuration } from 'webpack';
2
+ import { Entry } from './util/get-entry';
3
+ import { EmbeddedModuleConfig } from './app-configs/types';
4
+ export declare const createSingleClientWebpackConfig: (mode: 'dev' | 'prod', entry: Entry, module?: EmbeddedModuleConfig) => Configuration;
5
+ export declare const createClientWebpackConfig: (mode: 'dev' | 'prod') => webpack.Configuration | webpack.Configuration[];
@@ -1,2 +1,2 @@
1
- declare const config: import("webpack").Configuration;
1
+ declare const config: import("webpack").Configuration | import("webpack").Configuration[];
2
2
  export default config;