arui-scripts 14.4.0 → 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 (65) hide show
  1. package/CHANGELOG.md +23 -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/docker-build/index.js +1 -3
  10. package/build/commands/docker-build-compiled/index.js +1 -3
  11. package/build/commands/start/client.js +2 -30
  12. package/build/commands/start/index.js +5 -27
  13. package/build/commands/start/server.js +2 -11
  14. package/build/commands/start-prod/client.d.ts +1 -0
  15. package/build/commands/start-prod/client.js +8 -0
  16. package/build/commands/start-prod/index.d.ts +1 -0
  17. package/build/commands/start-prod/index.js +8 -0
  18. package/build/commands/start-prod/server.d.ts +1 -0
  19. package/build/commands/start-prod/server.js +8 -0
  20. package/build/commands/util/docker-build.d.ts +6 -0
  21. package/build/commands/util/docker-build.js +19 -1
  22. package/build/commands/util/run-client-dev-derver.d.ts +2 -0
  23. package/build/commands/util/run-client-dev-derver.js +47 -0
  24. package/build/commands/util/run-compilers.d.ts +1 -0
  25. package/build/commands/util/run-compilers.js +31 -0
  26. package/build/commands/util/run-server-watch-compiler.d.ts +2 -0
  27. package/build/commands/util/run-server-watch-compiler.js +21 -0
  28. package/build/configs/app-configs/calculate-dependent-config.d.ts +48 -8
  29. package/build/configs/app-configs/calculate-dependent-config.js +11 -13
  30. package/build/configs/app-configs/get-defaults.d.ts +3 -2
  31. package/build/configs/app-configs/get-defaults.js +49 -34
  32. package/build/configs/app-configs/index.d.ts +5 -3
  33. package/build/configs/app-configs/index.js +13 -7
  34. package/build/configs/app-configs/types.d.ts +60 -26
  35. package/build/configs/app-configs/update-with-config-file.d.ts +2 -2
  36. package/build/configs/app-configs/update-with-config-file.js +5 -7
  37. package/build/configs/app-configs/update-with-env.js +3 -8
  38. package/build/configs/app-configs/update-with-package.d.ts +2 -2
  39. package/build/configs/app-configs/update-with-package.js +5 -10
  40. package/build/configs/app-configs/update-with-presets.d.ts +2 -2
  41. package/build/configs/app-configs/update-with-presets.js +8 -15
  42. package/build/configs/app-configs/validate-settings-keys.d.ts +2 -5
  43. package/build/configs/app-configs/validate-settings-keys.js +6 -7
  44. package/build/configs/babel-client.d.ts +33 -1
  45. package/build/configs/babel-dependencies.d.ts +14 -1
  46. package/build/configs/babel-server.d.ts +26 -1
  47. package/build/configs/dev-server.d.ts +15 -2
  48. package/build/configs/jest/index.d.ts +33 -1
  49. package/build/configs/modules.d.ts +15 -0
  50. package/build/configs/modules.js +78 -0
  51. package/build/configs/server-externals-exemptions.d.ts +1 -1
  52. package/build/configs/server-externals-exemptions.js +1 -0
  53. package/build/configs/util/apply-overrides.d.ts +6 -6
  54. package/build/configs/util/get-entry.d.ts +2 -1
  55. package/build/configs/webpack.client.d.ts +5 -2
  56. package/build/configs/webpack.client.dev.d.ts +1 -1
  57. package/build/configs/webpack.client.js +71 -17
  58. package/build/configs/webpack.client.prod.d.ts +1 -1
  59. package/build/index.d.ts +2 -1
  60. package/build/index.js +3 -1
  61. package/build/tsconfig-local.tsbuildinfo +1 -1
  62. package/docs/modules.md +423 -0
  63. package/package.json +5 -2
  64. package/build/configs/app-configs/available-package-settings.d.ts +0 -8
  65. package/build/configs/app-configs/available-package-settings.js +0 -32
@@ -3,17 +3,57 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getDefaults = void 0;
6
+ exports.getDefaultAppContext = exports.getDefaultAppConfig = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const resolve_1 = require("../util/resolve");
10
- function getDefaults() {
11
- const CWD = process.cwd();
10
+ const CWD = process.cwd();
11
+ const absoluteSrcPath = path_1.default.resolve(CWD, 'src');
12
+ function getDefaultAppConfig() {
13
+ return {
14
+ /// general settings
15
+ clientServerPort: 8080,
16
+ serverPort: 3000,
17
+ debug: false,
18
+ devSourceMaps: 'eval',
19
+ useServerHMR: false,
20
+ presets: null,
21
+ // paths
22
+ buildPath: '.build',
23
+ assetsPath: 'assets',
24
+ additionalBuildPath: ['config'],
25
+ statsOutputFilename: 'stats.json',
26
+ serverEntry: path_1.default.resolve(absoluteSrcPath, 'server/index'),
27
+ serverOutput: 'server.js',
28
+ clientPolyfillsEntry: null,
29
+ clientEntry: path_1.default.resolve(absoluteSrcPath, 'index'),
30
+ // docker compilation configs
31
+ dockerRegistry: '',
32
+ baseDockerImage: 'alfabankui/arui-scripts:latest',
33
+ nginxRootPath: '/src',
34
+ runFromNonRootUser: true,
35
+ removeDevDependenciesDuringDockerBuild: true,
36
+ // archive compilation configs
37
+ archiveName: 'build.tar',
38
+ // build tuning
39
+ keepPropTypes: false,
40
+ useTscLoader: false,
41
+ webpack4Compatibility: false,
42
+ installServerSourceMaps: false,
43
+ // CSS
44
+ componentsTheme: undefined,
45
+ keepCssVars: false,
46
+ // Modules
47
+ embeddedModules: null,
48
+ mfModules: null,
49
+ };
50
+ }
51
+ exports.getDefaultAppConfig = getDefaultAppConfig;
52
+ function getDefaultAppContext() {
12
53
  const appPackage = JSON.parse(fs_1.default.readFileSync(path_1.default.join(CWD, 'package.json'), 'utf8'));
13
54
  if (appPackage['arui-scripts']) {
14
55
  throw Error('arui-scripts in package.json is not supported. Use aruiScripts instead.');
15
56
  }
16
- const absoluteSrcPath = path_1.default.resolve(CWD, 'src');
17
57
  const absoluteNodeModulesPath = path_1.default.resolve(CWD, 'node_modules');
18
58
  const absoluteNodeModulesBinPath = path_1.default.resolve(absoluteNodeModulesPath, '.bin');
19
59
  const projectTsConfigPath = path_1.default.join(CWD, 'tsconfig.json');
@@ -25,47 +65,22 @@ function getDefaults() {
25
65
  return {
26
66
  appPackage,
27
67
  name: appPackage.name,
68
+ normalizedName: appPackage.name.replace(/-/g, '_'),
28
69
  version: appPackage.version,
29
- dockerRegistry: '',
30
- baseDockerImage: 'alfabankui/arui-scripts:latest',
31
70
  // general paths
32
71
  cwd: CWD,
33
72
  appSrc: absoluteSrcPath,
34
73
  appNodeModules: absoluteNodeModulesPath,
35
74
  appNodeModulesBin: absoluteNodeModulesBinPath,
36
- buildPath: '.build',
37
- assetsPath: 'assets',
38
- additionalBuildPath: ['config'],
39
- nginxRootPath: '/src',
40
- runFromNonRootUser: true,
41
- archiveName: 'build.tar',
75
+ overridesPath: overridesPath ? [overridesPath] : [],
76
+ // tools availability
42
77
  babelRuntimeVersion: '7.0.0-beta.0',
43
- // server compilation configs
44
- serverEntry: path_1.default.resolve(absoluteSrcPath, 'server/index'),
45
- serverOutput: 'server.js',
46
- // client compilation configs
47
- clientPolyfillsEntry: null,
48
- clientEntry: path_1.default.resolve(absoluteSrcPath, 'index'),
49
- keepPropTypes: false,
78
+ useYarn: fs_1.default.existsSync(yarnLockFilePath),
50
79
  // compilation configs locations
51
80
  tsconfig: fs_1.default.existsSync(projectTsConfigPath) ? projectTsConfigPath : null,
52
81
  localNginxConf: fs_1.default.existsSync(nginxConfFilePath) ? nginxConfFilePath : null,
53
82
  localDockerfile: fs_1.default.existsSync(dockerfileFilePath) ? dockerfileFilePath : null,
54
83
  localStartScript: fs_1.default.existsSync(startScriptFilePath) ? startScriptFilePath : null,
55
- devSourceMaps: 'eval',
56
- useTscLoader: false,
57
- useServerHMR: false,
58
- webpack4Compatibility: false,
59
- useYarn: fs_1.default.existsSync(yarnLockFilePath),
60
- clientServerPort: 8080,
61
- serverPort: 3000,
62
- installServerSourceMaps: false,
63
- debug: false,
64
- overridesPath: overridesPath ? [overridesPath] : [],
65
- statsOutputFilename: 'stats.json',
66
- removeDevDependenciesDuringDockerBuild: true,
67
- componentsTheme: undefined,
68
- keepCssVars: false,
69
84
  // Эти пути зависят от других настроек, которые могут быть переопределены пользователем
70
85
  publicPath: '',
71
86
  serverOutputPath: '',
@@ -80,4 +95,4 @@ function getDefaults() {
80
95
  changelogBreakingChangesPath: path_1.default.resolve(CWD, './changelog_breaking_changes.tmp'),
81
96
  };
82
97
  }
83
- exports.getDefaults = getDefaults;
98
+ exports.getDefaultAppContext = getDefaultAppContext;
@@ -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
+ }[];