arui-scripts 13.5.0-feat-NEWCLICKUI-1746.1 → 14.0.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 +36 -0
- package/README.md +13 -5
- package/build/commands/archive-build/index.js +3 -3
- package/build/commands/build/build-wrapper.d.ts +1 -1
- package/build/commands/build/build-wrapper.js +2 -2
- package/build/commands/build/client.js +4 -4
- package/build/commands/build/index.js +3 -3
- package/build/commands/build/server.js +2 -2
- package/build/commands/bundle-analyze/index.js +2 -2
- package/build/commands/changelog/index.d.ts +1 -22
- package/build/commands/changelog/index.js +57 -46
- package/build/commands/docker-build/index.js +7 -7
- package/build/commands/docker-build-compiled/index.js +5 -5
- package/build/commands/start/client.js +3 -3
- package/build/commands/start/index.js +3 -3
- package/build/commands/start/server.js +2 -2
- package/build/commands/util/client-assets-sizes.d.ts +3 -3
- package/build/commands/util/client-assets-sizes.js +9 -9
- package/build/commands/util/docker-build.d.ts +1 -1
- package/build/commands/util/yarn.d.ts +1 -1
- package/build/configs/app-configs/available-package-settings.d.ts +2 -2
- package/build/configs/app-configs/calculate-dependent-config.js +3 -3
- package/build/configs/app-configs/get-defaults.js +9 -1
- package/build/configs/app-configs/index.js +6 -6
- package/build/configs/app-configs/types.d.ts +7 -1
- package/build/configs/app-configs/update-with-config-file.js +3 -3
- package/build/configs/app-configs/update-with-env.js +2 -2
- package/build/configs/app-configs/update-with-package.js +2 -2
- package/build/configs/app-configs/update-with-presets.js +4 -4
- package/build/configs/babel-client.js +1 -1
- package/build/configs/babel-dependencies.js +1 -1
- package/build/configs/babel-server.js +1 -1
- package/build/configs/dev-server.js +1 -1
- package/build/configs/jest/babel-transform.d.ts +1 -6
- package/build/configs/jest/file-transform.d.ts +3 -2
- package/build/configs/jest/file-transform.js +1 -1
- package/build/configs/jest/index.d.ts +8 -8
- package/build/configs/jest/index.js +1 -1
- package/build/configs/postcss.config.d.ts +1 -1
- package/build/configs/postcss.js +1 -1
- package/build/configs/server-externals-exemptions.d.ts +1 -0
- package/build/configs/server-externals-exemptions.js +20 -0
- package/build/configs/stats-options.js +1 -1
- package/build/configs/supporting-browsers.js +1 -1
- package/build/configs/util/apply-overrides.d.ts +4 -3
- package/build/configs/webpack.client.dev.js +7 -2
- package/build/configs/webpack.client.prod.js +5 -3
- package/build/configs/webpack.server.dev.js +5 -14
- package/build/configs/webpack.server.prod.js +5 -14
- package/build/index.js +1 -0
- package/build/templates/dockerfile-compiled.template.js +3 -3
- package/build/templates/dockerfile.template.js +1 -1
- package/build/templates/nginx.conf.template.js +1 -1
- package/build/templates/start.template.js +1 -1
- package/build/tsconfig-local.tsbuildinfo +1 -8829
- package/package.json +6 -6
|
@@ -20,17 +20,17 @@ function calculateDependentConfig(config) {
|
|
|
20
20
|
// Поэтому мы читаем версию того babel/runtime, который установлен в проекте.
|
|
21
21
|
// Так же мы не можем использовать require для получения контента из babel/runtime/package.json,
|
|
22
22
|
// потому что webpack.cache будет ругаться на то, что мы пытаемся импортировать файлы НЕ из своего node_modules.
|
|
23
|
-
const pathToProjectBabelRuntime = resolve_1.resolveNodeModuleRelativeTo(config.cwd, '@babel/runtime/package.json');
|
|
23
|
+
const pathToProjectBabelRuntime = (0, resolve_1.resolveNodeModuleRelativeTo)(config.cwd, '@babel/runtime/package.json');
|
|
24
24
|
babelRuntimeVersion = JSON.parse(fs_1.default.readFileSync(pathToProjectBabelRuntime, 'utf8')).version;
|
|
25
25
|
}
|
|
26
26
|
catch (e) {
|
|
27
27
|
babelRuntimeVersion = require('@babel/runtime/package.json').version;
|
|
28
28
|
}
|
|
29
|
-
return lodash_merge_1.default(config, {
|
|
29
|
+
return (0, lodash_merge_1.default)(config, {
|
|
30
30
|
publicPath: `${config.assetsPath}/`,
|
|
31
31
|
serverOutputPath: path_1.default.resolve(config.cwd, config.buildPath),
|
|
32
32
|
clientOutputPath: path_1.default.resolve(config.cwd, config.buildPath, config.assetsPath),
|
|
33
|
-
clientPolyfillsEntry: get_polyfills_1.getPolyfills(config),
|
|
33
|
+
clientPolyfillsEntry: (0, get_polyfills_1.getPolyfills)(config),
|
|
34
34
|
statsOutputPath: path_1.default.resolve(config.cwd, config.buildPath, config.statsOutputFilename),
|
|
35
35
|
watchIgnorePath: ['node_modules', config.buildPath],
|
|
36
36
|
babelRuntimeVersion,
|
|
@@ -15,9 +15,10 @@ function getDefaults() {
|
|
|
15
15
|
}
|
|
16
16
|
const absoluteSrcPath = path_1.default.resolve(CWD, 'src');
|
|
17
17
|
const absoluteNodeModulesPath = path_1.default.resolve(CWD, 'node_modules');
|
|
18
|
+
const absoluteNodeModulesBinPath = path_1.default.resolve(absoluteNodeModulesPath, '.bin');
|
|
18
19
|
const projectTsConfigPath = path_1.default.join(CWD, 'tsconfig.json');
|
|
19
20
|
const yarnLockFilePath = path_1.default.join(CWD, 'yarn.lock');
|
|
20
|
-
const overridesPath = resolve_1.tryResolve(path_1.default.join(CWD, 'arui-scripts.overrides'));
|
|
21
|
+
const overridesPath = (0, resolve_1.tryResolve)(path_1.default.join(CWD, 'arui-scripts.overrides'));
|
|
21
22
|
const nginxConfFilePath = path_1.default.join(CWD, 'nginx.conf');
|
|
22
23
|
const dockerfileFilePath = path_1.default.join(CWD, 'Dockerfile');
|
|
23
24
|
return {
|
|
@@ -30,6 +31,7 @@ function getDefaults() {
|
|
|
30
31
|
cwd: CWD,
|
|
31
32
|
appSrc: absoluteSrcPath,
|
|
32
33
|
appNodeModules: absoluteNodeModulesPath,
|
|
34
|
+
appNodeModulesBin: absoluteNodeModulesBinPath,
|
|
33
35
|
buildPath: '.build',
|
|
34
36
|
assetsPath: 'assets',
|
|
35
37
|
additionalBuildPath: ['config'],
|
|
@@ -68,6 +70,12 @@ function getDefaults() {
|
|
|
68
70
|
clientOutputPath: '',
|
|
69
71
|
statsOutputPath: '',
|
|
70
72
|
watchIgnorePath: [],
|
|
73
|
+
// changelog paths
|
|
74
|
+
changelogPath: path_1.default.resolve(CWD, './CHANGELOG.md'),
|
|
75
|
+
changelogTmpPath: path_1.default.resolve(CWD, './CHANGELOG_TMP.md'),
|
|
76
|
+
changelogFeaturesPath: path_1.default.resolve(CWD, './changelog_features.tmp'),
|
|
77
|
+
changelogBugfixesPath: path_1.default.resolve(CWD, './changelog_bugfixes.tmp'),
|
|
78
|
+
changelogBreakingChangesPath: path_1.default.resolve(CWD, './changelog_breaking_changes.tmp'),
|
|
71
79
|
};
|
|
72
80
|
}
|
|
73
81
|
exports.getDefaults = getDefaults;
|
|
@@ -7,10 +7,10 @@ const update_with_package_1 = require("./update-with-package");
|
|
|
7
7
|
const update_with_presets_1 = require("./update-with-presets");
|
|
8
8
|
const calculate_dependent_config_1 = require("./calculate-dependent-config");
|
|
9
9
|
const update_with_config_file_1 = require("./update-with-config-file");
|
|
10
|
-
let config = get_defaults_1.getDefaults();
|
|
11
|
-
config = update_with_presets_1.updateWithPresets(config);
|
|
12
|
-
config = update_with_package_1.updateWithPackage(config);
|
|
13
|
-
config = update_with_config_file_1.updateWithConfigFile(config);
|
|
14
|
-
config = update_with_env_1.updateWithEnv(config);
|
|
15
|
-
config = calculate_dependent_config_1.calculateDependentConfig(config);
|
|
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
16
|
exports.default = config;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type AppConfigs = {
|
|
2
2
|
appPackage: any;
|
|
3
3
|
name: string;
|
|
4
4
|
version: string;
|
|
@@ -7,6 +7,7 @@ export declare type AppConfigs = {
|
|
|
7
7
|
cwd: string;
|
|
8
8
|
appSrc: string;
|
|
9
9
|
appNodeModules: string;
|
|
10
|
+
appNodeModulesBin: string;
|
|
10
11
|
buildPath: string;
|
|
11
12
|
assetsPath: string;
|
|
12
13
|
additionalBuildPath: string[];
|
|
@@ -41,4 +42,9 @@ export declare type AppConfigs = {
|
|
|
41
42
|
clientOutputPath: string;
|
|
42
43
|
statsOutputPath: string;
|
|
43
44
|
watchIgnorePath: string[];
|
|
45
|
+
changelogPath: string;
|
|
46
|
+
changelogTmpPath: string;
|
|
47
|
+
changelogFeaturesPath: string;
|
|
48
|
+
changelogBugfixesPath: string;
|
|
49
|
+
changelogBreakingChangesPath: string;
|
|
44
50
|
};
|
|
@@ -10,15 +10,15 @@ const resolve_1 = require("../util/resolve");
|
|
|
10
10
|
const validate_settings_keys_1 = __importDefault(require("./validate-settings-keys"));
|
|
11
11
|
const available_package_settings_1 = require("./available-package-settings");
|
|
12
12
|
function updateWithConfigFile(config) {
|
|
13
|
-
const appConfigPath = resolve_1.tryResolve(path_1.default.join(config.cwd, '/arui-scripts.config'));
|
|
13
|
+
const appConfigPath = (0, resolve_1.tryResolve)(path_1.default.join(config.cwd, '/arui-scripts.config'));
|
|
14
14
|
if (appConfigPath) {
|
|
15
15
|
let appSettings = require(appConfigPath);
|
|
16
16
|
if (appSettings.__esModule) {
|
|
17
17
|
// ts-node импортирует esModules, из них надо вытягивать default именно так
|
|
18
18
|
appSettings = appSettings.default;
|
|
19
19
|
}
|
|
20
|
-
validate_settings_keys_1.default(available_package_settings_1.availablePackageSettings, appSettings);
|
|
21
|
-
config = lodash_merge_1.default(config, appSettings);
|
|
20
|
+
(0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, appSettings);
|
|
21
|
+
config = (0, lodash_merge_1.default)(config, appSettings);
|
|
22
22
|
}
|
|
23
23
|
return config;
|
|
24
24
|
}
|
|
@@ -14,8 +14,8 @@ function updateWithEnv(config) {
|
|
|
14
14
|
try {
|
|
15
15
|
console.warn('Используйте ARUI_SCRIPTS_CONFIG только для отладки');
|
|
16
16
|
const envSettings = JSON.parse(process.env.ARUI_SCRIPTS_CONFIG);
|
|
17
|
-
validate_settings_keys_1.default(available_package_settings_1.availablePackageSettings, envSettings);
|
|
18
|
-
return lodash_merge_1.default(config, envSettings);
|
|
17
|
+
(0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, envSettings);
|
|
18
|
+
return (0, lodash_merge_1.default)(config, envSettings);
|
|
19
19
|
}
|
|
20
20
|
catch (e) {
|
|
21
21
|
console.error(e);
|
|
@@ -9,7 +9,7 @@ const validate_settings_keys_1 = __importDefault(require("./validate-settings-ke
|
|
|
9
9
|
const available_package_settings_1 = require("./available-package-settings");
|
|
10
10
|
function updateWithPackage(config) {
|
|
11
11
|
const packageSettings = config.appPackage.aruiScripts || {};
|
|
12
|
-
validate_settings_keys_1.default(available_package_settings_1.availablePackageSettings, packageSettings);
|
|
13
|
-
return lodash_merge_1.default(config, packageSettings);
|
|
12
|
+
(0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, packageSettings);
|
|
13
|
+
return (0, lodash_merge_1.default)(config, packageSettings);
|
|
14
14
|
}
|
|
15
15
|
exports.updateWithPackage = updateWithPackage;
|
|
@@ -13,16 +13,16 @@ function updateWithPresets(config) {
|
|
|
13
13
|
if (!packageSettings.presets) {
|
|
14
14
|
return config;
|
|
15
15
|
}
|
|
16
|
-
const presetsConfigPath = resolve_1.tryResolve(`${packageSettings.presets}/arui-scripts.config`, { paths: [config.cwd] });
|
|
17
|
-
const presetsOverridesPath = resolve_1.tryResolve(`${packageSettings.presets}/arui-scripts.overrides`, { paths: [config.cwd] });
|
|
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] });
|
|
18
18
|
if (presetsConfigPath) {
|
|
19
19
|
let presetsSettings = require(presetsConfigPath);
|
|
20
20
|
if (presetsSettings.__esModule) {
|
|
21
21
|
// ts-node импортирует esModules, из них надо вытягивать default именно так
|
|
22
22
|
presetsSettings = presetsSettings.default;
|
|
23
23
|
}
|
|
24
|
-
validate_settings_keys_1.default(available_package_settings_1.availablePackageSettings, presetsSettings);
|
|
25
|
-
config = lodash_merge_1.default(config, presetsSettings);
|
|
24
|
+
(0, validate_settings_keys_1.default)(available_package_settings_1.availablePackageSettings, presetsSettings);
|
|
25
|
+
config = (0, lodash_merge_1.default)(config, presetsSettings);
|
|
26
26
|
}
|
|
27
27
|
if (presetsOverridesPath) {
|
|
28
28
|
config.overridesPath.unshift(presetsOverridesPath);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const supporting_browsers_1 = __importDefault(require("./supporting-browsers"));
|
|
7
7
|
const app_configs_1 = __importDefault(require("./app-configs"));
|
|
8
8
|
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
9
|
-
const babelClientConfig = apply_overrides_1.default(['babel', 'babelClient'], {
|
|
9
|
+
const babelClientConfig = (0, apply_overrides_1.default)(['babel', 'babelClient'], {
|
|
10
10
|
presets: [
|
|
11
11
|
[
|
|
12
12
|
require.resolve('@babel/preset-env'),
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.babelDependencies = void 0;
|
|
7
7
|
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
8
8
|
const app_configs_1 = __importDefault(require("./app-configs"));
|
|
9
|
-
exports.babelDependencies = apply_overrides_1.default('babelDependencies', {
|
|
9
|
+
exports.babelDependencies = (0, apply_overrides_1.default)('babelDependencies', {
|
|
10
10
|
sourceType: 'unambiguous',
|
|
11
11
|
presets: [
|
|
12
12
|
[
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
7
7
|
const app_configs_1 = __importDefault(require("./app-configs"));
|
|
8
|
-
const config = apply_overrides_1.default(['babel', 'babelServer'], {
|
|
8
|
+
const config = (0, apply_overrides_1.default)(['babel', 'babelServer'], {
|
|
9
9
|
presets: [
|
|
10
10
|
[
|
|
11
11
|
require.resolve('@babel/preset-env'),
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const path_1 = __importDefault(require("path"));
|
|
7
7
|
const app_configs_1 = __importDefault(require("./app-configs"));
|
|
8
8
|
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
9
|
-
const devServerConfig = apply_overrides_1.default('devServer', {
|
|
9
|
+
const devServerConfig = (0, apply_overrides_1.default)('devServer', {
|
|
10
10
|
port: app_configs_1.default.clientServerPort,
|
|
11
11
|
liveReload: false,
|
|
12
12
|
client: {
|
|
@@ -1,7 +1,2 @@
|
|
|
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
|
-
};
|
|
1
|
+
declare const _exports: import("@jest/transform").SyncTransformer<babel.TransformOptions>;
|
|
7
2
|
export = _exports;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export function process(src: any, filename: any): {
|
|
2
|
+
code: string;
|
|
3
|
+
};
|
|
@@ -4,6 +4,6 @@ const path = require('path');
|
|
|
4
4
|
// http://facebook.github.io/jest/docs/en/webpack.html
|
|
5
5
|
module.exports = {
|
|
6
6
|
process(src, filename) {
|
|
7
|
-
return `module.exports = ${JSON.stringify(path.basename(filename))}
|
|
7
|
+
return { code: `module.exports = ${JSON.stringify(path.basename(filename))};` };
|
|
8
8
|
},
|
|
9
9
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export const testRegex: string;
|
|
2
|
+
export const moduleFileExtensions: string[];
|
|
3
|
+
export const collectCoverageFrom: string[];
|
|
4
|
+
export const transform: {
|
|
5
5
|
'^.+\\.jsx?$': string;
|
|
6
6
|
'^.+\\.tsx?$': string;
|
|
7
7
|
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': string;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export const moduleNameMapper: {
|
|
10
10
|
'\\.css$': string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
12
|
+
export const setupFiles: string[];
|
|
13
|
+
export const snapshotSerializers: string[];
|
|
14
|
+
export const globals: {
|
|
15
15
|
'ts-jest': {
|
|
16
16
|
tsconfig: string | null;
|
|
17
17
|
babelConfig: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const fs = require('fs');
|
|
3
|
-
const { pathsToModuleNameMapper } = require('ts-jest
|
|
3
|
+
const { pathsToModuleNameMapper } = require('ts-jest');
|
|
4
4
|
const { parseConfigFileTextToJson } = require('typescript');
|
|
5
5
|
const merge = require('lodash.merge');
|
|
6
6
|
const configs = require('../app-configs').default;
|
package/build/configs/postcss.js
CHANGED
|
@@ -5,5 +5,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
7
7
|
const postcss_config_1 = require("./postcss.config");
|
|
8
|
-
const postcssConfig = apply_overrides_1.default('postcss', postcss_config_1.createPostcssConfig(postcss_config_1.postcssPlugins, postcss_config_1.postcssPluginsOptions));
|
|
8
|
+
const postcssConfig = (0, apply_overrides_1.default)('postcss', (0, postcss_config_1.createPostcssConfig)(postcss_config_1.postcssPlugins, postcss_config_1.postcssPluginsOptions));
|
|
9
9
|
exports.default = postcssConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const serverExternalsExemptions: (string | RegExp)[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.serverExternalsExemptions = void 0;
|
|
7
|
+
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
8
|
+
exports.serverExternalsExemptions = (0, apply_overrides_1.default)('serverExternalsExemptions', [
|
|
9
|
+
/^arui-feather/,
|
|
10
|
+
/^arui-ft-private/,
|
|
11
|
+
/^arui-private/,
|
|
12
|
+
/^alfaform-core-ui/,
|
|
13
|
+
/^@alfa-bank\/newclick-composite-components/,
|
|
14
|
+
/^#/,
|
|
15
|
+
/^@alfalab\/icons/,
|
|
16
|
+
/^@alfalab\/core-components/,
|
|
17
|
+
/^date-fns/,
|
|
18
|
+
/^@corp-front\//,
|
|
19
|
+
/^corp-sign-ui-react/,
|
|
20
|
+
]);
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
7
|
-
const statsOptions = apply_overrides_1.default('stats', {
|
|
7
|
+
const statsOptions = (0, apply_overrides_1.default)('stats', {
|
|
8
8
|
// Add asset Information
|
|
9
9
|
assets: false,
|
|
10
10
|
// Add information about cached (not built) modules
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
7
|
-
const supportingBrowsers = apply_overrides_1.default(['browsers', 'supportingBrowsers'], [
|
|
7
|
+
const supportingBrowsers = (0, apply_overrides_1.default)(['browsers', 'supportingBrowsers'], [
|
|
8
8
|
'last 2 versions',
|
|
9
9
|
'ie >= 10',
|
|
10
10
|
'Android >= 4',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Configuration as WebpackConfiguration, WebpackOptionsNormalized } from 'webpack';
|
|
2
2
|
import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
|
|
3
3
|
import { AppConfigs } from '../app-configs/types';
|
|
4
|
-
|
|
4
|
+
type Overrides = {
|
|
5
5
|
webpack: WebpackConfiguration;
|
|
6
6
|
webpackClient: WebpackConfiguration;
|
|
7
7
|
webpackDev: WebpackConfiguration;
|
|
@@ -24,9 +24,10 @@ declare type Overrides = {
|
|
|
24
24
|
'DockerfileCompiled': string;
|
|
25
25
|
nginx: string;
|
|
26
26
|
'start.sh': string;
|
|
27
|
+
serverExternalsExemptions: Array<string | RegExp>;
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
-
export
|
|
29
|
+
type OverrideFunction<K extends keyof Overrides> = (config: Overrides[K], appConfig: AppConfigs) => Overrides[K];
|
|
30
|
+
export type OverrideFile = {
|
|
30
31
|
[K in keyof Overrides]?: OverrideFunction<K>;
|
|
31
32
|
};
|
|
32
33
|
/**
|
|
@@ -29,18 +29,21 @@ function getSingleEntry(clientEntry) {
|
|
|
29
29
|
require.resolve('webpack/hot/dev-server'),
|
|
30
30
|
// Finally, this is your app's code:
|
|
31
31
|
...clientEntry,
|
|
32
|
+
// We include the app code last so that if there is a runtime error during
|
|
33
|
+
// initialization, it doesn't blow up the WebpackDevServer client, and
|
|
34
|
+
// changing JS code would still trigger a refresh.
|
|
32
35
|
].filter(Boolean);
|
|
33
36
|
}
|
|
34
37
|
// This is the development configuration.
|
|
35
38
|
// It is focused on developer experience and fast rebuilds.
|
|
36
39
|
// The production configuration is different and lives in a separate file.
|
|
37
|
-
const webpackClientDev = apply_overrides_1.default(['webpack', 'webpackClient', 'webpackDev', 'webpackClientDev'], {
|
|
40
|
+
const webpackClientDev = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webpackDev', 'webpackClientDev'], {
|
|
38
41
|
target: 'web',
|
|
39
42
|
mode: 'development',
|
|
40
43
|
devtool: app_configs_1.default.devSourceMaps,
|
|
41
44
|
// These are the "entry points" to our application.
|
|
42
45
|
// This means they will be the "root" imports that are included in JS bundle.
|
|
43
|
-
entry: get_entry_1.default(app_configs_1.default.clientEntry, getSingleEntry),
|
|
46
|
+
entry: (0, get_entry_1.default)(app_configs_1.default.clientEntry, getSingleEntry),
|
|
44
47
|
context: app_configs_1.default.cwd,
|
|
45
48
|
output: {
|
|
46
49
|
// Add /* filename */ comments to generated require()s in the output.
|
|
@@ -247,6 +250,8 @@ const webpackClientDev = apply_overrides_1.default(['webpack', 'webpackClient',
|
|
|
247
250
|
},
|
|
248
251
|
].filter(Boolean)),
|
|
249
252
|
},
|
|
253
|
+
// ** STOP ** Are you adding a new loader?
|
|
254
|
+
// Make sure to add the new loader(s) before the "file" loader.
|
|
250
255
|
],
|
|
251
256
|
},
|
|
252
257
|
plugins: ([
|
|
@@ -33,12 +33,12 @@ function getSingleEntry(entryPoint) {
|
|
|
33
33
|
].filter(Boolean);
|
|
34
34
|
}
|
|
35
35
|
// This is the production configuration.
|
|
36
|
-
const config = apply_overrides_1.default(['webpack', 'webpackClient', 'webpackProd', 'webpackClientProd'], {
|
|
36
|
+
const config = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webpackProd', 'webpackClientProd'], {
|
|
37
37
|
mode: 'production',
|
|
38
38
|
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
|
|
39
39
|
devtool: 'cheap-module-source-map',
|
|
40
40
|
// In production, we only want to load the polyfills and the app code.
|
|
41
|
-
entry: get_entry_1.default(app_configs_1.default.clientEntry, getSingleEntry),
|
|
41
|
+
entry: (0, get_entry_1.default)(app_configs_1.default.clientEntry, getSingleEntry),
|
|
42
42
|
bail: true,
|
|
43
43
|
context: app_configs_1.default.cwd,
|
|
44
44
|
output: {
|
|
@@ -291,6 +291,8 @@ const config = apply_overrides_1.default(['webpack', 'webpackClient', 'webpackPr
|
|
|
291
291
|
},
|
|
292
292
|
].filter(Boolean)),
|
|
293
293
|
},
|
|
294
|
+
// ** STOP ** Are you adding a new loader?
|
|
295
|
+
// Make sure to add the new loader(s) before the "file" loader.
|
|
294
296
|
],
|
|
295
297
|
},
|
|
296
298
|
plugins: ([
|
|
@@ -312,7 +314,7 @@ const config = apply_overrides_1.default(['webpack', 'webpackClient', 'webpackPr
|
|
|
312
314
|
threshold: 10240,
|
|
313
315
|
minRatio: 0.8
|
|
314
316
|
}),
|
|
315
|
-
check_node_version_1.default(10) && new compression_webpack_plugin_1.default({
|
|
317
|
+
(0, check_node_version_1.default)(10) && new compression_webpack_plugin_1.default({
|
|
316
318
|
filename: '[file].br',
|
|
317
319
|
algorithm: 'brotliCompress',
|
|
318
320
|
test: /\.(js|css|html|svg)$/,
|
|
@@ -19,6 +19,7 @@ const postcss_1 = __importDefault(require("./postcss"));
|
|
|
19
19
|
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
20
20
|
const get_entry_1 = __importDefault(require("./util/get-entry"));
|
|
21
21
|
const babel_dependencies_1 = require("./babel-dependencies");
|
|
22
|
+
const server_externals_exemptions_1 = require("./server-externals-exemptions");
|
|
22
23
|
const ReloadServerPlugin = require('../plugins/reload-server-webpack-plugin');
|
|
23
24
|
const assetsIgnoreBanner = fs_1.default.readFileSync(require.resolve('./util/node-assets-ignore'), 'utf8');
|
|
24
25
|
// style files regexes
|
|
@@ -39,7 +40,7 @@ const config = {
|
|
|
39
40
|
__filename: true,
|
|
40
41
|
__dirname: true
|
|
41
42
|
},
|
|
42
|
-
entry: get_entry_1.default(app_configs_1.default.serverEntry, getSingleEntry),
|
|
43
|
+
entry: (0, get_entry_1.default)(app_configs_1.default.serverEntry, getSingleEntry),
|
|
43
44
|
context: app_configs_1.default.cwd,
|
|
44
45
|
output: {
|
|
45
46
|
// Add /* filename */ comments to generated require()s in the output.
|
|
@@ -61,18 +62,8 @@ const config = {
|
|
|
61
62
|
},
|
|
62
63
|
},
|
|
63
64
|
externalsPresets: { node: true },
|
|
64
|
-
externals: [webpack_node_externals_1.default({
|
|
65
|
-
allowlist:
|
|
66
|
-
/^arui-feather/,
|
|
67
|
-
/^arui-ft-private/,
|
|
68
|
-
/^arui-private/,
|
|
69
|
-
/^alfaform-core-ui/,
|
|
70
|
-
/^@alfa-bank\/newclick-composite-components/,
|
|
71
|
-
/^#/,
|
|
72
|
-
/^@alfalab\/icons/,
|
|
73
|
-
/^@alfalab\/core-components/,
|
|
74
|
-
/^date-fns/,
|
|
75
|
-
],
|
|
65
|
+
externals: [(0, webpack_node_externals_1.default)({
|
|
66
|
+
allowlist: server_externals_exemptions_1.serverExternalsExemptions,
|
|
76
67
|
modulesFromFile: true,
|
|
77
68
|
})],
|
|
78
69
|
resolve: {
|
|
@@ -239,5 +230,5 @@ const config = {
|
|
|
239
230
|
ignored: /node_modules/,
|
|
240
231
|
}
|
|
241
232
|
};
|
|
242
|
-
const webpackServerDev = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], config);
|
|
233
|
+
const webpackServerDev = (0, apply_overrides_1.default)(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], config);
|
|
243
234
|
exports.default = webpackServerDev;
|
|
@@ -16,6 +16,7 @@ const postcss_1 = __importDefault(require("./postcss"));
|
|
|
16
16
|
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
17
17
|
const get_entry_1 = __importDefault(require("./util/get-entry"));
|
|
18
18
|
const babel_dependencies_1 = require("./babel-dependencies");
|
|
19
|
+
const server_externals_exemptions_1 = require("./server-externals-exemptions");
|
|
19
20
|
const assetsIgnoreBanner = fs_1.default.readFileSync(require.resolve('./util/node-assets-ignore'), 'utf8');
|
|
20
21
|
const sourceMapSupportBanner = fs_1.default.readFileSync(require.resolve('./util/install-sourcemap-support'), 'utf8');
|
|
21
22
|
// style files regexes
|
|
@@ -27,7 +28,7 @@ function getSingleEntry(entryPoint) {
|
|
|
27
28
|
// This is the production configuration.
|
|
28
29
|
// It compiles slowly and is focused on producing a fast and minimal bundle.
|
|
29
30
|
// The development configuration is different and lives in a separate file.
|
|
30
|
-
const config = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackProd', 'webpackServerProd'], {
|
|
31
|
+
const config = (0, apply_overrides_1.default)(['webpack', 'webpackServer', 'webpackProd', 'webpackServerProd'], {
|
|
31
32
|
mode: 'production',
|
|
32
33
|
// Don't attempt to continue if there are any errors.
|
|
33
34
|
bail: true,
|
|
@@ -38,7 +39,7 @@ const config = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackPr
|
|
|
38
39
|
__filename: true,
|
|
39
40
|
__dirname: true
|
|
40
41
|
},
|
|
41
|
-
entry: get_entry_1.default(app_configs_1.default.serverEntry, getSingleEntry),
|
|
42
|
+
entry: (0, get_entry_1.default)(app_configs_1.default.serverEntry, getSingleEntry),
|
|
42
43
|
context: app_configs_1.default.cwd,
|
|
43
44
|
output: {
|
|
44
45
|
// Add /* filename */ comments to generated require()s in the output.
|
|
@@ -53,18 +54,8 @@ const config = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackPr
|
|
|
53
54
|
.replace(/\\/g, '/'),
|
|
54
55
|
},
|
|
55
56
|
externalsPresets: { node: true },
|
|
56
|
-
externals: [webpack_node_externals_1.default({
|
|
57
|
-
allowlist:
|
|
58
|
-
/^arui-feather/,
|
|
59
|
-
/^arui-ft-private/,
|
|
60
|
-
/^arui-private/,
|
|
61
|
-
/^alfaform-core-ui/,
|
|
62
|
-
/^@alfa-bank\/newclick-composite-components/,
|
|
63
|
-
/^#/,
|
|
64
|
-
/^@alfalab\/icons/,
|
|
65
|
-
/^@alfalab\/core-components/,
|
|
66
|
-
/^date-fns/,
|
|
67
|
-
],
|
|
57
|
+
externals: [(0, webpack_node_externals_1.default)({
|
|
58
|
+
allowlist: server_externals_exemptions_1.serverExternalsExemptions,
|
|
68
59
|
// we cannot determine node_modules location before arui-scripts installation, so just load
|
|
69
60
|
// dependencies list from package.json
|
|
70
61
|
modulesFromFile: true,
|
package/build/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBuildParamsFromArgs = exports.prepareFilesForDocker = void 0;
|
|
3
4
|
var docker_build_1 = require("./commands/util/docker-build");
|
|
4
5
|
Object.defineProperty(exports, "prepareFilesForDocker", { enumerable: true, get: function () { return docker_build_1.prepareFilesForDocker; } });
|
|
5
6
|
var docker_build_2 = require("./commands/util/docker-build");
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const app_configs_1 = __importDefault(require("../configs/app-configs"));
|
|
7
7
|
const apply_overrides_1 = __importDefault(require("../configs/util/apply-overrides"));
|
|
8
8
|
const yarn_1 = require("../commands/util/yarn");
|
|
9
|
-
const installProductionCommand = yarn_1.getInstallProductionCommand();
|
|
10
|
-
const yarnVersion = yarn_1.getYarnVersion();
|
|
9
|
+
const installProductionCommand = (0, yarn_1.getInstallProductionCommand)();
|
|
10
|
+
const yarnVersion = (0, yarn_1.getYarnVersion)();
|
|
11
11
|
// В зависимости от используемого мендежера зависимостей для их установки нужно копировать разный набор файлов
|
|
12
12
|
const filesRequiredToInstallDependencies = [
|
|
13
13
|
'package.json',
|
|
@@ -44,4 +44,4 @@ RUN touch /var/run/nginx.pid && \
|
|
|
44
44
|
chown -R nginx:nginx /var/run/nginx.pid
|
|
45
45
|
USER nginx
|
|
46
46
|
`;
|
|
47
|
-
exports.default = apply_overrides_1.default('DockerfileCompiled', dockerfileTemplate);
|
|
47
|
+
exports.default = (0, apply_overrides_1.default)('DockerfileCompiled', dockerfileTemplate);
|
|
@@ -29,4 +29,4 @@ ${nginxNonRootPart}
|
|
|
29
29
|
${app_configs_1.default.runFromNonRootUser ? 'ADD --chown=nginx:nginx . /src' : 'ADD . /src'}
|
|
30
30
|
|
|
31
31
|
`;
|
|
32
|
-
exports.default = apply_overrides_1.default('Dockerfile', dockerfileTemplate);
|
|
32
|
+
exports.default = (0, apply_overrides_1.default)('Dockerfile', dockerfileTemplate);
|
|
@@ -34,4 +34,4 @@ nginx &
|
|
|
34
34
|
# Start nodejs process
|
|
35
35
|
node --max-old-space-size="$node_memory_limit" ./${app_configs_1.default.buildPath}/${app_configs_1.default.serverOutput}
|
|
36
36
|
`;
|
|
37
|
-
exports.default = apply_overrides_1.default('start.sh', startTemplate);
|
|
37
|
+
exports.default = (0, apply_overrides_1.default)('start.sh', startTemplate);
|