@yarnpkg/cli 4.3.1 → 4.4.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.
Files changed (2) hide show
  1. package/lib/lib.js +10 -0
  2. package/package.json +10 -10
package/lib/lib.js CHANGED
@@ -150,7 +150,16 @@ async function getCli({ cwd = fslib_1.ppath.cwd(), pluginConfiguration = (0, get
150
150
  }
151
151
  async function runExit(argv, { cwd = fslib_1.ppath.cwd(), selfPath, pluginConfiguration }) {
152
152
  const cli = getBaseCli({ cwd, pluginConfiguration });
153
+ function unexpectedTerminationHandler() {
154
+ clipanion_1.Cli.defaultContext.stdout.write(`ERROR: Yarn is terminating due to an unexpected empty event loop.\nPlease report this issue at https://github.com/yarnpkg/berry/issues.`);
155
+ }
156
+ process.once(`beforeExit`, unexpectedTerminationHandler);
153
157
  try {
158
+ // The exit code is set to an error code before the CLI runs so that
159
+ // if the event loop becomes empty and node terminates without
160
+ // finishing the execution of this function it counts as an error.
161
+ // https://github.com/yarnpkg/berry/issues/6398
162
+ process.exitCode = 42;
154
163
  process.exitCode = await run(cli, argv, { selfPath, pluginConfiguration });
155
164
  }
156
165
  catch (error) {
@@ -158,6 +167,7 @@ async function runExit(argv, { cwd = fslib_1.ppath.cwd(), selfPath, pluginConfig
158
167
  process.exitCode = 1;
159
168
  }
160
169
  finally {
170
+ process.off(`beforeExit`, unexpectedTerminationHandler);
161
171
  await fslib_1.xfs.rmtempPromise();
162
172
  }
163
173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarnpkg/cli",
3
- "version": "4.3.1",
3
+ "version": "4.4.1",
4
4
  "license": "BSD-2-Clause",
5
5
  "main": "./lib/index.js",
6
6
  "exports": {
@@ -8,23 +8,23 @@
8
8
  "./package.json": "./package.json"
9
9
  },
10
10
  "dependencies": {
11
- "@yarnpkg/core": "^4.1.1",
11
+ "@yarnpkg/core": "^4.1.2",
12
12
  "@yarnpkg/fslib": "^3.1.0",
13
13
  "@yarnpkg/libzip": "^3.1.0",
14
14
  "@yarnpkg/parsers": "^3.0.2",
15
- "@yarnpkg/plugin-compat": "^4.0.6",
15
+ "@yarnpkg/plugin-compat": "^4.0.8",
16
16
  "@yarnpkg/plugin-constraints": "^4.0.2",
17
17
  "@yarnpkg/plugin-dlx": "^4.0.0",
18
- "@yarnpkg/plugin-essentials": "^4.2.1",
18
+ "@yarnpkg/plugin-essentials": "^4.2.2",
19
19
  "@yarnpkg/plugin-exec": "^3.0.0",
20
20
  "@yarnpkg/plugin-file": "^3.0.0",
21
- "@yarnpkg/plugin-git": "^3.0.0",
21
+ "@yarnpkg/plugin-git": "^3.1.0",
22
22
  "@yarnpkg/plugin-github": "^3.0.0",
23
23
  "@yarnpkg/plugin-http": "^3.0.1",
24
24
  "@yarnpkg/plugin-init": "^4.0.1",
25
25
  "@yarnpkg/plugin-interactive-tools": "^4.0.0",
26
26
  "@yarnpkg/plugin-link": "^3.0.0",
27
- "@yarnpkg/plugin-nm": "^4.0.2",
27
+ "@yarnpkg/plugin-nm": "^4.0.3",
28
28
  "@yarnpkg/plugin-npm": "^3.0.1",
29
29
  "@yarnpkg/plugin-npm-cli": "^4.0.4",
30
30
  "@yarnpkg/plugin-pack": "^4.0.0",
@@ -36,7 +36,7 @@
36
36
  "@yarnpkg/plugin-version": "^4.0.3",
37
37
  "@yarnpkg/plugin-workspace-tools": "^4.1.0",
38
38
  "@yarnpkg/shell": "^4.0.2",
39
- "ci-info": "^3.2.0",
39
+ "ci-info": "^4.0.0",
40
40
  "clipanion": "^4.0.0-rc.2",
41
41
  "semver": "^7.1.2",
42
42
  "tslib": "^2.4.0",
@@ -44,12 +44,12 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/semver": "^7.1.0",
47
- "@yarnpkg/builder": "^4.1.1",
47
+ "@yarnpkg/builder": "^4.1.2",
48
48
  "@yarnpkg/monorepo": "^0.0.0",
49
- "@yarnpkg/pnpify": "^4.1.0"
49
+ "@yarnpkg/pnpify": "^4.1.1"
50
50
  },
51
51
  "peerDependencies": {
52
- "@yarnpkg/core": "^4.1.1"
52
+ "@yarnpkg/core": "^4.1.2"
53
53
  },
54
54
  "scripts": {
55
55
  "postpack": "rm -rf lib",