arui-scripts 12.2.0 → 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 (69) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/README.md +34 -6
  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/docker-build/index.d.ts +1 -0
  12. package/build/commands/ensure-yarn/index.d.ts +0 -0
  13. package/build/commands/start/client.d.ts +1 -0
  14. package/build/commands/start/index.d.ts +1 -0
  15. package/build/commands/start/print-compiler-output.d.ts +1 -0
  16. package/build/commands/start/server.d.ts +1 -0
  17. package/build/commands/test/index.d.ts +1 -0
  18. package/build/commands/util/check-required-files.d.ts +2 -0
  19. package/build/commands/util/client-assets-sizes.d.ts +26 -0
  20. package/build/commands/util/exec.d.ts +2 -0
  21. package/build/commands/util/format-webpack-messages.d.ts +5 -0
  22. package/build/commands/util/make-tmp-dir.d.ts +6 -0
  23. package/build/configs/app-configs/available-package-settings.d.ts +8 -0
  24. package/build/configs/app-configs/calculate-dependent-config.d.ts +11 -0
  25. package/build/configs/app-configs/get-defaults.d.ts +2 -0
  26. package/build/configs/app-configs/get-defaults.js +3 -2
  27. package/build/configs/app-configs/index.d.ts +3 -0
  28. package/build/configs/app-configs/types.d.ts +38 -0
  29. package/build/configs/app-configs/update-with-env.d.ts +2 -0
  30. package/build/configs/app-configs/update-with-package.d.ts +2 -0
  31. package/build/configs/app-configs/update-with-presets.d.ts +2 -0
  32. package/build/configs/app-configs/update-with-presets.js +2 -2
  33. package/build/configs/app-configs/validate-settings-keys.d.ts +7 -0
  34. package/build/configs/babel-client.d.ts +2 -0
  35. package/build/configs/babel-server.d.ts +2 -0
  36. package/build/configs/dev-server.d.ts +3 -0
  37. package/build/configs/jest/babel-transform.d.ts +7 -0
  38. package/build/configs/jest/css-mock.d.ts +1 -0
  39. package/build/configs/jest/file-transform.d.ts +2 -0
  40. package/build/configs/jest/index.d.ts +19 -0
  41. package/build/configs/jest/setup.d.ts +1 -0
  42. package/build/configs/mq.d.ts +24 -0
  43. package/build/configs/postcss.config.d.ts +27 -0
  44. package/build/configs/postcss.d.ts +2 -0
  45. package/build/configs/stats-options.d.ts +3 -0
  46. package/build/configs/stats-options.js +0 -2
  47. package/build/configs/supporting-browsers.d.ts +2 -0
  48. package/build/configs/util/apply-overrides.d.ts +37 -0
  49. package/build/configs/util/apply-overrides.js +2 -1
  50. package/build/configs/util/check-node-version.d.ts +2 -0
  51. package/build/configs/util/get-entry.d.ts +7 -0
  52. package/build/configs/util/get-polyfills.d.ts +3 -0
  53. package/build/configs/util/install-sourcemap-support.d.ts +1 -0
  54. package/build/configs/util/node-assets-ignore.d.ts +0 -0
  55. package/build/configs/util/noop.d.ts +1 -0
  56. package/build/configs/util/try-resolve.d.ts +1 -0
  57. package/build/configs/webpack.client.dev.d.ts +3 -0
  58. package/build/configs/webpack.client.prod.d.ts +3 -0
  59. package/build/configs/webpack.server.dev.d.ts +3 -0
  60. package/build/configs/webpack.server.prod.d.ts +3 -0
  61. package/build/index.d.ts +2 -0
  62. package/build/index.js +2 -0
  63. package/build/plugins/reload-server-webpack-plugin.d.ts +9 -0
  64. package/build/templates/dockerfile.template.d.ts +2 -0
  65. package/build/templates/nginx.conf.template.d.ts +2 -0
  66. package/build/templates/start.template.d.ts +2 -0
  67. package/build/tsconfig-local.tsbuildinfo +272 -170
  68. package/package.json +5 -3
  69. package/tsconfig-local.json +4 -2
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- # [12.2.0](https://github.com/alfa-laboratory/arui-scripts/compare/v12.1.0...v12.2.0) (2022-02-17)
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
4
  ### Features
5
5
 
6
- * **webpack-client:** add stats file generation ([f6301da](https://github.com/alfa-laboratory/arui-scripts/commit/f6301da5ebf6f7975a1b810c904cafd9c1d3f8f8))
6
+ * **overrides:** allow typescript overrides and config files ([8d7b0a6](https://github.com/alfa-laboratory/arui-scripts/commit/8d7b0a663c469b54d9a033a821f39061632d1298))
package/README.md CHANGED
@@ -443,7 +443,7 @@ arui-scripts bundle-analyze
443
443
  Если вам не хватает гибкости при использовании `arui-scripts`, например вы хотите добавить свой плагин для вебпака -
444
444
  вы можете воспользоваться механизмом `overrides`.
445
445
 
446
- Для этого вам необходимо создать в корне вашего проекта файл `arui-scripts.overrides.js`, из которого вы сможете управлять
446
+ Для этого вам необходимо создать в корне вашего проекта файл `arui-scripts.overrides.js` или `arui-scripts.overrides.ts`, из которого вы сможете управлять
447
447
  конфигурацией почти всех инструментов, используемых в `arui-scripts`.
448
448
 
449
449
  Принцип работы тут следующий. Для всех конфигураций определен набор ключей, которые они будут искать в `arui-scripts.overrides.js`,
@@ -451,7 +451,7 @@ arui-scripts bundle-analyze
451
451
  существующая конфигурация и полный конфиг приложения (см [AppConfig](./src/configs/app-configs/types.ts)).
452
452
  Возвращать такая функция должна так же конфигурацию.
453
453
 
454
- Например такое содержимое `arui-scripts.overrides.js`:
454
+ Пример `arui-scripts.overrides.js`:
455
455
  ```javascript
456
456
  const path = require('path');
457
457
  module.exports = {
@@ -464,6 +464,23 @@ module.exports = {
464
464
  };
465
465
  ```
466
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
+
467
484
  С помощью этой конфигурации ко всем настройкам вебпака будет добавлен `alias` *components*.
468
485
 
469
486
  На данный момент можно переопределять следующие конфигурации:
@@ -532,10 +549,10 @@ module.exports = {
532
549
  от папки, содержащей package.json. Так что это может быть как папка в проекте, так и пакет из node_modules).
533
550
 
534
551
  Сам пакет с пресетами может содержать два файла:
535
- - `arui-scirpts.config.js`
536
- - `arui-scripts.overrides.js`
552
+ - `arui-scirpts.config.js` (или `arui-scripts.config.ts`)
553
+ - `arui-scripts.overrides.js` (или `arui-scirpts.overrides.ts`)
537
554
 
538
- ### arui-scripts.config.js
555
+ ### arui-scripts.config (js | ts)
539
556
  С помощью этого файла можно задать любые ключи [конфигурации](#настройки).
540
557
  ```js
541
558
  module.exports = {
@@ -543,6 +560,17 @@ module.exports = {
543
560
  };
544
561
  ```
545
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
+
546
574
  На проекте конфиурация будет загружаться в следующем порядке:
547
575
  1. базовые настройки из arui-scripts
548
576
  2. настройки из presets
@@ -555,7 +583,7 @@ module.exports = {
555
583
  они будут вычисляться относительно корня проекта, а не вашей конфигурации.
556
584
  Вы можете использовать абсолютные пути при необходимости задать путь до файла внутри пакета с пресетами.
557
585
 
558
- ### arui-scripts.overrides.js
586
+ ### arui-scripts.overrides (js | ts)
559
587
  С помощью этого файла можно задать базовые оверрайды проекта, аналогично [заданию оверрайдов на проекте](#тонкая-настройка).
560
588
  ```js
561
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 {};
@@ -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 {};
@@ -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
+ };
@@ -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,7 +53,7 @@ function getDefaults() {
52
53
  clientServerPort: 8080,
53
54
  serverPort: 3000,
54
55
  debug: false,
55
- overridesPath: [overridesPath],
56
+ overridesPath: overridesPath ? [overridesPath] : [],
56
57
  statsOutputFilename: 'stats.json',
57
58
  componentsTheme: undefined,
58
59
  keepCssVars: false,
@@ -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 {};
@@ -0,0 +1 @@
1
+ export declare function tryResolve(...args: Parameters<typeof require.resolve>): string | undefined;
@@ -0,0 +1,3 @@
1
+ import webpack from 'webpack';
2
+ declare const webpackClientDev: webpack.Configuration;
3
+ export default webpackClientDev;
@@ -0,0 +1,3 @@
1
+ import webpack from 'webpack';
2
+ declare const config: webpack.Configuration;
3
+ export default config;
@@ -0,0 +1,3 @@
1
+ import webpack from 'webpack';
2
+ declare const webpackServerDev: webpack.Configuration;
3
+ export default webpackServerDev;
@@ -0,0 +1,3 @@
1
+ import webpack from 'webpack';
2
+ declare const config: webpack.Configuration;
3
+ export default config;
@@ -0,0 +1,2 @@
1
+ export type { OverrideFile } from './configs/util/apply-overrides';
2
+ export type { PackageSettings } from './configs/app-configs/available-package-settings';
package/build/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export = ReloadServerPlugin;
2
+ declare class ReloadServerPlugin {
3
+ constructor({ script }?: {
4
+ script: string;
5
+ });
6
+ done: any;
7
+ workers: any[];
8
+ apply(compiler: any): void;
9
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;