syncpack 9.1.2 → 9.3.2

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.
@@ -3,7 +3,7 @@ exports.__esModule = true;
3
3
  exports.fixMismatches = void 0;
4
4
  var expect_more_1 = require("expect-more");
5
5
  function fixMismatches(ctx) {
6
- ctx.versionGroups.reverse().forEach(function (versionGroup) {
6
+ ctx.versionGroups.forEach(function (versionGroup) {
7
7
  var invalidGroups = versionGroup.getInvalidInstanceGroups();
8
8
  // Nothing to do if there are no mismatches
9
9
  if (invalidGroups.length === 0)
@@ -51,19 +51,19 @@ var chalk_1 = __importDefault(require("chalk"));
51
51
  var constants_1 = require("../constants");
52
52
  var log = __importStar(require("../lib/log"));
53
53
  function lintSemverRanges(ctx) {
54
- ctx.semverGroups.reverse().forEach(function (semverGroup, i) {
54
+ var hasUserGroups = ctx.semverGroups.length > 1;
55
+ ctx.semverGroups.forEach(function (semverGroup, i) {
55
56
  // Nothing to do if there are no mismatches
56
57
  if (!semverGroup.hasMismatches())
57
58
  return;
58
59
  // Record that this project has mismatches, so that eg. the CLI can exit
59
60
  // with the correct status code.
60
61
  ctx.isInvalid = true;
62
+ // Annotate each group
63
+ hasUserGroups && log.semverGroupHeader(semverGroup, i);
61
64
  // Log each group which has mismatches
62
65
  semverGroup.getMismatches().forEach(function (_a) {
63
66
  var _b = __read(_a, 2), name = _b[0], mismatches = _b[1];
64
- // Annotate user-defined version groups
65
- if (!semverGroup.isDefault)
66
- log.semverGroupHeader(i);
67
67
  // Log the dependency name
68
68
  log.invalid(name);
69
69
  // Log each of the dependencies mismatches
@@ -35,11 +35,15 @@ var chalk_1 = __importDefault(require("chalk"));
35
35
  var constants_1 = require("../constants");
36
36
  var log = __importStar(require("../lib/log"));
37
37
  function list(ctx) {
38
- ctx.versionGroups.reverse().forEach(function (versionGroup, i) {
39
- // Annotate user-defined version groups
40
- if (!versionGroup.isDefault)
41
- log.versionGroupHeader(i);
42
- versionGroup.getAllInstanceGroups().forEach(function (instanceGroup) {
38
+ var hasUserGroups = ctx.versionGroups.length > 1;
39
+ ctx.versionGroups.forEach(function (versionGroup, i) {
40
+ var instanceGroups = versionGroup.getAllInstanceGroups();
41
+ // Nothing to do if empty
42
+ if (instanceGroups.length === 0)
43
+ return;
44
+ // Annotate each group
45
+ hasUserGroups && log.versionGroupHeader(versionGroup, i);
46
+ instanceGroups.forEach(function (instanceGroup) {
43
47
  // Record that this project has mismatches, so that eg. the CLI can exit
44
48
  // with the correct status code.
45
49
  if (instanceGroup.isInvalid())
@@ -34,7 +34,8 @@ exports.listMismatches = void 0;
34
34
  var chalk_1 = __importDefault(require("chalk"));
35
35
  var log = __importStar(require("../lib/log"));
36
36
  function listMismatches(ctx) {
37
- ctx.versionGroups.reverse().forEach(function (versionGroup, i) {
37
+ var hasUserGroups = ctx.versionGroups.length > 1;
38
+ ctx.versionGroups.forEach(function (versionGroup, i) {
38
39
  var invalidGroups = versionGroup.getInvalidInstanceGroups();
39
40
  // Nothing to do if there are no mismatches
40
41
  if (invalidGroups.length === 0)
@@ -42,9 +43,8 @@ function listMismatches(ctx) {
42
43
  // Record that this project has mismatches, so that eg. the CLI can exit
43
44
  // with the correct status code.
44
45
  ctx.isInvalid = true;
45
- // Annotate user-defined version groups
46
- if (!versionGroup.isDefault)
47
- log.versionGroupHeader(i);
46
+ // Annotate each group
47
+ hasUserGroups && log.versionGroupHeader(versionGroup, i);
48
48
  // Log the mismatches
49
49
  invalidGroups.forEach(function (instanceGroup) {
50
50
  if (versionGroup.isBanned())
@@ -2,7 +2,7 @@
2
2
  exports.__esModule = true;
3
3
  exports.setSemverRanges = void 0;
4
4
  var setSemverRanges = function (ctx) {
5
- ctx.semverGroups.reverse().forEach(function (semverGroup) {
5
+ ctx.semverGroups.forEach(function (semverGroup) {
6
6
  semverGroup.instances.forEach(function (instance) {
7
7
  instance.setVersion(semverGroup.getExpectedVersion(instance));
8
8
  });
@@ -2,5 +2,6 @@ import { z } from 'zod';
2
2
  export declare const baseGroupFields: {
3
3
  dependencies: z.ZodArray<z.ZodString, "many">;
4
4
  dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5
+ label: z.ZodDefault<z.ZodString>;
5
6
  packages: z.ZodArray<z.ZodString, "many">;
6
7
  };
@@ -5,5 +5,6 @@ var zod_1 = require("zod");
5
5
  exports.baseGroupFields = {
6
6
  dependencies: zod_1.z.array(zod_1.z.string()).min(1),
7
7
  dependencyTypes: zod_1.z.array(zod_1.z.string())["default"]([]),
8
+ label: zod_1.z.string()["default"](''),
8
9
  packages: zod_1.z.array(zod_1.z.string()).min(1)
9
10
  };