arui-scripts 12.0.3 → 12.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +4 -3
  2. package/README.md +68 -8
  3. package/build/bin/index.d.ts +3 -0
  4. package/build/commands/archive-build/index.d.ts +1 -0
  5. package/build/commands/build/build-wrapper.d.ts +8 -0
  6. package/build/commands/build/client.d.ts +1 -0
  7. package/build/commands/build/index.d.ts +1 -0
  8. package/build/commands/build/server.d.ts +1 -0
  9. package/build/commands/bundle-analyze/index.d.ts +1 -0
  10. package/build/commands/bundle-analyze/index.js +6 -1
  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/available-package-settings.js +1 -0
  25. package/build/configs/app-configs/calculate-dependent-config.d.ts +11 -0
  26. package/build/configs/app-configs/calculate-dependent-config.js +1 -0
  27. package/build/configs/app-configs/get-defaults.d.ts +2 -0
  28. package/build/configs/app-configs/get-defaults.js +5 -2
  29. package/build/configs/app-configs/index.d.ts +4 -0
  30. package/build/configs/app-configs/index.js +3 -0
  31. package/build/configs/app-configs/types.d.ts +38 -0
  32. package/build/configs/app-configs/update-with-config-file.d.ts +2 -0
  33. package/build/configs/app-configs/update-with-config-file.js +25 -0
  34. package/build/configs/app-configs/update-with-env.d.ts +2 -0
  35. package/build/configs/app-configs/update-with-package.d.ts +2 -0
  36. package/build/configs/app-configs/update-with-presets.d.ts +2 -0
  37. package/build/configs/app-configs/update-with-presets.js +7 -3
  38. package/build/configs/app-configs/validate-settings-keys.d.ts +7 -0
  39. package/build/configs/babel-client.d.ts +2 -0
  40. package/build/configs/babel-server.d.ts +2 -0
  41. package/build/configs/dev-server.d.ts +3 -0
  42. package/build/configs/jest/babel-transform.d.ts +7 -0
  43. package/build/configs/jest/css-mock.d.ts +1 -0
  44. package/build/configs/jest/file-transform.d.ts +2 -0
  45. package/build/configs/jest/index.d.ts +19 -0
  46. package/build/configs/jest/setup.d.ts +1 -0
  47. package/build/configs/mq.d.ts +24 -0
  48. package/build/configs/postcss.config.d.ts +27 -0
  49. package/build/configs/postcss.d.ts +2 -0
  50. package/build/configs/stats-options.d.ts +3 -0
  51. package/build/configs/stats-options.js +0 -2
  52. package/build/configs/supporting-browsers.d.ts +2 -0
  53. package/build/configs/util/apply-overrides.d.ts +37 -0
  54. package/build/configs/util/apply-overrides.js +12 -4
  55. package/build/configs/util/check-node-version.d.ts +2 -0
  56. package/build/configs/util/get-entry.d.ts +7 -0
  57. package/build/configs/util/get-polyfills.d.ts +3 -0
  58. package/build/configs/util/install-sourcemap-support.d.ts +1 -0
  59. package/build/configs/util/node-assets-ignore.d.ts +0 -0
  60. package/build/configs/util/noop.d.ts +1 -0
  61. package/build/configs/util/register-ts-node.d.ts +0 -0
  62. package/build/configs/util/register-ts-node.js +15 -0
  63. package/build/configs/util/try-resolve.d.ts +1 -0
  64. package/build/configs/webpack.client.dev.d.ts +3 -0
  65. package/build/configs/webpack.client.prod.d.ts +3 -0
  66. package/build/configs/webpack.server.dev.d.ts +3 -0
  67. package/build/configs/webpack.server.prod.d.ts +3 -0
  68. package/build/index.d.ts +2 -0
  69. package/build/index.js +2 -0
  70. package/build/plugins/reload-server-webpack-plugin.d.ts +9 -0
  71. package/build/templates/dockerfile.template.d.ts +2 -0
  72. package/build/templates/nginx.conf.template.d.ts +2 -0
  73. package/build/templates/start.template.d.ts +2 -0
  74. package/build/tsconfig-local.tsbuildinfo +411 -343
  75. package/package.json +3 -2
  76. package/release.config.js +1 -2
  77. package/tsconfig-local.json +4 -2
@@ -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;
@@ -7,9 +7,16 @@ const app_configs_1 = __importDefault(require("../app-configs"));
7
7
  let overrides = [];
8
8
  overrides = app_configs_1.default.overridesPath.map(path => {
9
9
  try {
10
- return require(path);
10
+ const requireResult = require(path);
11
+ if (requireResult.__esModule) {
12
+ // ts-node импортирует esModules, из них надо вытягивать default именно так
13
+ return requireResult.default;
14
+ }
15
+ return requireResult;
11
16
  }
12
17
  catch (e) {
18
+ console.error(`Unable to process override file "${path}"`);
19
+ console.log(e);
13
20
  return {};
14
21
  }
15
22
  });
@@ -26,10 +33,11 @@ function applyOverrides(overridesKey, config) {
26
33
  overridesKey.forEach(key => {
27
34
  overrides.forEach((override) => {
28
35
  if (override.hasOwnProperty(key)) {
29
- if (typeof override[key] !== 'function') {
30
- console.error(`Override ${key} must be a function`);
36
+ const overrideFn = override[key];
37
+ if (typeof overrideFn !== 'function') {
38
+ throw new TypeError(`Override ${key} must be a function`);
31
39
  }
32
- config = override[key](config, app_configs_1.default);
40
+ config = overrideFn(config, app_configs_1.default);
33
41
  }
34
42
  });
35
43
  });
@@ -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 {};
File without changes
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // Мы используем ts-node для работы c конфигами, описаными на ts
3
+ require('ts-node')
4
+ .register({
5
+ transpileOnly: true,
6
+ ignore: [],
7
+ compilerOptions: {
8
+ target: 'ES2016',
9
+ module: 'CommonJS',
10
+ skipLibCheck: true,
11
+ allowSyntheticDefaultImports: true,
12
+ moduleResolution: 'node',
13
+ esModuleInterop: true,
14
+ },
15
+ });
@@ -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;