@yarnpkg/cli 3.2.0 → 4.0.0-rc.3

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/lib/main.js CHANGED
@@ -52,11 +52,10 @@ async function main({ binaryVersion, pluginConfiguration }) {
52
52
  }
53
53
  async function exec(cli) {
54
54
  // Non-exhaustive known requirements:
55
- // - 14.0 and 14.1 empty http responses - https://github.com/sindresorhus/got/issues/1496
56
- // - 14.10.0 broken streams - https://github.com/nodejs/node/pull/34035 (fix: https://github.com/nodejs/node/commit/0f94c6b4e4)
55
+ // - 14.15 is the first LTS release
57
56
  var _a, _b, _c, _d, _e;
58
57
  const version = process.versions.node;
59
- const range = `>=12 <14 || 14.2 - 14.9 || >14.10.0`;
58
+ const range = `>=14.15.0`;
60
59
  // YARN_IGNORE_NODE is special because this code needs to execute as early as possible.
61
60
  // It's not a regular core setting because Configuration.find may use functions not available
62
61
  // on older Node versions.
@@ -76,11 +75,11 @@ async function main({ binaryVersion, pluginConfiguration }) {
76
75
  const tryRead = (p) => fslib_1.xfs.readFilePromise(p).catch(() => {
77
76
  return Buffer.of();
78
77
  });
79
- const isSameBinary = async () => yarnPath === selfPath ||
78
+ const isSameBinary = async () => yarnPath && (yarnPath === selfPath ||
80
79
  Buffer.compare(...await Promise.all([
81
80
  tryRead(yarnPath),
82
81
  tryRead(selfPath),
83
- ])) === 0;
82
+ ])) === 0);
84
83
  // Avoid unnecessary spawn when run directly
85
84
  if (!ignorePath && !ignoreCwd && await isSameBinary()) {
86
85
  process.env.YARN_IGNORE_PATH = `1`;
@@ -116,7 +115,15 @@ async function main({ binaryVersion, pluginConfiguration }) {
116
115
  cli.register(command);
117
116
  }
118
117
  }
119
- const command = cli.process(process.argv.slice(2));
118
+ const context = {
119
+ cwd: fslib_1.npath.toPortablePath(process.cwd()),
120
+ plugins: pluginConfiguration,
121
+ quiet: false,
122
+ stdin: process.stdin,
123
+ stdout: process.stdout,
124
+ stderr: process.stderr,
125
+ };
126
+ const command = cli.process(process.argv.slice(2), context);
120
127
  if (!command.help)
121
128
  (_e = core_1.Configuration.telemetry) === null || _e === void 0 ? void 0 : _e.reportCommandName(command.path.join(` `));
122
129
  // @ts-expect-error: The cwd is a global option defined by BaseCommand
@@ -130,14 +137,7 @@ async function main({ binaryVersion, pluginConfiguration }) {
130
137
  return;
131
138
  }
132
139
  }
133
- await cli.runExit(command, {
134
- cwd: fslib_1.npath.toPortablePath(process.cwd()),
135
- plugins: pluginConfiguration,
136
- quiet: false,
137
- stdin: process.stdin,
138
- stdout: process.stdout,
139
- stderr: process.stderr,
140
- });
140
+ await cli.runExit(command, context);
141
141
  }
142
142
  }
143
143
  return run()
@@ -1 +1 @@
1
- export declare const pluginCommands: Map<string, string[][]>;
1
+ export declare const pluginCommands: Map<string, string[]>;
@@ -3,28 +3,4 @@
3
3
  // yarn build:plugin-commands
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.pluginCommands = void 0;
6
- exports.pluginCommands = new Map([
7
- [`constraints`, [
8
- [`constraints`, `query`],
9
- [`constraints`, `source`],
10
- [`constraints`],
11
- ]],
12
- [`exec`, []],
13
- [`interactive-tools`, [
14
- [`search`],
15
- [`upgrade-interactive`],
16
- ]],
17
- [`stage`, [
18
- [`stage`],
19
- ]],
20
- [`typescript`, []],
21
- [`version`, [
22
- [`version`, `apply`],
23
- [`version`, `check`],
24
- [`version`],
25
- ]],
26
- [`workspace-tools`, [
27
- [`workspaces`, `focus`],
28
- [`workspaces`, `foreach`],
29
- ]],
30
- ]);
6
+ exports.pluginCommands = new Map([]);
@@ -11,7 +11,6 @@ const shell = tslib_1.__importStar(require("@yarnpkg/shell"));
11
11
  const clipanion = tslib_1.__importStar(require("clipanion"));
12
12
  const semver = tslib_1.__importStar(require("semver"));
13
13
  const typanion = tslib_1.__importStar(require("typanion"));
14
- const yup = tslib_1.__importStar(require("yup"));
15
14
  const getDynamicLibs = () => new Map([
16
15
  [`@yarnpkg/cli`, cli],
17
16
  [`@yarnpkg/core`, core],
@@ -23,7 +22,5 @@ const getDynamicLibs = () => new Map([
23
22
  [`clipanion`, clipanion],
24
23
  [`semver`, semver],
25
24
  [`typanion`, typanion],
26
- // TODO: remove in next major
27
- [`yup`, yup],
28
25
  ]);
29
26
  exports.getDynamicLibs = getDynamicLibs;
@@ -7,7 +7,7 @@ module.exports = ({modules, plugins}) => {
7
7
  }).join(``);
8
8
 
9
9
  const moduleSegment = ` modules: new Map([\n${modules.map((request, index) => {
10
- return ` [${JSON.stringify(require(`${request}/package.json`).name)}, ${request === `clipanion` ? `backportClipanionCompatibility` : ``}(_${index})],\n`;
10
+ return ` [${JSON.stringify(require(`${request}/package.json`).name)}, _${index}],\n`;
11
11
  }).join(``)} ]),\n`;
12
12
 
13
13
  const pluginSegment = ` plugins: new Set([\n${plugins.map(request => {
@@ -16,8 +16,6 @@ module.exports = ({modules, plugins}) => {
16
16
 
17
17
  return {
18
18
  code: [
19
- `import {backportClipanionCompatibility} from './backportClipanionCompatibility';\n`,
20
- `\n`,
21
19
  importSegment,
22
20
  `export const getPluginConfiguration = () => ({\n`,
23
21
  moduleSegment,
package/package.json CHANGED
@@ -1,48 +1,52 @@
1
1
  {
2
2
  "name": "@yarnpkg/cli",
3
- "version": "3.2.0",
3
+ "version": "4.0.0-rc.3",
4
4
  "license": "BSD-2-Clause",
5
5
  "main": "./lib/index.js",
6
6
  "dependencies": {
7
- "@yarnpkg/core": "^3.2.0",
8
- "@yarnpkg/fslib": "^2.6.1",
9
- "@yarnpkg/libzip": "^2.2.3",
10
- "@yarnpkg/parsers": "^2.5.0",
11
- "@yarnpkg/plugin-compat": "^3.1.2",
12
- "@yarnpkg/plugin-dlx": "^3.1.1",
13
- "@yarnpkg/plugin-essentials": "^3.2.0",
14
- "@yarnpkg/plugin-file": "^2.3.0",
15
- "@yarnpkg/plugin-git": "^2.6.0",
16
- "@yarnpkg/plugin-github": "^2.3.0",
17
- "@yarnpkg/plugin-http": "^2.2.0",
18
- "@yarnpkg/plugin-init": "^3.1.2",
19
- "@yarnpkg/plugin-link": "^2.2.0",
20
- "@yarnpkg/plugin-nm": "^3.1.1",
21
- "@yarnpkg/plugin-npm": "^2.7.0",
22
- "@yarnpkg/plugin-npm-cli": "^3.2.0",
23
- "@yarnpkg/plugin-pack": "^3.1.1",
24
- "@yarnpkg/plugin-patch": "^3.2.0",
25
- "@yarnpkg/plugin-pnp": "^3.2.0",
26
- "@yarnpkg/plugin-pnpm": "^1.1.0",
27
- "@yarnpkg/shell": "^3.2.0",
28
- "chalk": "^3.0.0",
7
+ "@yarnpkg/core": "^4.0.0-rc.3",
8
+ "@yarnpkg/fslib": "^3.0.0-rc.3",
9
+ "@yarnpkg/libzip": "^3.0.0-rc.3",
10
+ "@yarnpkg/parsers": "^3.0.0-rc.3",
11
+ "@yarnpkg/plugin-compat": "^4.0.0-rc.3",
12
+ "@yarnpkg/plugin-constraints": "^4.0.0-rc.3",
13
+ "@yarnpkg/plugin-dlx": "^4.0.0-rc.3",
14
+ "@yarnpkg/plugin-essentials": "^4.0.0-rc.3",
15
+ "@yarnpkg/plugin-exec": "^3.0.0-rc.3",
16
+ "@yarnpkg/plugin-file": "^3.0.0-rc.3",
17
+ "@yarnpkg/plugin-git": "^3.0.0-rc.3",
18
+ "@yarnpkg/plugin-github": "^3.0.0-rc.3",
19
+ "@yarnpkg/plugin-http": "^3.0.0-rc.3",
20
+ "@yarnpkg/plugin-init": "^4.0.0-rc.3",
21
+ "@yarnpkg/plugin-interactive-tools": "^4.0.0-rc.3",
22
+ "@yarnpkg/plugin-link": "^3.0.0-rc.3",
23
+ "@yarnpkg/plugin-nm": "^4.0.0-rc.3",
24
+ "@yarnpkg/plugin-npm": "^3.0.0-rc.3",
25
+ "@yarnpkg/plugin-npm-cli": "^4.0.0-rc.3",
26
+ "@yarnpkg/plugin-pack": "^4.0.0-rc.3",
27
+ "@yarnpkg/plugin-patch": "^4.0.0-rc.3",
28
+ "@yarnpkg/plugin-pnp": "^4.0.0-rc.3",
29
+ "@yarnpkg/plugin-pnpm": "^2.0.0-rc.3",
30
+ "@yarnpkg/plugin-stage": "^4.0.0-rc.3",
31
+ "@yarnpkg/plugin-typescript": "^4.0.0-rc.3",
32
+ "@yarnpkg/plugin-version": "^4.0.0-rc.3",
33
+ "@yarnpkg/plugin-workspace-tools": "^4.0.0-rc.3",
34
+ "@yarnpkg/shell": "^4.0.0-rc.3",
29
35
  "ci-info": "^3.2.0",
30
- "clipanion": "^3.2.0-rc.4",
36
+ "clipanion": "^3.2.0-rc.10",
31
37
  "semver": "^7.1.2",
32
38
  "tslib": "^1.13.0",
33
- "typanion": "^3.3.0",
34
- "yup": "^0.32.9"
39
+ "typanion": "^3.3.0"
35
40
  },
36
41
  "devDependencies": {
37
42
  "@types/semver": "^7.1.0",
38
- "@types/yup": "^0",
39
- "@yarnpkg/builder": "^3.2.0",
43
+ "@yarnpkg/builder": "^4.0.0-rc.3",
40
44
  "@yarnpkg/monorepo": "^0.0.0",
41
- "@yarnpkg/pnpify": "^3.1.1",
45
+ "@yarnpkg/pnpify": "^4.0.0-rc.3",
42
46
  "micromatch": "^4.0.2"
43
47
  },
44
48
  "peerDependencies": {
45
- "@yarnpkg/core": "^3.2.0"
49
+ "@yarnpkg/core": "^4.0.0-rc.3"
46
50
  },
47
51
  "scripts": {
48
52
  "postpack": "rm -rf lib",
@@ -67,12 +71,15 @@
67
71
  "standard": [
68
72
  "@yarnpkg/plugin-essentials",
69
73
  "@yarnpkg/plugin-compat",
74
+ "@yarnpkg/plugin-constraints",
70
75
  "@yarnpkg/plugin-dlx",
76
+ "@yarnpkg/plugin-exec",
71
77
  "@yarnpkg/plugin-file",
72
78
  "@yarnpkg/plugin-git",
73
79
  "@yarnpkg/plugin-github",
74
80
  "@yarnpkg/plugin-http",
75
81
  "@yarnpkg/plugin-init",
82
+ "@yarnpkg/plugin-interactive-tools",
76
83
  "@yarnpkg/plugin-link",
77
84
  "@yarnpkg/plugin-nm",
78
85
  "@yarnpkg/plugin-npm",
@@ -80,7 +87,11 @@
80
87
  "@yarnpkg/plugin-pack",
81
88
  "@yarnpkg/plugin-patch",
82
89
  "@yarnpkg/plugin-pnp",
83
- "@yarnpkg/plugin-pnpm"
90
+ "@yarnpkg/plugin-pnpm",
91
+ "@yarnpkg/plugin-stage",
92
+ "@yarnpkg/plugin-typescript",
93
+ "@yarnpkg/plugin-version",
94
+ "@yarnpkg/plugin-workspace-tools"
84
95
  ]
85
96
  }
86
97
  },
@@ -90,7 +101,8 @@
90
101
  "directory": "packages/yarnpkg-cli"
91
102
  },
92
103
  "engines": {
93
- "node": ">=12 <14 || 14.2 - 14.9 || >14.10.0"
104
+ "node": ">=14.15.0"
94
105
  },
106
+ "stableVersion": "3.2.0",
95
107
  "types": "./lib/index.d.ts"
96
108
  }
@@ -1 +0,0 @@
1
- export declare function backportClipanionCompatibility(clipanion: any): any;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.backportClipanionCompatibility = void 0;
4
- function backportClipanionCompatibility(clipanion) {
5
- clipanion.Command.Path = (...p) => (instance) => {
6
- instance.paths = instance.paths || [];
7
- instance.paths.push(p);
8
- };
9
- for (const fn of [`Array`, `Boolean`, `String`, `Proxy`, `Rest`, `Counter`]) {
10
- clipanion.Command[fn] = (...args) => (instance, propertyName) => {
11
- const value = clipanion.Option[fn](...args);
12
- Object.defineProperty(instance, `__${propertyName}`, {
13
- configurable: false,
14
- enumerable: true,
15
- get() {
16
- return value;
17
- },
18
- set(value) {
19
- this[propertyName] = value;
20
- },
21
- });
22
- };
23
- }
24
- return clipanion;
25
- }
26
- exports.backportClipanionCompatibility = backportClipanionCompatibility;