syncpack 8.5.14 → 9.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 (150) hide show
  1. package/README.md +194 -108
  2. package/dist/bin-fix-mismatches/fix-mismatches-cli.d.ts +2 -2
  3. package/dist/bin-fix-mismatches/fix-mismatches-cli.js +1 -1
  4. package/dist/bin-fix-mismatches/fix-mismatches.d.ts +2 -2
  5. package/dist/bin-fix-mismatches/fix-mismatches.js +35 -8
  6. package/dist/bin-fix-mismatches/index.js +9 -18
  7. package/dist/bin-format/format-cli.d.ts +2 -2
  8. package/dist/bin-format/format-cli.js +1 -1
  9. package/dist/bin-format/format.d.ts +2 -2
  10. package/dist/bin-format/index.js +2 -0
  11. package/dist/bin-lint-semver-ranges/index.js +10 -19
  12. package/dist/bin-lint-semver-ranges/lint-semver-ranges-cli.d.ts +2 -2
  13. package/dist/bin-lint-semver-ranges/lint-semver-ranges-cli.js +1 -1
  14. package/dist/bin-lint-semver-ranges/lint-semver-ranges.d.ts +2 -2
  15. package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +13 -14
  16. package/dist/bin-list/index.js +9 -18
  17. package/dist/bin-list/list-cli.d.ts +2 -2
  18. package/dist/bin-list/list-cli.js +1 -1
  19. package/dist/bin-list/list.d.ts +2 -2
  20. package/dist/bin-list/list.js +2 -2
  21. package/dist/bin-list-mismatches/index.js +9 -18
  22. package/dist/bin-list-mismatches/list-mismatches-cli.d.ts +2 -2
  23. package/dist/bin-list-mismatches/list-mismatches-cli.js +1 -1
  24. package/dist/bin-list-mismatches/list-mismatches.d.ts +2 -2
  25. package/dist/bin-list-mismatches/list-mismatches.js +6 -6
  26. package/dist/bin-set-semver-ranges/index.js +10 -19
  27. package/dist/bin-set-semver-ranges/set-semver-ranges-cli.d.ts +2 -2
  28. package/dist/bin-set-semver-ranges/set-semver-ranges-cli.js +1 -1
  29. package/dist/bin-set-semver-ranges/set-semver-ranges.d.ts +2 -2
  30. package/dist/constants.d.ts +11 -7
  31. package/dist/constants.js +11 -22
  32. package/dist/get-context/$R.d.ts +13 -0
  33. package/dist/get-context/$R.js +56 -0
  34. package/dist/{lib/get-context → get-context}/get-all-instances.d.ts +0 -0
  35. package/dist/{lib/get-context → get-context}/get-all-instances.js +1 -1
  36. package/dist/get-context/get-config/get-core-types.d.ts +36 -0
  37. package/dist/get-context/get-config/get-core-types.js +68 -0
  38. package/dist/get-context/get-config/get-custom-types.d.ts +4 -0
  39. package/dist/get-context/get-config/get-custom-types.js +28 -0
  40. package/dist/get-context/get-config/get-enabled-types.d.ts +4 -0
  41. package/dist/get-context/get-config/get-enabled-types.js +19 -0
  42. package/dist/get-context/get-config/index.d.ts +7 -0
  43. package/dist/get-context/get-config/index.js +115 -0
  44. package/dist/get-context/get-config/path-strategy/index.d.ts +8 -0
  45. package/dist/get-context/get-config/path-strategy/index.js +18 -0
  46. package/dist/get-context/get-config/path-strategy/lib/get-non-empty-string-prop.d.ts +4 -0
  47. package/dist/get-context/get-config/path-strategy/lib/get-non-empty-string-prop.js +11 -0
  48. package/dist/get-context/get-config/path-strategy/name-and-version-props.d.ts +2 -0
  49. package/dist/get-context/get-config/path-strategy/name-and-version-props.js +66 -0
  50. package/dist/get-context/get-config/path-strategy/name-and-version-string.d.ts +2 -0
  51. package/dist/get-context/get-config/path-strategy/name-and-version-string.js +60 -0
  52. package/dist/get-context/get-config/path-strategy/types.d.ts +15 -0
  53. package/dist/{lib/get-context/get-config/config.js → get-context/get-config/path-strategy/types.js} +0 -0
  54. package/dist/get-context/get-config/path-strategy/version-string.d.ts +2 -0
  55. package/dist/get-context/get-config/path-strategy/version-string.js +60 -0
  56. package/dist/get-context/get-config/path-strategy/versions-by-name.d.ts +2 -0
  57. package/dist/get-context/get-config/path-strategy/versions-by-name.js +39 -0
  58. package/dist/get-context/get-config/schema/base-group.d.ts +6 -0
  59. package/dist/get-context/get-config/schema/base-group.js +9 -0
  60. package/dist/get-context/get-config/schema/index.d.ts +1276 -0
  61. package/dist/get-context/get-config/schema/index.js +104 -0
  62. package/dist/get-context/get-config/schema/paths.d.ts +89 -0
  63. package/dist/get-context/get-config/schema/paths.js +33 -0
  64. package/dist/get-context/get-config/schema/semver-group.d.ts +101 -0
  65. package/dist/get-context/get-config/schema/semver-group.js +50 -0
  66. package/dist/get-context/get-config/schema/semver-range.d.ts +2 -0
  67. package/dist/get-context/get-config/schema/semver-range.js +16 -0
  68. package/dist/get-context/get-config/schema/version-group.d.ts +151 -0
  69. package/dist/get-context/get-config/schema/version-group.js +31 -0
  70. package/dist/get-context/get-groups/get-semver-groups.d.ts +4 -0
  71. package/dist/{lib/get-context → get-context}/get-groups/get-semver-groups.js +2 -1
  72. package/dist/get-context/get-groups/get-version-groups.d.ts +4 -0
  73. package/dist/{lib/get-context → get-context}/get-groups/get-version-groups.js +2 -1
  74. package/dist/{lib/get-context → get-context}/get-groups/semver-group/index.d.ts +10 -11
  75. package/dist/get-context/get-groups/semver-group/index.js +56 -0
  76. package/dist/{lib/get-context → get-context}/get-groups/version-group/index.d.ts +5 -6
  77. package/dist/{lib/get-context → get-context}/get-groups/version-group/index.js +0 -0
  78. package/dist/{lib/get-context → get-context}/get-groups/version-group/instance-group/get-highest-version.d.ts +0 -0
  79. package/dist/{lib/get-context → get-context}/get-groups/version-group/instance-group/get-highest-version.js +2 -2
  80. package/dist/{lib/get-context → get-context}/get-groups/version-group/instance-group/index.d.ts +3 -1
  81. package/dist/{lib/get-context → get-context}/get-groups/version-group/instance-group/index.js +10 -9
  82. package/dist/get-context/get-package-json-files/get-file-paths.d.ts +14 -0
  83. package/dist/get-context/get-package-json-files/get-file-paths.js +40 -0
  84. package/dist/get-context/get-package-json-files/get-patterns/get-lerna-patterns.d.ts +4 -0
  85. package/dist/get-context/get-package-json-files/get-patterns/get-lerna-patterns.js +19 -0
  86. package/dist/get-context/get-package-json-files/get-patterns/get-pnpm-patterns.d.ts +4 -0
  87. package/dist/get-context/get-package-json-files/get-patterns/get-pnpm-patterns.js +23 -0
  88. package/dist/get-context/get-package-json-files/get-patterns/get-yarn-patterns.d.ts +4 -0
  89. package/dist/get-context/get-package-json-files/get-patterns/get-yarn-patterns.js +20 -0
  90. package/dist/get-context/get-package-json-files/get-patterns/index.d.ts +11 -0
  91. package/dist/get-context/get-package-json-files/get-patterns/index.js +70 -0
  92. package/dist/get-context/get-package-json-files/get-patterns/lib/get-array-of-strings.d.ts +1 -0
  93. package/dist/get-context/get-package-json-files/get-patterns/lib/get-array-of-strings.js +10 -0
  94. package/dist/get-context/get-package-json-files/get-patterns/props.d.ts +6 -0
  95. package/dist/get-context/get-package-json-files/get-patterns/props.js +48 -0
  96. package/dist/{lib/get-context → get-context}/get-package-json-files/get-patterns/read-json-safe.d.ts +4 -3
  97. package/dist/get-context/get-package-json-files/get-patterns/read-json-safe.js +20 -0
  98. package/dist/get-context/get-package-json-files/get-patterns/read-yaml-safe.d.ts +4 -0
  99. package/dist/get-context/get-package-json-files/get-patterns/read-yaml-safe.js +11 -0
  100. package/dist/get-context/get-package-json-files/index.d.ts +5 -0
  101. package/dist/get-context/get-package-json-files/index.js +16 -0
  102. package/dist/{lib/get-context → get-context}/get-package-json-files/package-json-file/index.d.ts +7 -6
  103. package/dist/{lib/get-context → get-context}/get-package-json-files/package-json-file/index.js +28 -38
  104. package/dist/{lib/get-context → get-context}/get-package-json-files/package-json-file/instance.d.ts +6 -6
  105. package/dist/get-context/get-package-json-files/package-json-file/instance.js +62 -0
  106. package/dist/{lib/get-context → get-context}/index.d.ts +4 -5
  107. package/dist/{lib/get-context → get-context}/index.js +1 -1
  108. package/dist/lib/disk.d.ts +11 -11
  109. package/dist/lib/error.d.ts +12 -0
  110. package/dist/lib/error.js +43 -0
  111. package/dist/lib/exit-if-invalid.d.ts +2 -2
  112. package/dist/lib/is-semver.d.ts +2 -2
  113. package/dist/lib/set-semver-range.d.ts +2 -2
  114. package/dist/lib/show-help-on-error.d.ts +2 -0
  115. package/dist/lib/show-help-on-error.js +16 -0
  116. package/dist/lib/write-if-changed.d.ts +2 -2
  117. package/dist/option.d.ts +4 -10
  118. package/dist/option.js +6 -16
  119. package/dist/types.d.ts +88 -0
  120. package/dist/{lib/get-context/get-config/internal-config.js → types.js} +0 -0
  121. package/package.json +4 -3
  122. package/dist/lib/get-context/get-config/config.d.ts +0 -151
  123. package/dist/lib/get-context/get-config/index.d.ts +0 -8
  124. package/dist/lib/get-context/get-config/index.js +0 -160
  125. package/dist/lib/get-context/get-config/internal-config.d.ts +0 -24
  126. package/dist/lib/get-context/get-groups/get-semver-groups.d.ts +0 -4
  127. package/dist/lib/get-context/get-groups/get-version-groups.d.ts +0 -4
  128. package/dist/lib/get-context/get-groups/semver-group/index.js +0 -33
  129. package/dist/lib/get-context/get-package-json-files/get-file-paths.d.ts +0 -12
  130. package/dist/lib/get-context/get-package-json-files/get-file-paths.js +0 -55
  131. package/dist/lib/get-context/get-package-json-files/get-patterns/get-lerna-patterns.d.ts +0 -3
  132. package/dist/lib/get-context/get-package-json-files/get-patterns/get-lerna-patterns.js +0 -40
  133. package/dist/lib/get-context/get-package-json-files/get-patterns/get-pnpm-patterns.d.ts +0 -3
  134. package/dist/lib/get-context/get-package-json-files/get-patterns/get-pnpm-patterns.js +0 -45
  135. package/dist/lib/get-context/get-package-json-files/get-patterns/get-yarn-patterns.d.ts +0 -3
  136. package/dist/lib/get-context/get-package-json-files/get-patterns/get-yarn-patterns.js +0 -46
  137. package/dist/lib/get-context/get-package-json-files/get-patterns/index.d.ts +0 -10
  138. package/dist/lib/get-context/get-package-json-files/get-patterns/index.js +0 -79
  139. package/dist/lib/get-context/get-package-json-files/get-patterns/props.d.ts +0 -7
  140. package/dist/lib/get-context/get-package-json-files/get-patterns/props.js +0 -43
  141. package/dist/lib/get-context/get-package-json-files/get-patterns/read-json-safe.js +0 -41
  142. package/dist/lib/get-context/get-package-json-files/get-patterns/read-yaml-safe.d.ts +0 -3
  143. package/dist/lib/get-context/get-package-json-files/get-patterns/read-yaml-safe.js +0 -34
  144. package/dist/lib/get-context/get-package-json-files/index.d.ts +0 -5
  145. package/dist/lib/get-context/get-package-json-files/index.js +0 -40
  146. package/dist/lib/get-context/get-package-json-files/package-json-file/instance.js +0 -46
  147. package/dist/lib/get-context/get-package-json-files/tap.d.ts +0 -15
  148. package/dist/lib/get-context/get-package-json-files/tap.js +0 -56
  149. package/dist/lib/get-context/get-package-json-files/try-catch.d.ts +0 -5
  150. package/dist/lib/get-context/get-package-json-files/try-catch.js +0 -13
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __read = (this && this.__read) || function (o, n) {
37
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
38
+ if (!m) return o;
39
+ var i = m.call(o), r, ar = [], e;
40
+ try {
41
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
42
+ }
43
+ catch (error) { e = { error: error }; }
44
+ finally {
45
+ try {
46
+ if (r && !r.done && (m = i["return"])) m.call(i);
47
+ }
48
+ finally { if (e) throw e.error; }
49
+ }
50
+ return ar;
51
+ };
52
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
53
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
54
+ if (ar || !(i in from)) {
55
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
56
+ ar[i] = from[i];
57
+ }
58
+ }
59
+ return to.concat(ar || Array.prototype.slice.call(from));
60
+ };
61
+ exports.__esModule = true;
62
+ exports.Public = exports.Cli = exports.SyncpackRc = exports.Private = void 0;
63
+ var zod_1 = require("zod");
64
+ var constants_1 = require("../../../constants");
65
+ var paths = __importStar(require("./paths"));
66
+ var semverGroup = __importStar(require("./semver-group"));
67
+ var semverRange = __importStar(require("./semver-range"));
68
+ var versionGroup = __importStar(require("./version-group"));
69
+ var nonEmptyString = zod_1.z.string().trim().min(1);
70
+ var cliOnly = {
71
+ configPath: zod_1.z.string().optional(),
72
+ types: zod_1.z.string()["default"]('')
73
+ };
74
+ var syncpackRcOnly = {
75
+ customTypes: paths.pathConfigByName.optional(),
76
+ dependencyTypes: zod_1.z.array(nonEmptyString)["default"]([]),
77
+ semverGroups: zod_1.z
78
+ .array(semverGroup.any)["default"](__spreadArray([], __read(constants_1.DEFAULT_CONFIG.semverGroups), false)),
79
+ sortAz: zod_1.z.array(nonEmptyString)["default"](__spreadArray([], __read(constants_1.DEFAULT_CONFIG.sortAz), false)),
80
+ sortFirst: zod_1.z.array(nonEmptyString)["default"](__spreadArray([], __read(constants_1.DEFAULT_CONFIG.sortFirst), false)),
81
+ versionGroups: zod_1.z
82
+ .array(versionGroup.any)["default"](__spreadArray([], __read(constants_1.DEFAULT_CONFIG.versionGroups), false))
83
+ };
84
+ var cliAndRcFile = {
85
+ filter: nonEmptyString["default"](constants_1.DEFAULT_CONFIG.filter),
86
+ indent: zod_1.z.string()["default"](constants_1.DEFAULT_CONFIG.indent),
87
+ semverRange: semverRange.value["default"](constants_1.DEFAULT_CONFIG.semverRange),
88
+ source: zod_1.z.array(nonEmptyString)["default"](__spreadArray([], __read(constants_1.DEFAULT_CONFIG.source), false))
89
+ };
90
+ var privateOnly = {
91
+ allTypes: zod_1.z.array(paths.pathDefinition),
92
+ enabledTypes: zod_1.z.array(paths.pathDefinition),
93
+ defaultSemverGroup: semverGroup.base,
94
+ defaultVersionGroup: versionGroup.base
95
+ };
96
+ exports.Private = zod_1.z.object(__assign(__assign(__assign(__assign({}, privateOnly), cliOnly), syncpackRcOnly), cliAndRcFile));
97
+ exports.SyncpackRc = zod_1.z.object(__assign(__assign({}, syncpackRcOnly), cliAndRcFile));
98
+ exports.Cli = zod_1.z.object(__assign(__assign({}, cliOnly), cliAndRcFile));
99
+ exports.Public = exports.Private.omit({
100
+ allTypes: true,
101
+ enabledTypes: true,
102
+ defaultSemverGroup: true,
103
+ defaultVersionGroup: true
104
+ });
@@ -0,0 +1,89 @@
1
+ import { z } from 'zod';
2
+ /** config */
3
+ export declare const pathConfigByName: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"strategy", [z.ZodObject<{
4
+ namePath: z.ZodString;
5
+ path: z.ZodString;
6
+ strategy: z.ZodLiteral<"name~version">;
7
+ }, "strip", z.ZodTypeAny, {
8
+ strategy: "name~version";
9
+ namePath: string;
10
+ path: string;
11
+ }, {
12
+ strategy: "name~version";
13
+ namePath: string;
14
+ path: string;
15
+ }>, z.ZodObject<{
16
+ path: z.ZodString;
17
+ strategy: z.ZodLiteral<"name@version">;
18
+ }, "strip", z.ZodTypeAny, {
19
+ strategy: "name@version";
20
+ path: string;
21
+ }, {
22
+ strategy: "name@version";
23
+ path: string;
24
+ }>, z.ZodObject<{
25
+ path: z.ZodString;
26
+ strategy: z.ZodLiteral<"version">;
27
+ }, "strip", z.ZodTypeAny, {
28
+ strategy: "version";
29
+ path: string;
30
+ }, {
31
+ strategy: "version";
32
+ path: string;
33
+ }>, z.ZodObject<{
34
+ path: z.ZodString;
35
+ strategy: z.ZodLiteral<"versionsByName">;
36
+ }, "strip", z.ZodTypeAny, {
37
+ strategy: "versionsByName";
38
+ path: string;
39
+ }, {
40
+ strategy: "versionsByName";
41
+ path: string;
42
+ }>]>>;
43
+ /** private */
44
+ export declare const pathDefinition: z.ZodIntersection<z.ZodDiscriminatedUnion<"strategy", [z.ZodObject<{
45
+ namePath: z.ZodString;
46
+ path: z.ZodString;
47
+ strategy: z.ZodLiteral<"name~version">;
48
+ }, "strip", z.ZodTypeAny, {
49
+ strategy: "name~version";
50
+ namePath: string;
51
+ path: string;
52
+ }, {
53
+ strategy: "name~version";
54
+ namePath: string;
55
+ path: string;
56
+ }>, z.ZodObject<{
57
+ path: z.ZodString;
58
+ strategy: z.ZodLiteral<"name@version">;
59
+ }, "strip", z.ZodTypeAny, {
60
+ strategy: "name@version";
61
+ path: string;
62
+ }, {
63
+ strategy: "name@version";
64
+ path: string;
65
+ }>, z.ZodObject<{
66
+ path: z.ZodString;
67
+ strategy: z.ZodLiteral<"version">;
68
+ }, "strip", z.ZodTypeAny, {
69
+ strategy: "version";
70
+ path: string;
71
+ }, {
72
+ strategy: "version";
73
+ path: string;
74
+ }>, z.ZodObject<{
75
+ path: z.ZodString;
76
+ strategy: z.ZodLiteral<"versionsByName">;
77
+ }, "strip", z.ZodTypeAny, {
78
+ strategy: "versionsByName";
79
+ path: string;
80
+ }, {
81
+ strategy: "versionsByName";
82
+ path: string;
83
+ }>]>, z.ZodObject<{
84
+ name: z.ZodString;
85
+ }, "strip", z.ZodTypeAny, {
86
+ name: string;
87
+ }, {
88
+ name: string;
89
+ }>>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.pathDefinition = exports.pathConfigByName = void 0;
4
+ var zod_1 = require("zod");
5
+ var namedVersionString = zod_1.z.object({
6
+ path: zod_1.z.string(),
7
+ strategy: zod_1.z.literal('name@version')
8
+ });
9
+ var nameAndVersionStrings = zod_1.z.object({
10
+ namePath: zod_1.z.string(),
11
+ path: zod_1.z.string(),
12
+ strategy: zod_1.z.literal('name~version')
13
+ });
14
+ var unnamedVersionString = zod_1.z.object({
15
+ path: zod_1.z.string(),
16
+ strategy: zod_1.z.literal('version')
17
+ });
18
+ var versionsByName = zod_1.z.object({
19
+ path: zod_1.z.string(),
20
+ strategy: zod_1.z.literal('versionsByName')
21
+ });
22
+ var pathConfig = zod_1.z.discriminatedUnion('strategy', [
23
+ nameAndVersionStrings,
24
+ namedVersionString,
25
+ unnamedVersionString,
26
+ versionsByName,
27
+ ]);
28
+ /** config */
29
+ exports.pathConfigByName = zod_1.z.record(pathConfig);
30
+ /** private */
31
+ exports.pathDefinition = pathConfig.and(zod_1.z.object({
32
+ name: zod_1.z.string().trim().min(1)
33
+ }));
@@ -0,0 +1,101 @@
1
+ import { z } from 'zod';
2
+ export declare const ignored: z.ZodObject<{
3
+ isIgnored: z.ZodLiteral<true>;
4
+ dependencies: z.ZodArray<z.ZodString, "many">;
5
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6
+ packages: z.ZodArray<z.ZodString, "many">;
7
+ }, "strict", z.ZodTypeAny, {
8
+ dependencies: string[];
9
+ isIgnored: true;
10
+ dependencyTypes: string[];
11
+ packages: string[];
12
+ }, {
13
+ dependencyTypes?: string[] | undefined;
14
+ dependencies: string[];
15
+ isIgnored: true;
16
+ packages: string[];
17
+ }>;
18
+ export declare const withRange: z.ZodObject<{
19
+ range: z.ZodEnum<["*", "", ">", ">=", ".x", "<", "<=", "^", "~"]>;
20
+ dependencies: z.ZodArray<z.ZodString, "many">;
21
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
22
+ packages: z.ZodArray<z.ZodString, "many">;
23
+ }, "strict", z.ZodTypeAny, {
24
+ dependencies: string[];
25
+ dependencyTypes: string[];
26
+ packages: string[];
27
+ range: "" | "*" | ">" | ">=" | ".x" | "<" | "<=" | "^" | "~";
28
+ }, {
29
+ dependencyTypes?: string[] | undefined;
30
+ dependencies: string[];
31
+ packages: string[];
32
+ range: "" | "*" | ">" | ">=" | ".x" | "<" | "<=" | "^" | "~";
33
+ }>;
34
+ export declare const base: z.ZodObject<{
35
+ range: z.ZodEnum<["*", "", ">", ">=", ".x", "<", "<=", "^", "~"]>;
36
+ isDefault: z.ZodLiteral<true>;
37
+ dependencies: z.ZodArray<z.ZodString, "many">;
38
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
39
+ packages: z.ZodArray<z.ZodString, "many">;
40
+ }, "strict", z.ZodTypeAny, {
41
+ isDefault: true;
42
+ dependencies: string[];
43
+ dependencyTypes: string[];
44
+ packages: string[];
45
+ range: "" | "*" | ">" | ">=" | ".x" | "<" | "<=" | "^" | "~";
46
+ }, {
47
+ dependencyTypes?: string[] | undefined;
48
+ isDefault: true;
49
+ dependencies: string[];
50
+ packages: string[];
51
+ range: "" | "*" | ">" | ">=" | ".x" | "<" | "<=" | "^" | "~";
52
+ }>;
53
+ export declare const any: z.ZodUnion<[z.ZodObject<{
54
+ isIgnored: z.ZodLiteral<true>;
55
+ dependencies: z.ZodArray<z.ZodString, "many">;
56
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
57
+ packages: z.ZodArray<z.ZodString, "many">;
58
+ }, "strict", z.ZodTypeAny, {
59
+ dependencies: string[];
60
+ isIgnored: true;
61
+ dependencyTypes: string[];
62
+ packages: string[];
63
+ }, {
64
+ dependencyTypes?: string[] | undefined;
65
+ dependencies: string[];
66
+ isIgnored: true;
67
+ packages: string[];
68
+ }>, z.ZodObject<{
69
+ range: z.ZodEnum<["*", "", ">", ">=", ".x", "<", "<=", "^", "~"]>;
70
+ dependencies: z.ZodArray<z.ZodString, "many">;
71
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
72
+ packages: z.ZodArray<z.ZodString, "many">;
73
+ }, "strict", z.ZodTypeAny, {
74
+ dependencies: string[];
75
+ dependencyTypes: string[];
76
+ packages: string[];
77
+ range: "" | "*" | ">" | ">=" | ".x" | "<" | "<=" | "^" | "~";
78
+ }, {
79
+ dependencyTypes?: string[] | undefined;
80
+ dependencies: string[];
81
+ packages: string[];
82
+ range: "" | "*" | ">" | ">=" | ".x" | "<" | "<=" | "^" | "~";
83
+ }>, z.ZodObject<{
84
+ range: z.ZodEnum<["*", "", ">", ">=", ".x", "<", "<=", "^", "~"]>;
85
+ isDefault: z.ZodLiteral<true>;
86
+ dependencies: z.ZodArray<z.ZodString, "many">;
87
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
88
+ packages: z.ZodArray<z.ZodString, "many">;
89
+ }, "strict", z.ZodTypeAny, {
90
+ isDefault: true;
91
+ dependencies: string[];
92
+ dependencyTypes: string[];
93
+ packages: string[];
94
+ range: "" | "*" | ">" | ">=" | ".x" | "<" | "<=" | "^" | "~";
95
+ }, {
96
+ dependencyTypes?: string[] | undefined;
97
+ isDefault: true;
98
+ dependencies: string[];
99
+ packages: string[];
100
+ range: "" | "*" | ">" | ">=" | ".x" | "<" | "<=" | "^" | "~";
101
+ }>]>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ exports.__esModule = true;
37
+ exports.any = exports.base = exports.withRange = exports.ignored = void 0;
38
+ var zod_1 = require("zod");
39
+ var base_group_1 = require("./base-group");
40
+ var SemverRangeSchema = __importStar(require("./semver-range"));
41
+ exports.ignored = zod_1.z
42
+ .object(__assign(__assign({}, base_group_1.baseGroupFields), { isIgnored: zod_1.z.literal(true) }))
43
+ .strict();
44
+ exports.withRange = zod_1.z
45
+ .object(__assign(__assign({}, base_group_1.baseGroupFields), { range: SemverRangeSchema.value }))
46
+ .strict();
47
+ exports.base = zod_1.z
48
+ .object(__assign(__assign({}, base_group_1.baseGroupFields), { range: SemverRangeSchema.value, isDefault: zod_1.z.literal(true) }))
49
+ .strict();
50
+ exports.any = zod_1.z.union([exports.ignored, exports.withRange, exports.base]);
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const value: z.ZodEnum<["*", "", ">", ">=", ".x", "<", "<=", "^", "~"]>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.value = void 0;
4
+ var zod_1 = require("zod");
5
+ var constants_1 = require("../../../constants");
6
+ exports.value = zod_1.z["enum"]([
7
+ constants_1.RANGE.ANY,
8
+ constants_1.RANGE.EXACT,
9
+ constants_1.RANGE.GT,
10
+ constants_1.RANGE.GTE,
11
+ constants_1.RANGE.LOOSE,
12
+ constants_1.RANGE.LT,
13
+ constants_1.RANGE.LTE,
14
+ constants_1.RANGE.MINOR,
15
+ constants_1.RANGE.PATCH,
16
+ ]);
@@ -0,0 +1,151 @@
1
+ import { z } from 'zod';
2
+ export declare const standard: z.ZodObject<{
3
+ dependencies: z.ZodArray<z.ZodString, "many">;
4
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5
+ packages: z.ZodArray<z.ZodString, "many">;
6
+ }, "strict", z.ZodTypeAny, {
7
+ dependencies: string[];
8
+ dependencyTypes: string[];
9
+ packages: string[];
10
+ }, {
11
+ dependencyTypes?: string[] | undefined;
12
+ dependencies: string[];
13
+ packages: string[];
14
+ }>;
15
+ export declare const banned: z.ZodObject<{
16
+ isBanned: z.ZodLiteral<true>;
17
+ dependencies: z.ZodArray<z.ZodString, "many">;
18
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
19
+ packages: z.ZodArray<z.ZodString, "many">;
20
+ }, "strict", z.ZodTypeAny, {
21
+ dependencies: string[];
22
+ dependencyTypes: string[];
23
+ packages: string[];
24
+ isBanned: true;
25
+ }, {
26
+ dependencyTypes?: string[] | undefined;
27
+ dependencies: string[];
28
+ packages: string[];
29
+ isBanned: true;
30
+ }>;
31
+ export declare const ignored: z.ZodObject<{
32
+ isIgnored: z.ZodLiteral<true>;
33
+ dependencies: z.ZodArray<z.ZodString, "many">;
34
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
35
+ packages: z.ZodArray<z.ZodString, "many">;
36
+ }, "strict", z.ZodTypeAny, {
37
+ dependencies: string[];
38
+ isIgnored: true;
39
+ dependencyTypes: string[];
40
+ packages: string[];
41
+ }, {
42
+ dependencyTypes?: string[] | undefined;
43
+ dependencies: string[];
44
+ isIgnored: true;
45
+ packages: string[];
46
+ }>;
47
+ export declare const pinned: z.ZodObject<{
48
+ pinVersion: z.ZodString;
49
+ dependencies: z.ZodArray<z.ZodString, "many">;
50
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
51
+ packages: z.ZodArray<z.ZodString, "many">;
52
+ }, "strict", z.ZodTypeAny, {
53
+ dependencies: string[];
54
+ dependencyTypes: string[];
55
+ packages: string[];
56
+ pinVersion: string;
57
+ }, {
58
+ dependencyTypes?: string[] | undefined;
59
+ dependencies: string[];
60
+ packages: string[];
61
+ pinVersion: string;
62
+ }>;
63
+ export declare const base: z.ZodObject<{
64
+ isDefault: z.ZodLiteral<true>;
65
+ dependencies: z.ZodArray<z.ZodString, "many">;
66
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
67
+ packages: z.ZodArray<z.ZodString, "many">;
68
+ }, "strict", z.ZodTypeAny, {
69
+ isDefault: true;
70
+ dependencies: string[];
71
+ dependencyTypes: string[];
72
+ packages: string[];
73
+ }, {
74
+ dependencyTypes?: string[] | undefined;
75
+ isDefault: true;
76
+ dependencies: string[];
77
+ packages: string[];
78
+ }>;
79
+ export declare const any: z.ZodUnion<[z.ZodObject<{
80
+ dependencies: z.ZodArray<z.ZodString, "many">;
81
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
82
+ packages: z.ZodArray<z.ZodString, "many">;
83
+ }, "strict", z.ZodTypeAny, {
84
+ dependencies: string[];
85
+ dependencyTypes: string[];
86
+ packages: string[];
87
+ }, {
88
+ dependencyTypes?: string[] | undefined;
89
+ dependencies: string[];
90
+ packages: string[];
91
+ }>, z.ZodObject<{
92
+ isBanned: z.ZodLiteral<true>;
93
+ dependencies: z.ZodArray<z.ZodString, "many">;
94
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
95
+ packages: z.ZodArray<z.ZodString, "many">;
96
+ }, "strict", z.ZodTypeAny, {
97
+ dependencies: string[];
98
+ dependencyTypes: string[];
99
+ packages: string[];
100
+ isBanned: true;
101
+ }, {
102
+ dependencyTypes?: string[] | undefined;
103
+ dependencies: string[];
104
+ packages: string[];
105
+ isBanned: true;
106
+ }>, z.ZodObject<{
107
+ isIgnored: z.ZodLiteral<true>;
108
+ dependencies: z.ZodArray<z.ZodString, "many">;
109
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
110
+ packages: z.ZodArray<z.ZodString, "many">;
111
+ }, "strict", z.ZodTypeAny, {
112
+ dependencies: string[];
113
+ isIgnored: true;
114
+ dependencyTypes: string[];
115
+ packages: string[];
116
+ }, {
117
+ dependencyTypes?: string[] | undefined;
118
+ dependencies: string[];
119
+ isIgnored: true;
120
+ packages: string[];
121
+ }>, z.ZodObject<{
122
+ pinVersion: z.ZodString;
123
+ dependencies: z.ZodArray<z.ZodString, "many">;
124
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
125
+ packages: z.ZodArray<z.ZodString, "many">;
126
+ }, "strict", z.ZodTypeAny, {
127
+ dependencies: string[];
128
+ dependencyTypes: string[];
129
+ packages: string[];
130
+ pinVersion: string;
131
+ }, {
132
+ dependencyTypes?: string[] | undefined;
133
+ dependencies: string[];
134
+ packages: string[];
135
+ pinVersion: string;
136
+ }>, z.ZodObject<{
137
+ isDefault: z.ZodLiteral<true>;
138
+ dependencies: z.ZodArray<z.ZodString, "many">;
139
+ dependencyTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
140
+ packages: z.ZodArray<z.ZodString, "many">;
141
+ }, "strict", z.ZodTypeAny, {
142
+ isDefault: true;
143
+ dependencies: string[];
144
+ dependencyTypes: string[];
145
+ packages: string[];
146
+ }, {
147
+ dependencyTypes?: string[] | undefined;
148
+ isDefault: true;
149
+ dependencies: string[];
150
+ packages: string[];
151
+ }>]>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ exports.__esModule = true;
14
+ exports.any = exports.base = exports.pinned = exports.ignored = exports.banned = exports.standard = void 0;
15
+ var zod_1 = require("zod");
16
+ var base_group_1 = require("./base-group");
17
+ var NonEmptyString = zod_1.z.string().trim().min(1);
18
+ exports.standard = zod_1.z.object(base_group_1.baseGroupFields).strict();
19
+ exports.banned = zod_1.z
20
+ .object(__assign(__assign({}, base_group_1.baseGroupFields), { isBanned: zod_1.z.literal(true) }))
21
+ .strict();
22
+ exports.ignored = zod_1.z
23
+ .object(__assign(__assign({}, base_group_1.baseGroupFields), { isIgnored: zod_1.z.literal(true) }))
24
+ .strict();
25
+ exports.pinned = zod_1.z
26
+ .object(__assign(__assign({}, base_group_1.baseGroupFields), { pinVersion: NonEmptyString }))
27
+ .strict();
28
+ exports.base = zod_1.z
29
+ .object(__assign(__assign({}, base_group_1.baseGroupFields), { isDefault: zod_1.z.literal(true) }))
30
+ .strict();
31
+ exports.any = zod_1.z.union([exports.standard, exports.banned, exports.ignored, exports.pinned, exports.base]);
@@ -0,0 +1,4 @@
1
+ import type { Syncpack } from '../../types';
2
+ import type { Instance } from '../get-package-json-files/package-json-file/instance';
3
+ import { SemverGroup } from './semver-group';
4
+ export declare function getSemverGroups(input: Syncpack.Config.Private, instances: Instance[]): SemverGroup[];
@@ -17,6 +17,7 @@ function getSemverGroups(input, instances) {
17
17
  var semverGroups = input.semverGroups.map(function (semverGroup) { return new semver_group_1.SemverGroup(input, semverGroup); });
18
18
  instances.forEach(function (instance) {
19
19
  var e_1, _a;
20
+ var _b;
20
21
  var name = instance.name, pkgName = instance.pkgName;
21
22
  try {
22
23
  for (var semverGroups_1 = __values(semverGroups), semverGroups_1_1 = semverGroups_1.next(); !semverGroups_1_1.done; semverGroups_1_1 = semverGroups_1.next()) {
@@ -25,7 +26,7 @@ function getSemverGroups(input, instances) {
25
26
  if (!semverGroup.instancesByName[name]) {
26
27
  semverGroup.instancesByName[name] = [];
27
28
  }
28
- semverGroup.instancesByName[name].push(instance);
29
+ (_b = semverGroup.instancesByName[name]) === null || _b === void 0 ? void 0 : _b.push(instance);
29
30
  semverGroup.instances.push(instance);
30
31
  return;
31
32
  }
@@ -0,0 +1,4 @@
1
+ import type { Syncpack } from '../../types';
2
+ import type { Instance } from '../get-package-json-files/package-json-file/instance';
3
+ import { VersionGroup } from './version-group';
4
+ export declare function getVersionGroups(input: Syncpack.Config.Private, instances: Instance[]): VersionGroup[];
@@ -34,6 +34,7 @@ function getVersionGroups(input, instances) {
34
34
  var versionGroups = input.versionGroups.map(function (versionGroup) { return new version_group_1.VersionGroup(input, versionGroup); });
35
35
  instances.forEach(function (instance) {
36
36
  var e_1, _a;
37
+ var _b;
37
38
  var name = instance.name, pkgName = instance.pkgName;
38
39
  try {
39
40
  for (var versionGroups_1 = __values(versionGroups), versionGroups_1_1 = versionGroups_1.next(); !versionGroups_1_1.done; versionGroups_1_1 = versionGroups_1.next()) {
@@ -42,7 +43,7 @@ function getVersionGroups(input, instances) {
42
43
  if (!versionGroup.instancesByName[name]) {
43
44
  versionGroup.instancesByName[name] = [];
44
45
  }
45
- versionGroup.instancesByName[name].push(instance);
46
+ (_b = versionGroup.instancesByName[name]) === null || _b === void 0 ? void 0 : _b.push(instance);
46
47
  versionGroup.instances.push(instance);
47
48
  return;
48
49
  }
@@ -1,13 +1,12 @@
1
- import type { Config, DependencyType, ValidRange } from '../../get-config/config';
2
- import type { InternalConfig } from '../../get-config/internal-config';
1
+ import type { Syncpack } from '../../../types';
3
2
  import type { Instance } from '../../get-package-json-files/package-json-file/instance';
4
3
  export declare class SemverGroup {
5
4
  /** */
6
5
  dependencies: string[];
7
- /** Optionally limit this group to dependencies of the provided types */
8
- dependencyTypes?: DependencyType[];
6
+ /** Optionally limit this group to dependencies at these named paths */
7
+ dependencyTypes: Syncpack.TypeName[];
9
8
  /** */
10
- input: InternalConfig;
9
+ input: Syncpack.Config.Private;
11
10
  /** */
12
11
  instances: Instance[];
13
12
  /** */
@@ -19,12 +18,12 @@ export declare class SemverGroup {
19
18
  /** */
20
19
  packages: string[];
21
20
  /** The semver range which dependencies in this group should use */
22
- range: ValidRange;
23
- constructor(input: InternalConfig, semverGroup: Config.SemverGroup.Any);
24
- /** Syncpack must report or fix this group's mismatches */
25
- isInvalid(): boolean;
21
+ range: Syncpack.Config.SemverRange.Value;
22
+ constructor(input: Syncpack.Config.Private, semverGroup: Syncpack.Config.SemverGroup.Any);
23
+ /** Does this `Instance` not follow the rules of this group? */
24
+ isMismatch(instance: Instance): boolean;
26
25
  /** 1+ `Instance` has a version which does not follow the rules */
27
- hasInvalidInstances(): boolean;
26
+ hasMismatches(): boolean;
28
27
  /** Get every `Instance` with a version which does not follow the rules */
29
- getInvalidInstances(): Instance[];
28
+ getMismatches(): [string, Instance[]][];
30
29
  }