arui-scripts 23.3.1 → 23.4.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.
@@ -1,11 +1,12 @@
1
1
  ts-jest[versions] (WARN) Version 6.0.2 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <6.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
2
2
  ts-jest[versions] (WARN) Version 6.0.2 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <6.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
3
3
  ts-jest[versions] (WARN) Version 6.0.2 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <6.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
4
- PASS src/bin/__tests__/create-cli.tests.ts (33.253 s)
5
- PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts
4
+ PASS src/bin/__tests__/create-cli.tests.ts (35.077 s)
5
+ PASS src/templates/__tests__/dockerfile-templates.tests.ts
6
+ PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (35.512 s)
6
7
  PASS src/configs/util/__tests__/create-watch-ignore-regex.tests.ts
8
+ PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts
7
9
  PASS src/configs/util/__tests__/apply-overrides.tests.ts
8
- PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (33.909 s)
9
10
  PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
10
11
  PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
11
12
  PASS src/configs/util/__tests__/compress-with-dcb.test.ts
@@ -13,12 +14,12 @@ PASS src/configs/util/__tests__/get-polyfills.tests.ts
13
14
  PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
14
15
  PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
15
16
  PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
16
- PASS src/configs/__tests__/webpack-client-modules.tests.ts (10.197 s)
17
- PASS src/configs/util/__tests__/find-plugin.tests.ts (44.432 s)
17
+ PASS src/configs/__tests__/webpack-client-modules.tests.ts (11.464 s)
18
+ PASS src/configs/util/__tests__/find-plugin.tests.ts (47.931 s)
18
19
  A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks. Active timers can also cause this, ensure that .unref() was called on them.
19
20
 
20
- Test Suites: 14 passed, 14 total
21
- Tests: 37 passed, 37 total
21
+ Test Suites: 15 passed, 15 total
22
+ Tests: 42 passed, 42 total
22
23
  Snapshots: 0 total
23
- Time: 46.176 s
24
+ Time: 49.677 s
24
25
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # arui-scripts
2
2
 
3
+ ## 23.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#569](https://github.com/core-ds/arui-scripts/pull/569) [`ea2dfc8`](https://github.com/core-ds/arui-scripts/commit/ea2dfc84ee753f85c94900b015d26b776f3ecc30) Thanks [@heymdall-legal](https://github.com/heymdall-legal)! - Добавлена настройка `deleteNpm` для команд `docker-build` и `docker-build:compiled`. При её
8
+ включении из docker-образа удаляются npm и связанные с ним библиотеки, что уменьшает
9
+ поверхность атаки и исключает неиспользуемые пакеты из результатов security-сканирования.
10
+
3
11
  ## 23.3.1
4
12
 
5
13
  ### Patch Changes
@@ -45,6 +45,7 @@ function getDefaultAppConfig() {
45
45
  nginx: null,
46
46
  runFromNonRootUser: true,
47
47
  removeDevDependenciesDuringDockerBuild: true,
48
+ deleteNpm: false,
48
49
  // archive compilation configs
49
50
  archiveName: 'build.tar',
50
51
  dictionaryCompression: {
@@ -35,6 +35,7 @@ export type AppConfigs = {
35
35
  } | null;
36
36
  runFromNonRootUser: boolean;
37
37
  removeDevDependenciesDuringDockerBuild: boolean;
38
+ deleteNpm: boolean;
38
39
  archiveName: string;
39
40
  dictionaryCompression: {
40
41
  dictionaryPath: string[];
@@ -38,6 +38,11 @@ RUN ${installProductionCommand} && \\
38
38
 
39
39
  ADD --chown=nginx:nginx . /src
40
40
 
41
+ # При необходимости удаляем npm и связанные библиотеки из образа
42
+ ${app_configs_1.configs.deleteNpm
43
+ ? 'RUN rm -rf /usr/local/bin/npm /usr/local/bin/npx /usr/local/lib/node_modules/npm'
44
+ : ''}
45
+
41
46
  # Создаем директории для nginx и выставляем правильные права
42
47
  RUN mkdir -p /var/lib/nginx && \
43
48
  chown -R nginx:nginx /var/lib/nginx && \
@@ -37,6 +37,9 @@ ${nginxNonRootPart}
37
37
  ${app_configs_1.configs.runFromNonRootUser
38
38
  ? `ADD --chown=nginx:nginx ${appPathToAdd} ${appTargetPath}`
39
39
  : `ADD ${appPathToAdd} ${appTargetPath}`}
40
+ ${app_configs_1.configs.deleteNpm
41
+ ? 'RUN rm -rf /usr/local/bin/npm /usr/local/bin/npx /usr/local/lib/node_modules/npm'
42
+ : ''}
40
43
  ${app_configs_1.configs.clientOnly ? 'COPY env-config.jso[n] /src/' : ''}
41
44
  ${app_configs_1.configs.clientOnly ? 'CMD ["nginx"]' : ''}
42
45
  `;
package/docs/settings.md CHANGED
@@ -198,6 +198,13 @@ const settings = {
198
198
  Отключает удаление devDependencies из node_modules при сборке докер образа. Используется когда вам не нужно удалять devDependencies,
199
199
  т.к. в своём Dockerfile вы не переносите node_modules в докер-контейнер. По умолчанию `true`.
200
200
 
201
+ #### deleteNpm
202
+ Удаляет npm и связанные с ним библиотеки (`/usr/local/bin/npm`, `/usr/local/bin/npx`,
203
+ `/usr/local/lib/node_modules/npm`) из итогового docker-образа, собираемого командами
204
+ [docker-build](./commands.md#docker-build) и [docker-build:compiled](./commands.md#docker-buildcompiled).
205
+ Полезно для уменьшения поверхности атаки и исключения неиспользуемых пакетов, которые могут
206
+ ложно срабатывать в security-сканерах. По умолчанию `false`.
207
+
201
208
  #### archiveName
202
209
  Имя архива, который будет создан при использовании команды [archive-build](./commands.md#archive-build). По умолчанию `'build.tar'`.
203
210
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-scripts",
3
- "version": "23.3.1",
3
+ "version": "23.4.0",
4
4
  "main": "./build/index.js",
5
5
  "typings": "./build/index.d.ts",
6
6
  "exports": {