arui-scripts 12.0.1 → 12.3.0-feat-ts-config-files.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 (74) hide show
  1. package/CHANGELOG.md +3 -4
  2. package/README.md +45 -7
  3. package/build/bin/index.d.ts +2 -0
  4. package/build/bin/index.js +9 -0
  5. package/build/commands/archive-build/index.d.ts +1 -0
  6. package/build/commands/build/build-wrapper.d.ts +8 -0
  7. package/build/commands/build/client.d.ts +1 -0
  8. package/build/commands/build/index.d.ts +1 -0
  9. package/build/commands/build/server.d.ts +1 -0
  10. package/build/commands/bundle-analyze/index.d.ts +1 -0
  11. package/build/commands/bundle-analyze/index.js +6 -1
  12. package/build/commands/docker-build/index.d.ts +1 -0
  13. package/build/commands/ensure-yarn/index.d.ts +0 -0
  14. package/build/commands/start/client.d.ts +1 -0
  15. package/build/commands/start/index.d.ts +1 -0
  16. package/build/commands/start/print-compiler-output.d.ts +1 -0
  17. package/build/commands/start/server.d.ts +1 -0
  18. package/build/commands/test/index.d.ts +1 -0
  19. package/build/commands/util/check-required-files.d.ts +2 -0
  20. package/build/commands/util/client-assets-sizes.d.ts +26 -0
  21. package/build/commands/util/exec.d.ts +2 -0
  22. package/build/commands/util/format-webpack-messages.d.ts +5 -0
  23. package/build/commands/util/make-tmp-dir.d.ts +6 -0
  24. package/build/configs/app-configs/available-package-settings.d.ts +8 -0
  25. package/build/configs/app-configs/available-package-settings.js +1 -0
  26. package/build/configs/app-configs/calculate-dependent-config.d.ts +11 -0
  27. package/build/configs/app-configs/calculate-dependent-config.js +1 -0
  28. package/build/configs/app-configs/get-defaults.d.ts +2 -0
  29. package/build/configs/app-configs/get-defaults.js +5 -2
  30. package/build/configs/app-configs/index.d.ts +3 -0
  31. package/build/configs/app-configs/types.d.ts +38 -0
  32. package/build/configs/app-configs/update-with-env.d.ts +2 -0
  33. package/build/configs/app-configs/update-with-package.d.ts +2 -0
  34. package/build/configs/app-configs/update-with-presets.d.ts +2 -0
  35. package/build/configs/app-configs/update-with-presets.js +2 -2
  36. package/build/configs/app-configs/validate-settings-keys.d.ts +7 -0
  37. package/build/configs/babel-client.d.ts +2 -0
  38. package/build/configs/babel-server.d.ts +2 -0
  39. package/build/configs/dev-server.d.ts +3 -0
  40. package/build/configs/jest/babel-transform.d.ts +7 -0
  41. package/build/configs/jest/css-mock.d.ts +1 -0
  42. package/build/configs/jest/file-transform.d.ts +2 -0
  43. package/build/configs/jest/index.d.ts +19 -0
  44. package/build/configs/jest/setup.d.ts +1 -0
  45. package/build/configs/mq.d.ts +24 -0
  46. package/build/configs/postcss.config.d.ts +27 -0
  47. package/build/configs/postcss.d.ts +2 -0
  48. package/build/configs/stats-options.d.ts +3 -0
  49. package/build/configs/stats-options.js +0 -2
  50. package/build/configs/supporting-browsers.d.ts +2 -0
  51. package/build/configs/util/apply-overrides.d.ts +37 -0
  52. package/build/configs/util/apply-overrides.js +2 -1
  53. package/build/configs/util/check-node-version.d.ts +2 -0
  54. package/build/configs/util/get-entry.d.ts +7 -0
  55. package/build/configs/util/get-polyfills.d.ts +3 -0
  56. package/build/configs/util/install-sourcemap-support.d.ts +1 -0
  57. package/build/configs/util/node-assets-ignore.d.ts +0 -0
  58. package/build/configs/util/noop.d.ts +1 -0
  59. package/build/configs/util/try-resolve.d.ts +1 -0
  60. package/build/configs/webpack.client.dev.d.ts +3 -0
  61. package/build/configs/webpack.client.dev.js +2 -0
  62. package/build/configs/webpack.client.prod.d.ts +3 -0
  63. package/build/configs/webpack.server.dev.d.ts +3 -0
  64. package/build/configs/webpack.server.dev.js +3 -0
  65. package/build/configs/webpack.server.prod.d.ts +3 -0
  66. package/build/index.d.ts +2 -0
  67. package/build/index.js +2 -0
  68. package/build/plugins/reload-server-webpack-plugin.d.ts +9 -0
  69. package/build/templates/dockerfile.template.d.ts +2 -0
  70. package/build/templates/nginx.conf.template.d.ts +2 -0
  71. package/build/templates/start.template.d.ts +2 -0
  72. package/build/tsconfig-local.tsbuildinfo +447 -344
  73. package/package.json +5 -3
  74. package/tsconfig-local.json +4 -2
package/CHANGELOG.md CHANGED
@@ -1,7 +1,6 @@
1
- ## [12.0.1](https://github.com/alfa-laboratory/arui-scripts/compare/v12.0.0...v12.0.1) (2021-11-16)
1
+ # [12.3.0-feat-ts-config-files.1](https://github.com/alfa-laboratory/arui-scripts/compare/v12.2.0...v12.3.0-feat-ts-config-files.1) (2022-02-17)
2
2
 
3
3
 
4
- ### Bug Fixes
4
+ ### Features
5
5
 
6
- * **package.json:** up peerDependencies ([7ff5c69](https://github.com/alfa-laboratory/arui-scripts/commit/7ff5c69ade098078e4f3980ddb2f66c3a79c2a1b))
7
- * **yarn.lock:** up ([3496603](https://github.com/alfa-laboratory/arui-scripts/commit/3496603b59984c90b1cece92c647b926f5743375))
6
+ * **overrides:** allow typescript overrides and config files ([8d7b0a6](https://github.com/alfa-laboratory/arui-scripts/commit/8d7b0a663c469b54d9a033a821f39061632d1298))
package/README.md CHANGED
@@ -68,6 +68,7 @@ npm install arui-scripts --save-dev
68
68
  - `archiveName` - имя архива, который будет создан при использовании команды `archive-build`. По умолчанию `build.tar`.
69
69
  - `keepPropTypes` - если `true`, пакеты с prop-types не будут удалены из production билда.
70
70
  - `debug` - режим отладки, в котором не выполняются некоторые нежелательные операции и выводится больше сообщений об ошибках, по умолчанию `false`.
71
+ - `statsOutputFilename` - имя [stats-файла](https://webpack.js.org/api/stats/), которое будет использоваться в [bundle-analyze](#анализ-бандла) команде
71
72
  - `useTscLoader` - использовать ts-loader вместо babel-loader для обработки ts файлов. У babel-loader есть [ряд ограничений](https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/). По умолчанию `false`.
72
73
  - `componentsTheme` - путь к css файлу с темой для [core-components](https://alfa-laboratory.github.io/core-components). Используется для настройки [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties#importfrom).
73
74
  - `keepCssVars` - отключает `postcss-custom-properties`, css переменные будут оставаться в бандле.
@@ -426,14 +427,23 @@ require node.js на таких местах ломается. Поэтому н
426
427
  воспользоваться механизмом `overrides`, описанным ниже.
427
428
  По умолчанию же все не-js файлы из внешних модулей будут проигнорированы.
428
429
 
429
-
430
+ Анализ бандла
431
+ ---
432
+ Для изучения итогового бандла приложения и просмотра его размеров и включенных файлов в arui-scripts есть команда
433
+ ```
434
+ arui-scripts bundle-analyze
435
+ ```
436
+ Она запускает [webpack-bundle-analyzer](https://www.npmjs.com/package/webpack-bundle-analyzer) для клиентского кода.
437
+ Так же при запуске будет генерироваться [stats-файл](https://webpack.js.org/api/stats/), который можно использовать в
438
+ [сторонних](http://webpack.github.io/analyse/) инструментах, например для понимания почему тот или иной модуль попал в бандл.
439
+ По умолчанию файл будет писаться в `.build/stats.json`.
430
440
 
431
441
  Тонкая настройка
432
442
  ===
433
443
  Если вам не хватает гибкости при использовании `arui-scripts`, например вы хотите добавить свой плагин для вебпака -
434
444
  вы можете воспользоваться механизмом `overrides`.
435
445
 
436
- Для этого вам необходимо создать в корне вашего проекта файл `arui-scripts.overrides.js`, из которого вы сможете управлять
446
+ Для этого вам необходимо создать в корне вашего проекта файл `arui-scripts.overrides.js` или `arui-scripts.overrides.ts`, из которого вы сможете управлять
437
447
  конфигурацией почти всех инструментов, используемых в `arui-scripts`.
438
448
 
439
449
  Принцип работы тут следующий. Для всех конфигураций определен набор ключей, которые они будут искать в `arui-scripts.overrides.js`,
@@ -441,7 +451,7 @@ require node.js на таких местах ломается. Поэтому н
441
451
  существующая конфигурация и полный конфиг приложения (см [AppConfig](./src/configs/app-configs/types.ts)).
442
452
  Возвращать такая функция должна так же конфигурацию.
443
453
 
444
- Например такое содержимое `arui-scripts.overrides.js`:
454
+ Пример `arui-scripts.overrides.js`:
445
455
  ```javascript
446
456
  const path = require('path');
447
457
  module.exports = {
@@ -454,6 +464,23 @@ module.exports = {
454
464
  };
455
465
  ```
456
466
 
467
+ Пример `arui-scripts.overrides.ts`:
468
+ ```ts
469
+ import type { OverrideFile } from 'arui-scripts';
470
+ import path from 'path';
471
+
472
+ const overrides: OverrideFile = {
473
+ webpack: (config, applicationConfig) => {
474
+ config.resolve.alias = {
475
+ components: path.resolve(__dirname, 'src/components')
476
+ };
477
+ return config;
478
+ }
479
+ };
480
+
481
+ export default overrides;
482
+ ```
483
+
457
484
  С помощью этой конфигурации ко всем настройкам вебпака будет добавлен `alias` *components*.
458
485
 
459
486
  На данный момент можно переопределять следующие конфигурации:
@@ -522,10 +549,10 @@ module.exports = {
522
549
  от папки, содержащей package.json. Так что это может быть как папка в проекте, так и пакет из node_modules).
523
550
 
524
551
  Сам пакет с пресетами может содержать два файла:
525
- - `arui-scirpts.config.js`
526
- - `arui-scripts.overrides.js`
552
+ - `arui-scirpts.config.js` (или `arui-scripts.config.ts`)
553
+ - `arui-scripts.overrides.js` (или `arui-scirpts.overrides.ts`)
527
554
 
528
- ### arui-scripts.config.js
555
+ ### arui-scripts.config (js | ts)
529
556
  С помощью этого файла можно задать любые ключи [конфигурации](#настройки).
530
557
  ```js
531
558
  module.exports = {
@@ -533,6 +560,17 @@ module.exports = {
533
560
  };
534
561
  ```
535
562
 
563
+ Или в виде ts:
564
+ ```ts
565
+ import type { PackageSettings } from 'arui-scripts';
566
+
567
+ const settings: PackageSettings = {
568
+ baseDockerImage: 'my-company-artifactory.com/arui-scripts-base:11.2'
569
+ };
570
+
571
+ export default settings;
572
+ ```
573
+
536
574
  На проекте конфиурация будет загружаться в следующем порядке:
537
575
  1. базовые настройки из arui-scripts
538
576
  2. настройки из presets
@@ -545,7 +583,7 @@ module.exports = {
545
583
  они будут вычисляться относительно корня проекта, а не вашей конфигурации.
546
584
  Вы можете использовать абсолютные пути при необходимости задать путь до файла внутри пакета с пресетами.
547
585
 
548
- ### arui-scripts.overrides.js
586
+ ### arui-scripts.overrides (js | ts)
549
587
  С помощью этого файла можно задать базовые оверрайды проекта, аналогично [заданию оверрайдов на проекте](#тонкая-настройка).
550
588
  ```js
551
589
  module.exports = {
@@ -0,0 +1,2 @@
1
+ #! /usr/bin/env node
2
+ export {};
@@ -1,6 +1,15 @@
1
1
  #! /usr/bin/env node
2
2
  "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
3
7
  /* eslint import/no-dynamic-require: 0 */
8
+ const ts_node_1 = __importDefault(require("ts-node"));
9
+ // Мы используем ts-node для работы c конфигами, описаными на ts
10
+ ts_node_1.default.register({
11
+ transpileOnly: true,
12
+ });
4
13
  const commands = [
5
14
  'start',
6
15
  'build',
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import webpack from 'webpack';
2
+ declare type BuildResult = {
3
+ stats: webpack.Stats;
4
+ warnings: string[];
5
+ previousFileSizes: unknown;
6
+ };
7
+ declare function build(config: webpack.Configuration, previousFileSizes?: unknown): Promise<BuildResult>;
8
+ export default build;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -16,10 +16,15 @@ const webpack_1 = __importDefault(require("webpack"));
16
16
  const webpack_bundle_analyzer_1 = require("webpack-bundle-analyzer");
17
17
  const make_tmp_dir_1 = __importDefault(require("../util/make-tmp-dir"));
18
18
  const webpack_client_prod_1 = __importDefault(require("../../configs/webpack.client.prod"));
19
+ const app_configs_1 = __importDefault(require("../../configs/app-configs"));
19
20
  (() => __awaiter(void 0, void 0, void 0, function* () {
20
21
  var _a;
21
22
  const tmpDir = yield make_tmp_dir_1.default();
22
- (_a = webpack_client_prod_1.default === null || webpack_client_prod_1.default === void 0 ? void 0 : webpack_client_prod_1.default.plugins) === null || _a === void 0 ? void 0 : _a.push((new webpack_bundle_analyzer_1.BundleAnalyzerPlugin()));
23
+ const plugin = new webpack_bundle_analyzer_1.BundleAnalyzerPlugin({
24
+ generateStatsFile: true,
25
+ statsFilename: app_configs_1.default.statsOutputPath,
26
+ });
27
+ (_a = webpack_client_prod_1.default.plugins) === null || _a === void 0 ? void 0 : _a.push(plugin);
23
28
  webpack_client_prod_1.default.output.path = tmpDir;
24
29
  webpack_1.default(webpack_client_prod_1.default).run(() => { });
25
30
  }))();
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export default function printCompilerOutput(compilerName: string, stats: any): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare function checkRequiredFiles(): boolean;
2
+ export default checkRequiredFiles;
@@ -0,0 +1,26 @@
1
+ import { Stats } from 'webpack';
2
+ declare type AssetSize = {
3
+ name: string;
4
+ fullName: string;
5
+ gzipSize: number;
6
+ brotliSize: number;
7
+ size: number;
8
+ sizeLabel: string;
9
+ gzipLabel: string;
10
+ brotliLabel: string;
11
+ };
12
+ declare type TotalSizes = {
13
+ size: number;
14
+ sizeLabel: string;
15
+ gzipSize: number;
16
+ gzipLabel: string;
17
+ brotliSize: number;
18
+ brotliLabel: string;
19
+ };
20
+ declare type ClientAssetsSizes = {
21
+ totalSizes: TotalSizes;
22
+ assets: AssetSize[];
23
+ };
24
+ export declare function calculateAssetsSizes(webpackStats: Stats, rootDir?: string): ClientAssetsSizes;
25
+ export declare function printAssetsSizes(sizes: ClientAssetsSizes): void;
26
+ export {};
@@ -0,0 +1,2 @@
1
+ declare function exec(command: string): Promise<unknown>;
2
+ export default exec;
@@ -0,0 +1,5 @@
1
+ export = formatWebpackMessages;
2
+ declare function formatWebpackMessages(json: any): {
3
+ errors: any;
4
+ warnings: any;
5
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Создает и возвращает временную папку
3
+ * @returns {Promise<string>}
4
+ */
5
+ declare function makeTmpDir(): Promise<string>;
6
+ export default makeTmpDir;
@@ -0,0 +1,8 @@
1
+ import { AppConfigs } from './types';
2
+ /**
3
+ * Эти ключи из конфига будут обновляться из package.json при их наличии
4
+ */
5
+ export declare const availablePackageSettings: readonly ["dockerRegistry", "baseDockerImage", "serverEntry", "buildPath", "assetsPath", "additionalBuildPath", "nginxRootPath", "runFromNonRootUser", "archiveName", "serverOutput", "clientPolyfillsEntry", "clientEntry", "keepPropTypes", "useTscLoader", "useServerHMR", "clientServerPort", "serverPort", "debug", "statsOutputFilename", "componentsTheme", "keepCssVars"];
6
+ declare type ArrayElementType<ArrayType extends ReadonlyArray<unknown>> = ArrayType[number];
7
+ export declare type PackageSettings = Partial<Pick<AppConfigs, ArrayElementType<typeof availablePackageSettings>>>;
8
+ export {};
@@ -23,6 +23,7 @@ exports.availablePackageSettings = [
23
23
  'clientServerPort',
24
24
  'serverPort',
25
25
  'debug',
26
+ 'statsOutputFilename',
26
27
  'componentsTheme',
27
28
  'keepCssVars',
28
29
  ];
@@ -0,0 +1,11 @@
1
+ import { AppConfigs } from './types';
2
+ /**
3
+ * Обновление ключей конфига, зависящих от других. Это нужно делать в самый последний момент
4
+ */
5
+ export declare function calculateDependentConfig(config: AppConfigs): AppConfigs & {
6
+ publicPath: string;
7
+ serverOutputPath: string;
8
+ clientOutputPath: string;
9
+ clientPolyfillsEntry: string[];
10
+ statsOutputPath: string;
11
+ };
@@ -16,6 +16,7 @@ function calculateDependentConfig(config) {
16
16
  serverOutputPath: path_1.default.resolve(config.cwd, config.buildPath),
17
17
  clientOutputPath: path_1.default.resolve(config.cwd, config.buildPath, config.assetsPath),
18
18
  clientPolyfillsEntry: get_polyfills_1.getPolyfills(config),
19
+ statsOutputPath: path_1.default.resolve(config.cwd, config.buildPath, config.statsOutputFilename),
19
20
  });
20
21
  }
21
22
  exports.calculateDependentConfig = calculateDependentConfig;
@@ -0,0 +1,2 @@
1
+ import { AppConfigs } from './types';
2
+ export declare function getDefaults(): AppConfigs;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getDefaults = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const fs_1 = __importDefault(require("fs"));
9
+ const try_resolve_1 = require("../util/try-resolve");
9
10
  function getDefaults() {
10
11
  const CWD = process.cwd();
11
12
  const appPackage = JSON.parse(fs_1.default.readFileSync(path_1.default.join(CWD, 'package.json'), 'utf8'));
@@ -16,7 +17,7 @@ function getDefaults() {
16
17
  const absoluteNodeModulesPath = path_1.default.resolve(CWD, 'node_modules');
17
18
  const projectTsConfigPath = path_1.default.join(CWD, 'tsconfig.json');
18
19
  const yarnLockFilePath = path_1.default.join(CWD, 'yarn.lock');
19
- const overridesPath = path_1.default.join(CWD, 'arui-scripts.overrides.js');
20
+ const overridesPath = try_resolve_1.tryResolve(path_1.default.join(CWD, 'arui-scripts.overrides'));
20
21
  const nginxConfFilePath = path_1.default.join(CWD, 'nginx.conf');
21
22
  const dockerfileFilePath = path_1.default.join(CWD, 'Dockerfile');
22
23
  return {
@@ -52,13 +53,15 @@ function getDefaults() {
52
53
  clientServerPort: 8080,
53
54
  serverPort: 3000,
54
55
  debug: false,
55
- overridesPath: [overridesPath],
56
+ overridesPath: overridesPath ? [overridesPath] : [],
57
+ statsOutputFilename: 'stats.json',
56
58
  componentsTheme: undefined,
57
59
  keepCssVars: false,
58
60
  // Эти пути зависят от других настроек, которые могут быть переопределены пользователем
59
61
  publicPath: '',
60
62
  serverOutputPath: '',
61
63
  clientOutputPath: '',
64
+ statsOutputPath: '',
62
65
  };
63
66
  }
64
67
  exports.getDefaults = getDefaults;
@@ -0,0 +1,3 @@
1
+ import { AppConfigs } from './types';
2
+ declare let config: AppConfigs;
3
+ export default config;
@@ -0,0 +1,38 @@
1
+ export declare 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
+ buildPath: string;
11
+ assetsPath: string;
12
+ additionalBuildPath: string[];
13
+ nginxRootPath: string;
14
+ runFromNonRootUser: boolean;
15
+ archiveName: string;
16
+ serverEntry: string | string[] | Record<string, string | string[]>;
17
+ serverOutput: string;
18
+ clientPolyfillsEntry: null | string | string[];
19
+ clientEntry: string;
20
+ keepPropTypes: boolean;
21
+ tsconfig: string | null;
22
+ localNginxConf: string | null;
23
+ localDockerfile: string | null;
24
+ useTscLoader: boolean;
25
+ useServerHMR: boolean;
26
+ useYarn: boolean;
27
+ clientServerPort: number;
28
+ serverPort: number;
29
+ debug: boolean;
30
+ overridesPath: string[];
31
+ statsOutputFilename: string;
32
+ componentsTheme: string | undefined;
33
+ keepCssVars: boolean;
34
+ publicPath: string;
35
+ serverOutputPath: string;
36
+ clientOutputPath: string;
37
+ statsOutputPath: string;
38
+ };
@@ -0,0 +1,2 @@
1
+ import { AppConfigs } from './types';
2
+ export declare function updateWithEnv(config: AppConfigs): any;
@@ -0,0 +1,2 @@
1
+ import { AppConfigs } from './types';
2
+ export declare function updateWithPackage(config: AppConfigs): any;
@@ -0,0 +1,2 @@
1
+ import { AppConfigs } from './types';
2
+ export declare function updateWithPresets(config: AppConfigs): AppConfigs;
@@ -13,8 +13,8 @@ function updateWithPresets(config) {
13
13
  if (!packageSettings.presets) {
14
14
  return config;
15
15
  }
16
- const presetsConfigPath = try_resolve_1.tryResolve(`${packageSettings.presets}/arui-scripts.config.js`, { paths: [config.cwd] });
17
- const presetsOverridesPath = try_resolve_1.tryResolve(`${packageSettings.presets}/arui-scripts.overrides.js`, { paths: [config.cwd] });
16
+ const presetsConfigPath = try_resolve_1.tryResolve(`${packageSettings.presets}/arui-scripts.config`, { paths: [config.cwd] });
17
+ const presetsOverridesPath = try_resolve_1.tryResolve(`${packageSettings.presets}/arui-scripts.overrides`, { paths: [config.cwd] });
18
18
  if (presetsConfigPath) {
19
19
  const presetsSettings = require(presetsConfigPath);
20
20
  validate_settings_keys_1.default(available_package_settings_1.availablePackageSettings, presetsSettings);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Функция проверяет что все ключи объекта settingsObject есть в массиве availableKeys
3
+ * @param {string[]} availableKeys Массив допустимых настроек
4
+ * @param settingsObject Объект с настройками
5
+ */
6
+ declare function validateSettingsKeys(availableKeys: ReadonlyArray<string>, settingsObject: Record<string, unknown>): void;
7
+ export default validateSettingsKeys;
@@ -0,0 +1,2 @@
1
+ declare const babelClientConfig: any;
2
+ export default babelClientConfig;
@@ -0,0 +1,2 @@
1
+ declare const config: any;
2
+ export default config;
@@ -0,0 +1,3 @@
1
+ /// <reference types="webpack-dev-server" />
2
+ declare const devServerConfig: import("webpack-dev-server").Configuration;
3
+ export default devServerConfig;
@@ -0,0 +1,7 @@
1
+ declare const _exports: {
2
+ canInstrument?: boolean | undefined;
3
+ createTransformer?: ((options?: any) => import("@jest/transform").Transformer) | undefined;
4
+ getCacheKey?: ((fileData: string, filePath: string, configStr: string, options: import("@jest/transform").CacheKeyOptions) => string) | undefined;
5
+ process: (sourceText: string, sourcePath: string, config: import("@jest/types/build/Config").ProjectConfig, options?: import("@jest/transform").TransformOptions | undefined) => import("@jest/transform").TransformedSource;
6
+ };
7
+ export = _exports;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function process(src: any, filename: any): string;
2
+ export declare function process(src: any, filename: any): string;
@@ -0,0 +1,19 @@
1
+ export declare const testRegex: string;
2
+ export declare const moduleFileExtensions: string[];
3
+ export declare const collectCoverageFrom: string[];
4
+ export declare const transform: {
5
+ '^.+\\.jsx?$': string;
6
+ '^.+\\.tsx?$': string;
7
+ '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': string;
8
+ };
9
+ export declare const moduleNameMapper: {
10
+ '\\.css$': string;
11
+ };
12
+ export declare const setupFiles: string[];
13
+ export declare const snapshotSerializers: string[];
14
+ export declare const globals: {
15
+ 'ts-jest': {
16
+ tsconfig: string | null;
17
+ babelConfig: any;
18
+ };
19
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ export declare const customMedia: {
2
+ "--small": string;
3
+ "--small-only": string;
4
+ "--medium": string;
5
+ "--medium-only": string;
6
+ "--large": string;
7
+ "--large-only": string;
8
+ "--xlarge": string;
9
+ "--xlarge-only": string;
10
+ "--xxlarge": string;
11
+ "--xxlarge-only": string;
12
+ "--mobile-s": string;
13
+ "--mobile-m": string;
14
+ "--mobile-l": string;
15
+ "--mobile": string;
16
+ "--tablet-s": string;
17
+ "--tablet-m": string;
18
+ "--tablet": string;
19
+ "--desktop-s": string;
20
+ "--desktop-m": string;
21
+ "--desktop-l": string;
22
+ "--desktop-xl": string;
23
+ "--desktop": string;
24
+ };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Функция для создания конфигурационного файла postcss
3
+ * @param {String[]} plugins список плагинов
4
+ * @param {Object} options коллекция конфигураций плагинов, где ключ - название плагина, а значение - аргумент для инициализации
5
+ * @returns {*}
6
+ */
7
+ export declare function createPostcssConfig(plugins: string[], options: Record<string, unknown>): any[];
8
+ export declare const postcssPlugins: string[];
9
+ export declare const postcssPluginsOptions: {
10
+ 'postcss-custom-properties'?: {
11
+ preserve: boolean;
12
+ importFrom: string | undefined;
13
+ };
14
+ 'postcss-import': {
15
+ path: string[];
16
+ plugins: any[];
17
+ };
18
+ 'postcss-url': {
19
+ url: string;
20
+ };
21
+ 'postcss-custom-media': {
22
+ importFrom: string;
23
+ };
24
+ 'postcss-color-mod-function': {
25
+ unresolved: string;
26
+ };
27
+ };
@@ -0,0 +1,2 @@
1
+ declare const postcssConfig: any[];
2
+ export default postcssConfig;
@@ -0,0 +1,3 @@
1
+ import type { WebpackOptionsNormalized } from 'webpack';
2
+ declare const statsOptions: WebpackOptionsNormalized['stats'];
3
+ export default statsOptions;
@@ -29,8 +29,6 @@ const statsOptions = apply_overrides_1.default('stats', {
29
29
  hash: false,
30
30
  // Add built modules information
31
31
  modules: true,
32
- // Set the maximum number of modules to be shown
33
- maxModules: 0,
34
32
  // Show dependencies and origin of warnings/errors (since webpack 2.5.0)
35
33
  moduleTrace: true,
36
34
  // Show performance hint when file size exceeds `performance.maxAssetSize`
@@ -0,0 +1,2 @@
1
+ declare const supportingBrowsers: string[];
2
+ export default supportingBrowsers;
@@ -0,0 +1,37 @@
1
+ import type { Configuration as WebpackConfiguration, WebpackOptionsNormalized } from 'webpack';
2
+ import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
3
+ import { AppConfigs } from '../app-configs/types';
4
+ declare type Overrides = {
5
+ webpack: WebpackConfiguration;
6
+ webpackClient: WebpackConfiguration;
7
+ webpackDev: WebpackConfiguration;
8
+ webpackClientDev: WebpackConfiguration;
9
+ webpackServer: WebpackConfiguration;
10
+ webpackServerDev: WebpackConfiguration;
11
+ webpackProd: WebpackConfiguration;
12
+ webpackClientProd: WebpackConfiguration;
13
+ webpackServerProd: WebpackConfiguration;
14
+ devServer: WebpackDevServerConfiguration;
15
+ stats: WebpackOptionsNormalized['stats'];
16
+ babel: any;
17
+ babelClient: any;
18
+ babelServer: any;
19
+ postcss: any[];
20
+ browsers: string[];
21
+ supportingBrowsers: string[];
22
+ Dockerfile: string;
23
+ nginx: string;
24
+ 'start.sh': string;
25
+ };
26
+ declare type OverrideFunction<K extends keyof Overrides> = (config: Overrides[K], appConfig: AppConfigs) => Overrides[K];
27
+ export declare type OverrideFile = {
28
+ [K in keyof Overrides]?: OverrideFunction<K>;
29
+ };
30
+ /**
31
+ *
32
+ * @param {String|String[]} overridesKey Ключи оверрайда
33
+ * @param {Object} config Конфиг, к которому нужно применить оверрайды
34
+ * @returns {*}
35
+ */
36
+ declare function applyOverrides<Key extends keyof Overrides>(overridesKey: Key | Key[], config: Overrides[Key]): Overrides[Key];
37
+ export default applyOverrides;
@@ -25,11 +25,12 @@ function applyOverrides(overridesKey, config) {
25
25
  }
26
26
  overridesKey.forEach(key => {
27
27
  overrides.forEach((override) => {
28
+ var _a;
28
29
  if (override.hasOwnProperty(key)) {
29
30
  if (typeof override[key] !== 'function') {
30
31
  console.error(`Override ${key} must be a function`);
31
32
  }
32
- config = override[key](config, app_configs_1.default);
33
+ config = (_a = override[key]) === null || _a === void 0 ? void 0 : _a.call(override, config, app_configs_1.default);
33
34
  }
34
35
  });
35
36
  });
@@ -0,0 +1,2 @@
1
+ declare function checkNodeVersion(majorVersion: number): boolean;
2
+ export default checkNodeVersion;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @param {string|string[]|object} entryPoint Строка, массив строк или объект с энтрипоинтами
3
+ * @param {Function} getSingleEntry Функция, возвращающая конфигурацию для одного entryPoint
4
+ * @returns {*}
5
+ */
6
+ declare function getEntry(entryPoint: string | string[] | Record<string, string | string[]>, getSingleEntry: (entry: string[]) => string[]): string[] | Record<string, string | string[]>;
7
+ export default getEntry;
@@ -0,0 +1,3 @@
1
+ /// <reference types="node" />
2
+ import { AppConfigs } from '../app-configs/types';
3
+ export declare function getPolyfills(config: AppConfigs, requireResolve?: RequireResolve): string[];
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1 @@
1
+ export {};