arui-scripts 12.3.0 → 12.5.0-alfa.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 +10 -3
- package/README.md +1 -0
- package/build/commands/docker-build/index.js +10 -8
- package/build/configs/app-configs/available-package-settings.d.ts +1 -1
- package/build/configs/app-configs/available-package-settings.js +1 -0
- package/build/configs/app-configs/get-defaults.js +1 -0
- package/build/configs/app-configs/types.d.ts +1 -0
- package/build/configs/util/register-ts-node.js +2 -0
- package/build/templates/start.template.js +6 -2
- package/build/tsconfig-local.tsbuildinfo +8 -8
- package/package.json +1 -1
- package/release.config.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
## [12.4.1](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v12.4.0...v12.4.1) (2022-06-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **ts-config:** ignore local tsconfigs for ts-node ([0235ade](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/0235ade62cbf9d14ac55f7c518ca170fdc7d364e))
|
|
7
|
+
* **ts-configs:** disable processing of js files with ts-node ([edbb9d2](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/edbb9d2d23ba1c0f7950fedf5fff394b695c6cd5))
|
|
8
|
+
|
|
9
|
+
# [12.4.0](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v12.3.0...v12.4.0) (2022-05-25)
|
|
2
10
|
|
|
3
11
|
|
|
4
12
|
### Features
|
|
5
13
|
|
|
6
|
-
* add
|
|
7
|
-
* allow using config files instead of package config ([5063d23](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/5063d23abc1a13b503c73b0906d68aaa57840a74))
|
|
14
|
+
* add removeDevDependenciesDuringDockerBuild setting ([51f016f](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/51f016f3aad3e2e5e489659d0b26e6005cacdafe))
|
package/README.md
CHANGED
|
@@ -74,6 +74,7 @@ npm install arui-scripts --save-dev
|
|
|
74
74
|
- `useTscLoader` - использовать ts-loader вместо babel-loader для обработки ts файлов. У babel-loader есть [ряд ограничений](https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/). По умолчанию `false`.
|
|
75
75
|
- `componentsTheme` - путь к css файлу с темой для [core-components](https://alfa-laboratory.github.io/core-components). Используется для настройки [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties#importfrom).
|
|
76
76
|
- `keepCssVars` - отключает `postcss-custom-properties`, css переменные будут оставаться в бандле.
|
|
77
|
+
- `removeDevDependenciesDuringDockerBuild` - отключает удаление devDependencies из node_modules при сборке докер образа. Используется когда вам не нужно удалять devDependencies, т.к. в своём Dockerfile вы не переносите node_modules в докер-контейнер
|
|
77
78
|
|
|
78
79
|
В целях отладки все эти настройки можно переопределить не изменяя package.json
|
|
79
80
|
Просто передайте необходимые настройки в environment переменной ARUI_SCRIPTS_CONFIG
|
|
@@ -70,15 +70,17 @@ const imageFullName = `${dockerRegistry ? `${dockerRegistry}/` : ''}${imageName}
|
|
|
70
70
|
// run build script
|
|
71
71
|
yield exec_1.default('npm run build');
|
|
72
72
|
console.timeEnd('Build application time');
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
if (app_configs_1.default.removeDevDependenciesDuringDockerBuild) {
|
|
74
|
+
console.time('Remove dev dependencies time');
|
|
75
|
+
// if yarn is available prune dev dependencies with yarn, otherwise use npm
|
|
76
|
+
if (app_configs_1.default.useYarn && shelljs_1.default.which('yarn')) {
|
|
77
|
+
yield exec_1.default('yarn install --production --ignore-optional --frozen-lockfile --ignore-scripts --prefer-offline');
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
yield exec_1.default('npm prune --production');
|
|
81
|
+
}
|
|
82
|
+
console.timeEnd('Remove dev dependencies time');
|
|
77
83
|
}
|
|
78
|
-
else {
|
|
79
|
-
yield exec_1.default('npm prune --production');
|
|
80
|
-
}
|
|
81
|
-
console.timeEnd('Remove dev dependencies time');
|
|
82
84
|
console.time('Build docker image time');
|
|
83
85
|
yield exec_1.default(`docker build -f "./${tempDirName}/Dockerfile" \\
|
|
84
86
|
--build-arg START_SH_LOCATION="./${tempDirName}/start.sh" \\
|
|
@@ -2,7 +2,7 @@ import { AppConfigs } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Эти ключи из конфига будут обновляться из package.json при их наличии
|
|
4
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"];
|
|
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", "removeDevDependenciesDuringDockerBuild"];
|
|
6
6
|
declare type ArrayElementType<ArrayType extends ReadonlyArray<unknown>> = ArrayType[number];
|
|
7
7
|
export declare type PackageSettings = Partial<Pick<AppConfigs, ArrayElementType<typeof availablePackageSettings>>>;
|
|
8
8
|
export {};
|
|
@@ -55,6 +55,7 @@ function getDefaults() {
|
|
|
55
55
|
debug: false,
|
|
56
56
|
overridesPath: overridesPath ? [overridesPath] : [],
|
|
57
57
|
statsOutputFilename: 'stats.json',
|
|
58
|
+
removeDevDependenciesDuringDockerBuild: true,
|
|
58
59
|
componentsTheme: undefined,
|
|
59
60
|
keepCssVars: false,
|
|
60
61
|
// Эти пути зависят от других настроек, которые могут быть переопределены пользователем
|
|
@@ -18,8 +18,12 @@ cat ./nginx.conf \\
|
|
|
18
18
|
| sed 's/~~\\([a-zA-Z0-9_-]\\{1,\\}\\)~~/$\\1/g' \\
|
|
19
19
|
> /etc/nginx/conf.d/default.conf
|
|
20
20
|
|
|
21
|
-
# Достаем лимит памяти из cgroup, это то, как его докер задает.
|
|
22
|
-
|
|
21
|
+
# Достаем лимит памяти из cgroup, это то, как его докер задает.
|
|
22
|
+
if [[ -f /sys/fs/cgroup/cgroup.controllers ]]; then
|
|
23
|
+
max_total_memory=$(cat /sys/fs/cgroup/memory.max)
|
|
24
|
+
else
|
|
25
|
+
max_total_memory=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
|
|
26
|
+
fi
|
|
23
27
|
# Самой nodejs мы не можем отдать совсем всю память, операционная система+nginx все же требуют какого то количества.
|
|
24
28
|
# Поэтому мы вычитаем 100мб на нужды ос
|
|
25
29
|
node_memory_limit="$(($max_total_memory / 1024 / 1024 - 100))"
|
|
@@ -597,13 +597,13 @@
|
|
|
597
597
|
"affectsGlobalScope": false
|
|
598
598
|
},
|
|
599
599
|
"../src/configs/util/register-ts-node.ts": {
|
|
600
|
-
"version": "
|
|
600
|
+
"version": "a806ff42cf28f9ceb3b5e73b8683bf3f820946226669351f626c900d780f6436",
|
|
601
601
|
"signature": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
602
602
|
"affectsGlobalScope": true
|
|
603
603
|
},
|
|
604
604
|
"../src/configs/app-configs/types.ts": {
|
|
605
|
-
"version": "
|
|
606
|
-
"signature": "
|
|
605
|
+
"version": "26d68b5ad7a9a6e47346984c915611d452f560764aaec153e014bc8f6588221c",
|
|
606
|
+
"signature": "d515261b42d96bab440c2b496fdbef1e4caf0fbdb16f32d3984d80fb37266d2d",
|
|
607
607
|
"affectsGlobalScope": false
|
|
608
608
|
},
|
|
609
609
|
"../src/configs/util/try-resolve.ts": {
|
|
@@ -612,7 +612,7 @@
|
|
|
612
612
|
"affectsGlobalScope": false
|
|
613
613
|
},
|
|
614
614
|
"../src/configs/app-configs/get-defaults.ts": {
|
|
615
|
-
"version": "
|
|
615
|
+
"version": "d3ac931c5bc4b57982ec4bf4505f63921b676fea862fa27f865d41afd01b4419",
|
|
616
616
|
"signature": "32ce4848d302065a0608781a400430ff0f4fb5757a501c614f3ab8aaad45afd0",
|
|
617
617
|
"affectsGlobalScope": false
|
|
618
618
|
},
|
|
@@ -692,8 +692,8 @@
|
|
|
692
692
|
"affectsGlobalScope": false
|
|
693
693
|
},
|
|
694
694
|
"../src/configs/app-configs/available-package-settings.ts": {
|
|
695
|
-
"version": "
|
|
696
|
-
"signature": "
|
|
695
|
+
"version": "d8870fed947c21ef7cd799f019e27b205e47d3d2eb6bbd1699a511abea07e156",
|
|
696
|
+
"signature": "670a083c7ad4c5ddc8f95b5c48f5e099d7fd11e3b4b7846b0a3b7078fba86813",
|
|
697
697
|
"affectsGlobalScope": false
|
|
698
698
|
},
|
|
699
699
|
"../src/configs/app-configs/update-with-env.ts": {
|
|
@@ -792,7 +792,7 @@
|
|
|
792
792
|
"affectsGlobalScope": false
|
|
793
793
|
},
|
|
794
794
|
"../src/templates/start.template.ts": {
|
|
795
|
-
"version": "
|
|
795
|
+
"version": "880f33b82d22e208683f9096f25507b29f038c0ac42858f4bae39edb1dd988c6",
|
|
796
796
|
"signature": "0fffbf1a5f54522ff7b89592bab1cf72966d7bdc613d52b0087717fcfec14b29",
|
|
797
797
|
"affectsGlobalScope": false
|
|
798
798
|
},
|
|
@@ -1247,7 +1247,7 @@
|
|
|
1247
1247
|
"affectsGlobalScope": false
|
|
1248
1248
|
},
|
|
1249
1249
|
"../src/commands/docker-build/index.ts": {
|
|
1250
|
-
"version": "
|
|
1250
|
+
"version": "1b5c4842fdd8a6f8c3da38afa0b4eab277f567bd0161cb5cc01f707fc2f7e2a3",
|
|
1251
1251
|
"signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
1252
1252
|
"affectsGlobalScope": false
|
|
1253
1253
|
},
|
package/package.json
CHANGED