@yarnpkg/plugin-essentials 4.6.0 → 4.6.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.
- package/lib/commands/add.js +1 -1
- package/lib/commands/up.js +2 -2
- package/lib/commands/why.js +6 -3
- package/lib/suggestUtils.d.ts +2 -1
- package/lib/suggestUtils.js +8 -0
- package/package.json +5 -5
package/lib/commands/add.js
CHANGED
|
@@ -59,7 +59,7 @@ class AddCommand extends cli_1.BaseCommand {
|
|
|
59
59
|
async execute() {
|
|
60
60
|
const configuration = await core_1.Configuration.find(this.context.cwd, this.context.plugins);
|
|
61
61
|
if (this.noTimeGate)
|
|
62
|
-
|
|
62
|
+
suggestUtils.disableTimeGate(configuration);
|
|
63
63
|
const { project, workspace } = await core_2.Project.find(configuration, this.context.cwd);
|
|
64
64
|
const cache = await core_1.Cache.find(configuration);
|
|
65
65
|
if (!workspace)
|
package/lib/commands/up.js
CHANGED
|
@@ -52,7 +52,7 @@ class UpCommand extends cli_1.BaseCommand {
|
|
|
52
52
|
async executeUpRecursive() {
|
|
53
53
|
const configuration = await core_3.Configuration.find(this.context.cwd, this.context.plugins);
|
|
54
54
|
if (this.noTimeGate)
|
|
55
|
-
|
|
55
|
+
suggestUtils.disableTimeGate(configuration);
|
|
56
56
|
const { project, workspace } = await core_2.Project.find(configuration, this.context.cwd);
|
|
57
57
|
const cache = await core_3.Cache.find(configuration);
|
|
58
58
|
if (!workspace)
|
|
@@ -90,7 +90,7 @@ class UpCommand extends cli_1.BaseCommand {
|
|
|
90
90
|
async executeUpClassic() {
|
|
91
91
|
const configuration = await core_3.Configuration.find(this.context.cwd, this.context.plugins);
|
|
92
92
|
if (this.noTimeGate)
|
|
93
|
-
|
|
93
|
+
suggestUtils.disableTimeGate(configuration);
|
|
94
94
|
const { project, workspace } = await core_2.Project.find(configuration, this.context.cwd);
|
|
95
95
|
const cache = await core_3.Cache.find(configuration);
|
|
96
96
|
if (!workspace)
|
package/lib/commands/why.js
CHANGED
|
@@ -71,7 +71,7 @@ function whySimple(project, targetPkg, { configuration, peers }) {
|
|
|
71
71
|
const nodeChildren = {};
|
|
72
72
|
const node = null;
|
|
73
73
|
for (const dependency of pkg.dependencies.values()) {
|
|
74
|
-
if (!peers && pkg
|
|
74
|
+
if (!peers && isVirtualPeerDependency(pkg, dependency))
|
|
75
75
|
continue;
|
|
76
76
|
const resolution = project.storedResolutions.get(dependency.descriptorHash);
|
|
77
77
|
if (!resolution)
|
|
@@ -112,7 +112,7 @@ function whyRecursive(project, targetPkg, { configuration, peers }) {
|
|
|
112
112
|
}
|
|
113
113
|
let depends = false;
|
|
114
114
|
for (const dependency of pkg.dependencies.values()) {
|
|
115
|
-
if (!peers && pkg
|
|
115
|
+
if (!peers && isVirtualPeerDependency(pkg, dependency))
|
|
116
116
|
continue;
|
|
117
117
|
const resolution = project.storedResolutions.get(dependency.descriptorHash);
|
|
118
118
|
if (!resolution)
|
|
@@ -156,7 +156,7 @@ function whyRecursive(project, targetPkg, { configuration, peers }) {
|
|
|
156
156
|
return;
|
|
157
157
|
printed.add(pkg.locatorHash);
|
|
158
158
|
for (const dependency of pkg.dependencies.values()) {
|
|
159
|
-
if (!peers && pkg
|
|
159
|
+
if (!peers && isVirtualPeerDependency(pkg, dependency))
|
|
160
160
|
continue;
|
|
161
161
|
const resolution = project.storedResolutions.get(dependency.descriptorHash);
|
|
162
162
|
if (!resolution)
|
|
@@ -171,3 +171,6 @@ function whyRecursive(project, targetPkg, { configuration, peers }) {
|
|
|
171
171
|
printAllDependents(workspace.anchoredPackage, rootChildren, null);
|
|
172
172
|
return root;
|
|
173
173
|
}
|
|
174
|
+
function isVirtualPeerDependency(pkg, dependency) {
|
|
175
|
+
return core_2.structUtils.isVirtualLocator(pkg) && pkg.peerDependencies.has(dependency.identHash);
|
|
176
|
+
}
|
package/lib/suggestUtils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cache, DescriptorHash, Descriptor, Ident, Locator, Project, Workspace } from '@yarnpkg/core';
|
|
1
|
+
import { Cache, DescriptorHash, Descriptor, Ident, Locator, Project, Workspace, Configuration } from '@yarnpkg/core';
|
|
2
2
|
import { PortablePath } from '@yarnpkg/fslib';
|
|
3
3
|
export type Suggestion = {
|
|
4
4
|
descriptor: Descriptor;
|
|
@@ -56,6 +56,7 @@ export declare enum Strategy {
|
|
|
56
56
|
*/
|
|
57
57
|
CACHE = "cache"
|
|
58
58
|
}
|
|
59
|
+
export declare function disableTimeGate(configuration: Configuration): void;
|
|
59
60
|
export declare function getModifier(flags: {
|
|
60
61
|
exact: boolean;
|
|
61
62
|
caret: boolean;
|
package/lib/suggestUtils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Strategy = exports.WorkspaceModifier = exports.Modifier = exports.Target = void 0;
|
|
4
|
+
exports.disableTimeGate = disableTimeGate;
|
|
4
5
|
exports.getModifier = getModifier;
|
|
5
6
|
exports.extractRangeModifier = extractRangeModifier;
|
|
6
7
|
exports.applyModifier = applyModifier;
|
|
@@ -62,6 +63,13 @@ var Strategy;
|
|
|
62
63
|
*/
|
|
63
64
|
Strategy["CACHE"] = "cache";
|
|
64
65
|
})(Strategy || (exports.Strategy = Strategy = {}));
|
|
66
|
+
function disableTimeGate(configuration) {
|
|
67
|
+
configuration.useWithSource(`<cli>`, { npmMinimalAgeGate: `0` }, configuration.startingCwd, { overwrite: true });
|
|
68
|
+
const npmScopes = configuration.get(`npmScopes`);
|
|
69
|
+
for (const scopeConfiguration of npmScopes.values()) {
|
|
70
|
+
scopeConfiguration.delete(`npmMinimalAgeGate`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
65
73
|
function getModifier(flags, project) {
|
|
66
74
|
if (flags.exact)
|
|
67
75
|
return Modifier.EXACT;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarnpkg/plugin-essentials",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.1",
|
|
4
4
|
"license": "BSD-2-Clause",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"typanion": "^3.14.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@yarnpkg/cli": "^4.
|
|
24
|
-
"@yarnpkg/core": "^4.
|
|
23
|
+
"@yarnpkg/cli": "^4.17.0",
|
|
24
|
+
"@yarnpkg/core": "^4.9.0",
|
|
25
25
|
"@yarnpkg/plugin-git": "^3.2.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/micromatch": "^4.0.1",
|
|
29
29
|
"@types/semver": "^7.1.0",
|
|
30
|
-
"@yarnpkg/cli": "^4.
|
|
31
|
-
"@yarnpkg/core": "^4.
|
|
30
|
+
"@yarnpkg/cli": "^4.17.0",
|
|
31
|
+
"@yarnpkg/core": "^4.9.0",
|
|
32
32
|
"@yarnpkg/plugin-git": "^3.2.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|