arui-scripts 13.1.0-yarn2.1 → 13.1.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 CHANGED
@@ -1,9 +1,16 @@
1
- # [13.1.0-yarn2.1](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v13.0.0...v13.1.0-yarn2.1) (2022-07-28)
1
+ # [13.1.0](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v13.0.0...v13.1.0) (2022-08-05)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * **commands:** add yarn 2 support ([7773e38](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/7773e38864652805e6e3bc672b36a04298915123))
6
+ * add yarn 2 support ([5d4bb8c](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/5d4bb8c5e4debb3d0db430c094effbedd9b7bcc3))
7
+
8
+ # [13.1.0-feature-yarn2.1](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v13.0.0...v13.1.0-feature-yarn2.1) (2022-08-04)
9
+
10
+
11
+ ### Features
12
+
13
+ * add yarn 2 support ([5d4bb8c](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/5d4bb8c5e4debb3d0db430c094effbedd9b7bcc3))
7
14
 
8
15
  # [13.0.0](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v12.5.0...v13.0.0) (2022-07-11)
9
16
 
package/README.md CHANGED
@@ -297,6 +297,7 @@ docker
297
297
 
298
298
  Команда предполагает наличие установленных `node_modules` перед сборкой, в процессе работы же очищает дев зависимости используя `yarn` или `npm`.
299
299
  yarn будет использоваться когда в рутовой папке проекта есть `yarn.lock` и `yarn` доступен в системе.
300
+ Если вы используете yarn 2, для выполнения команды очистки используется плагин [workspace-tools](https://github.com/yarnpkg/berry/blob/HEAD/packages/plugin-workspace-tools/README.md), поэтому он должен быть установлен и указан в `.yarnrc.yml` вашего проекта.
300
301
 
301
302
  Итоговый контейнер будет содержать `nginx` и скрипт для запуска `nginx` одновременно с `nodejs` сервером.
302
303
 
@@ -323,6 +324,7 @@ archive
323
324
 
324
325
  Команда предполагает наличие установленных `node_modules` перед сборкой, в процессе работы же очищает дев зависимости используя `yarn` или `npm`.
325
326
  yarn будет использоваться когда в рутовой папке проекта есть `yarn.lock` и `yarn` доступен в системе.
327
+ Если вы используете yarn 2, для выполнения команды очистки используется плагин [workspace-tools](https://github.com/yarnpkg/berry/blob/HEAD/packages/plugin-workspace-tools/README.md), поэтому он должен быть установлен и указан в `.yarnrc.yml` вашего проекта.
326
328
 
327
329
  Итоговый архив будет содержать в себе `.build`, `node_modules`, `package.json` и `config` папки вашего проекта.
328
330
 
@@ -51,14 +51,14 @@ const packageJsonPath = path_1.default.join(app_configs_1.default.cwd, packageJs
51
51
  console.time('Remove build dependencies time');
52
52
  // if yarn is available prune dev dependencies with yarn, otherwise use npm
53
53
  if (app_configs_1.default.useYarn && shelljs_1.default.which('yarn')) {
54
- try {
55
- // if yarn 1 is used
56
- yield exec_1.default('yarn install --production --ignore-optional --frozen-lockfile --ignore-scripts --prefer-offline');
57
- }
58
- catch (_a) {
59
- // if yarn 2 is used
54
+ const yarnVersion = shelljs_1.default.exec('yarn -v', { silent: true });
55
+ const yarnMajorVersion = Number(yarnVersion.split('.')[0]);
56
+ if (yarnMajorVersion > 1) {
60
57
  yield exec_1.default('yarn workspaces focus --production --all');
61
58
  }
59
+ else {
60
+ yield exec_1.default('yarn install --production --ignore-optional --frozen-lockfile --ignore-scripts --prefer-offline');
61
+ }
62
62
  }
63
63
  else {
64
64
  yield exec_1.default('npm prune --production');
@@ -74,14 +74,14 @@ const imageFullName = `${dockerRegistry ? `${dockerRegistry}/` : ''}${imageName}
74
74
  console.time('Remove dev dependencies time');
75
75
  // if yarn is available prune dev dependencies with yarn, otherwise use npm
76
76
  if (app_configs_1.default.useYarn && shelljs_1.default.which('yarn')) {
77
- try {
78
- // if yarn 1 is used
79
- yield exec_1.default('yarn install --production --ignore-optional --frozen-lockfile --ignore-scripts --prefer-offline');
80
- }
81
- catch (_a) {
82
- // if yarn 2 is used
77
+ const yarnVersion = shelljs_1.default.exec('yarn -v', { silent: true });
78
+ const yarnMajorVersion = Number(yarnVersion.split('.')[0]);
79
+ if (yarnMajorVersion > 1) {
83
80
  yield exec_1.default('yarn workspaces focus --production --all');
84
81
  }
82
+ else {
83
+ yield exec_1.default('yarn install --production --ignore-optional --frozen-lockfile --ignore-scripts --prefer-offline');
84
+ }
85
85
  }
86
86
  else {
87
87
  yield exec_1.default('npm prune --production');
@@ -797,7 +797,7 @@
797
797
  "affectsGlobalScope": false
798
798
  },
799
799
  "../src/commands/archive-build/index.ts": {
800
- "version": "53a1f66f56ea6840f036c80d206529fcb0cc7bb66c102f703a58aacf4849e1fd",
800
+ "version": "dd67bcf3100cbd10b03627a144dfa3e311d40b9d64c443bcd16e6e378d5045f4",
801
801
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
802
802
  "affectsGlobalScope": false
803
803
  },
@@ -1247,7 +1247,7 @@
1247
1247
  "affectsGlobalScope": false
1248
1248
  },
1249
1249
  "../src/commands/docker-build/index.ts": {
1250
- "version": "2c2ea99c9582ac64c16597b1ea91d5a4a14d767a52c55a23737b1b55ccf4dd67",
1250
+ "version": "3e1518759f88ff6c846f5fd5f3293d4fb65958073f013bcd68a192e2e40bebfc",
1251
1251
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
1252
1252
  "affectsGlobalScope": false
1253
1253
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-scripts",
3
- "version": "13.1.0-yarn2.1",
3
+ "version": "13.1.0",
4
4
  "main": "./build/index.js",
5
5
  "typings": "./build/index.d.ts",
6
6
  "license": "MPL-2.0",