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.
- package/CHANGELOG.md +4 -3
- package/README.md +68 -8
- package/build/bin/index.d.ts +3 -0
- package/build/commands/archive-build/index.d.ts +1 -0
- package/build/commands/build/build-wrapper.d.ts +8 -0
- package/build/commands/build/client.d.ts +1 -0
- package/build/commands/build/index.d.ts +1 -0
- package/build/commands/build/server.d.ts +1 -0
- package/build/commands/bundle-analyze/index.d.ts +1 -0
- package/build/commands/bundle-analyze/index.js +6 -1
- package/build/commands/docker-build/index.d.ts +1 -0
- package/build/commands/ensure-yarn/index.d.ts +0 -0
- package/build/commands/start/client.d.ts +1 -0
- package/build/commands/start/index.d.ts +1 -0
- package/build/commands/start/print-compiler-output.d.ts +1 -0
- package/build/commands/start/server.d.ts +1 -0
- package/build/commands/test/index.d.ts +1 -0
- package/build/commands/util/check-required-files.d.ts +2 -0
- package/build/commands/util/client-assets-sizes.d.ts +26 -0
- package/build/commands/util/exec.d.ts +2 -0
- package/build/commands/util/format-webpack-messages.d.ts +5 -0
- package/build/commands/util/make-tmp-dir.d.ts +6 -0
- package/build/configs/app-configs/available-package-settings.d.ts +8 -0
- package/build/configs/app-configs/available-package-settings.js +1 -0
- package/build/configs/app-configs/calculate-dependent-config.d.ts +11 -0
- package/build/configs/app-configs/calculate-dependent-config.js +1 -0
- package/build/configs/app-configs/get-defaults.d.ts +2 -0
- package/build/configs/app-configs/get-defaults.js +5 -2
- package/build/configs/app-configs/index.d.ts +4 -0
- package/build/configs/app-configs/index.js +3 -0
- package/build/configs/app-configs/types.d.ts +38 -0
- package/build/configs/app-configs/update-with-config-file.d.ts +2 -0
- package/build/configs/app-configs/update-with-config-file.js +25 -0
- package/build/configs/app-configs/update-with-env.d.ts +2 -0
- package/build/configs/app-configs/update-with-package.d.ts +2 -0
- package/build/configs/app-configs/update-with-presets.d.ts +2 -0
- package/build/configs/app-configs/update-with-presets.js +7 -3
- package/build/configs/app-configs/validate-settings-keys.d.ts +7 -0
- package/build/configs/babel-client.d.ts +2 -0
- package/build/configs/babel-server.d.ts +2 -0
- package/build/configs/dev-server.d.ts +3 -0
- package/build/configs/jest/babel-transform.d.ts +7 -0
- package/build/configs/jest/css-mock.d.ts +1 -0
- package/build/configs/jest/file-transform.d.ts +2 -0
- package/build/configs/jest/index.d.ts +19 -0
- package/build/configs/jest/setup.d.ts +1 -0
- package/build/configs/mq.d.ts +24 -0
- package/build/configs/postcss.config.d.ts +27 -0
- package/build/configs/postcss.d.ts +2 -0
- package/build/configs/stats-options.d.ts +3 -0
- package/build/configs/stats-options.js +0 -2
- package/build/configs/supporting-browsers.d.ts +2 -0
- package/build/configs/util/apply-overrides.d.ts +37 -0
- package/build/configs/util/apply-overrides.js +12 -4
- package/build/configs/util/check-node-version.d.ts +2 -0
- package/build/configs/util/get-entry.d.ts +7 -0
- package/build/configs/util/get-polyfills.d.ts +3 -0
- package/build/configs/util/install-sourcemap-support.d.ts +1 -0
- package/build/configs/util/node-assets-ignore.d.ts +0 -0
- package/build/configs/util/noop.d.ts +1 -0
- package/build/configs/util/register-ts-node.d.ts +0 -0
- package/build/configs/util/register-ts-node.js +15 -0
- package/build/configs/util/try-resolve.d.ts +1 -0
- package/build/configs/webpack.client.dev.d.ts +3 -0
- package/build/configs/webpack.client.prod.d.ts +3 -0
- package/build/configs/webpack.server.dev.d.ts +3 -0
- package/build/configs/webpack.server.prod.d.ts +3 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +2 -0
- package/build/plugins/reload-server-webpack-plugin.d.ts +9 -0
- package/build/templates/dockerfile.template.d.ts +2 -0
- package/build/templates/nginx.conf.template.d.ts +2 -0
- package/build/templates/start.template.d.ts +2 -0
- package/build/tsconfig-local.tsbuildinfo +411 -343
- package/package.json +3 -2
- package/release.config.js +1 -2
- 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
|
-
|
|
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
|
-
|
|
30
|
-
|
|
36
|
+
const overrideFn = override[key];
|
|
37
|
+
if (typeof overrideFn !== 'function') {
|
|
38
|
+
throw new TypeError(`Override ${key} must be a function`);
|
|
31
39
|
}
|
|
32
|
-
config =
|
|
40
|
+
config = overrideFn(config, app_configs_1.default);
|
|
33
41
|
}
|
|
34
42
|
});
|
|
35
43
|
});
|
|
@@ -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 @@
|
|
|
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;
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED