@yarnpkg/plugin-essentials 4.0.0-rc.8 → 4.0.0

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.
Files changed (69) hide show
  1. package/lib/commands/add.d.ts +1 -1
  2. package/lib/commands/add.js +34 -25
  3. package/lib/commands/bin.d.ts +1 -1
  4. package/lib/commands/bin.js +1 -1
  5. package/lib/commands/cache/clean.d.ts +1 -1
  6. package/lib/commands/cache/clean.js +1 -1
  7. package/lib/commands/config/get.d.ts +2 -1
  8. package/lib/commands/config/get.js +4 -1
  9. package/lib/commands/config/set.d.ts +1 -1
  10. package/lib/commands/config/set.js +1 -1
  11. package/lib/commands/config/unset.d.ts +1 -1
  12. package/lib/commands/config/unset.js +1 -1
  13. package/lib/commands/config.d.ts +5 -3
  14. package/lib/commands/config.js +96 -39
  15. package/lib/commands/dedupe.d.ts +1 -1
  16. package/lib/commands/dedupe.js +7 -8
  17. package/lib/commands/entries/clipanion.js +1 -1
  18. package/lib/commands/entries/help.js +1 -1
  19. package/lib/commands/entries/version.js +1 -1
  20. package/lib/commands/exec.js +1 -1
  21. package/lib/commands/explain/peerRequirements.d.ts +2 -2
  22. package/lib/commands/explain/peerRequirements.js +4 -6
  23. package/lib/commands/explain.js +1 -1
  24. package/lib/commands/info.js +10 -18
  25. package/lib/commands/install.d.ts +1 -1
  26. package/lib/commands/install.js +245 -205
  27. package/lib/commands/link.d.ts +2 -2
  28. package/lib/commands/link.js +36 -32
  29. package/lib/commands/node.js +1 -1
  30. package/lib/commands/plugin/check.d.ts +8 -0
  31. package/lib/commands/plugin/check.js +61 -0
  32. package/lib/commands/plugin/import/sources.d.ts +3 -3
  33. package/lib/commands/plugin/import/sources.js +5 -5
  34. package/lib/commands/plugin/import.d.ts +5 -4
  35. package/lib/commands/plugin/import.js +15 -28
  36. package/lib/commands/plugin/list.d.ts +2 -2
  37. package/lib/commands/plugin/list.js +5 -6
  38. package/lib/commands/plugin/remove.d.ts +1 -1
  39. package/lib/commands/plugin/remove.js +14 -13
  40. package/lib/commands/plugin/runtime.d.ts +2 -2
  41. package/lib/commands/plugin/runtime.js +4 -4
  42. package/lib/commands/rebuild.d.ts +2 -2
  43. package/lib/commands/rebuild.js +10 -10
  44. package/lib/commands/remove.d.ts +1 -1
  45. package/lib/commands/remove.js +7 -8
  46. package/lib/commands/run.js +1 -1
  47. package/lib/commands/runIndex.d.ts +2 -2
  48. package/lib/commands/runIndex.js +3 -3
  49. package/lib/commands/set/resolution.d.ts +1 -1
  50. package/lib/commands/set/resolution.js +4 -6
  51. package/lib/commands/set/version/sources.d.ts +3 -2
  52. package/lib/commands/set/version/sources.js +21 -12
  53. package/lib/commands/set/version.d.ts +2 -3
  54. package/lib/commands/set/version.js +20 -16
  55. package/lib/commands/unlink.d.ts +1 -1
  56. package/lib/commands/unlink.js +7 -8
  57. package/lib/commands/up.d.ts +3 -3
  58. package/lib/commands/up.js +19 -17
  59. package/lib/commands/why.js +5 -13
  60. package/lib/commands/workspace.js +2 -5
  61. package/lib/commands/workspaces/list.d.ts +2 -1
  62. package/lib/commands/workspaces/list.js +8 -1
  63. package/lib/dedupeUtils.d.ts +3 -3
  64. package/lib/dedupeUtils.js +3 -5
  65. package/lib/index.d.ts +76 -1
  66. package/lib/index.js +40 -1
  67. package/lib/suggestUtils.d.ts +4 -4
  68. package/lib/suggestUtils.js +14 -12
  69. package/package.json +22 -17
@@ -160,11 +160,10 @@ class InfoCommand extends cli_1.BaseCommand {
160
160
  const infoTreeChildren = {};
161
161
  const infoTree = { children: infoTreeChildren };
162
162
  const fetcher = configuration.makeFetcher();
163
- const fetcherOptions = { project, fetcher, cache, checksums: project.storedChecksums, report: new core_1.ThrowReport(), cacheOptions: { skipIntegrityCheck: true }, skipIntegrityCheck: true };
163
+ const fetcherOptions = { project, fetcher, cache, checksums: project.storedChecksums, report: new core_1.ThrowReport(), cacheOptions: { skipIntegrityCheck: true } };
164
164
  const builtinInfoBuilders = [
165
165
  // Manifest fields
166
166
  async (pkg, extra, registerData) => {
167
- var _a, _b;
168
167
  if (!extra.has(`manifest`))
169
168
  return;
170
169
  const fetchResult = await fetcher.fetch(pkg, fetcherOptions);
@@ -173,28 +172,23 @@ class InfoCommand extends cli_1.BaseCommand {
173
172
  manifest = await core_1.Manifest.find(fetchResult.prefixPath, { baseFs: fetchResult.packageFs });
174
173
  }
175
174
  finally {
176
- (_a = fetchResult.releaseFs) === null || _a === void 0 ? void 0 : _a.call(fetchResult);
175
+ fetchResult.releaseFs?.();
177
176
  }
178
177
  registerData(`Manifest`, {
179
178
  [`License`]: core_1.formatUtils.tuple(core_1.formatUtils.Type.NO_HINT, manifest.license),
180
- [`Homepage`]: core_1.formatUtils.tuple(core_1.formatUtils.Type.URL, (_b = manifest.raw.homepage) !== null && _b !== void 0 ? _b : null),
179
+ [`Homepage`]: core_1.formatUtils.tuple(core_1.formatUtils.Type.URL, manifest.raw.homepage ?? null),
181
180
  });
182
181
  },
183
182
  // Cache info
184
183
  async (pkg, extra, registerData) => {
185
- var _a;
186
184
  if (!extra.has(`cache`))
187
185
  return;
188
- const cacheOptions = {
189
- mockedPackages: project.disabledLocators,
190
- unstablePackages: project.conditionalLocators,
191
- };
192
- const checksum = (_a = project.storedChecksums.get(pkg.locatorHash)) !== null && _a !== void 0 ? _a : null;
193
- const cachePath = cache.getLocatorPath(pkg, checksum, cacheOptions);
186
+ const checksum = project.storedChecksums.get(pkg.locatorHash) ?? null;
187
+ const cachePath = cache.getLocatorPath(pkg, checksum);
194
188
  let stat;
195
189
  if (cachePath !== null) {
196
190
  try {
197
- stat = fslib_1.xfs.statSync(cachePath);
191
+ stat = await fslib_1.xfs.statPromise(cachePath);
198
192
  }
199
193
  catch { }
200
194
  }
@@ -272,10 +266,9 @@ class InfoCommand extends cli_1.BaseCommand {
272
266
  }
273
267
  if (pkg.dependencies.size > 0 && !isVirtual) {
274
268
  registerData(`Dependencies`, [...pkg.dependencies.values()].map(dependency => {
275
- var _a;
276
269
  const resolutionHash = project.storedResolutions.get(dependency.descriptorHash);
277
270
  const resolution = typeof resolutionHash !== `undefined`
278
- ? (_a = project.storedPackages.get(resolutionHash)) !== null && _a !== void 0 ? _a : null
271
+ ? project.storedPackages.get(resolutionHash) ?? null
279
272
  : null;
280
273
  return core_1.formatUtils.tuple(core_1.formatUtils.Type.RESOLUTION, {
281
274
  descriptor: dependency,
@@ -285,13 +278,12 @@ class InfoCommand extends cli_1.BaseCommand {
285
278
  }
286
279
  if (pkg.peerDependencies.size > 0 && isVirtual) {
287
280
  registerData(`Peer dependencies`, [...pkg.peerDependencies.values()].map(peerDependency => {
288
- var _a, _b;
289
281
  const dependency = pkg.dependencies.get(peerDependency.identHash);
290
282
  const resolutionHash = typeof dependency !== `undefined`
291
- ? (_a = project.storedResolutions.get(dependency.descriptorHash)) !== null && _a !== void 0 ? _a : null
283
+ ? project.storedResolutions.get(dependency.descriptorHash) ?? null
292
284
  : null;
293
285
  const resolution = resolutionHash !== null
294
- ? (_b = project.storedPackages.get(resolutionHash)) !== null && _b !== void 0 ? _b : null
286
+ ? project.storedPackages.get(resolutionHash) ?? null
295
287
  : null;
296
288
  return core_1.formatUtils.tuple(core_1.formatUtils.Type.RESOLUTION, {
297
289
  descriptor: peerDependency,
@@ -308,7 +300,6 @@ class InfoCommand extends cli_1.BaseCommand {
308
300
  });
309
301
  }
310
302
  }
311
- exports.default = InfoCommand;
312
303
  InfoCommand.paths = [
313
304
  [`info`],
314
305
  ];
@@ -328,3 +319,4 @@ InfoCommand.usage = clipanion_1.Command.Usage({
328
319
  `$0 info lodash`,
329
320
  ]],
330
321
  });
322
+ exports.default = InfoCommand;
@@ -21,5 +21,5 @@ export default class YarnCommand extends BaseCommand {
21
21
  registry: string | undefined;
22
22
  silent: boolean | undefined;
23
23
  networkTimeout: string | undefined;
24
- execute(): Promise<1 | 0>;
24
+ execute(): Promise<0 | 1>;
25
25
  }