arui-scripts 23.4.0 → 23.5.1

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,25 +1,25 @@
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 (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)
7
- PASS src/configs/util/__tests__/create-watch-ignore-regex.tests.ts
4
+ PASS src/templates/__tests__/dockerfile-templates.tests.ts (33.921 s)
5
+ PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (34.001 s)
8
6
  PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts
9
- PASS src/configs/util/__tests__/apply-overrides.tests.ts
7
+ PASS src/bin/__tests__/create-cli.tests.ts
8
+ PASS src/configs/util/__tests__/create-watch-ignore-regex.tests.ts
10
9
  PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
10
+ PASS src/configs/util/__tests__/apply-overrides.tests.ts
11
11
  PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
12
12
  PASS src/configs/util/__tests__/compress-with-dcb.test.ts
13
13
  PASS src/configs/util/__tests__/get-polyfills.tests.ts
14
14
  PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
15
15
  PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
16
16
  PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
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)
17
+ PASS src/configs/__tests__/webpack-client-modules.tests.ts (12.54 s)
18
+ PASS src/configs/util/__tests__/find-plugin.tests.ts (48.247 s)
19
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.
20
20
 
21
21
  Test Suites: 15 passed, 15 total
22
- Tests: 42 passed, 42 total
22
+ Tests: 45 passed, 45 total
23
23
  Snapshots: 0 total
24
- Time: 49.677 s
24
+ Time: 50.316 s
25
25
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # arui-scripts
2
2
 
3
+ ## 23.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#574](https://github.com/core-ds/arui-scripts/pull/574) [`2e48012`](https://github.com/core-ds/arui-scripts/commit/2e4801232e988fc8da639faac6e6e5fd716118e8) Thanks [@artemgafarov66](https://github.com/artemgafarov66)! - Исправлено создание ссылки на Yarn при сборке Docker-образа, если бинарник уже существует.
8
+
9
+ ## 23.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#571](https://github.com/core-ds/arui-scripts/pull/571) [`9c548f5`](https://github.com/core-ds/arui-scripts/commit/9c548f51c44d6198c8a98dd4b03f6a3a372324b7) Thanks [@syn7xx](https://github.com/syn7xx)! - Добавлен автоматический symlink на yarn бинарник в Dockerfile при использовании yarn 2+ с yarnPath в .yarnrc.yml. Это исправляет ошибку `yarn: not found` в Docker-образах (ни полный, ни slim-образ не содержат yarn).
14
+
3
15
  ## 23.4.0
4
16
 
5
17
  ### Minor Changes
@@ -2,4 +2,16 @@ type YarnVersion = '1' | '2+' | 'unavailable';
2
2
  export declare function getYarnVersion(): YarnVersion;
3
3
  export declare function getPruningCommand(): string;
4
4
  export declare function getInstallProductionCommand(): string;
5
+ /**
6
+ * Читает значение yarnPath из .yarnrc.yml.
7
+ * Возвращает путь к бинарнику yarn (например .yarn/releases/yarn-4.18.0.cjs) или null.
8
+ */
9
+ export declare function getYarnPathFromRc(): string | null;
10
+ /**
11
+ * Возвращает команду для создания symlink на yarn бинарник в Docker-образе.
12
+ * Используется при yarn 2+ с yarnPath в .yarnrc.yml, чтобы yarn был доступен
13
+ * в PATH внутри Docker-образов (где yarn не установлен глобально).
14
+ * Возвращает пустую строку, если symlink не нужен.
15
+ */
16
+ export declare function getYarnBinSymlinkCommand(): string;
5
17
  export {};
@@ -6,6 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getYarnVersion = getYarnVersion;
7
7
  exports.getPruningCommand = getPruningCommand;
8
8
  exports.getInstallProductionCommand = getInstallProductionCommand;
9
+ exports.getYarnPathFromRc = getYarnPathFromRc;
10
+ exports.getYarnBinSymlinkCommand = getYarnBinSymlinkCommand;
11
+ const fs_1 = __importDefault(require("fs"));
12
+ const path_1 = __importDefault(require("path"));
9
13
  const shelljs_1 = __importDefault(require("shelljs"));
10
14
  const app_configs_1 = require("../../configs/app-configs");
11
15
  function getYarnVersion() {
@@ -53,3 +57,41 @@ function getInstallProductionCommand() {
53
57
  }
54
58
  }
55
59
  }
60
+ /**
61
+ * Читает значение yarnPath из .yarnrc.yml.
62
+ * Возвращает путь к бинарнику yarn (например .yarn/releases/yarn-4.18.0.cjs) или null.
63
+ */
64
+ function getYarnPathFromRc() {
65
+ const rcPath = path_1.default.join(app_configs_1.configs.cwd, '.yarnrc.yml');
66
+ if (!shelljs_1.default.test('-f', rcPath)) {
67
+ return null;
68
+ }
69
+ let content;
70
+ try {
71
+ content = fs_1.default.readFileSync(rcPath, 'utf8');
72
+ }
73
+ catch (_a) {
74
+ return null;
75
+ }
76
+ // Ищем строку вида: yarnPath: .yarn/releases/yarn-4.18.0.cjs
77
+ // Значение может быть в кавычках или без
78
+ const match = content.match(/^\s*yarnPath:\s*['"]?([^'"\s]+)['"]?\s*$/m);
79
+ return match ? match[1] : null;
80
+ }
81
+ /**
82
+ * Возвращает команду для создания symlink на yarn бинарник в Docker-образе.
83
+ * Используется при yarn 2+ с yarnPath в .yarnrc.yml, чтобы yarn был доступен
84
+ * в PATH внутри Docker-образов (где yarn не установлен глобально).
85
+ * Возвращает пустую строку, если symlink не нужен.
86
+ */
87
+ function getYarnBinSymlinkCommand() {
88
+ if (getYarnVersion() !== '2+') {
89
+ return '';
90
+ }
91
+ const yarnPath = getYarnPathFromRc();
92
+ if (!yarnPath) {
93
+ return '';
94
+ }
95
+ // WORKDIR в Dockerfile = /src
96
+ return `ln -sf /src/${yarnPath} /usr/local/bin/yarn && \\\n `;
97
+ }
@@ -6,6 +6,7 @@ const app_configs_1 = require("../configs/app-configs");
6
6
  const apply_overrides_1 = require("../configs/util/apply-overrides");
7
7
  const installProductionCommand = (0, yarn_1.getInstallProductionCommand)();
8
8
  const yarnVersion = (0, yarn_1.getYarnVersion)();
9
+ const yarnBinSymlinkCommand = (0, yarn_1.getYarnBinSymlinkCommand)();
9
10
  const { nginx } = app_configs_1.configs;
10
11
  // В зависимости от используемого мендежера зависимостей для их установки нужно копировать разный набор файлов
11
12
  const filesRequiredToInstallDependencies = [
@@ -33,7 +34,7 @@ ${filesRequiredToInstallDependencies
33
34
  .map((file) => `ADD --chown=nginx:nginx ${file} /src/${file}`)
34
35
  .join('\n')}
35
36
 
36
- RUN ${installProductionCommand} && \\
37
+ RUN ${yarnBinSymlinkCommand}${installProductionCommand} && \\
37
38
  ${yarnVersion === 'unavailable' ? 'npm cache clean --force' : 'yarn cache clean --all'}
38
39
 
39
40
  ADD --chown=nginx:nginx . /src
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-scripts",
3
- "version": "23.4.0",
3
+ "version": "23.5.1",
4
4
  "main": "./build/index.js",
5
5
  "typings": "./build/index.d.ts",
6
6
  "exports": {