@yarnpkg/plugin-essentials 4.5.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.d.ts +1 -0
- package/lib/commands/add.js +5 -0
- package/lib/commands/install.js +4 -0
- package/lib/commands/up.d.ts +1 -0
- package/lib/commands/up.js +7 -0
- 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.d.ts
CHANGED
package/lib/commands/add.js
CHANGED
|
@@ -46,6 +46,9 @@ class AddCommand extends cli_1.BaseCommand {
|
|
|
46
46
|
this.cached = clipanion_1.Option.Boolean(`--cached`, false, {
|
|
47
47
|
description: `Reuse the highest version already used somewhere within the project`,
|
|
48
48
|
});
|
|
49
|
+
this.noTimeGate = clipanion_1.Option.Boolean(`--no-time-gate`, false, {
|
|
50
|
+
description: `Disable the minimum release age check for this command`,
|
|
51
|
+
});
|
|
49
52
|
this.mode = clipanion_1.Option.String(`--mode`, {
|
|
50
53
|
description: `Change what artifacts installs generate`,
|
|
51
54
|
validator: t.isEnum(core_2.InstallMode),
|
|
@@ -55,6 +58,8 @@ class AddCommand extends cli_1.BaseCommand {
|
|
|
55
58
|
}
|
|
56
59
|
async execute() {
|
|
57
60
|
const configuration = await core_1.Configuration.find(this.context.cwd, this.context.plugins);
|
|
61
|
+
if (this.noTimeGate)
|
|
62
|
+
suggestUtils.disableTimeGate(configuration);
|
|
58
63
|
const { project, workspace } = await core_2.Project.find(configuration, this.context.cwd);
|
|
59
64
|
const cache = await core_1.Cache.find(configuration);
|
|
60
65
|
if (!workspace)
|
package/lib/commands/install.js
CHANGED
|
@@ -29,6 +29,10 @@ const LOCKFILE_MIGRATION_RULES = [{
|
|
|
29
29
|
selector: v => v < 9,
|
|
30
30
|
name: `enableScripts`,
|
|
31
31
|
value: true,
|
|
32
|
+
}, {
|
|
33
|
+
selector: v => v < 10,
|
|
34
|
+
name: `npmMinimalAgeGate`,
|
|
35
|
+
value: `0`,
|
|
32
36
|
}];
|
|
33
37
|
// eslint-disable-next-line arca/no-default-export
|
|
34
38
|
class YarnCommand extends cli_1.BaseCommand {
|
package/lib/commands/up.d.ts
CHANGED
package/lib/commands/up.js
CHANGED
|
@@ -32,6 +32,9 @@ class UpCommand extends cli_1.BaseCommand {
|
|
|
32
32
|
this.recursive = clipanion_1.Option.Boolean(`-R,--recursive`, false, {
|
|
33
33
|
description: `Resolve again ALL resolutions for those packages`,
|
|
34
34
|
});
|
|
35
|
+
this.noTimeGate = clipanion_1.Option.Boolean(`--no-time-gate`, false, {
|
|
36
|
+
description: `Disable the minimum release age check for this command`,
|
|
37
|
+
});
|
|
35
38
|
this.mode = clipanion_1.Option.String(`--mode`, {
|
|
36
39
|
description: `Change what artifacts installs generate`,
|
|
37
40
|
validator: t.isEnum(core_2.InstallMode),
|
|
@@ -48,6 +51,8 @@ class UpCommand extends cli_1.BaseCommand {
|
|
|
48
51
|
}
|
|
49
52
|
async executeUpRecursive() {
|
|
50
53
|
const configuration = await core_3.Configuration.find(this.context.cwd, this.context.plugins);
|
|
54
|
+
if (this.noTimeGate)
|
|
55
|
+
suggestUtils.disableTimeGate(configuration);
|
|
51
56
|
const { project, workspace } = await core_2.Project.find(configuration, this.context.cwd);
|
|
52
57
|
const cache = await core_3.Cache.find(configuration);
|
|
53
58
|
if (!workspace)
|
|
@@ -84,6 +89,8 @@ class UpCommand extends cli_1.BaseCommand {
|
|
|
84
89
|
}
|
|
85
90
|
async executeUpClassic() {
|
|
86
91
|
const configuration = await core_3.Configuration.find(this.context.cwd, this.context.plugins);
|
|
92
|
+
if (this.noTimeGate)
|
|
93
|
+
suggestUtils.disableTimeGate(configuration);
|
|
87
94
|
const { project, workspace } = await core_2.Project.find(configuration, this.context.cwd);
|
|
88
95
|
const cache = await core_3.Cache.find(configuration);
|
|
89
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.
|
|
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": {
|