@yarnpkg/plugin-essentials 3.2.0-rc.11 → 3.2.0-rc.12
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/commands/add.js +6 -1
- package/package.json +9 -9
package/lib/commands/add.js
CHANGED
|
@@ -78,7 +78,12 @@ class AddCommand extends cli_1.BaseCommand {
|
|
|
78
78
|
const allSuggestions = await Promise.all(this.packages.map(async (pseudoDescriptor) => {
|
|
79
79
|
const request = pseudoDescriptor.match(/^\.{0,2}\//)
|
|
80
80
|
? await suggestUtils.extractDescriptorFromPath(pseudoDescriptor, { cwd: this.context.cwd, workspace })
|
|
81
|
-
: core_3.structUtils.
|
|
81
|
+
: core_3.structUtils.tryParseDescriptor(pseudoDescriptor);
|
|
82
|
+
const unsupportedPrefix = pseudoDescriptor.match(/^(https?:|git@github)/);
|
|
83
|
+
if (unsupportedPrefix)
|
|
84
|
+
throw new clipanion_1.UsageError(`It seems you are trying to add a package using a ${core_1.formatUtils.pretty(configuration, `${unsupportedPrefix[0]}...`, core_1.FormatType.RANGE)} url; we now require package names to be explicitly specified.\nTry running the command again with the package name prefixed: ${core_1.formatUtils.pretty(configuration, `yarn add`, core_1.FormatType.CODE)} ${core_1.formatUtils.pretty(configuration, core_3.structUtils.makeDescriptor(core_3.structUtils.makeIdent(null, `my-package`), `${unsupportedPrefix[0]}...`), core_1.FormatType.DESCRIPTOR)}`);
|
|
85
|
+
if (!request)
|
|
86
|
+
throw new clipanion_1.UsageError(`The ${core_1.formatUtils.pretty(configuration, pseudoDescriptor, core_1.FormatType.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);
|
|
82
87
|
const target = suggestTarget(workspace, request, {
|
|
83
88
|
dev: this.dev,
|
|
84
89
|
peer: this.peer,
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarnpkg/plugin-essentials",
|
|
3
|
-
"version": "3.2.0-rc.
|
|
3
|
+
"version": "3.2.0-rc.12",
|
|
4
4
|
"license": "BSD-2-Clause",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@yarnpkg/fslib": "^2.6.1-rc.
|
|
7
|
+
"@yarnpkg/fslib": "^2.6.1-rc.9",
|
|
8
8
|
"@yarnpkg/json-proxy": "^2.1.1",
|
|
9
|
-
"@yarnpkg/parsers": "^2.5.0-rc.
|
|
9
|
+
"@yarnpkg/parsers": "^2.5.0-rc.12",
|
|
10
10
|
"ci-info": "^3.2.0",
|
|
11
11
|
"clipanion": "^3.2.0-rc.4",
|
|
12
12
|
"enquirer": "^2.3.6",
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"typanion": "^3.3.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@yarnpkg/cli": "^3.2.0-rc.
|
|
21
|
-
"@yarnpkg/core": "^3.2.0-rc.
|
|
22
|
-
"@yarnpkg/plugin-git": "^2.6.0-rc.
|
|
20
|
+
"@yarnpkg/cli": "^3.2.0-rc.14",
|
|
21
|
+
"@yarnpkg/core": "^3.2.0-rc.14",
|
|
22
|
+
"@yarnpkg/plugin-git": "^2.6.0-rc.14"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/lodash": "^4.14.136",
|
|
26
26
|
"@types/micromatch": "^4.0.1",
|
|
27
27
|
"@types/semver": "^7.1.0",
|
|
28
28
|
"@types/treeify": "^1.0.0",
|
|
29
|
-
"@yarnpkg/cli": "^3.2.0-rc.
|
|
30
|
-
"@yarnpkg/core": "^3.2.0-rc.
|
|
31
|
-
"@yarnpkg/plugin-git": "^2.6.0-rc.
|
|
29
|
+
"@yarnpkg/cli": "^3.2.0-rc.14",
|
|
30
|
+
"@yarnpkg/core": "^3.2.0-rc.14",
|
|
31
|
+
"@yarnpkg/plugin-git": "^2.6.0-rc.14"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|