@yarnpkg/plugin-essentials 3.2.0-rc.10 → 3.2.0-rc.14
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
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,
|
|
@@ -35,6 +35,8 @@ class SetVersionCommand extends cli_1.BaseCommand {
|
|
|
35
35
|
bundleUrl = `https://repo.yarnpkg.com/${await resolveTag(configuration, `canary`)}/packages/yarnpkg-cli/bin/yarn.js`;
|
|
36
36
|
else if (this.version === `classic`)
|
|
37
37
|
bundleUrl = `https://nightly.yarnpkg.com/latest.js`;
|
|
38
|
+
else if (this.version.match(/^https?:/))
|
|
39
|
+
bundleUrl = this.version;
|
|
38
40
|
else if (this.version.match(/^\.{0,2}[\\/]/) || fslib_1.npath.isAbsolute(this.version))
|
|
39
41
|
bundleUrl = `file://${fslib_1.npath.resolve(this.version)}`;
|
|
40
42
|
else if (core_2.semverUtils.satisfiesWithPrereleases(this.version, `>=2.0.0`))
|
|
@@ -112,6 +114,9 @@ SetVersionCommand.usage = clipanion_1.Command.Usage({
|
|
|
112
114
|
], [
|
|
113
115
|
`Use a release from the local filesystem`,
|
|
114
116
|
`$0 set version ./yarn.cjs`,
|
|
117
|
+
], [
|
|
118
|
+
`Use a release from a URL`,
|
|
119
|
+
`$0 set version https://repo.yarnpkg.com/3.1.0/packages/yarnpkg-cli/bin/yarn.js`,
|
|
115
120
|
], [
|
|
116
121
|
`Download the version used to invoke the command`,
|
|
117
122
|
`$0 set version self`,
|
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.14",
|
|
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.11",
|
|
8
8
|
"@yarnpkg/json-proxy": "^2.1.1",
|
|
9
|
-
"@yarnpkg/parsers": "^2.5.0-rc.
|
|
9
|
+
"@yarnpkg/parsers": "^2.5.0-rc.14",
|
|
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.16",
|
|
21
|
+
"@yarnpkg/core": "^3.2.0-rc.16",
|
|
22
|
+
"@yarnpkg/plugin-git": "^2.6.0-rc.16"
|
|
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.16",
|
|
30
|
+
"@yarnpkg/core": "^3.2.0-rc.16",
|
|
31
|
+
"@yarnpkg/plugin-git": "^2.6.0-rc.16"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|