@yarnpkg/plugin-essentials 4.0.0-rc.46 → 4.0.0-rc.48
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 +5 -6
- package/lib/commands/dedupe.js +5 -6
- package/lib/commands/install.js +96 -53
- package/lib/commands/link.js +3 -5
- package/lib/commands/plugin/remove.js +13 -12
- package/lib/commands/rebuild.js +6 -6
- package/lib/commands/remove.js +4 -5
- package/lib/commands/set/resolution.js +3 -5
- package/lib/commands/set/version/sources.d.ts +1 -0
- package/lib/commands/set/version/sources.js +20 -11
- package/lib/commands/set/version.js +1 -1
- package/lib/commands/unlink.js +4 -5
- package/lib/commands/up.js +7 -10
- package/package.json +10 -10
package/lib/commands/add.js
CHANGED
|
@@ -201,15 +201,14 @@ class AddCommand extends cli_1.BaseCommand {
|
|
|
201
201
|
await configuration.triggerMultipleHooks((hooks) => hooks.afterWorkspaceDependencyReplacement, afterWorkspaceDependencyReplacementList);
|
|
202
202
|
if (askedQuestions)
|
|
203
203
|
this.context.stdout.write(`\n`);
|
|
204
|
-
|
|
205
|
-
configuration,
|
|
204
|
+
return await project.installWithNewReport({
|
|
206
205
|
json: this.json,
|
|
207
206
|
stdout: this.context.stdout,
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
|
|
207
|
+
quiet: this.context.quiet,
|
|
208
|
+
}, {
|
|
209
|
+
cache,
|
|
210
|
+
mode: this.mode,
|
|
211
211
|
});
|
|
212
|
-
return installReport.exitCode();
|
|
213
212
|
}
|
|
214
213
|
}
|
|
215
214
|
AddCommand.paths = [
|
package/lib/commands/dedupe.js
CHANGED
|
@@ -61,14 +61,13 @@ class DedupeCommand extends cli_1.BaseCommand {
|
|
|
61
61
|
return dedupedPackageCount ? 1 : 0;
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
|
-
|
|
65
|
-
configuration,
|
|
66
|
-
stdout: this.context.stdout,
|
|
64
|
+
return await project.installWithNewReport({
|
|
67
65
|
json: this.json,
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
stdout: this.context.stdout,
|
|
67
|
+
}, {
|
|
68
|
+
cache,
|
|
69
|
+
mode: this.mode,
|
|
70
70
|
});
|
|
71
|
-
return installReport.exitCode();
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
}
|
package/lib/commands/install.js
CHANGED
|
@@ -7,7 +7,21 @@ const fslib_1 = require("@yarnpkg/fslib");
|
|
|
7
7
|
const parsers_1 = require("@yarnpkg/parsers");
|
|
8
8
|
const ci_info_1 = tslib_1.__importDefault(require("ci-info"));
|
|
9
9
|
const clipanion_1 = require("clipanion");
|
|
10
|
+
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
10
11
|
const t = tslib_1.__importStar(require("typanion"));
|
|
12
|
+
const LOCKFILE_MIGRATION_RULES = [{
|
|
13
|
+
selector: v => v === -1,
|
|
14
|
+
name: `nodeLinker`,
|
|
15
|
+
value: `node-modules`,
|
|
16
|
+
}, {
|
|
17
|
+
selector: v => v !== -1 && v < 8,
|
|
18
|
+
name: `enableGlobalCache`,
|
|
19
|
+
value: false,
|
|
20
|
+
}, {
|
|
21
|
+
selector: v => v !== -1 && v < 8,
|
|
22
|
+
name: `compressionLevel`,
|
|
23
|
+
value: `mixed`,
|
|
24
|
+
}];
|
|
11
25
|
// eslint-disable-next-line arca/no-default-export
|
|
12
26
|
class YarnCommand extends cli_1.BaseCommand {
|
|
13
27
|
constructor() {
|
|
@@ -189,34 +203,6 @@ class YarnCommand extends cli_1.BaseCommand {
|
|
|
189
203
|
return fixReport.exitCode();
|
|
190
204
|
}
|
|
191
205
|
}
|
|
192
|
-
if (configuration.projectCwd !== null && typeof configuration.sources.get(`nodeLinker`) === `undefined`) {
|
|
193
|
-
const projectCwd = configuration.projectCwd;
|
|
194
|
-
let content;
|
|
195
|
-
try {
|
|
196
|
-
content = await fslib_1.xfs.readFilePromise(fslib_1.ppath.join(projectCwd, fslib_1.Filename.lockfile), `utf8`);
|
|
197
|
-
}
|
|
198
|
-
catch { }
|
|
199
|
-
// If migrating from a v1 install, we automatically enable the node-modules linker,
|
|
200
|
-
// since that's likely what the author intended to do.
|
|
201
|
-
if (content === null || content === void 0 ? void 0 : content.includes(`yarn lockfile v1`)) {
|
|
202
|
-
const nmReport = await core_1.StreamReport.start({
|
|
203
|
-
configuration,
|
|
204
|
-
json: this.json,
|
|
205
|
-
stdout: this.context.stdout,
|
|
206
|
-
includeFooter: false,
|
|
207
|
-
}, async (report) => {
|
|
208
|
-
report.reportInfo(core_1.MessageName.AUTO_NM_SUCCESS, `Migrating from Yarn 1; automatically enabling the compatibility node-modules linker 👍`);
|
|
209
|
-
report.reportSeparator();
|
|
210
|
-
configuration.use(`<compat>`, { nodeLinker: `node-modules` }, projectCwd, { overwrite: true });
|
|
211
|
-
await core_1.Configuration.updateConfiguration(projectCwd, {
|
|
212
|
-
nodeLinker: `node-modules`,
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
if (nmReport.hasErrors()) {
|
|
216
|
-
return nmReport.exitCode();
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
206
|
if (configuration.projectCwd !== null) {
|
|
221
207
|
const telemetryReport = await core_1.StreamReport.start({
|
|
222
208
|
configuration,
|
|
@@ -224,18 +210,74 @@ class YarnCommand extends cli_1.BaseCommand {
|
|
|
224
210
|
stdout: this.context.stdout,
|
|
225
211
|
includeFooter: false,
|
|
226
212
|
}, async (report) => {
|
|
227
|
-
var _a;
|
|
213
|
+
var _a, _b;
|
|
228
214
|
if ((_a = core_1.Configuration.telemetry) === null || _a === void 0 ? void 0 : _a.isNew) {
|
|
215
|
+
core_1.Configuration.telemetry.commitMotd();
|
|
229
216
|
report.reportInfo(core_1.MessageName.TELEMETRY_NOTICE, `Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry`);
|
|
230
217
|
report.reportInfo(core_1.MessageName.TELEMETRY_NOTICE, `Run ${core_1.formatUtils.pretty(configuration, `yarn config set --home enableTelemetry 0`, core_1.formatUtils.Type.CODE)} to disable`);
|
|
231
218
|
report.reportSeparator();
|
|
232
219
|
}
|
|
220
|
+
else if (((_b = core_1.Configuration.telemetry) === null || _b === void 0 ? void 0 : _b.isMotd) && configuration.get(`enableMotd`)) {
|
|
221
|
+
const data = await fetch(`https://repo.yarnpkg.com/tags`).then(res => res.json()).catch(() => null);
|
|
222
|
+
if (data !== null) {
|
|
223
|
+
let newVersion = null;
|
|
224
|
+
const YarnVersion = `3.0.0`;
|
|
225
|
+
if (YarnVersion !== null) {
|
|
226
|
+
const isRcBinary = semver_1.default.prerelease(YarnVersion);
|
|
227
|
+
const releaseType = isRcBinary ? `canary` : `stable`;
|
|
228
|
+
const candidate = data.latest[releaseType];
|
|
229
|
+
if (semver_1.default.gt(candidate, YarnVersion)) {
|
|
230
|
+
newVersion = [releaseType, candidate];
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (newVersion) {
|
|
234
|
+
core_1.Configuration.telemetry.commitMotd();
|
|
235
|
+
report.reportInfo(core_1.MessageName.VERSION_NOTICE, `${core_1.formatUtils.applyStyle(configuration, `A new ${newVersion[0]} version of Yarn is available:`, core_1.formatUtils.Style.BOLD)} ${core_1.structUtils.prettyReference(configuration, newVersion[1])}!`);
|
|
236
|
+
report.reportInfo(core_1.MessageName.VERSION_NOTICE, `Upgrade now by running ${core_1.formatUtils.pretty(configuration, `yarn set version ${newVersion[1]}`, core_1.formatUtils.Type.CODE)}`);
|
|
237
|
+
report.reportSeparator();
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
const motd = core_1.Configuration.telemetry.selectMotd(data.motd);
|
|
241
|
+
if (motd) {
|
|
242
|
+
report.reportInfo(core_1.MessageName.MOTD_NOTICE, core_1.formatUtils.pretty(configuration, motd.message, core_1.formatUtils.Type.MARKDOWN_INLINE));
|
|
243
|
+
if (motd.url)
|
|
244
|
+
report.reportInfo(core_1.MessageName.MOTD_NOTICE, `Learn more at ${motd.url}`);
|
|
245
|
+
report.reportSeparator();
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
233
250
|
});
|
|
234
251
|
if (telemetryReport.hasErrors()) {
|
|
235
252
|
return telemetryReport.exitCode();
|
|
236
253
|
}
|
|
237
254
|
}
|
|
238
255
|
const { project, workspace } = await core_1.Project.find(configuration, this.context.cwd);
|
|
256
|
+
const lockfileLastVersion = project.lockfileLastVersion;
|
|
257
|
+
if (lockfileLastVersion !== null) {
|
|
258
|
+
const compatReport = await core_1.StreamReport.start({
|
|
259
|
+
configuration,
|
|
260
|
+
json: this.json,
|
|
261
|
+
stdout: this.context.stdout,
|
|
262
|
+
includeFooter: false,
|
|
263
|
+
}, async (report) => {
|
|
264
|
+
const newSettings = {};
|
|
265
|
+
for (const rule of LOCKFILE_MIGRATION_RULES) {
|
|
266
|
+
if (rule.selector(lockfileLastVersion) && typeof configuration.sources.get(rule.name) === `undefined`) {
|
|
267
|
+
configuration.use(`<compat>`, { [rule.name]: rule.value }, project.cwd, { overwrite: true });
|
|
268
|
+
newSettings[rule.name] = rule.value;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (Object.keys(newSettings).length > 0) {
|
|
272
|
+
await core_1.Configuration.updateConfiguration(project.cwd, newSettings);
|
|
273
|
+
report.reportInfo(core_1.MessageName.MIGRATION_SUCCESS, `Migrated your project to the latest Yarn version 🚀`);
|
|
274
|
+
report.reportSeparator();
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
if (compatReport.hasErrors()) {
|
|
278
|
+
return compatReport.exitCode();
|
|
279
|
+
}
|
|
280
|
+
}
|
|
239
281
|
const cache = await core_1.Cache.find(configuration, { immutable: immutableCache, check: this.checkCache });
|
|
240
282
|
if (!workspace)
|
|
241
283
|
throw new cli_1.WorkspaceRequiredError(project.cwd, this.context.cwd);
|
|
@@ -253,15 +295,15 @@ class YarnCommand extends cli_1.BaseCommand {
|
|
|
253
295
|
// install logic should be implemented elsewhere (probably in either of
|
|
254
296
|
// the Configuration and Install classes). Feel free to open an issue
|
|
255
297
|
// in order to ask for design feedback before writing features.
|
|
256
|
-
|
|
257
|
-
configuration,
|
|
298
|
+
return await project.installWithNewReport({
|
|
258
299
|
json: this.json,
|
|
259
300
|
stdout: this.context.stdout,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
301
|
+
}, {
|
|
302
|
+
cache,
|
|
303
|
+
immutable,
|
|
304
|
+
checkResolutions,
|
|
305
|
+
mode: this.mode,
|
|
263
306
|
});
|
|
264
|
-
return report.exitCode();
|
|
265
307
|
}
|
|
266
308
|
}
|
|
267
309
|
YarnCommand.paths = [
|
|
@@ -399,24 +441,25 @@ async function autofixLegacyPlugins(configuration, immutable) {
|
|
|
399
441
|
return false;
|
|
400
442
|
const legacyPlugins = [];
|
|
401
443
|
const yarnPluginDir = fslib_1.ppath.join(configuration.projectCwd, `.yarn/plugins/@yarnpkg`);
|
|
402
|
-
const changed = await core_1.Configuration.updateConfiguration(configuration.projectCwd,
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
444
|
+
const changed = await core_1.Configuration.updateConfiguration(configuration.projectCwd, {
|
|
445
|
+
plugins: plugins => {
|
|
446
|
+
if (!Array.isArray(plugins))
|
|
447
|
+
return plugins;
|
|
448
|
+
const filteredPlugins = plugins.filter((plugin) => {
|
|
449
|
+
if (!plugin.path)
|
|
450
|
+
return true;
|
|
451
|
+
const resolvedPath = fslib_1.ppath.resolve(configuration.projectCwd, plugin.path);
|
|
452
|
+
const isLegacy = core_1.LEGACY_PLUGINS.has(plugin.spec) && fslib_1.ppath.contains(yarnPluginDir, resolvedPath);
|
|
453
|
+
if (isLegacy)
|
|
454
|
+
legacyPlugins.push(resolvedPath);
|
|
455
|
+
return !isLegacy;
|
|
456
|
+
});
|
|
457
|
+
if (filteredPlugins.length === 0)
|
|
458
|
+
return core_1.Configuration.deleteProperty;
|
|
459
|
+
if (filteredPlugins.length === plugins.length)
|
|
460
|
+
return plugins;
|
|
461
|
+
return filteredPlugins;
|
|
462
|
+
},
|
|
420
463
|
}, {
|
|
421
464
|
immutable,
|
|
422
465
|
});
|
package/lib/commands/link.js
CHANGED
|
@@ -68,13 +68,11 @@ class LinkCommand extends cli_1.BaseCommand {
|
|
|
68
68
|
reference: `portal:${target}`,
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
configuration,
|
|
71
|
+
return await project.installWithNewReport({
|
|
73
72
|
stdout: this.context.stdout,
|
|
74
|
-
},
|
|
75
|
-
|
|
73
|
+
}, {
|
|
74
|
+
cache,
|
|
76
75
|
});
|
|
77
|
-
return report.exitCode();
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
78
|
LinkCommand.paths = [
|
|
@@ -28,18 +28,19 @@ class PluginRemoveCommand extends cli_1.BaseCommand {
|
|
|
28
28
|
await fslib_1.xfs.removePromise(absolutePath);
|
|
29
29
|
}
|
|
30
30
|
report.reportInfo(core_1.MessageName.UNNAMED, `Updating the configuration...`);
|
|
31
|
-
await core_1.Configuration.updateConfiguration(project.cwd,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
await core_1.Configuration.updateConfiguration(project.cwd, {
|
|
32
|
+
plugins: plugins => {
|
|
33
|
+
if (!Array.isArray(plugins))
|
|
34
|
+
return plugins;
|
|
35
|
+
const filteredPlugins = plugins.filter((plugin) => {
|
|
36
|
+
return plugin.path !== relativePath;
|
|
37
|
+
});
|
|
38
|
+
if (filteredPlugins.length === 0)
|
|
39
|
+
return core_1.Configuration.deleteProperty;
|
|
40
|
+
if (filteredPlugins.length === plugins.length)
|
|
41
|
+
return plugins;
|
|
42
|
+
return filteredPlugins;
|
|
43
|
+
},
|
|
43
44
|
});
|
|
44
45
|
});
|
|
45
46
|
return report.exitCode();
|
package/lib/commands/rebuild.js
CHANGED
|
@@ -30,20 +30,20 @@ class RebuildCommand extends cli_1.BaseCommand {
|
|
|
30
30
|
for (const pkg of project.storedPackages.values()) {
|
|
31
31
|
if (filteredIdents.has(pkg.identHash)) {
|
|
32
32
|
project.storedBuildState.delete(pkg.locatorHash);
|
|
33
|
+
project.skippedBuilds.delete(pkg.locatorHash);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
else {
|
|
37
38
|
project.storedBuildState.clear();
|
|
39
|
+
project.skippedBuilds.clear();
|
|
38
40
|
}
|
|
39
|
-
|
|
40
|
-
configuration,
|
|
41
|
+
return await project.installWithNewReport({
|
|
41
42
|
stdout: this.context.stdout,
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
43
|
+
quiet: this.context.quiet,
|
|
44
|
+
}, {
|
|
45
|
+
cache,
|
|
45
46
|
});
|
|
46
|
-
return installReport.exitCode();
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
RebuildCommand.paths = [
|
package/lib/commands/remove.js
CHANGED
|
@@ -92,13 +92,12 @@ class RemoveCommand extends cli_1.BaseCommand {
|
|
|
92
92
|
throw new clipanion_1.UsageError(`${patterns} ${core_1.formatUtils.prettyList(configuration, unreferencedPatterns, core_1.formatUtils.Type.CODE)} ${dont} match any packages referenced by ${which} workspace`);
|
|
93
93
|
if (hasChanged) {
|
|
94
94
|
await configuration.triggerMultipleHooks((hooks) => hooks.afterWorkspaceDependencyRemoval, afterWorkspaceDependencyRemovalList);
|
|
95
|
-
|
|
96
|
-
configuration,
|
|
95
|
+
return await project.installWithNewReport({
|
|
97
96
|
stdout: this.context.stdout,
|
|
98
|
-
},
|
|
99
|
-
|
|
97
|
+
}, {
|
|
98
|
+
cache,
|
|
99
|
+
mode: this.mode,
|
|
100
100
|
});
|
|
101
|
-
return report.exitCode();
|
|
102
101
|
}
|
|
103
102
|
return 0;
|
|
104
103
|
}
|
|
@@ -28,13 +28,11 @@ class SetResolutionCommand extends cli_1.BaseCommand {
|
|
|
28
28
|
project.storedDescriptors.set(fromDescriptor.descriptorHash, fromDescriptor);
|
|
29
29
|
project.storedDescriptors.set(toDescriptor.descriptorHash, toDescriptor);
|
|
30
30
|
project.resolutionAliases.set(fromDescriptor.descriptorHash, toDescriptor.descriptorHash);
|
|
31
|
-
|
|
32
|
-
configuration,
|
|
31
|
+
return await project.installWithNewReport({
|
|
33
32
|
stdout: this.context.stdout,
|
|
34
|
-
},
|
|
35
|
-
|
|
33
|
+
}, {
|
|
34
|
+
cache,
|
|
36
35
|
});
|
|
37
|
-
return report.exitCode();
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
38
|
SetResolutionCommand.paths = [
|
|
@@ -27,10 +27,11 @@ const cloneWorkflow = ({ repository, branch }, target) => [
|
|
|
27
27
|
const updateWorkflow = ({ branch }) => [
|
|
28
28
|
[`git`, `fetch`, `origin`, `--depth=1`, getBranchRef(branch), `--force`],
|
|
29
29
|
[`git`, `reset`, `--hard`, `FETCH_HEAD`],
|
|
30
|
-
[`git`, `clean`, `-dfx`],
|
|
30
|
+
[`git`, `clean`, `-dfx`, `-e`, `packages/yarnpkg-cli/bundles`],
|
|
31
31
|
];
|
|
32
|
-
const buildWorkflow = ({ plugins, noMinify }, target) => [
|
|
32
|
+
const buildWorkflow = ({ plugins, noMinify }, output, target) => [
|
|
33
33
|
[`yarn`, `build:cli`, ...new Array().concat(...plugins.map(plugin => [`--plugin`, fslib_1.ppath.resolve(target, plugin)])), ...noMinify ? [`--no-minify`] : [], `|`],
|
|
34
|
+
[`mv`, `packages/yarnpkg-cli/bundles/yarn.js`, fslib_1.npath.fromPortablePath(output), `|`],
|
|
34
35
|
];
|
|
35
36
|
// eslint-disable-next-line arca/no-default-export
|
|
36
37
|
class SetVersionSourcesCommand extends cli_1.BaseCommand {
|
|
@@ -48,6 +49,9 @@ class SetVersionSourcesCommand extends cli_1.BaseCommand {
|
|
|
48
49
|
this.plugins = clipanion_1.Option.Array(`--plugin`, [], {
|
|
49
50
|
description: `An array of additional plugins that should be included in the bundle`,
|
|
50
51
|
});
|
|
52
|
+
this.dryRun = clipanion_1.Option.Boolean(`-n,--dry-run`, false, {
|
|
53
|
+
description: `If set, the bundle will be built but not added to the project`,
|
|
54
|
+
});
|
|
51
55
|
this.noMinify = clipanion_1.Option.Boolean(`--no-minify`, false, {
|
|
52
56
|
description: `Build a bundle for development (debugging) - non-minified and non-mangled`,
|
|
53
57
|
});
|
|
@@ -72,15 +76,20 @@ class SetVersionSourcesCommand extends cli_1.BaseCommand {
|
|
|
72
76
|
report.reportSeparator();
|
|
73
77
|
report.reportInfo(core_1.MessageName.UNNAMED, `Building a fresh bundle`);
|
|
74
78
|
report.reportSeparator();
|
|
75
|
-
await
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
const commitHash = await core_1.execUtils.execvp(`git`, [`rev-parse`, `--short`, `HEAD`], { cwd: target, strict: true });
|
|
80
|
+
const bundlePath = fslib_1.ppath.join(target, `packages/yarnpkg-cli/bundles/yarn-${commitHash.stdout.trim()}.js`);
|
|
81
|
+
if (!fslib_1.xfs.existsSync(bundlePath)) {
|
|
82
|
+
await runWorkflow(buildWorkflow(this, bundlePath, target), { configuration, context: this.context, target });
|
|
83
|
+
report.reportSeparator();
|
|
84
|
+
}
|
|
78
85
|
const bundleBuffer = await fslib_1.xfs.readFilePromise(bundlePath);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
if (!this.dryRun) {
|
|
87
|
+
const { bundleVersion } = await (0, version_1.setVersion)(configuration, null, async () => bundleBuffer, {
|
|
88
|
+
report,
|
|
89
|
+
});
|
|
90
|
+
if (!this.skipPlugins) {
|
|
91
|
+
await updatePlugins(this, bundleVersion, { project, report, target });
|
|
92
|
+
}
|
|
84
93
|
}
|
|
85
94
|
});
|
|
86
95
|
return report.exitCode();
|
|
@@ -141,7 +150,7 @@ async function prepareRepo(spec, { configuration, report, target }) {
|
|
|
141
150
|
await runWorkflow(updateWorkflow(spec), { configuration, context: spec.context, target });
|
|
142
151
|
ready = true;
|
|
143
152
|
}
|
|
144
|
-
catch
|
|
153
|
+
catch {
|
|
145
154
|
report.reportSeparator();
|
|
146
155
|
report.reportWarning(core_1.MessageName.UNNAMED, `Repository update failed; we'll try to regenerate it`);
|
|
147
156
|
}
|
|
@@ -170,7 +170,7 @@ async function setVersion(configuration, bundleVersion, fetchBuffer, { report, u
|
|
|
170
170
|
await fslib_1.xfs.writeFilePromise(temporaryPath, bundleBuffer);
|
|
171
171
|
const { stdout } = await core_2.execUtils.execvp(process.execPath, [fslib_1.npath.fromPortablePath(temporaryPath), `--version`], {
|
|
172
172
|
cwd: tmpDir,
|
|
173
|
-
env: { ...
|
|
173
|
+
env: { ...configuration.env, YARN_IGNORE_PATH: `1` },
|
|
174
174
|
});
|
|
175
175
|
bundleVersion = stdout.trim();
|
|
176
176
|
if (!semver_1.default.valid(bundleVersion)) {
|
package/lib/commands/unlink.js
CHANGED
|
@@ -63,13 +63,12 @@ class UnlinkCommand extends cli_1.BaseCommand {
|
|
|
63
63
|
topLevelWorkspace.manifest.resolutions = topLevelWorkspace.manifest.resolutions.filter(({ pattern }) => {
|
|
64
64
|
return !workspacesToUnlink.has(pattern.descriptor.fullName);
|
|
65
65
|
});
|
|
66
|
-
|
|
67
|
-
configuration,
|
|
66
|
+
return await project.installWithNewReport({
|
|
68
67
|
stdout: this.context.stdout,
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
quiet: this.context.quiet,
|
|
69
|
+
}, {
|
|
70
|
+
cache,
|
|
71
71
|
});
|
|
72
|
-
return report.exitCode();
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
74
|
UnlinkCommand.paths = [
|
package/lib/commands/up.js
CHANGED
|
@@ -75,13 +75,11 @@ class UpCommand extends cli_1.BaseCommand {
|
|
|
75
75
|
project.storedDescriptors.delete(descriptor.descriptorHash);
|
|
76
76
|
project.storedResolutions.delete(descriptor.descriptorHash);
|
|
77
77
|
}
|
|
78
|
-
|
|
79
|
-
configuration,
|
|
78
|
+
return await project.installWithNewReport({
|
|
80
79
|
stdout: this.context.stdout,
|
|
81
|
-
},
|
|
82
|
-
|
|
80
|
+
}, {
|
|
81
|
+
cache,
|
|
83
82
|
});
|
|
84
|
-
return installReport.exitCode();
|
|
85
83
|
}
|
|
86
84
|
async executeUpClassic() {
|
|
87
85
|
var _a;
|
|
@@ -236,13 +234,12 @@ class UpCommand extends cli_1.BaseCommand {
|
|
|
236
234
|
await configuration.triggerMultipleHooks((hooks) => hooks.afterWorkspaceDependencyReplacement, afterWorkspaceDependencyReplacementList);
|
|
237
235
|
if (askedQuestions)
|
|
238
236
|
this.context.stdout.write(`\n`);
|
|
239
|
-
|
|
240
|
-
configuration,
|
|
237
|
+
return await project.installWithNewReport({
|
|
241
238
|
stdout: this.context.stdout,
|
|
242
|
-
},
|
|
243
|
-
|
|
239
|
+
}, {
|
|
240
|
+
cache,
|
|
241
|
+
mode: this.mode,
|
|
244
242
|
});
|
|
245
|
-
return installReport.exitCode();
|
|
246
243
|
}
|
|
247
244
|
}
|
|
248
245
|
UpCommand.paths = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarnpkg/plugin-essentials",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.48",
|
|
4
4
|
"stableVersion": "3.3.0",
|
|
5
5
|
"license": "BSD-2-Clause",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"./package.json": "./package.json"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@yarnpkg/fslib": "^3.0.0-rc.
|
|
13
|
-
"@yarnpkg/parsers": "^3.0.0-rc.
|
|
12
|
+
"@yarnpkg/fslib": "^3.0.0-rc.48",
|
|
13
|
+
"@yarnpkg/parsers": "^3.0.0-rc.48",
|
|
14
14
|
"ci-info": "^3.2.0",
|
|
15
15
|
"clipanion": "^3.2.1",
|
|
16
16
|
"enquirer": "^2.3.6",
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
"typanion": "^3.12.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@yarnpkg/cli": "^4.0.0-rc.
|
|
25
|
-
"@yarnpkg/core": "^4.0.0-rc.
|
|
26
|
-
"@yarnpkg/plugin-git": "^3.0.0-rc.
|
|
24
|
+
"@yarnpkg/cli": "^4.0.0-rc.48",
|
|
25
|
+
"@yarnpkg/core": "^4.0.0-rc.48",
|
|
26
|
+
"@yarnpkg/plugin-git": "^3.0.0-rc.48"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/lodash": "^4.14.136",
|
|
30
30
|
"@types/micromatch": "^4.0.1",
|
|
31
31
|
"@types/semver": "^7.1.0",
|
|
32
|
-
"@yarnpkg/cli": "^4.0.0-rc.
|
|
33
|
-
"@yarnpkg/core": "^4.0.0-rc.
|
|
34
|
-
"@yarnpkg/plugin-git": "^3.0.0-rc.
|
|
32
|
+
"@yarnpkg/cli": "^4.0.0-rc.48",
|
|
33
|
+
"@yarnpkg/core": "^4.0.0-rc.48",
|
|
34
|
+
"@yarnpkg/plugin-git": "^3.0.0-rc.48"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
|
37
37
|
"type": "git",
|
|
@@ -53,6 +53,6 @@
|
|
|
53
53
|
"/lib/**/*"
|
|
54
54
|
],
|
|
55
55
|
"engines": {
|
|
56
|
-
"node": ">=
|
|
56
|
+
"node": ">=18.12.0"
|
|
57
57
|
}
|
|
58
58
|
}
|